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

This page was generated on 2025-09-20 12:05 -0400 (Sat, 20 Sep 2025).

HostnameOSArch (*)R versionInstalled pkgs
nebbiolo2Linux (Ubuntu 24.04.3 LTS)x86_644.5.1 Patched (2025-08-23 r88802) -- "Great Square Root" 4814
lconwaymacOS 12.7.1 Montereyx86_644.5.1 Patched (2025-09-10 r88807) -- "Great Square Root" 4603
kjohnson3macOS 13.7.7 Venturaarm644.5.1 Patched (2025-09-10 r88807) -- "Great Square Root" 4547
taishanLinux (openEuler 24.03 LTS)aarch644.5.0 (2025-04-11) -- "How About a Twenty-Six" 4553
Click on any hostname to see more info about the system (e.g. compilers)      (*) as reported by 'uname -p', except on Windows and Mac OS X

Package 253/2333HostnameOS / ArchINSTALLBUILDCHECKBUILD BIN
BufferedMatrix 1.73.0  (landing page)
Ben Bolstad
Snapshot Date: 2025-09-19 13:45 -0400 (Fri, 19 Sep 2025)
git_url: https://git.bioconductor.org/packages/BufferedMatrix
git_branch: devel
git_last_commit: 0147962
git_last_commit_date: 2025-04-15 09:39:39 -0400 (Tue, 15 Apr 2025)
nebbiolo2Linux (Ubuntu 24.04.3 LTS) / x86_64  OK    OK    OK  UNNEEDED, same version is already published
lconwaymacOS 12.7.1 Monterey / x86_64  OK    OK    WARNINGS    OK  UNNEEDED, same version is already published
kjohnson3macOS 13.7.7 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 kjohnson3

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

raw results


Summary

Package: BufferedMatrix
Version: 1.73.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.73.0.tar.gz
StartedAt: 2025-09-19 18:30:32 -0400 (Fri, 19 Sep 2025)
EndedAt: 2025-09-19 18:30:48 -0400 (Fri, 19 Sep 2025)
EllapsedTime: 16.2 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.73.0.tar.gz
###
##############################################################################
##############################################################################


* using log directory ‘/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck’
* using R version 4.5.1 Patched (2025-09-10 r88807)
* 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.7
* using session charset: UTF-8
* using option ‘--no-vignettes’
* checking for file ‘BufferedMatrix/DESCRIPTION’ ... OK
* this is package ‘BufferedMatrix’ version ‘1.73.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.1.0.2.5)’
* used SDK: ‘MacOSX11.3.1.sdk’
* checking installed package size ... OK
* checking package directory ... OK
* checking ‘build’ directory ... OK
* checking DESCRIPTION meta-information ... OK
* checking top-level files ... OK
* checking for left-over files ... OK
* checking index information ... OK
* checking package subdirectories ... OK
* checking code files for non-ASCII characters ... OK
* checking R files for syntax errors ... OK
* checking whether the package can be loaded ... OK
* checking whether the package can be loaded with stated dependencies ... OK
* checking whether the package can be unloaded cleanly ... OK
* checking whether the namespace can be loaded with stated dependencies ... OK
* checking whether the namespace can be unloaded cleanly ... OK
* checking dependencies in R code ... OK
* checking S3 generic/method consistency ... OK
* checking replacement functions ... OK
* checking foreign function calls ... OK
* checking R code for possible problems ... OK
* checking Rd files ... NOTE
checkRd: (-1) BufferedMatrix-class.Rd:209: Lost braces; missing escapes or markup?
   209 |     $x^{power}$ elementwise of the matrix
       |        ^
