Back to Build/check report for BioC 3.22:   simplified   long
A[B]CDEFGHIJKLMNOPQRSTUVWXYZ

This page was generated on 2026-04-01 11:57 -0400 (Wed, 01 Apr 2026).

HostnameOSArch (*)R versionInstalled pkgs
nebbiolo2Linux (Ubuntu 24.04.3 LTS)x86_644.5.2 (2025-10-31) -- "[Not] Part in a Rumble" 4896
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 257/2361HostnameOS / ArchINSTALLBUILDCHECKBUILD BIN
BufferedMatrix 1.74.0  (landing page)
Ben Bolstad
Snapshot Date: 2026-03-31 13:45 -0400 (Tue, 31 Mar 2026)
git_url: https://git.bioconductor.org/packages/BufferedMatrix
git_branch: RELEASE_3_22
git_last_commit: d2ce144
git_last_commit_date: 2025-10-29 09:58:55 -0400 (Wed, 29 Oct 2025)
nebbiolo2Linux (Ubuntu 24.04.3 LTS) / x86_64  OK    OK    OK  UNNEEDED, same version is already published
See other builds for BufferedMatrix in R Universe.


CHECK results for BufferedMatrix on nebbiolo2

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.74.0
Command: /home/biocbuild/bbs-3.22-bioc/R/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/home/biocbuild/bbs-3.22-bioc/R/site-library --timings BufferedMatrix_1.74.0.tar.gz
StartedAt: 2026-03-31 21:38:25 -0400 (Tue, 31 Mar 2026)
EndedAt: 2026-03-31 21:38:49 -0400 (Tue, 31 Mar 2026)
EllapsedTime: 24.0 seconds
RetCode: 0
Status:   OK  
CheckDir: BufferedMatrix.Rcheck
Warnings: 0

Command output

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


* using log directory ‘/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck’
* using R version 4.5.2 (2025-10-31)
* 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.4 LTS
* using session charset: UTF-8
* checking for file ‘BufferedMatrix/DESCRIPTION’ ... OK
* this is package ‘BufferedMatrix’ version ‘1.74.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.1) 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 ... NOTE
Note: information on .o files is not available
* 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: 2 NOTEs
See
  ‘/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/00check.log’
for details.


Installation output

BufferedMatrix.Rcheck/00install.out

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


* installing to library ‘/home/biocbuild/bbs-3.22-bioc/R/site-library’
* installing *source* package ‘BufferedMatrix’ ...
** this is package ‘BufferedMatrix’ version ‘1.74.0’
** using staged installation
** libs
using C compiler: ‘gcc (Ubuntu 13.3.0-6ubuntu2~24.04.1) 13.3.0’
gcc -std=gnu2x -I"/home/biocbuild/bbs-3.22-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.22-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.22-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.22-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.22-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.22-bioc/R/lib -lR
installing to /home/biocbuild/bbs-3.22-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 version 4.5.2 (2025-10-31) -- "[Not] Part in a Rumble"
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.239   0.051   0.281 

BufferedMatrix.Rcheck/tests/objectTesting.Rout


R version 4.5.2 (2025-10-31) -- "[Not] Part in a Rumble"
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.22-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 478284 25.6    1046725   56   639600 34.2
Vcells 884773  6.8    8388608   64  2081613 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] "Tue Mar 31 21:38:40 2026"
> 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] "Tue Mar 31 21:38:40 2026"
> 
> 
> 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: 0x5689b74761c0>
> 
> 
> 
> 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] "Tue Mar 31 21:38:40 2026"
> 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] "Tue Mar 31 21:38:40 2026"
> 
> ColMode(tmp2)
<pointer: 0x5689b74761c0>
> 
> 
> 
> ### 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,] 99.34496731 -0.14752824  0.68489120  1.9012288
[2,]  1.94018154 -0.53526936  0.02423765 -0.6053828
[3,]  0.01354895 -0.02401067  0.61651304  0.8528023
[4,] -0.22679756  2.42907983 -0.20389546  1.5696021
> ewApply(tmp5,abs)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
            [,1]       [,2]       [,3]      [,4]
[1,] 99.34496731 0.14752824 0.68489120 1.9012288
[2,]  1.94018154 0.53526936 0.02423765 0.6053828
[3,]  0.01354895 0.02401067 0.61651304 0.8528023
[4,]  0.22679756 2.42907983 0.20389546 1.5696021
> ewApply(tmp5,sqrt)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
          [,1]      [,2]      [,3]      [,4]
[1,] 9.9671946 0.3840940 0.8275815 1.3788505
[2,] 1.3929040 0.7316210 0.1556844 0.7780635
[3,] 0.1163999 0.1549538 0.7851834 0.9234729
[4,] 0.4762327 1.5585506 0.4515479 1.2528376
> 
> 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.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
          [,1]     [,2]     [,3]     [,4]
[1,] 224.01691 28.98847 33.96071 40.68973
[2,]  40.86922 32.85148 26.58108 33.38602
[3,]  26.17755 26.57355 33.46835 35.08753
[4,]  29.98912 43.01459 29.71937 39.09798
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x5689b81453b0>
> exp(tmp5)
<pointer: 0x5689b81453b0>
> log(tmp5,2)
<pointer: 0x5689b81453b0>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 466.2619
> Min(tmp5)
[1] 54.48514
> mean(tmp5)
[1] 73.05201
> Sum(tmp5)
[1] 14610.4
> Var(tmp5)
[1] 853.9801
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 91.87925 70.00689 70.87201 72.56216 70.43736 72.71053 70.81253 73.59848
 [9] 69.28761 68.35329
> rowSums(tmp5)
 [1] 1837.585 1400.138 1417.440 1451.243 1408.747 1454.211 1416.251 1471.970
 [9] 1385.752 1367.066
> rowVars(tmp5)
 [1] 7830.20502   67.48192   62.65580   91.26124   68.91452   68.54905
 [7]   66.94422   66.42783   87.23432   95.43813
> rowSd(tmp5)
 [1] 88.488446  8.214738  7.915542  9.553075  8.301477  8.279435  8.181945
 [8]  8.150327  9.339931  9.769244
> rowMax(tmp5)
 [1] 466.26185  86.62707  82.40320  89.52922  84.53095  89.41440  91.29040
 [8]  87.96513  90.22582  89.56879
> rowMin(tmp5)
 [1] 56.51895 55.32504 54.48514 59.90795 56.28767 59.39479 54.94527 61.04647
 [9] 54.76686 55.63741
> 
> colMeans(tmp5)
 [1] 111.42003  66.90965  69.51562  71.88728  72.03375  71.47223  70.46471
 [8]  69.96799  70.66907  70.54208  70.99547  71.12731  75.01210  73.45216
[15]  73.12837  72.26753  70.61551  68.47474  70.19873  70.88592
> colSums(tmp5)
 [1] 1114.2003  669.0965  695.1562  718.8728  720.3375  714.7223  704.6471
 [8]  699.6799  706.6907  705.4208  709.9547  711.2731  750.1210  734.5216
[15]  731.2837  722.6753  706.1551  684.7474  701.9873  708.8592
> colVars(tmp5)
 [1] 15660.57166   122.10193    79.34310    86.33451    69.15897    62.31223
 [7]    72.90412    55.34485    38.44647    69.43494   108.79671    92.20982
