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

This page was generated on 2026-01-24 11:34 -0500 (Sat, 24 Jan 2026).

HostnameOSArch (*)R versionInstalled pkgs
nebbiolo1Linux (Ubuntu 24.04.3 LTS)x86_64R Under development (unstable) (2026-01-15 r89304) -- "Unsuffered Consequences" 4811
kjohnson3macOS 13.7.7 Venturaarm64R Under development (unstable) (2026-01-15 r89304) -- "Unsuffered Consequences" 4545
Click on any hostname to see more info about the system (e.g. compilers)      (*) as reported by 'uname -p', except on Windows and Mac OS X

Package 253/2345HostnameOS / ArchINSTALLBUILDCHECKBUILD BIN
BufferedMatrix 1.75.0  (landing page)
Ben Bolstad
Snapshot Date: 2026-01-23 13:40 -0500 (Fri, 23 Jan 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 -0500 (Wed, 29 Oct 2025)
nebbiolo1Linux (Ubuntu 24.04.3 LTS) / x86_64  OK    OK    OK  UNNEEDED, same version is already published
kjohnson3macOS 13.7.7 Ventura / arm64  OK    OK    WARNINGS    OK  UNNEEDED, same version is already published


CHECK results for BufferedMatrix on kjohnson3

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: /Library/Frameworks/R.framework/Resources/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/Library/Frameworks/R.framework/Resources/library --no-vignettes --timings BufferedMatrix_1.75.0.tar.gz
StartedAt: 2026-01-23 18:54:15 -0500 (Fri, 23 Jan 2026)
EndedAt: 2026-01-23 18:54:37 -0500 (Fri, 23 Jan 2026)
EllapsedTime: 21.3 seconds
RetCode: 0
Status:   WARNINGS  
CheckDir: BufferedMatrix.Rcheck
Warnings: 1

Command output

##############################################################################
##############################################################################
###
### Running command:
###
###   /Library/Frameworks/R.framework/Resources/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/Library/Frameworks/R.framework/Resources/library --no-vignettes --timings BufferedMatrix_1.75.0.tar.gz
###
##############################################################################
##############################################################################


* using log directory ‘/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck’
* using R Under development (unstable) (2026-01-15 r89304)
* using platform: aarch64-apple-darwin20
* R was compiled by
    Apple clang version 16.0.0 (clang-1600.0.26.6)
    GNU Fortran (GCC) 14.2.0
* running under: macOS Ventura 13.7.8
* using session charset: UTF-8
* using option ‘--no-vignettes’
* 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 ... WARNING
Found the following significant warnings:
  doubleBufferedMatrix.c:1580:7: warning: logical not is only applied to the left hand side of this bitwise operator [-Wlogical-not-parentheses]
See ‘/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/00install.out’ for details.
* used C compiler: ‘Apple clang version 15.0.0 (clang-1500.1.0.2.5)’
* used SDK: ‘MacOSX11.3.1.sdk’
* 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 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’ ... OK
* 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 running R code from vignettes ... SKIPPED
* checking re-building of vignette outputs ... SKIPPED
* checking PDF version of manual ... OK
* DONE

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


Installation output

BufferedMatrix.Rcheck/00install.out

##############################################################################
##############################################################################
###
### Running command:
###
###   /Library/Frameworks/R.framework/Resources/bin/R CMD INSTALL BufferedMatrix
###
##############################################################################
##############################################################################


* installing to library ‘/Library/Frameworks/R.framework/Versions/4.6-arm64/Resources/library’
* installing *source* package ‘BufferedMatrix’ ...
** this is package ‘BufferedMatrix’ version ‘1.75.0’
** using staged installation
** libs
using C compiler: ‘Apple clang version 15.0.0 (clang-1500.1.0.2.5)’
using SDK: ‘MacOSX11.3.1.sdk’
clang -arch arm64 -std=gnu2x -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/opt/R/arm64/include    -fPIC  -falign-functions=64 -Wall -g -O2  -c RBufferedMatrix.c -o RBufferedMatrix.o
clang -arch arm64 -std=gnu2x -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/opt/R/arm64/include    -fPIC  -falign-functions=64 -Wall -g -O2  -c doubleBufferedMatrix.c -o doubleBufferedMatrix.o
doubleBufferedMatrix.c:1580:7: warning: logical not is only applied to the left hand side of this bitwise operator [-Wlogical-not-parentheses]
  if (!(Matrix->readonly) & setting){
      ^                   ~
doubleBufferedMatrix.c:1580:7: note: add parentheses after the '!' to evaluate the bitwise operator first
  if (!(Matrix->readonly) & setting){
      ^
       (                           )
doubleBufferedMatrix.c:1580:7: note: add parentheses around left hand side expression to silence this warning
  if (!(Matrix->readonly) & setting){
      ^
      (                  )
doubleBufferedMatrix.c:3327:12: warning: unused function 'sort_double' [-Wunused-function]
static int sort_double(const double *a1,const double *a2){
           ^
2 warnings generated.
clang -arch arm64 -std=gnu2x -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/opt/R/arm64/include    -fPIC  -falign-functions=64 -Wall -g -O2  -c doubleBufferedMatrix_C_tests.c -o doubleBufferedMatrix_C_tests.o
clang -arch arm64 -std=gnu2x -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/opt/R/arm64/include    -fPIC  -falign-functions=64 -Wall -g -O2  -c init_package.c -o init_package.o
clang -arch arm64 -std=gnu2x -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -L/Library/Frameworks/R.framework/Resources/lib -L/opt/R/arm64/lib -o BufferedMatrix.so RBufferedMatrix.o doubleBufferedMatrix.o doubleBufferedMatrix_C_tests.o init_package.o -F/Library/Frameworks/R.framework/.. -framework R
installing to /Library/Frameworks/R.framework/Versions/4.6-arm64/Resources/library/00LOCK-BufferedMatrix/00new/BufferedMatrix/libs
** R
** inst
** byte-compile and prepare package for lazy loading
Creating a new generic function for ‘rowMeans’ in package ‘BufferedMatrix’
Creating a new generic function for ‘rowSums’ in package ‘BufferedMatrix’
Creating a new generic function for ‘colMeans’ in package ‘BufferedMatrix’
Creating a new generic function for ‘colSums’ in package ‘BufferedMatrix’
Creating a generic function for ‘ncol’ from package ‘base’ in package ‘BufferedMatrix’
Creating a generic function for ‘nrow’ from package ‘base’ in package ‘BufferedMatrix’
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
** checking absolute paths in shared objects and dynamic libraries
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (BufferedMatrix)

Tests output

BufferedMatrix.Rcheck/tests/c_code_level_tests.Rout


R Under development (unstable) (2026-01-15 r89304) -- "Unsuffered Consequences"
Copyright (C) 2026 The R Foundation for Statistical Computing
Platform: aarch64-apple-darwin20

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.124   0.050   0.182 

BufferedMatrix.Rcheck/tests/objectTesting.Rout


R Under development (unstable) (2026-01-15 r89304) -- "Unsuffered Consequences"
Copyright (C) 2026 The R Foundation for Statistical Computing
Platform: aarch64-apple-darwin20

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] "/Users/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) limit (Mb) max used (Mb)
Ncells 481350 25.8    1058420 56.6         NA   633731 33.9
Vcells 891641  6.9    8388608 64.0     196608  2111489 16.2
> 
> 
> 
> 
> ##
> ## 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] "Fri Jan 23 18:54:27 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] "Fri Jan 23 18:54:27 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: 0x6000015802a0>
> 
> 
> 
> 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] "Fri Jan 23 18:54:28 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] "Fri Jan 23 18:54:29 2026"
> 
> ColMode(tmp2)
<pointer: 0x6000015802a0>
> 
> 
> 
> ### Now testing assignments
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+ 
+   new.data <- rnorm(20)
+   tmp2[which.row,] <- new.data
+   test.matrix[which.row,] <- new.data
+   if (rep > 1){
+     if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+   
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   new.data <- rnorm(10)
+   tmp2[,which.col] <- new.data
+   test.matrix[,which.col]<- new.data
+ 
+   if (rep > 1){
+     if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.col <- which.col
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,5,replace=TRUE)
+   new.data <- matrix(rnorm(50),5,10)
+   tmp2[,which.col] <- new.data
+   test.matrix[,which.col]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.col <- which.col
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   new.data <- matrix(rnorm(50),5,10)
+   tmp2[which.row,] <- new.data
+   test.matrix[which.row,]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col  <- sample(1:20,5,replace=TRUE)
+   new.data <- matrix(rnorm(25),5,5)
+   tmp2[which.row,which.col] <- new.data
+   test.matrix[which.row,which.col]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[prev.row,prev.col] == test.matrix[prev.row,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+   prev.col <- which.col
+ }
> 
> 
> 
> 
> ###
> ###
> ### testing some more functions
> ###
> 
> 
> 
> ## duplication function
> tmp5 <- duplicate(tmp2)
> 
> # making sure really did copy everything.
> tmp5[1,1] <- tmp5[1,1] +100.00
> 
> if (tmp5[1,1] == tmp2[1,1]){
+   stop("Problem with duplication")
+ }
> 
> 
> 
> 
> ### testing elementwise applying of functions
> 
> tmp5[1:4,1:4]
            [,1]        [,2]       [,3]       [,4]
[1,] 99.18986915  0.07165383  0.4148084  1.3390891
[2,] -0.81817307 -0.03107842  1.2893548 -0.2725216
[3,] -0.13101402  1.60930702 -1.4216107 -1.6570286
[4,]  0.04277688 -0.77783730  1.1579379  0.3743091
> ewApply(tmp5,abs)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /Users/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,] 99.18986915 0.07165383 0.4148084 1.3390891
[2,]  0.81817307 0.03107842 1.2893548 0.2725216
[3,]  0.13101402 1.60930702 1.4216107 1.6570286
[4,]  0.04277688 0.77783730 1.1579379 0.3743091
> ewApply(tmp5,sqrt)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /Users/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,] 9.9594111 0.2676823 0.6440562 1.157190
[2,] 0.9045292 0.1762907 1.1354976 0.522036
[3,] 0.3619586 1.2685847 1.1923132 1.287256
[4,] 0.2068257 0.8819509 1.0760753 0.611808
> 
> 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:    /Users/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,] 223.78398 27.74848 31.85537 37.91099
[2,]  34.86347 26.79399 37.64433 30.49288
[3,]  28.75060 39.29515 38.34474 39.52959
[4,]  27.11103 34.59735 36.91869 31.49239
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x6000015a41e0>
> exp(tmp5)
<pointer: 0x6000015a41e0>
> log(tmp5,2)
<pointer: 0x6000015a41e0>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 465.777
> Min(tmp5)
[1] 52.80446
> mean(tmp5)
[1] 72.82444
> Sum(tmp5)
[1] 14564.89
> Var(tmp5)
[1] 849.0036
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 91.28918 71.80094 74.10248 68.58045 70.83245 69.63341 70.71997 71.67208
 [9] 68.18491 71.42853
> rowSums(tmp5)
 [1] 1825.784 1436.019 1482.050 1371.609 1416.649 1392.668 1414.399 1433.442
 [9] 1363.698 1428.571
> rowVars(tmp5)
 [1] 7870.23461   44.42475   63.22361   58.33879   90.30223   65.92333
 [7]   46.69390   75.24901   64.37949   87.08864
> rowSd(tmp5)
 [1] 88.714343  6.665189  7.951328  7.637983  9.502748  8.119318  6.833294
 [8]  8.674619  8.023683  9.332129
> rowMax(tmp5)
 [1] 465.77703  88.77158  87.15332  81.12959  84.88368  86.53306  80.01630
 [8]  81.93854  85.44908  90.90722
> rowMin(tmp5)
 [1] 54.80206 55.76817 59.84061 53.93629 55.09208 52.80446 54.65007 55.30745
 [9] 53.88723 58.02083
> 
> colMeans(tmp5)
 [1] 107.49180  69.08217  71.72857  71.63890  66.71967  72.69810  75.88940
 [8]  72.44048  67.32136  68.57173  71.78427  71.05263  72.49183  69.83624
[15]  67.28014  74.81904  70.39471  74.50383  70.17436  70.56958
> colSums(tmp5)
 [1] 1074.9180  690.8217  717.2857  716.3890  667.1967  726.9810  758.8940
 [8]  724.4048  673.2136  685.7173  717.8427  710.5263  724.9183  698.3624
[15]  672.8014  748.1904  703.9471  745.0383  701.7436  705.6958
> colVars(tmp5)
 [1] 15909.48952    93.44960    46.33843    71.27025    51.31178    88.29846
 [7]    41.40313    86.45232    91.08899    74.50785    97.53889   101.65771
[13]    14.35571   152.39479    27.57098    45.03836    60.23513    35.68565
[19]    62.34599    85.93251
> colSd(tmp5)
 [1] 126.132825   9.666933   6.807234   8.442171   7.163224   9.396726
 [7]   6.434527   9.297974   9.544055   8.631793   9.876178  10.082545
[13]   3.788893  12.344828   5.250808   6.711063   7.761130   5.973746
[19]   7.895948   9.269979
> colMax(tmp5)
 [1] 465.77703  84.43771  79.80956  86.53306  80.17564  90.90722  85.02610
 [8]  84.88368  82.24746  85.44908  84.68269  88.77158  81.38505  90.63246
[15]  73.78547  87.15332  79.44893  81.90734  83.05951  81.08079
> colMin(tmp5)
 [1] 56.42807 55.76817 62.40559 63.46694 58.02083 61.86694 66.11595 54.32319
 [9] 54.65007 59.26807 57.18066 56.79712 68.76780 53.93629 57.65957 64.15944
[17] 54.80206 65.84195 52.80446 53.88723
> 
> 
> ### 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]       NA 71.80094 74.10248 68.58045 70.83245 69.63341 70.71997 71.67208
 [9] 68.18491 71.42853
> rowSums(tmp5)
 [1]       NA 1436.019 1482.050 1371.609 1416.649 1392.668 1414.399 1433.442
 [9] 1363.698 1428.571
> rowVars(tmp5)
 [1] 8272.53448   44.42475   63.22361   58.33879   90.30223   65.92333
 [7]   46.69390   75.24901   64.37949   87.08864
> rowSd(tmp5)
 [1] 90.953474  6.665189  7.951328  7.637983  9.502748  8.119318  6.833294
 [8]  8.674619  8.023683  9.332129
> rowMax(tmp5)
 [1]       NA 88.77158 87.15332 81.12959 84.88368 86.53306 80.01630 81.93854
 [9] 85.44908 90.90722
> rowMin(tmp5)
 [1]       NA 55.76817 59.84061 53.93629 55.09208 52.80446 54.65007 55.30745
 [9] 53.88723 58.02083
> 
> colMeans(tmp5)
 [1] 107.49180  69.08217  71.72857  71.63890        NA  72.69810  75.88940
 [8]  72.44048  67.32136  68.57173  71.78427  71.05263  72.49183  69.83624
[15]  67.28014  74.81904  70.39471  74.50383  70.17436  70.56958
> colSums(tmp5)
 [1] 1074.9180  690.8217  717.2857  716.3890        NA  726.9810  758.8940
 [8]  724.4048  673.2136  685.7173  717.8427  710.5263  724.9183  698.3624
[15]  672.8014  748.1904  703.9471  745.0383  701.7436  705.6958
> colVars(tmp5)
 [1] 15909.48952    93.44960    46.33843    71.27025          NA    88.29846
 [7]    41.40313    86.45232    91.08899    74.50785    97.53889   101.65771
[13]    14.35571   152.39479    27.57098    45.03836    60.23513    35.68565
[19]    62.34599    85.93251
> colSd(tmp5)
 [1] 126.132825   9.666933   6.807234   8.442171         NA   9.396726
 [7]   6.434527   9.297974   9.544055   8.631793   9.876178  10.082545
[13]   3.788893  12.344828   5.250808   6.711063   7.761130   5.973746
[19]   7.895948   9.269979
> colMax(tmp5)
 [1] 465.77703  84.43771  79.80956  86.53306        NA  90.90722  85.02610
 [8]  84.88368  82.24746  85.44908  84.68269  88.77158  81.38505  90.63246
[15]  73.78547  87.15332  79.44893  81.90734  83.05951  81.08079
> colMin(tmp5)
 [1] 56.42807 55.76817 62.40559 63.46694       NA 61.86694 66.11595 54.32319
 [9] 54.65007 59.26807 57.18066 56.79712 68.76780 53.93629 57.65957 64.15944
[17] 54.80206 65.84195 52.80446 53.88723
> 
> Max(tmp5,na.rm=TRUE)
[1] 465.777
> Min(tmp5,na.rm=TRUE)
[1] 52.80446
> mean(tmp5,na.rm=TRUE)
[1] 72.85448
> Sum(tmp5,na.rm=TRUE)
[1] 14498.04
> Var(tmp5,na.rm=TRUE)
[1] 853.1101
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 92.57558 71.80094 74.10248 68.58045 70.83245 69.63341 70.71997 71.67208
 [9] 68.18491 71.42853
> rowSums(tmp5,na.rm=TRUE)
 [1] 1758.936 1436.019 1482.050 1371.609 1416.649 1392.668 1414.399 1433.442
 [9] 1363.698 1428.571
> rowVars(tmp5,na.rm=TRUE)
 [1] 8272.53448   44.42475   63.22361   58.33879   90.30223   65.92333
 [7]   46.69390   75.24901   64.37949   87.08864
> rowSd(tmp5,na.rm=TRUE)
 [1] 90.953474  6.665189  7.951328  7.637983  9.502748  8.119318  6.833294
 [8]  8.674619  8.023683  9.332129
> rowMax(tmp5,na.rm=TRUE)
 [1] 465.77703  88.77158  87.15332  81.12959  84.88368  86.53306  80.01630
 [8]  81.93854  85.44908  90.90722
> rowMin(tmp5,na.rm=TRUE)
 [1] 54.80206 55.76817 59.84061 53.93629 55.09208 52.80446 54.65007 55.30745
 [9] 53.88723 58.02083
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 107.49180  69.08217  71.72857  71.63890  66.70547  72.69810  75.88940
 [8]  72.44048  67.32136  68.57173  71.78427  71.05263  72.49183  69.83624
[15]  67.28014  74.81904  70.39471  74.50383  70.17436  70.56958
> colSums(tmp5,na.rm=TRUE)
 [1] 1074.9180  690.8217  717.2857  716.3890  600.3492  726.9810  758.8940
 [8]  724.4048  673.2136  685.7173  717.8427  710.5263  724.9183  698.3624
[15]  672.8014  748.1904  703.9471  745.0383  701.7436  705.6958
> colVars(tmp5,na.rm=TRUE)
 [1] 15909.48952    93.44960    46.33843    71.27025    57.72348    88.29846
 [7]    41.40313    86.45232    91.08899    74.50785    97.53889   101.65771
[13]    14.35571   152.39479    27.57098    45.03836    60.23513    35.68565
[19]    62.34599    85.93251
> colSd(tmp5,na.rm=TRUE)
 [1] 126.132825   9.666933   6.807234   8.442171   7.597597   9.396726
 [7]   6.434527   9.297974   9.544055   8.631793   9.876178  10.082545
[13]   3.788893  12.344828   5.250808   6.711063   7.761130   5.973746
[19]   7.895948   9.269979
> colMax(tmp5,na.rm=TRUE)
 [1] 465.77703  84.43771  79.80956  86.53306  80.17564  90.90722  85.02610
 [8]  84.88368  82.24746  85.44908  84.68269  88.77158  81.38505  90.63246
[15]  73.78547  87.15332  79.44893  81.90734  83.05951  81.08079
> colMin(tmp5,na.rm=TRUE)
 [1] 56.42807 55.76817 62.40559 63.46694 58.02083 61.86694 66.11595 54.32319
 [9] 54.65007 59.26807 57.18066 56.79712 68.76780 53.93629 57.65957 64.15944
[17] 54.80206 65.84195 52.80446 53.88723
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1]      NaN 71.80094 74.10248 68.58045 70.83245 69.63341 70.71997 71.67208
 [9] 68.18491 71.42853
