Back to Multiple platform build/check report for BioC 3.23:   simplified   long
A[B]CDEFGHIJKLMNOPQRSTUVWXYZ

This page was generated on 2025-12-16 11:34 -0500 (Tue, 16 Dec 2025).

HostnameOSArch (*)R versionInstalled pkgs
nebbiolo1Linux (Ubuntu 24.04.3 LTS)x86_64R Under development (unstable) (2025-10-20 r88955) -- "Unsuffered Consequences" 4875
kjohnson3macOS 13.7.7 Venturaarm64R Under development (unstable) (2025-11-04 r88984) -- "Unsuffered Consequences" 4583
Click on any hostname to see more info about the system (e.g. compilers)      (*) as reported by 'uname -p', except on Windows and Mac OS X

Package 253/2332HostnameOS / ArchINSTALLBUILDCHECKBUILD BIN
BufferedMatrix 1.75.0  (landing page)
Ben Bolstad
Snapshot Date: 2025-12-15 13:40 -0500 (Mon, 15 Dec 2025)
git_url: https://git.bioconductor.org/packages/BufferedMatrix
git_branch: devel
git_last_commit: ecdbf23
git_last_commit_date: 2025-10-29 09:58:55 -0500 (Wed, 29 Oct 2025)
nebbiolo1Linux (Ubuntu 24.04.3 LTS) / x86_64  OK    OK    OK  UNNEEDED, same version is already published
kjohnson3macOS 13.7.7 Ventura / arm64  OK    OK    WARNINGS    OK  UNNEEDED, same version is already published


CHECK results for BufferedMatrix on nebbiolo1

To the developers/maintainers of the BufferedMatrix package:
- Allow up to 24 hours (and sometimes 48 hours) for your latest push to git@git.bioconductor.org:packages/BufferedMatrix.git to reflect on this report. See Troubleshooting Build Report for more information.
- Use the following Renviron settings to reproduce errors and warnings.
- If 'R CMD check' started to fail recently on the Linux builder(s) over a missing dependency, add the missing dependency to 'Suggests:' in your DESCRIPTION file. See Renviron.bioc for more information.

raw results


Summary

Package: BufferedMatrix
Version: 1.75.0
Command: /home/biocbuild/bbs-3.23-bioc/R/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/home/biocbuild/bbs-3.23-bioc/R/site-library --timings BufferedMatrix_1.75.0.tar.gz
StartedAt: 2025-12-15 21:27:26 -0500 (Mon, 15 Dec 2025)
EndedAt: 2025-12-15 21:27:52 -0500 (Mon, 15 Dec 2025)
EllapsedTime: 26.1 seconds
RetCode: 0
Status:   OK  
CheckDir: BufferedMatrix.Rcheck
Warnings: 0

Command output

##############################################################################
##############################################################################
###
### Running command:
###
###   /home/biocbuild/bbs-3.23-bioc/R/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/home/biocbuild/bbs-3.23-bioc/R/site-library --timings BufferedMatrix_1.75.0.tar.gz
###
##############################################################################
##############################################################################