[13]    95.26894   120.87750    41.44057    69.17002    54.65528    57.63736
[19]    47.25283    92.86530
> colSd(tmp5)
 [1] 125.142206  11.049974   8.907474   9.291637   8.316187   7.893810
 [7]   8.538391   7.439412   6.200522   8.332763  10.430566   9.602594
[13]   9.760581  10.994430   6.437435   8.316851   7.392921   7.591927
[19]   6.874069   9.636664
> colMax(tmp5)
 [1] 466.26185  89.52922  89.56879  84.69035  86.62707  88.28446  82.14523
 [8]  84.53095  85.21579  83.69807  86.70067  89.41440  90.22582  91.29040
[15]  82.32825  86.46013  82.40320  80.29263  80.18056  83.59446
> colMin(tmp5)
 [1] 54.48514 55.30936 55.32504 59.38680 59.14540 59.37968 58.93196 60.29749
 [9] 64.60543 55.89945 54.94527 58.22212 55.63741 60.09208 63.13991 63.07931
[17] 60.81798 56.51895 59.90795 54.76686
> 
> 
> ### 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] 91.87925 70.00689 70.87201 72.56216 70.43736 72.71053       NA 73.59848
 [9] 69.28761 68.35329
> rowSums(tmp5)
 [1] 1837.585 1400.138 1417.440 1451.243 1408.747 1454.211       NA 1471.970
 [9] 1385.752 1367.066
> rowVars(tmp5)
 [1] 7830.20502   67.48192   62.65580   91.26124   68.91452   68.54905
 [7]   70.65046   66.42783   87.23432   95.43813
> rowSd(tmp5)
 [1] 88.488446  8.214738  7.915542  9.553075  8.301477  8.279435  8.405383
 [8]  8.150327  9.339931  9.769244
> rowMax(tmp5)
 [1] 466.26185  86.62707  82.40320  89.52922  84.53095  89.41440        NA
 [8]  87.96513  90.22582  89.56879
> rowMin(tmp5)
 [1] 56.51895 55.32504 54.48514 59.90795 56.28767 59.39479       NA 61.04647
 [9] 54.76686 55.63741
> 
> colMeans(tmp5)
 [1] 111.42003  66.90965  69.51562  71.88728  72.03375  71.47223  70.46471
 [8]  69.96799  70.66907        NA  70.99547  71.12731  75.01210  73.45216
[15]  73.12837  72.26753  70.61551  68.47474  70.19873  70.88592
> colSums(tmp5)
 [1] 1114.2003  669.0965  695.1562  718.8728  720.3375  714.7223  704.6471
 [8]  699.6799  706.6907        NA  709.9547  711.2731  750.1210  734.5216
[15]  731.2837  722.6753  706.1551  684.7474  701.9873  708.8592
> colVars(tmp5)
 [1] 15660.57166   122.10193    79.34310    86.33451    69.15897    62.31223
 [7]    72.90412    55.34485    38.44647          NA   108.79671    92.20982
[13]    95.26894   120.87750    41.44057    69.17002    54.65528    57.63736
[19]    47.25283    92.86530
> colSd(tmp5)
 [1] 125.142206  11.049974   8.907474   9.291637   8.316187   7.893810
 [7]   8.538391   7.439412   6.200522         NA  10.430566   9.602594
[13]   9.760581  10.994430   6.437435   8.316851   7.392921   7.591927
[19]   6.874069   9.636664
> colMax(tmp5)
 [1] 466.26185  89.52922  89.56879  84.69035  86.62707  88.28446  82.14523
 [8]  84.53095  85.21579        NA  86.70067  89.41440  90.22582  91.29040
[15]  82.32825  86.46013  82.40320  80.29263  80.18056  83.59446
> colMin(tmp5)
 [1] 54.48514 55.30936 55.32504 59.38680 59.14540 59.37968 58.93196 60.29749
 [9] 64.60543       NA 54.94527 58.22212 55.63741 60.09208 63.13991 63.07931
[17] 60.81798 56.51895 59.90795 54.76686
> 
> Max(tmp5,na.rm=TRUE)
[1] 466.2619
> Min(tmp5,na.rm=TRUE)
[1] 54.48514
> mean(tmp5,na.rm=TRUE)
[1] 73.06562
> Sum(tmp5,na.rm=TRUE)
[1] 14540.06
> Var(tmp5,na.rm=TRUE)
[1] 858.2559
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 91.87925 70.00689 70.87201 72.56216 70.43736 72.71053 70.83723 73.59848
 [9] 69.28761 68.35329
> rowSums(tmp5,na.rm=TRUE)
 [1] 1837.585 1400.138 1417.440 1451.243 1408.747 1454.211 1345.907 1471.970
 [9] 1385.752 1367.066
> rowVars(tmp5,na.rm=TRUE)
 [1] 7830.20502   67.48192   62.65580   91.26124   68.91452   68.54905
 [7]   70.65046   66.42783   87.23432   95.43813
> rowSd(tmp5,na.rm=TRUE)
 [1] 88.488446  8.214738  7.915542  9.553075  8.301477  8.279435  8.405383
 [8]  8.150327  9.339931  9.769244
> rowMax(tmp5,na.rm=TRUE)
 [1] 466.26185  86.62707  82.40320  89.52922  84.53095  89.41440  91.29040
 [8]  87.96513  90.22582  89.56879
> rowMin(tmp5,na.rm=TRUE)
 [1] 56.51895 55.32504 54.48514 59.90795 56.28767 59.39479 54.94527 61.04647
 [9] 54.76686 55.63741
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 111.42003  66.90965  69.51562  71.88728  72.03375  71.47223  70.46471
 [8]  69.96799  70.66907  70.56418  70.99547  71.12731  75.01210  73.45216
[15]  73.12837  72.26753  70.61551  68.47474  70.19873  70.88592
> colSums(tmp5,na.rm=TRUE)
 [1] 1114.2003  669.0965  695.1562  718.8728  720.3375  714.7223  704.6471
 [8]  699.6799  706.6907  635.0777  709.9547  711.2731  750.1210  734.5216
[15]  731.2837  722.6753  706.1551  684.7474  701.9873  708.8592
> colVars(tmp5,na.rm=TRUE)
 [1] 15660.57166   122.10193    79.34310    86.33451    69.15897    62.31223
 [7]    72.90412    55.34485    38.44647    78.10881   108.79671    92.20982
[13]    95.26894   120.87750    41.44057    69.17002    54.65528    57.63736
[19]    47.25283    92.86530
> colSd(tmp5,na.rm=TRUE)
 [1] 125.142206  11.049974   8.907474   9.291637   8.316187   7.893810
 [7]   8.538391   7.439412   6.200522   8.837919  10.430566   9.602594
[13]   9.760581  10.994430   6.437435   8.316851   7.392921   7.591927
[19]   6.874069   9.636664
> colMax(tmp5,na.rm=TRUE)
 [1] 466.26185  89.52922  89.56879  84.69035  86.62707  88.28446  82.14523
 [8]  84.53095  85.21579  83.69807  86.70067  89.41440  90.22582  91.29040
[15]  82.32825  86.46013  82.40320  80.29263  80.18056  83.59446
> colMin(tmp5,na.rm=TRUE)
 [1] 54.48514 55.30936 55.32504 59.38680 59.14540 59.37968 58.93196 60.29749
 [9] 64.60543 55.89945 54.94527 58.22212 55.63741 60.09208 63.13991 63.07931