> rowSums(tmp5,na.rm=TRUE)
 [1]    0.000 1436.019 1482.050 1371.609 1416.649 1392.668 1414.399 1433.442
 [9] 1363.698 1428.571
> rowVars(tmp5,na.rm=TRUE)
 [1]       NA 44.42475 63.22361 58.33879 90.30223 65.92333 46.69390 75.24901
 [9] 64.37949 87.08864
> rowSd(tmp5,na.rm=TRUE)
 [1]       NA 6.665189 7.951328 7.637983 9.502748 8.119318 6.833294 8.674619
 [9] 8.023683 9.332129
> rowMax(tmp5,na.rm=TRUE)
 [1]       NA 88.77158 87.15332 81.12959 84.88368 86.53306 80.01630 81.93854
 [9] 85.44908 90.90722
> rowMin(tmp5,na.rm=TRUE)
 [1]       NA 55.76817 59.84061 53.93629 55.09208 52.80446 54.65007 55.30745
 [9] 53.88723 58.02083
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1] 67.68233 70.34076 72.33144 70.83135      NaN 71.59909 75.53528 73.08883
 [9] 67.90219 67.73529 70.35111 72.63658 72.43718 67.52554 68.02290 74.76554
[17] 72.12723 74.70516 68.74268 70.39013
> colSums(tmp5,na.rm=TRUE)
 [1] 609.1409 633.0669 650.9830 637.4822   0.0000 644.3918 679.8175 657.7994
 [9] 611.1197 609.6177 633.1600 653.7292 651.9346 607.7299 612.2061 672.8898
