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

This page was generated on 2026-04-09 11:35 -0400 (Thu, 09 Apr 2026).

HostnameOSArch (*)R versionInstalled pkgs
nebbiolo1Linux (Ubuntu 24.04.4 LTS)x86_644.6.0 alpha (2026-04-05 r89794) 4912
kjohnson3macOS 13.7.7 Venturaarm64R Under development (unstable) (2026-03-26 r89717) -- "Unsuffered Consequences" 4623
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 258/2388HostnameOS / ArchINSTALLBUILDCHECKBUILD BIN
BufferedMatrix 1.75.0  (landing page)
Ben Bolstad
Snapshot Date: 2026-04-08 13:40 -0400 (Wed, 08 Apr 2026)
git_url: https://git.bioconductor.org/packages/BufferedMatrix
git_branch: devel
git_last_commit: ecdbf23
git_last_commit_date: 2025-10-29 09:58:55 -0400 (Wed, 29 Oct 2025)
nebbiolo1Linux (Ubuntu 24.04.4 LTS) / x86_64  OK    OK    OK  UNNEEDED, same version is already published
kjohnson3macOS 13.7.7 Ventura / arm64  OK    OK    WARNINGS    OK  UNNEEDED, same version is already published
See other builds for BufferedMatrix in R Universe.


CHECK results for BufferedMatrix on nebbiolo1

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

raw results


Summary

Package: BufferedMatrix
Version: 1.75.0
Command: /home/biocbuild/bbs-3.23-bioc/R/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/home/biocbuild/bbs-3.23-bioc/R/site-library --timings BufferedMatrix_1.75.0.tar.gz
StartedAt: 2026-04-08 21:55:06 -0400 (Wed, 08 Apr 2026)
EndedAt: 2026-04-08 21:55:31 -0400 (Wed, 08 Apr 2026)
EllapsedTime: 25.1 seconds
RetCode: 0
Status:   OK  
CheckDir: BufferedMatrix.Rcheck
Warnings: 0

Command output

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


* using log directory ‘/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck’
* using R version 4.6.0 alpha (2026-04-05 r89794)
* using platform: x86_64-pc-linux-gnu
* R was compiled by
    gcc (Ubuntu 13.3.0-6ubuntu2~24.04.1) 13.3.0
    GNU Fortran (Ubuntu 13.3.0-6ubuntu2~24.04.1) 13.3.0