[17] 60.81798 56.51895 59.90795 54.76686
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1] 91.87925 70.00689 70.87201 72.56216 70.43736 72.71053      NaN 73.59848
 [9] 69.28761 68.35329
> rowSums(tmp5,na.rm=TRUE)
 [1] 1837.585 1400.138 1417.440 1451.243 1408.747 1454.211    0.000 1471.970
 [9] 1385.752 1367.066
> rowVars(tmp5,na.rm=TRUE)
 [1] 7830.20502   67.48192   62.65580   91.26124   68.91452   68.54905
 [7]         NA   66.42783   87.23432   95.43813
> rowSd(tmp5,na.rm=TRUE)
 [1] 88.488446  8.214738  7.915542  9.553075  8.301477  8.279435        NA
 [8]  8.150327  9.339931  9.769244
> rowMax(tmp5,na.rm=TRUE)
 [1] 466.26185  86.62707  82.40320  89.52922  84.53095  89.41440        NA
 [8]  87.96513  90.22582  89.56879
> rowMin(tmp5,na.rm=TRUE)
 [1] 56.51895 55.32504 54.48514 59.90795 56.28767 59.39479       NA 61.04647
 [9] 54.76686 55.63741
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1] 117.28571  67.57965  69.45371  70.68109  72.26140  72.06308  70.64336
 [8]  69.15561  69.97113       NaN  72.77882  71.14943  75.00949  71.47014
[15]  73.22514  72.91666  70.56076  67.88800  69.72902  71.63049
> colSums(tmp5,na.rm=TRUE)
 [1] 1055.5714  608.2169  625.0833  636.1298  650.3526  648.5678  635.7903
 [8]  622.4005  629.7402    0.0000  655.0094  640.3449  675.0854  643.2312
[15]  659.0263  656.2499  635.0468  610.9920  627.5612  644.6744
> colVars(tmp5,na.rm=TRUE)
 [1] 17231.07287   132.31444    89.21786    80.75857    77.22085    66.17372
 [7]    81.65806    54.83839    37.77222          NA    86.61728   103.73054
[13]   107.17748    91.79236    46.51528    73.07592    61.45346    60.96915
[19]    50.67734    98.23661
> colSd(tmp5,na.rm=TRUE)
 [1] 131.267181  11.502801   9.445521   8.986577   8.787540   8.134723
 [7]   9.036485   7.405294   6.145911         NA   9.306841  10.184819
[13]  10.352656   9.580833   6.820211   8.548445   7.839226   7.808274
[19]   7.118802   9.911438
> colMax(tmp5,na.rm=TRUE)
 [1] 466.26185  89.52922  89.56879  84.69035  86.62707  88.28446  82.14523
 [8]  84.53095  85.21579      -Inf  86.70067  89.41440  90.22582  87.96513
[15]  82.32825  86.46013  82.40320  80.29263  80.18056  83.59446
> colMin(tmp5,na.rm=TRUE)
 [1] 54.48514 55.30936 55.32504 59.38680 59.14540 59.37968 58.93196 60.29749
 [9] 64.60543      Inf 60.43381 58.22212 55.63741 60.09208 63.13991 63.07931
[17] 60.81798 56.51895 59.90795 54.76686
> 
> 
> 
> 
> 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] 172.2967 304.7604 149.0903 267.2457 233.5386 216.7207 154.2336 296.1324
 [9] 127.8667 191.3211
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 172.2967 304.7604 149.0903 267.2457 233.5386 216.7207 154.2336 296.1324
 [9] 127.8667 191.3211
> 
> 
> 
> 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]  0.000000e+00 -2.842171e-14 -1.136868e-13  2.842171e-14  1.989520e-13
 [6] -8.526513e-14  5.684342e-14  4.263256e-14  0.000000e+00  5.684342e-14
[11] -8.526513e-14 -5.684342e-14  2.842171e-14  1.136868e-13  8.526513e-14
[16] -5.684342e-14  1.421085e-14  5.684342e-14  5.684342e-14  8.526513e-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)
+ }
1   4 
9   4 
5   4 
9   14 
9   17 
6   4 
2   19 
7   5 
5   14 
2   2 
8   8 
3   14 
6   9 
6   1 
4   11 
3   4 
2   15 
7   11 
9   15 
5   20 
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] 3.054453
> Min(tmp)
[1] -2.399969
> mean(tmp)
[1] 0.2742391
> Sum(tmp)
[1] 27.42391
> Var(tmp)
[1] 0.9716044
> 
> rowMeans(tmp)
[1] 0.2742391
> rowSums(tmp)
[1] 27.42391
> rowVars(tmp)
[1] 0.9716044
> rowSd(tmp)
[1] 0.9856999
> rowMax(tmp)
[1] 3.054453
> rowMin(tmp)
[1] -2.399969
> 
> colMeans(tmp)
  [1]  0.674770764 -0.088170254 -1.260533189  0.024321427  0.374758131
  [6]  1.404130258  1.023349575 -0.313441508 -0.762725967 -0.575472523
 [11]  0.171010213 -0.517091407  0.176753724  0.864248867  3.054453190
 [16] -0.894373022  1.003653883  1.200439522  0.801696154  1.518937735
 [21]  0.419405767 -0.381707032 -1.443081865 -2.045137222  0.774436533
 [26] -0.578004255  0.441175359 -1.176329073 -0.765489711  0.461434631
 [31] -0.460697707 -2.399968915  2.321675288  0.885702083 -0.678171910
 [36] -0.642182580 -0.783834460 -0.315627818  0.885875036  1.201463844
 [41]  1.410654825 -0.389889774 -0.045977780  0.941134635 -0.665040644
 [46]  0.970632374  0.578498013  0.254240467  1.082884297 -0.289104967
 [51] -0.138969640  0.614071493  0.517732077 -0.471027085  0.304705203
 [56] -0.689777824  0.337540772  0.537433873  1.149376135 -0.724757284
 [61]  0.345551042  1.875188840  0.574337211  2.098875074  2.172795983
 [66] -0.427499632  1.098867011 -0.500103225 -0.510400634  0.382004438
 [71]  0.713564014  1.088631836  0.381256070  1.851770704  2.058940384
 [76]  0.597017327  1.914805149  0.100880001  0.251013854 -1.001427426
 [81]  0.967406760 -1.390758197  0.892304097  0.309140023  0.537778505
 [86]  0.246276054 -0.773117269  0.734675331  0.988466613 -1.427911209
 [91] -0.178238451  0.671793717 -0.361478146  0.317379756 -0.908538414
 [96] -0.005703448  0.873436381 -0.895899837  1.403302419  1.471520161