[17] 649.1451 672.3465 618.6841 633.5112
> colVars(tmp5,na.rm=TRUE)
 [1]  69.24347  87.31013  48.04195  72.84267        NA  85.74780  45.16770
 [8]  92.52991  98.67976  75.95048  86.62440  86.14000  16.11657 111.37705
[15]  24.81084  50.63595  33.99634  39.69036  47.07992  96.31180
> colSd(tmp5,na.rm=TRUE)
 [1]  8.321266  9.343989  6.931230  8.534791        NA  9.260011  6.720692
 [8]  9.619247  9.933769  8.714957  9.307223  9.281164  4.014545 10.553532
[15]  4.981048  7.115894  5.830638  6.300028  6.861481  9.813857
> colMax(tmp5,na.rm=TRUE)
 [1] 81.89340 84.43771 79.80956 86.53306     -Inf 90.90722 85.02610 84.88368
 [9] 82.24746 85.44908 81.93854 88.77158 81.38505 81.10265 73.78547 87.15332
[17] 79.44893 81.90734 75.99483 81.08079
> colMin(tmp5,na.rm=TRUE)
 [1] 56.42807 55.76817 62.40559 63.46694      Inf 61.86694 66.11595 54.32319
 [9] 54.65007 59.26807 57.18066 58.85175 68.76780 53.93629 57.65957 64.15944
[17] 63.94823 65.84195 52.80446 53.88723
> 
> 
> 
> 
> 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] 162.5420 222.9462 318.9944 254.1672 435.9720 310.3276 334.3525 245.6426
 [9] 188.4736 250.9443
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 162.5420 222.9462 318.9944 254.1672 435.9720 310.3276 334.3525 245.6426
 [9] 188.4736 250.9443
> 
> 
> 
> 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  0.000000e+00 -1.421085e-14  8.526513e-14  0.000000e+00
 [6] -2.557954e-13 -1.705303e-13 -2.842171e-14  0.000000e+00 -8.526513e-14
