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

This page was generated on 2025-12-15 12:07 -0500 (Mon, 15 Dec 2025).

HostnameOSArch (*)R versionInstalled pkgs
nebbiolo2Linux (Ubuntu 24.04.3 LTS)x86_644.5.2 (2025-10-31) -- "[Not] Part in a Rumble" 4882
merida1macOS 12.7.6 Montereyx86_644.5.2 (2025-10-31) -- "[Not] Part in a Rumble" 4673
kjohnson1macOS 13.7.5 Venturaarm644.5.2 Patched (2025-11-04 r88984) -- "[Not] Part in a Rumble" 4607
taishanLinux (openEuler 24.03 LTS)aarch644.5.0 (2025-04-11) -- "How About a Twenty-Six" 4671
Click on any hostname to see more info about the system (e.g. compilers)      (*) as reported by 'uname -p', except on Windows and Mac OS X

Package 257/2361HostnameOS / ArchINSTALLBUILDCHECKBUILD BIN
BufferedMatrix 1.74.0  (landing page)
Ben Bolstad
Snapshot Date: 2025-12-11 13:45 -0500 (Thu, 11 Dec 2025)
git_url: https://git.bioconductor.org/packages/BufferedMatrix
git_branch: RELEASE_3_22
git_last_commit: d2ce144
git_last_commit_date: 2025-10-29 09:58:55 -0500 (Wed, 29 Oct 2025)
nebbiolo2Linux (Ubuntu 24.04.3 LTS) / x86_64  OK    OK    OK  UNNEEDED, same version is already published
merida1macOS 12.7.6 Monterey / x86_64  OK    OK    WARNINGS    OK  UNNEEDED, same version is already published
kjohnson1macOS 13.7.5 Ventura / arm64  OK    OK    WARNINGS    OK  UNNEEDED, same version is already published
taishanLinux (openEuler 24.03 LTS) / aarch64  OK    OK    OK  


CHECK results for BufferedMatrix on kjohnson1

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

raw results


Summary

Package: BufferedMatrix
Version: 1.74.0
Command: /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.74.0.tar.gz
StartedAt: 2025-12-12 17:44:17 -0500 (Fri, 12 Dec 2025)
EndedAt: 2025-12-12 17:45:14 -0500 (Fri, 12 Dec 2025)
EllapsedTime: 56.6 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.74.0.tar.gz
###
##############################################################################
##############################################################################


* using log directory ‘/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck’
* using R version 4.5.2 Patched (2025-11-04 r88984)
* 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.74.0’
* checking package namespace information ... OK
* checking package dependencies ... OK
* checking if this is a source package ... OK
* checking if there is a namespace ... OK
* checking for hidden files and directories ... OK
* checking for portable file names ... OK
* checking for sufficient/correct file permissions ... OK
* checking whether package ‘BufferedMatrix’ can be installed ... 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.22-bioc/meat/BufferedMatrix.Rcheck/00install.out’ for details.
* used C compiler: ‘Apple clang version 15.0.0 (clang-1500.0.40.1)’
* 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 ... NOTE
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, 2 NOTEs
See
  ‘/Users/biocbuild/bbs-3.22-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.5-arm64/Resources/library’
* installing *source* package ‘BufferedMatrix’ ...
** this is package ‘BufferedMatrix’ version ‘1.74.0’
** using staged installation
** libs
using C compiler: ‘Apple clang version 15.0.0 (clang-1500.0.40.1)’
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.5-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 version 4.5.2 Patched (2025-11-04 r88984) -- "[Not] Part in a Rumble"
Copyright (C) 2025 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.336   0.110   0.490 

BufferedMatrix.Rcheck/tests/objectTesting.Rout


R version 4.5.2 Patched (2025-11-04 r88984) -- "[Not] Part in a Rumble"
Copyright (C) 2025 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.22-bioc/meat/BufferedMatrix.Rcheck/tests"
> prefix(tmp3)
[1] "BM"
> 
> ## testing if we can remove these objects
> rm(tmp, tmp2, tmp3)
> gc()
         used (Mb) gc trigger (Mb) limit (Mb) max used (Mb)