> colSums(tmp)
  [1]  0.674770764 -0.088170254 -1.260533189  0.024321427  0.374758131
  [6]  1.404130258  1.023349575 -0.313441508 -0.762725967 -0.575472523
 [11]  0.171010213 -0.517091407  0.176753724  0.864248867  3.054453190
 [16] -0.894373022  1.003653883  1.200439522  0.801696154  1.518937735
 [21]  0.419405767 -0.381707032 -1.443081865 -2.045137222  0.774436533
 [26] -0.578004255  0.441175359 -1.176329073 -0.765489711  0.461434631
 [31] -0.460697707 -2.399968915  2.321675288  0.885702083 -0.678171910
 [36] -0.642182580 -0.783834460 -0.315627818  0.885875036  1.201463844
 [41]  1.410654825 -0.389889774 -0.045977780  0.941134635 -0.665040644
 [46]  0.970632374  0.578498013  0.254240467  1.082884297 -0.289104967
 [51] -0.138969640  0.614071493  0.517732077 -0.471027085  0.304705203
 [56] -0.689777824  0.337540772  0.537433873  1.149376135 -0.724757284
 [61]  0.345551042  1.875188840  0.574337211  2.098875074  2.172795983
 [66] -0.427499632  1.098867011 -0.500103225 -0.510400634  0.382004438
 [71]  0.713564014  1.088631836  0.381256070  1.851770704  2.058940384
 [76]  0.597017327  1.914805149  0.100880001  0.251013854 -1.001427426
 [81]  0.967406760 -1.390758197  0.892304097  0.309140023  0.537778505
 [86]  0.246276054 -0.773117269  0.734675331  0.988466613 -1.427911209
 [91] -0.178238451  0.671793717 -0.361478146  0.317379756 -0.908538414
 [96] -0.005703448  0.873436381 -0.895899837  1.403302419  1.471520161
> 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.674770764 -0.088170254 -1.260533189  0.024321427  0.374758131
  [6]  1.404130258  1.023349575 -0.313441508 -0.762725967 -0.575472523
 [11]  0.171010213 -0.517091407  0.176753724  0.864248867  3.054453190
 [16] -0.894373022  1.003653883  1.200439522  0.801696154  1.518937735
 [21]  0.419405767 -0.381707032 -1.443081865 -2.045137222  0.774436533
 [26] -0.578004255  0.441175359 -1.176329073 -0.765489711  0.461434631
 [31] -0.460697707 -2.399968915  2.321675288  0.885702083 -0.678171910
 [36] -0.642182580 -0.783834460 -0.315627818  0.885875036  1.201463844
 [41]  1.410654825 -0.389889774 -0.045977780  0.941134635 -0.665040644
 [46]  0.970632374  0.578498013  0.254240467  1.082884297 -0.289104967
 [51] -0.138969640  0.614071493  0.517732077 -0.471027085  0.304705203
 [56] -0.689777824  0.337540772  0.537433873  1.149376135 -0.724757284
 [61]  0.345551042  1.875188840  0.574337211  2.098875074  2.172795983
 [66] -0.427499632  1.098867011 -0.500103225 -0.510400634  0.382004438
 [71]  0.713564014  1.088631836  0.381256070  1.851770704  2.058940384
 [76]  0.597017327  1.914805149  0.100880001  0.251013854 -1.001427426
 [81]  0.967406760 -1.390758197  0.892304097  0.309140023  0.537778505
 [86]  0.246276054 -0.773117269  0.734675331  0.988466613 -1.427911209
 [91] -0.178238451  0.671793717 -0.361478146  0.317379756 -0.908538414
 [96] -0.005703448  0.873436381 -0.895899837  1.403302419  1.471520161
> colMin(tmp)
  [1]  0.674770764 -0.088170254 -1.260533189  0.024321427  0.374758131
  [6]  1.404130258  1.023349575 -0.313441508 -0.762725967 -0.575472523
 [11]  0.171010213 -0.517091407  0.176753724  0.864248867  3.054453190
 [16] -0.894373022  1.003653883  1.200439522  0.801696154  1.518937735
 [21]  0.419405767 -0.381707032 -1.443081865 -2.045137222  0.774436533
 [26] -0.578004255  0.441175359 -1.176329073 -0.765489711  0.461434631
 [31] -0.460697707 -2.399968915  2.321675288  0.885702083 -0.678171910
 [36] -0.642182580 -0.783834460 -0.315627818  0.885875036  1.201463844
 [41]  1.410654825 -0.389889774 -0.045977780  0.941134635 -0.665040644
 [46]  0.970632374  0.578498013  0.254240467  1.082884297 -0.289104967
 [51] -0.138969640  0.614071493  0.517732077 -0.471027085  0.304705203
 [56] -0.689777824  0.337540772  0.537433873  1.149376135 -0.724757284
 [61]  0.345551042  1.875188840  0.574337211  2.098875074  2.172795983
 [66] -0.427499632  1.098867011 -0.500103225 -0.510400634  0.382004438
 [71]  0.713564014  1.088631836  0.381256070  1.851770704  2.058940384
 [76]  0.597017327  1.914805149  0.100880001  0.251013854 -1.001427426
 [81]  0.967406760 -1.390758197  0.892304097  0.309140023  0.537778505
 [86]  0.246276054 -0.773117269  0.734675331  0.988466613 -1.427911209
 [91] -0.178238451  0.671793717 -0.361478146  0.317379756 -0.908538414
 [96] -0.005703448  0.873436381 -0.895899837  1.403302419  1.471520161
> colMedians(tmp)
  [1]  0.674770764 -0.088170254 -1.260533189  0.024321427  0.374758131
  [6]  1.404130258  1.023349575 -0.313441508 -0.762725967 -0.575472523
 [11]  0.171010213 -0.517091407  0.176753724  0.864248867  3.054453190
 [16] -0.894373022  1.003653883  1.200439522  0.801696154  1.518937735
 [21]  0.419405767 -0.381707032 -1.443081865 -2.045137222  0.774436533
 [26] -0.578004255  0.441175359 -1.176329073 -0.765489711  0.461434631
 [31] -0.460697707 -2.399968915  2.321675288  0.885702083 -0.678171910
 [36] -0.642182580 -0.783834460 -0.315627818  0.885875036  1.201463844
 [41]  1.410654825 -0.389889774 -0.045977780  0.941134635 -0.665040644
 [46]  0.970632374  0.578498013  0.254240467  1.082884297 -0.289104967
 [51] -0.138969640  0.614071493  0.517732077 -0.471027085  0.304705203
 [56] -0.689777824  0.337540772  0.537433873  1.149376135 -0.724757284
 [61]  0.345551042  1.875188840  0.574337211  2.098875074  2.172795983
 [66] -0.427499632  1.098867011 -0.500103225 -0.510400634  0.382004438
 [71]  0.713564014  1.088631836  0.381256070  1.851770704  2.058940384
 [76]  0.597017327  1.914805149  0.100880001  0.251013854 -1.001427426
 [81]  0.967406760 -1.390758197  0.892304097  0.309140023  0.537778505
 [86]  0.246276054 -0.773117269  0.734675331  0.988466613 -1.427911209
 [91] -0.178238451  0.671793717 -0.361478146  0.317379756 -0.908538414
 [96] -0.005703448  0.873436381 -0.895899837  1.403302419  1.471520161
> colRanges(tmp)
          [,1]        [,2]      [,3]       [,4]      [,5]    [,6]    [,7]
[1,] 0.6747708 -0.08817025 -1.260533 0.02432143 0.3747581 1.40413 1.02335
[2,] 0.6747708 -0.08817025 -1.260533 0.02432143 0.3747581 1.40413 1.02335
           [,8]      [,9]      [,10]     [,11]      [,12]     [,13]     [,14]
[1,] -0.3134415 -0.762726 -0.5754725 0.1710102 -0.5170914 0.1767537 0.8642489
[2,] -0.3134415 -0.762726 -0.5754725 0.1710102 -0.5170914 0.1767537 0.8642489
        [,15]     [,16]    [,17]   [,18]     [,19]    [,20]     [,21]     [,22]
[1,] 3.054453 -0.894373 1.003654 1.20044 0.8016962 1.518938 0.4194058 -0.381707
[2,] 3.054453 -0.894373 1.003654 1.20044 0.8016962 1.518938 0.4194058 -0.381707
         [,23]     [,24]     [,25]      [,26]     [,27]     [,28]      [,29]