[11] -2.842171e-14 -1.136868e-13  0.000000e+00  0.000000e+00  5.684342e-14
[16] -2.842171e-14  0.000000e+00 -1.136868e-13 -2.557954e-13  1.136868e-13
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> ## 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)
+ }
4   1 
6   9 
3   19 
10   18 
6   11 
1   3 
2   8 
7   12 
2   10 
1   7 
6   10 
4   2 
10   4 
3   12 
9   3 
9   12 
7   1 
9   13 
2   12 
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.143744
> Min(tmp)
[1] -2.962614
> mean(tmp)
[1] -0.1022598
> Sum(tmp)
[1] -10.22598
> Var(tmp)
[1] 0.8622036
> 
> rowMeans(tmp)
[1] -0.1022598
> rowSums(tmp)
[1] -10.22598
> rowVars(tmp)
[1] 0.8622036
> rowSd(tmp)
[1] 0.9285492
> rowMax(tmp)
[1] 2.143744
> rowMin(tmp)
[1] -2.962614
> 
> colMeans(tmp)
  [1]  0.66584523 -0.94601505 -0.69667268 -0.20749052 -0.14648220 -1.26157804
  [7] -0.46543307  0.62776965  1.94858229  0.28403485  0.09753046  0.46337517
 [13] -0.72795768 -1.80211046 -0.01523196  0.71256063  0.64473979  0.06067949
 [19] -1.29266611  0.51802726 -1.11850140  0.25691757 -0.14959069 -0.40608475
 [25] -0.94536125  0.72460442 -1.80624049 -0.03057131  0.35356793  2.14374393
 [31]  0.64693258  1.74610318 -0.48338743  0.66140855  0.45919408 -0.86954849
 [37]  1.03480866 -0.90588245 -0.26879435 -0.36570110 -0.11578182  0.64117953
 [43]  0.74129521  0.75627544 -0.94855610 -0.48985555 -0.16115035 -0.74909261
 [49] -0.07304295 -0.78303033 -0.84569561  1.26133834  0.68664538 -0.03138112
 [55] -1.06843229 -2.96261398 -1.05501925 -0.54711531 -0.20447893  0.18564470
 [61]  0.48148651 -0.44334276  0.06140542 -0.98541607  0.09738496 -1.27928342
 [67]  0.08792461 -0.55057460  0.62859505 -0.67667153  1.30387008 -1.41971085
 [73] -0.66571439  1.09682790  1.14818592 -0.64767910 -0.47622133  0.49131549
 [79]  0.43309728  1.38411293  0.75982491  0.19455970  0.40927843 -0.14003123
 [85] -1.04934115  1.03249161  0.05433527 -0.61987044  1.55325206 -0.05036057
 [91]  1.57865578 -0.61765968 -1.83103406 -0.40355478 -0.86258245 -0.82755077
 [97]  0.70172902 -1.67705450 -2.12997509  0.25306135
> colSums(tmp)
  [1]  0.66584523 -0.94601505 -0.69667268 -0.20749052 -0.14648220 -1.26157804
  [7] -0.46543307  0.62776965  1.94858229  0.28403485  0.09753046  0.46337517
 [13] -0.72795768 -1.80211046 -0.01523196  0.71256063  0.64473979  0.06067949
 [19] -1.29266611  0.51802726 -1.11850140  0.25691757 -0.14959069 -0.40608475
 [25] -0.94536125  0.72460442 -1.80624049 -0.03057131  0.35356793  2.14374393
 [31]  0.64693258  1.74610318 -0.48338743  0.66140855  0.45919408 -0.86954849
 [37]  1.03480866 -0.90588245 -0.26879435 -0.36570110 -0.11578182  0.64117953
 [43]  0.74129521  0.75627544 -0.94855610 -0.48985555 -0.16115035 -0.74909261
 [49] -0.07304295 -0.78303033 -0.84569561  1.26133834  0.68664538 -0.03138112
 [55] -1.06843229 -2.96261398 -1.05501925 -0.54711531 -0.20447893  0.18564470
 [61]  0.48148651 -0.44334276  0.06140542 -0.98541607  0.09738496 -1.27928342
 [67]  0.08792461 -0.55057460  0.62859505 -0.67667153  1.30387008 -1.41971085
 [73] -0.66571439  1.09682790  1.14818592 -0.64767910 -0.47622133  0.49131549
 [79]  0.43309728  1.38411293  0.75982491  0.19455970  0.40927843 -0.14003123
 [85] -1.04934115  1.03249161  0.05433527 -0.61987044  1.55325206 -0.05036057
 [91]  1.57865578 -0.61765968 -1.83103406 -0.40355478 -0.86258245 -0.82755077
 [97]  0.70172902 -1.67705450 -2.12997509  0.25306135
> 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.66584523 -0.94601505 -0.69667268 -0.20749052 -0.14648220 -1.26157804
  [7] -0.46543307  0.62776965  1.94858229  0.28403485  0.09753046  0.46337517
 [13] -0.72795768 -1.80211046 -0.01523196  0.71256063  0.64473979  0.06067949
 [19] -1.29266611  0.51802726 -1.11850140  0.25691757 -0.14959069 -0.40608475
 [25] -0.94536125  0.72460442 -1.80624049 -0.03057131  0.35356793  2.14374393
 [31]  0.64693258  1.74610318 -0.48338743  0.66140855  0.45919408 -0.86954849
 [37]  1.03480866 -0.90588245 -0.26879435 -0.36570110 -0.11578182  0.64117953
 [43]  0.74129521  0.75627544 -0.94855610 -0.48985555 -0.16115035 -0.74909261
 [49] -0.07304295 -0.78303033 -0.84569561  1.26133834  0.68664538 -0.03138112
 [55] -1.06843229 -2.96261398 -1.05501925 -0.54711531 -0.20447893  0.18564470
 [61]  0.48148651 -0.44334276  0.06140542 -0.98541607  0.09738496 -1.27928342
 [67]  0.08792461 -0.55057460  0.62859505 -0.67667153  1.30387008 -1.41971085
 [73] -0.66571439  1.09682790  1.14818592 -0.64767910 -0.47622133  0.49131549
 [79]  0.43309728  1.38411293  0.75982491  0.19455970  0.40927843 -0.14003123
 [85] -1.04934115  1.03249161  0.05433527 -0.61987044  1.55325206 -0.05036057
 [91]  1.57865578 -0.61765968 -1.83103406 -0.40355478 -0.86258245 -0.82755077
 [97]  0.70172902 -1.67705450 -2.12997509  0.25306135
> colMin(tmp)
  [1]  0.66584523 -0.94601505 -0.69667268 -0.20749052 -0.14648220 -1.26157804
  [7] -0.46543307  0.62776965  1.94858229  0.28403485  0.09753046  0.46337517
 [13] -0.72795768 -1.80211046 -0.01523196  0.71256063  0.64473979  0.06067949
 [19] -1.29266611  0.51802726 -1.11850140  0.25691757 -0.14959069 -0.40608475
 [25] -0.94536125  0.72460442 -1.80624049 -0.03057131  0.35356793  2.14374393
 [31]  0.64693258  1.74610318 -0.48338743  0.66140855  0.45919408 -0.86954849
 [37]  1.03480866 -0.90588245 -0.26879435 -0.36570110 -0.11578182  0.64117953
 [43]  0.74129521  0.75627544 -0.94855610 -0.48985555 -0.16115035 -0.74909261
 [49] -0.07304295 -0.78303033 -0.84569561  1.26133834  0.68664538 -0.03138112
 [55] -1.06843229 -2.96261398 -1.05501925 -0.54711531 -0.20447893  0.18564470
 [61]  0.48148651 -0.44334276  0.06140542 -0.98541607  0.09738496 -1.27928342
 [67]  0.08792461 -0.55057460  0.62859505 -0.67667153  1.30387008 -1.41971085
 [73] -0.66571439  1.09682790  1.14818592 -0.64767910 -0.47622133  0.49131549
 [79]  0.43309728  1.38411293  0.75982491  0.19455970  0.40927843 -0.14003123
 [85] -1.04934115  1.03249161  0.05433527 -0.61987044  1.55325206 -0.05036057
 [91]  1.57865578 -0.61765968 -1.83103406 -0.40355478 -0.86258245 -0.82755077
 [97]  0.70172902 -1.67705450 -2.12997509  0.25306135