prepare_Rd: createBufferedMatrix.Rd:26: Dropping empty section \keyword
prepare_Rd: createBufferedMatrix.Rd:17-18: Dropping empty section \details
prepare_Rd: createBufferedMatrix.Rd:15-16: Dropping empty section \value
prepare_Rd: createBufferedMatrix.Rd:19-20: Dropping empty section \references
prepare_Rd: createBufferedMatrix.Rd:21-22: Dropping empty section \seealso
prepare_Rd: createBufferedMatrix.Rd:23-24: Dropping empty section \examples
* checking Rd metadata ... OK
* checking Rd cross-references ... OK
* checking for missing documentation entries ... OK
* checking for code/documentation mismatches ... OK
* checking Rd \usage sections ... OK
* checking Rd contents ... OK
* checking for unstated dependencies in examples ... OK
* checking line endings in C/C++/Fortran sources/headers ... OK
* checking compiled code ... 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.73.0’
** using staged installation
** libs
using C compiler: ‘Apple clang version 15.0.0 (clang-1500.1.0.2.5)’
using SDK: ‘MacOSX11.3.1.sdk’
clang -arch arm64 -std=gnu2x -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/opt/R/arm64/include    -fPIC  -falign-functions=64 -Wall -g -O2  -c RBufferedMatrix.c -o RBufferedMatrix.o
clang -arch arm64 -std=gnu2x -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/opt/R/arm64/include    -fPIC  -falign-functions=64 -Wall -g -O2  -c doubleBufferedMatrix.c -o doubleBufferedMatrix.o
doubleBufferedMatrix.c:1580:7: warning: logical not is only applied to the left hand side of this bitwise operator [-Wlogical-not-parentheses]
  if (!(Matrix->readonly) & setting){
      ^                   ~
doubleBufferedMatrix.c:1580:7: note: add parentheses after the '!' to evaluate the bitwise operator first
  if (!(Matrix->readonly) & setting){
      ^
       (                           )
doubleBufferedMatrix.c:1580:7: note: add parentheses around left hand side expression to silence this warning
  if (!(Matrix->readonly) & setting){
      ^
      (                  )
doubleBufferedMatrix.c:3327:12: warning: unused function 'sort_double' [-Wunused-function]
static int sort_double(const double *a1,const double *a2){
           ^
2 warnings generated.
clang -arch arm64 -std=gnu2x -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/opt/R/arm64/include    -fPIC  -falign-functions=64 -Wall -g -O2  -c doubleBufferedMatrix_C_tests.c -o doubleBufferedMatrix_C_tests.o
clang -arch arm64 -std=gnu2x -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/opt/R/arm64/include    -fPIC  -falign-functions=64 -Wall -g -O2  -c init_package.c -o init_package.o
clang -arch arm64 -std=gnu2x -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -L/Library/Frameworks/R.framework/Resources/lib -L/opt/R/arm64/lib -o BufferedMatrix.so RBufferedMatrix.o doubleBufferedMatrix.o doubleBufferedMatrix_C_tests.o init_package.o -F/Library/Frameworks/R.framework/.. -framework R
installing to /Library/Frameworks/R.framework/Versions/4.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.1 Patched (2025-09-10 r88807) -- "Great Square Root"
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.119   0.040   0.155 

BufferedMatrix.Rcheck/tests/objectTesting.Rout


R version 4.5.1 Patched (2025-09-10 r88807) -- "Great Square Root"
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 480828 25.7    1056624 56.5         NA   634340 33.9
Vcells 891019  6.8    8388608 64.0     196608  2109889 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 Sep 19 18:30:41 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 Sep 19 18:30:41 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: 0x600000758120>
> 
> 
> 
> 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 Sep 19 18:30:42 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 Sep 19 18:30:42 2025"
> 
> ColMode(tmp2)
<pointer: 0x600000758120>
> 
> 
> 
> ### 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.4940343 -0.8131666 -0.2211615  1.5117773
[2,] -0.4376631 -0.6164054  0.0470566 -0.5809539
[3,] -1.9425807  1.8409350  0.2222510  0.5459984
[4,]  0.2003128  1.6332755 -1.9327707  0.2884809
> 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.4940343 0.8131666 0.2211615 1.5117773
[2,]  0.4376631 0.6164054 0.0470566 0.5809539
[3,]  1.9425807 1.8409350 0.2222510 0.5459984
[4,]  0.2003128 1.6332755 1.9327707 0.2884809
> 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.9244161 0.9017575 0.4702781 1.2295436
[2,] 0.6615611 0.7851149 0.2169253 0.7622033
[3,] 1.3937649 1.3568106 0.4714351 0.7389171
[4,] 0.4475632 1.2779967 1.3902412 0.5371042
> 
> 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,] 222.73820 34.83074 29.92394 38.80721
[2,]  32.05327 33.46755 27.21631 33.20299
[3,]  40.88023 40.40904 29.93660 32.93517
[4,]  29.67594 39.41324 40.83518 30.65952
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x600000744000>
> exp(tmp5)
<pointer: 0x600000744000>
> log(tmp5,2)
<pointer: 0x600000744000>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 463.6004
> Min(tmp5)
[1] 52.56316
> mean(tmp5)
[1] 73.41856
> Sum(tmp5)
[1] 14683.71
> Var(tmp5)
[1] 850.7236
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 91.25590 71.43038 74.05813 73.29610 69.78480 69.26394 68.81766 70.18365
 [9] 73.00775 73.08724
> rowSums(tmp5)
 [1] 1825.118 1428.608 1481.163 1465.922 1395.696 1385.279 1376.353 1403.673
 [9] 1460.155 1461.745
> rowVars(tmp5)
 [1] 7724.88666  107.20085   76.13061   95.85731   57.37577   77.23392
 [7]  110.54228   64.80836  108.01533   82.97637
> rowSd(tmp5)
 [1] 87.891334 10.353784  8.725286  9.790675  7.574680  8.788283 10.513909
 [8]  8.050364 10.393042  9.109137
> rowMax(tmp5)
 [1] 463.60037  93.42333  85.81602  85.53901  83.14487  88.73128  87.46505
 [8]  83.14529  88.89580  92.65920
> rowMin(tmp5)
 [1] 60.86465 53.65604 58.43805 57.29101 56.44752 57.75721 53.22037 52.83384
 [9] 54.24572 52.56316
> 
> colMeans(tmp5)
 [1] 109.03405  75.41422  69.61931  66.56634  72.42867  74.40316  69.93362
 [8]  70.66599  72.64953  63.37868  70.67576  69.65348  70.05750  77.60229
[15]  68.37872  66.41748  74.13877  71.25405  78.23612  77.86335
> colSums(tmp5)
 [1] 1090.3405  754.1422  696.1931  665.6634  724.2867  744.0316  699.3362
 [8]  706.6599  726.4953  633.7868  706.7576  696.5348  700.5750  776.0229
[15]  683.7872  664.1748  741.3877  712.5405  782.3612  778.6335
> colVars(tmp5)
 [1] 15582.77257    23.66367   117.57323    58.12332   107.93803    50.51152
 [7]   102.34955    66.45472    93.00110    17.78381   113.36942    87.53369
[13]    76.49003   115.28027    39.97074    84.63105    69.45159    74.74931
[19]    44.66743    73.04388
> colSd(tmp5)
 [1] 124.830976   4.864532  10.843119   7.623865  10.389323   7.107146
 [7]  10.116795   8.151976   9.643708   4.217086  10.647508   9.355944
[13]   8.745858  10.736865   6.322242   9.199514   8.333762   8.645768
[19]   6.683370   8.546571
> colMax(tmp5)
 [1] 463.60037  84.10612  84.99308  80.77213  92.65920  85.35498  88.89580
 [8]  80.22841  82.32213  68.74493  90.56859  83.17072  81.49257  93.42333
[15]  78.46314  82.41775  86.89545  82.57317  88.73128  90.12636
> colMin(tmp5)
 [1] 60.45266 69.65833 52.56316 53.61676 59.64825 66.36379 53.65604 54.24572
 [9] 53.22037 56.57859 59.02161 56.44752 57.61453 61.61856 58.42982 52.83384
[17] 61.57334 57.29101 69.49921 64.87782
> 
> 
> ### setting a random element to NA and then testing with na.rm=TRUE or na.rm=FALSE (The default)
> 
> 
> which.row <- sample(1:10,1,replace=TRUE)
> which.col  <- sample(1:20,1,replace=TRUE)
> 
> tmp5[which.row,which.col] <- NA
> 
> Max(tmp5)
[1] NA
> Min(tmp5)
[1] NA
> mean(tmp5)
[1] NA
> Sum(tmp5)
[1] NA
> Var(tmp5)
[1] NA
> 
> rowMeans(tmp5)
 [1]       NA 71.43038 74.05813 73.29610 69.78480 69.26394 68.81766 70.18365
 [9] 73.00775 73.08724
> rowSums(tmp5)
 [1]       NA 1428.608 1481.163 1465.922 1395.696 1385.279 1376.353 1403.673
 [9] 1460.155 1461.745
> rowVars(tmp5)
 [1] 8144.47659  107.20085   76.13061   95.85731   57.37577   77.23392
 [7]  110.54228   64.80836  108.01533   82.97637
> rowSd(tmp5)
 [1] 90.246754 10.353784  8.725286  9.790675  7.574680  8.788283 10.513909
 [8]  8.050364 10.393042  9.109137
> rowMax(tmp5)
 [1]       NA 93.42333 85.81602 85.53901 83.14487 88.73128 87.46505 83.14529
 [9] 88.89580 92.65920
> rowMin(tmp5)
 [1]       NA 53.65604 58.43805 57.29101 56.44752 57.75721 53.22037 52.83384
 [9] 54.24572 52.56316
> 
> colMeans(tmp5)
 [1] 109.03405  75.41422  69.61931  66.56634  72.42867  74.40316  69.93362
 [8]  70.66599  72.64953  63.37868  70.67576  69.65348  70.05750  77.60229
[15]        NA  66.41748  74.13877  71.25405  78.23612  77.86335
> colSums(tmp5)
 [1] 1090.3405  754.1422  696.1931  665.6634  724.2867  744.0316  699.3362
 [8]  706.6599  726.4953  633.7868  706.7576  696.5348  700.5750  776.0229
[15]        NA  664.1748  741.3877  712.5405  782.3612  778.6335
> colVars(tmp5)
 [1] 15582.77257    23.66367   117.57323    58.12332   107.93803    50.51152
 [7]   102.34955    66.45472    93.00110    17.78381   113.36942    87.53369
[13]    76.49003   115.28027          NA    84.63105    69.45159    74.74931
[19]    44.66743    73.04388
> colSd(tmp5)
 [1] 124.830976   4.864532  10.843119   7.623865  10.389323   7.107146
 [7]  10.116795   8.151976   9.643708   4.217086  10.647508   9.355944
[13]   8.745858  10.736865         NA   9.199514   8.333762   8.645768
[19]   6.683370   8.546571
> colMax(tmp5)
 [1] 463.60037  84.10612  84.99308  80.77213  92.65920  85.35498  88.89580
 [8]  80.22841  82.32213  68.74493  90.56859  83.17072  81.49257  93.42333
[15]        NA  82.41775  86.89545  82.57317  88.73128  90.12636
> colMin(tmp5)
 [1] 60.45266 69.65833 52.56316 53.61676 59.64825 66.36379 53.65604 54.24572
 [9] 53.22037 56.57859 59.02161 56.44752 57.61453 61.61856       NA 52.83384
[17] 61.57334 57.29101 69.49921 64.87782
> 
> Max(tmp5,na.rm=TRUE)
[1] 463.6004
> Min(tmp5,na.rm=TRUE)
[1] 52.56316
> mean(tmp5,na.rm=TRUE)
[1] 73.39321
> Sum(tmp5,na.rm=TRUE)
[1] 14605.25
> Var(tmp5,na.rm=TRUE)
[1] 854.891
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 91.92920 71.43038 74.05813 73.29610 69.78480 69.26394 68.81766 70.18365
 [9] 73.00775 73.08724
> rowSums(tmp5,na.rm=TRUE)
 [1] 1746.655 1428.608 1481.163 1465.922 1395.696 1385.279 1376.353 1403.673
 [9] 1460.155 1461.745
> rowVars(tmp5,na.rm=TRUE)
 [1] 8144.47659  107.20085   76.13061   95.85731   57.37577   77.23392
 [7]  110.54228   64.80836  108.01533   82.97637
> rowSd(tmp5,na.rm=TRUE)
 [1] 90.246754 10.353784  8.725286  9.790675  7.574680  8.788283 10.513909
 [8]  8.050364 10.393042  9.109137
> rowMax(tmp5,na.rm=TRUE)
 [1] 463.60037  93.42333  85.81602  85.53901  83.14487  88.73128  87.46505
 [8]  83.14529  88.89580  92.65920
> rowMin(tmp5,na.rm=TRUE)
 [1] 60.86465 53.65604 58.43805 57.29101 56.44752 57.75721 53.22037 52.83384
 [9] 54.24572 52.56316
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 109.03405  75.41422  69.61931  66.56634  72.42867  74.40316  69.93362
 [8]  70.66599  72.64953  63.37868  70.67576  69.65348  70.05750  77.60229
[15]  67.25823  66.41748  74.13877  71.25405  78.23612  77.86335
> colSums(tmp5,na.rm=TRUE)
 [1] 1090.3405  754.1422  696.1931  665.6634  724.2867  744.0316  699.3362
 [8]  706.6599  726.4953  633.7868  706.7576  696.5348  700.5750  776.0229
[15]  605.3240  664.1748  741.3877  712.5405  782.3612  778.6335
> colVars(tmp5,na.rm=TRUE)
 [1] 15582.77257    23.66367   117.57323    58.12332   107.93803    50.51152
 [7]   102.34955    66.45472    93.00110    17.78381   113.36942    87.53369
[13]    76.49003   115.28027    30.84269    84.63105    69.45159    74.74931
[19]    44.66743    73.04388
> colSd(tmp5,na.rm=TRUE)
 [1] 124.830976   4.864532  10.843119   7.623865  10.389323   7.107146
 [7]  10.116795   8.151976   9.643708   4.217086  10.647508   9.355944
[13]   8.745858  10.736865   5.553619   9.199514   8.333762   8.645768
[19]   6.683370   8.546571
> colMax(tmp5,na.rm=TRUE)
 [1] 463.60037  84.10612  84.99308  80.77213  92.65920  85.35498  88.89580
 [8]  80.22841  82.32213  68.74493  90.56859  83.17072  81.49257  93.42333
[15]  72.64124  82.41775  86.89545  82.57317  88.73128  90.12636
> colMin(tmp5,na.rm=TRUE)
 [1] 60.45266 69.65833 52.56316 53.61676 59.64825 66.36379 53.65604 54.24572
 [9] 53.22037 56.57859 59.02161 56.44752 57.61453 61.61856 58.42982 52.83384
[17] 61.57334 57.29101 69.49921 64.87782
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1]      NaN 71.43038 74.05813 73.29610 69.78480 69.26394 68.81766 70.18365
 [9] 73.00775 73.08724
> rowSums(tmp5,na.rm=TRUE)
 [1]    0.000 1428.608 1481.163 1465.922 1395.696 1385.279 1376.353 1403.673
 [9] 1460.155 1461.745
> rowVars(tmp5,na.rm=TRUE)
 [1]        NA 107.20085  76.13061  95.85731  57.37577  77.23392 110.54228
 [8]  64.80836 108.01533  82.97637
> rowSd(tmp5,na.rm=TRUE)
 [1]        NA 10.353784  8.725286  9.790675  7.574680  8.788283 10.513909
 [8]  8.050364 10.393042  9.109137
> rowMax(tmp5,na.rm=TRUE)
 [1]       NA 93.42333 85.81602 85.53901 83.14487 88.73128 87.46505 83.14529
 [9] 88.89580 92.65920
> rowMin(tmp5,na.rm=TRUE)
 [1]       NA 53.65604 58.43805 57.29101 56.44752 57.75721 53.22037 52.83384
 [9] 54.24572 52.56316
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1] 69.63779 75.73851 70.43448 64.98792 71.88738 75.01841 70.76811 69.60350
 [9] 71.65513 63.21761 71.06287 70.63002 69.60763 77.22877      NaN 66.16647
[17] 74.70179 71.78588 78.95396 78.38810
> colSums(tmp5,na.rm=TRUE)
 [1] 626.7401 681.6466 633.9104 584.8912 646.9864 675.1657 636.9130 626.4315
 [9] 644.8961 568.9585 639.5658 635.6702 626.4687 695.0589   0.0000 595.4983
[17] 672.3161 646.0729 710.5857 705.4929
> colVars(tmp5,na.rm=TRUE)
 [1]  69.88624  25.43855 124.79421  37.36033 118.13408  52.56698 107.30905
 [8]  62.06159  93.50185  19.71492 125.85476  87.74712  83.77450 128.12071
[15]        NA  94.50114  74.56691  80.91105  44.45376  79.07654
> colSd(tmp5,na.rm=TRUE)
 [1]  8.359799  5.043664 11.171133  6.112310 10.868950  7.250309 10.359008
 [8]  7.877918  9.669635  4.440149 11.218501  9.367343  9.152841 11.319042
[15]        NA  9.721170  8.635214  8.995057  6.667365  8.892499
> colMax(tmp5,na.rm=TRUE)
 [1] 85.08684 84.10612 84.99308 71.36288 92.65920 85.35498 88.89580 79.42739
 [9] 82.32213 68.74493 90.56859 83.17072 81.49257 93.42333     -Inf 82.41775
[17] 86.89545 82.57317 88.73128 90.12636
> colMin(tmp5,na.rm=TRUE)
 [1] 60.45266 69.65833 52.56316 53.61676 59.64825 66.36379 53.65604 54.24572
 [9] 53.22037 56.57859 59.02161 56.44752 57.61453 61.61856      Inf 52.83384
[17] 61.57334 57.29101 69.49921 64.87782
> 
> 
> 
> 
> 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] 225.4639 165.8329 436.2039 209.4751 316.3601 184.1706 156.1585 233.2570
 [9] 146.0425 177.8402
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 225.4639 165.8329 436.2039 209.4751 316.3601 184.1706 156.1585 233.2570
 [9] 146.0425 177.8402