[1,] -1.443082 -2.045137 0.7744365 -0.5780043 0.4411754 -1.176329 -0.7654897
[2,] -1.443082 -2.045137 0.7744365 -0.5780043 0.4411754 -1.176329 -0.7654897
         [,30]      [,31]     [,32]    [,33]     [,34]      [,35]      [,36]
[1,] 0.4614346 -0.4606977 -2.399969 2.321675 0.8857021 -0.6781719 -0.6421826
[2,] 0.4614346 -0.4606977 -2.399969 2.321675 0.8857021 -0.6781719 -0.6421826
          [,37]      [,38]    [,39]    [,40]    [,41]      [,42]       [,43]
[1,] -0.7838345 -0.3156278 0.885875 1.201464 1.410655 -0.3898898 -0.04597778
[2,] -0.7838345 -0.3156278 0.885875 1.201464 1.410655 -0.3898898 -0.04597778
         [,44]      [,45]     [,46]    [,47]     [,48]    [,49]     [,50]
[1,] 0.9411346 -0.6650406 0.9706324 0.578498 0.2542405 1.082884 -0.289105
[2,] 0.9411346 -0.6650406 0.9706324 0.578498 0.2542405 1.082884 -0.289105
          [,51]     [,52]     [,53]      [,54]     [,55]      [,56]     [,57]
[1,] -0.1389696 0.6140715 0.5177321 -0.4710271 0.3047052 -0.6897778 0.3375408
[2,] -0.1389696 0.6140715 0.5177321 -0.4710271 0.3047052 -0.6897778 0.3375408
         [,58]    [,59]      [,60]    [,61]    [,62]     [,63]    [,64]
[1,] 0.5374339 1.149376 -0.7247573 0.345551 1.875189 0.5743372 2.098875
[2,] 0.5374339 1.149376 -0.7247573 0.345551 1.875189 0.5743372 2.098875
        [,65]      [,66]    [,67]      [,68]      [,69]     [,70]    [,71]
[1,] 2.172796 -0.4274996 1.098867 -0.5001032 -0.5104006 0.3820044 0.713564
[2,] 2.172796 -0.4274996 1.098867 -0.5001032 -0.5104006 0.3820044 0.713564
        [,72]     [,73]    [,74]   [,75]     [,76]    [,77]   [,78]     [,79]
[1,] 1.088632 0.3812561 1.851771 2.05894 0.5970173 1.914805 0.10088 0.2510139
[2,] 1.088632 0.3812561 1.851771 2.05894 0.5970173 1.914805 0.10088 0.2510139
         [,80]     [,81]     [,82]     [,83]   [,84]     [,85]     [,86]
[1,] -1.001427 0.9674068 -1.390758 0.8923041 0.30914 0.5377785 0.2462761
[2,] -1.001427 0.9674068 -1.390758 0.8923041 0.30914 0.5377785 0.2462761
          [,87]     [,88]     [,89]     [,90]      [,91]     [,92]      [,93]
[1,] -0.7731173 0.7346753 0.9884666 -1.427911 -0.1782385 0.6717937 -0.3614781
[2,] -0.7731173 0.7346753 0.9884666 -1.427911 -0.1782385 0.6717937 -0.3614781
         [,94]      [,95]        [,96]     [,97]      [,98]    [,99]  [,100]
[1,] 0.3173798 -0.9085384 -0.005703448 0.8734364 -0.8958998 1.403302 1.47152
[2,] 0.3173798 -0.9085384 -0.005703448 0.8734364 -0.8958998 1.403302 1.47152
> 
> 
> Max(tmp2)
[1] 2.524082
> Min(tmp2)
[1] -2.397402
> mean(tmp2)
[1] 0.07872181
> Sum(tmp2)
[1] 7.872181
> Var(tmp2)
[1] 0.9893729
> 
> rowMeans(tmp2)
  [1]  0.17822642  0.56445764  0.06604141 -0.01094965  0.02435388  2.52408174
  [7]  0.71089876 -1.10931207  1.08426831 -0.58473893  0.32110675 -0.79312858
 [13] -0.65435877 -1.20922207  0.49372633 -0.98357641 -1.53966856 -0.71135908
 [19]  0.16735200  2.26436506  0.50826376 -0.36173604 -1.76416443  1.16089138
 [25] -1.40899994 -0.86367648 -0.66194962  2.35693165 -0.10865671  1.53844908
 [31]  0.28590669 -1.71901485 -0.64207856  0.41546142 -0.25340461  2.17650260
 [37] -1.47893289  0.64098269  0.11739028  0.31496393  0.85887455 -0.61187060
 [43]  0.48621450 -1.08762649 -0.30313896  1.05096384  1.15168112  0.16975631
 [49] -1.23137096 -0.45312658 -0.60169137 -2.39740155  1.05328521 -0.01728862
 [55] -0.19239349  1.65267716 -0.68656894  0.13715381  0.51697119  0.50183201
 [61] -0.12831555 -0.29056827  0.64988919  1.02072938 -0.19844918  1.89445332
 [67]  0.21724294  0.71666061 -0.34339626 -1.00966360  2.34676379 -1.09320488
 [73]  0.64833199 -0.93092607  0.34010025  1.20336007 -0.52655485 -0.19516898
 [79]  0.72858610 -0.91322594  0.53172673  0.48063168 -0.79975738  0.95202388
 [85]  0.38432821  1.51084668 -0.74130267  0.44927925  1.33087240  0.50485493
 [91] -1.34794315 -0.87830981  0.64541047 -1.14675038  0.30270754 -0.21046002
 [97]  1.27986410 -0.04899451 -0.58372555  0.06760863
> rowSums(tmp2)
  [1]  0.17822642  0.56445764  0.06604141 -0.01094965  0.02435388  2.52408174
  [7]  0.71089876 -1.10931207  1.08426831 -0.58473893  0.32110675 -0.79312858
 [13] -0.65435877 -1.20922207  0.49372633 -0.98357641 -1.53966856 -0.71135908
 [19]  0.16735200  2.26436506  0.50826376 -0.36173604 -1.76416443  1.16089138
 [25] -1.40899994 -0.86367648 -0.66194962  2.35693165 -0.10865671  1.53844908
 [31]  0.28590669 -1.71901485 -0.64207856  0.41546142 -0.25340461  2.17650260
 [37] -1.47893289  0.64098269  0.11739028  0.31496393  0.85887455 -0.61187060
 [43]  0.48621450 -1.08762649 -0.30313896  1.05096384  1.15168112  0.16975631
 [49] -1.23137096 -0.45312658 -0.60169137 -2.39740155  1.05328521 -0.01728862
 [55] -0.19239349  1.65267716 -0.68656894  0.13715381  0.51697119  0.50183201
 [61] -0.12831555 -0.29056827  0.64988919  1.02072938 -0.19844918  1.89445332
 [67]  0.21724294  0.71666061 -0.34339626 -1.00966360  2.34676379 -1.09320488
 [73]  0.64833199 -0.93092607  0.34010025  1.20336007 -0.52655485 -0.19516898
 [79]  0.72858610 -0.91322594  0.53172673  0.48063168 -0.79975738  0.95202388
 [85]  0.38432821  1.51084668 -0.74130267  0.44927925  1.33087240  0.50485493
 [91] -1.34794315 -0.87830981  0.64541047 -1.14675038  0.30270754 -0.21046002
 [97]  1.27986410 -0.04899451 -0.58372555  0.06760863