> colMedians(tmp)
  [1]  0.66584523 -0.94601505 -0.69667268 -0.20749052 -0.14648220 -1.26157804
  [7] -0.46543307  0.62776965  1.94858229  0.28403485  0.09753046  0.46337517
 [13] -0.72795768 -1.80211046 -0.01523196  0.71256063  0.64473979  0.06067949
 [19] -1.29266611  0.51802726 -1.11850140  0.25691757 -0.14959069 -0.40608475
 [25] -0.94536125  0.72460442 -1.80624049 -0.03057131  0.35356793  2.14374393
 [31]  0.64693258  1.74610318 -0.48338743  0.66140855  0.45919408 -0.86954849
 [37]  1.03480866 -0.90588245 -0.26879435 -0.36570110 -0.11578182  0.64117953
 [43]  0.74129521  0.75627544 -0.94855610 -0.48985555 -0.16115035 -0.74909261
 [49] -0.07304295 -0.78303033 -0.84569561  1.26133834  0.68664538 -0.03138112
 [55] -1.06843229 -2.96261398 -1.05501925 -0.54711531 -0.20447893  0.18564470
 [61]  0.48148651 -0.44334276  0.06140542 -0.98541607  0.09738496 -1.27928342
 [67]  0.08792461 -0.55057460  0.62859505 -0.67667153  1.30387008 -1.41971085
 [73] -0.66571439  1.09682790  1.14818592 -0.64767910 -0.47622133  0.49131549
 [79]  0.43309728  1.38411293  0.75982491  0.19455970  0.40927843 -0.14003123
 [85] -1.04934115  1.03249161  0.05433527 -0.61987044  1.55325206 -0.05036057
 [91]  1.57865578 -0.61765968 -1.83103406 -0.40355478 -0.86258245 -0.82755077
 [97]  0.70172902 -1.67705450 -2.12997509  0.25306135
> colRanges(tmp)
          [,1]       [,2]       [,3]       [,4]       [,5]      [,6]       [,7]
[1,] 0.6658452 -0.9460151 -0.6966727 -0.2074905 -0.1464822 -1.261578 -0.4654331
[2,] 0.6658452 -0.9460151 -0.6966727 -0.2074905 -0.1464822 -1.261578 -0.4654331
          [,8]     [,9]     [,10]      [,11]     [,12]      [,13]    [,14]
[1,] 0.6277697 1.948582 0.2840348 0.09753046 0.4633752 -0.7279577 -1.80211
[2,] 0.6277697 1.948582 0.2840348 0.09753046 0.4633752 -0.7279577 -1.80211
           [,15]     [,16]     [,17]      [,18]     [,19]     [,20]     [,21]
[1,] -0.01523196 0.7125606 0.6447398 0.06067949 -1.292666 0.5180273 -1.118501
[2,] -0.01523196 0.7125606 0.6447398 0.06067949 -1.292666 0.5180273 -1.118501
         [,22]      [,23]      [,24]      [,25]     [,26]    [,27]       [,28]
[1,] 0.2569176 -0.1495907 -0.4060848 -0.9453612 0.7246044 -1.80624 -0.03057131
[2,] 0.2569176 -0.1495907 -0.4060848 -0.9453612 0.7246044 -1.80624 -0.03057131
         [,29]    [,30]     [,31]    [,32]      [,33]     [,34]     [,35]
[1,] 0.3535679 2.143744 0.6469326 1.746103 -0.4833874 0.6614086 0.4591941
[2,] 0.3535679 2.143744 0.6469326 1.746103 -0.4833874 0.6614086 0.4591941
          [,36]    [,37]      [,38]      [,39]      [,40]      [,41]     [,42]
[1,] -0.8695485 1.034809 -0.9058824 -0.2687944 -0.3657011 -0.1157818 0.6411795
[2,] -0.8695485 1.034809 -0.9058824 -0.2687944 -0.3657011 -0.1157818 0.6411795
         [,43]     [,44]      [,45]      [,46]      [,47]      [,48]
[1,] 0.7412952 0.7562754 -0.9485561 -0.4898555 -0.1611503 -0.7490926
[2,] 0.7412952 0.7562754 -0.9485561 -0.4898555 -0.1611503 -0.7490926
           [,49]      [,50]      [,51]    [,52]     [,53]       [,54]     [,55]
[1,] -0.07304295 -0.7830303 -0.8456956 1.261338 0.6866454 -0.03138112 -1.068432
[2,] -0.07304295 -0.7830303 -0.8456956 1.261338 0.6866454 -0.03138112 -1.068432
         [,56]     [,57]      [,58]      [,59]     [,60]     [,61]      [,62]
[1,] -2.962614 -1.055019 -0.5471153 -0.2044789 0.1856447 0.4814865 -0.4433428
[2,] -2.962614 -1.055019 -0.5471153 -0.2044789 0.1856447 0.4814865 -0.4433428
          [,63]      [,64]      [,65]     [,66]      [,67]      [,68]    [,69]
[1,] 0.06140542 -0.9854161 0.09738496 -1.279283 0.08792461 -0.5505746 0.628595
[2,] 0.06140542 -0.9854161 0.09738496 -1.279283 0.08792461 -0.5505746 0.628595
          [,70]   [,71]     [,72]      [,73]    [,74]    [,75]      [,76]
[1,] -0.6766715 1.30387 -1.419711 -0.6657144 1.096828 1.148186 -0.6476791
[2,] -0.6766715 1.30387 -1.419711 -0.6657144 1.096828 1.148186 -0.6476791
          [,77]     [,78]     [,79]    [,80]     [,81]     [,82]     [,83]
[1,] -0.4762213 0.4913155 0.4330973 1.384113 0.7598249 0.1945597 0.4092784
[2,] -0.4762213 0.4913155 0.4330973 1.384113 0.7598249 0.1945597 0.4092784
          [,84]     [,85]    [,86]      [,87]      [,88]    [,89]       [,90]
[1,] -0.1400312 -1.049341 1.032492 0.05433527 -0.6198704 1.553252 -0.05036057
[2,] -0.1400312 -1.049341 1.032492 0.05433527 -0.6198704 1.553252 -0.05036057
        [,91]      [,92]     [,93]      [,94]      [,95]      [,96]    [,97]
[1,] 1.578656 -0.6176597 -1.831034 -0.4035548 -0.8625824 -0.8275508 0.701729
[2,] 1.578656 -0.6176597 -1.831034 -0.4035548 -0.8625824 -0.8275508 0.701729
         [,98]     [,99]    [,100]
[1,] -1.677054 -2.129975 0.2530614
[2,] -1.677054 -2.129975 0.2530614
> 
> 
> Max(tmp2)
[1] 2.511511
> Min(tmp2)
[1] -2.392696
> mean(tmp2)
[1] -0.1775527
> Sum(tmp2)
[1] -17.75527
> Var(tmp2)
[1] 0.9871073
> 
> rowMeans(tmp2)
  [1] -0.308913709 -2.008939070 -0.311607520  0.626231995 -0.005384358
  [6] -2.380918577 -1.840105819  0.118462312  0.907740418  0.702804108
 [11] -2.000738912  1.208545150 -0.048360608  1.040514069  0.264624720
 [16]  0.710506598 -2.126698017  0.487128897  1.115803161 -0.185038257
 [21] -0.476678647 -0.367272355 -0.068982848  1.423326601 -0.316927307
 [26] -0.420679947  1.728354944 -0.325703429  0.414214259  1.580091007
 [31] -0.660194693 -0.144057680 -1.400785688 -0.954916174 -0.514016352
 [36] -1.679950806  0.485060424  0.375622513 -0.920838988  0.734999786
 [41]  1.121384661  2.511510623  0.846543051 -1.269390767  0.847804275
 [46] -0.792676491 -0.856665971  0.709566642 -0.124099452  0.176793442
 [51] -1.772700106 -1.364303999 -0.994238443 -0.385647610  1.356838483
 [56] -1.248814223 -0.936564035  0.483010878 -0.539158180  0.121926804
 [61]  0.198084094 -2.392695554 -0.497259869 -0.787314163  0.225095579
 [66] -0.960085026 -0.124774061 -0.475844316  0.555785927  0.817467192
 [71]  0.286206990 -0.375858731 -0.227248202  1.376037263 -1.426960817
 [76] -0.911642361 -0.351559957  1.345044535  0.560544008 -0.765294327
 [81] -2.366605751 -0.295740646 -0.505569510  0.105925541 -0.488572077
 [86]  1.910468099  0.369171377 -1.270854178 -0.359569418  0.115207397
 [91] -1.416321810 -0.524327806 -0.035509069 -0.818282755  0.380413153
 [96] -0.718726116  0.511932016 -0.528346148 -0.125377424 -0.109757646