* using log directory ‘/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck’
* using R Under development (unstable) (2025-10-20 r88955)
* using platform: x86_64-pc-linux-gnu
* R was compiled by
    gcc (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0
    GNU Fortran (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0
* running under: Ubuntu 24.04.3 LTS
* using session charset: UTF-8
* checking for file ‘BufferedMatrix/DESCRIPTION’ ... OK
* this is package ‘BufferedMatrix’ version ‘1.75.0’
* checking package namespace information ... OK
* checking package dependencies ... OK
* checking if this is a source package ... OK
* checking if there is a namespace ... OK
* checking for hidden files and directories ... OK
* checking for portable file names ... OK
* checking for sufficient/correct file permissions ... OK
* checking whether package ‘BufferedMatrix’ can be installed ... OK
* used C compiler: ‘gcc (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0’
* checking installed package size ... OK
* checking package directory ... OK
* checking ‘build’ directory ... OK
* checking DESCRIPTION meta-information ... OK
* checking top-level files ... OK
* checking for left-over files ... OK
* checking index information ... OK
* checking package subdirectories ... OK
* checking code files for non-ASCII characters ... OK
* checking R files for syntax errors ... OK
* checking whether the package can be loaded ... OK
* checking whether the package can be loaded with stated dependencies ... OK
* checking whether the package can be unloaded cleanly ... OK
* checking whether the namespace can be loaded with stated dependencies ... OK
* checking whether the namespace can be unloaded cleanly ... OK
* checking loading without being on the library search path ... OK
* checking dependencies in R code ... OK
* checking S3 generic/method consistency ... OK
* checking replacement functions ... OK
* checking foreign function calls ... OK
* checking R code for possible problems ... OK
* checking Rd files ... NOTE
checkRd: (-1) BufferedMatrix-class.Rd:209: Lost braces; missing escapes or markup?
   209 |     $x^{power}$ elementwise of the matrix
       |        ^
prepare_Rd: createBufferedMatrix.Rd:26: Dropping empty section \keyword
prepare_Rd: createBufferedMatrix.Rd:17-18: Dropping empty section \details
prepare_Rd: createBufferedMatrix.Rd:15-16: Dropping empty section \value
prepare_Rd: createBufferedMatrix.Rd:19-20: Dropping empty section \references
prepare_Rd: createBufferedMatrix.Rd:21-22: Dropping empty section \seealso
prepare_Rd: createBufferedMatrix.Rd:23-24: Dropping empty section \examples
* checking Rd metadata ... OK
* checking Rd cross-references ... OK
* checking for missing documentation entries ... OK
* checking for code/documentation mismatches ... OK
* checking Rd \usage sections ... OK
* checking Rd contents ... OK
* checking for unstated dependencies in examples ... OK
* checking line endings in C/C++/Fortran sources/headers ... OK
* checking compiled code ... INFO
Note: information on .o files is not available
* checking sizes of PDF files under ‘inst/doc’ ...* checking files in ‘vignettes’ ... OK
* checking examples ... NONE
* checking for unstated dependencies in ‘tests’ ... OK
* checking tests ...
  Running ‘Rcodetesting.R’
  Running ‘c_code_level_tests.R’
  Running ‘objectTesting.R’
  Running ‘rawCalltesting.R’
 OK
* checking for unstated dependencies in vignettes ... OK
* checking package vignettes ... OK
* checking re-building of vignette outputs ... OK
* checking PDF version of manual ... OK
* DONE

Status: 1 NOTE
See
  ‘/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/00check.log’
for details.


Installation output

BufferedMatrix.Rcheck/00install.out

##############################################################################
##############################################################################
###
### Running command:
###
###   /home/biocbuild/bbs-3.23-bioc/R/bin/R CMD INSTALL BufferedMatrix
###
##############################################################################
##############################################################################


* installing to library ‘/home/biocbuild/bbs-3.23-bioc/R/site-library’
* installing *source* package ‘BufferedMatrix’ ...
** this is package ‘BufferedMatrix’ version ‘1.75.0’
** using staged installation
** libs
using C compiler: ‘gcc (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0’
gcc -std=gnu2x -I"/home/biocbuild/bbs-3.23-bioc/R/include" -DNDEBUG   -I/usr/local/include    -fpic  -g -O2  -Wall -Werror=format-security -c RBufferedMatrix.c -o RBufferedMatrix.o
gcc -std=gnu2x -I"/home/biocbuild/bbs-3.23-bioc/R/include" -DNDEBUG   -I/usr/local/include    -fpic  -g -O2  -Wall -Werror=format-security -c doubleBufferedMatrix.c -o doubleBufferedMatrix.o
doubleBufferedMatrix.c: In function ‘dbm_ReadOnlyMode’:
doubleBufferedMatrix.c:1580:7: warning: suggest parentheses around operand of ‘!’ or change ‘&’ to ‘&&’ or ‘!’ to ‘~’ [-Wparentheses]
 1580 |   if (!(Matrix->readonly) & setting){
      |       ^~~~~~~~~~~~~~~~~~~
doubleBufferedMatrix.c: At top level:
doubleBufferedMatrix.c:3327:12: warning: ‘sort_double’ defined but not used [-Wunused-function]
 3327 | static int sort_double(const double *a1,const double *a2){
      |            ^~~~~~~~~~~
gcc -std=gnu2x -I"/home/biocbuild/bbs-3.23-bioc/R/include" -DNDEBUG   -I/usr/local/include    -fpic  -g -O2  -Wall -Werror=format-security -c doubleBufferedMatrix_C_tests.c -o doubleBufferedMatrix_C_tests.o
gcc -std=gnu2x -I"/home/biocbuild/bbs-3.23-bioc/R/include" -DNDEBUG   -I/usr/local/include    -fpic  -g -O2  -Wall -Werror=format-security -c init_package.c -o init_package.o
gcc -std=gnu2x -shared -L/home/biocbuild/bbs-3.23-bioc/R/lib -L/usr/local/lib -o BufferedMatrix.so RBufferedMatrix.o doubleBufferedMatrix.o doubleBufferedMatrix_C_tests.o init_package.o -L/home/biocbuild/bbs-3.23-bioc/R/lib -lR
installing to /home/biocbuild/bbs-3.23-bioc/R/site-library/00LOCK-BufferedMatrix/00new/BufferedMatrix/libs
** R
** inst
** byte-compile and prepare package for lazy loading
Creating a new generic function for ‘rowMeans’ in package ‘BufferedMatrix’
Creating a new generic function for ‘rowSums’ in package ‘BufferedMatrix’
Creating a new generic function for ‘colMeans’ in package ‘BufferedMatrix’
Creating a new generic function for ‘colSums’ in package ‘BufferedMatrix’
Creating a generic function for ‘ncol’ from package ‘base’ in package ‘BufferedMatrix’
Creating a generic function for ‘nrow’ from package ‘base’ in package ‘BufferedMatrix’
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
** checking absolute paths in shared objects and dynamic libraries
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (BufferedMatrix)

Tests output

BufferedMatrix.Rcheck/tests/c_code_level_tests.Rout


R Under development (unstable) (2025-10-20 r88955) -- "Unsuffered Consequences"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(BufferedMatrix);library.dynam("BufferedMatrix", "BufferedMatrix", .libPaths());.C("dbm_c_tester",integer(1))

Attaching package: 'BufferedMatrix'

The following objects are masked from 'package:base':

    colMeans, colSums, rowMeans, rowSums

Checking dimensions
Rows: 5
Cols: 5
Buffer Rows: 1
Buffer Cols: 1

Assigning Values
0.000000 1.000000 2.000000 3.000000 4.000000 
1.000000 2.000000 3.000000 4.000000 5.000000 
2.000000 3.000000 4.000000 5.000000 6.000000 
3.000000 4.000000 5.000000 6.000000 7.000000 
4.000000 5.000000 6.000000 7.000000 8.000000 

Adding Additional Column
Checking dimensions
Rows: 5
Cols: 6
Buffer Rows: 1
Buffer Cols: 1
0.000000 1.000000 2.000000 3.000000 4.000000 0.000000 
1.000000 2.000000 3.000000 4.000000 5.000000 0.000000 
2.000000 3.000000 4.000000 5.000000 6.000000 0.000000 
3.000000 4.000000 5.000000 6.000000 7.000000 0.000000 
4.000000 5.000000 6.000000 7.000000 8.000000 0.000000 

Reassigning values
1.000000 6.000000 11.000000 16.000000 21.000000 26.000000 
2.000000 7.000000 12.000000 17.000000 22.000000 27.000000 
3.000000 8.000000 13.000000 18.000000 23.000000 28.000000 
4.000000 9.000000 14.000000 19.000000 24.000000 29.000000 
5.000000 10.000000 15.000000 20.000000 25.000000 30.000000 

Resizing Buffers
Checking dimensions
Rows: 5
Cols: 6
Buffer Rows: 3
Buffer Cols: 3
1.000000 6.000000 11.000000 16.000000 21.000000 26.000000 
2.000000 7.000000 12.000000 17.000000 22.000000 27.000000 
3.000000 8.000000 13.000000 18.000000 23.000000 28.000000 
4.000000 9.000000 14.000000 19.000000 24.000000 29.000000 
5.000000 10.000000 15.000000 20.000000 25.000000 30.000000 

Activating Row Buffer
In row mode: 1
1.000000 6.000000 11.000000 16.000000 21.000000 26.000000 
2.000000 7.000000 12.000000 17.000000 22.000000 27.000000 
3.000000 8.000000 13.000000 18.000000 23.000000 28.000000 
4.000000 9.000000 14.000000 19.000000 24.000000 29.000000 
5.000000 10.000000 15.000000 20.000000 25.000000 30.000000 

Squaring Last Column
1.000000 6.000000 11.000000 16.000000 21.000000 676.000000 
2.000000 7.000000 12.000000 17.000000 22.000000 729.000000 
3.000000 8.000000 13.000000 18.000000 23.000000 784.000000 
4.000000 9.000000 14.000000 19.000000 24.000000 841.000000 
5.000000 10.000000 15.000000 20.000000 25.000000 900.000000 

Square rooting Last Row, then turing off Row Buffer
In row mode: 0
Checking on value that should be not be in column buffer2.236068 
1.000000 6.000000 11.000000 16.000000 21.000000 676.000000 
2.000000 7.000000 12.000000 17.000000 22.000000 729.000000 
3.000000 8.000000 13.000000 18.000000 23.000000 784.000000 
4.000000 9.000000 14.000000 19.000000 24.000000 841.000000 
2.236068 3.162278 3.872983 4.472136 5.000000 30.000000 

Single Indexing. Assign each value its square
1.000000 36.000000 121.000000 256.000000 441.000000 676.000000 
4.000000 49.000000 144.000000 289.000000 484.000000 729.000000 
9.000000 64.000000 169.000000 324.000000 529.000000 784.000000 
16.000000 81.000000 196.000000 361.000000 576.000000 841.000000 
25.000000 100.000000 225.000000 400.000000 625.000000 900.000000 

Resizing Buffers Smaller
Checking dimensions
Rows: 5
Cols: 6
Buffer Rows: 1
Buffer Cols: 1
1.000000 36.000000 121.000000 256.000000 441.000000 676.000000 
4.000000 49.000000 144.000000 289.000000 484.000000 729.000000 
9.000000 64.000000 169.000000 324.000000 529.000000 784.000000 
16.000000 81.000000 196.000000 361.000000 576.000000 841.000000 
25.000000 100.000000 225.000000 400.000000 625.000000 900.000000 

Activating Row Mode.
Resizing Buffers
Checking dimensions
Rows: 5
Cols: 6
Buffer Rows: 1
Buffer Cols: 1
Activating ReadOnly Mode.
The results of assignment is: 0
Printing matrix reversed.
900.000000 625.000000 400.000000 225.000000 100.000000 25.000000 
841.000000 576.000000 361.000000 196.000000 81.000000 16.000000 
784.000000 529.000000 324.000000 169.000000 64.000000 9.000000 
729.000000 484.000000 289.000000 144.000000 49.000000 -30.000000 
676.000000 441.000000 256.000000 121.000000 -20.000000 -10.000000 

[[1]]
[1] 0

> 
> proc.time()
   user  system elapsed 
  0.236   0.053   0.278 

BufferedMatrix.Rcheck/tests/objectTesting.Rout


R Under development (unstable) (2025-10-20 r88955) -- "Unsuffered Consequences"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(BufferedMatrix);library.dynam("BufferedMatrix","BufferedMatrix", .libPaths());

Attaching package: 'BufferedMatrix'

The following objects are masked from 'package:base':

    colMeans, colSums, rowMeans, rowSums

> 
> 
> ### this is used to control how many repetitions in something below
> ### higher values result in more checks.
> nreps <-100 ##20000
> 
> 
> ## test creation and some simple assignments and subsetting operations
> 
> ## first on single elements
> tmp <- createBufferedMatrix(1000,10)
> 
> tmp[10,5]
[1] 0
> tmp[10,5] <- 10
> tmp[10,5]
[1] 10
> tmp[10,5] <- 12.445
> tmp[10,5]
[1] 12.445
> 
> 
> 
> ## now testing accessing multiple elements
> tmp2 <- createBufferedMatrix(10,20)
> 
> 
> tmp2[3,1] <- 51.34
> tmp2[9,2] <- 9.87654
> tmp2[,1:2]
       [,1]    [,2]
 [1,]  0.00 0.00000
 [2,]  0.00 0.00000
 [3,] 51.34 0.00000
 [4,]  0.00 0.00000
 [5,]  0.00 0.00000
 [6,]  0.00 0.00000
 [7,]  0.00 0.00000
 [8,]  0.00 0.00000
 [9,]  0.00 9.87654
[10,]  0.00 0.00000
> tmp2[,-(3:20)]
       [,1]    [,2]
 [1,]  0.00 0.00000
 [2,]  0.00 0.00000
 [3,] 51.34 0.00000
 [4,]  0.00 0.00000
 [5,]  0.00 0.00000
 [6,]  0.00 0.00000
 [7,]  0.00 0.00000
 [8,]  0.00 0.00000
 [9,]  0.00 9.87654
[10,]  0.00 0.00000
> tmp2[3,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
[1,] 51.34    0    0    0    0    0    0    0    0     0     0     0     0
     [,14] [,15] [,16] [,17] [,18] [,19] [,20]
[1,]     0     0     0     0     0     0     0
> tmp2[-3,]
      [,1]    [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [2,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [3,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [4,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [5,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [6,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [7,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [8,]    0 9.87654    0    0    0    0    0    0    0     0     0     0     0
 [9,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
      [,14] [,15] [,16] [,17] [,18] [,19] [,20]
 [1,]     0     0     0     0     0     0     0
 [2,]     0     0     0     0     0     0     0
 [3,]     0     0     0     0     0     0     0
 [4,]     0     0     0     0     0     0     0
 [5,]     0     0     0     0     0     0     0
 [6,]     0     0     0     0     0     0     0
 [7,]     0     0     0     0     0     0     0
 [8,]     0     0     0     0     0     0     0
 [9,]     0     0     0     0     0     0     0
> tmp2[2,1:3]
     [,1] [,2] [,3]
[1,]    0    0    0
> tmp2[3:9,1:3]
      [,1]    [,2] [,3]
[1,] 51.34 0.00000    0
[2,]  0.00 0.00000    0
[3,]  0.00 0.00000    0
[4,]  0.00 0.00000    0
[5,]  0.00 0.00000    0
[6,]  0.00 0.00000    0
[7,]  0.00 9.87654    0
> tmp2[-4,-4]
       [,1]    [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [2,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [3,] 51.34 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [4,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [5,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [6,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [7,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [8,]  0.00 9.87654    0    0    0    0    0    0    0     0     0     0     0
 [9,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
      [,14] [,15] [,16] [,17] [,18] [,19]
 [1,]     0     0     0     0     0     0
 [2,]     0     0     0     0     0     0
 [3,]     0     0     0     0     0     0
 [4,]     0     0     0     0     0     0
 [5,]     0     0     0     0     0     0
 [6,]     0     0     0     0     0     0
 [7,]     0     0     0     0     0     0
 [8,]     0     0     0     0     0     0
 [9,]     0     0     0     0     0     0
> 
> ## now testing accessing/assigning multiple elements
> tmp3 <- createBufferedMatrix(10,10)
> 
> for (i in 1:10){
+   for (j in 1:10){
+     tmp3[i,j] <- (j-1)*10 + i
+   }
+ }
> 
> tmp3[2:4,2:4]
     [,1] [,2] [,3]
[1,]   12   22   32
[2,]   13   23   33
[3,]   14   24   34
> tmp3[c(-10),c(2:4,2:4,10,1,2,1:10,10:1)]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]   11   21   31   11   21   31   91    1   11     1    11    21    31
 [2,]   12   22   32   12   22   32   92    2   12     2    12    22    32
 [3,]   13   23   33   13   23   33   93    3   13     3    13    23    33
 [4,]   14   24   34   14   24   34   94    4   14     4    14    24    34
 [5,]   15   25   35   15   25   35   95    5   15     5    15    25    35
 [6,]   16   26   36   16   26   36   96    6   16     6    16    26    36
 [7,]   17   27   37   17   27   37   97    7   17     7    17    27    37
 [8,]   18   28   38   18   28   38   98    8   18     8    18    28    38
 [9,]   19   29   39   19   29   39   99    9   19     9    19    29    39
      [,14] [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24] [,25]
 [1,]    41    51    61    71    81    91    91    81    71    61    51    41
 [2,]    42    52    62    72    82    92    92    82    72    62    52    42
 [3,]    43    53    63    73    83    93    93    83    73    63    53    43
 [4,]    44    54    64    74    84    94    94    84    74    64    54    44
 [5,]    45    55    65    75    85    95    95    85    75    65    55    45
 [6,]    46    56    66    76    86    96    96    86    76    66    56    46
 [7,]    47    57    67    77    87    97    97    87    77    67    57    47
 [8,]    48    58    68    78    88    98    98    88    78    68    58    48
 [9,]    49    59    69    79    89    99    99    89    79    69    59    49
      [,26] [,27] [,28] [,29]
 [1,]    31    21    11     1
 [2,]    32    22    12     2
 [3,]    33    23    13     3
 [4,]    34    24    14     4
 [5,]    35    25    15     5
 [6,]    36    26    16     6
 [7,]    37    27    17     7
 [8,]    38    28    18     8
 [9,]    39    29    19     9
> tmp3[-c(1:5),-c(6:10)]
     [,1] [,2] [,3] [,4] [,5]
[1,]    6   16   26   36   46
[2,]    7   17   27   37   47
[3,]    8   18   28   38   48
[4,]    9   19   29   39   49
[5,]   10   20   30   40   50
> 
> ## assignment of whole columns
> tmp3[,1] <- c(1:10*100.0)
> tmp3[,1:2] <- tmp3[,1:2]*100
> tmp3[,1:2] <- tmp3[,2:1]
> tmp3[,1:2]
      [,1]  [,2]
 [1,] 1100 1e+04
 [2,] 1200 2e+04
 [3,] 1300 3e+04
 [4,] 1400 4e+04
 [5,] 1500 5e+04
 [6,] 1600 6e+04
 [7,] 1700 7e+04
 [8,] 1800 8e+04
 [9,] 1900 9e+04
[10,] 2000 1e+05
> 
> 
> tmp3[,-1] <- tmp3[,1:9]
> tmp3[,1:10]
      [,1] [,2]  [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,] 1100 1100 1e+04   21   31   41   51   61   71    81
 [2,] 1200 1200 2e+04   22   32   42   52   62   72    82
 [3,] 1300 1300 3e+04   23   33   43   53   63   73    83
 [4,] 1400 1400 4e+04   24   34   44   54   64   74    84
 [5,] 1500 1500 5e+04   25   35   45   55   65   75    85
 [6,] 1600 1600 6e+04   26   36   46   56   66   76    86
 [7,] 1700 1700 7e+04   27   37   47   57   67   77    87
 [8,] 1800 1800 8e+04   28   38   48   58   68   78    88
 [9,] 1900 1900 9e+04   29   39   49   59   69   79    89
[10,] 2000 2000 1e+05   30   40   50   60   70   80    90
> 
> tmp3[,1:2] <- rep(1,10)
> tmp3[,1:2] <- rep(1,20)
> tmp3[,1:2] <- matrix(c(1:5),1,5)
> 
> tmp3[,-c(1:8)] <- matrix(c(1:5),1,5)
> 
> tmp3[1,] <- 1:10
> tmp3[1,]
     [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,]    1    2    3    4    5    6    7    8    9    10
> tmp3[-1,] <- c(1,2)
> tmp3[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    1    2    3    4    5    6    7    8    9    10
 [2,]    1    2    1    2    1    2    1    2    1     2
 [3,]    2    1    2    1    2    1    2    1    2     1
 [4,]    1    2    1    2    1    2    1    2    1     2
 [5,]    2    1    2    1    2    1    2    1    2     1
 [6,]    1    2    1    2    1    2    1    2    1     2
 [7,]    2    1    2    1    2    1    2    1    2     1
 [8,]    1    2    1    2    1    2    1    2    1     2
 [9,]    2    1    2    1    2    1    2    1    2     1
[10,]    1    2    1    2    1    2    1    2    1     2
> tmp3[-c(1:8),] <- matrix(c(1:5),1,5)
> tmp3[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    1    2    3    4    5    6    7    8    9    10
 [2,]    1    2    1    2    1    2    1    2    1     2
 [3,]    2    1    2    1    2    1    2    1    2     1
 [4,]    1    2    1    2    1    2    1    2    1     2
 [5,]    2    1    2    1    2    1    2    1    2     1
 [6,]    1    2    1    2    1    2    1    2    1     2
 [7,]    2    1    2    1    2    1    2    1    2     1
 [8,]    1    2    1    2    1    2    1    2    1     2
 [9,]    1    3    5    2    4    1    3    5    2     4
[10,]    2    4    1    3    5    2    4    1    3     5
> 
> 
> tmp3[1:2,1:2] <- 5555.04
> tmp3[-(1:2),1:2] <- 1234.56789
> 
> 
> 
> ## testing accessors for the directory and prefix
> directory(tmp3)
[1] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests"
> prefix(tmp3)
[1] "BM"
> 
> ## testing if we can remove these objects
> rm(tmp, tmp2, tmp3)
> gc()
         used (Mb) gc trigger (Mb) max used (Mb)
Ncells 478818 25.6    1048392   56   639317 34.2
Vcells 885623  6.8    8388608   64  2082728 15.9
> 
> 
> 
> 
> ##
> ## checking reads
> ##
> 
> tmp2 <- createBufferedMatrix(10,20)
> 
> test.sample <- rnorm(10*20)
> 
> tmp2[1:10,1:20] <- test.sample
> 
> test.matrix <- matrix(test.sample,10,20)
> 
> ## testing reads
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   which.col <- sample(1:20,1)
+   if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> date()
[1] "Mon Dec 15 21:27:43 2025"
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> date()
[1] "Mon Dec 15 21:27:43 2025"
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,which.col] == test.matrix[which.row,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> 
> 
> RowMode(tmp2)
<pointer: 0x61ff523155e0>
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   which.col <- sample(1:20,1)
+   if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,5,replace=TRUE)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> date()
[1] "Mon Dec 15 21:27:43 2025"
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col <- sample(1:20,5,replace=TRUE)
+   if (!all(tmp2[which.row,which.col] == test.matrix[which.row,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> date()
[1] "Mon Dec 15 21:27:43 2025"
> 
> ColMode(tmp2)
<pointer: 0x61ff523155e0>
> 
> 
> 
> ### Now testing assignments
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+ 
+   new.data <- rnorm(20)
+   tmp2[which.row,] <- new.data
+   test.matrix[which.row,] <- new.data
+   if (rep > 1){
+     if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+   
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   new.data <- rnorm(10)
+   tmp2[,which.col] <- new.data
+   test.matrix[,which.col]<- new.data
+ 
+   if (rep > 1){
+     if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.col <- which.col
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,5,replace=TRUE)
+   new.data <- matrix(rnorm(50),5,10)
+   tmp2[,which.col] <- new.data
+   test.matrix[,which.col]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.col <- which.col
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   new.data <- matrix(rnorm(50),5,10)
+   tmp2[which.row,] <- new.data
+   test.matrix[which.row,]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col  <- sample(1:20,5,replace=TRUE)
+   new.data <- matrix(rnorm(25),5,5)
+   tmp2[which.row,which.col] <- new.data
+   test.matrix[which.row,which.col]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[prev.row,prev.col] == test.matrix[prev.row,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+   prev.col <- which.col
+ }
> 
> 
> 
> 
> ###
> ###
> ### testing some more functions
> ###
> 
> 
> 
> ## duplication function
> tmp5 <- duplicate(tmp2)
> 
> # making sure really did copy everything.
> tmp5[1,1] <- tmp5[1,1] +100.00
> 
> if (tmp5[1,1] == tmp2[1,1]){
+   stop("Problem with duplication")
+ }
> 
> 
> 
> 
> ### testing elementwise applying of functions
> 
> tmp5[1:4,1:4]
            [,1]       [,2]       [,3]       [,4]
[1,] 100.4270002 -0.4530989  1.7156058  0.2089908
[2,]  -0.9794666 -1.1264877 -0.8306319  1.3425342
[3,]   0.2210405  0.7905584 -1.5811570 -0.7675133
[4,]   0.4106070  1.2636560  2.7450519 -1.4533487
> ewApply(tmp5,abs)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
            [,1]      [,2]      [,3]      [,4]
[1,] 100.4270002 0.4530989 1.7156058 0.2089908
[2,]   0.9794666 1.1264877 0.8306319 1.3425342
[3,]   0.2210405 0.7905584 1.5811570 0.7675133
[4,]   0.4106070 1.2636560 2.7450519 1.4533487
> ewApply(tmp5,sqrt)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
           [,1]      [,2]      [,3]      [,4]
[1,] 10.0213273 0.6731262 1.3098114 0.4571551
[2,]  0.9896800 1.0613612 0.9113901 1.1586778
[3,]  0.4701495 0.8891335 1.2574407 0.8760784
[4,]  0.6407862 1.1241245 1.6568198 1.2055491
> 
> my.function <- function(x,power){
+   (x+5)^power
+ }
> 
> ewApply(tmp5,my.function,power=2)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
          [,1]     [,2]     [,3]     [,4]
[1,] 225.64027 32.18436 39.81372 29.78054
[2,]  35.87627 36.74010 34.94453 37.92931
[3,]  29.92254 34.68189 39.15556 34.52830
[4,]  31.81847 37.50490 44.31325 38.50884
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x61ff51ea0840>
> exp(tmp5)
<pointer: 0x61ff51ea0840>
> log(tmp5,2)
<pointer: 0x61ff51ea0840>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 469.6407
> Min(tmp5)
[1] 53.1576
> mean(tmp5)
[1] 74.48488
> Sum(tmp5)
[1] 14896.98
> Var(tmp5)
[1] 865.5438
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 92.83046 75.29473 68.23066 74.80807 73.70940 73.72974 72.79964 70.50288
 [9] 72.17220 70.77098
> rowSums(tmp5)
 [1] 1856.609 1505.895 1364.613 1496.161 1474.188 1474.595 1455.993 1410.058
 [9] 1443.444 1415.420
> rowVars(tmp5)
 [1] 7936.68866   44.85754   72.91547  107.25841   79.27679  114.32234
 [7]   48.55621   76.08763   45.45609  102.70247
> rowSd(tmp5)
 [1] 89.088095  6.697577  8.539056 10.356564  8.903751 10.692163  6.968229
 [8]  8.722822  6.742113 10.134223
> rowMax(tmp5)
 [1] 469.64066  85.92678  85.22494  92.23222  90.82078 100.61016  85.85045
 [8]  93.20395  88.42684  94.12750
> rowMin(tmp5)
 [1] 54.34534 58.98216 56.13359 57.57486 54.83267 59.65774 59.16411 53.15760
 [9] 61.35623 58.51750
> 
> colMeans(tmp5)
 [1] 108.60875  73.39553  82.04902  73.34898  74.80602  67.28094  72.35418
 [8]  70.86010  73.74512  75.61354  70.57027  71.73653  70.57297  73.28465
[15]  70.62288  72.98094  74.19786  71.47425  69.62032  72.57467
> colSums(tmp5)
 [1] 1086.0875  733.9553  820.4902  733.4898  748.0602  672.8094  723.5418
 [8]  708.6010  737.4512  756.1354  705.7027  717.3653  705.7297  732.8465
[15]  706.2288  729.8094  741.9786  714.7425  696.2032  725.7467
> colVars(tmp5)
 [1] 16128.66277    35.78451   106.80848    79.50134    31.56429    45.24507
 [7]    76.48628    83.51964    80.61818   102.35011    66.47437    75.37046
[13]    76.00931    74.45538    67.12516   108.60905    55.68758   152.49856
[19]    99.58508    48.56996
> colSd(tmp5)
 [1] 126.998672   5.982015  10.334819   8.916352   5.618210   6.726446
 [7]   8.745644   9.138908   8.978763  10.116823   8.153182   8.681616
[13]   8.718332   8.628753   8.192995  10.421567   7.462411  12.349031
[19]   9.979232   6.969215
> colMax(tmp5)
 [1] 469.64066  83.30752 100.61016  86.51430  84.73883  79.38094  88.42684
 [8]  84.14727  83.17248  91.14143  81.25264  83.43260  90.82078  87.72914
[15]  85.89829  86.59284  82.52001  94.12750  85.92678  85.85045
> colMin(tmp5)
 [1] 60.48399 64.46640 68.39798 58.94166 69.06303 59.71660 60.36048 53.15760
 [9] 54.34534 61.80252 57.85806 59.16411 58.98216 62.93214 59.65774 60.27475
[17] 58.83511 54.83267 56.13359 62.84560
> 
> 
> ### setting a random element to NA and then testing with na.rm=TRUE or na.rm=FALSE (The default)
> 
> 
> which.row <- sample(1:10,1,replace=TRUE)
> which.col  <- sample(1:20,1,replace=TRUE)
> 
> tmp5[which.row,which.col] <- NA
> 
> Max(tmp5)
[1] NA
> Min(tmp5)
[1] NA
> mean(tmp5)
[1] NA
> Sum(tmp5)
[1] NA
> Var(tmp5)
[1] NA
> 
> rowMeans(tmp5)
 [1] 92.83046 75.29473 68.23066 74.80807 73.70940 73.72974 72.79964 70.50288
 [9]       NA 70.77098
> rowSums(tmp5)
 [1] 1856.609 1505.895 1364.613 1496.161 1474.188 1474.595 1455.993 1410.058
 [9]       NA 1415.420
> rowVars(tmp5)
 [1] 7936.68866   44.85754   72.91547  107.25841   79.27679  114.32234
 [7]   48.55621   76.08763   47.64293  102.70247
> rowSd(tmp5)
 [1] 89.088095  6.697577  8.539056 10.356564  8.903751 10.692163  6.968229
 [8]  8.722822  6.902386 10.134223
> rowMax(tmp5)
 [1] 469.64066  85.92678  85.22494  92.23222  90.82078 100.61016  85.85045
 [8]  93.20395        NA  94.12750
> rowMin(tmp5)
 [1] 54.34534 58.98216 56.13359 57.57486 54.83267 59.65774 59.16411 53.15760
 [9]       NA 58.51750
> 
> colMeans(tmp5)
 [1] 108.60875  73.39553  82.04902  73.34898  74.80602        NA  72.35418
 [8]  70.86010  73.74512  75.61354  70.57027  71.73653  70.57297  73.28465
[15]  70.62288  72.98094  74.19786  71.47425  69.62032  72.57467
> colSums(tmp5)
 [1] 1086.0875  733.9553  820.4902  733.4898  748.0602        NA  723.5418
 [8]  708.6010  737.4512  756.1354  705.7027  717.3653  705.7297  732.8465
[15]  706.2288  729.8094  741.9786  714.7425  696.2032  725.7467
> colVars(tmp5)
 [1] 16128.66277    35.78451   106.80848    79.50134    31.56429          NA
 [7]    76.48628    83.51964    80.61818   102.35011    66.47437    75.37046
[13]    76.00931    74.45538    67.12516   108.60905    55.68758   152.49856
[19]    99.58508    48.56996
> colSd(tmp5)
 [1] 126.998672   5.982015  10.334819   8.916352   5.618210         NA
 [7]   8.745644   9.138908   8.978763  10.116823   8.153182   8.681616
[13]   8.718332   8.628753   8.192995  10.421567   7.462411  12.349031
[19]   9.979232   6.969215
> colMax(tmp5)
 [1] 469.64066  83.30752 100.61016  86.51430  84.73883        NA  88.42684
 [8]  84.14727  83.17248  91.14143  81.25264  83.43260  90.82078  87.72914
[15]  85.89829  86.59284  82.52001  94.12750  85.92678  85.85045
> colMin(tmp5)
 [1] 60.48399 64.46640 68.39798 58.94166 69.06303       NA 60.36048 53.15760
 [9] 54.34534 61.80252 57.85806 59.16411 58.98216 62.93214 59.65774 60.27475
[17] 58.83511 54.83267 56.13359 62.84560
> 
> Max(tmp5,na.rm=TRUE)
[1] 469.6407
> Min(tmp5,na.rm=TRUE)
[1] 53.1576
> mean(tmp5,na.rm=TRUE)
[1] 74.48441
> Sum(tmp5,na.rm=TRUE)
[1] 14822.4
> Var(tmp5,na.rm=TRUE)
[1] 869.9152
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 92.83046 75.29473 68.23066 74.80807 73.70940 73.72974 72.79964 70.50288
 [9] 72.04557 70.77098
> rowSums(tmp5,na.rm=TRUE)
 [1] 1856.609 1505.895 1364.613 1496.161 1474.188 1474.595 1455.993 1410.058
 [9] 1368.866 1415.420
> rowVars(tmp5,na.rm=TRUE)
 [1] 7936.68866   44.85754   72.91547  107.25841   79.27679  114.32234
 [7]   48.55621   76.08763   47.64293  102.70247
> rowSd(tmp5,na.rm=TRUE)
 [1] 89.088095  6.697577  8.539056 10.356564  8.903751 10.692163  6.968229
 [8]  8.722822  6.902386 10.134223
> rowMax(tmp5,na.rm=TRUE)
 [1] 469.64066  85.92678  85.22494  92.23222  90.82078 100.61016  85.85045
 [8]  93.20395  88.42684  94.12750
> rowMin(tmp5,na.rm=TRUE)
 [1] 54.34534 58.98216 56.13359 57.57486 54.83267 59.65774 59.16411 53.15760
 [9] 61.35623 58.51750
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 108.60875  73.39553  82.04902  73.34898  74.80602  66.47014  72.35418
 [8]  70.86010  73.74512  75.61354  70.57027  71.73653  70.57297  73.28465
[15]  70.62288  72.98094  74.19786  71.47425  69.62032  72.57467
> colSums(tmp5,na.rm=TRUE)
 [1] 1086.0875  733.9553  820.4902  733.4898  748.0602  598.2313  723.5418
 [8]  708.6010  737.4512  756.1354  705.7027  717.3653  705.7297  732.8465
[15]  706.2288  729.8094  741.9786  714.7425  696.2032  725.7467
> colVars(tmp5,na.rm=TRUE)
 [1] 16128.66277    35.78451   106.80848    79.50134    31.56429    43.50506
 [7]    76.48628    83.51964    80.61818   102.35011    66.47437    75.37046
[13]    76.00931    74.45538    67.12516   108.60905    55.68758   152.49856
[19]    99.58508    48.56996
> colSd(tmp5,na.rm=TRUE)
 [1] 126.998672   5.982015  10.334819   8.916352   5.618210   6.595836
 [7]   8.745644   9.138908   8.978763  10.116823   8.153182   8.681616
[13]   8.718332   8.628753   8.192995  10.421567   7.462411  12.349031
[19]   9.979232   6.969215
> colMax(tmp5,na.rm=TRUE)
 [1] 469.64066  83.30752 100.61016  86.51430  84.73883  79.38094  88.42684
 [8]  84.14727  83.17248  91.14143  81.25264  83.43260  90.82078  87.72914
[15]  85.89829  86.59284  82.52001  94.12750  85.92678  85.85045
> colMin(tmp5,na.rm=TRUE)
 [1] 60.48399 64.46640 68.39798 58.94166 69.06303 59.71660 60.36048 53.15760
 [9] 54.34534 61.80252 57.85806 59.16411 58.98216 62.93214 59.65774 60.27475
[17] 58.83511 54.83267 56.13359 62.84560
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1] 92.83046 75.29473 68.23066 74.80807 73.70940 73.72974 72.79964 70.50288
 [9]      NaN 70.77098
> rowSums(tmp5,na.rm=TRUE)
 [1] 1856.609 1505.895 1364.613 1496.161 1474.188 1474.595 1455.993 1410.058
 [9]    0.000 1415.420
> rowVars(tmp5,na.rm=TRUE)
 [1] 7936.68866   44.85754   72.91547  107.25841   79.27679  114.32234
 [7]   48.55621   76.08763         NA  102.70247
> rowSd(tmp5,na.rm=TRUE)
 [1] 89.088095  6.697577  8.539056 10.356564  8.903751 10.692163  6.968229
 [8]  8.722822        NA 10.134223
> rowMax(tmp5,na.rm=TRUE)
 [1] 469.64066  85.92678  85.22494  92.23222  90.82078 100.61016  85.85045
 [8]  93.20395        NA  94.12750
> rowMin(tmp5,na.rm=TRUE)
 [1] 54.34534 58.98216 56.13359 57.57486 54.83267 59.65774 59.16411 53.15760
 [9]       NA 58.51750
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1] 112.60581  73.51364  83.04786  73.63229  75.44413       NaN  70.56833
 [8]  71.17966  74.22662  75.77301  69.99526  70.43697  70.12587  74.09970
[15]  69.88795  74.22859  73.72775  72.59848  70.20321  73.07153
> colSums(tmp5,na.rm=TRUE)
 [1] 1013.4523  661.6227  747.4308  662.6906  678.9972    0.0000  635.1150
 [8]  640.6170  668.0396  681.9571  629.9574  633.9327  631.1328  666.8973
[15]  628.9915  668.0573  663.5498  653.3863  631.8289  657.6438
> colVars(tmp5,na.rm=TRUE)
 [1] 17965.01000    40.10065   108.93557    88.53602    30.92899          NA
 [7]    50.16783    92.81073    88.08724   114.85778    71.06400    65.79204
[13]    83.26165    76.28885    69.43940   104.67305    60.16233   157.34222
[19]   108.21093    51.86394
> colSd(tmp5,na.rm=TRUE)
 [1] 134.033615   6.332507  10.437220   9.409358   5.561384         NA
 [7]   7.082925   9.633832   9.385480  10.717172   8.429946   8.111229
[13]   9.124782   8.734349   8.333030  10.230985   7.756438  12.543613
[19]  10.402448   7.201662
> colMax(tmp5,na.rm=TRUE)
 [1] 469.64066  83.30752 100.61016  86.51430  84.73883      -Inf  82.97030
 [8]  84.14727  83.17248  91.14143  81.25264  82.84640  90.82078  87.72914
[15]  85.89829  86.59284  82.52001  94.12750  85.92678  85.85045
> colMin(tmp5,na.rm=TRUE)
 [1] 60.48399 64.46640 68.39798 58.94166 69.19239      Inf 60.36048 53.15760
 [9] 54.34534 61.80252 57.85806 59.16411 58.98216 62.93214 59.65774 60.27475
[17] 58.83511 54.83267 56.13359 62.84560
> 
> 
> 
> 
> copymatrix <- matrix(rnorm(200,150,15),10,20)
> 
> tmp5[1:10,1:20] <- copymatrix
> which.row <- 3
> which.col  <- 1
> cat(which.row," ",which.col,"\n")
3   1 
> tmp5[which.row,which.col] <- NA
> copymatrix[which.row,which.col] <- NA
> 
> rowVars(tmp5,na.rm=TRUE)
 [1] 177.91465 167.85999 216.55576 181.57305 138.00916  93.50059 191.04101
 [8] 206.58837 290.49927 314.49639
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 177.91465 167.85999 216.55576 181.57305 138.00916  93.50059 191.04101
 [8] 206.58837 290.49927 314.49639
> 
> 
> 
> copymatrix <- matrix(rnorm(200,150,15),10,20)
> 
> tmp5[1:10,1:20] <- copymatrix
> which.row <- 1
> which.col  <- 3
> cat(which.row," ",which.col,"\n")
1   3 
> tmp5[which.row,which.col] <- NA
> copymatrix[which.row,which.col] <- NA
> 
> colVars(tmp5,na.rm=TRUE)-apply(copymatrix,2,var,na.rm=TRUE)
 [1] -1.421085e-14  2.273737e-13 -1.421085e-14  1.136868e-13 -1.136868e-13
 [6] -2.842171e-14  1.421085e-14  1.136868e-13 -1.421085e-14 -5.684342e-14
[11] -1.989520e-13 -1.136868e-13 -1.136868e-13 -2.842171e-14  1.136868e-13
[16]  2.557954e-13  1.278977e-13  0.000000e+00  2.842171e-14 -5.684342e-14
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> ## making sure these things agree
> ##
> ## first when there is no NA
> 
> 
> 
> agree.checks <- function(buff.matrix,r.matrix,err.tol=1e-10){
+ 
+   if (Max(buff.matrix,na.rm=TRUE) != max(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Max")
+   }
+   
+ 
+   if (Min(buff.matrix,na.rm=TRUE) != min(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Min")
+   }
+ 
+ 
+   if (abs(Sum(buff.matrix,na.rm=TRUE)- sum(r.matrix,na.rm=TRUE)) > err.tol){
+ 
+     cat(Sum(buff.matrix,na.rm=TRUE),"\n")
+     cat(sum(r.matrix,na.rm=TRUE),"\n")
+     cat(Sum(buff.matrix,na.rm=TRUE) - sum(r.matrix,na.rm=TRUE),"\n")
+     
+     stop("No agreement in Sum")
+   }
+   
+   if (abs(mean(buff.matrix,na.rm=TRUE) - mean(r.matrix,na.rm=TRUE)) > err.tol){
+     stop("No agreement in mean")
+   }
+   
+   
+   if(abs(Var(buff.matrix,na.rm=TRUE) - var(as.vector(r.matrix),na.rm=TRUE)) > err.tol){
+     stop("No agreement in Var")
+   }
+   
+   
+ 
+   if(any(abs(rowMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,mean,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowMeans")
+   }
+   
+   
+   if(any(abs(colMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,mean,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colMeans")
+   }
+   
+   
+   if(any(abs(rowSums(buff.matrix,na.rm=TRUE)  -  apply(r.matrix,1,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in rowSums")
+   }
+   
+   
+   if(any(abs(colSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colSums")
+   }
+   
+   ### this is to get around the fact that R doesn't like to compute NA on an entire vector of NA when 
+   ### computing variance
+   my.Var <- function(x,na.rm=FALSE){
+    if (all(is.na(x))){
+      return(NA)
+    } else {
+      var(x,na.rm=na.rm)
+    }
+ 
+   }
+   
+   if(any(abs(rowVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+   
+   
+   if(any(abs(colVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+ 
+ 
+   if(any(abs(rowMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+ 
+   if(any(abs(colMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+   
+   
+   if(any(abs(rowMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+   
+ 
+   if(any(abs(colMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+ 
+   if(any(abs(colMedians(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,median,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMedian")
+   }
+ 
+   if(any(abs(colRanges(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,range,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colRanges")
+   }
+ 
+ 
+   
+ }
> 
> 
> 
> 
> 
> 
> 
> 
> 
> for (rep in 1:20){
+   copymatrix <- matrix(rnorm(200,150,15),10,20)
+   
+   tmp5[1:10,1:20] <- copymatrix
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ## now lets assign some NA values and check agreement
+ 
+   which.row <- sample(1:10,1,replace=TRUE)
+   which.col  <- sample(1:20,1,replace=TRUE)
+   
+   cat(which.row," ",which.col,"\n")
+   
+   tmp5[which.row,which.col] <- NA
+   copymatrix[which.row,which.col] <- NA
+   
+   agree.checks(tmp5,copymatrix)
+ 
+   ## make an entire row NA
+   tmp5[which.row,] <- NA
+   copymatrix[which.row,] <- NA
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ### also make an entire col NA
+   tmp5[,which.col] <- NA
+   copymatrix[,which.col] <- NA
+ 
+   agree.checks(tmp5,copymatrix)
+ 
+   ### now make 1 element non NA with NA in the rest of row and column
+ 
+   tmp5[which.row,which.col] <- rnorm(1,150,15)
+   copymatrix[which.row,which.col] <- tmp5[which.row,which.col]
+ 
+   agree.checks(tmp5,copymatrix)
+ }
9   2 
9   18 
8   20 
7   18 
10   12 
10   3 
9   8 
1   10 
5   8 
9   11 
5   6 
9   20 
2   10 
7   13 
7   1 
5   5 
8   6 
1   12 
8   9 
1   11 
There were 50 or more warnings (use warnings() to see the first 50)
> 
> 
> ### now test 1 by n and n by 1 matrix
> 
> 
> err.tol <- 1e-12
> 
> rm(tmp5)
> 
> dataset1 <- rnorm(100)
> dataset2 <- rnorm(100)
> 
> tmp <- createBufferedMatrix(1,100)
> tmp[1,] <- dataset1
> 
> tmp2 <- createBufferedMatrix(100,1)
> tmp2[,1] <- dataset2
> 
> 
> 
> 
> 
> Max(tmp)
[1] 2.647031
> Min(tmp)
[1] -2.865792
> mean(tmp)
[1] 0.02254846
> Sum(tmp)
[1] 2.254846
> Var(tmp)
[1] 1.138059
> 
> rowMeans(tmp)
[1] 0.02254846
> rowSums(tmp)
[1] 2.254846
> rowVars(tmp)
[1] 1.138059
> rowSd(tmp)
[1] 1.066799
> rowMax(tmp)
[1] 2.647031
> rowMin(tmp)
[1] -2.865792
> 
> colMeans(tmp)
  [1]  0.243144897  1.285859659  0.585036829 -1.526340139  0.352375367
  [6]  2.324752246 -0.961788072  1.445011766  0.594266151  1.023552995
 [11] -0.582182128  0.872460824 -2.865791967 -0.166481115 -0.081890316
 [16]  0.033289027  0.456719313 -0.911701802 -1.950855227 -0.628597142
 [21] -0.016159119 -0.281225142  1.228162663 -1.040735003  0.750460333
 [26]  1.950094835 -0.236337213  0.142553051  0.738791981  0.211522651
 [31]  0.674455636  0.897295983 -1.179089632  2.647031315  0.001830488
 [36] -0.053763701 -0.111174953 -0.677285316 -0.320632848  1.425476354
 [41] -2.342332506  0.329139625  0.581127255 -0.467923339 -1.288762461
 [46]  0.416256519 -1.048695495 -0.321345706 -0.026729933  1.302018639
 [51]  0.676449132  0.454527246 -0.048873809  0.518519379  0.027875120
 [56] -0.047064167  1.067509991 -0.654613919  0.448688430 -1.138982867
 [61]  0.368304351 -0.989000180  0.837202762  1.307359647  0.518256391
 [66] -0.855260008  1.003693451  0.249653761  0.045400068 -0.088633512
 [71] -0.240190233  1.233747406  0.907680799  0.584082504 -0.471154343
 [76] -1.537910625 -2.127389966 -1.841100364  0.946750807  1.607649459
 [81]  1.368338122  0.847218432  0.200051087 -1.563602872  0.713168451
 [86] -0.901329021 -0.263030235  0.645037682  1.569574371 -2.720742822
 [91]  0.099981400 -1.428123651 -0.317936222 -1.076319223  2.016934738
 [96] -1.077861467 -0.303222597 -0.413214998 -0.363667245 -0.964450724
> colSums(tmp)
  [1]  0.243144897  1.285859659  0.585036829 -1.526340139  0.352375367
  [6]  2.324752246 -0.961788072  1.445011766  0.594266151  1.023552995
 [11] -0.582182128  0.872460824 -2.865791967 -0.166481115 -0.081890316
 [16]  0.033289027  0.456719313 -0.911701802 -1.950855227 -0.628597142
 [21] -0.016159119 -0.281225142  1.228162663 -1.040735003  0.750460333
 [26]  1.950094835 -0.236337213  0.142553051  0.738791981  0.211522651
 [31]  0.674455636  0.897295983 -1.179089632  2.647031315  0.001830488
 [36] -0.053763701 -0.111174953 -0.677285316 -0.320632848  1.425476354
 [41] -2.342332506  0.329139625  0.581127255 -0.467923339 -1.288762461
 [46]  0.416256519 -1.048695495 -0.321345706 -0.026729933  1.302018639
 [51]  0.676449132  0.454527246 -0.048873809  0.518519379  0.027875120
 [56] -0.047064167  1.067509991 -0.654613919  0.448688430 -1.138982867
 [61]  0.368304351 -0.989000180  0.837202762  1.307359647  0.518256391
 [66] -0.855260008  1.003693451  0.249653761  0.045400068 -0.088633512
 [71] -0.240190233  1.233747406  0.907680799  0.584082504 -0.471154343
 [76] -1.537910625 -2.127389966 -1.841100364  0.946750807  1.607649459
 [81]  1.368338122  0.847218432  0.200051087 -1.563602872  0.713168451
 [86] -0.901329021 -0.263030235  0.645037682  1.569574371 -2.720742822
 [91]  0.099981400 -1.428123651 -0.317936222 -1.076319223  2.016934738
 [96] -1.077861467 -0.303222597 -0.413214998 -0.363667245 -0.964450724
> colVars(tmp)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> colSd(tmp)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> colMax(tmp)
  [1]  0.243144897  1.285859659  0.585036829 -1.526340139  0.352375367
  [6]  2.324752246 -0.961788072  1.445011766  0.594266151  1.023552995
 [11] -0.582182128  0.872460824 -2.865791967 -0.166481115 -0.081890316
 [16]  0.033289027  0.456719313 -0.911701802 -1.950855227 -0.628597142
 [21] -0.016159119 -0.281225142  1.228162663 -1.040735003  0.750460333
 [26]  1.950094835 -0.236337213  0.142553051  0.738791981  0.211522651
 [31]  0.674455636  0.897295983 -1.179089632  2.647031315  0.001830488
 [36] -0.053763701 -0.111174953 -0.677285316 -0.320632848  1.425476354
 [41] -2.342332506  0.329139625  0.581127255 -0.467923339 -1.288762461
 [46]  0.416256519 -1.048695495 -0.321345706 -0.026729933  1.302018639
 [51]  0.676449132  0.454527246 -0.048873809  0.518519379  0.027875120
 [56] -0.047064167  1.067509991 -0.654613919  0.448688430 -1.138982867
 [61]  0.368304351 -0.989000180  0.837202762  1.307359647  0.518256391
 [66] -0.855260008  1.003693451  0.249653761  0.045400068 -0.088633512
 [71] -0.240190233  1.233747406  0.907680799  0.584082504 -0.471154343
 [76] -1.537910625 -2.127389966 -1.841100364  0.946750807  1.607649459
 [81]  1.368338122  0.847218432  0.200051087 -1.563602872  0.713168451
 [86] -0.901329021 -0.263030235  0.645037682  1.569574371 -2.720742822
 [91]  0.099981400 -1.428123651 -0.317936222 -1.076319223  2.016934738
 [96] -1.077861467 -0.303222597 -0.413214998 -0.363667245 -0.964450724
> colMin(tmp)
  [1]  0.243144897  1.285859659  0.585036829 -1.526340139  0.352375367
  [6]  2.324752246 -0.961788072  1.445011766  0.594266151  1.023552995
 [11] -0.582182128  0.872460824 -2.865791967 -0.166481115 -0.081890316
 [16]  0.033289027  0.456719313 -0.911701802 -1.950855227 -0.628597142
 [21] -0.016159119 -0.281225142  1.228162663 -1.040735003  0.750460333
 [26]  1.950094835 -0.236337213  0.142553051  0.738791981  0.211522651
 [31]  0.674455636  0.897295983 -1.179089632  2.647031315  0.001830488
 [36] -0.053763701 -0.111174953 -0.677285316 -0.320632848  1.425476354
 [41] -2.342332506  0.329139625  0.581127255 -0.467923339 -1.288762461
 [46]  0.416256519 -1.048695495 -0.321345706 -0.026729933  1.302018639
 [51]  0.676449132  0.454527246 -0.048873809  0.518519379  0.027875120
 [56] -0.047064167  1.067509991 -0.654613919  0.448688430 -1.138982867
 [61]  0.368304351 -0.989000180  0.837202762  1.307359647  0.518256391
 [66] -0.855260008  1.003693451  0.249653761  0.045400068 -0.088633512
 [71] -0.240190233  1.233747406  0.907680799  0.584082504 -0.471154343
 [76] -1.537910625 -2.127389966 -1.841100364  0.946750807  1.607649459
 [81]  1.368338122  0.847218432  0.200051087 -1.563602872  0.713168451
 [86] -0.901329021 -0.263030235  0.645037682  1.569574371 -2.720742822
 [91]  0.099981400 -1.428123651 -0.317936222 -1.076319223  2.016934738
 [96] -1.077861467 -0.303222597 -0.413214998 -0.363667245 -0.964450724
> colMedians(tmp)
  [1]  0.243144897  1.285859659  0.585036829 -1.526340139  0.352375367
  [6]  2.324752246 -0.961788072  1.445011766  0.594266151  1.023552995
 [11] -0.582182128  0.872460824 -2.865791967 -0.166481115 -0.081890316
 [16]  0.033289027  0.456719313 -0.911701802 -1.950855227 -0.628597142
 [21] -0.016159119 -0.281225142  1.228162663 -1.040735003  0.750460333
 [26]  1.950094835 -0.236337213  0.142553051  0.738791981  0.211522651
 [31]  0.674455636  0.897295983 -1.179089632  2.647031315  0.001830488
 [36] -0.053763701 -0.111174953 -0.677285316 -0.320632848  1.425476354
 [41] -2.342332506  0.329139625  0.581127255 -0.467923339 -1.288762461
 [46]  0.416256519 -1.048695495 -0.321345706 -0.026729933  1.302018639
 [51]  0.676449132  0.454527246 -0.048873809  0.518519379  0.027875120
 [56] -0.047064167  1.067509991 -0.654613919  0.448688430 -1.138982867
 [61]  0.368304351 -0.989000180  0.837202762  1.307359647  0.518256391
 [66] -0.855260008  1.003693451  0.249653761  0.045400068 -0.088633512
 [71] -0.240190233  1.233747406  0.907680799  0.584082504 -0.471154343
 [76] -1.537910625 -2.127389966 -1.841100364  0.946750807  1.607649459
 [81]  1.368338122  0.847218432  0.200051087 -1.563602872  0.713168451
 [86] -0.901329021 -0.263030235  0.645037682  1.569574371 -2.720742822
 [91]  0.099981400 -1.428123651 -0.317936222 -1.076319223  2.016934738
 [96] -1.077861467 -0.303222597 -0.413214998 -0.363667245 -0.964450724
> colRanges(tmp)
          [,1]    [,2]      [,3]     [,4]      [,5]     [,6]       [,7]
[1,] 0.2431449 1.28586 0.5850368 -1.52634 0.3523754 2.324752 -0.9617881
[2,] 0.2431449 1.28586 0.5850368 -1.52634 0.3523754 2.324752 -0.9617881
         [,8]      [,9]    [,10]      [,11]     [,12]     [,13]      [,14]
[1,] 1.445012 0.5942662 1.023553 -0.5821821 0.8724608 -2.865792 -0.1664811
[2,] 1.445012 0.5942662 1.023553 -0.5821821 0.8724608 -2.865792 -0.1664811
           [,15]      [,16]     [,17]      [,18]     [,19]      [,20]
[1,] -0.08189032 0.03328903 0.4567193 -0.9117018 -1.950855 -0.6285971
[2,] -0.08189032 0.03328903 0.4567193 -0.9117018 -1.950855 -0.6285971
           [,21]      [,22]    [,23]     [,24]     [,25]    [,26]      [,27]
[1,] -0.01615912 -0.2812251 1.228163 -1.040735 0.7504603 1.950095 -0.2363372
[2,] -0.01615912 -0.2812251 1.228163 -1.040735 0.7504603 1.950095 -0.2363372
         [,28]    [,29]     [,30]     [,31]    [,32]    [,33]    [,34]
[1,] 0.1425531 0.738792 0.2115227 0.6744556 0.897296 -1.17909 2.647031
[2,] 0.1425531 0.738792 0.2115227 0.6744556 0.897296 -1.17909 2.647031
           [,35]      [,36]     [,37]      [,38]      [,39]    [,40]     [,41]
[1,] 0.001830488 -0.0537637 -0.111175 -0.6772853 -0.3206328 1.425476 -2.342333
[2,] 0.001830488 -0.0537637 -0.111175 -0.6772853 -0.3206328 1.425476 -2.342333
         [,42]     [,43]      [,44]     [,45]     [,46]     [,47]      [,48]
[1,] 0.3291396 0.5811273 -0.4679233 -1.288762 0.4162565 -1.048695 -0.3213457
[2,] 0.3291396 0.5811273 -0.4679233 -1.288762 0.4162565 -1.048695 -0.3213457
           [,49]    [,50]     [,51]     [,52]       [,53]     [,54]      [,55]
[1,] -0.02672993 1.302019 0.6764491 0.4545272 -0.04887381 0.5185194 0.02787512
[2,] -0.02672993 1.302019 0.6764491 0.4545272 -0.04887381 0.5185194 0.02787512
           [,56]   [,57]      [,58]     [,59]     [,60]     [,61]      [,62]
[1,] -0.04706417 1.06751 -0.6546139 0.4486884 -1.138983 0.3683044 -0.9890002
[2,] -0.04706417 1.06751 -0.6546139 0.4486884 -1.138983 0.3683044 -0.9890002
         [,63]   [,64]     [,65]    [,66]    [,67]     [,68]      [,69]
[1,] 0.8372028 1.30736 0.5182564 -0.85526 1.003693 0.2496538 0.04540007
[2,] 0.8372028 1.30736 0.5182564 -0.85526 1.003693 0.2496538 0.04540007
           [,70]      [,71]    [,72]     [,73]     [,74]      [,75]     [,76]
[1,] -0.08863351 -0.2401902 1.233747 0.9076808 0.5840825 -0.4711543 -1.537911
[2,] -0.08863351 -0.2401902 1.233747 0.9076808 0.5840825 -0.4711543 -1.537911
        [,77]   [,78]     [,79]    [,80]    [,81]     [,82]     [,83]     [,84]
[1,] -2.12739 -1.8411 0.9467508 1.607649 1.368338 0.8472184 0.2000511 -1.563603
[2,] -2.12739 -1.8411 0.9467508 1.607649 1.368338 0.8472184 0.2000511 -1.563603
         [,85]     [,86]      [,87]     [,88]    [,89]     [,90]     [,91]
[1,] 0.7131685 -0.901329 -0.2630302 0.6450377 1.569574 -2.720743 0.0999814
[2,] 0.7131685 -0.901329 -0.2630302 0.6450377 1.569574 -2.720743 0.0999814
         [,92]      [,93]     [,94]    [,95]     [,96]      [,97]     [,98]
[1,] -1.428124 -0.3179362 -1.076319 2.016935 -1.077861 -0.3032226 -0.413215
[2,] -1.428124 -0.3179362 -1.076319 2.016935 -1.077861 -0.3032226 -0.413215
          [,99]     [,100]
[1,] -0.3636672 -0.9644507
[2,] -0.3636672 -0.9644507
> 
> 
> Max(tmp2)
[1] 2.320035
> Min(tmp2)
[1] -1.961044
> mean(tmp2)
[1] 0.08856677
> Sum(tmp2)
[1] 8.856677
> Var(tmp2)
[1] 0.8382006
> 
> rowMeans(tmp2)
  [1] -1.104017002 -0.017664335 -0.178780514 -0.727246273 -0.901763774
  [6]  1.955030429  0.104918105  0.297119525 -0.729292646  1.187730108
 [11] -0.728239162 -0.864632613 -0.242802745  0.253999702  0.820172151
 [16] -0.172249433 -1.961043513 -0.572097877 -0.524732599 -1.874304148
 [21] -1.586719214 -1.299753259  1.509885349  1.619307825  1.403274886
 [26] -0.500578197 -0.130472954  0.042712999  0.671742029  0.441926522
 [31]  0.577277471 -0.046068559  1.761373365  0.899425866  0.851538189
 [36]  1.037036815  1.311210932  0.425510316 -0.991810498 -0.312885144
 [41] -0.590238535 -0.525009426 -0.834843498 -0.287720776 -0.076031665
 [46] -0.111020461  0.817142224  0.044520339 -0.007891746 -0.543088979
 [51]  1.400734251  1.009751522  0.925687747  0.469088408  0.603698706
 [56]  1.024200937  1.736022521 -0.820652985 -0.891955329  0.129517627
 [61] -0.401097430  0.254103366 -0.284667709  1.482873164 -0.074545411
 [66]  0.126750460  1.310048925  0.641123341 -0.074219863 -0.855584304
 [71]  1.047069101 -0.100977264 -0.708068258 -1.147631133  0.657084889
 [76] -1.051462296 -0.477722142  1.356238248  0.946952884  1.410369529
 [81]  0.049878913  2.320035478  0.859894787 -0.483146740 -0.528608382
 [86]  1.244784830 -0.671260136  0.526959791  0.468247932 -0.306310164
 [91] -1.466612428 -0.585888238  0.011823424 -1.111106120  1.179586386
 [96] -0.445191050 -0.135432312  0.547833094 -1.413455506 -0.437943441
> rowSums(tmp2)
  [1] -1.104017002 -0.017664335 -0.178780514 -0.727246273 -0.901763774
  [6]  1.955030429  0.104918105  0.297119525 -0.729292646  1.187730108
 [11] -0.728239162 -0.864632613 -0.242802745  0.253999702  0.820172151
 [16] -0.172249433 -1.961043513 -0.572097877 -0.524732599 -1.874304148
 [21] -1.586719214 -1.299753259  1.509885349  1.619307825  1.403274886
 [26] -0.500578197 -0.130472954  0.042712999  0.671742029  0.441926522
 [31]  0.577277471 -0.046068559  1.761373365  0.899425866  0.851538189
 [36]  1.037036815  1.311210932  0.425510316 -0.991810498 -0.312885144
 [41] -0.590238535 -0.525009426 -0.834843498 -0.287720776 -0.076031665
 [46] -0.111020461  0.817142224  0.044520339 -0.007891746 -0.543088979
 [51]  1.400734251  1.009751522  0.925687747  0.469088408  0.603698706
 [56]  1.024200937  1.736022521 -0.820652985 -0.891955329  0.129517627
 [61] -0.401097430  0.254103366 -0.284667709  1.482873164 -0.074545411
 [66]  0.126750460  1.310048925  0.641123341 -0.074219863 -0.855584304
 [71]  1.047069101 -0.100977264 -0.708068258 -1.147631133  0.657084889
 [76] -1.051462296 -0.477722142  1.356238248  0.946952884  1.410369529
 [81]  0.049878913  2.320035478  0.859894787 -0.483146740 -0.528608382
 [86]  1.244784830 -0.671260136  0.526959791  0.468247932 -0.306310164
 [91] -1.466612428 -0.585888238  0.011823424 -1.111106120  1.179586386
 [96] -0.445191050 -0.135432312  0.547833094 -1.413455506 -0.437943441
> rowVars(tmp2)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowSd(tmp2)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowMax(tmp2)
  [1] -1.104017002 -0.017664335 -0.178780514 -0.727246273 -0.901763774
  [6]  1.955030429  0.104918105  0.297119525 -0.729292646  1.187730108
 [11] -0.728239162 -0.864632613 -0.242802745  0.253999702  0.820172151
 [16] -0.172249433 -1.961043513 -0.572097877 -0.524732599 -1.874304148
 [21] -1.586719214 -1.299753259  1.509885349  1.619307825  1.403274886
 [26] -0.500578197 -0.130472954  0.042712999  0.671742029  0.441926522
 [31]  0.577277471 -0.046068559  1.761373365  0.899425866  0.851538189
 [36]  1.037036815  1.311210932  0.425510316 -0.991810498 -0.312885144
 [41] -0.590238535 -0.525009426 -0.834843498 -0.287720776 -0.076031665
 [46] -0.111020461  0.817142224  0.044520339 -0.007891746 -0.543088979
 [51]  1.400734251  1.009751522  0.925687747  0.469088408  0.603698706
 [56]  1.024200937  1.736022521 -0.820652985 -0.891955329  0.129517627
 [61] -0.401097430  0.254103366 -0.284667709  1.482873164 -0.074545411
 [66]  0.126750460  1.310048925  0.641123341 -0.074219863 -0.855584304
 [71]  1.047069101 -0.100977264 -0.708068258 -1.147631133  0.657084889
 [76] -1.051462296 -0.477722142  1.356238248  0.946952884  1.410369529
 [81]  0.049878913  2.320035478  0.859894787 -0.483146740 -0.528608382
 [86]  1.244784830 -0.671260136  0.526959791  0.468247932 -0.306310164
 [91] -1.466612428 -0.585888238  0.011823424 -1.111106120  1.179586386
 [96] -0.445191050 -0.135432312  0.547833094 -1.413455506 -0.437943441
> rowMin(tmp2)
  [1] -1.104017002 -0.017664335 -0.178780514 -0.727246273 -0.901763774
  [6]  1.955030429  0.104918105  0.297119525 -0.729292646  1.187730108
 [11] -0.728239162 -0.864632613 -0.242802745  0.253999702  0.820172151
 [16] -0.172249433 -1.961043513 -0.572097877 -0.524732599 -1.874304148
 [21] -1.586719214 -1.299753259  1.509885349  1.619307825  1.403274886
 [26] -0.500578197 -0.130472954  0.042712999  0.671742029  0.441926522
 [31]  0.577277471 -0.046068559  1.761373365  0.899425866  0.851538189
 [36]  1.037036815  1.311210932  0.425510316 -0.991810498 -0.312885144
 [41] -0.590238535 -0.525009426 -0.834843498 -0.287720776 -0.076031665
 [46] -0.111020461  0.817142224  0.044520339 -0.007891746 -0.543088979
 [51]  1.400734251  1.009751522  0.925687747  0.469088408  0.603698706
 [56]  1.024200937  1.736022521 -0.820652985 -0.891955329  0.129517627
 [61] -0.401097430  0.254103366 -0.284667709  1.482873164 -0.074545411
 [66]  0.126750460  1.310048925  0.641123341 -0.074219863 -0.855584304
 [71]  1.047069101 -0.100977264 -0.708068258 -1.147631133  0.657084889
 [76] -1.051462296 -0.477722142  1.356238248  0.946952884  1.410369529
 [81]  0.049878913  2.320035478  0.859894787 -0.483146740 -0.528608382
 [86]  1.244784830 -0.671260136  0.526959791  0.468247932 -0.306310164
 [91] -1.466612428 -0.585888238  0.011823424 -1.111106120  1.179586386
 [96] -0.445191050 -0.135432312  0.547833094 -1.413455506 -0.437943441
> 
> colMeans(tmp2)
[1] 0.08856677
> colSums(tmp2)
[1] 8.856677
> colVars(tmp2)
[1] 0.8382006
> colSd(tmp2)
[1] 0.9155329
> colMax(tmp2)
[1] 2.320035
> colMin(tmp2)
[1] -1.961044
> colMedians(tmp2)
[1] -0.03186645
> colRanges(tmp2)
          [,1]
[1,] -1.961044
[2,]  2.320035
> 
> dataset1 <- matrix(dataset1,1,100)
> 
> agree.checks(tmp,dataset1)
> 
> dataset2 <- matrix(dataset2,100,1)
> agree.checks(tmp2,dataset2)
>   
> 
> tmp <- createBufferedMatrix(10,10)
> 
> tmp[1:10,1:10] <- rnorm(100)
> colApply(tmp,sum)
 [1]  0.8485783  1.1901315  1.5528981  0.6418093  5.5311329 -1.4435328
 [7] -2.9249092  0.8421520  1.4854504  1.5545575
> colApply(tmp,quantile)[,1]
            [,1]
[1,] -1.24016854
[2,] -0.56679317
[3,] -0.07829484
[4,]  0.73430244
[5,]  1.64453773
> 
> rowApply(tmp,sum)
 [1] -1.4899624  2.5299814  3.5096417  3.7239882 -0.5329733  0.6943045
 [7]  1.8370022  0.8164722 -0.8314437 -0.9787427
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    9    6    7    4    3   10    2    5    6     3
 [2,]    4    3   10    7    8    5    8    6    4     2
 [3,]   10   10    3    8    2    2    1    7    5     4
 [4,]    5    8    1    5    6    6    5   10    2     6
 [5,]    7    9    4    2   10    8    4    8    7    10
 [6,]    1    4    6    6    1    9    6    2    9     8
 [7,]    2    1    5    9    7    1   10    4    1     7
 [8,]    8    2    8    1    9    7    3    3   10     5
 [9,]    6    5    9   10    5    3    9    1    3     1
[10,]    3    7    2    3    4    4    7    9    8     9
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1] -1.7923501  1.1944933 -2.8652045  0.9077630 -1.7380067  0.3249314
 [7]  0.9352180  2.8553766  1.8294058  3.1188288  2.2192703  1.4587726
[13] -1.6517426 -2.0248773 -2.0979513 -0.8111302 -0.9284961 -1.7004005
[19] -1.8675937  1.6557991
> colApply(tmp,quantile)[,1]
            [,1]
[1,] -1.28661481
[2,] -1.12555058
[3,] -0.05775008
[4,]  0.24758913
[5,]  0.42997626
> 
> rowApply(tmp,sum)
[1]  1.4175309 -4.1060497  3.3640624 -0.9133941 -0.7400435
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]   12    2    8   15    2
[2,]    5   20   18   11    9
[3,]    3   10    6    2   12
[4,]   13   16   14   13    5
[5,]    1   14   16    4    6
> 
> 
> as.matrix(tmp)
            [,1]        [,2]        [,3]       [,4]       [,5]        [,6]
[1,]  0.24758913 -0.54053344 -0.93801616  0.3928053 -1.5073349  0.59788583
[2,] -1.28661481  1.06087442 -0.30430022  0.4795318  0.3568340 -0.07124379
[3,] -0.05775008  0.98172882 -0.34945814  0.5601037  0.9032294  0.55094396
[4,]  0.42997626 -0.01675152 -1.20755803  0.1294014 -0.9473578 -1.01262460
[5,] -1.12555058 -0.29082494 -0.06587193 -0.6540794 -0.5433774  0.25997002
            [,7]       [,8]       [,9]      [,10]      [,11]      [,12]
[1,]  0.55752933  1.9996814  0.1986749  0.3946373  1.3645650 -0.1951611
[2,] -0.03331992  0.3808884  0.8076929 -0.7939652 -0.6849064 -1.1282911
[3,] -0.43823764  0.3810998  1.5114888  0.2001081  0.8481916 -0.3193567
[4,] -0.07414280  1.0961792 -0.5823803  0.7619209  0.1378138  2.2506145
[5,]  0.92338907 -1.0024722 -0.1060706  2.5561277  0.5536063  0.8509669
          [,13]       [,14]       [,15]      [,16]      [,17]       [,18]
[1,] -0.9110161  0.48070751 -0.07287014 -1.1273712  0.4837681 -0.03677658
[2,] -0.5344009 -1.16747319  0.98316938 -1.3448105 -1.0286668 -0.13004686
[3,] -0.3691012 -1.01545134 -1.81282461  0.5373163  0.9525790  0.06200975
[4,] -0.8708308 -0.23804184 -0.40850013  1.4814677  0.8390687 -1.87967122
[5,]  1.0336064 -0.08461843 -0.78692576 -0.3577326 -2.1752450  0.28408438
           [,19]       [,20]
[1,]  0.09501982 -0.06625313
[2,]  0.64094410 -0.30794511
[3,] -1.37465407  1.61209698
[4,] -0.92842135  0.12644365
[5,] -0.30048220  0.29145672
> 
> 
> is.BufferedMatrix(tmp)
[1] TRUE
> 
> as.BufferedMatrix(as.matrix(tmp))
BufferedMatrix object
Matrix size:  5 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  800  bytes.
> 
> 
> 
> subBufferedMatrix(tmp,1:5,1:5)
BufferedMatrix object
Matrix size:  5 5 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  653  bytes.
Disk usage :  200  bytes.
> subBufferedMatrix(tmp,,5:8)
BufferedMatrix object
Matrix size:  5 4 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  566  bytes.
Disk usage :  160  bytes.
> subBufferedMatrix(tmp,1:3,)
BufferedMatrix object
Matrix size:  3 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  480  bytes.
> 
> 
> rm(tmp)
> 
> 
> ###
> ### Testing colnames and rownames
> ###
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> 
> 
> colnames(tmp)
NULL
> rownames(tmp)
NULL
> 
> 
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> colnames(tmp)
 [1] "col1"  "col2"  "col3"  "col4"  "col5"  "col6"  "col7"  "col8"  "col9" 
[10] "col10" "col11" "col12" "col13" "col14" "col15" "col16" "col17" "col18"
[19] "col19" "col20"
> rownames(tmp)
[1] "row1" "row2" "row3" "row4" "row5"
> 
> 
> tmp["row1",]
           col1       col2      col3       col4      col5      col6       col7
row1 -0.2276757 -0.8193833 -1.783518 -0.1787637 0.1543568 -1.763538 -0.7372914
          col8      col9     col10       col11     col12     col13      col14
row1 -1.727735 0.6912298 -1.300577 -0.03782672 -1.897777 -1.926523 -0.4263533
       col15      col16      col17     col18     col19      col20
row1 1.79988 0.08401175 -0.2917408 0.8861536 -1.956086 -0.9311743
> tmp[,"col10"]
          col10
row1 -1.3005772
row2  0.2378077
row3  1.6091638
row4 -0.3018916
row5 -1.4554893
> tmp[c("row1","row5"),]
            col1       col2      col3       col4      col5       col6
row1 -0.22767575 -0.8193833 -1.783518 -0.1787637 0.1543568 -1.7635380
row5 -0.04583301  0.2897789  1.128586  0.6073813 1.6321527 -0.8992768
           col7      col8       col9     col10       col11      col12
row1 -0.7372914 -1.727735  0.6912298 -1.300577 -0.03782672 -1.8977772
row5 -0.1429186 -1.234755 -1.4894860 -1.455489 -0.43474097  0.6963783
          col13       col14      col15       col16      col17       col18
row1 -1.9265230 -0.42635326  1.7998800  0.08401175 -0.2917408  0.88615358
row5  0.6416629 -0.05979417 -0.3293824 -0.21244613  0.6844406 -0.05644689
         col19      col20
row1 -1.956086 -0.9311743
row5 -1.029211 -0.7650093
> tmp[,c("col6","col20")]
           col6      col20
row1 -1.7635380 -0.9311743
row2  0.3668528  1.1429210
row3 -0.5420612  0.9421160
row4 -0.2987381  1.9236624
row5 -0.8992768 -0.7650093
> tmp[c("row1","row5"),c("col6","col20")]
           col6      col20
row1 -1.7635380 -0.9311743
row5 -0.8992768 -0.7650093
> 
> 
> 
> 
> tmp["row1",] <- rnorm(20,mean=10)
> tmp[,"col10"] <- rnorm(5,mean=30)
> tmp[c("row1","row5"),] <- rnorm(40,mean=50)
> tmp[,c("col6","col20")] <- rnorm(10,mean=75)
> tmp[c("row1","row5"),c("col6","col20")]  <- rnorm(4,mean=105)
> 
> tmp["row1",]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 52.60267 48.96062 51.47311 48.40722 47.56381 107.3601 48.52015 50.84419
         col9    col10    col11    col12    col13   col14    col15    col16
row1 50.14208 49.14263 48.50113 49.38533 49.66938 48.8326 51.01908 51.79112
        col17    col18    col19    col20
row1 49.74966 51.28384 50.05099 105.2022
> tmp[,"col10"]
        col10
row1 49.14263
row2 28.59444
row3 29.77341
row4 31.22277
row5 49.73854
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 52.60267 48.96062 51.47311 48.40722 47.56381 107.3601 48.52015 50.84419
row5 50.44651 51.95515 48.10771 49.66881 49.41380 103.8128 49.40291 50.35382
         col9    col10    col11    col12    col13    col14    col15    col16
row1 50.14208 49.14263 48.50113 49.38533 49.66938 48.83260 51.01908 51.79112
row5 49.13349 49.73854 50.41552 48.98578 49.60981 49.17325 47.20820 48.43017
        col17    col18    col19    col20
row1 49.74966 51.28384 50.05099 105.2022
row5 51.13420 50.08949 47.56349 103.9172
> tmp[,c("col6","col20")]
          col6     col20
row1 107.36008 105.20222
row2  76.50513  74.32682
row3  74.23356  74.87052
row4  74.40406  73.37542
row5 103.81283 103.91717
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 107.3601 105.2022
row5 103.8128 103.9172
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 107.3601 105.2022
row5 103.8128 103.9172
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
          col13
[1,] -0.8888219
[2,] -0.3035370
[3,]  1.3012205
[4,] -0.1800881
[5,]  1.2776035
> tmp[,c("col17","col7")]
          col17       col7
[1,] -0.9278814  1.2622463
[2,] -0.6848948 -1.2214166
[3,] -0.3311894 -1.5492767
[4,] -0.1800304 -0.2976911
[5,] -2.1924486 -0.2045351
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
           col6      col20
[1,] -1.1220570  1.0660000
[2,] -1.5891374  0.1094108
[3,]  0.3578106  0.1708695
[4,] -1.1687548  0.2488152
[5,] -0.2514072 -0.2192465
> subBufferedMatrix(tmp,1,c("col6"))[,1]
          col1
[1,] -1.122057
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
          col6
[1,] -1.122057
[2,] -1.589137
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> 
> 
> 
> subBufferedMatrix(tmp,c("row3","row1"),)[,1:20]
         [,1]       [,2]       [,3]     [,4]        [,5]       [,6]      [,7]
row3 0.902290 -0.2192666  0.3625043 0.770037 -0.67221348  1.1169913 1.1179702
row1 1.666026 -0.7170617 -1.9929972 1.533274  0.03722287 -0.1978978 0.3415202
          [,8]         [,9]     [,10]       [,11]      [,12]       [,13]
row3 1.3456468  0.003361037 1.1618437 -0.04745075 -0.6121526  0.08835299
row1 0.9348196 -1.542716707 0.4638198 -1.54126505 -1.3244050 -0.54351554
           [,14]      [,15]      [,16]      [,17]     [,18]      [,19]
row3 -1.18021444  0.6673839  1.1578706 -0.9520332 -1.146223 -0.4611129
row1 -0.05051172 -2.4297701 -0.5447831  0.0687536  1.233630  0.9607197
          [,20]
row3  2.7065824
row1 -0.3084945
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
         [,1]       [,2]       [,3]     [,4]      [,5]      [,6]     [,7]
row2 1.214969 -0.2123972 0.05713681 1.200336 0.3642883 0.6935614 1.099308
           [,8]         [,9]     [,10]
row2 -0.3422075 -0.007727529 0.5002928
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
         [,1]      [,2]     [,3]      [,4]      [,5]     [,6]      [,7]
row5 1.994474 0.8841465 2.729092 0.1069457 -1.241079 1.265521 -0.761235
          [,8]       [,9]    [,10]   [,11]     [,12]      [,13]     [,14]
row5 -0.296666 -0.5402214 -1.50332 1.27851 0.3106352 -0.5584043 0.4618078
        [,15]     [,16]    [,17]     [,18]     [,19]      [,20]
row5 1.301706 0.4035195 1.227767 0.9992419 0.6279042 -0.1123033
> 
> 
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> colnames(tmp)
 [1] "col1"  "col2"  "col3"  "col4"  "col5"  "col6"  "col7"  "col8"  "col9" 
[10] "col10" "col11" "col12" "col13" "col14" "col15" "col16" "col17" "col18"
[19] "col19" "col20"
> rownames(tmp)
[1] "row1" "row2" "row3" "row4" "row5"
> 
> 
> colnames(tmp) <- NULL
> rownames(tmp) <- NULL
> 
> colnames(tmp)
NULL
> rownames(tmp)
NULL
> 
> 
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> dimnames(tmp)
[[1]]
[1] "row1" "row2" "row3" "row4" "row5"

[[2]]
 [1] "col1"  "col2"  "col3"  "col4"  "col5"  "col6"  "col7"  "col8"  "col9" 
[10] "col10" "col11" "col12" "col13" "col14" "col15" "col16" "col17" "col18"
[19] "col19" "col20"

> 
> dimnames(tmp) <- NULL
> 
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> dimnames(tmp)
[[1]]
NULL

[[2]]
 [1] "col1"  "col2"  "col3"  "col4"  "col5"  "col6"  "col7"  "col8"  "col9" 
[10] "col10" "col11" "col12" "col13" "col14" "col15" "col16" "col17" "col18"
[19] "col19" "col20"

> 
> 
> dimnames(tmp) <- NULL
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> dimnames(tmp)
[[1]]
[1] "row1" "row2" "row3" "row4" "row5"

[[2]]
NULL

> 
> dimnames(tmp) <- list(NULL,c(colnames(tmp,do.NULL=FALSE)))
> dimnames(tmp)
[[1]]
NULL

[[2]]
 [1] "col1"  "col2"  "col3"  "col4"  "col5"  "col6"  "col7"  "col8"  "col9" 
[10] "col10" "col11" "col12" "col13" "col14" "col15" "col16" "col17" "col18"
[19] "col19" "col20"

> 
> 
> 
> ###
> ### Testing logical indexing
> ###
> ###
> 
> tmp <- createBufferedMatrix(230,15)
> tmp[1:230,1:15] <- rnorm(230*15)
> x <-tmp[1:230,1:15]  
> 
> for (rep in 1:10){
+   which.cols <- sample(c(TRUE,FALSE),15,replace=T)
+   which.rows <- sample(c(TRUE,FALSE),230,replace=T)
+   
+   if (!all(tmp[which.rows,which.cols] == x[which.rows,which.cols])){
+     stop("No agreement when logical indexing\n")
+   }
+   
+   if (!all(subBufferedMatrix(tmp,,which.cols)[,1:sum(which.cols)] ==  x[,which.cols])){
+     stop("No agreement when logical indexing in subBufferedMatrix cols\n")
+   }
+   if (!all(subBufferedMatrix(tmp,which.rows,)[1:sum(which.rows),] ==  x[which.rows,])){
+     stop("No agreement when logical indexing in subBufferedMatrix rows\n")
+   }
+   
+   
+   if (!all(subBufferedMatrix(tmp,which.rows,which.cols)[1:sum(which.rows),1:sum(which.cols)]==  x[which.rows,which.cols])){
+     stop("No agreement when logical indexing in subBufferedMatrix rows and columns\n")
+   }
+ }
> 
> 
> ##
> ## Test the ReadOnlyMode
> ##
> 
> ReadOnlyMode(tmp)
<pointer: 0x61ff518a6830>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1dd3017c939574"
 [2] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1dd3013d74d9f4"
 [3] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1dd3013cdb1708"
 [4] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1dd301391d66c1"
 [5] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1dd3011fe61560"
 [6] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1dd3013afb9522"
 [7] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1dd3011d29b8e1"
 [8] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1dd30137640973"
 [9] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1dd301156d41f" 
[10] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1dd301422f84d7"
[11] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1dd301540b60d2"
[12] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1dd301aeb82e5" 
[13] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1dd3017df82659"
[14] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1dd3013f433252"
[15] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1dd3014bd7c1df"
> 
> 
> ### testing coercion functions
> ###
> 
> tmp <- as(tmp,"matrix")
> tmp <- as(tmp,"BufferedMatrix")
> 
> 
> 
> ### testing whether can move storage from one location to another
> 
> MoveStorageDirectory(tmp,"NewDirectory",full.path=FALSE)
<pointer: 0x61ff52e162f0>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x61ff52e162f0>
Warning message:
In dir.create(new.directory) :
  '/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x61ff52e162f0>
> rowMedians(tmp)
  [1]  0.125095635 -0.113096861 -0.573621818 -0.291988920 -0.520803247
  [6] -0.139814286 -0.307115073  0.474522413  0.218613322  0.647667840
 [11]  0.307066657 -0.260841250  0.304832160 -0.060266252  0.624278309
 [16]  0.415712476 -0.251648156 -0.333638248  0.021122222 -0.541662735
 [21] -0.073726115 -0.156329078 -0.064629062 -0.070490622 -0.036670445
 [26]  0.075359572  0.437306494 -0.070409624 -0.043022274 -0.217326681
 [31]  0.097216272  0.465987280  0.415557651 -0.247021469 -0.489049137
 [36]  0.507805151 -0.256091310 -0.314995731  0.237280911 -0.391149766
 [41] -0.045251928  0.103403316  0.101246128 -0.018866972 -0.082552502
 [46] -0.070663756  0.324517910  0.156041756 -0.019632563  0.574934565
 [51]  0.591018283  0.133458337 -0.214739716  0.032305884  0.267431483
 [56]  0.176320218  0.290173979 -0.088501379 -0.278127332 -0.114005880
 [61]  0.186944369 -0.203851220 -0.172334982  0.299525097 -0.251278425
 [66] -0.442779065 -0.366997467  0.196405245  0.023926585  0.063344289
 [71]  0.460439851 -0.539824700  0.107220598  0.170509967  0.057967388
 [76] -0.020640727 -0.267727731  0.201584912  0.249183398  0.143867648
 [81]  0.344700703  0.170328156  0.583905757 -0.819673971 -0.092719815
 [86]  0.043655147 -0.322869496  0.174014235  0.052625727  0.423397916
 [91] -0.219042510 -0.108956997 -0.082757729 -0.035925631 -0.071580924
 [96]  0.080397710 -0.185499496 -0.033915408  0.306404208  0.065715835
[101] -0.444289573  0.412266232  0.258444568  0.160001620 -0.130407125
[106] -0.024480075 -0.195590840 -0.507821652  0.435128459 -0.959239586
[111] -0.170985651  0.054497925 -0.512841550  0.046016485 -0.014148484
[116]  0.510743565  0.125237891  0.037479092 -0.264229937 -0.331625154
[121] -0.027610562  0.119395397 -0.145219195  0.324049942  0.276456843
[126]  0.283319879  0.114424938  0.544218552  0.078000920  0.269850379
[131]  0.018954904 -0.353234762  0.787980018 -0.197957038  0.055545425
[136] -0.265989750  0.081405668  0.253527196  0.841016562 -0.469178589
[141] -0.544023201  0.141246585  0.326419863 -0.153906727 -0.136468376
[146] -0.396023435 -0.053650096  0.218893634  0.239083435  0.151026108
[151] -0.498592116 -0.177797585 -0.274397141  0.191959496  0.490521880
[156]  0.077954861 -0.269528037 -0.001910436  0.459036392  0.331704195
[161]  0.610173673  0.245940671 -0.568768095  0.780613619 -0.043511858
[166]  0.196088333  0.172471953  0.378200262  0.083613482  0.173596236
[171]  0.333418347 -0.210125559 -0.319239250 -0.199335272 -0.082397828
[176] -0.077844687  0.072350294  0.050963028 -0.285533672 -0.394638190
[181] -0.241946573  0.143198340 -0.472354005 -0.107724689 -0.278773023
[186] -0.276915632 -0.428029810  0.095192497  0.654377819 -0.263079176
[191]  0.590796502 -0.436982604 -0.042370394  0.074014474  0.413414377
[196]  0.107348273 -0.155233764 -0.227310215 -0.579708133 -0.203879929
[201] -0.262015732  0.074366554 -0.211066185 -0.116123486 -0.077953656
[206] -0.402907339  0.225268432  0.286718709 -0.135266924  0.128770981
[211]  0.122967118 -0.211867447 -0.163393738 -0.408580624 -0.132834420
[216] -0.585864721 -0.382187728 -0.016184938 -0.499083770  0.560825848
[221] -0.249448177 -0.148021434 -0.178111471 -0.333956304 -0.125388431
[226] -0.261737376  0.265351873 -0.096100666  0.511238267  0.164276019
> 
> proc.time()
   user  system elapsed 
  1.283   1.452   2.724 

BufferedMatrix.Rcheck/tests/rawCalltesting.Rout


R Under development (unstable) (2025-10-20 r88955) -- "Unsuffered Consequences"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(BufferedMatrix);library.dynam("BufferedMatrix","BufferedMatrix", .libPaths());

Attaching package: 'BufferedMatrix'

The following objects are masked from 'package:base':

    colMeans, colSums, rowMeans, rowSums

> 
> prefix <- "dbmtest"
> directory <- getwd()
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_Test_C",P)
RBufferedMatrix
Checking dimensions
Rows: 5
Cols: 5
Buffer Rows: 1
Buffer Cols: 1

Assigning Values
0.000000 1.000000 2.000000 3.000000 4.000000 
1.000000 2.000000 3.000000 4.000000 5.000000 
2.000000 3.000000 4.000000 5.000000 6.000000 
3.000000 4.000000 5.000000 6.000000 7.000000 
4.000000 5.000000 6.000000 7.000000 8.000000 

<pointer: 0x6259f7785b20>
> .Call("R_bm_Test_C2",P)
Checking dimensions
Rows: 5
Cols: 5
Buffer Rows: 1
Buffer Cols: 1

Printing Values
0.000000 1.000000 2.000000 3.000000 4.000000 
1.000000 2.000000 3.000000 4.000000 5.000000 
2.000000 3.000000 4.000000 5.000000 6.000000 
3.000000 4.000000 5.000000 6.000000 7.000000 
4.000000 5.000000 6.000000 7.000000 8.000000 

<pointer: 0x6259f7785b20>
> .Call("R_bm_Test_C",P)
RBufferedMatrix
Checking dimensions
Rows: 5
Cols: 10
Buffer Rows: 1
Buffer Cols: 1

Assigning Values
0.000000 1.000000 2.000000 3.000000 4.000000 
1.000000 2.000000 3.000000 4.000000 5.000000 
2.000000 3.000000 4.000000 5.000000 6.000000 
3.000000 4.000000 5.000000 6.000000 7.000000 
4.000000 5.000000 6.000000 7.000000 8.000000 

<pointer: 0x6259f7785b20>
> .Call("R_bm_Test_C2",P)
Checking dimensions
Rows: 5
Cols: 10
Buffer Rows: 1
Buffer Cols: 1

Printing Values
0.000000 1.000000 2.000000 3.000000 4.000000 0.000000 0.000000 0.000000 0.000000 0.000000 
1.000000 2.000000 3.000000 4.000000 5.000000 0.000000 0.000000 0.000000 0.000000 0.000000 
2.000000 3.000000 4.000000 5.000000 6.000000 0.000000 0.000000 0.000000 0.000000 0.000000 
3.000000 4.000000 5.000000 6.000000 7.000000 0.000000 0.000000 0.000000 0.000000 0.000000 
4.000000 5.000000 6.000000 7.000000 8.000000 0.000000 0.000000 0.000000 0.000000 0.000000 

<pointer: 0x6259f7785b20>
> rm(P)
> 
> #P <- .Call("R_bm_Destroy",P)
> #.Call("R_bm_Destroy",P)
> #.Call("R_bm_Test_C",P)
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,5)
[1] TRUE
> .Call("R_bm_Test_C2",P)
Checking dimensions
Rows: 5
Cols: 0
Buffer Rows: 1
Buffer Cols: 1

Printing Values






<pointer: 0x6259f7766410>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6259f7766410>
> .Call("R_bm_Test_C2",P)
Checking dimensions
Rows: 5
Cols: 1
Buffer Rows: 1
Buffer Cols: 1

Printing Values
0.000000 
0.000000 
0.000000 
0.000000 
0.000000 

<pointer: 0x6259f7766410>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6259f7766410>
> .Call("R_bm_Test_C2",P)
Checking dimensions
Rows: 5
Cols: 2
Buffer Rows: 1
Buffer Cols: 1

Printing Values
0.000000 0.000000 
0.000000 0.000000 
0.000000 0.000000 
0.000000 0.000000 
0.000000 0.000000 

<pointer: 0x6259f7766410>
> rm(P)
> 
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,5)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x6259f60137a0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6259f60137a0>
> .Call("R_bm_Test_C2",P)
Checking dimensions
Rows: 5
Cols: 2
Buffer Rows: 1
Buffer Cols: 1

Printing Values
0.000000 0.000000 
0.000000 0.000000 
0.000000 0.000000 
0.000000 0.000000 
0.000000 0.000000 

<pointer: 0x6259f60137a0>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x6259f60137a0>
> .Call("R_bm_Test_C2",P)
Checking dimensions
Rows: 5
Cols: 2
Buffer Rows: 5
Buffer Cols: 5

Printing Values
0.000000 0.000000 
0.000000 0.000000 
0.000000 0.000000 
0.000000 0.000000 
0.000000 0.000000 

<pointer: 0x6259f60137a0>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x6259f60137a0>
> .Call("R_bm_Test_C2",P)
Checking dimensions
Rows: 5
Cols: 2
Buffer Rows: 5
Buffer Cols: 5

Printing Values
0.000000 0.000000 
0.000000 0.000000 
0.000000 0.000000 
0.000000 0.000000 
0.000000 0.000000 

<pointer: 0x6259f60137a0>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x6259f60137a0>
> .Call("R_bm_Test_C2",P)
Checking dimensions
Rows: 5
Cols: 2
Buffer Rows: 5
Buffer Cols: 5

Printing Values
0.000000 0.000000 
0.000000 0.000000 
0.000000 0.000000 
0.000000 0.000000 
0.000000 0.000000 

<pointer: 0x6259f60137a0>
> rm(P)
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x6259f6fe5680>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x6259f6fe5680>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6259f6fe5680>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6259f6fe5680>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile1dd41c71e50622" "BufferedMatrixFile1dd41c7d91a4d5"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile1dd41c71e50622" "BufferedMatrixFile1dd41c7d91a4d5"
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x6259f6d79490>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6259f6d79490>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x6259f6d79490>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x6259f6d79490>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x6259f6d79490>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x6259f6d79490>
> .Call("R_bm_isRowMode",P)
[1] FALSE
> rm(P)
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x6259f83d5110>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6259f83d5110>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x6259f83d5110>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x6259f83d5110>
> rm(P)
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_Test_C",P)
RBufferedMatrix
Checking dimensions
Rows: 5
Cols: 5
Buffer Rows: 1
Buffer Cols: 1

Assigning Values
0.000000 1.000000 2.000000 3.000000 4.000000 
1.000000 2.000000 3.000000 4.000000 5.000000 
2.000000 3.000000 4.000000 5.000000 6.000000 
3.000000 4.000000 5.000000 6.000000 7.000000 
4.000000 5.000000 6.000000 7.000000 8.000000 

<pointer: 0x6259f84785e0>
> .Call("R_bm_getValue",P,3,3)
[1] 6
> 
> .Call("R_bm_getValue",P,100000,10000)
[1] NA
> .Call("R_bm_setValue",P,3,3,12345.0)
[1] TRUE
> .Call("R_bm_Test_C2",P)
Checking dimensions
Rows: 5
Cols: 5
Buffer Rows: 1
Buffer Cols: 1

Printing Values
0.000000 1.000000 2.000000 3.000000 4.000000 
1.000000 2.000000 3.000000 4.000000 5.000000 
2.000000 3.000000 4.000000 5.000000 6.000000 
3.000000 4.000000 5.000000 12345.000000 7.000000 
4.000000 5.000000 6.000000 7.000000 8.000000 

<pointer: 0x6259f84785e0>
> rm(P)
> 
> proc.time()
   user  system elapsed 
  0.250   0.047   0.286 

BufferedMatrix.Rcheck/tests/Rcodetesting.Rout


R Under development (unstable) (2025-10-20 r88955) -- "Unsuffered Consequences"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(BufferedMatrix);library.dynam("BufferedMatrix","BufferedMatrix", .libPaths());

Attaching package: 'BufferedMatrix'

The following objects are masked from 'package:base':

    colMeans, colSums, rowMeans, rowSums

> 
> Temp <- createBufferedMatrix(100)
> dim(Temp)
[1] 100   0
> buffer.dim(Temp)
[1] 1 1
> 
> 
> proc.time()
   user  system elapsed 
  0.252   0.053   0.292 

Example timings