> 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]  0.17822642  0.56445764  0.06604141 -0.01094965  0.02435388  2.52408174
  [7]  0.71089876 -1.10931207  1.08426831 -0.58473893  0.32110675 -0.79312858
 [13] -0.65435877 -1.20922207  0.49372633 -0.98357641 -1.53966856 -0.71135908
 [19]  0.16735200  2.26436506  0.50826376 -0.36173604 -1.76416443  1.16089138
 [25] -1.40899994 -0.86367648 -0.66194962  2.35693165 -0.10865671  1.53844908
 [31]  0.28590669 -1.71901485 -0.64207856  0.41546142 -0.25340461  2.17650260
 [37] -1.47893289  0.64098269  0.11739028  0.31496393  0.85887455 -0.61187060
 [43]  0.48621450 -1.08762649 -0.30313896  1.05096384  1.15168112  0.16975631
 [49] -1.23137096 -0.45312658 -0.60169137 -2.39740155  1.05328521 -0.01728862
 [55] -0.19239349  1.65267716 -0.68656894  0.13715381  0.51697119  0.50183201
 [61] -0.12831555 -0.29056827  0.64988919  1.02072938 -0.19844918  1.89445332
 [67]  0.21724294  0.71666061 -0.34339626 -1.00966360  2.34676379 -1.09320488
 [73]  0.64833199 -0.93092607  0.34010025  1.20336007 -0.52655485 -0.19516898
 [79]  0.72858610 -0.91322594  0.53172673  0.48063168 -0.79975738  0.95202388
 [85]  0.38432821  1.51084668 -0.74130267  0.44927925  1.33087240  0.50485493
 [91] -1.34794315 -0.87830981  0.64541047 -1.14675038  0.30270754 -0.21046002
 [97]  1.27986410 -0.04899451 -0.58372555  0.06760863
> rowMin(tmp2)
  [1]  0.17822642  0.56445764  0.06604141 -0.01094965  0.02435388  2.52408174
  [7]  0.71089876 -1.10931207  1.08426831 -0.58473893  0.32110675 -0.79312858
 [13] -0.65435877 -1.20922207  0.49372633 -0.98357641 -1.53966856 -0.71135908
 [19]  0.16735200  2.26436506  0.50826376 -0.36173604 -1.76416443  1.16089138
 [25] -1.40899994 -0.86367648 -0.66194962  2.35693165 -0.10865671  1.53844908
 [31]  0.28590669 -1.71901485 -0.64207856  0.41546142 -0.25340461  2.17650260
 [37] -1.47893289  0.64098269  0.11739028  0.31496393  0.85887455 -0.61187060
 [43]  0.48621450 -1.08762649 -0.30313896  1.05096384  1.15168112  0.16975631
 [49] -1.23137096 -0.45312658 -0.60169137 -2.39740155  1.05328521 -0.01728862
 [55] -0.19239349  1.65267716 -0.68656894  0.13715381  0.51697119  0.50183201
 [61] -0.12831555 -0.29056827  0.64988919  1.02072938 -0.19844918  1.89445332
 [67]  0.21724294  0.71666061 -0.34339626 -1.00966360  2.34676379 -1.09320488
 [73]  0.64833199 -0.93092607  0.34010025  1.20336007 -0.52655485 -0.19516898
 [79]  0.72858610 -0.91322594  0.53172673  0.48063168 -0.79975738  0.95202388
 [85]  0.38432821  1.51084668 -0.74130267  0.44927925  1.33087240  0.50485493
 [91] -1.34794315 -0.87830981  0.64541047 -1.14675038  0.30270754 -0.21046002
 [97]  1.27986410 -0.04899451 -0.58372555  0.06760863
> 
> colMeans(tmp2)
[1] 0.07872181
> colSums(tmp2)
[1] 7.872181
> colVars(tmp2)
[1] 0.9893729
> colSd(tmp2)
[1] 0.9946723
> colMax(tmp2)
[1] 2.524082
> colMin(tmp2)
[1] -2.397402
> colMedians(tmp2)
[1] 0.09249946
> colRanges(tmp2)
          [,1]
[1,] -2.397402
[2,]  2.524082
> 
> 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] -3.88130285 -3.49012279 -4.34288888  3.24842393 -0.08460884 -5.68011676
 [7] -0.13876197 -1.39581933 -7.63549625 -0.12252003
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -1.8597817
[2,] -1.0734976
[3,] -0.3729861
[4,]  0.1410766
[5,]  0.9303040
> 
> rowApply(tmp,sum)
 [1] -2.088322 -5.384675 -2.152107  3.321245 -4.076751 -3.276921 -1.566785
 [8] -7.627211  1.661778 -2.333465
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    9    7    3    1    6    5    2    4    5    10
 [2,]    2    9    6    3    1    9    6    3    6     5
 [3,]    6    8   10    8    9    2    3    7    1     2
 [4,]    4    4    4   10    4    6    9    9    9     8
 [5,]    3    2    9    4    2   10    1   10    8     7
 [6,]    8    3    1    2    7    7    4    1   10     4
 [7,]    7    5    8    5    3    3   10    8    4     3
 [8,]   10    1    2    6    8    8    8    5    2     9
 [9,]    5    6    5    7    5    1    5    2    3     1
[10,]    1   10    7    9   10    4    7    6    7     6
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1] -2.229326194  0.112503796 -2.662907496  1.357549707 -1.290332828
 [6]  0.009847135 -0.355632105 -1.166661598 -0.688894404  4.059855615
[11]  0.121084597 -1.243397835 -3.049827395  3.421038929  2.239659578
[16]  0.092315169 -1.224887826 -0.256815623  3.289531754  2.846802592
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -1.1675249
[2,] -0.7396935
[3,] -0.5316364
[4,] -0.1011897
[5,]  0.3107183
> 
> rowApply(tmp,sum)
[1] -1.2851995  3.5157860  0.9836294 -3.2099572  3.3772469
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]   10   11    3   10    3
[2,]   12    2   14   13   16
[3,]   16    4    1    2   14
[4,]   20    6    6   20    2
[5,]   11    1   19    5   13
> 
> 
> as.matrix(tmp)
           [,1]       [,2]       [,3]        [,4]        [,5]        [,6]
[1,] -0.1011897  0.1433916  0.7218569  1.33043039 -0.03528983  0.76417976
[2,]  0.3107183 -1.3551630 -0.3528387 -0.06695768 -2.57999865 -0.06237868
[3,] -1.1675249  0.5341933 -2.3202238 -0.49684192  1.91795078 -0.88787657
[4,] -0.5316364  0.1004322 -1.3175780  1.45102206 -0.88744394  0.78485495
[5,] -0.7396935  0.6896497  0.6058761 -0.86010315  0.29444881 -0.58893232
           [,7]         [,8]       [,9]     [,10]        [,11]      [,12]
[1,] -1.5934484 -1.156838174 -1.5309027 0.3065560 -0.201883658  0.5601955
[2,]  1.0865499  0.007387426  1.5037346 0.4613180  0.004949218  0.5044721
[3,] -0.2116934 -0.935213380 -1.7080345 2.0150912  1.364553217  0.2504927
[4,] -1.2458220  0.006493462  0.7596893 1.0715483 -0.570865925 -0.1884808
[5,]  1.6087817  0.911509069  0.2866187 0.2053422 -0.475668254 -2.3700773
          [,13]     [,14]      [,15]       [,16]      [,17]      [,18]