> rowSums(tmp2)
  [1] -0.308913709 -2.008939070 -0.311607520  0.626231995 -0.005384358
  [6] -2.380918577 -1.840105819  0.118462312  0.907740418  0.702804108
 [11] -2.000738912  1.208545150 -0.048360608  1.040514069  0.264624720
 [16]  0.710506598 -2.126698017  0.487128897  1.115803161 -0.185038257
 [21] -0.476678647 -0.367272355 -0.068982848  1.423326601 -0.316927307
 [26] -0.420679947  1.728354944 -0.325703429  0.414214259  1.580091007
 [31] -0.660194693 -0.144057680 -1.400785688 -0.954916174 -0.514016352
 [36] -1.679950806  0.485060424  0.375622513 -0.920838988  0.734999786
 [41]  1.121384661  2.511510623  0.846543051 -1.269390767  0.847804275
 [46] -0.792676491 -0.856665971  0.709566642 -0.124099452  0.176793442
 [51] -1.772700106 -1.364303999 -0.994238443 -0.385647610  1.356838483
 [56] -1.248814223 -0.936564035  0.483010878 -0.539158180  0.121926804
 [61]  0.198084094 -2.392695554 -0.497259869 -0.787314163  0.225095579
 [66] -0.960085026 -0.124774061 -0.475844316  0.555785927  0.817467192
 [71]  0.286206990 -0.375858731 -0.227248202  1.376037263 -1.426960817
 [76] -0.911642361 -0.351559957  1.345044535  0.560544008 -0.765294327
 [81] -2.366605751 -0.295740646 -0.505569510  0.105925541 -0.488572077
 [86]  1.910468099  0.369171377 -1.270854178 -0.359569418  0.115207397
 [91] -1.416321810 -0.524327806 -0.035509069 -0.818282755  0.380413153
 [96] -0.718726116  0.511932016 -0.528346148 -0.125377424 -0.109757646
> rowVars(tmp2)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowSd(tmp2)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowMax(tmp2)
  [1] -0.308913709 -2.008939070 -0.311607520  0.626231995 -0.005384358
  [6] -2.380918577 -1.840105819  0.118462312  0.907740418  0.702804108
 [11] -2.000738912  1.208545150 -0.048360608  1.040514069  0.264624720
 [16]  0.710506598 -2.126698017  0.487128897  1.115803161 -0.185038257
 [21] -0.476678647 -0.367272355 -0.068982848  1.423326601 -0.316927307
 [26] -0.420679947  1.728354944 -0.325703429  0.414214259  1.580091007
 [31] -0.660194693 -0.144057680 -1.400785688 -0.954916174 -0.514016352
 [36] -1.679950806  0.485060424  0.375622513 -0.920838988  0.734999786
 [41]  1.121384661  2.511510623  0.846543051 -1.269390767  0.847804275
 [46] -0.792676491 -0.856665971  0.709566642 -0.124099452  0.176793442
 [51] -1.772700106 -1.364303999 -0.994238443 -0.385647610  1.356838483
 [56] -1.248814223 -0.936564035  0.483010878 -0.539158180  0.121926804
 [61]  0.198084094 -2.392695554 -0.497259869 -0.787314163  0.225095579
 [66] -0.960085026 -0.124774061 -0.475844316  0.555785927  0.817467192
 [71]  0.286206990 -0.375858731 -0.227248202  1.376037263 -1.426960817
 [76] -0.911642361 -0.351559957  1.345044535  0.560544008 -0.765294327
 [81] -2.366605751 -0.295740646 -0.505569510  0.105925541 -0.488572077
 [86]  1.910468099  0.369171377 -1.270854178 -0.359569418  0.115207397
 [91] -1.416321810 -0.524327806 -0.035509069 -0.818282755  0.380413153
 [96] -0.718726116  0.511932016 -0.528346148 -0.125377424 -0.109757646
> rowMin(tmp2)
  [1] -0.308913709 -2.008939070 -0.311607520  0.626231995 -0.005384358
  [6] -2.380918577 -1.840105819  0.118462312  0.907740418  0.702804108
 [11] -2.000738912  1.208545150 -0.048360608  1.040514069  0.264624720
 [16]  0.710506598 -2.126698017  0.487128897  1.115803161 -0.185038257
 [21] -0.476678647 -0.367272355 -0.068982848  1.423326601 -0.316927307
 [26] -0.420679947  1.728354944 -0.325703429  0.414214259  1.580091007
 [31] -0.660194693 -0.144057680 -1.400785688 -0.954916174 -0.514016352
 [36] -1.679950806  0.485060424  0.375622513 -0.920838988  0.734999786
 [41]  1.121384661  2.511510623  0.846543051 -1.269390767  0.847804275
 [46] -0.792676491 -0.856665971  0.709566642 -0.124099452  0.176793442
 [51] -1.772700106 -1.364303999 -0.994238443 -0.385647610  1.356838483
 [56] -1.248814223 -0.936564035  0.483010878 -0.539158180  0.121926804
 [61]  0.198084094 -2.392695554 -0.497259869 -0.787314163  0.225095579
 [66] -0.960085026 -0.124774061 -0.475844316  0.555785927  0.817467192
 [71]  0.286206990 -0.375858731 -0.227248202  1.376037263 -1.426960817
 [76] -0.911642361 -0.351559957  1.345044535  0.560544008 -0.765294327
 [81] -2.366605751 -0.295740646 -0.505569510  0.105925541 -0.488572077
 [86]  1.910468099  0.369171377 -1.270854178 -0.359569418  0.115207397
 [91] -1.416321810 -0.524327806 -0.035509069 -0.818282755  0.380413153
 [96] -0.718726116  0.511932016 -0.528346148 -0.125377424 -0.109757646
> 
> colMeans(tmp2)
[1] -0.1775527
> colSums(tmp2)
[1] -17.75527
> colVars(tmp2)
[1] 0.9871073
> colSd(tmp2)
[1] 0.9935327
> colMax(tmp2)
[1] 2.511511
> colMin(tmp2)
[1] -2.392696
> colMedians(tmp2)
[1] -0.2061432
> colRanges(tmp2)
          [,1]
[1,] -2.392696
[2,]  2.511511
> 
> 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] -1.7685323  3.9742765 -3.7212220  0.5684073  1.9913288 -6.8898771
 [7] -3.0748632 -0.7032812 -4.2726722 -2.8241086
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -1.7168189
[2,] -1.1530324
[3,] -0.3581258
[4,]  0.5044696
[5,]  2.4140925
> 
> rowApply(tmp,sum)
 [1]  1.1960153 -0.5383748 -8.0448835  1.3973850 -4.7450032 -2.9688525
 [7] -0.6118386 -0.7494822 -1.9540399  0.2985303
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    7    1   10   10    4    7    1    2    4     4
 [2,]   10    7    5    4    9   10    7    9    9     7
 [3,]    2    3    7    7    6    3    9    5    3     5
 [4,]    4    9    6    5    5    4    6   10    5     8
 [5,]    6    8    8    9    7    5    5    3    6     6
 [6,]    9    5    4    1    3    1    4    7    7     3
 [7,]    8    2    3    6   10    6    2    1   10     2
 [8,]    1    6    2    3    8    8   10    8    2     9
 [9,]    3    4    1    2    2    9    3    4    8    10
[10,]    5   10    9    8    1    2    8    6    1     1
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1] -3.8357525  2.8030606 -0.6736164  0.5526337  1.8440707  0.1792133
 [7] -5.2115285  1.9291466 -0.4424001 -1.0008848  1.6391052 -5.3086638