> 
> 
> 
> copymatrix <- matrix(rnorm(200,150,15),10,20)
> 
> tmp5[1:10,1:20] <- copymatrix
> which.row <- 1
> which.col  <- 3
> cat(which.row," ",which.col,"\n")
1   3 
> tmp5[which.row,which.col] <- NA
> copymatrix[which.row,which.col] <- NA
> 
> colVars(tmp5,na.rm=TRUE)-apply(copymatrix,2,var,na.rm=TRUE)
 [1] -1.989520e-13 -8.526513e-14 -2.842171e-14  0.000000e+00 -8.526513e-14
 [6]  2.273737e-13  0.000000e+00  1.136868e-13 -4.263256e-13  8.526513e-14
[11] -1.989520e-13 -1.136868e-13 -5.684342e-14  1.136868e-13  0.000000e+00
[16] -1.989520e-13  1.705303e-13  0.000000e+00  1.136868e-13  8.526513e-14
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> ## making sure these things agree
> ##
> ## first when there is no NA
> 
> 
> 
> agree.checks <- function(buff.matrix,r.matrix,err.tol=1e-10){
+ 
+   if (Max(buff.matrix,na.rm=TRUE) != max(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Max")
+   }
+   
+ 
+   if (Min(buff.matrix,na.rm=TRUE) != min(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Min")
+   }
+ 
+ 
+   if (abs(Sum(buff.matrix,na.rm=TRUE)- sum(r.matrix,na.rm=TRUE)) > err.tol){
+ 
+     cat(Sum(buff.matrix,na.rm=TRUE),"\n")
+     cat(sum(r.matrix,na.rm=TRUE),"\n")
+     cat(Sum(buff.matrix,na.rm=TRUE) - sum(r.matrix,na.rm=TRUE),"\n")
+     
+     stop("No agreement in Sum")
+   }
+   
+   if (abs(mean(buff.matrix,na.rm=TRUE) - mean(r.matrix,na.rm=TRUE)) > err.tol){
+     stop("No agreement in mean")
+   }
+   
+   
+   if(abs(Var(buff.matrix,na.rm=TRUE) - var(as.vector(r.matrix),na.rm=TRUE)) > err.tol){
+     stop("No agreement in Var")
+   }
+   
+   
+ 
+   if(any(abs(rowMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,mean,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowMeans")
+   }
+   
+   
+   if(any(abs(colMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,mean,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colMeans")
+   }
+   
+   
+   if(any(abs(rowSums(buff.matrix,na.rm=TRUE)  -  apply(r.matrix,1,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in rowSums")
+   }
+   
+   
+   if(any(abs(colSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colSums")
+   }
+   
+   ### this is to get around the fact that R doesn't like to compute NA on an entire vector of NA when 
+   ### computing variance
+   my.Var <- function(x,na.rm=FALSE){
+    if (all(is.na(x))){
+      return(NA)
+    } else {
+      var(x,na.rm=na.rm)
+    }
+ 
+   }
+   
+   if(any(abs(rowVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+   
+   
+   if(any(abs(colVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+ 
+ 
+   if(any(abs(rowMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+ 
+   if(any(abs(colMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+   
+   
+   if(any(abs(rowMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+   
+ 
+   if(any(abs(colMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+ 
+   if(any(abs(colMedians(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,median,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMedian")
+   }
+ 
+   if(any(abs(colRanges(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,range,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colRanges")
+   }
+ 
+ 
+   
+ }
> 
> 
> 
> 
> 
> 
> 
> 
> 
> for (rep in 1:20){
+   copymatrix <- matrix(rnorm(200,150,15),10,20)
+   
+   tmp5[1:10,1:20] <- copymatrix
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ## now lets assign some NA values and check agreement
+ 
+   which.row <- sample(1:10,1,replace=TRUE)
+   which.col  <- sample(1:20,1,replace=TRUE)
+   
+   cat(which.row," ",which.col,"\n")
+   
+   tmp5[which.row,which.col] <- NA
+   copymatrix[which.row,which.col] <- NA
+   
+   agree.checks(tmp5,copymatrix)
+ 
+   ## make an entire row NA
+   tmp5[which.row,] <- NA
+   copymatrix[which.row,] <- NA
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ### also make an entire col NA
+   tmp5[,which.col] <- NA
+   copymatrix[,which.col] <- NA
+ 
+   agree.checks(tmp5,copymatrix)
+ 
+   ### now make 1 element non NA with NA in the rest of row and column
+ 
+   tmp5[which.row,which.col] <- rnorm(1,150,15)
+   copymatrix[which.row,which.col] <- tmp5[which.row,which.col]
+ 
+   agree.checks(tmp5,copymatrix)
+ }
4   6 
2   1 
3   9 
5   7 
5   6 
2   2 
5   14 
4   1 
1   12 
6   9 
6   5 
2   8 
5   3 
2   10 
5   18 
4   1 
2   13 
5   13 
6   18 
5   13 
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.23595
> Min(tmp)
[1] -2.694494
> mean(tmp)
[1] 0.2169133
> Sum(tmp)
[1] 21.69133
> Var(tmp)
[1] 1.083151
> 
> rowMeans(tmp)
[1] 0.2169133
> rowSums(tmp)
[1] 21.69133
> rowVars(tmp)
[1] 1.083151
> rowSd(tmp)
[1] 1.040745
> rowMax(tmp)
[1] 2.23595
> rowMin(tmp)
[1] -2.694494
> 
> colMeans(tmp)
  [1] -0.50959708 -1.24032319  1.35837338 -0.08324162  0.73502302 -1.30287693
  [7]  0.05484463  0.99375962 -2.24506682 -0.11980705 -0.85261471 -2.69449394
 [13]  1.08023977  1.41210618  0.49877259  0.28449157 -0.72498026  0.26773208
 [19] -1.20037420 -1.09124894 -0.99485005  0.06864966  0.84033039  0.10570723
 [25]  0.56062533 -2.07476252  0.35434233  0.16701421  1.43820381  1.89300808
 [31]  0.85400376  1.10243458  2.15236727  0.21811274  0.89011378 -0.15946569
 [37]  1.45343088 -0.29360095  0.16564558  0.73504613  1.39990015  2.23595047
 [43] -0.62034753  0.27407026 -0.49168466 -0.42492774  1.22309819 -0.54938332
 [49]  1.92538836 -1.74053369 -1.24520548  0.80416772  0.19292314 -1.48980948
 [55]  0.20837888  0.28410632  1.52557878  0.87138596  0.15896155  0.63289578
 [61] -0.64043687 -0.35763769  1.61566335 -0.78754864 -0.05858672  0.87917077
 [67]  0.47066969  0.05801784 -0.55853385  1.39872438 -1.94540242 -0.06927837
 [73]  0.05897844  0.08519753  1.59875917  1.85368844  1.36692347 -0.95391603
 [79]  1.71059750  0.78139387  0.04782166  0.17897602 -0.31344895  0.72054624
 [85] -1.72252616  1.48880503  0.47532119 -0.01963825  0.85108178  1.67370438
 [91] -0.19734527  0.26613254 -1.05549416  0.91509337  1.19965199  1.00090519
 [97]  0.77296713  0.50152213 -0.33185061 -0.53932279
> colSums(tmp)
  [1] -0.50959708 -1.24032319  1.35837338 -0.08324162  0.73502302 -1.30287693
  [7]  0.05484463  0.99375962 -2.24506682 -0.11980705 -0.85261471 -2.69449394
 [13]  1.08023977  1.41210618  0.49877259  0.28449157 -0.72498026  0.26773208
 [19] -1.20037420 -1.09124894 -0.99485005  0.06864966  0.84033039  0.10570723
 [25]  0.56062533 -2.07476252  0.35434233  0.16701421  1.43820381  1.89300808
 [31]  0.85400376  1.10243458  2.15236727  0.21811274  0.89011378 -0.15946569
 [37]  1.45343088 -0.29360095  0.16564558  0.73504613  1.39990015  2.23595047
 [43] -0.62034753  0.27407026 -0.49168466 -0.42492774  1.22309819 -0.54938332
 [49]  1.92538836 -1.74053369 -1.24520548  0.80416772  0.19292314 -1.48980948
 [55]  0.20837888  0.28410632  1.52557878  0.87138596  0.15896155  0.63289578
 [61] -0.64043687 -0.35763769  1.61566335 -0.78754864 -0.05858672  0.87917077
 [67]  0.47066969  0.05801784 -0.55853385  1.39872438 -1.94540242 -0.06927837
 [73]  0.05897844  0.08519753  1.59875917  1.85368844  1.36692347 -0.95391603
 [79]  1.71059750  0.78139387  0.04782166  0.17897602 -0.31344895  0.72054624
 [85] -1.72252616  1.48880503  0.47532119 -0.01963825  0.85108178  1.67370438
 [91] -0.19734527  0.26613254 -1.05549416  0.91509337  1.19965199  1.00090519
 [97]  0.77296713  0.50152213 -0.33185061 -0.53932279
> 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.50959708 -1.24032319  1.35837338 -0.08324162  0.73502302 -1.30287693
  [7]  0.05484463  0.99375962 -2.24506682 -0.11980705 -0.85261471 -2.69449394
 [13]  1.08023977  1.41210618  0.49877259  0.28449157 -0.72498026  0.26773208
 [19] -1.20037420 -1.09124894 -0.99485005  0.06864966  0.84033039  0.10570723
 [25]  0.56062533 -2.07476252  0.35434233  0.16701421  1.43820381  1.89300808
 [31]  0.85400376  1.10243458  2.15236727  0.21811274  0.89011378 -0.15946569
 [37]  1.45343088 -0.29360095  0.16564558  0.73504613  1.39990015  2.23595047
 [43] -0.62034753  0.27407026 -0.49168466 -0.42492774  1.22309819 -0.54938332
 [49]  1.92538836 -1.74053369 -1.24520548  0.80416772  0.19292314 -1.48980948
 [55]  0.20837888  0.28410632  1.52557878  0.87138596  0.15896155  0.63289578
 [61] -0.64043687 -0.35763769  1.61566335 -0.78754864 -0.05858672  0.87917077
 [67]  0.47066969  0.05801784 -0.55853385  1.39872438 -1.94540242 -0.06927837
 [73]  0.05897844  0.08519753  1.59875917  1.85368844  1.36692347 -0.95391603
 [79]  1.71059750  0.78139387  0.04782166  0.17897602 -0.31344895  0.72054624
 [85] -1.72252616  1.48880503  0.47532119 -0.01963825  0.85108178  1.67370438
 [91] -0.19734527  0.26613254 -1.05549416  0.91509337  1.19965199  1.00090519
 [97]  0.77296713  0.50152213 -0.33185061 -0.53932279
> colMin(tmp)
  [1] -0.50959708 -1.24032319  1.35837338 -0.08324162  0.73502302 -1.30287693
  [7]  0.05484463  0.99375962 -2.24506682 -0.11980705 -0.85261471 -2.69449394
 [13]  1.08023977  1.41210618  0.49877259  0.28449157 -0.72498026  0.26773208
 [19] -1.20037420 -1.09124894 -0.99485005  0.06864966  0.84033039  0.10570723
 [25]  0.56062533 -2.07476252  0.35434233  0.16701421  1.43820381  1.89300808
 [31]  0.85400376  1.10243458  2.15236727  0.21811274  0.89011378 -0.15946569
 [37]  1.45343088 -0.29360095  0.16564558  0.73504613  1.39990015  2.23595047
 [43] -0.62034753  0.27407026 -0.49168466 -0.42492774  1.22309819 -0.54938332
 [49]  1.92538836 -1.74053369 -1.24520548  0.80416772  0.19292314 -1.48980948
 [55]  0.20837888  0.28410632  1.52557878  0.87138596  0.15896155  0.63289578
 [61] -0.64043687 -0.35763769  1.61566335 -0.78754864 -0.05858672  0.87917077
 [67]  0.47066969  0.05801784 -0.55853385  1.39872438 -1.94540242 -0.06927837
 [73]  0.05897844  0.08519753  1.59875917  1.85368844  1.36692347 -0.95391603
 [79]  1.71059750  0.78139387  0.04782166  0.17897602 -0.31344895  0.72054624
 [85] -1.72252616  1.48880503  0.47532119 -0.01963825  0.85108178  1.67370438
 [91] -0.19734527  0.26613254 -1.05549416  0.91509337  1.19965199  1.00090519
 [97]  0.77296713  0.50152213 -0.33185061 -0.53932279
> colMedians(tmp)
  [1] -0.50959708 -1.24032319  1.35837338 -0.08324162  0.73502302 -1.30287693
  [7]  0.05484463  0.99375962 -2.24506682 -0.11980705 -0.85261471 -2.69449394
 [13]  1.08023977  1.41210618  0.49877259  0.28449157 -0.72498026  0.26773208
 [19] -1.20037420 -1.09124894 -0.99485005  0.06864966  0.84033039  0.10570723
 [25]  0.56062533 -2.07476252  0.35434233  0.16701421  1.43820381  1.89300808
 [31]  0.85400376  1.10243458  2.15236727  0.21811274  0.89011378 -0.15946569
 [37]  1.45343088 -0.29360095  0.16564558  0.73504613  1.39990015  2.23595047
 [43] -0.62034753  0.27407026 -0.49168466 -0.42492774  1.22309819 -0.54938332
 [49]  1.92538836 -1.74053369 -1.24520548  0.80416772  0.19292314 -1.48980948
 [55]  0.20837888  0.28410632  1.52557878  0.87138596  0.15896155  0.63289578
 [61] -0.64043687 -0.35763769  1.61566335 -0.78754864 -0.05858672  0.87917077
 [67]  0.47066969  0.05801784 -0.55853385  1.39872438 -1.94540242 -0.06927837
 [73]  0.05897844  0.08519753  1.59875917  1.85368844  1.36692347 -0.95391603
 [79]  1.71059750  0.78139387  0.04782166  0.17897602 -0.31344895  0.72054624
 [85] -1.72252616  1.48880503  0.47532119 -0.01963825  0.85108178  1.67370438
 [91] -0.19734527  0.26613254 -1.05549416  0.91509337  1.19965199  1.00090519
 [97]  0.77296713  0.50152213 -0.33185061 -0.53932279
> colRanges(tmp)
           [,1]      [,2]     [,3]        [,4]     [,5]      [,6]       [,7]
[1,] -0.5095971 -1.240323 1.358373 -0.08324162 0.735023 -1.302877 0.05484463
[2,] -0.5095971 -1.240323 1.358373 -0.08324162 0.735023 -1.302877 0.05484463
          [,8]      [,9]     [,10]      [,11]     [,12]   [,13]    [,14]
[1,] 0.9937596 -2.245067 -0.119807 -0.8526147 -2.694494 1.08024 1.412106
[2,] 0.9937596 -2.245067 -0.119807 -0.8526147 -2.694494 1.08024 1.412106
         [,15]     [,16]      [,17]     [,18]     [,19]     [,20]    [,21]
[1,] 0.4987726 0.2844916 -0.7249803 0.2677321 -1.200374 -1.091249 -0.99485
[2,] 0.4987726 0.2844916 -0.7249803 0.2677321 -1.200374 -1.091249 -0.99485
          [,22]     [,23]     [,24]     [,25]     [,26]     [,27]     [,28]
[1,] 0.06864966 0.8403304 0.1057072 0.5606253 -2.074763 0.3543423 0.1670142
[2,] 0.06864966 0.8403304 0.1057072 0.5606253 -2.074763 0.3543423 0.1670142
        [,29]    [,30]     [,31]    [,32]    [,33]     [,34]     [,35]
[1,] 1.438204 1.893008 0.8540038 1.102435 2.152367 0.2181127 0.8901138
[2,] 1.438204 1.893008 0.8540038 1.102435 2.152367 0.2181127 0.8901138
          [,36]    [,37]     [,38]     [,39]     [,40]  [,41]   [,42]
[1,] -0.1594657 1.453431 -0.293601 0.1656456 0.7350461 1.3999 2.23595
[2,] -0.1594657 1.453431 -0.293601 0.1656456 0.7350461 1.3999 2.23595
          [,43]     [,44]      [,45]      [,46]    [,47]      [,48]    [,49]
[1,] -0.6203475 0.2740703 -0.4916847 -0.4249277 1.223098 -0.5493833 1.925388
[2,] -0.6203475 0.2740703 -0.4916847 -0.4249277 1.223098 -0.5493833 1.925388
         [,50]     [,51]     [,52]     [,53]     [,54]     [,55]     [,56]
[1,] -1.740534 -1.245205 0.8041677 0.1929231 -1.489809 0.2083789 0.2841063
[2,] -1.740534 -1.245205 0.8041677 0.1929231 -1.489809 0.2083789 0.2841063
        [,57]    [,58]     [,59]     [,60]      [,61]      [,62]    [,63]
[1,] 1.525579 0.871386 0.1589615 0.6328958 -0.6404369 -0.3576377 1.615663
[2,] 1.525579 0.871386 0.1589615 0.6328958 -0.6404369 -0.3576377 1.615663
          [,64]       [,65]     [,66]     [,67]      [,68]      [,69]    [,70]
[1,] -0.7875486 -0.05858672 0.8791708 0.4706697 0.05801784 -0.5585339 1.398724
[2,] -0.7875486 -0.05858672 0.8791708 0.4706697 0.05801784 -0.5585339 1.398724
         [,71]       [,72]      [,73]      [,74]    [,75]    [,76]    [,77]
[1,] -1.945402 -0.06927837 0.05897844 0.08519753 1.598759 1.853688 1.366923
[2,] -1.945402 -0.06927837 0.05897844 0.08519753 1.598759 1.853688 1.366923
         [,78]    [,79]     [,80]      [,81]    [,82]     [,83]     [,84]
[1,] -0.953916 1.710597 0.7813939 0.04782166 0.178976 -0.313449 0.7205462
[2,] -0.953916 1.710597 0.7813939 0.04782166 0.178976 -0.313449 0.7205462
         [,85]    [,86]     [,87]       [,88]     [,89]    [,90]      [,91]
[1,] -1.722526 1.488805 0.4753212 -0.01963825 0.8510818 1.673704 -0.1973453
[2,] -1.722526 1.488805 0.4753212 -0.01963825 0.8510818 1.673704 -0.1973453
         [,92]     [,93]     [,94]    [,95]    [,96]     [,97]     [,98]
[1,] 0.2661325 -1.055494 0.9150934 1.199652 1.000905 0.7729671 0.5015221
[2,] 0.2661325 -1.055494 0.9150934 1.199652 1.000905 0.7729671 0.5015221
          [,99]     [,100]
[1,] -0.3318506 -0.5393228
[2,] -0.3318506 -0.5393228
> 
> 
> Max(tmp2)
[1] 2.469663
> Min(tmp2)
[1] -2.527376
> mean(tmp2)
[1] 0.06992538
> Sum(tmp2)
[1] 6.992538
> Var(tmp2)
[1] 0.9411282
> 
> rowMeans(tmp2)
  [1] -0.45780924  0.62902954  2.46966280 -0.45176240  0.26569510  0.75578792
  [7]  0.95496463  0.33076460  0.74081127  0.62245471 -1.07704533 -0.51955256
 [13]  0.33278965 -0.14673731  0.51052555 -0.34944068  0.52014120 -0.29303645
 [19]  0.30691062  0.16866130  0.55174655  1.26958123  0.18519795  1.53063839
 [25]  0.88315400 -0.39730538 -0.06086613  0.01893459 -1.29843949  0.67807428
 [31]  0.07675508  0.31711542  1.16664241  1.60357119 -1.27266583 -0.96990827
 [37] -0.46391242  0.48596824  0.30041827 -0.80368746 -0.15881146  0.76407456
 [43] -1.23328961 -0.37316445 -1.07320893 -0.09225312  0.83385681 -0.71683083
 [49]  0.25094227  0.78113799 -0.84028541 -0.70774586  0.72212747  1.16681275
 [55] -0.02917677 -0.80682779 -0.55076125 -0.51147777  0.96172058 -0.71364090
 [61] -0.79868255 -0.88138351 -1.78088761  0.87592642 -2.05563654  0.63745354
 [67]  0.25594923 -0.91368483  2.12300669  0.85455707  1.99298186 -1.05587174
 [73]  0.98303177 -1.78282569  1.42065281  0.01116720  0.20740508 -0.59897143
 [79]  0.22301224 -1.75143201 -0.68500634 -0.68169757  0.45479234 -2.52737587
 [85] -1.52228542  1.36146523 -0.79862413  1.74763338 -0.63682959  0.03713696
 [91] -0.50144004  0.59227397  2.06804380  1.04455900 -0.41729716 -0.35702031
 [97]  0.89463394  0.86835502  0.92139453  0.37703217
> rowSums(tmp2)
  [1] -0.45780924  0.62902954  2.46966280 -0.45176240  0.26569510  0.75578792
  [7]  0.95496463  0.33076460  0.74081127  0.62245471 -1.07704533 -0.51955256
 [13]  0.33278965 -0.14673731  0.51052555 -0.34944068  0.52014120 -0.29303645
 [19]  0.30691062  0.16866130  0.55174655  1.26958123  0.18519795  1.53063839
 [25]  0.88315400 -0.39730538 -0.06086613  0.01893459 -1.29843949  0.67807428
 [31]  0.07675508  0.31711542  1.16664241  1.60357119 -1.27266583 -0.96990827
 [37] -0.46391242  0.48596824  0.30041827 -0.80368746 -0.15881146  0.76407456
 [43] -1.23328961 -0.37316445 -1.07320893 -0.09225312  0.83385681 -0.71683083
 [49]  0.25094227  0.78113799 -0.84028541 -0.70774586  0.72212747  1.16681275
 [55] -0.02917677 -0.80682779 -0.55076125 -0.51147777  0.96172058 -0.71364090
 [61] -0.79868255 -0.88138351 -1.78088761  0.87592642 -2.05563654  0.63745354
 [67]  0.25594923 -0.91368483  2.12300669  0.85455707  1.99298186 -1.05587174
 [73]  0.98303177 -1.78282569  1.42065281  0.01116720  0.20740508 -0.59897143
 [79]  0.22301224 -1.75143201 -0.68500634 -0.68169757  0.45479234 -2.52737587
 [85] -1.52228542  1.36146523 -0.79862413  1.74763338 -0.63682959  0.03713696
 [91] -0.50144004  0.59227397  2.06804380  1.04455900 -0.41729716 -0.35702031
 [97]  0.89463394  0.86835502  0.92139453  0.37703217
> 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.45780924  0.62902954  2.46966280 -0.45176240  0.26569510  0.75578792
  [7]  0.95496463  0.33076460  0.74081127  0.62245471 -1.07704533 -0.51955256
 [13]  0.33278965 -0.14673731  0.51052555 -0.34944068  0.52014120 -0.29303645
 [19]  0.30691062  0.16866130  0.55174655  1.26958123  0.18519795  1.53063839
 [25]  0.88315400 -0.39730538 -0.06086613  0.01893459 -1.29843949  0.67807428
 [31]  0.07675508  0.31711542  1.16664241  1.60357119 -1.27266583 -0.96990827
 [37] -0.46391242  0.48596824  0.30041827 -0.80368746 -0.15881146  0.76407456
 [43] -1.23328961 -0.37316445 -1.07320893 -0.09225312  0.83385681 -0.71683083
 [49]  0.25094227  0.78113799 -0.84028541 -0.70774586  0.72212747  1.16681275
 [55] -0.02917677 -0.80682779 -0.55076125 -0.51147777  0.96172058 -0.71364090
 [61] -0.79868255 -0.88138351 -1.78088761  0.87592642 -2.05563654  0.63745354
 [67]  0.25594923 -0.91368483  2.12300669  0.85455707  1.99298186 -1.05587174
 [73]  0.98303177 -1.78282569  1.42065281  0.01116720  0.20740508 -0.59897143
 [79]  0.22301224 -1.75143201 -0.68500634 -0.68169757  0.45479234 -2.52737587
 [85] -1.52228542  1.36146523 -0.79862413  1.74763338 -0.63682959  0.03713696
 [91] -0.50144004  0.59227397  2.06804380  1.04455900 -0.41729716 -0.35702031
 [97]  0.89463394  0.86835502  0.92139453  0.37703217
> rowMin(tmp2)
  [1] -0.45780924  0.62902954  2.46966280 -0.45176240  0.26569510  0.75578792
  [7]  0.95496463  0.33076460  0.74081127  0.62245471 -1.07704533 -0.51955256
 [13]  0.33278965 -0.14673731  0.51052555 -0.34944068  0.52014120 -0.29303645
 [19]  0.30691062  0.16866130  0.55174655  1.26958123  0.18519795  1.53063839
 [25]  0.88315400 -0.39730538 -0.06086613  0.01893459 -1.29843949  0.67807428
 [31]  0.07675508  0.31711542  1.16664241  1.60357119 -1.27266583 -0.96990827
 [37] -0.46391242  0.48596824  0.30041827 -0.80368746 -0.15881146  0.76407456
 [43] -1.23328961 -0.37316445 -1.07320893 -0.09225312  0.83385681 -0.71683083
 [49]  0.25094227  0.78113799 -0.84028541 -0.70774586  0.72212747  1.16681275
 [55] -0.02917677 -0.80682779 -0.55076125 -0.51147777  0.96172058 -0.71364090
 [61] -0.79868255 -0.88138351 -1.78088761  0.87592642 -2.05563654  0.63745354
 [67]  0.25594923 -0.91368483  2.12300669  0.85455707  1.99298186 -1.05587174
 [73]  0.98303177 -1.78282569  1.42065281  0.01116720  0.20740508 -0.59897143
 [79]  0.22301224 -1.75143201 -0.68500634 -0.68169757  0.45479234 -2.52737587
 [85] -1.52228542  1.36146523 -0.79862413  1.74763338 -0.63682959  0.03713696
 [91] -0.50144004  0.59227397  2.06804380  1.04455900 -0.41729716 -0.35702031
 [97]  0.89463394  0.86835502  0.92139453  0.37703217
> 
> colMeans(tmp2)
[1] 0.06992538
> colSums(tmp2)
[1] 6.992538
> colVars(tmp2)
[1] 0.9411282
> colSd(tmp2)
[1] 0.9701176
> colMax(tmp2)
[1] 2.469663
> colMin(tmp2)
[1] -2.527376
> colMedians(tmp2)
[1] 0.1769296
> colRanges(tmp2)
          [,1]
[1,] -2.527376
[2,]  2.469663
> 
> dataset1 <- matrix(dataset1,1,100)
> 
> agree.checks(tmp,dataset1)
> 
> dataset2 <- matrix(dataset2,100,1)
> agree.checks(tmp2,dataset2)
>   
> 
> tmp <- createBufferedMatrix(10,10)
> 
> tmp[1:10,1:10] <- rnorm(100)
> colApply(tmp,sum)
 [1]  1.1736802 -1.6348295  3.9896308  0.3650587  4.9606345  2.9425435
 [7]  4.9699143  0.2480915 -4.5322024  1.6542439
> colApply(tmp,quantile)[,1]
            [,1]
[1,] -1.49302500
[2,] -0.38836422
[3,]  0.03440932
[4,]  0.70560640
[5,]  2.17537049
> 
> rowApply(tmp,sum)
 [1]  2.21622884  2.98090252 -0.07910271 -0.88890812  2.42668581 -2.20886586
 [7]  3.12789486  0.65659359  4.09096286  1.81437372
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    5    6    2    4    8    2    5    9    2    10
 [2,]    4    1    4   10   10    1    7    4    4     6
 [3,]   10    7    7    8    1   10    6    1    7     8
 [4,]    2    9    6    2    3    9    2    5    1     7
 [5,]    1    4    9    6    5    8    8    7    6     9
 [6,]    8    3    8    9    6    6    9    3    9     4
 [7,]    7   10   10    1    9    7    3    2   10     1
 [8,]    3    8    1    3    4    4   10    8    5     5
 [9,]    9    2    3    5    2    5    1    6    3     2
[10,]    6    5    5    7    7    3    4   10    8     3
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1]  1.42547124 -0.50035291 -0.76574403  2.46029494 -1.93024309 -0.67076180
 [7]  2.71979742 -0.55732711 -2.98368617  1.75540608  1.88175854  0.02638778
[13] -0.43739298 -2.69572819 -0.80707067  2.81534516  0.56630363  0.24745157
[19]  2.10032028 -0.31081276
> colApply(tmp,quantile)[,1]
            [,1]
[1,] -1.59306615
[2,] -0.59100887
[3,]  0.05622986
[4,]  1.52294819
[5,]  2.03036821
> 
> rowApply(tmp,sum)
[1]  3.987734  2.291152  1.991833 -7.314255  3.382953
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]   19   20   10    3    5
[2,]   17   10   16    1    6
[3,]   11    2   15   18    4
[4,]    9   14   18    9   17
[5,]    7    6   13    6    7
> 
> 
> as.matrix(tmp)
            [,1]       [,2]        [,3]       [,4]       [,5]        [,6]
[1,]  2.03036821  1.1262216 -0.06311985 -0.3218300 -0.4704997  2.27706912
[2,]  1.52294819  0.1144326 -1.53974556  0.7135640 -0.4115974 -1.06321797
[3,]  0.05622986  0.8633762  0.74470288  1.1936453  0.3352517  0.06062003
[4,] -1.59306615 -2.1220506  0.82923887 -0.3172547 -1.1139636 -1.83760311
[5,] -0.59100887 -0.4823326 -0.73682038  1.1921702 -0.2694341 -0.10762987
           [,7]       [,8]       [,9]      [,10]       [,11]      [,12]
[1,]  0.3878398 -0.5085407 -1.1476999  1.1975026 -0.58604033  0.9723792
[2,]  0.2305125 -1.6935312  0.7840068  1.0167721 -0.05539965 -0.1346329
[3,]  1.7849048 -0.2212861 -0.5630161 -0.8775200  2.13219036 -1.6847212
[4,] -0.1715129  1.0926299 -1.0621928 -0.1541993  0.36885838  0.1303553
[5,]  0.4880533  0.7734010 -0.9947842  0.5728507  0.02214977  0.7430072
           [,13]      [,14]      [,15]      [,16]      [,17]       [,18]
[1,] -0.78777513 -0.3676746  1.0917845 -0.6177802  0.9549616 -1.79786734
[2,] -0.09618757  0.5662584  0.1962743  1.3707526 -0.8047578  1.36343853
[3,] -0.23894415 -0.3772278  0.6357933  1.1680090 -0.8996204  0.10122603
[4,] -0.61713951 -1.1279860 -1.3655202  0.4642374 -0.2295158  0.49071143
[5,]  1.30265338 -1.3890981 -1.3654026  0.4301264  1.5452361  0.08994291
          [,19]      [,20]
[1,] -0.1524079  0.7708432
[2,]  1.3837085 -1.1724467
[3,] -0.6066156 -1.6151650
[4,] -0.2194094  1.2411279
[5,]  1.6950447  0.4648278
> 
> 
> 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 :  563  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      col7
row1 0.7352915 -1.262919 -0.06965699 -1.134155 0.1280831 -0.0979327 -1.034513
          col8     col9     col10     col11     col12     col13      col14
row1 0.8028686 1.332241 0.4121713 0.7324939 0.8359541 -2.311773 -0.1818969
          col15    col16      col17      col18      col19      col20
row1 -0.2055507 -1.09875 -0.2738854 -0.3164875 -0.3771207 -0.8501437
> tmp[,"col10"]
          col10
row1  0.4121713
row2 -1.6170998
row3 -0.3664785
row4 -0.5509791
row5 -0.7268585
> tmp[c("row1","row5"),]
          col1        col2        col3      col4       col5        col6
row1 0.7352915 -1.26291867 -0.06965699 -1.134155  0.1280831 -0.09793270
row5 0.6750962  0.06050806  0.29826648 -1.108576 -0.8697311  0.07166399
           col7      col8      col9      col10     col11      col12      col13
row1 -1.0345127 0.8028686  1.332241  0.4121713 0.7324939  0.8359541 -2.3117726
row5 -0.2141389 0.2983530 -1.143311 -0.7268585 0.9042152 -0.3786856  0.8609369
          col14      col15       col16      col17      col18      col19
row1 -0.1818969 -0.2055507 -1.09875018 -0.2738854 -0.3164875 -0.3771207
row5  1.3117521  1.1470421 -0.08799457  0.3802101 -0.3158405  0.7726914
          col20
row1 -0.8501437
row5 -1.7278596
> tmp[,c("col6","col20")]
            col6      col20
row1 -0.09793270 -0.8501437
row2 -0.50628693 -1.4562012
row3  0.48071995 -1.6658622
row4  0.67794233  1.3129194
row5  0.07166399 -1.7278596
> tmp[c("row1","row5"),c("col6","col20")]
            col6      col20
row1 -0.09793270 -0.8501437
row5  0.07166399 -1.7278596
> 
> 
> 
> 
> 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 51.37702 50.22171 49.38224 50.22278 49.29903 104.6993 49.73563 50.57602
         col9    col10    col11    col12    col13    col14    col15    col16
row1 49.63775 48.42586 49.01586 50.22068 50.08897 49.02512 50.33522 50.51901
        col17    col18    col19    col20
row1 49.35614 50.83241 50.50412 104.6624
> tmp[,"col10"]
        col10
row1 48.42586
row2 29.21662
row3 28.78897
row4 28.85855
row5 50.32119
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 51.37702 50.22171 49.38224 50.22278 49.29903 104.6993 49.73563 50.57602
row5 51.60767 48.42436 50.11354 50.71487 50.92611 102.9011 50.11385 49.14139
         col9    col10    col11    col12    col13    col14    col15    col16
row1 49.63775 48.42586 49.01586 50.22068 50.08897 49.02512 50.33522 50.51901
row5 50.16633 50.32119 49.19304 49.82068 49.35351 50.53181 48.62732 48.78410
        col17    col18    col19    col20
row1 49.35614 50.83241 50.50412 104.6624
row5 48.62632 50.92763 51.89447 106.5664
> tmp[,c("col6","col20")]
          col6     col20
row1 104.69935 104.66237
row2  75.62182  75.31991
row3  74.31839  74.44906
row4  76.22056  75.63927
row5 102.90109 106.56645
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 104.6993 104.6624
row5 102.9011 106.5664
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 104.6993 104.6624
row5 102.9011 106.5664
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
           col13
[1,]  0.08568707
[2,] -0.58090002
[3,] -2.00035279
[4,]  1.51031170
[5,]  1.52158424
> tmp[,c("col17","col7")]
           col17       col7
[1,]  0.07859787  0.5615990
[2,] -0.34211819  0.1599449
[3,]  0.98781682 -0.5448030
[4,]  0.42603880  1.8702563
[5,]  0.26543629 -1.5986028
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
           col6      col20
[1,] -1.2466859 -0.4094039
[2,]  0.8334414  0.3191820
[3,]  1.6474018 -0.8129737
[4,]  0.3708992 -0.5395591
[5,]  1.3079089 -0.4541694
> subBufferedMatrix(tmp,1,c("col6"))[,1]
          col1
[1,] -1.246686
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
           col6
[1,] -1.2466859
[2,]  0.8334414
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> 
> 
> 
> subBufferedMatrix(tmp,c("row3","row1"),)[,1:20]
           [,1]      [,2]        [,3]       [,4]      [,5]        [,6]
row3 -0.6508939 -1.341847  0.06922037 -0.3160805  0.633601  0.03573968
row1 -0.4538168 -1.103554 -0.65138321  1.2698957 -1.735413 -0.23863336
           [,7]        [,8]       [,9]      [,10]     [,11]      [,12]
row3 -0.6094808  0.55044281 -0.1022105 -0.3325176 0.3806278 -0.2400584
row1 -1.4686412 -0.06404586  0.4689262 -0.1776717 0.5347047 -1.8712069
          [,13]     [,14]      [,15]     [,16]       [,17]      [,18]
row3 -1.8663956 0.5452947 -0.6279783 0.4151052 -0.02238263  0.4146535
row1  0.4377945 0.5336625  0.9413440 1.0719369  1.61263734 -0.9373525
           [,19]      [,20]
row3  0.09338214  0.3033851
row1 -0.30308955 -0.3472361
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
          [,1]      [,2]       [,3]      [,4]      [,5]       [,6]     [,7]
row2 0.5565831 0.8931821 -0.5037844 0.2057268 0.9659721 -0.4402871 2.416032
           [,8]      [,9]     [,10]
row2 -0.8503823 -1.916336 -1.016128
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
          [,1]       [,2]      [,3]      [,4]      [,5]        [,6]       [,7]
row5 0.9416107 -0.4092195 0.3943216 0.3627283 0.4454367 -0.08805386 -0.2883189
          [,8]      [,9]     [,10]    [,11]      [,12]    [,13]      [,14]
row5 0.5563642 0.6133629 -1.353329 1.158283 -0.5299723 1.865184 -0.5193027
         [,15]    [,16]     [,17]      [,18]      [,19]      [,20]
row5 -1.613977 1.126153 -2.291988 -0.4287029 0.02606347 -0.9467049
> 
> 
> 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: 0x6000007400c0>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM7d7825244513"
 [2] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM7d787032f571"
 [3] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM7d7821900743"
 [4] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM7d7876ccd0eb"
 [5] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM7d78a8313c"  
 [6] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM7d7822385a7a"
 [7] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM7d7821bc1123"
 [8] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM7d7842092222"
 [9] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM7d7865a0080c"
[10] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM7d786d707ff3"
[11] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM7d7874e062a6"
[12] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM7d78376cbc3c"
[13] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM7d7843ba2391"
[14] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM7d7871752753"
[15] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM7d784268f456"
> 
> 
> ### 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: 0x6000007702a0>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x6000007702a0>
Warning message:
In dir.create(new.directory) :
  '/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x6000007702a0>
> rowMedians(tmp)
  [1] -0.256252105  0.564192834  0.069417360 -0.332541209 -0.622380010
  [6]  0.197695129 -0.365865235 -0.232828522 -0.171474455  0.144662094
 [11]  0.035355442  0.057515360  0.395992442 -0.265010199  0.156042807
 [16]  0.224791554  0.410151156  0.676946351 -0.374245748 -0.275501579
 [21] -0.194081930  0.073331390  0.312063386  0.790963219  0.498165281
 [26] -0.265479048 -0.095497738 -0.147996393 -0.118873876 -0.247214184
 [31]  0.628019355 -0.009417760 -0.188522061  0.244521879 -0.700978282
 [36] -0.097339547 -0.408708537 -0.143036625 -0.503126601  0.392106291
 [41]  0.043017240  0.032301270 -0.024142929  0.476044197 -0.403422423
 [46]  0.599974700  0.285049866  0.502520238  0.126036249  0.048126436
 [51]  0.242103917 -0.064287705 -0.159963210  0.402259085  0.110802458
 [56]  0.093775105  0.193781811 -0.306712421  0.228051581 -0.433851750
 [61]  0.654076151 -0.237355573 -0.159228641  0.001072640 -0.080529243
 [66]  0.531000919 -0.213050698  0.752943253 -0.124474563  0.179380768
 [71]  0.103948972 -0.277489112  0.036383492 -0.376674901 -0.159597386
 [76]  0.362772856 -0.416476639  0.705807984  0.306757347 -0.270274713
 [81] -0.217705821  0.650563732 -0.032833352  0.373053593 -0.033398283
 [86] -0.043247767  0.477225841  0.107826545  0.374746469  0.051122212
 [91]  0.080211848 -0.021695224  0.697646310 -0.027478769  0.065143608
 [96] -0.112931088  0.446247010  0.283904914 -0.394324121  0.087415106
[101] -0.292861357  0.387461090  0.152136641 -0.322271482  0.175719018
[106]  0.369986129  0.081692852 -0.213765617 -0.369855297 -0.417624580
[111]  0.039369729 -0.362809537 -0.036621824  0.214122068  0.219369829
[116]  0.042500532 -0.351279467  0.102562571 -0.093845579 -0.131721024
[121] -0.259281259  0.003977669 -0.112866489  0.270589706  0.086032429
[126] -0.169659666  0.362349553  0.276379041  0.269307589  0.066269184
[131]  0.238299676 -0.177185293 -0.714455598 -0.222860859  0.169748348
[136]  0.316174204  0.043373403  0.419380240 -0.085836360  0.045604948
[141]  0.112910238 -0.287650349  0.429273985 -0.237831318 -0.239438368
[146] -0.185392928  0.013436637 -0.528406936  0.121460984 -0.076640446
[151]  0.617813776  0.068201664 -0.295356729  0.222706464 -0.261142648
[156]  0.236360026 -0.201697195  0.159903733 -0.176869448 -0.701671142
[161]  0.299464755  0.412001698 -0.050022592  0.358711685  0.232012915
[166]  0.212493077 -0.385268596 -0.068957791  0.642747160  0.126693534
[171]  0.119045209 -0.133080834  0.069335768  0.344514166  0.612973474
[176]  0.256113024 -0.270786848  0.362196981 -0.085950289  0.525355334
[181]  0.475678744  0.194169756  0.320035194  0.198634829  0.379898018
[186]  0.021578100  0.232022374 -0.082181857 -0.127353054 -0.055531196
[191] -0.318088560  0.160548458 -0.054480896  0.101553534 -0.060252796
[196]  0.659141994  0.540719007 -0.522177375 -0.297326038  0.179929997
[201]  0.047049174 -0.128662094 -0.156386160  0.748115951  0.317764561
[206]  0.246345177  0.343972362  0.120076474 -0.124536678 -0.293827571
[211]  0.439794515 -0.314392827 -0.330340050 -0.158029166 -0.227548970
[216]  0.267885199 -0.081679999 -0.080611527 -0.077282350  0.089073137
[221]  0.533090003 -0.028285539 -0.171165356  0.143026781 -0.302968355
[226] -0.361749574 -0.421972420  0.105320271  0.294031399  0.157447828
> 
> proc.time()
   user  system elapsed 
  0.629   3.133   4.005 

BufferedMatrix.Rcheck/tests/rawCalltesting.Rout


R version 4.5.1 Patched (2025-09-10 r88807) -- "Great Square Root"
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: 0x600000424000>
> .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: 0x600000424000>
> .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: 0x600000424000>
> .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: 0x600000424000>
> 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: 0x6000004281e0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000004281e0>
> .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: 0x6000004281e0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000004281e0>
> .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: 0x6000004281e0>
> 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: 0x6000004283c0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000004283c0>
> .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: 0x6000004283c0>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x6000004283c0>
> .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: 0x6000004283c0>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x6000004283c0>
> .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: 0x6000004283c0>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x6000004283c0>
> .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: 0x6000004283c0>
> 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: 0x6000004285a0>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x6000004285a0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000004285a0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000004285a0>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile7fed31ed7dbd" "BufferedMatrixFile7fed5eda1ce6"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile7fed31ed7dbd" "BufferedMatrixFile7fed5eda1ce6"
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x600000428840>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600000428840>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x600000428840>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x600000428840>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x600000428840>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x600000428840>
> .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: 0x600000428a20>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600000428a20>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x600000428a20>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x600000428a20>
> 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: 0x600000428c00>
> .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: 0x600000428c00>
> rm(P)
> 
> proc.time()
   user  system elapsed 
  0.130   0.047   0.172 

BufferedMatrix.Rcheck/tests/Rcodetesting.Rout


R version 4.5.1 Patched (2025-09-10 r88807) -- "Great Square Root"
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.106   0.020   0.123 

Example timings