[1,] -0.9412099 0.3098331 -0.5311984 -0.52463608  1.1985943 -0.8328086
[2,] -0.5265359 0.3792244 -0.3079633  1.21817654  0.4781215  0.1252734
[3,] -0.4524106 0.8707949  1.3160124 -0.12272644 -0.2391662 -0.0091864
[4,] -1.2405845 0.9885383 -0.6585853 -0.53193042 -1.9386222  0.3109744
[5,]  0.1109134 0.8726483  2.4213942  0.05343157 -0.7238152  0.1489316
          [,19]       [,20]
[1,] -0.1439741  0.97314226
[2,]  0.3206824  2.36701414
[3,]  1.2051149  0.06032411
[4,]  1.2377026 -0.80966311
[5,]  0.6700060  0.25598519
> 
> 
> 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.22-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.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  648  bytes.
Disk usage :  200  bytes.
> subBufferedMatrix(tmp,,5:8)
BufferedMatrix object
Matrix size:  5 4 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  560  bytes.
Disk usage :  160  bytes.
> subBufferedMatrix(tmp,1:3,)
BufferedMatrix object
Matrix size:  3 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.22-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.4360155 0.1522901 0.4950431 0.9287277 -1.388014 2.045187 0.7959823
            col8       col9     col10      col11      col12    col13     col14
row1 -0.04066154 -0.4765888 0.9911629 -0.6563276 -0.6624855 1.043963 0.3553994
          col15      col16      col17     col18      col19     col20
row1 -0.5384657 -0.2859037 -0.9282345 -1.362532 -0.4412858 -1.279357
> tmp[,"col10"]
          col10
row1 0.99116293
row2 0.24351418
row3 0.18338380
row4 0.56611293
row5 0.02805106
> tmp[c("row1","row5"),]
           col1      col2      col3      col4       col5      col6       col7
row1 -0.4360155 0.1522901 0.4950431 0.9287277 -1.3880139  2.045187  0.7959823
row5 -1.3392825 0.2100977 0.1102654 0.1453685 -0.9877764 -0.964579 -0.8411413
            col8       col9      col10      col11      col12    col13
row1 -0.04066154 -0.4765888 0.99116293 -0.6563276 -0.6624855 1.043963
row5  1.23675785 -0.0635404 0.02805106  2.2571943  0.8843684 1.604915
          col14      col15      col16      col17      col18      col19
row1  0.3553994 -0.5384657 -0.2859037 -0.9282345 -1.3625324 -0.4412858
row5 -1.4100672  0.1681059  1.7197111 -1.4802382 -0.4389703 -0.4760915
          col20
row1 -1.2793572
row5  0.9234556
> tmp[,c("col6","col20")]
           col6      col20
row1  2.0451874 -1.2793572
row2 -0.3388833  0.2394536
row3 -0.6762119  0.5419491
row4 -0.4132941  1.1281489
row5 -0.9645790  0.9234556
> tmp[c("row1","row5"),c("col6","col20")]
          col6      col20
row1  2.045187 -1.2793572
row5 -0.964579  0.9234556
> 
> 
> 
> 
> 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 48.68019 48.88106 50.69699 50.00201 49.52609 104.3099 51.47515 48.84717
         col9   col10    col11    col12    col13    col14    col15    col16
row1 50.57361 50.7873 49.39321 49.04366 48.76516 49.00531 48.35434 49.89369
        col17    col18    col19    col20
row1 50.41275 50.38172 49.45382 105.7581
> tmp[,"col10"]
        col10
row1 50.78730
row2 30.07044
row3 28.98258
row4 30.06817
row5 50.25278
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 48.68019 48.88106 50.69699 50.00201 49.52609 104.3099 51.47515 48.84717
row5 50.80169 50.62691 51.45183 50.00063 50.63606 103.6394 47.55375 49.58850
         col9    col10    col11    col12    col13    col14    col15    col16
row1 50.57361 50.78730 49.39321 49.04366 48.76516 49.00531 48.35434 49.89369
row5 49.49799 50.25278 51.16473 51.03742 52.31132 50.87539 50.31252 50.47890
        col17    col18    col19    col20
row1 50.41275 50.38172 49.45382 105.7581
row5 50.71835 51.97183 49.59391 104.1741
> tmp[,c("col6","col20")]
          col6     col20
row1 104.30988 105.75806
row2  74.29005  76.13845
row3  73.07081  75.55523
row4  74.66990  75.62629
row5 103.63937 104.17410
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 104.3099 105.7581
row5 103.6394 104.1741
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 104.3099 105.7581
row5 103.6394 104.1741
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
          col13
[1,]  0.2077168
[2,] -1.1292994
[3,] -0.2775753
[4,] -0.6787059
[5,]  1.4879395
> tmp[,c("col17","col7")]
          col17       col7
[1,] -0.4777959 -0.2361998
[2,] -0.4200971  0.7388871
[3,]  2.2215576 -1.0011976
[4,] -0.7007897 -0.9544018
[5,]  0.0621173  1.0534631
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
          col6      col20
[1,] 0.1147808 -1.2679994
[2,] 1.0302075 -0.2149434
[3,] 0.8374626  0.4103501
[4,] 0.4623167 -0.8393465
[5,] 0.2156598  0.1381774
> subBufferedMatrix(tmp,1,c("col6"))[,1]
          col1
[1,] 0.1147808
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
          col6
[1,] 0.1147808
[2,] 1.0302075
> 
> 
> 
> 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  1.5045252 -0.2494987 -0.4053720 1.0312804 -0.1583072 1.958107 -1.5395897
row1 -0.4393356 -0.1035991  0.6573219 0.4102111  0.3614844 1.566607 -0.7955661
          [,8]       [,9]      [,10]     [,11]      [,12]       [,13]
row3 0.1728204 -0.4967824  2.1029909 1.1715529  0.2063601 -0.74169391
row1 0.4641361 -0.4140692 -0.8002958 0.8394585 -0.1128320  0.08990406
          [,14]      [,15]      [,16]     [,17]     [,18]      [,19]      [,20]
row3 -1.0097665 -0.8177532 -0.8302894 0.2610412 0.1231769  0.6773805  0.4648956
row1 -0.7166383 -1.3433604  0.7093545 0.9198823 0.1499701 -1.9437752 -0.1130704
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
          [,1]       [,2]     [,3]     [,4]     [,5]       [,6]      [,7]
row2 -1.565883 -0.8853593 1.511202 1.322821 1.492151 -0.6334687 0.3114497
         [,8]      [,9]    [,10]
row2 -1.14347 -1.641521 0.669347
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
          [,1]       [,2]       [,3]       [,4]      [,5]      [,6]      [,7]
row5 -2.080869 -0.2459177 -0.5370843 -0.1861035 -1.113653 0.1783517 0.3632135
          [,8]       [,9]      [,10]      [,11]      [,12]      [,13]     [,14]
row5 0.9313776 0.03308942 -0.8790677 -0.7363946 -0.2233771 -0.5410624 -1.276512
           [,15]     [,16]    [,17]     [,18]     [,19]      [,20]