[13] -3.5751826  0.6571413 -0.9085691  0.4724846 -0.4053935 -0.6738135
[19]  2.6754552  2.6049387
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -1.8808147
[2,] -1.2553419
[3,] -0.7778581
[4,] -0.2622084
[5,]  0.3404707
> 
> rowApply(tmp,sum)
[1] -4.8382032  0.4716685  1.2201271 -5.7750247  2.2428773
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]   15    1    5    5    9
[2,]   17   14   17   17   10
[3,]    6    8    8   10   12
[4,]   12   18   18    8    3
[5,]   19    5   16   13   14
> 
> 
> as.matrix(tmp)
           [,1]        [,2]        [,3]        [,4]       [,5]       [,6]
[1,]  0.3404707  0.48811543 -0.62706711  0.01425442  0.9423236 -0.7368884
[2,] -1.8808147  0.63286178 -0.26750564  1.26623559 -1.0619304  1.3225794
[3,] -0.7778581  1.22272006 -0.28122696  1.24669122  1.1468107 -0.0440388
[4,] -1.2553419  0.52439578  0.01552698 -0.48796214  0.2360755  0.5214666
[5,] -0.2622084 -0.06503241  0.48665630 -1.48658539  0.5807913 -0.8839055
           [,7]       [,8]       [,9]      [,10]      [,11]        [,12]
[1,] -1.7471320 -0.1568954  0.4732022 -0.6212882 -0.1857201 -1.689361388
[2,] -0.3306955  0.9116869  0.1429608 -1.8197582  0.9453260  0.477347626
[3,] -1.7414270 -0.6597627  0.7073565  1.2694026 -0.5338910 -0.004973925
[4,] -0.8835071 -0.5756862 -1.8809400  1.1501125  0.3143870 -2.433476004
[5,] -0.5087670  2.4098041  0.1150204 -0.9793534  1.0990033 -1.658200061
           [,13]      [,14]      [,15]        [,16]       [,17]      [,18]
[1,]  0.09494311  0.8863980 -1.8572849  0.006271264 -2.18714689  0.1820053
[2,] -1.08103716  0.1100119  0.4802723 -0.205336397  1.04066976 -1.2602465
[3,]  0.46424293 -1.0701127  0.2176567 -1.095237725  0.21378172  0.6193069
[4,] -1.47509128 -0.0336710 -1.7736091  0.341923507  0.02070591  0.1672111
[5,] -1.57824020  0.7645151  2.0243959  1.424863920  0.50659595 -0.3820902
           [,19]      [,20]
[1,] -0.08409928  1.6266967
[2,]  1.49406223 -0.4450212
[3,]  1.46250079 -1.1418142
[4,]  1.05364644  0.6788089
[5,] -1.25065499  1.8862686
> 
> 
> is.BufferedMatrix(tmp)
[1] TRUE
> 
> as.BufferedMatrix(as.matrix(tmp))
BufferedMatrix object
Matrix size:  5 20 
Buffer size:  1 1 
Directory:    /Users/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:    /Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  654  bytes.
Disk usage :  200  bytes.
> subBufferedMatrix(tmp,,5:8)
BufferedMatrix object
Matrix size:  5 4 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  567  bytes.
Disk usage :  160  bytes.
> subBufferedMatrix(tmp,1:3,)
BufferedMatrix object
Matrix size:  3 20 
Buffer size:  1 1 
Directory:    /Users/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 1.55133 -0.3046865 0.2142368 -0.9526348 -1.296746 2.172278 -0.8229643
          col8      col9     col10     col11     col12     col13       col14
row1 0.6476886 -1.401863 0.2544009 0.4902808 0.2731106 -2.369085 -0.07693975
         col15      col16     col17     col18      col19   col20
row1 0.3001555 -0.1281175 -0.948134 0.9309478 -0.4375983 1.94091
> tmp[,"col10"]
          col10
row1  0.2544009
row2 -0.5184225
row3 -0.5146419
row4  1.2804975
row5 -2.5997305
> tmp[c("row1","row5"),]
         col1       col2       col3        col4       col5        col6
row1 1.551330 -0.3046865  0.2142368 -0.95263482 -1.2967463  2.17227773
row5 0.201725 -2.0189272 -0.6909989  0.07927501 -0.1361072 -0.04284206
           col7       col8      col9      col10     col11      col12      col13
row1 -0.8229643  0.6476886 -1.401863  0.2544009 0.4902808  0.2731106 -2.3690853
row5  0.4812358 -2.5519994  1.678446 -2.5997305 0.7603623 -0.1464185 -0.2994794
           col14      col15      col16     col17     col18      col19
row1 -0.07693975  0.3001555 -0.1281175 -0.948134 0.9309478 -0.4375983
row5 -1.41278024 -1.5202543  1.4914718 -1.110224 0.9828948  0.6924323
          col20
row1 1.94090994
row5 0.08867787
> tmp[,c("col6","col20")]
            col6      col20
row1  2.17227773 1.94090994
row2 -1.17361924 0.71361206
row3 -0.21675994 1.52997793
row4 -1.22068027 1.20739836
row5 -0.04284206 0.08867787
> tmp[c("row1","row5"),c("col6","col20")]
            col6      col20
row1  2.17227773 1.94090994
row5 -0.04284206 0.08867787
> 
> 
> 
> 
> 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.46881 50.44709 49.50372 49.55876 49.22206 105.788 51.57818 50.58228
         col9    col10    col11    col12   col13    col14    col15    col16
row1 48.13828 49.18507 47.84735 50.63095 51.2707 49.57708 49.37711 51.36179
        col17    col18    col19    col20
row1 48.83208 51.45001 51.15619 106.3003
> tmp[,"col10"]
        col10
row1 49.18507
row2 29.87335
row3 30.74594
row4 29.84177
row5 49.87402
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 50.46881 50.44709 49.50372 49.55876 49.22206 105.7880 51.57818 50.58228
row5 50.95635 49.53661 49.46481 50.85281 51.87600 104.6918 49.55758 48.36267
         col9    col10    col11    col12    col13    col14    col15    col16
row1 48.13828 49.18507 47.84735 50.63095 51.27070 49.57708 49.37711 51.36179
row5 51.29683 49.87402 49.92014 49.40872 51.30316 49.20590 49.55232 49.43025
        col17    col18    col19    col20
row1 48.83208 51.45001 51.15619 106.3003
row5 51.23970 50.35469 49.25212 105.7976
> tmp[,c("col6","col20")]
          col6     col20
row1 105.78800 106.30027
row2  72.71303  75.61964
row3  74.27554  74.12199
row4  75.35557  74.79884
row5 104.69179 105.79756
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 105.7880 106.3003
row5 104.6918 105.7976
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 105.7880 106.3003
row5 104.6918 105.7976
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
          col13
[1,]  0.6203639
[2,]  0.8924508
[3,]  1.2262299
[4,] -0.8995325
[5,]  0.2989763
> tmp[,c("col17","col7")]
         col17        col7
[1,] 0.0460477 -0.23677293
[2,] 1.9241757  0.55552050
[3,] 0.1791586 -0.03421778
[4,] 0.3207591  0.12250055
[5,] 0.8309257  0.08062135
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
           col6       col20
[1,] -0.1940763 -0.02960511
[2,]  0.7255180 -0.18677629
[3,]  0.8139138 -0.76827826
[4,]  0.3878847  1.84028091
[5,] -1.6638019 -0.40550331
> subBufferedMatrix(tmp,1,c("col6"))[,1]
           col1
[1,] -0.1940763
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
           col6
[1,] -0.1940763
[2,]  0.7255180
> 
> 
> 
> 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 -1.5665949 -0.6637607 -0.4233296  0.9713759 0.7654716 -1.0518467
row1  0.5739986 -0.2466429 -0.2303086 -1.4816219 1.3468102  0.5073288
           [,7]      [,8]        [,9]      [,10]     [,11]      [,12]     [,13]