Ncells 480695 25.7    1056201 56.5         NA   634425 33.9
Vcells 890553  6.8    8388608 64.0      65536  2109045 16.1
> 
> 
> 
> 
> ##
> ## 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 Dec 12 17:44:42 2025"
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> date()
[1] "Fri Dec 12 17:44:42 2025"
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,which.col] == test.matrix[which.row,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> 
> 
> RowMode(tmp2)
<pointer: 0x600001fdc000>
> 
> 
> 
> 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 Dec 12 17:44:46 2025"
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col <- sample(1:20,5,replace=TRUE)
+   if (!all(tmp2[which.row,which.col] == test.matrix[which.row,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> date()
[1] "Fri Dec 12 17:44:48 2025"
> 
> ColMode(tmp2)
<pointer: 0x600001fdc000>
> 
> 
> 
> ### 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,] 98.7361471  1.3985040 -1.3475288 -1.0840702
[2,] -0.2469194 -0.5703420 -0.2112190 -0.5843063
[3,]  0.2344523 -0.3202670  1.5725821 -1.3512060
[4,]  1.3928379 -0.4667441  0.5399164  0.8640585
> ewApply(tmp5,abs)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
           [,1]      [,2]      [,3]      [,4]
[1,] 98.7361471 1.3985040 1.3475288 1.0840702
[2,]  0.2469194 0.5703420 0.2112190 0.5843063
[3,]  0.2344523 0.3202670 1.5725821 1.3512060
[4,]  1.3928379 0.4667441 0.5399164 0.8640585
> ewApply(tmp5,sqrt)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
          [,1]      [,2]      [,3]      [,4]
[1,] 9.9366064 1.1825836 1.1608311 1.0411869
[2,] 0.4969099 0.7552099 0.4595857 0.7643993
[3,] 0.4842028 0.5659213 1.2540264 1.1624138
[4,] 1.1801855 0.6831867 0.7347900 0.9295475
> 
> 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.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
          [,1]     [,2]     [,3]     [,4]
[1,] 223.10221 38.22434 37.95584 36.49594
[2,]  30.21602 33.12244 29.80708 33.22830
[3,]  30.07648 30.97948 39.11285 37.97534
[4,]  38.19469 32.29861 32.88782 35.15953
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x600001fd02a0>
> exp(tmp5)
<pointer: 0x600001fd02a0>
> log(tmp5,2)
<pointer: 0x600001fd02a0>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 464.358
> Min(tmp5)
[1] 55.1073
> mean(tmp5)
[1] 73.94763
> Sum(tmp5)
[1] 14789.53
> Var(tmp5)
[1] 836.7618
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 90.02584 72.46272 74.11651 72.77422 72.79875 69.41744 72.28539 71.25898
 [9] 71.56187 72.77462
> rowSums(tmp5)
 [1] 1800.517 1449.254 1482.330 1455.484 1455.975 1388.349 1445.708 1425.180
 [9] 1431.237 1455.492
> rowVars(tmp5)
 [1] 7825.19350   75.26025   54.77250   77.36451   87.03014   66.11043
 [7]   65.54702   63.09212   57.26333   75.48092
> rowSd(tmp5)
 [1] 88.460124  8.675266  7.400844  8.795710  9.328995  8.130832  8.096111
 [8]  7.943055  7.567254  8.687976
> rowMax(tmp5)
 [1] 464.35802  93.52332  85.88712  86.81739  88.84944  84.12156  83.75835
 [8]  86.88183  89.14538  86.20197
> rowMin(tmp5)
 [1] 56.79330 60.80932 61.84764 59.82941 55.66517 55.10730 55.92045 60.89844
 [9] 58.16217 57.85559
> 
> colMeans(tmp5)
 [1] 109.06785  71.85295  70.07048  76.60064  70.51429  73.37815  71.08261
 [8]  68.40482  72.83659  75.01252  74.07444  73.64403  74.00281  71.10326
[15]  67.36027  73.28996  70.79119  72.97382  69.54835  73.34367
> colSums(tmp5)
 [1] 1090.6785  718.5295  700.7048  766.0064  705.1429  733.7815  710.8261
 [8]  684.0482  728.3659  750.1252  740.7444  736.4403  740.0281  711.0326
[15]  673.6027  732.8996  707.9119  729.7382  695.4835  733.4367
> colVars(tmp5)
 [1] 15654.79375    59.49438    63.02797    33.17533    42.57161   126.48424
 [7]    31.89319    61.81481    44.74725   103.29328    90.48825    89.75419
[13]    73.93015    55.70467    36.56434    95.48644    75.03808    94.45195
[19]    53.52361    64.43288
> colSd(tmp5)
 [1] 125.119118   7.713260   7.939016   5.759803   6.524693  11.246521
 [7]   5.647406   7.862239   6.689339  10.163330   9.512531   9.473869
[13]   8.598264   7.463556   6.046845   9.771717   8.662452   9.718639
[19]   7.315983   8.027010
> colMax(tmp5)
 [1] 464.35802  84.12156  81.40826  88.84944  79.83227  89.14538  81.40787
 [8]  86.49670  82.28918  93.52332  88.93814  86.81739  85.49098  82.99169
[15]  76.88047  87.45306  82.96218  86.88183  79.80319  85.91312
> colMin(tmp5)
 [1] 61.24571 60.89844 55.92045 69.16035 61.22428 55.66517 63.25200 58.22685
 [9] 63.42516 55.10730 64.30217 58.16217 63.78619 61.19378 58.92375 62.46950
[17] 57.85559 59.82941 56.30546 60.39547
> 
> 
> ### 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 72.46272 74.11651 72.77422 72.79875 69.41744 72.28539 71.25898
 [9] 71.56187 72.77462
> rowSums(tmp5)
 [1]       NA 1449.254 1482.330 1455.484 1455.975 1388.349 1445.708 1425.180
 [9] 1431.237 1455.492
> rowVars(tmp5)
 [1] 8221.84744   75.26025   54.77250   77.36451   87.03014   66.11043
 [7]   65.54702   63.09212   57.26333   75.48092
> rowSd(tmp5)
 [1] 90.674403  8.675266  7.400844  8.795710  9.328995  8.130832  8.096111
 [8]  7.943055  7.567254  8.687976
> rowMax(tmp5)
 [1]       NA 93.52332 85.88712 86.81739 88.84944 84.12156 83.75835 86.88183
 [9] 89.14538 86.20197
> rowMin(tmp5)
 [1]       NA 60.80932 61.84764 59.82941 55.66517 55.10730 55.92045 60.89844
 [9] 58.16217 57.85559
> 
> colMeans(tmp5)
 [1] 109.06785  71.85295  70.07048  76.60064  70.51429  73.37815  71.08261
 [8]  68.40482  72.83659  75.01252  74.07444  73.64403        NA  71.10326
[15]  67.36027  73.28996  70.79119  72.97382  69.54835  73.34367
> colSums(tmp5)
 [1] 1090.6785  718.5295  700.7048  766.0064  705.1429  733.7815  710.8261
 [8]  684.0482  728.3659  750.1252  740.7444  736.4403        NA  711.0326
[15]  673.6027  732.8996  707.9119  729.7382  695.4835  733.4367
> colVars(tmp5)
 [1] 15654.79375    59.49438    63.02797    33.17533    42.57161   126.48424
 [7]    31.89319    61.81481    44.74725   103.29328    90.48825    89.75419
[13]          NA    55.70467    36.56434    95.48644    75.03808    94.45195
[19]    53.52361    64.43288
> colSd(tmp5)
 [1] 125.119118   7.713260   7.939016   5.759803   6.524693  11.246521
 [7]   5.647406   7.862239   6.689339  10.163330   9.512531   9.473869
[13]         NA   7.463556   6.046845   9.771717   8.662452   9.718639
[19]   7.315983   8.027010
> colMax(tmp5)
 [1] 464.35802  84.12156  81.40826  88.84944  79.83227  89.14538  81.40787
 [8]  86.49670  82.28918  93.52332  88.93814  86.81739        NA  82.99169
[15]  76.88047  87.45306  82.96218  86.88183  79.80319  85.91312
> colMin(tmp5)
 [1] 61.24571 60.89844 55.92045 69.16035 61.22428 55.66517 63.25200 58.22685
 [9] 63.42516 55.10730 64.30217 58.16217       NA 61.19378 58.92375 62.46950
[17] 57.85559 59.82941 56.30546 60.39547
> 
> Max(tmp5,na.rm=TRUE)
[1] 464.358
> Min(tmp5,na.rm=TRUE)
[1] 55.1073
> mean(tmp5,na.rm=TRUE)
[1] 73.99507
> Sum(tmp5,na.rm=TRUE)
[1] 14725.02
> Var(tmp5,na.rm=TRUE)
[1] 840.5356
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 91.36887 72.46272 74.11651 72.77422 72.79875 69.41744 72.28539 71.25898
 [9] 71.56187 72.77462
> rowSums(tmp5,na.rm=TRUE)
 [1] 1736.009 1449.254 1482.330 1455.484 1455.975 1388.349 1445.708 1425.180
 [9] 1431.237 1455.492
> rowVars(tmp5,na.rm=TRUE)
 [1] 8221.84744   75.26025   54.77250   77.36451   87.03014   66.11043
 [7]   65.54702   63.09212   57.26333   75.48092
> rowSd(tmp5,na.rm=TRUE)
 [1] 90.674403  8.675266  7.400844  8.795710  9.328995  8.130832  8.096111
 [8]  7.943055  7.567254  8.687976
> rowMax(tmp5,na.rm=TRUE)
 [1] 464.35802  93.52332  85.88712  86.81739  88.84944  84.12156  83.75835
 [8]  86.88183  89.14538  86.20197
> rowMin(tmp5,na.rm=TRUE)
 [1] 56.79330 60.80932 61.84764 59.82941 55.66517 55.10730 55.92045 60.89844
 [9] 58.16217 57.85559
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 109.06785  71.85295  70.07048  76.60064  70.51429  73.37815  71.08261
 [8]  68.40482  72.83659  75.01252  74.07444  73.64403  75.05777  71.10326
[15]  67.36027  73.28996  70.79119  72.97382  69.54835  73.34367
> colSums(tmp5,na.rm=TRUE)
 [1] 1090.6785  718.5295  700.7048  766.0064  705.1429  733.7815  710.8261
 [8]  684.0482  728.3659  750.1252  740.7444  736.4403  675.5199  711.0326
[15]  673.6027  732.8996  707.9119  729.7382  695.4835  733.4367
> colVars(tmp5,na.rm=TRUE)
 [1] 15654.79375    59.49438    63.02797    33.17533    42.57161   126.48424
 [7]    31.89319    61.81481    44.74725   103.29328    90.48825    89.75419
[13]    70.65083    55.70467    36.56434    95.48644    75.03808    94.45195
[19]    53.52361    64.43288
> colSd(tmp5,na.rm=TRUE)
 [1] 125.119118   7.713260   7.939016   5.759803   6.524693  11.246521
 [7]   5.647406   7.862239   6.689339  10.163330   9.512531   9.473869
[13]   8.405405   7.463556   6.046845   9.771717   8.662452   9.718639
[19]   7.315983   8.027010
> colMax(tmp5,na.rm=TRUE)
 [1] 464.35802  84.12156  81.40826  88.84944  79.83227  89.14538  81.40787
 [8]  86.49670  82.28918  93.52332  88.93814  86.81739  85.49098  82.99169
[15]  76.88047  87.45306  82.96218  86.88183  79.80319  85.91312
> colMin(tmp5,na.rm=TRUE)
 [1] 61.24571 60.89844 55.92045 69.16035 61.22428 55.66517 63.25200 58.22685
 [9] 63.42516 55.10730 64.30217 58.16217 63.78619 61.19378 58.92375 62.46950
[17] 57.85559 59.82941 56.30546 60.39547
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1]      NaN 72.46272 74.11651 72.77422 72.79875 69.41744 72.28539 71.25898
 [9] 71.56187 72.77462
> rowSums(tmp5,na.rm=TRUE)
 [1]    0.000 1449.254 1482.330 1455.484 1455.975 1388.349 1445.708 1425.180
 [9] 1431.237 1455.492
> rowVars(tmp5,na.rm=TRUE)
 [1]       NA 75.26025 54.77250 77.36451 87.03014 66.11043 65.54702 63.09212
 [9] 57.26333 75.48092
> rowSd(tmp5,na.rm=TRUE)
 [1]       NA 8.675266 7.400844 8.795710 9.328995 8.130832 8.096111 7.943055
 [9] 7.567254 8.687976
> rowMax(tmp5,na.rm=TRUE)
 [1]       NA 93.52332 85.88712 86.81739 88.84944 84.12156 83.75835 86.88183
 [9] 89.14538 86.20197
> rowMin(tmp5,na.rm=TRUE)
 [1]       NA 60.80932 61.84764 59.82941 55.66517 55.10730 55.92045 60.89844
 [9] 58.16217 57.85559
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1] 69.59116 70.99673 69.07830 76.67165 70.16478 75.22091 71.01035 66.39461
 [9] 72.85704 74.61220 74.69662 73.99602      NaN 72.20431 68.29766 73.90533
[17] 71.67575 72.54046 69.46936 74.78235
> colSums(tmp5,na.rm=TRUE)
 [1] 626.3205 638.9706 621.7047 690.0448 631.4830 676.9882 639.0931 597.5515
 [9] 655.7133 671.5098 672.2696 665.9642   0.0000 649.8388 614.6789 665.1479
[17] 645.0818 652.8641 625.2242 673.0412
> colVars(tmp5,na.rm=TRUE)
 [1]  79.54461  58.68361  59.83172  37.26551  46.51876 104.09238  35.82109
 [8]  24.08104  50.33595 114.40201  97.44434  99.57956        NA  49.02918
[15]  31.24949 103.16213  75.61525 104.14565  60.14386  49.20146
> colSd(tmp5,na.rm=TRUE)
 [1]  8.918778  7.660523  7.735096  6.104549  6.820466 10.202567  5.985072
 [8]  4.907244  7.094784 10.695887  9.871390  9.978956        NA  7.002084
[15]  5.590124 10.156876  8.695703 10.205177  7.755247  7.014375
> colMax(tmp5,na.rm=TRUE)
 [1] 83.75835 84.12156 81.40826 88.84944 79.83227 89.14538 81.40787 72.90475
 [9] 82.28918 93.52332 88.93814 86.81739     -Inf 82.99169 76.88047 87.45306
[17] 82.96218 86.88183 79.80319 85.91312
> colMin(tmp5,na.rm=TRUE)
 [1] 61.24571 60.89844 55.92045 69.16035 61.22428 55.66517 63.25200 58.22685
 [9] 63.42516 55.10730 64.30217 58.16217      Inf 61.69908 61.88789 62.46950
[17] 57.85559 59.82941 56.30546 65.94008
> 
> 
> 
> 
> 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] 169.2632 199.4137 182.2870 387.4447 179.7024 275.4109 124.4798 124.5618
 [9] 215.0180 151.7644
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 169.2632 199.4137 182.2870 387.4447 179.7024 275.4109 124.4798 124.5618
 [9] 215.0180 151.7644
> 
> 
> 
> 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]  4.263256e-14  2.842171e-14 -1.421085e-13 -8.526513e-14  1.705303e-13
 [6] -2.842171e-14  5.684342e-14  8.526513e-14  0.000000e+00 -8.526513e-14