row5 -0.04846801 0.2746138 1.572959 -1.112148 0.4501503 -0.2802772
> 
> 
> 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: 0x5689b7fab320>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM4b87179fa3836"
 [2] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM4b8714668c360"
 [3] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM4b8714fb420f3"
 [4] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM4b87177886d49"
 [5] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM4b8711b4fde97"
 [6] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM4b8713c85d320"
 [7] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM4b87171afe727"
 [8] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM4b8714b41c977"
 [9] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM4b871480a3ab0"
[10] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM4b87119413e45"
[11] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM4b87130ee6e2f"
[12] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM4b87132a3f6eb"
[13] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM4b8712289e3c4"
[14] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM4b871411a9e08"
[15] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM4b87142ff810a"
> 
> 
> ### 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: 0x5689b86306f0>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x5689b86306f0>
Warning message:
In dir.create(new.directory) :
  '/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x5689b86306f0>
> rowMedians(tmp)
  [1]  0.1583055485  0.2327050748  0.1723834277 -0.0925766626  0.2645568437
  [6]  0.1528075309 -0.8369742938  0.4723795338  0.3403208391 -0.2941177584
 [11]  0.0880765814 -0.5627862971 -0.4949437659  0.4886455305 -0.0486975691
 [16]  0.3429215643  0.5001981654 -0.6091833521 -0.2090051140  0.1194783067
 [21] -0.4716415833  0.3225697485  0.0355475450 -0.3586134913 -0.5424235550
 [26] -0.0484339299  0.0704813776 -0.2858887780  0.2370029302 -0.1868254350
 [31] -0.3486340614  0.0877107421 -0.1760328682  0.1466316275 -0.0913970341
 [36] -0.0705202239 -0.5351692527 -0.2479144828  0.1411225614  0.5812563819
 [41]  0.1652933822  0.0937202520 -0.3221834950 -0.0568539836 -0.2424429423
 [46]  0.1816410263  0.2030423722 -0.1930200645 -0.1410416410 -0.0669630254
 [51] -0.2968047559  0.0262702762  0.4613995169 -0.2492300029 -0.5194104999
 [56]  0.0182769960 -0.1261771875  0.1013013885  0.2961196209 -0.2315773578
 [61]  0.2517167870  0.1307266427  0.3929088216  0.1100751811 -0.2569672848
 [66] -0.2069418136 -0.0571040175  0.5845994685 -0.0249207259 -0.2849148904
 [71]  0.7662795243 -0.1118529289  0.0674182807 -0.6330556099  0.0325422267
 [76]  0.1231020934  0.6937166333  0.3259681826 -0.2650275241 -0.0724537325
 [81] -0.3234665462 -0.4140955773 -0.1303024520 -0.1004523775  0.1941676722
 [86] -0.1069844716 -0.1839936277 -0.0145298665 -0.0153781714  0.1955570008
 [91] -0.2716695107 -0.1592627432 -0.0798497328 -0.3170774374  0.3233698697
 [96] -0.7147192984 -0.2153582699 -0.0030154025 -0.4389061556  0.1060913735
[101] -0.1453720715 -0.1540101723 -0.1509207281 -0.6229544841  0.1916849511
[106] -0.1592803307  0.4192981713 -0.1404077368 -0.3992434684  0.3282230239
[111]  0.0294758744  0.1035038197  0.0543663040 -0.4572393458 -0.1522716980
[116] -0.2020921827 -0.2094079452  0.3304481415 -0.3141778209 -0.0402685377
[121]  0.2609033337  0.2231993884 -0.5137662220 -0.1633294725  0.7893588000
[126]  0.3096246792 -0.2296629179 -0.2994747827  0.1374176753 -0.2900877518
[131] -0.4056165182 -0.4199662600 -0.0439050094 -0.1319338867 -0.0682344957
[136] -0.0840365081  0.3715790200  0.3083457771  0.0295531483 -0.2582106256
[141]  0.0720478438 -0.0001295606 -0.5418689029 -0.5386251189 -0.0850536318
[146] -0.1364641369 -0.0441612917 -0.3668101214 -0.0800092596 -0.2395015354
[151] -0.0053546678  0.2408598087 -0.0037092651  0.2765198366  0.0484233805
[156] -0.0404148172  0.1588132861 -0.2609913086  0.1246519097 -0.2871014002
[161]  0.2341162940  0.0394049860  0.3772960414 -0.4983545730  0.4170279925
[166]  0.2739649529  0.1203743659 -0.2851729883 -0.1210878114  0.1005282625
[171]  0.0149174479 -0.4401555367  0.3955452550  0.6148992423  0.1720115291
[176] -0.1943331624 -0.9086364276  0.5668386987 -0.1947576600 -0.3868973529
[181] -0.4652571147  0.2047095317 -0.2651387817 -0.1889498927  0.2687641633
[186]  0.0267240474  0.3546194455  0.1455744657 -0.2043094021 -0.4161489200
[191]  0.3582238234 -0.2243596478 -0.1370613968  0.0244539666 -0.0653020876
[196]  0.2538834884  0.5151162215 -0.0029551458 -0.3393691938 -0.2323340509
[201]  0.0020251945 -0.7832184467 -0.4704869974  0.3245076420  0.2787656790
[206] -0.2845668368 -0.2672188701 -0.2063069460 -0.3532418286  0.1311943479
[211]  0.2609756350  0.0409720789 -0.5628917490 -0.0793023233 -0.3159967738
[216]  0.1377307448  0.2330992704  0.1625046007 -0.1299989222  0.3249300104
[221] -0.0695367903 -0.1444381347  0.3214261584 -0.0887790175 -0.5801705630
[226]  0.0694045715 -0.2757684259 -0.0655081376  0.1171017688 -0.3082158283
> 
> proc.time()
   user  system elapsed 
  1.272   0.676   1.937 

BufferedMatrix.Rcheck/tests/rawCalltesting.Rout


R version 4.5.2 (2025-10-31) -- "[Not] Part in a Rumble"
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: 0x5e428b4091c0>
> .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: 0x5e428b4091c0>
> .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: 0x5e428b4091c0>
> .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: 0x5e428b4091c0>
> 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: 0x5e428b6ec120>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5e428b6ec120>
> .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: 0x5e428b6ec120>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5e428b6ec120>
> .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: 0x5e428b6ec120>
> 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: 0x5e428a3a04a0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5e428a3a04a0>
> .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: 0x5e428a3a04a0>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x5e428a3a04a0>
> .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: 0x5e428a3a04a0>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x5e428a3a04a0>
> .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: 0x5e428a3a04a0>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x5e428a3a04a0>
> .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: 0x5e428a3a04a0>
> 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: 0x5e428a43c390>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x5e428a43c390>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5e428a43c390>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5e428a43c390>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile4b9842428eb28" "BufferedMatrixFile4b984955cab0" 
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile4b9842428eb28" "BufferedMatrixFile4b984955cab0" 
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x5e428a3333d0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5e428a3333d0>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x5e428a3333d0>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x5e428a3333d0>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x5e428a3333d0>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x5e428a3333d0>
> .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: 0x5e428be68fa0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5e428be68fa0>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x5e428be68fa0>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x5e428be68fa0>
> 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: 0x5e428c3e25d0>
> .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: 0x5e428c3e25d0>
> rm(P)
> 
> proc.time()
   user  system elapsed 
  0.236   0.052   0.276 

BufferedMatrix.Rcheck/tests/Rcodetesting.Rout


R version 4.5.2 (2025-10-31) -- "[Not] Part in a Rumble"
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.254   0.053   0.296 

Example timings