row3 -0.8806227 -0.929184 -0.04980872 -1.1199947 0.9172674  1.2514271 0.9597534
row1  0.3422368 -1.231667  0.46183833 -0.5353728 0.2738093 -0.1783682 1.5116576
          [,14]      [,15]      [,16]      [,17]       [,18]       [,19]
row3 -0.3998565 -0.6601507 -0.4411645 -0.1116209  0.08021549 -0.01414651
row1  1.2606620 -0.2603714  0.4677482  0.1956748 -0.66938468 -0.77731599
          [,20]
row3 -0.7738022
row1  0.7624961
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
            [,1]       [,2]     [,3]       [,4]       [,5]      [,6]      [,7]
row2 -0.03001176 -0.4581286 1.075371 -0.7598892 -0.4962925 0.8598029 0.8825966
          [,8]      [,9]     [,10]
row2 -1.285702 0.3335744 0.1981785
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
          [,1]     [,2]      [,3]      [,4]      [,5]       [,6]     [,7]
row5 0.8848965 1.985102 0.1662979 -1.081907 0.5203003 -0.1518244 1.775093
         [,8]        [,9]     [,10]    [,11]      [,12]     [,13]      [,14]
row5 1.932102 -0.05755584 0.1680719 1.720764 -0.5249212 -1.182119 -0.4389371
         [,15]      [,16]      [,17]     [,18]     [,19]     [,20]
row5 0.4495051 -0.8716232 -0.7262508 -1.767968 0.8117567 0.1569854
> 
> 
> 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: 0x600001580300>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1855cda64511" 
 [2] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1855c1f006617"
 [3] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1855c532e7fe7"
 [4] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1855c11cf415b"
 [5] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1855c3dcbc67f"
 [6] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1855cd54db8b" 
 [7] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1855c3e198983"
 [8] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1855c7e93174e"
 [9] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1855c6adf42cd"
[10] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1855c679ad78b"
[11] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1855c66bd1bd0"
[12] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1855c96d2962" 
[13] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1855c5db7e5c3"
[14] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1855c544d9546"
[15] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1855c318351e7"
> 
> 
> ### 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: 0x600001580480>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x600001580480>
Warning message:
In dir.create(new.directory) :
  '/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x600001580480>
> rowMedians(tmp)
  [1] -0.238756778  0.039861320  0.133394234  1.012833438 -0.242433139
  [6]  0.224411236 -0.223248110  0.300356104  0.709469642  0.083497708
 [11] -0.303582314 -0.135968032  0.015812045  0.023599560  0.471101157
 [16] -0.774263924  0.722342554  0.679784829  0.297403079 -0.211966263
 [21] -0.193351439  0.257919369  0.071670528 -0.124318478  0.132084748
 [26] -0.209521402  0.431332972  0.702763940  0.330941720 -0.148406476
 [31] -0.081280825  0.107576982 -0.414638778  0.169391685 -0.483684445
 [36] -0.281022083 -0.301516618 -0.604093405  0.610312343  0.086228877
 [41]  0.300863136 -0.269026881 -0.165404825  0.168981549  0.147035539
 [46]  0.342480928  0.095875598  0.575699067 -0.159133020  0.448320699
 [51]  0.046019828  0.353634010  0.309090633 -0.034671385 -0.441953979
 [56]  0.171602773  0.146192893  0.179956532  0.164062045 -0.067324539
 [61]  0.707720940 -0.598848187  0.089107725  0.372910197  0.022549979
 [66]  0.190486083 -0.645614647  0.024911354  0.106601177 -0.319554699
 [71]  0.062809482  0.166201133 -0.044790850 -0.310336688 -0.029074174
 [76] -0.081697877 -0.028934432 -0.181804810 -0.345877370  0.027996619
 [81] -0.040305197  0.385654205  0.432125980 -0.225033089 -0.395850339
 [86] -0.091534506 -0.114649444  0.032413206 -0.499323960  0.189333653
 [91]  0.220971735 -0.373324737  0.617354629  0.567612595  0.221899268
 [96]  0.046401453 -0.619135870 -0.420684576  0.129032961 -0.779004540
[101]  0.129006624  0.683164627  0.625164767 -0.077914037 -0.172951961
[106]  0.551614314 -0.332233036 -0.104904885 -0.107169528 -0.428665143
[111] -0.377849573  0.111178862 -0.147412764 -0.141604985  0.140100233
[116]  0.016125124 -0.335136057  0.173993486 -0.238266250 -0.206845547
[121] -0.037280465  0.446562351 -0.236173116 -0.744122525  0.120178073
[126]  0.146687354  0.180558329  0.418994058  0.349611251  0.134506389
[131]  0.164615907  0.254682223  0.153945860  0.295985387  0.394756794
[136] -0.403135922  0.109572262 -0.124681905 -0.084301434  0.426611006
[141]  0.027472650  0.061120578  0.241978164  0.368353227 -0.423163611
[146]  0.246385466 -0.015432105 -0.343326614 -0.359292185 -0.626730131
[151] -0.137697523  0.625605557 -0.269227162 -0.848868334 -0.288462518
[156] -0.032135941  0.335328700 -0.211152203 -0.166210694 -0.244388311
[161] -0.804356441 -0.044190418 -0.442719453 -0.156585415 -0.158474307
[166]  0.395051736 -0.302297359 -0.421446747 -0.052145504  0.042895385
[171] -0.333089349 -0.037954873  0.329578094  0.262766522 -0.065542492
[176] -0.329574798 -0.250600193 -0.333312737 -0.409070566 -0.293933920
[181]  0.156408323  0.586398460  0.176174082  0.196560760 -0.285170101
[186]  0.056618940 -0.137804403  0.422138406 -0.123123347  0.165579377
[191] -0.022061029  0.241964778 -0.306438239 -0.112080684 -0.495182281
[196] -0.412098175 -0.445797942 -0.124357025 -0.312359923  0.773213547
[201] -0.208367395  0.096833315  0.111823714  0.636582915  0.367692392
[206] -0.014244218 -0.488655630  0.575816777 -0.355355312  0.129403842
[211]  0.192583886  0.000358048 -0.044392177  0.333121532  0.089954830
[216]  0.029378778 -0.048365610 -0.022445734 -0.202868390 -0.457599338
[221] -0.491183731  0.112504680 -0.146313186  0.557781243 -0.145605551
[226]  0.264329975 -0.322571719 -0.098193204 -0.357774372 -0.025018771
> 
> proc.time()
   user  system elapsed 
  0.718   3.642   5.193 

BufferedMatrix.Rcheck/tests/rawCalltesting.Rout


R Under development (unstable) (2026-01-15 r89304) -- "Unsuffered Consequences"
Copyright (C) 2026 The R Foundation for Statistical Computing
Platform: aarch64-apple-darwin20

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: 0x600001888000>
> .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: 0x600001888000>
> .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: 0x600001888000>
> .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: 0x600001888000>
> 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: 0x600001894660>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600001894660>
> .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: 0x600001894660>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600001894660>
> .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: 0x600001894660>
> 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: 0x600001894840>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600001894840>
> .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: 0x600001894840>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x600001894840>
> .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: 0x600001894840>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x600001894840>
> .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: 0x600001894840>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x600001894840>
> .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: 0x600001894840>
> 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: 0x600001894a20>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x600001894a20>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600001894a20>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600001894a20>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile4e5163d300e" "BufferedMatrixFile4e575d1a360"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile4e5163d300e" "BufferedMatrixFile4e575d1a360"
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000018841e0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000018841e0>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x6000018841e0>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x6000018841e0>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x6000018841e0>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x6000018841e0>
> .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: 0x6000018843c0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000018843c0>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x6000018843c0>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x6000018843c0>
> 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: 0x6000018845a0>
> .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: 0x6000018845a0>
> rm(P)
> 
> proc.time()
   user  system elapsed 
  0.141   0.060   0.197 

BufferedMatrix.Rcheck/tests/Rcodetesting.Rout


R Under development (unstable) (2026-01-15 r89304) -- "Unsuffered Consequences"
Copyright (C) 2026 The R Foundation for Statistical Computing
Platform: aarch64-apple-darwin20

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.124   0.033   0.154 

Example timings