* running under: Ubuntu 24.04.4 LTS
* using session charset: UTF-8
* current time: 2026-04-09 01:55:07 UTC
* checking for file ‘BufferedMatrix/DESCRIPTION’ ... OK
* this is package ‘BufferedMatrix’ version ‘1.75.0’
* checking package namespace information ... OK
* checking package dependencies ... OK
* checking if this is a source package ... OK
* checking if there is a namespace ... OK
* checking for hidden files and directories ... OK
* checking for portable file names ... OK
* checking for sufficient/correct file permissions ... OK
* checking whether package ‘BufferedMatrix’ can be installed ... OK
* used C compiler: ‘gcc (Ubuntu 13.3.0-6ubuntu2~24.04.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 ... INFO
Note: information on .o files is not available
* checking sizes of PDF files under ‘inst/doc’ ...* checking files in ‘vignettes’ ... OK
* checking examples ... NONE
* checking for unstated dependencies in ‘tests’ ... OK
* checking tests ...
  Running ‘Rcodetesting.R’
  Running ‘c_code_level_tests.R’
  Running ‘objectTesting.R’
  Running ‘rawCalltesting.R’
 OK
* checking for unstated dependencies in vignettes ... OK
* checking package vignettes ... OK
* checking re-building of vignette outputs ... OK
* checking PDF version of manual ... OK
* DONE

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


Installation output

BufferedMatrix.Rcheck/00install.out

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


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

Tests output

BufferedMatrix.Rcheck/tests/c_code_level_tests.Rout


R version 4.6.0 alpha (2026-04-05 r89794)
Copyright (C) 2026 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.242   0.051   0.282 

BufferedMatrix.Rcheck/tests/objectTesting.Rout


R version 4.6.0 alpha (2026-04-05 r89794)
Copyright (C) 2026 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu

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

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

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

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

Attaching package: 'BufferedMatrix'

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

    colMeans, colSums, rowMeans, rowSums

> 
> 
> ### this is used to control how many repetitions in something below
> ### higher values result in more checks.
> nreps <-100 ##20000
> 
> 
> ## test creation and some simple assignments and subsetting operations
> 
> ## first on single elements
> tmp <- createBufferedMatrix(1000,10)
> 
> tmp[10,5]
[1] 0
> tmp[10,5] <- 10
> tmp[10,5]
[1] 10
> tmp[10,5] <- 12.445
> tmp[10,5]
[1] 12.445
> 
> 
> 
> ## now testing accessing multiple elements
> tmp2 <- createBufferedMatrix(10,20)
> 
> 
> tmp2[3,1] <- 51.34
> tmp2[9,2] <- 9.87654
> tmp2[,1:2]
       [,1]    [,2]
 [1,]  0.00 0.00000
 [2,]  0.00 0.00000
 [3,] 51.34 0.00000
 [4,]  0.00 0.00000
 [5,]  0.00 0.00000
 [6,]  0.00 0.00000
 [7,]  0.00 0.00000
 [8,]  0.00 0.00000
 [9,]  0.00 9.87654
[10,]  0.00 0.00000
> tmp2[,-(3:20)]
       [,1]    [,2]
 [1,]  0.00 0.00000
 [2,]  0.00 0.00000
 [3,] 51.34 0.00000
 [4,]  0.00 0.00000
 [5,]  0.00 0.00000
 [6,]  0.00 0.00000
 [7,]  0.00 0.00000
 [8,]  0.00 0.00000
 [9,]  0.00 9.87654
[10,]  0.00 0.00000
> tmp2[3,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
[1,] 51.34    0    0    0    0    0    0    0    0     0     0     0     0
     [,14] [,15] [,16] [,17] [,18] [,19] [,20]
[1,]     0     0     0     0     0     0     0
> tmp2[-3,]
      [,1]    [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [2,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [3,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [4,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [5,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [6,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [7,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [8,]    0 9.87654    0    0    0    0    0    0    0     0     0     0     0
 [9,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
      [,14] [,15] [,16] [,17] [,18] [,19] [,20]
 [1,]     0     0     0     0     0     0     0
 [2,]     0     0     0     0     0     0     0
 [3,]     0     0     0     0     0     0     0
 [4,]     0     0     0     0     0     0     0
 [5,]     0     0     0     0     0     0     0
 [6,]     0     0     0     0     0     0     0
 [7,]     0     0     0     0     0     0     0
 [8,]     0     0     0     0     0     0     0
 [9,]     0     0     0     0     0     0     0
> tmp2[2,1:3]
     [,1] [,2] [,3]
[1,]    0    0    0
> tmp2[3:9,1:3]
      [,1]    [,2] [,3]
[1,] 51.34 0.00000    0
[2,]  0.00 0.00000    0
[3,]  0.00 0.00000    0
[4,]  0.00 0.00000    0
[5,]  0.00 0.00000    0
[6,]  0.00 0.00000    0
[7,]  0.00 9.87654    0
> tmp2[-4,-4]
       [,1]    [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [2,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [3,] 51.34 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [4,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [5,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [6,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [7,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [8,]  0.00 9.87654    0    0    0    0    0    0    0     0     0     0     0
 [9,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
      [,14] [,15] [,16] [,17] [,18] [,19]
 [1,]     0     0     0     0     0     0
 [2,]     0     0     0     0     0     0
 [3,]     0     0     0     0     0     0
 [4,]     0     0     0     0     0     0
 [5,]     0     0     0     0     0     0
 [6,]     0     0     0     0     0     0
 [7,]     0     0     0     0     0     0
 [8,]     0     0     0     0     0     0
 [9,]     0     0     0     0     0     0
> 
> ## now testing accessing/assigning multiple elements
> tmp3 <- createBufferedMatrix(10,10)
> 
> for (i in 1:10){
+   for (j in 1:10){
+     tmp3[i,j] <- (j-1)*10 + i
+   }
+ }
> 
> tmp3[2:4,2:4]
     [,1] [,2] [,3]
[1,]   12   22   32
[2,]   13   23   33
[3,]   14   24   34
> tmp3[c(-10),c(2:4,2:4,10,1,2,1:10,10:1)]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]   11   21   31   11   21   31   91    1   11     1    11    21    31
 [2,]   12   22   32   12   22   32   92    2   12     2    12    22    32
 [3,]   13   23   33   13   23   33   93    3   13     3    13    23    33
 [4,]   14   24   34   14   24   34   94    4   14     4    14    24    34
 [5,]   15   25   35   15   25   35   95    5   15     5    15    25    35
 [6,]   16   26   36   16   26   36   96    6   16     6    16    26    36
 [7,]   17   27   37   17   27   37   97    7   17     7    17    27    37
 [8,]   18   28   38   18   28   38   98    8   18     8    18    28    38
 [9,]   19   29   39   19   29   39   99    9   19     9    19    29    39
      [,14] [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24] [,25]
 [1,]    41    51    61    71    81    91    91    81    71    61    51    41
 [2,]    42    52    62    72    82    92    92    82    72    62    52    42
 [3,]    43    53    63    73    83    93    93    83    73    63    53    43
 [4,]    44    54    64    74    84    94    94    84    74    64    54    44
 [5,]    45    55    65    75    85    95    95    85    75    65    55    45
 [6,]    46    56    66    76    86    96    96    86    76    66    56    46
 [7,]    47    57    67    77    87    97    97    87    77    67    57    47
 [8,]    48    58    68    78    88    98    98    88    78    68    58    48
 [9,]    49    59    69    79    89    99    99    89    79    69    59    49
      [,26] [,27] [,28] [,29]
 [1,]    31    21    11     1
 [2,]    32    22    12     2
 [3,]    33    23    13     3
 [4,]    34    24    14     4
 [5,]    35    25    15     5
 [6,]    36    26    16     6
 [7,]    37    27    17     7
 [8,]    38    28    18     8
 [9,]    39    29    19     9
> tmp3[-c(1:5),-c(6:10)]
     [,1] [,2] [,3] [,4] [,5]
[1,]    6   16   26   36   46
[2,]    7   17   27   37   47
[3,]    8   18   28   38   48
[4,]    9   19   29   39   49
[5,]   10   20   30   40   50
> 
> ## assignment of whole columns
> tmp3[,1] <- c(1:10*100.0)
> tmp3[,1:2] <- tmp3[,1:2]*100
> tmp3[,1:2] <- tmp3[,2:1]
> tmp3[,1:2]
      [,1]  [,2]
 [1,] 1100 1e+04
 [2,] 1200 2e+04
 [3,] 1300 3e+04
 [4,] 1400 4e+04
 [5,] 1500 5e+04
 [6,] 1600 6e+04
 [7,] 1700 7e+04
 [8,] 1800 8e+04
 [9,] 1900 9e+04
[10,] 2000 1e+05
> 
> 
> tmp3[,-1] <- tmp3[,1:9]
> tmp3[,1:10]
      [,1] [,2]  [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,] 1100 1100 1e+04   21   31   41   51   61   71    81
 [2,] 1200 1200 2e+04   22   32   42   52   62   72    82
 [3,] 1300 1300 3e+04   23   33   43   53   63   73    83
 [4,] 1400 1400 4e+04   24   34   44   54   64   74    84
 [5,] 1500 1500 5e+04   25   35   45   55   65   75    85
 [6,] 1600 1600 6e+04   26   36   46   56   66   76    86
 [7,] 1700 1700 7e+04   27   37   47   57   67   77    87
 [8,] 1800 1800 8e+04   28   38   48   58   68   78    88
 [9,] 1900 1900 9e+04   29   39   49   59   69   79    89
[10,] 2000 2000 1e+05   30   40   50   60   70   80    90
> 
> tmp3[,1:2] <- rep(1,10)
> tmp3[,1:2] <- rep(1,20)
> tmp3[,1:2] <- matrix(c(1:5),1,5)
> 
> tmp3[,-c(1:8)] <- matrix(c(1:5),1,5)
> 
> tmp3[1,] <- 1:10
> tmp3[1,]
     [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,]    1    2    3    4    5    6    7    8    9    10
> tmp3[-1,] <- c(1,2)
> tmp3[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    1    2    3    4    5    6    7    8    9    10
 [2,]    1    2    1    2    1    2    1    2    1     2
 [3,]    2    1    2    1    2    1    2    1    2     1
 [4,]    1    2    1    2    1    2    1    2    1     2
 [5,]    2    1    2    1    2    1    2    1    2     1
 [6,]    1    2    1    2    1    2    1    2    1     2
 [7,]    2    1    2    1    2    1    2    1    2     1
 [8,]    1    2    1    2    1    2    1    2    1     2
 [9,]    2    1    2    1    2    1    2    1    2     1
[10,]    1    2    1    2    1    2    1    2    1     2
> tmp3[-c(1:8),] <- matrix(c(1:5),1,5)
> tmp3[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    1    2    3    4    5    6    7    8    9    10
 [2,]    1    2    1    2    1    2    1    2    1     2
 [3,]    2    1    2    1    2    1    2    1    2     1
 [4,]    1    2    1    2    1    2    1    2    1     2
 [5,]    2    1    2    1    2    1    2    1    2     1
 [6,]    1    2    1    2    1    2    1    2    1     2
 [7,]    2    1    2    1    2    1    2    1    2     1
 [8,]    1    2    1    2    1    2    1    2    1     2
 [9,]    1    3    5    2    4    1    3    5    2     4
[10,]    2    4    1    3    5    2    4    1    3     5
> 
> 
> tmp3[1:2,1:2] <- 5555.04
> tmp3[-(1:2),1:2] <- 1234.56789
> 
> 
> 
> ## testing accessors for the directory and prefix
> directory(tmp3)
[1] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests"
> prefix(tmp3)
[1] "BM"
> 
> ## testing if we can remove these objects
> rm(tmp, tmp2, tmp3)
> gc()
         used (Mb) gc trigger (Mb) max used (Mb)
Ncells 480193 25.7    1053195 56.3   637568 34.1
Vcells 887233  6.8    8388608 64.0  2083868 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] "Wed Apr  8 21:55:21 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] "Wed Apr  8 21:55:22 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: 0x5b94b4f04a60>
> 
> 
> 
> 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] "Wed Apr  8 21:55:22 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] "Wed Apr  8 21:55:22 2026"
> 
> ColMode(tmp2)
<pointer: 0x5b94b4f04a60>
> 
> 
> 
> ### 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,] 102.22801838 -0.5479141 -0.61772721 -2.5743474
[2,]  -0.54643275 -0.2566035  0.06297128  0.6299464
[3,]  -0.02299227 -1.3669563 -1.61425764 -0.9066420
[4,]  -1.45108536  0.8286448  0.53059993  0.5478683
> ewApply(tmp5,abs)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
             [,1]      [,2]       [,3]      [,4]
[1,] 102.22801838 0.5479141 0.61772721 2.5743474
[2,]   0.54643275 0.2566035 0.06297128 0.6299464
[3,]   0.02299227 1.3669563 1.61425764 0.9066420
[4,]   1.45108536 0.8286448 0.53059993 0.5478683
> ewApply(tmp5,sqrt)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
           [,1]      [,2]      [,3]      [,4]
[1,] 10.1107872 0.7402122 0.7859562 1.6044773
[2,]  0.7392109 0.5065605 0.2509408 0.7936916
[3,]  0.1516320 1.1691691 1.2705344 0.9521775
[4,]  1.2046100 0.9102993 0.7284229 0.7401813
> 
> my.function <- function(x,power){
+   (x+5)^power
+ }
> 
> ewApply(tmp5,my.function,power=2)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
          [,1]     [,2]     [,3]     [,4]
[1,] 228.33589 32.95004 33.47729 43.61912
[2,]  32.93854 30.32221 27.57238 33.56686
[3,]  26.53931 38.05865 39.31960 35.42842
[4,]  38.49719 34.93164 32.81483 32.94968
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x5b94b4e85e20>
> exp(tmp5)
<pointer: 0x5b94b4e85e20>
> log(tmp5,2)
<pointer: 0x5b94b4e85e20>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 475.2512
> Min(tmp5)
[1] 54.01339
> mean(tmp5)
[1] 72.04052
> Sum(tmp5)
[1] 14408.1
> Var(tmp5)
[1] 888.1171
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 90.45803 70.73736 69.07863 70.17387 72.49686 68.01182 68.70412 71.59587
 [9] 69.56013 69.58851
> rowSums(tmp5)
 [1] 1809.161 1414.747 1381.573 1403.477 1449.937 1360.236 1374.082 1431.917
 [9] 1391.203 1391.770
> rowVars(tmp5)
 [1] 8267.00788  121.96546   51.77245   89.96485   60.98182   54.85048
 [7]   49.59104   56.96217   60.69039   74.28965
> rowSd(tmp5)
 [1] 90.923088 11.043797  7.195307  9.484980  7.809086  7.406111  7.042091
 [8]  7.547328  7.790404  8.619144
> rowMax(tmp5)
 [1] 475.25124  89.24057  81.83860  96.58106  88.49831  87.42483  82.55667
 [8]  85.25241  82.93233  87.00318
> rowMin(tmp5)
 [1] 56.93579 54.01339 55.23810 54.06954 55.75890 54.91435 58.18775 55.31388
 [9] 56.52527 54.18193
> 
> colMeans(tmp5)
 [1] 111.70092  74.43260  70.36877  71.35342  67.76939  69.44271  71.18553
 [8]  71.29739  71.22357  70.61787  70.30276  70.23722  69.43983  71.94598
[15]  70.88966  67.40847  66.54942  69.00578  67.51926  68.11981
> colSums(tmp5)
 [1] 1117.0092  744.3260  703.6877  713.5342  677.6939  694.4271  711.8553
 [8]  712.9739  712.2357  706.1787  703.0276  702.3722  694.3983  719.4598
[15]  708.8966  674.0847  665.4942  690.0578  675.1926  681.1981
> colVars(tmp5)
 [1] 16383.25689    56.26949    64.38692    88.26196   101.19589    57.96476
 [7]    74.16032    72.63004    60.07278    82.75329   112.19789    27.55397
[13]    80.99340   130.07032    73.45949    64.55504    35.00475    56.42000
[19]    37.08830    65.73570
> colSd(tmp5)
 [1] 127.997097   7.501299   8.024146   9.394784  10.059617   7.613459
 [7]   8.611639   8.522326   7.750663   9.096884  10.592350   5.249188
[13]   8.999633  11.404837   8.570851   8.034615   5.916481   7.511325
[19]   6.090017   8.107755
> colMax(tmp5)
 [1] 475.25124  87.00318  82.93233  90.78748  89.24057  76.76937  85.25241
 [8]  82.73922  81.23509  88.49831  87.42483  78.15124  85.16435  96.58106
[15]  83.50288  84.12089  75.91609  89.13397  79.59435  82.55667
> colMin(tmp5)
 [1] 55.23810 63.11170 57.38829 58.18775 54.18193 56.93579 59.08298 54.01339
 [9] 61.07696 58.64194 54.06954 62.87303 56.52527 55.31388 54.99511 55.75890
[17] 60.16011 63.47384 58.75493 54.91435
> 
> 
> ### 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] 90.45803 70.73736 69.07863 70.17387       NA 68.01182 68.70412 71.59587
 [9] 69.56013 69.58851
> rowSums(tmp5)
 [1] 1809.161 1414.747 1381.573 1403.477       NA 1360.236 1374.082 1431.917
 [9] 1391.203 1391.770
> rowVars(tmp5)
 [1] 8267.00788  121.96546   51.77245   89.96485   58.05453   54.85048
 [7]   49.59104   56.96217   60.69039   74.28965
> rowSd(tmp5)
 [1] 90.923088 11.043797  7.195307  9.484980  7.619352  7.406111  7.042091
 [8]  7.547328  7.790404  8.619144
> rowMax(tmp5)
 [1] 475.25124  89.24057  81.83860  96.58106        NA  87.42483  82.55667
 [8]  85.25241  82.93233  87.00318
> rowMin(tmp5)
 [1] 56.93579 54.01339 55.23810 54.06954       NA 54.91435 58.18775 55.31388
 [9] 56.52527 54.18193
> 
> colMeans(tmp5)
 [1] 111.70092  74.43260  70.36877  71.35342  67.76939  69.44271  71.18553
 [8]  71.29739  71.22357  70.61787  70.30276  70.23722  69.43983  71.94598
[15]        NA  67.40847  66.54942  69.00578  67.51926  68.11981
> colSums(tmp5)
 [1] 1117.0092  744.3260  703.6877  713.5342  677.6939  694.4271  711.8553
 [8]  712.9739  712.2357  706.1787  703.0276  702.3722  694.3983  719.4598
[15]        NA  674.0847  665.4942  690.0578  675.1926  681.1981
> colVars(tmp5)
 [1] 16383.25689    56.26949    64.38692    88.26196   101.19589    57.96476
 [7]    74.16032    72.63004    60.07278    82.75329   112.19789    27.55397
[13]    80.99340   130.07032          NA    64.55504    35.00475    56.42000
[19]    37.08830    65.73570
> colSd(tmp5)
 [1] 127.997097   7.501299   8.024146   9.394784  10.059617   7.613459
 [7]   8.611639   8.522326   7.750663   9.096884  10.592350   5.249188
[13]   8.999633  11.404837         NA   8.034615   5.916481   7.511325
[19]   6.090017   8.107755
> colMax(tmp5)
 [1] 475.25124  87.00318  82.93233  90.78748  89.24057  76.76937  85.25241
 [8]  82.73922  81.23509  88.49831  87.42483  78.15124  85.16435  96.58106
[15]        NA  84.12089  75.91609  89.13397  79.59435  82.55667
> colMin(tmp5)
 [1] 55.23810 63.11170 57.38829 58.18775 54.18193 56.93579 59.08298 54.01339
 [9] 61.07696 58.64194 54.06954 62.87303 56.52527 55.31388       NA 55.75890
[17] 60.16011 63.47384 58.75493 54.91435
> 
> Max(tmp5,na.rm=TRUE)
[1] 475.2512
> Min(tmp5,na.rm=TRUE)
[1] 54.01339
> mean(tmp5,na.rm=TRUE)
[1] 71.986
> Sum(tmp5,na.rm=TRUE)
[1] 14325.21
> Var(tmp5,na.rm=TRUE)
[1] 892.0052
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 90.45803 70.73736 69.07863 70.17387 71.94992 68.01182 68.70412 71.59587
 [9] 69.56013 69.58851
> rowSums(tmp5,na.rm=TRUE)
 [1] 1809.161 1414.747 1381.573 1403.477 1367.048 1360.236 1374.082 1431.917
 [9] 1391.203 1391.770
> rowVars(tmp5,na.rm=TRUE)
 [1] 8267.00788  121.96546   51.77245   89.96485   58.05453   54.85048
 [7]   49.59104   56.96217   60.69039   74.28965
> rowSd(tmp5,na.rm=TRUE)
 [1] 90.923088 11.043797  7.195307  9.484980  7.619352  7.406111  7.042091
 [8]  7.547328  7.790404  8.619144
> rowMax(tmp5,na.rm=TRUE)
 [1] 475.25124  89.24057  81.83860  96.58106  88.49831  87.42483  82.55667
 [8]  85.25241  82.93233  87.00318
> rowMin(tmp5,na.rm=TRUE)
 [1] 56.93579 54.01339 55.23810 54.06954 55.75890 54.91435 58.18775 55.31388
 [9] 56.52527 54.18193
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 111.70092  74.43260  70.36877  71.35342  67.76939  69.44271  71.18553
 [8]  71.29739  71.22357  70.61787  70.30276  70.23722  69.43983  71.94598
[15]  69.55644  67.40847  66.54942  69.00578  67.51926  68.11981
> colSums(tmp5,na.rm=TRUE)
 [1] 1117.0092  744.3260  703.6877  713.5342  677.6939  694.4271  711.8553
 [8]  712.9739  712.2357  706.1787  703.0276  702.3722  694.3983  719.4598
[15]  626.0080  674.0847  665.4942  690.0578  675.1926  681.1981
> colVars(tmp5,na.rm=TRUE)
 [1] 16383.25689    56.26949    64.38692    88.26196   101.19589    57.96476
 [7]    74.16032    72.63004    60.07278    82.75329   112.19789    27.55397
[13]    80.99340   130.07032    62.64531    64.55504    35.00475    56.42000
[19]    37.08830    65.73570
> colSd(tmp5,na.rm=TRUE)
 [1] 127.997097   7.501299   8.024146   9.394784  10.059617   7.613459
 [7]   8.611639   8.522326   7.750663   9.096884  10.592350   5.249188
[13]   8.999633  11.404837   7.914879   8.034615   5.916481   7.511325
[19]   6.090017   8.107755
> colMax(tmp5,na.rm=TRUE)
 [1] 475.25124  87.00318  82.93233  90.78748  89.24057  76.76937  85.25241
 [8]  82.73922  81.23509  88.49831  87.42483  78.15124  85.16435  96.58106
[15]  83.50288  84.12089  75.91609  89.13397  79.59435  82.55667
> colMin(tmp5,na.rm=TRUE)
 [1] 55.23810 63.11170 57.38829 58.18775 54.18193 56.93579 59.08298 54.01339
 [9] 61.07696 58.64194 54.06954 62.87303 56.52527 55.31388 54.99511 55.75890
[17] 60.16011 63.47384 58.75493 54.91435
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1] 90.45803 70.73736 69.07863 70.17387      NaN 68.01182 68.70412 71.59587
 [9] 69.56013 69.58851
> rowSums(tmp5,na.rm=TRUE)
 [1] 1809.161 1414.747 1381.573 1403.477    0.000 1360.236 1374.082 1431.917
 [9] 1391.203 1391.770
> rowVars(tmp5,na.rm=TRUE)
 [1] 8267.00788  121.96546   51.77245   89.96485         NA   54.85048
 [7]   49.59104   56.96217   60.69039   74.28965
> rowSd(tmp5,na.rm=TRUE)
 [1] 90.923088 11.043797  7.195307  9.484980        NA  7.406111  7.042091
 [8]  7.547328  7.790404  8.619144
> rowMax(tmp5,na.rm=TRUE)
 [1] 475.25124  89.24057  81.83860  96.58106        NA  87.42483  82.55667
 [8]  85.25241  82.93233  87.00318
> rowMin(tmp5,na.rm=TRUE)
 [1] 56.93579 54.01339 55.23810 54.06954       NA 54.91435 58.18775 55.31388
 [9] 56.52527 54.18193
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1] 116.01022  73.41777  70.35173  72.19690  67.26629  68.62863  70.77274
 [8]  70.42679  71.51002  68.63115  69.24478  70.37399  69.55141  72.19646
[15]       NaN  68.70286  65.61843  69.62044  67.56795  68.15126
> colSums(tmp5,na.rm=TRUE)
 [1] 1044.0920  660.7599  633.1656  649.7721  605.3966  617.6577  636.9547
 [8]  633.8411  643.5902  617.6803  623.2030  633.3659  625.9627  649.7682
[15]    0.0000  618.3258  590.5659  626.5840  608.1116  613.3613
> colVars(tmp5,na.rm=TRUE)
 [1] 18222.25083    51.71680    72.43202    91.29081   110.99790    57.75480
 [7]    81.51344    73.18191    66.65875    48.69325   113.63020    30.78778
[13]    90.97751   145.62325          NA    53.77548    29.62958    59.22217
[19]    41.69766    73.94154
> colSd(tmp5,na.rm=TRUE)
 [1] 134.989818   7.191440   8.510700   9.554622  10.535554   7.599658
 [7]   9.028479   8.554643   8.164481   6.978055  10.659747   5.548674
[13]   9.538213  12.067446         NA   7.333177   5.443306   7.695594
[19]   6.457373   8.598927
> colMax(tmp5,na.rm=TRUE)
 [1] 475.25124  87.00318  82.93233  90.78748  89.24057  75.59251  85.25241
 [8]  82.73922  81.23509  78.85613  87.42483  78.15124  85.16435  96.58106
[15]      -Inf  84.12089  75.91609  89.13397  79.59435  82.55667
> colMin(tmp5,na.rm=TRUE)
 [1] 55.23810 63.11170 57.38829 58.18775 54.18193 56.93579 59.08298 54.01339
 [9] 61.07696 58.64194 54.06954 62.87303 56.52527 55.31388      Inf 58.79171
[17] 60.16011 63.77478 58.75493 54.91435
> 
> 
> 
> 
> 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] 366.1963 242.6500 444.4350 195.8097 247.3322 246.1175 226.3068 211.8888
 [9] 298.0817 328.0318
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 366.1963 242.6500 444.4350 195.8097 247.3322 246.1175 226.3068 211.8888
 [9] 298.0817 328.0318
> 
> 
> 
> 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] -5.684342e-14 -1.705303e-13 -5.684342e-14  9.947598e-14  2.842171e-14
 [6] -1.136868e-13 -2.273737e-13 -1.136868e-13  0.000000e+00  2.842171e-14
[11]  0.000000e+00  2.273737e-13  0.000000e+00 -5.684342e-14  0.000000e+00
[16] -2.273737e-13  2.557954e-13  2.842171e-14 -4.263256e-14  0.000000e+00
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> ## 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)
+ }
6   7 
1   7 
2   11 
5   11 
7   4 
9   9 
6   13 
3   14 
6   8 
1   15 
6   5 
5   12 
3   12 
8   19 
4   9 
9   6 
1   7 
8   20 
3   20 
4   9 
There were 50 or more warnings (use warnings() to see the first 50)
> 
> 
> ### now test 1 by n and n by 1 matrix
> 
> 
> err.tol <- 1e-12
> 
> rm(tmp5)
> 
> dataset1 <- rnorm(100)
> dataset2 <- rnorm(100)
> 
> tmp <- createBufferedMatrix(1,100)
> tmp[1,] <- dataset1
> 
> tmp2 <- createBufferedMatrix(100,1)
> tmp2[,1] <- dataset2
> 
> 
> 
> 
> 
> Max(tmp)
[1] 2.782981
> Min(tmp)
[1] -2.509344
> mean(tmp)
[1] -0.08778331
> Sum(tmp)
[1] -8.778331
> Var(tmp)
[1] 1.121268
> 
> rowMeans(tmp)
[1] -0.08778331
> rowSums(tmp)
[1] -8.778331
> rowVars(tmp)
[1] 1.121268
> rowSd(tmp)
[1] 1.0589
> rowMax(tmp)
[1] 2.782981
> rowMin(tmp)
[1] -2.509344
> 
> colMeans(tmp)
  [1]  0.36880253 -0.84454959  0.20302167 -2.03297516  0.93490796 -0.43662587
  [7]  0.21291317  0.86716060  1.02057524 -2.02145621  0.27276238 -0.83584633
 [13] -1.42325485  0.89051304  1.21310796  0.42281503 -0.33181932 -1.02892184
 [19]  0.67836204  2.67003630  0.95950980  0.60542578 -0.50316071  2.27983308
 [25] -0.13519742  0.94028715 -0.07048807  0.25019414 -0.25169819  0.81727018
 [31] -0.23526069  0.76297568 -0.11234630 -1.87520584  0.09960494  0.02101273
 [37]  0.43841910  0.03122152 -1.62497460 -1.05043497  0.36044532 -1.28636539
 [43]  0.02315224  0.56992320 -0.06124355  0.07443295  0.32131764  0.77164364
 [49]  1.16523788 -0.34906358 -2.50934386  2.78298146 -0.79871476 -0.23065050
 [55] -0.02198299 -1.25715050 -2.01791712  0.87070206 -0.85645113 -2.13130261
 [61]  0.52382479 -0.14637221 -0.17426425  0.65185364 -1.26921419  0.76872889
 [67] -0.98284413 -1.89587339  0.02850025 -0.60984591 -0.34274433 -0.12765081
 [73] -0.78016100 -0.75800758 -1.91024606 -1.61658297 -1.05573963  1.37934126
 [79]  1.38503833 -0.45935412  0.77858844  0.10536365 -1.19146326  0.03241893
 [85] -0.36485082 -0.02198120  0.78536220  0.94872121  0.53270582  0.33534622
 [91]  0.21039840  0.66523134  1.42725415 -0.62054910 -0.36327613 -1.52618774
 [97] -2.09344722  1.89582935  0.16158195 -0.64993055
> colSums(tmp)
  [1]  0.36880253 -0.84454959  0.20302167 -2.03297516  0.93490796 -0.43662587
  [7]  0.21291317  0.86716060  1.02057524 -2.02145621  0.27276238 -0.83584633
 [13] -1.42325485  0.89051304  1.21310796  0.42281503 -0.33181932 -1.02892184
 [19]  0.67836204  2.67003630  0.95950980  0.60542578 -0.50316071  2.27983308
 [25] -0.13519742  0.94028715 -0.07048807  0.25019414 -0.25169819  0.81727018
 [31] -0.23526069  0.76297568 -0.11234630 -1.87520584  0.09960494  0.02101273
 [37]  0.43841910  0.03122152 -1.62497460 -1.05043497  0.36044532 -1.28636539
 [43]  0.02315224  0.56992320 -0.06124355  0.07443295  0.32131764  0.77164364
 [49]  1.16523788 -0.34906358 -2.50934386  2.78298146 -0.79871476 -0.23065050
 [55] -0.02198299 -1.25715050 -2.01791712  0.87070206 -0.85645113 -2.13130261
 [61]  0.52382479 -0.14637221 -0.17426425  0.65185364 -1.26921419  0.76872889
 [67] -0.98284413 -1.89587339  0.02850025 -0.60984591 -0.34274433 -0.12765081
 [73] -0.78016100 -0.75800758 -1.91024606 -1.61658297 -1.05573963  1.37934126
 [79]  1.38503833 -0.45935412  0.77858844  0.10536365 -1.19146326  0.03241893
 [85] -0.36485082 -0.02198120  0.78536220  0.94872121  0.53270582  0.33534622
 [91]  0.21039840  0.66523134  1.42725415 -0.62054910 -0.36327613 -1.52618774
 [97] -2.09344722  1.89582935  0.16158195 -0.64993055
> 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.36880253 -0.84454959  0.20302167 -2.03297516  0.93490796 -0.43662587
  [7]  0.21291317  0.86716060  1.02057524 -2.02145621  0.27276238 -0.83584633
 [13] -1.42325485  0.89051304  1.21310796  0.42281503 -0.33181932 -1.02892184
 [19]  0.67836204  2.67003630  0.95950980  0.60542578 -0.50316071  2.27983308
 [25] -0.13519742  0.94028715 -0.07048807  0.25019414 -0.25169819  0.81727018
 [31] -0.23526069  0.76297568 -0.11234630 -1.87520584  0.09960494  0.02101273
 [37]  0.43841910  0.03122152 -1.62497460 -1.05043497  0.36044532 -1.28636539
 [43]  0.02315224  0.56992320 -0.06124355  0.07443295  0.32131764  0.77164364
 [49]  1.16523788 -0.34906358 -2.50934386  2.78298146 -0.79871476 -0.23065050
 [55] -0.02198299 -1.25715050 -2.01791712  0.87070206 -0.85645113 -2.13130261
 [61]  0.52382479 -0.14637221 -0.17426425  0.65185364 -1.26921419  0.76872889
 [67] -0.98284413 -1.89587339  0.02850025 -0.60984591 -0.34274433 -0.12765081
 [73] -0.78016100 -0.75800758 -1.91024606 -1.61658297 -1.05573963  1.37934126
 [79]  1.38503833 -0.45935412  0.77858844  0.10536365 -1.19146326  0.03241893
 [85] -0.36485082 -0.02198120  0.78536220  0.94872121  0.53270582  0.33534622
 [91]  0.21039840  0.66523134  1.42725415 -0.62054910 -0.36327613 -1.52618774
 [97] -2.09344722  1.89582935  0.16158195 -0.64993055
> colMin(tmp)
  [1]  0.36880253 -0.84454959  0.20302167 -2.03297516  0.93490796 -0.43662587
  [7]  0.21291317  0.86716060  1.02057524 -2.02145621  0.27276238 -0.83584633
 [13] -1.42325485  0.89051304  1.21310796  0.42281503 -0.33181932 -1.02892184
 [19]  0.67836204  2.67003630  0.95950980  0.60542578 -0.50316071  2.27983308
 [25] -0.13519742  0.94028715 -0.07048807  0.25019414 -0.25169819  0.81727018
 [31] -0.23526069  0.76297568 -0.11234630 -1.87520584  0.09960494  0.02101273
 [37]  0.43841910  0.03122152 -1.62497460 -1.05043497  0.36044532 -1.28636539
 [43]  0.02315224  0.56992320 -0.06124355  0.07443295  0.32131764  0.77164364
 [49]  1.16523788 -0.34906358 -2.50934386  2.78298146 -0.79871476 -0.23065050
 [55] -0.02198299 -1.25715050 -2.01791712  0.87070206 -0.85645113 -2.13130261
 [61]  0.52382479 -0.14637221 -0.17426425  0.65185364 -1.26921419  0.76872889
 [67] -0.98284413 -1.89587339  0.02850025 -0.60984591 -0.34274433 -0.12765081
 [73] -0.78016100 -0.75800758 -1.91024606 -1.61658297 -1.05573963  1.37934126
 [79]  1.38503833 -0.45935412  0.77858844  0.10536365 -1.19146326  0.03241893
 [85] -0.36485082 -0.02198120  0.78536220  0.94872121  0.53270582  0.33534622
 [91]  0.21039840  0.66523134  1.42725415 -0.62054910 -0.36327613 -1.52618774
 [97] -2.09344722  1.89582935  0.16158195 -0.64993055
> colMedians(tmp)
  [1]  0.36880253 -0.84454959  0.20302167 -2.03297516  0.93490796 -0.43662587
  [7]  0.21291317  0.86716060  1.02057524 -2.02145621  0.27276238 -0.83584633
 [13] -1.42325485  0.89051304  1.21310796  0.42281503 -0.33181932 -1.02892184
 [19]  0.67836204  2.67003630  0.95950980  0.60542578 -0.50316071  2.27983308
 [25] -0.13519742  0.94028715 -0.07048807  0.25019414 -0.25169819  0.81727018
 [31] -0.23526069  0.76297568 -0.11234630 -1.87520584  0.09960494  0.02101273
 [37]  0.43841910  0.03122152 -1.62497460 -1.05043497  0.36044532 -1.28636539
 [43]  0.02315224  0.56992320 -0.06124355  0.07443295  0.32131764  0.77164364
 [49]  1.16523788 -0.34906358 -2.50934386  2.78298146 -0.79871476 -0.23065050
 [55] -0.02198299 -1.25715050 -2.01791712  0.87070206 -0.85645113 -2.13130261
 [61]  0.52382479 -0.14637221 -0.17426425  0.65185364 -1.26921419  0.76872889
 [67] -0.98284413 -1.89587339  0.02850025 -0.60984591 -0.34274433 -0.12765081
 [73] -0.78016100 -0.75800758 -1.91024606 -1.61658297 -1.05573963  1.37934126
 [79]  1.38503833 -0.45935412  0.77858844  0.10536365 -1.19146326  0.03241893
 [85] -0.36485082 -0.02198120  0.78536220  0.94872121  0.53270582  0.33534622
 [91]  0.21039840  0.66523134  1.42725415 -0.62054910 -0.36327613 -1.52618774
 [97] -2.09344722  1.89582935  0.16158195 -0.64993055
> colRanges(tmp)
          [,1]       [,2]      [,3]      [,4]     [,5]       [,6]      [,7]
[1,] 0.3688025 -0.8445496 0.2030217 -2.032975 0.934908 -0.4366259 0.2129132
[2,] 0.3688025 -0.8445496 0.2030217 -2.032975 0.934908 -0.4366259 0.2129132
          [,8]     [,9]     [,10]     [,11]      [,12]     [,13]    [,14]
[1,] 0.8671606 1.020575 -2.021456 0.2727624 -0.8358463 -1.423255 0.890513
[2,] 0.8671606 1.020575 -2.021456 0.2727624 -0.8358463 -1.423255 0.890513
        [,15]    [,16]      [,17]     [,18]    [,19]    [,20]     [,21]
[1,] 1.213108 0.422815 -0.3318193 -1.028922 0.678362 2.670036 0.9595098
[2,] 1.213108 0.422815 -0.3318193 -1.028922 0.678362 2.670036 0.9595098
         [,22]      [,23]    [,24]      [,25]     [,26]       [,27]     [,28]
[1,] 0.6054258 -0.5031607 2.279833 -0.1351974 0.9402872 -0.07048807 0.2501941
[2,] 0.6054258 -0.5031607 2.279833 -0.1351974 0.9402872 -0.07048807 0.2501941
          [,29]     [,30]      [,31]     [,32]      [,33]     [,34]      [,35]
[1,] -0.2516982 0.8172702 -0.2352607 0.7629757 -0.1123463 -1.875206 0.09960494
[2,] -0.2516982 0.8172702 -0.2352607 0.7629757 -0.1123463 -1.875206 0.09960494
          [,36]     [,37]      [,38]     [,39]     [,40]     [,41]     [,42]
[1,] 0.02101273 0.4384191 0.03122152 -1.624975 -1.050435 0.3604453 -1.286365
[2,] 0.02101273 0.4384191 0.03122152 -1.624975 -1.050435 0.3604453 -1.286365
          [,43]     [,44]       [,45]      [,46]     [,47]     [,48]    [,49]
[1,] 0.02315224 0.5699232 -0.06124355 0.07443295 0.3213176 0.7716436 1.165238
[2,] 0.02315224 0.5699232 -0.06124355 0.07443295 0.3213176 0.7716436 1.165238
          [,50]     [,51]    [,52]      [,53]      [,54]       [,55]    [,56]
[1,] -0.3490636 -2.509344 2.782981 -0.7987148 -0.2306505 -0.02198299 -1.25715
[2,] -0.3490636 -2.509344 2.782981 -0.7987148 -0.2306505 -0.02198299 -1.25715
         [,57]     [,58]      [,59]     [,60]     [,61]      [,62]      [,63]
[1,] -2.017917 0.8707021 -0.8564511 -2.131303 0.5238248 -0.1463722 -0.1742643
[2,] -2.017917 0.8707021 -0.8564511 -2.131303 0.5238248 -0.1463722 -0.1742643
         [,64]     [,65]     [,66]      [,67]     [,68]      [,69]      [,70]
[1,] 0.6518536 -1.269214 0.7687289 -0.9828441 -1.895873 0.02850025 -0.6098459
[2,] 0.6518536 -1.269214 0.7687289 -0.9828441 -1.895873 0.02850025 -0.6098459
          [,71]      [,72]     [,73]      [,74]     [,75]     [,76]    [,77]
[1,] -0.3427443 -0.1276508 -0.780161 -0.7580076 -1.910246 -1.616583 -1.05574
[2,] -0.3427443 -0.1276508 -0.780161 -0.7580076 -1.910246 -1.616583 -1.05574
        [,78]    [,79]      [,80]     [,81]     [,82]     [,83]      [,84]
[1,] 1.379341 1.385038 -0.4593541 0.7785884 0.1053636 -1.191463 0.03241893
[2,] 1.379341 1.385038 -0.4593541 0.7785884 0.1053636 -1.191463 0.03241893
          [,85]      [,86]     [,87]     [,88]     [,89]     [,90]     [,91]
[1,] -0.3648508 -0.0219812 0.7853622 0.9487212 0.5327058 0.3353462 0.2103984
[2,] -0.3648508 -0.0219812 0.7853622 0.9487212 0.5327058 0.3353462 0.2103984
         [,92]    [,93]      [,94]      [,95]     [,96]     [,97]    [,98]
[1,] 0.6652313 1.427254 -0.6205491 -0.3632761 -1.526188 -2.093447 1.895829
[2,] 0.6652313 1.427254 -0.6205491 -0.3632761 -1.526188 -2.093447 1.895829
        [,99]     [,100]
[1,] 0.161582 -0.6499306
[2,] 0.161582 -0.6499306
> 
> 
> Max(tmp2)
[1] 2.706019
> Min(tmp2)
[1] -2.955963
> mean(tmp2)
[1] 0.1714606
> Sum(tmp2)
[1] 17.14606
> Var(tmp2)
[1] 1.02036
> 
> rowMeans(tmp2)
  [1]  1.917118720 -0.503194125  1.006877055  1.392405657 -0.485504704
  [6] -0.298845934 -0.024522657  0.056175229 -0.728137415 -0.081088265
 [11]  2.275052160  1.381370782  0.613665913  1.428024064 -1.299708146
 [16]  1.115390723  0.247033093  0.944478934 -1.035126892 -0.734368075
 [21]  0.470344853  1.147595331 -0.007633371 -0.946192126 -0.514470799
 [26]  0.894124619 -0.878402769  0.909441338  0.333211643  1.163567926
 [31]  1.273465490  1.161403568 -2.955963316  1.335452193 -0.055921662
 [36] -1.887490011 -0.293060813  1.331695859 -0.269121809  0.437069051
 [41] -0.883996817 -0.345486994  2.495555591 -0.534945800  0.983965186
 [46] -0.037402509 -0.657156723  0.531820134 -0.920346672  1.196675279
 [51] -1.345663859  0.283862931 -0.084290698 -1.909085789  0.869565173
 [56] -0.899258861  1.558357009 -0.481720950  0.638825993  0.890604994
 [61]  0.114297766  1.555428380  0.657116987 -0.129074879  0.263204973
 [66]  1.201104467  0.922924762  0.131612041  1.767423997  0.294022359
 [71] -0.118612262  0.957806291  0.084033408 -0.883598745 -2.051389301
 [76]  0.397608684 -0.590787359 -0.129077634  0.298699797  1.254644362
 [81] -0.089464166 -0.644728125  0.497449564 -0.179251034 -0.993491315
 [86] -0.657291837 -0.179039496 -0.401695796  0.151732596 -1.168636796
 [91]  2.706019445  0.830957038  0.160636103 -0.742316499 -1.242683282
 [96] -0.112041389 -0.561079716  0.744117785  1.163522589  0.679866016
> rowSums(tmp2)
  [1]  1.917118720 -0.503194125  1.006877055  1.392405657 -0.485504704
  [6] -0.298845934 -0.024522657  0.056175229 -0.728137415 -0.081088265
 [11]  2.275052160  1.381370782  0.613665913  1.428024064 -1.299708146
 [16]  1.115390723  0.247033093  0.944478934 -1.035126892 -0.734368075
 [21]  0.470344853  1.147595331 -0.007633371 -0.946192126 -0.514470799
 [26]  0.894124619 -0.878402769  0.909441338  0.333211643  1.163567926
 [31]  1.273465490  1.161403568 -2.955963316  1.335452193 -0.055921662
 [36] -1.887490011 -0.293060813  1.331695859 -0.269121809  0.437069051
 [41] -0.883996817 -0.345486994  2.495555591 -0.534945800  0.983965186
 [46] -0.037402509 -0.657156723  0.531820134 -0.920346672  1.196675279
 [51] -1.345663859  0.283862931 -0.084290698 -1.909085789  0.869565173
 [56] -0.899258861  1.558357009 -0.481720950  0.638825993  0.890604994
 [61]  0.114297766  1.555428380  0.657116987 -0.129074879  0.263204973
 [66]  1.201104467  0.922924762  0.131612041  1.767423997  0.294022359
 [71] -0.118612262  0.957806291  0.084033408 -0.883598745 -2.051389301
 [76]  0.397608684 -0.590787359 -0.129077634  0.298699797  1.254644362
 [81] -0.089464166 -0.644728125  0.497449564 -0.179251034 -0.993491315
 [86] -0.657291837 -0.179039496 -0.401695796  0.151732596 -1.168636796
 [91]  2.706019445  0.830957038  0.160636103 -0.742316499 -1.242683282
 [96] -0.112041389 -0.561079716  0.744117785  1.163522589  0.679866016
> rowVars(tmp2)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowSd(tmp2)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowMax(tmp2)
  [1]  1.917118720 -0.503194125  1.006877055  1.392405657 -0.485504704
  [6] -0.298845934 -0.024522657  0.056175229 -0.728137415 -0.081088265
 [11]  2.275052160  1.381370782  0.613665913  1.428024064 -1.299708146
 [16]  1.115390723  0.247033093  0.944478934 -1.035126892 -0.734368075
 [21]  0.470344853  1.147595331 -0.007633371 -0.946192126 -0.514470799
 [26]  0.894124619 -0.878402769  0.909441338  0.333211643  1.163567926
 [31]  1.273465490  1.161403568 -2.955963316  1.335452193 -0.055921662
 [36] -1.887490011 -0.293060813  1.331695859 -0.269121809  0.437069051
 [41] -0.883996817 -0.345486994  2.495555591 -0.534945800  0.983965186
 [46] -0.037402509 -0.657156723  0.531820134 -0.920346672  1.196675279
 [51] -1.345663859  0.283862931 -0.084290698 -1.909085789  0.869565173
 [56] -0.899258861  1.558357009 -0.481720950  0.638825993  0.890604994
 [61]  0.114297766  1.555428380  0.657116987 -0.129074879  0.263204973
 [66]  1.201104467  0.922924762  0.131612041  1.767423997  0.294022359
 [71] -0.118612262  0.957806291  0.084033408 -0.883598745 -2.051389301
 [76]  0.397608684 -0.590787359 -0.129077634  0.298699797  1.254644362
 [81] -0.089464166 -0.644728125  0.497449564 -0.179251034 -0.993491315
 [86] -0.657291837 -0.179039496 -0.401695796  0.151732596 -1.168636796
 [91]  2.706019445  0.830957038  0.160636103 -0.742316499 -1.242683282
 [96] -0.112041389 -0.561079716  0.744117785  1.163522589  0.679866016
> rowMin(tmp2)
  [1]  1.917118720 -0.503194125  1.006877055  1.392405657 -0.485504704
  [6] -0.298845934 -0.024522657  0.056175229 -0.728137415 -0.081088265
 [11]  2.275052160  1.381370782  0.613665913  1.428024064 -1.299708146
 [16]  1.115390723  0.247033093  0.944478934 -1.035126892 -0.734368075
 [21]  0.470344853  1.147595331 -0.007633371 -0.946192126 -0.514470799
 [26]  0.894124619 -0.878402769  0.909441338  0.333211643  1.163567926
 [31]  1.273465490  1.161403568 -2.955963316  1.335452193 -0.055921662
 [36] -1.887490011 -0.293060813  1.331695859 -0.269121809  0.437069051
 [41] -0.883996817 -0.345486994  2.495555591 -0.534945800  0.983965186
 [46] -0.037402509 -0.657156723  0.531820134 -0.920346672  1.196675279
 [51] -1.345663859  0.283862931 -0.084290698 -1.909085789  0.869565173
 [56] -0.899258861  1.558357009 -0.481720950  0.638825993  0.890604994
 [61]  0.114297766  1.555428380  0.657116987 -0.129074879  0.263204973
 [66]  1.201104467  0.922924762  0.131612041  1.767423997  0.294022359
 [71] -0.118612262  0.957806291  0.084033408 -0.883598745 -2.051389301
 [76]  0.397608684 -0.590787359 -0.129077634  0.298699797  1.254644362
 [81] -0.089464166 -0.644728125  0.497449564 -0.179251034 -0.993491315
 [86] -0.657291837 -0.179039496 -0.401695796  0.151732596 -1.168636796
 [91]  2.706019445  0.830957038  0.160636103 -0.742316499 -1.242683282
 [96] -0.112041389 -0.561079716  0.744117785  1.163522589  0.679866016
> 
> colMeans(tmp2)
[1] 0.1714606
> colSums(tmp2)
[1] 17.14606
> colVars(tmp2)
[1] 1.02036
> colSd(tmp2)
[1] 1.010129
> colMax(tmp2)
[1] 2.706019
> colMin(tmp2)
[1] -2.955963
> colMedians(tmp2)
[1] 0.1229549
> colRanges(tmp2)
          [,1]
[1,] -2.955963
[2,]  2.706019
> 
> dataset1 <- matrix(dataset1,1,100)
> 
> agree.checks(tmp,dataset1)
> 
> dataset2 <- matrix(dataset2,100,1)
> agree.checks(tmp2,dataset2)
>   
> 
> tmp <- createBufferedMatrix(10,10)
> 
> tmp[1:10,1:10] <- rnorm(100)
> colApply(tmp,sum)
 [1] -0.8147827  5.2567118 -1.0293798  5.2790103  4.0986456 -1.6982132
 [7] -1.1463265 -2.5840939  0.5845686 -2.0469014
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -1.9641792
[2,] -0.4799325
[3,]  0.1451809
[4,]  0.3869438
[5,]  0.9738108
> 
> rowApply(tmp,sum)
 [1]  3.2054336 -1.7146859 -0.5656949 -4.1611437 -0.5981691  1.9449752
 [7]  1.3867010  3.6690822 -2.4346912  5.1674317
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    3    8   10    7    6    2    8    1    1     6
 [2,]    9    6    6    6    4    7   10    4    4     9
 [3,]    5    5    2    1    8    3    4    5    9     5
 [4,]   10    9    5    8    9    5    2    7    5    10
 [5,]    7   10    8    5   10    9    3    8    8     7
 [6,]    1    1    4    4    3    8    7    6    3     8
 [7,]    2    4    1    9    7   10    5    9    2     2
 [8,]    8    3    7    3    2    1    1   10    7     4
 [9,]    6    7    3   10    5    4    6    3    6     1
[10,]    4    2    9    2    1    6    9    2   10     3
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1] -2.4017690  0.9979457  1.4737543 -1.8128347 -0.5384336 -1.9675548
 [7]  2.5359512 -0.3587035  1.2728531 -1.0327546  0.8751928 -1.2582169
[13] -1.8177104 -3.7926739 -1.0530569 -0.5675936 -1.5969876  1.2283519
[19]  0.4749614  2.3069366
> colApply(tmp,quantile)[,1]
            [,1]
[1,] -1.62327451
[2,] -1.37845328
[3,] -1.11575804
[4,] -0.01290426
[5,]  1.72862110
> 
> rowApply(tmp,sum)
[1] -2.693662 -9.137136  3.733346  5.046210 -3.981100
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]    5    2    9   19    2
[2,]   20    3   13    7   15
[3,]    1   19   14   20   13
[4,]   15    7    8    5    3
[5,]   16    8   15    4    4
> 
> 
> as.matrix(tmp)
            [,1]        [,2]        [,3]       [,4]       [,5]       [,6]
[1,] -1.11575804  1.47776425 -2.02312938  0.5245540  0.8379393  1.2605776
[2,] -1.62327451 -1.27710898  0.52108438 -0.8337112 -0.8271067 -2.3660312
[3,] -0.01290426  0.46838018  0.76156014 -0.1662707  0.8270589 -1.2101142
[4,]  1.72862110 -0.08792384  2.14570441 -0.1563104 -0.2495079 -0.4422665
[5,] -1.37845328  0.41683412  0.06853473 -1.1810964 -1.1268172  0.7902795
             [,7]        [,8]        [,9]       [,10]      [,11]      [,12]
[1,]  0.168204495 -0.97951386  0.47599843  0.41635204  0.3772266  1.2165156
[2,]  1.622871489  0.46225801  0.02665598 -1.18718464  0.1312040 -1.1745033
[3,] -0.190755707 -1.04286318 -0.35523996  0.01721484  1.4032349 -0.9407247
[4,]  0.928486005  0.03789706 -0.08657773 -1.29672432  0.7036332  0.3840348
[5,]  0.007144961  1.16351847  1.21201639  1.01758751 -1.7401058 -0.7435392
          [,13]      [,14]      [,15]      [,16]      [,17]       [,18]
[1,] -1.2049185 -1.7379365 -0.7020574 -0.8051995 -1.3667017  0.91056456
[2,] -0.7639618 -0.9793765  0.2993893 -0.1061364  0.2499878 -0.47862473
[3,] -0.4717630 -0.6994104  0.1020426  0.8409632  0.1190697  0.83125134
[4,] -0.8344470  0.5381619  0.2531447  0.3230633  0.4648440  0.01537935
[5,]  1.4573799 -0.9141124 -1.0055762 -0.8202842 -1.0641874 -0.05021864
           [,19]      [,20]
[1,] -0.23361211 -0.1905322
[2,] -0.13737362 -0.6961937
[3,]  1.39785501  2.0547617
[4,] -0.09953365  0.7765317
[5,] -0.45237421  0.3623691
> 
> 
> is.BufferedMatrix(tmp)
[1] TRUE
> 
> as.BufferedMatrix(as.matrix(tmp))
BufferedMatrix object
Matrix size:  5 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  800  bytes.
> 
> 
> 
> subBufferedMatrix(tmp,1:5,1:5)
BufferedMatrix object
Matrix size:  5 5 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  653  bytes.
Disk usage :  200  bytes.
> subBufferedMatrix(tmp,,5:8)
BufferedMatrix object
Matrix size:  5 4 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  565  bytes.
Disk usage :  160  bytes.
> subBufferedMatrix(tmp,1:3,)
BufferedMatrix object
Matrix size:  3 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  480  bytes.
> 
> 
> rm(tmp)
> 
> 
> ###
> ### Testing colnames and rownames
> ###
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> 
> 
> colnames(tmp)
NULL
> rownames(tmp)
NULL
> 
> 
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> colnames(tmp)
 [1] "col1"  "col2"  "col3"  "col4"  "col5"  "col6"  "col7"  "col8"  "col9" 
[10] "col10" "col11" "col12" "col13" "col14" "col15" "col16" "col17" "col18"
[19] "col19" "col20"
> rownames(tmp)
[1] "row1" "row2" "row3" "row4" "row5"
> 
> 
> tmp["row1",]
           col1      col2        col3      col4     col5       col6     col7
row1 -0.6645908 0.5097546 -0.09155558 0.2311369 1.147539 -0.3957186 1.810224
           col8      col9     col10     col11     col12    col13     col14
row1 -0.3137747 -0.146375 -1.341639 0.6835324 0.4689312 1.714353 0.5093112
       col15     col16     col17      col18     col19     col20
row1 -2.2109 0.8727238 0.1606551 -0.6239422 -2.280239 0.3047685
> tmp[,"col10"]
          col10
row1 -1.3416386
row2 -0.1860278
row3  0.3084381
row4  0.4933497
row5 -2.4469128
> tmp[c("row1","row5"),]
           col1      col2        col3      col4      col5       col6       col7
row1 -0.6645908 0.5097546 -0.09155558 0.2311369 1.1475385 -0.3957186  1.8102244
row5 -0.9003227 0.5246171 -1.64314842 0.5353422 0.1602815 -0.8957641 -0.5612133
           col8      col9     col10       col11      col12      col13
row1 -0.3137747 -0.146375 -1.341639  0.68353239  0.4689312  1.7143530
row5 -0.2943202 -1.258511 -2.446913 -0.05258836 -0.2746720 -0.8286225
          col14     col15     col16     col17      col18      col19     col20
row1  0.5093112 -2.210900 0.8727238 0.1606551 -0.6239422 -2.2802386 0.3047685
row5 -0.4812731 -1.347987 0.2462554 1.5342014  0.8357834 -0.7339656 1.1558195
> tmp[,c("col6","col20")]
           col6       col20
row1 -0.3957186  0.30476847
row2  0.4180257 -0.04913056
row3  1.6370867 -0.24196203
row4 -0.1355968  1.17304937
row5 -0.8957641  1.15581953
> tmp[c("row1","row5"),c("col6","col20")]
           col6     col20
row1 -0.3957186 0.3047685
row5 -0.8957641 1.1558195
> 
> 
> 
> 
> 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 50.12661 50.20113 49.74055 49.37185 51.38342 104.5715 51.11221 50.85746
         col9    col10    col11  col12  col13    col14   col15    col16
row1 51.07609 50.81766 49.44612 51.917 50.055 50.07292 49.7127 49.66444
        col17    col18    col19  col20
row1 50.17477 50.09752 49.35815 105.38
> tmp[,"col10"]
        col10
row1 50.81766
row2 30.84077
row3 30.63419
row4 29.08307
row5 50.53880
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 50.12661 50.20113 49.74055 49.37185 51.38342 104.5715 51.11221 50.85746
row5 50.67685 49.92436 48.72946 52.13248 50.35450 105.0089 50.91489 47.96256
         col9    col10    col11    col12    col13    col14   col15    col16
row1 51.07609 50.81766 49.44612 51.91700 50.05500 50.07292 49.7127 49.66444
row5 50.00741 50.53880 50.82948 50.45322 48.32656 50.95837 50.5587 50.05952
        col17    col18    col19    col20
row1 50.17477 50.09752 49.35815 105.3800
row5 51.40641 50.51269 50.44692 104.3503
> tmp[,c("col6","col20")]
          col6     col20
row1 104.57145 105.37995
row2  75.52462  76.30155
row3  75.38459  76.79482
row4  75.63773  75.11587
row5 105.00895 104.35029
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 104.5715 105.3800
row5 105.0089 104.3503
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 104.5715 105.3800
row5 105.0089 104.3503
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
           col13
[1,] -1.22521726
[2,] -0.15672861
[3,]  1.07083081
[4,] -0.49403645
[5,]  0.09223625
> tmp[,c("col17","col7")]
          col17        col7
[1,]  1.3547273 -0.13558094
[2,] -1.0641554  1.03899533
[3,]  0.8036014  2.74832541
[4,]  0.3528370  0.09994907
[5,]  1.7034034  0.69725561
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
            col6        col20
[1,]  0.50387292 -0.207617441
[2,]  0.24663486 -1.305376652
[3,] -0.62037377 -0.432374904
[4,]  1.04982906 -0.001242211
[5,]  0.04177502 -0.477166792
> subBufferedMatrix(tmp,1,c("col6"))[,1]
          col1
[1,] 0.5038729
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
          col6
[1,] 0.5038729
[2,] 0.2466349
> 
> 
> 
> 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]
row3  0.3393388  0.4168920  2.9542162 -0.9409385 -1.2873669 -0.7128765
row1 -0.1900407 -0.5592478 -0.1490919 -0.6405931 -0.4428428  0.2214640
           [,7]       [,8]      [,9]      [,10]     [,11]      [,12]      [,13]
row3 -1.8660891 -0.3049156 -1.208325 -0.4102736 0.5710229  0.3167068 -0.9366906
row1  0.2775958  0.9774628 -2.495443 -0.6919051 0.8448281 -0.4506171 -0.5813742
          [,14]       [,15]     [,16]      [,17]      [,18]     [,19]
row3 -0.3261990  0.02636431 0.2155853 -0.1357770  1.4052384 0.6389059
row1  0.4630998 -0.54066998 0.2266441  0.3579034 -0.4854521 0.1784158
          [,20]
row3 -1.1960819
row1 -0.3570071
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
          [,1]      [,2]      [,3]       [,4]      [,5]       [,6]      [,7]
row2 0.3611352 0.6327711 0.2582294 -0.3699529 -1.505276 -0.2293102 0.3788863
           [,8]      [,9]      [,10]
row2 -0.5217973 -1.097996 -0.3931275
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
          [,1]      [,2]       [,3]     [,4]         [,5]        [,6]      [,7]
row5 0.5427608 0.9141565 -0.2162515 0.645846 -0.002738678 -0.07897531 0.1833707
          [,8]     [,9]    [,10]      [,11]    [,12]    [,13]     [,14]
row5 0.5659947 1.639742 0.311876 -0.2928047 0.292855 -1.57558 0.6635971
         [,15]    [,16]      [,17]      [,18]    [,19]     [,20]
row5 0.1530336 0.179177 -0.6438025 -0.8080454 2.168255 0.1471226
> 
> 
> 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: 0x5b94b7058c00>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM3acf6c6544110b"
 [2] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM3acf6c6edbd82c"
 [3] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM3acf6c4d0672a6"
 [4] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM3acf6c6aac38c2"
 [5] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM3acf6c3c1f5a74"
 [6] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM3acf6c135ca84" 
 [7] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM3acf6c3d8ed584"
 [8] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM3acf6c3f08853b"
 [9] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM3acf6c360da2c6"
[10] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM3acf6c5229adb8"
[11] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM3acf6c4af50b52"
[12] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM3acf6c44a21d41"
[13] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM3acf6c5a95ce92"
[14] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM3acf6c53912970"
[15] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM3acf6c5b078ff9"
> 
> 
> ### 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: 0x5b94b4ef2400>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x5b94b4ef2400>
Warning message:
In dir.create(new.directory) :
  '/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x5b94b4ef2400>
> rowMedians(tmp)
  [1] -0.476303825  0.144757700 -0.010787967 -0.051606699  0.003485189
  [6] -0.374053767  0.059768924 -0.324986661 -0.502084233  0.106554897
 [11]  0.576384389 -0.348561287 -0.184362138  0.474642772  0.112274229
 [16] -0.315806719  0.054509612 -0.351552841  0.334589726  0.307758672
 [21]  0.201372232  0.289440184  0.226948931  0.433133039 -0.465335503
 [26]  0.169874865 -0.413802836  0.232725826 -0.373116437 -0.115929888
 [31] -0.330809894  0.003405076  0.279556363 -0.111552661  0.313742789
 [36] -0.493883989 -0.083137819 -0.132968024 -0.127491884 -0.542072549
 [41]  0.505537452 -0.354029918  0.003899922 -0.204575388  0.064447960
 [46]  0.297423063  0.058392554  0.231772916  0.142514029 -0.163224291
 [51]  0.089099589  0.160331295 -0.186375046 -0.103929978 -0.290742572
 [56] -0.141213540  0.082467787  0.053610337 -0.325518649 -0.143247951
 [61] -0.193101917  0.274149693  0.071793781  0.164333648 -0.186649578
 [66]  0.203025370  0.007306444 -0.174258018 -0.103490892  0.125032015
 [71] -0.099279462 -0.006377054 -0.070477448 -0.467143750 -0.269516761
 [76] -0.092064919  0.003188362  0.474738861  0.264527836 -0.410013212
 [81] -0.061729401  0.005865278 -0.293502957 -0.081251621  0.244864206
 [86] -0.506155861 -0.030263901 -0.159187584 -0.267851868 -0.481388580
 [91] -0.140609156  0.161725854  0.250397749 -0.130712752 -0.152698211
 [96]  0.163895428  0.008672932  0.035159162  0.041597673  0.165974551
[101]  0.507503144 -0.607191452  0.047556836 -0.155664523 -0.409546798
[106] -0.097674076 -0.536788293  0.472054532  0.225169022 -0.266116484
[111] -0.396746121  0.195433262 -0.566029993 -0.095757946 -0.229420587
[116] -0.004252719 -0.640456082  0.299991073  0.148025799 -0.532914699
[121] -0.509188927  0.009643604 -0.342565365  0.067111100 -0.104308131
[126]  0.116929972  0.783193710  0.112784935  0.080629903 -0.631121221
[131] -0.088748070  0.005163604  0.412033356  0.337198487 -0.661426294
[136]  0.017886477 -0.502851526 -0.177547664  0.365348373 -0.329266564
[141] -0.306926575  0.126319308 -0.133481958  0.330628621 -0.834205041
[146] -0.201604615  0.137542203 -0.543830075  0.509692944 -0.153229327
[151] -0.019843981 -0.218029090  0.095359168 -0.534638216  0.271216996
[156]  0.210441878  0.139414920 -0.580253484  0.266268111 -0.074491371
[161] -0.143762995 -0.046494872 -0.437976738  0.022105268 -0.201565537
[166]  0.323129941  0.087058165 -0.268338602 -0.176808816  0.042258313
[171] -0.250602376  0.227819640 -0.316583779  0.643188051  0.478644029
[176]  0.521513426 -0.070484412 -0.165483630  0.716994387  0.513748954
[181] -0.166805625 -0.196581273 -0.558614433  0.728941896  0.463831469
[186]  0.269044104  0.205170815  0.113854661 -0.206919398  0.362639090
[191]  0.930786611  0.233839720  0.718546950  0.540758638  0.152441025
[196] -0.222282850 -0.086847691 -0.234186315 -0.550688002 -0.217100516
[201]  0.545794976  0.670749830  0.045281752 -0.176058788 -0.416252340
[206] -0.088406504 -0.568757323  0.148547272 -0.975897799 -0.080910707
[211]  0.038254116 -0.114894422 -0.214028538  0.027506908  0.187319646
[216] -0.433400298 -0.328650855 -0.101892700 -0.357984348  0.318597154
[221]  0.114605594  0.073023129 -0.157769109 -0.376315737  0.156013141
[226]  0.052084376 -0.141474443  0.116457832  0.077786933  0.548214482
> 
> proc.time()
   user  system elapsed 
  1.297   1.457   2.742 

BufferedMatrix.Rcheck/tests/rawCalltesting.Rout


R version 4.6.0 alpha (2026-04-05 r89794)
Copyright (C) 2026 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: 0x5615e603cff0>
> .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: 0x5615e603cff0>
> .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: 0x5615e603cff0>
> .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: 0x5615e603cff0>
> 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: 0x5615e5c5ba60>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5615e5c5ba60>
> .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: 0x5615e5c5ba60>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5615e5c5ba60>
> .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: 0x5615e5c5ba60>
> 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: 0x5615e59c1240>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5615e59c1240>
> .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: 0x5615e59c1240>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x5615e59c1240>
> .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: 0x5615e59c1240>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x5615e59c1240>
> .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: 0x5615e59c1240>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x5615e59c1240>
> .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: 0x5615e59c1240>
> 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: 0x5615e6a02160>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x5615e6a02160>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5615e6a02160>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5615e6a02160>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile3ad1032ed2b5a1" "BufferedMatrixFile3ad1039867396" 
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile3ad1032ed2b5a1" "BufferedMatrixFile3ad1039867396" 
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x5615e6c73d20>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5615e6c73d20>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x5615e6c73d20>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x5615e6c73d20>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x5615e6c73d20>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x5615e6c73d20>
> .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: 0x5615e6ea5390>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5615e6ea5390>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x5615e6ea5390>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x5615e6ea5390>
> 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: 0x5615e817f7c0>
> .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: 0x5615e817f7c0>
> rm(P)
> 
> proc.time()
   user  system elapsed 
  0.238   0.051   0.278 

BufferedMatrix.Rcheck/tests/Rcodetesting.Rout


R version 4.6.0 alpha (2026-04-05 r89794)
Copyright (C) 2026 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.250   0.041   0.279 

Example timings