[11] -1.705303e-13  5.684342e-14 -1.705303e-13  5.684342e-14  0.000000e+00
[16]  8.526513e-14  2.842171e-14  5.684342e-14  0.000000e+00  5.684342e-14
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> ## making sure these things agree
> ##
> ## first when there is no NA
> 
> 
> 
> agree.checks <- function(buff.matrix,r.matrix,err.tol=1e-10){
+ 
+   if (Max(buff.matrix,na.rm=TRUE) != max(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Max")
+   }
+   
+ 
+   if (Min(buff.matrix,na.rm=TRUE) != min(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Min")
+   }
+ 
+ 
+   if (abs(Sum(buff.matrix,na.rm=TRUE)- sum(r.matrix,na.rm=TRUE)) > err.tol){
+ 
+     cat(Sum(buff.matrix,na.rm=TRUE),"\n")
+     cat(sum(r.matrix,na.rm=TRUE),"\n")
+     cat(Sum(buff.matrix,na.rm=TRUE) - sum(r.matrix,na.rm=TRUE),"\n")
+     
+     stop("No agreement in Sum")
+   }
+   
+   if (abs(mean(buff.matrix,na.rm=TRUE) - mean(r.matrix,na.rm=TRUE)) > err.tol){
+     stop("No agreement in mean")
+   }
+   
+   
+   if(abs(Var(buff.matrix,na.rm=TRUE) - var(as.vector(r.matrix),na.rm=TRUE)) > err.tol){
+     stop("No agreement in Var")
+   }
+   
+   
+ 
+   if(any(abs(rowMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,mean,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowMeans")
+   }
+   
+   
+   if(any(abs(colMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,mean,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colMeans")
+   }
+   
+   
+   if(any(abs(rowSums(buff.matrix,na.rm=TRUE)  -  apply(r.matrix,1,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in rowSums")
+   }
+   
+   
+   if(any(abs(colSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colSums")
+   }
+   
+   ### this is to get around the fact that R doesn't like to compute NA on an entire vector of NA when 
+   ### computing variance
+   my.Var <- function(x,na.rm=FALSE){
+    if (all(is.na(x))){
+      return(NA)
+    } else {
+      var(x,na.rm=na.rm)
+    }
+ 
+   }
+   
+   if(any(abs(rowVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+   
+   
+   if(any(abs(colVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+ 
+ 
+   if(any(abs(rowMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+ 
+   if(any(abs(colMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+   
+   
+   if(any(abs(rowMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+   
+ 
+   if(any(abs(colMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+ 
+   if(any(abs(colMedians(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,median,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMedian")
+   }
+ 
+   if(any(abs(colRanges(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,range,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colRanges")
+   }
+ 
+ 
+   
+ }
> 
> 
> 
> 
> 
> 
> 
> 
> 
> for (rep in 1:20){
+   copymatrix <- matrix(rnorm(200,150,15),10,20)
+   
+   tmp5[1:10,1:20] <- copymatrix
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ## now lets assign some NA values and check agreement
+ 
+   which.row <- sample(1:10,1,replace=TRUE)
+   which.col  <- sample(1:20,1,replace=TRUE)
+   
+   cat(which.row," ",which.col,"\n")
+   
+   tmp5[which.row,which.col] <- NA
+   copymatrix[which.row,which.col] <- NA
+   
+   agree.checks(tmp5,copymatrix)
+ 
+   ## make an entire row NA
+   tmp5[which.row,] <- NA
+   copymatrix[which.row,] <- NA
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ### also make an entire col NA
+   tmp5[,which.col] <- NA
+   copymatrix[,which.col] <- NA
+ 
+   agree.checks(tmp5,copymatrix)
+ 
+   ### now make 1 element non NA with NA in the rest of row and column
+ 
+   tmp5[which.row,which.col] <- rnorm(1,150,15)
+   copymatrix[which.row,which.col] <- tmp5[which.row,which.col]
+ 
+   agree.checks(tmp5,copymatrix)
+ }
7   5 
9   13 
4   7 
5   12 
1   2 
7   11 
2   11 
6   14 
1   8 
9   18 
1   5 
2   2 
1   2 
2   19 
3   12 
7   19 
9   6 
3   1 
4   8 
8   16 
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.735373
> Min(tmp)
[1] -2.014423
> mean(tmp)
[1] 0.1060982
> Sum(tmp)
[1] 10.60982
> Var(tmp)
[1] 1.024783
> 
> rowMeans(tmp)
[1] 0.1060982
> rowSums(tmp)
[1] 10.60982
> rowVars(tmp)
[1] 1.024783
> rowSd(tmp)
[1] 1.012316
> rowMax(tmp)
[1] 2.735373
> rowMin(tmp)
[1] -2.014423
> 
> colMeans(tmp)
  [1]  0.6243877  0.7273151  1.2004620 -1.5346249  0.5850498  1.4007750
  [7]  1.6399849 -0.5746092  0.3442024 -0.6337053  0.4238113  0.1717377
 [13] -0.7360309  0.8076302  0.2160385  1.7956598 -1.1732183 -0.1053554
 [19]  2.3922157  1.0103376 -1.3107217 -0.8167309  1.1627301  0.4815350
 [25]  1.5219634  0.5064805 -0.8888922 -0.9793081  0.4584934  0.9811560
 [31] -0.6087210  0.7475200  0.8916294  1.6307120  0.7423761  0.5986291
 [37] -1.0486515 -0.4373201  2.2059976 -0.3717029 -1.5908694  0.4222192
 [43] -0.2481586 -0.2547643  0.9058909 -0.8253203  0.3141837 -0.2612969
 [49]  0.4387963 -0.4165697 -2.0144227  2.7353734  0.1732183  0.6411819
 [55]  0.9389860 -1.6570267  0.1830760  0.8028687  0.6776462 -0.4290136
 [61] -1.5364715 -0.5149537  0.6924802  1.8075168  0.5092284  0.5316111
 [67] -0.5054526  0.1897068 -1.0641273 -0.1087890 -0.2701806 -0.5005634
 [73] -0.7307912  0.7207865 -1.3900529 -1.7287031 -0.3169849 -0.2203956
 [79] -0.6519065  0.7955543  1.8017845 -0.1059508 -0.6273941 -0.6469691
 [85] -1.7732118 -1.0111659  0.3575607  1.2465970 -0.3843809 -0.5811704
 [91]  1.2389493 -0.7375524  0.2373172  0.3186258 -0.9119853  0.9047657
 [97] -1.5030174  0.3343898  0.2103448  1.9495315
> colSums(tmp)
  [1]  0.6243877  0.7273151  1.2004620 -1.5346249  0.5850498  1.4007750
  [7]  1.6399849 -0.5746092  0.3442024 -0.6337053  0.4238113  0.1717377
 [13] -0.7360309  0.8076302  0.2160385  1.7956598 -1.1732183 -0.1053554
 [19]  2.3922157  1.0103376 -1.3107217 -0.8167309  1.1627301  0.4815350
 [25]  1.5219634  0.5064805 -0.8888922 -0.9793081  0.4584934  0.9811560
 [31] -0.6087210  0.7475200  0.8916294  1.6307120  0.7423761  0.5986291
 [37] -1.0486515 -0.4373201  2.2059976 -0.3717029 -1.5908694  0.4222192
 [43] -0.2481586 -0.2547643  0.9058909 -0.8253203  0.3141837 -0.2612969
 [49]  0.4387963 -0.4165697 -2.0144227  2.7353734  0.1732183  0.6411819
 [55]  0.9389860 -1.6570267  0.1830760  0.8028687  0.6776462 -0.4290136
 [61] -1.5364715 -0.5149537  0.6924802  1.8075168  0.5092284  0.5316111
 [67] -0.5054526  0.1897068 -1.0641273 -0.1087890 -0.2701806 -0.5005634
 [73] -0.7307912  0.7207865 -1.3900529 -1.7287031 -0.3169849 -0.2203956
 [79] -0.6519065  0.7955543  1.8017845 -0.1059508 -0.6273941 -0.6469691
 [85] -1.7732118 -1.0111659  0.3575607  1.2465970 -0.3843809 -0.5811704
 [91]  1.2389493 -0.7375524  0.2373172  0.3186258 -0.9119853  0.9047657
 [97] -1.5030174  0.3343898  0.2103448  1.9495315
> 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.6243877  0.7273151  1.2004620 -1.5346249  0.5850498  1.4007750
  [7]  1.6399849 -0.5746092  0.3442024 -0.6337053  0.4238113  0.1717377
 [13] -0.7360309  0.8076302  0.2160385  1.7956598 -1.1732183 -0.1053554
 [19]  2.3922157  1.0103376 -1.3107217 -0.8167309  1.1627301  0.4815350
 [25]  1.5219634  0.5064805 -0.8888922 -0.9793081  0.4584934  0.9811560
 [31] -0.6087210  0.7475200  0.8916294  1.6307120  0.7423761  0.5986291
 [37] -1.0486515 -0.4373201  2.2059976 -0.3717029 -1.5908694  0.4222192
 [43] -0.2481586 -0.2547643  0.9058909 -0.8253203  0.3141837 -0.2612969
 [49]  0.4387963 -0.4165697 -2.0144227  2.7353734  0.1732183  0.6411819
 [55]  0.9389860 -1.6570267  0.1830760  0.8028687  0.6776462 -0.4290136
 [61] -1.5364715 -0.5149537  0.6924802  1.8075168  0.5092284  0.5316111
 [67] -0.5054526  0.1897068 -1.0641273 -0.1087890 -0.2701806 -0.5005634
 [73] -0.7307912  0.7207865 -1.3900529 -1.7287031 -0.3169849 -0.2203956
 [79] -0.6519065  0.7955543  1.8017845 -0.1059508 -0.6273941 -0.6469691
 [85] -1.7732118 -1.0111659  0.3575607  1.2465970 -0.3843809 -0.5811704
 [91]  1.2389493 -0.7375524  0.2373172  0.3186258 -0.9119853  0.9047657
 [97] -1.5030174  0.3343898  0.2103448  1.9495315
> colMin(tmp)
  [1]  0.6243877  0.7273151  1.2004620 -1.5346249  0.5850498  1.4007750
  [7]  1.6399849 -0.5746092  0.3442024 -0.6337053  0.4238113  0.1717377
 [13] -0.7360309  0.8076302  0.2160385  1.7956598 -1.1732183 -0.1053554
 [19]  2.3922157  1.0103376 -1.3107217 -0.8167309  1.1627301  0.4815350
 [25]  1.5219634  0.5064805 -0.8888922 -0.9793081  0.4584934  0.9811560
 [31] -0.6087210  0.7475200  0.8916294  1.6307120  0.7423761  0.5986291
 [37] -1.0486515 -0.4373201  2.2059976 -0.3717029 -1.5908694  0.4222192
 [43] -0.2481586 -0.2547643  0.9058909 -0.8253203  0.3141837 -0.2612969
 [49]  0.4387963 -0.4165697 -2.0144227  2.7353734  0.1732183  0.6411819
 [55]  0.9389860 -1.6570267  0.1830760  0.8028687  0.6776462 -0.4290136
 [61] -1.5364715 -0.5149537  0.6924802  1.8075168  0.5092284  0.5316111
 [67] -0.5054526  0.1897068 -1.0641273 -0.1087890 -0.2701806 -0.5005634
 [73] -0.7307912  0.7207865 -1.3900529 -1.7287031 -0.3169849 -0.2203956
 [79] -0.6519065  0.7955543  1.8017845 -0.1059508 -0.6273941 -0.6469691
 [85] -1.7732118 -1.0111659  0.3575607  1.2465970 -0.3843809 -0.5811704
 [91]  1.2389493 -0.7375524  0.2373172  0.3186258 -0.9119853  0.9047657
 [97] -1.5030174  0.3343898  0.2103448  1.9495315
> colMedians(tmp)
  [1]  0.6243877  0.7273151  1.2004620 -1.5346249  0.5850498  1.4007750
  [7]  1.6399849 -0.5746092  0.3442024 -0.6337053  0.4238113  0.1717377
 [13] -0.7360309  0.8076302  0.2160385  1.7956598 -1.1732183 -0.1053554
 [19]  2.3922157  1.0103376 -1.3107217 -0.8167309  1.1627301  0.4815350
 [25]  1.5219634  0.5064805 -0.8888922 -0.9793081  0.4584934  0.9811560
 [31] -0.6087210  0.7475200  0.8916294  1.6307120  0.7423761  0.5986291
 [37] -1.0486515 -0.4373201  2.2059976 -0.3717029 -1.5908694  0.4222192
 [43] -0.2481586 -0.2547643  0.9058909 -0.8253203  0.3141837 -0.2612969
 [49]  0.4387963 -0.4165697 -2.0144227  2.7353734  0.1732183  0.6411819
 [55]  0.9389860 -1.6570267  0.1830760  0.8028687  0.6776462 -0.4290136
 [61] -1.5364715 -0.5149537  0.6924802  1.8075168  0.5092284  0.5316111
 [67] -0.5054526  0.1897068 -1.0641273 -0.1087890 -0.2701806 -0.5005634
 [73] -0.7307912  0.7207865 -1.3900529 -1.7287031 -0.3169849 -0.2203956
 [79] -0.6519065  0.7955543  1.8017845 -0.1059508 -0.6273941 -0.6469691
 [85] -1.7732118 -1.0111659  0.3575607  1.2465970 -0.3843809 -0.5811704
 [91]  1.2389493 -0.7375524  0.2373172  0.3186258 -0.9119853  0.9047657
 [97] -1.5030174  0.3343898  0.2103448  1.9495315
> colRanges(tmp)
          [,1]      [,2]     [,3]      [,4]      [,5]     [,6]     [,7]
[1,] 0.6243877 0.7273151 1.200462 -1.534625 0.5850498 1.400775 1.639985
[2,] 0.6243877 0.7273151 1.200462 -1.534625 0.5850498 1.400775 1.639985
           [,8]      [,9]      [,10]     [,11]     [,12]      [,13]     [,14]
[1,] -0.5746092 0.3442024 -0.6337053 0.4238113 0.1717377 -0.7360309 0.8076302
[2,] -0.5746092 0.3442024 -0.6337053 0.4238113 0.1717377 -0.7360309 0.8076302
         [,15]   [,16]     [,17]      [,18]    [,19]    [,20]     [,21]
[1,] 0.2160385 1.79566 -1.173218 -0.1053554 2.392216 1.010338 -1.310722
[2,] 0.2160385 1.79566 -1.173218 -0.1053554 2.392216 1.010338 -1.310722
          [,22]   [,23]    [,24]    [,25]     [,26]      [,27]      [,28]
[1,] -0.8167309 1.16273 0.481535 1.521963 0.5064805 -0.8888922 -0.9793081
[2,] -0.8167309 1.16273 0.481535 1.521963 0.5064805 -0.8888922 -0.9793081
         [,29]    [,30]     [,31]   [,32]     [,33]    [,34]     [,35]
[1,] 0.4584934 0.981156 -0.608721 0.74752 0.8916294 1.630712 0.7423761
[2,] 0.4584934 0.981156 -0.608721 0.74752 0.8916294 1.630712 0.7423761
         [,36]     [,37]      [,38]    [,39]      [,40]     [,41]     [,42]
[1,] 0.5986291 -1.048652 -0.4373201 2.205998 -0.3717029 -1.590869 0.4222192
[2,] 0.5986291 -1.048652 -0.4373201 2.205998 -0.3717029 -1.590869 0.4222192
          [,43]      [,44]     [,45]      [,46]     [,47]      [,48]     [,49]
[1,] -0.2481586 -0.2547643 0.9058909 -0.8253203 0.3141837 -0.2612969 0.4387963
[2,] -0.2481586 -0.2547643 0.9058909 -0.8253203 0.3141837 -0.2612969 0.4387963
          [,50]     [,51]    [,52]     [,53]     [,54]    [,55]     [,56]
[1,] -0.4165697 -2.014423 2.735373 0.1732183 0.6411819 0.938986 -1.657027
[2,] -0.4165697 -2.014423 2.735373 0.1732183 0.6411819 0.938986 -1.657027
        [,57]     [,58]     [,59]      [,60]     [,61]      [,62]     [,63]
[1,] 0.183076 0.8028687 0.6776462 -0.4290136 -1.536472 -0.5149537 0.6924802
[2,] 0.183076 0.8028687 0.6776462 -0.4290136 -1.536472 -0.5149537 0.6924802
        [,64]     [,65]     [,66]      [,67]     [,68]     [,69]     [,70]
[1,] 1.807517 0.5092284 0.5316111 -0.5054526 0.1897068 -1.064127 -0.108789
[2,] 1.807517 0.5092284 0.5316111 -0.5054526 0.1897068 -1.064127 -0.108789
          [,71]      [,72]      [,73]     [,74]     [,75]     [,76]      [,77]
[1,] -0.2701806 -0.5005634 -0.7307912 0.7207865 -1.390053 -1.728703 -0.3169849
[2,] -0.2701806 -0.5005634 -0.7307912 0.7207865 -1.390053 -1.728703 -0.3169849
          [,78]      [,79]     [,80]    [,81]      [,82]      [,83]      [,84]
[1,] -0.2203956 -0.6519065 0.7955543 1.801784 -0.1059508 -0.6273941 -0.6469691
[2,] -0.2203956 -0.6519065 0.7955543 1.801784 -0.1059508 -0.6273941 -0.6469691
         [,85]     [,86]     [,87]    [,88]      [,89]      [,90]    [,91]
[1,] -1.773212 -1.011166 0.3575607 1.246597 -0.3843809 -0.5811704 1.238949
[2,] -1.773212 -1.011166 0.3575607 1.246597 -0.3843809 -0.5811704 1.238949
          [,92]     [,93]     [,94]      [,95]     [,96]     [,97]     [,98]
[1,] -0.7375524 0.2373172 0.3186258 -0.9119853 0.9047657 -1.503017 0.3343898
[2,] -0.7375524 0.2373172 0.3186258 -0.9119853 0.9047657 -1.503017 0.3343898
         [,99]   [,100]
[1,] 0.2103448 1.949531
[2,] 0.2103448 1.949531
> 
> 
> Max(tmp2)
[1] 3.475351
> Min(tmp2)
[1] -2.444101
> mean(tmp2)
[1] 0.2414293
> Sum(tmp2)
[1] 24.14293
> Var(tmp2)
[1] 1.114788
> 
> rowMeans(tmp2)
  [1]  0.11807027  0.23419284 -1.45808349  1.48100967 -1.41074610  0.45193598
  [7] -0.66352678  1.32879301  0.07824714  0.46683065  0.69392035  0.42229561
 [13]  0.34260390 -0.31060856 -1.36859514 -0.48914590  0.08329672  0.24650037
 [19]  0.30781632  1.03868268  0.36208426 -1.24381446 -0.27869253 -0.13982279
 [25]  0.29432911  2.18578362  1.13552603 -2.44410064 -0.77817208  0.30064625
 [31]  0.06821951  1.19002597  1.53139964 -0.31975227 -0.47311261  3.47535079
 [37]  1.61060654 -0.17116476 -1.46508652  0.06253168 -0.39754554  0.33836781
 [43] -1.35807792  0.58145741  1.03447034 -1.71167891  0.55149253  0.46756153
 [49] -0.48796026  1.68597200 -0.52895609  0.54546119  0.67501454 -2.39346218
 [55] -1.45994366  1.02336839  0.21058166  0.52344996 -0.38577354  0.36739262
 [61]  1.16317086  1.55142063 -0.49257354  2.68043006 -1.05046847  1.01331886
 [67] -0.30465163  1.32626947 -0.01993808  1.62388821  0.59427630 -0.09876634
 [73]  1.04179348 -0.18807160  1.52817657  0.25441991  0.33456155  0.61979074
 [79]  0.44404546 -1.26092846  1.05611434  0.52376347  0.91563369  1.64411530
 [85]  1.20691637  1.11205809 -1.25849442 -0.63661970  0.11031664 -1.44905534
 [91] -0.04468249  2.11963525  0.68959934 -0.39621783 -0.25087525 -0.92827028
 [97]  0.34425742 -0.18669918  1.12771115  1.90609636
> rowSums(tmp2)
  [1]  0.11807027  0.23419284 -1.45808349  1.48100967 -1.41074610  0.45193598
  [7] -0.66352678  1.32879301  0.07824714  0.46683065  0.69392035  0.42229561
 [13]  0.34260390 -0.31060856 -1.36859514 -0.48914590  0.08329672  0.24650037
 [19]  0.30781632  1.03868268  0.36208426 -1.24381446 -0.27869253 -0.13982279
 [25]  0.29432911  2.18578362  1.13552603 -2.44410064 -0.77817208  0.30064625
 [31]  0.06821951  1.19002597  1.53139964 -0.31975227 -0.47311261  3.47535079
 [37]  1.61060654 -0.17116476 -1.46508652  0.06253168 -0.39754554  0.33836781
 [43] -1.35807792  0.58145741  1.03447034 -1.71167891  0.55149253  0.46756153
 [49] -0.48796026  1.68597200 -0.52895609  0.54546119  0.67501454 -2.39346218
 [55] -1.45994366  1.02336839  0.21058166  0.52344996 -0.38577354  0.36739262
 [61]  1.16317086  1.55142063 -0.49257354  2.68043006 -1.05046847  1.01331886
 [67] -0.30465163  1.32626947 -0.01993808  1.62388821  0.59427630 -0.09876634
 [73]  1.04179348 -0.18807160  1.52817657  0.25441991  0.33456155  0.61979074
 [79]  0.44404546 -1.26092846  1.05611434  0.52376347  0.91563369  1.64411530
 [85]  1.20691637  1.11205809 -1.25849442 -0.63661970  0.11031664 -1.44905534
 [91] -0.04468249  2.11963525  0.68959934 -0.39621783 -0.25087525 -0.92827028
 [97]  0.34425742 -0.18669918  1.12771115  1.90609636
> 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.11807027  0.23419284 -1.45808349  1.48100967 -1.41074610  0.45193598
  [7] -0.66352678  1.32879301  0.07824714  0.46683065  0.69392035  0.42229561
 [13]  0.34260390 -0.31060856 -1.36859514 -0.48914590  0.08329672  0.24650037
 [19]  0.30781632  1.03868268  0.36208426 -1.24381446 -0.27869253 -0.13982279
 [25]  0.29432911  2.18578362  1.13552603 -2.44410064 -0.77817208  0.30064625
 [31]  0.06821951  1.19002597  1.53139964 -0.31975227 -0.47311261  3.47535079
 [37]  1.61060654 -0.17116476 -1.46508652  0.06253168 -0.39754554  0.33836781
 [43] -1.35807792  0.58145741  1.03447034 -1.71167891  0.55149253  0.46756153
 [49] -0.48796026  1.68597200 -0.52895609  0.54546119  0.67501454 -2.39346218
 [55] -1.45994366  1.02336839  0.21058166  0.52344996 -0.38577354  0.36739262
 [61]  1.16317086  1.55142063 -0.49257354  2.68043006 -1.05046847  1.01331886
 [67] -0.30465163  1.32626947 -0.01993808  1.62388821  0.59427630 -0.09876634
 [73]  1.04179348 -0.18807160  1.52817657  0.25441991  0.33456155  0.61979074
 [79]  0.44404546 -1.26092846  1.05611434  0.52376347  0.91563369  1.64411530
 [85]  1.20691637  1.11205809 -1.25849442 -0.63661970  0.11031664 -1.44905534
 [91] -0.04468249  2.11963525  0.68959934 -0.39621783 -0.25087525 -0.92827028
 [97]  0.34425742 -0.18669918  1.12771115  1.90609636
> rowMin(tmp2)
  [1]  0.11807027  0.23419284 -1.45808349  1.48100967 -1.41074610  0.45193598
  [7] -0.66352678  1.32879301  0.07824714  0.46683065  0.69392035  0.42229561
 [13]  0.34260390 -0.31060856 -1.36859514 -0.48914590  0.08329672  0.24650037
 [19]  0.30781632  1.03868268  0.36208426 -1.24381446 -0.27869253 -0.13982279
 [25]  0.29432911  2.18578362  1.13552603 -2.44410064 -0.77817208  0.30064625
 [31]  0.06821951  1.19002597  1.53139964 -0.31975227 -0.47311261  3.47535079
 [37]  1.61060654 -0.17116476 -1.46508652  0.06253168 -0.39754554  0.33836781
 [43] -1.35807792  0.58145741  1.03447034 -1.71167891  0.55149253  0.46756153
 [49] -0.48796026  1.68597200 -0.52895609  0.54546119  0.67501454 -2.39346218
 [55] -1.45994366  1.02336839  0.21058166  0.52344996 -0.38577354  0.36739262
 [61]  1.16317086  1.55142063 -0.49257354  2.68043006 -1.05046847  1.01331886
 [67] -0.30465163  1.32626947 -0.01993808  1.62388821  0.59427630 -0.09876634
 [73]  1.04179348 -0.18807160  1.52817657  0.25441991  0.33456155  0.61979074
 [79]  0.44404546 -1.26092846  1.05611434  0.52376347  0.91563369  1.64411530
 [85]  1.20691637  1.11205809 -1.25849442 -0.63661970  0.11031664 -1.44905534
 [91] -0.04468249  2.11963525  0.68959934 -0.39621783 -0.25087525 -0.92827028
 [97]  0.34425742 -0.18669918  1.12771115  1.90609636
> 
> colMeans(tmp2)
[1] 0.2414293
> colSums(tmp2)
[1] 24.14293
> colVars(tmp2)
[1] 1.114788
> colSd(tmp2)
[1] 1.055835
> colMax(tmp2)
[1] 3.475351
> colMin(tmp2)
[1] -2.444101
> colMedians(tmp2)
[1] 0.3042313
> colRanges(tmp2)
          [,1]
[1,] -2.444101
[2,]  3.475351
> 
> dataset1 <- matrix(dataset1,1,100)
> 
> agree.checks(tmp,dataset1)
> 
> dataset2 <- matrix(dataset2,100,1)
> agree.checks(tmp2,dataset2)
>   
> 
> tmp <- createBufferedMatrix(10,10)
> 
> tmp[1:10,1:10] <- rnorm(100)
> colApply(tmp,sum)
 [1] -0.1838110  3.5548985 -2.6336722 -3.1605369 -0.5497896  1.5553780
 [7] -2.3863933 -2.0401142  6.7101550 -0.0620254
> colApply(tmp,quantile)[,1]
            [,1]
[1,] -1.42415584
[2,] -0.67901657
[3,]  0.05916865
[4,]  0.52308052
[5,]  1.18639717
> 
> rowApply(tmp,sum)
 [1]  1.9177944  3.9769870 -1.1297635  1.1656116 -2.9127011 -0.1444206
 [7] -0.4443325  0.6365570 -2.6093074  0.3476641
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    2    6   10    8    9    7    5    2    3     2
 [2,]   10    3    4    4    8    6   10   10    5     1
 [3,]    6    7    3    1    2    1    4    9    6     6
 [4,]    3    8    1   10    6    3    6    1    7     7
 [5,]    7    4    5    5    1    8    2    8    9     5
 [6,]    8    2    9    2    7    9    9    6    2     8
 [7,]    1    9    6    6    4    5    3    4    4     3
 [8,]    4    1    2    3    5   10    1    5    8     9
 [9,]    5   10    8    9   10    4    7    3   10    10
[10,]    9    5    7    7    3    2    8    7    1     4
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1] -0.7114559 -2.4614978 -0.6293635  2.1242767 -1.5402152 -0.2436152
 [7] -2.2234262  0.4953611 -0.9038475  1.7561767  0.7503154 -1.3809656
[13]  0.5551857  4.5294383 -3.5716237  1.9718226  4.0444816  2.4032311
[19] -1.6327210  2.0693107
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -2.5820510
[2,] -0.6060065
[3,] -0.2735574
[4,]  1.2758184
[5,]  1.4743407
> 
> rowApply(tmp,sum)
[1] -1.6716426  0.1769403 -0.3055964  2.8306524  4.3705145
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]   10   19   19    5    1
[2,]    5    9    5    7    2
[3,]    7    7   13    8    5
[4,]   12   11   16   15   12
[5,]   20    1    9    2    9
> 
> 
> as.matrix(tmp)
           [,1]       [,2]        [,3]      [,4]        [,5]       [,6]
[1,] -0.2735574 -0.5280410 -0.46069140 0.1620696  1.98614088  0.6753421
[2,]  1.2758184 -0.1812471 -0.33138616 0.1644708 -2.41866118 -0.5409015
[3,]  1.4743407 -0.8801899  0.26398150 0.8699425 -0.14525818 -0.9956962
[4,] -0.6060065 -0.0928441 -0.07631870 0.5440889 -1.00954629  0.2528890
[5,] -2.5820510 -0.7791757 -0.02494873 0.3837049  0.04710957  0.3647514
           [,7]        [,8]         [,9]      [,10]      [,11]        [,12]
[1,] -1.0288678  0.11361374 -1.917340162  1.1940395 -0.3831964 -1.718247769
[2,] -0.1425240  1.06369945  0.553456567  0.4377578 -1.0971889 -0.828560751
[3,]  0.2520189 -0.34896059 -0.002774435 -1.9942501  0.2836482  0.909833397
[4,] -0.7021508  0.05949762 -0.861935748  0.6316281  0.9994546  0.258560197
[5,] -0.6019024 -0.39248912  1.324746231  1.4870015  0.9475979 -0.002550709
          [,13]      [,14]       [,15]       [,16]     [,17]      [,18]
[1,]  1.1372742 -0.4076308 -2.10515303  0.64159360 1.2854161  0.1690202
[2,] -0.8405196  1.6850875 -1.07023864  0.97567631 0.6588519  0.5237305
[3,] -0.5103572  1.6754785 -1.20911521 -0.03829891 1.0790984 -1.0729750
[4,]  0.5581749  0.1987683  0.82584953 -0.13500061 0.3340412  2.3990987
[5,]  0.2106134  1.3777348 -0.01296636  0.52785224 0.6870741  0.3843568
           [,19]      [,20]
[1,]  0.26383407 -0.4772606
[2,] -0.27782660  0.5674456
[3,] -0.37073404  0.4546715
[4,] -1.26611761  0.5185217
[5,]  0.01812314  1.0059325
> 
> 
> 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.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  800  bytes.
> 
> 
> 
> subBufferedMatrix(tmp,1:5,1:5)
BufferedMatrix object
Matrix size:  5 5 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  650  bytes.
Disk usage :  200  bytes.
> subBufferedMatrix(tmp,,5:8)
BufferedMatrix object
Matrix size:  5 4 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  562  bytes.
Disk usage :  160  bytes.
> subBufferedMatrix(tmp,1:3,)
BufferedMatrix object
Matrix size:  3 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  480  bytes.
> 
> 
> rm(tmp)
> 
> 
> ###
> ### Testing colnames and rownames
> ###
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> 
> 
> colnames(tmp)
NULL
> rownames(tmp)
NULL
> 
> 
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> colnames(tmp)
 [1] "col1"  "col2"  "col3"  "col4"  "col5"  "col6"  "col7"  "col8"  "col9" 
[10] "col10" "col11" "col12" "col13" "col14" "col15" "col16" "col17" "col18"
[19] "col19" "col20"
> rownames(tmp)
[1] "row1" "row2" "row3" "row4" "row5"
> 
> 
> tmp["row1",]
            col1       col2       col3      col4       col5      col6
row1 -0.06948839 -0.3731932 -0.4207026 -1.808288 -0.5200939 0.6191919
           col7     col8     col9      col10    col11     col12    col13
row1 0.03216231 2.257196 1.898206 -0.7891178 1.055164 -1.149377 1.973461
         col14      col15    col16    col17       col18     col19      col20
row1 -2.217946 -0.7691721 2.187355 1.058335 -0.09912921 0.3769021 -0.5735121
> tmp[,"col10"]
          col10
row1 -0.7891178
row2 -1.8728060
row3  0.5032264
row4 -0.1880747
row5  0.7542667
> tmp[c("row1","row5"),]
            col1       col2       col3        col4       col5       col6
row1 -0.06948839 -0.3731932 -0.4207026 -1.80828790 -0.5200939  0.6191919
row5  0.09463407 -0.5831460 -2.3061068  0.07434613 -0.9823139 -0.4582574
           col7     col8     col9      col10     col11     col12    col13
row1 0.03216231 2.257196 1.898206 -0.7891178  1.055164 -1.149377 1.973461
row5 1.09950744 1.713067 1.414765  0.7542667 -1.290280 -0.239244 1.322144
          col14      col15     col16      col17       col18     col19
row1 -2.2179464 -0.7691721 2.1873550  1.0583348 -0.09912921 0.3769021
row5 -0.3273195  1.2419785 0.4340128 -0.5057653 -0.15515375 0.7856687
          col20
row1 -0.5735121
row5 -0.3073719
> tmp[,c("col6","col20")]
           col6       col20
row1  0.6191919 -0.57351211
row2  0.3157320  0.66961790
row3 -0.5966767  0.78799894
row4  2.4978479  0.01702037
row5 -0.4582574 -0.30737187
> tmp[c("row1","row5"),c("col6","col20")]
           col6      col20
row1  0.6191919 -0.5735121
row5 -0.4582574 -0.3073719
> 
> 
> 
> 
> tmp["row1",] <- rnorm(20,mean=10)
> tmp[,"col10"] <- rnorm(5,mean=30)
> tmp[c("row1","row5"),] <- rnorm(40,mean=50)
> tmp[,c("col6","col20")] <- rnorm(10,mean=75)
> tmp[c("row1","row5"),c("col6","col20")]  <- rnorm(4,mean=105)
> 
> tmp["row1",]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 48.82072 47.35383 50.39806 50.32826 49.04693 104.9675 49.60597 50.71654
         col9    col10    col11    col12    col13    col14    col15   col16
row1 50.09544 50.17292 48.00592 48.84631 49.69383 50.99866 50.70919 50.1325
        col17    col18    col19    col20
row1 50.04572 50.25367 50.70731 106.2077
> tmp[,"col10"]
        col10
row1 50.17292
row2 29.85233
row3 29.22378
row4 29.90748
row5 51.58523
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 48.82072 47.35383 50.39806 50.32826 49.04693 104.9675 49.60597 50.71654
row5 50.42449 50.68173 49.58944 50.90287 50.25765 105.4905 49.47871 48.87319
         col9    col10    col11    col12    col13    col14    col15    col16
row1 50.09544 50.17292 48.00592 48.84631 49.69383 50.99866 50.70919 50.13250
row5 51.12207 51.58523 50.61485 50.23922 49.28703 50.85405 49.51272 49.08862
        col17    col18    col19    col20
row1 50.04572 50.25367 50.70731 106.2077
row5 50.08912 49.38746 50.54656 104.9523
> tmp[,c("col6","col20")]
          col6     col20
row1 104.96747 106.20774
row2  75.66101  74.97118
row3  74.81191  75.56961
row4  73.09762  74.10556
row5 105.49054 104.95225
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 104.9675 106.2077
row5 105.4905 104.9523
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 104.9675 106.2077
row5 105.4905 104.9523
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
          col13
[1,] -1.1561186
[2,]  0.8082857
[3,] -0.5320524
[4,]  0.7287614
[5,] -0.2181421
> tmp[,c("col17","col7")]
          col17         col7
[1,] -0.3509185 -1.039264249
[2,]  2.0320654 -0.007006715
[3,]  2.5859662 -2.202451481
[4,]  2.1429918 -0.537267685
[5,] -0.1588105  0.724130917
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
           col6       col20
[1,] -0.1852590 -0.09597442
[2,]  0.6370473 -1.27161454
[3,] -2.3173048  0.75292652
[4,]  0.5517197  0.68573557
[5,] -1.5294785  0.07305087
> subBufferedMatrix(tmp,1,c("col6"))[,1]
          col1
[1,] -0.185259
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
           col6
[1,] -0.1852590
[2,]  0.6370473
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> 
> 
> 
> subBufferedMatrix(tmp,c("row3","row1"),)[,1:20]
           [,1]      [,2]      [,3]       [,4]      [,5]       [,6]      [,7]
row3  1.3786184  1.166063  1.638306 0.08619706 -1.198142 -0.4395785 -1.073121
row1 -0.3790128 -1.801959 -1.737658 0.51928807  1.963929 -1.3194624  1.706670
           [,8]       [,9]     [,10]      [,11]     [,12]     [,13]      [,14]
row3 -1.2158781 -1.7876051 0.3001784 -0.3355468 1.1744312 -1.126001  0.6014528
row1  0.8631473  0.9519495 1.0903461 -0.2724480 0.2941464  0.998674 -0.6704111
          [,15]     [,16]      [,17]      [,18]     [,19]     [,20]
row3  2.2285211 0.3677018  1.3086373  1.6330194 -0.609107 -1.060392
row1 -0.8585412 0.1009896 -0.4403798 -0.9941056  2.019060 -1.111452
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
           [,1]      [,2]      [,3]      [,4]      [,5]      [,6]    [,7]
row2 -0.8558563 -1.347686 -1.221284 0.2304281 -1.258959 -1.407454 1.00447
          [,8]      [,9]     [,10]
row2 -0.499866 0.9795233 -2.494337
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
           [,1]      [,2]      [,3]      [,4]      [,5]      [,6]       [,7]
row5 -0.1847067 -1.133996 0.3131668 -2.210211 0.4615877 -0.182501 -0.6799297
          [,8]       [,9]      [,10]      [,11]     [,12]     [,13]     [,14]
row5 -1.571515 -0.4689217 -0.1041455 -0.1510392 -1.842749 0.4283548 0.9938775
         [,15]        [,16]     [,17]    [,18]     [,19]     [,20]
row5 -1.259782 -0.008203289 0.4801785 1.585119 0.5060964 0.1397768
> 
> 
> 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: 0x600001fcc2a0>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM889948132ffa"
 [2] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM889963b2eb0d"
 [3] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM88997765d59d"
 [4] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM88993eab73a8"
 [5] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM88996a363abc"
 [6] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM8899e4a431e" 
 [7] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM88992d7c6de6"
 [8] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM889944132e5e"
 [9] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM88994749403c"
[10] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM88991a1847b4"
[11] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM8899300b87ce"
[12] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM88994500fe06"
[13] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM889944255f4e"
[14] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM889971941cd5"
[15] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM889932f11e34"
> 
> 
> ### 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: 0x600001fe00c0>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x600001fe00c0>
Warning message:
In dir.create(new.directory) :
  '/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x600001fe00c0>
> rowMedians(tmp)
  [1] -0.021524784 -0.130503353 -0.202179613  0.228815936  0.144408654
  [6]  0.024314968 -0.067918671 -0.413381343 -0.314118507 -0.149499053
 [11]  0.209237442 -0.125901036 -0.174409308 -0.479515494 -0.113763010
 [16] -0.081503591  0.625388869  0.697837365  0.483033888 -0.236260176
 [21] -0.353338661 -0.322456682 -0.693563968 -0.003175792  0.256643855
 [26] -0.127763487  0.076162901  0.066792607  0.532670050 -0.356785654
 [31] -0.076345263 -0.108507209  0.485505740 -0.030125469  0.617994908
 [36]  0.043271645 -0.194836428  0.858684062  0.412149326 -0.137250722
 [41]  0.742683446 -0.019079597  0.038596057 -0.126009491  0.099199039
 [46]  0.058332409 -0.276071505 -0.368232445  0.084714039 -0.137606873
 [51] -0.355291596 -0.179511324 -0.053226026  0.241231910 -0.408117724
 [56] -0.316363655 -0.206409620 -0.071438110  0.273602065 -0.445296401
 [61] -0.414503304  0.173034227 -0.371213328 -0.607194601 -0.398480126
 [66]  0.141218699 -0.549860045 -0.018926139  0.627223622  0.647003900
 [71] -0.760852114  0.583870949  0.115714753  0.127463918 -0.095295268
 [76]  0.665805344  0.020810651  0.033065389  0.094550321 -0.288757732
 [81] -0.267372941 -0.153782197  0.168166720  0.121901780 -0.302007795
 [86]  0.318291732 -0.189205012  0.326949434 -0.624132050  0.261551768
 [91]  0.337832915 -0.257876077 -0.489039408 -0.076910126  0.240894035
 [96]  0.365807629 -0.018867548  0.449267426  0.379822535 -0.092657935
[101]  0.035480593  0.119939876  0.123926801  0.264941727  0.199792744
[106]  0.163666527 -0.026307633  0.275569841  0.149086459  0.080811839
[111]  0.177045891  0.043111890  0.894655252 -0.122214921 -0.390733469
[116]  0.242278471 -0.059902881 -0.183510623  0.044941688 -0.101316359
[121] -0.531326020 -0.161614764 -0.221085365 -0.150997041  0.025686700
[126] -0.218297686  0.042202579  0.060195748 -0.218059931  0.253642368
[131] -0.533405117 -0.232696142 -0.043979330 -0.789388519  0.244361131
[136] -0.123869899  0.070054938 -0.384466317  0.071844720 -0.476919016
[141]  0.729222713 -0.279550355  0.156082012 -0.065279129  0.068561724
[146] -0.068582023 -0.560368369 -0.316064819  0.057671855 -0.453139187
[151] -0.286609798  0.555904070  0.256240800 -0.238776067  0.130471720
[156] -0.367435607 -0.547673402  0.426646692 -0.285742625  0.087197511
[161]  0.363487042 -0.523062977  0.350374515 -0.429394642 -0.504000676
[166]  0.095216744 -0.456495066  0.743981282 -0.154443116  0.221337935
[171] -0.163314405  0.023978999  0.152390678 -0.073535323 -0.343118156
[176] -0.335971812 -0.604062514  0.077931149 -0.564444948  0.393809637
[181]  0.344060600  0.183724068 -0.346409274  0.367570744 -0.017676978
[186]  0.042498908  0.401825540 -0.143805290  0.034477874  0.111586619
[191] -0.095167995 -0.047993338 -0.073960593 -0.192366809 -0.206767967
[196] -0.425978329  0.172199424  0.028879315  0.057940397  0.307106289
[201] -0.035730958  0.200056475 -0.388829940  0.028230797 -0.023034641
[206]  0.057804068 -0.169388983 -0.474861832  0.191729272  0.467686280
[211] -0.248907942 -0.177886827 -0.203349060  0.309012270 -0.290438480
[216] -0.170659714 -0.384439964 -0.201430926  0.751643340 -0.280562126
[221] -0.072023373  0.574279101 -0.249473823  0.321562490 -0.051457447
[226]  0.092600464  0.196710694  0.002663983  0.033855774 -0.133394584
> 
> proc.time()
   user  system elapsed 
  2.179   9.449  17.802 

BufferedMatrix.Rcheck/tests/rawCalltesting.Rout


R version 4.5.2 Patched (2025-11-04 r88984) -- "[Not] Part in a Rumble"
Copyright (C) 2025 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: 0x600002828000>
> .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: 0x600002828000>
> .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: 0x600002828000>
> .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: 0x600002828000>
> 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: 0x60000282c000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x60000282c000>
> .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: 0x60000282c000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x60000282c000>
> .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: 0x60000282c000>
> 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: 0x600002834840>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600002834840>
> .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: 0x600002834840>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x600002834840>
> .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: 0x600002834840>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x600002834840>
> .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: 0x600002834840>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x600002834840>
> .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: 0x600002834840>
> 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: 0x600002830360>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x600002830360>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600002830360>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600002830360>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile8f5d48cefc52" "BufferedMatrixFile8f5dd1790d6" 
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile8f5d48cefc52" "BufferedMatrixFile8f5dd1790d6" 
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000028305a0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000028305a0>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x6000028305a0>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x6000028305a0>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x6000028305a0>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x6000028305a0>
> .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: 0x60000283c120>
> .Call("R_bm_AddColumn",P)
<pointer: 0x60000283c120>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x60000283c120>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x60000283c120>
> 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: 0x60000283c300>
> .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: 0x60000283c300>
> rm(P)
> 
> proc.time()
   user  system elapsed 
  0.351   0.115   0.589 

BufferedMatrix.Rcheck/tests/Rcodetesting.Rout


R version 4.5.2 Patched (2025-11-04 r88984) -- "[Not] Part in a Rumble"
Copyright (C) 2025 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.339   0.075   0.479 

Example timings