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

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

HostnameOSArch (*)R versionInstalled pkgs
nebbiolo1Linux (Ubuntu 24.04.4 LTS)x86_644.6.0 RC (2026-04-17 r89917) -- "Because it was There" 4686
kjohnson3macOS 13.7.7 Venturaarm644.6.0 alpha (2026-04-08 r89818) 4690
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 259/2404HostnameOS / ArchINSTALLBUILDCHECKBUILD BIN
BufferedMatrix 1.75.0  (landing page)
Ben Bolstad
Snapshot Date: 2026-04-20 13:40 -0400 (Mon, 20 Apr 2026)
git_url: https://git.bioconductor.org/packages/BufferedMatrix
git_branch: devel
git_last_commit: ecdbf23
git_last_commit_date: 2025-10-29 09:58:55 -0400 (Wed, 29 Oct 2025)
nebbiolo1Linux (Ubuntu 24.04.4 LTS) / x86_64  OK    OK    OK  UNNEEDED, same version is already published
kjohnson3macOS 13.7.7 Ventura / arm64  OK    OK    WARNINGS    OK  UNNEEDED, same version is already published
See other builds for BufferedMatrix in R Universe.


CHECK results for BufferedMatrix on kjohnson3

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

raw results


Summary

Package: BufferedMatrix
Version: 1.75.0
Command: /Library/Frameworks/R.framework/Resources/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/Library/Frameworks/R.framework/Resources/library --no-vignettes --timings BufferedMatrix_1.75.0.tar.gz
StartedAt: 2026-04-20 18:45:57 -0400 (Mon, 20 Apr 2026)
EndedAt: 2026-04-20 18:46:17 -0400 (Mon, 20 Apr 2026)
EllapsedTime: 20.3 seconds
RetCode: 0
Status:   WARNINGS  
CheckDir: BufferedMatrix.Rcheck
Warnings: 1

Command output

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


* using log directory ‘/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck’
* using R version 4.6.0 alpha (2026-04-08 r89818)
* using platform: aarch64-apple-darwin23
* R was compiled by
    Apple clang version 17.0.0 (clang-1700.3.19.1)
    GNU Fortran (GCC) 14.2.0
* running under: macOS Tahoe 26.3.1
* using session charset: UTF-8
* current time: 2026-04-20 22:45:57 UTC
* using option ‘--no-vignettes’
* checking for file ‘BufferedMatrix/DESCRIPTION’ ... OK
* this is package ‘BufferedMatrix’ version ‘1.75.0’
* checking package namespace information ... OK
* checking package dependencies ... OK
* checking if this is a source package ... OK
* checking if there is a namespace ... OK
* checking for hidden files and directories ... OK
* checking for portable file names ... OK
* checking for sufficient/correct file permissions ... OK
* checking whether package ‘BufferedMatrix’ can be installed ... WARNING
Found the following significant warnings:
  doubleBufferedMatrix.c:1580:7: warning: logical not is only applied to the left hand side of this bitwise operator [-Wlogical-not-parentheses]
See ‘/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/00install.out’ for details.
* used C compiler: ‘Apple clang version 17.0.0 (clang-1700.6.4.2)’
* used SDK: ‘MacOSX26.2.sdk’
* checking installed package size ... OK
* checking package directory ... OK
* checking ‘build’ directory ... OK
* checking DESCRIPTION meta-information ... OK
* checking top-level files ... OK
* checking for left-over files ... OK
* checking index information ... OK
* checking package subdirectories ... OK
* checking code files for non-ASCII characters ... OK
* checking R files for syntax errors ... OK
* checking whether the package can be loaded ... OK
* checking whether the package can be loaded with stated dependencies ... OK
* checking whether the package can be unloaded cleanly ... OK
* checking whether the namespace can be loaded with stated dependencies ... OK
* checking whether the namespace can be unloaded cleanly ... OK
* checking dependencies in R code ... OK
* checking S3 generic/method consistency ... OK
* checking replacement functions ... OK
* checking foreign function calls ... OK
* checking R code for possible problems ... OK
* checking Rd files ... NOTE
checkRd: (-1) BufferedMatrix-class.Rd:209: Lost braces; missing escapes or markup?
   209 |     $x^{power}$ elementwise of the matrix
       |        ^
prepare_Rd: createBufferedMatrix.Rd:26: Dropping empty section \keyword
prepare_Rd: createBufferedMatrix.Rd:17-18: Dropping empty section \details
prepare_Rd: createBufferedMatrix.Rd:15-16: Dropping empty section \value
prepare_Rd: createBufferedMatrix.Rd:19-20: Dropping empty section \references
prepare_Rd: createBufferedMatrix.Rd:21-22: Dropping empty section \seealso
prepare_Rd: createBufferedMatrix.Rd:23-24: Dropping empty section \examples
* checking Rd metadata ... OK
* checking Rd cross-references ... OK
* checking for missing documentation entries ... OK
* checking for code/documentation mismatches ... OK
* checking Rd \usage sections ... OK
* checking Rd contents ... OK
* checking for unstated dependencies in examples ... OK
* checking line endings in C/C++/Fortran sources/headers ... OK
* checking compiled code ... INFO
Note: information on .o files is not available
* checking sizes of PDF files under ‘inst/doc’ ... OK
* checking files in ‘vignettes’ ... OK
* checking examples ... NONE
* checking for unstated dependencies in ‘tests’ ... OK
* checking tests ...
  Running ‘Rcodetesting.R’
  Running ‘c_code_level_tests.R’
  Running ‘objectTesting.R’
  Running ‘rawCalltesting.R’
 OK
* checking for unstated dependencies in vignettes ... OK
* checking package vignettes ... OK
* checking running R code from vignettes ... SKIPPED
* checking re-building of vignette outputs ... SKIPPED
* checking PDF version of manual ... OK
* DONE

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


Installation output

BufferedMatrix.Rcheck/00install.out

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


* installing to library ‘/Library/Frameworks/R.framework/Versions/4.6/Resources/library’
* installing *source* package ‘BufferedMatrix’ ...
** this is package ‘BufferedMatrix’ version ‘1.75.0’
** using staged installation
** libs
using C compiler: ‘Apple clang version 17.0.0 (clang-1700.6.4.2)’
using SDK: ‘MacOSX26.2.sdk’
clang -arch arm64 -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 -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]
 1580 |   if (!(Matrix->readonly) & setting){
      |       ^                   ~
doubleBufferedMatrix.c:1580:7: note: add parentheses after the '!' to evaluate the bitwise operator first
 1580 |   if (!(Matrix->readonly) & setting){
      |       ^                            
      |        (                           )
doubleBufferedMatrix.c:1580:7: note: add parentheses around left hand side expression to silence this warning
 1580 |   if (!(Matrix->readonly) & setting){
      |       ^
      |       (                  )
doubleBufferedMatrix.c:3327:12: warning: unused function 'sort_double' [-Wunused-function]
 3327 | static int sort_double(const double *a1,const double *a2){
      |            ^~~~~~~~~~~
2 warnings generated.
clang -arch arm64 -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 -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 -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -L/Library/Frameworks/R.framework/Resources/lib -L/opt/R/arm64/lib -o BufferedMatrix.so RBufferedMatrix.o doubleBufferedMatrix.o doubleBufferedMatrix_C_tests.o init_package.o -F/Library/Frameworks/R.framework/.. -framework R
installing to /Library/Frameworks/R.framework/Versions/4.6/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.6.0 alpha (2026-04-08 r89818)
Copyright (C) 2026 The R Foundation for Statistical Computing
Platform: aarch64-apple-darwin23

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.134   0.050   0.183 

BufferedMatrix.Rcheck/tests/objectTesting.Rout


R version 4.6.0 alpha (2026-04-08 r89818)
Copyright (C) 2026 The R Foundation for Statistical Computing
Platform: aarch64-apple-darwin23

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

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

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

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

Attaching package: 'BufferedMatrix'

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

    colMeans, colSums, rowMeans, rowSums

> 
> 
> ### this is used to control how many repetitions in something below
> ### higher values result in more checks.
> nreps <-100 ##20000
> 
> 
> ## test creation and some simple assignments and subsetting operations
> 
> ## first on single elements
> tmp <- createBufferedMatrix(1000,10)
> 
> tmp[10,5]
[1] 0
> tmp[10,5] <- 10
> tmp[10,5]
[1] 10
> tmp[10,5] <- 12.445
> tmp[10,5]
[1] 12.445
> 
> 
> 
> ## now testing accessing multiple elements
> tmp2 <- createBufferedMatrix(10,20)
> 
> 
> tmp2[3,1] <- 51.34
> tmp2[9,2] <- 9.87654
> tmp2[,1:2]
       [,1]    [,2]
 [1,]  0.00 0.00000
 [2,]  0.00 0.00000
 [3,] 51.34 0.00000
 [4,]  0.00 0.00000
 [5,]  0.00 0.00000
 [6,]  0.00 0.00000
 [7,]  0.00 0.00000
 [8,]  0.00 0.00000
 [9,]  0.00 9.87654
[10,]  0.00 0.00000
> tmp2[,-(3:20)]
       [,1]    [,2]
 [1,]  0.00 0.00000
 [2,]  0.00 0.00000
 [3,] 51.34 0.00000
 [4,]  0.00 0.00000
 [5,]  0.00 0.00000
 [6,]  0.00 0.00000
 [7,]  0.00 0.00000
 [8,]  0.00 0.00000
 [9,]  0.00 9.87654
[10,]  0.00 0.00000
> tmp2[3,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
[1,] 51.34    0    0    0    0    0    0    0    0     0     0     0     0
     [,14] [,15] [,16] [,17] [,18] [,19] [,20]
[1,]     0     0     0     0     0     0     0
> tmp2[-3,]
      [,1]    [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [2,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [3,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [4,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [5,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [6,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [7,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [8,]    0 9.87654    0    0    0    0    0    0    0     0     0     0     0
 [9,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
      [,14] [,15] [,16] [,17] [,18] [,19] [,20]
 [1,]     0     0     0     0     0     0     0
 [2,]     0     0     0     0     0     0     0
 [3,]     0     0     0     0     0     0     0
 [4,]     0     0     0     0     0     0     0
 [5,]     0     0     0     0     0     0     0
 [6,]     0     0     0     0     0     0     0
 [7,]     0     0     0     0     0     0     0
 [8,]     0     0     0     0     0     0     0
 [9,]     0     0     0     0     0     0     0
> tmp2[2,1:3]
     [,1] [,2] [,3]
[1,]    0    0    0
> tmp2[3:9,1:3]
      [,1]    [,2] [,3]
[1,] 51.34 0.00000    0
[2,]  0.00 0.00000    0
[3,]  0.00 0.00000    0
[4,]  0.00 0.00000    0
[5,]  0.00 0.00000    0
[6,]  0.00 0.00000    0
[7,]  0.00 9.87654    0
> tmp2[-4,-4]
       [,1]    [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [2,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [3,] 51.34 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [4,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [5,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [6,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [7,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [8,]  0.00 9.87654    0    0    0    0    0    0    0     0     0     0     0
 [9,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
      [,14] [,15] [,16] [,17] [,18] [,19]
 [1,]     0     0     0     0     0     0
 [2,]     0     0     0     0     0     0
 [3,]     0     0     0     0     0     0
 [4,]     0     0     0     0     0     0
 [5,]     0     0     0     0     0     0
 [6,]     0     0     0     0     0     0
 [7,]     0     0     0     0     0     0
 [8,]     0     0     0     0     0     0
 [9,]     0     0     0     0     0     0
> 
> ## now testing accessing/assigning multiple elements
> tmp3 <- createBufferedMatrix(10,10)
> 
> for (i in 1:10){
+   for (j in 1:10){
+     tmp3[i,j] <- (j-1)*10 + i
+   }
+ }
> 
> tmp3[2:4,2:4]
     [,1] [,2] [,3]
[1,]   12   22   32
[2,]   13   23   33
[3,]   14   24   34
> tmp3[c(-10),c(2:4,2:4,10,1,2,1:10,10:1)]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]   11   21   31   11   21   31   91    1   11     1    11    21    31
 [2,]   12   22   32   12   22   32   92    2   12     2    12    22    32
 [3,]   13   23   33   13   23   33   93    3   13     3    13    23    33
 [4,]   14   24   34   14   24   34   94    4   14     4    14    24    34
 [5,]   15   25   35   15   25   35   95    5   15     5    15    25    35
 [6,]   16   26   36   16   26   36   96    6   16     6    16    26    36
 [7,]   17   27   37   17   27   37   97    7   17     7    17    27    37
 [8,]   18   28   38   18   28   38   98    8   18     8    18    28    38
 [9,]   19   29   39   19   29   39   99    9   19     9    19    29    39
      [,14] [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24] [,25]
 [1,]    41    51    61    71    81    91    91    81    71    61    51    41
 [2,]    42    52    62    72    82    92    92    82    72    62    52    42
 [3,]    43    53    63    73    83    93    93    83    73    63    53    43
 [4,]    44    54    64    74    84    94    94    84    74    64    54    44
 [5,]    45    55    65    75    85    95    95    85    75    65    55    45
 [6,]    46    56    66    76    86    96    96    86    76    66    56    46
 [7,]    47    57    67    77    87    97    97    87    77    67    57    47
 [8,]    48    58    68    78    88    98    98    88    78    68    58    48
 [9,]    49    59    69    79    89    99    99    89    79    69    59    49
      [,26] [,27] [,28] [,29]
 [1,]    31    21    11     1
 [2,]    32    22    12     2
 [3,]    33    23    13     3
 [4,]    34    24    14     4
 [5,]    35    25    15     5
 [6,]    36    26    16     6
 [7,]    37    27    17     7
 [8,]    38    28    18     8
 [9,]    39    29    19     9
> tmp3[-c(1:5),-c(6:10)]
     [,1] [,2] [,3] [,4] [,5]
[1,]    6   16   26   36   46
[2,]    7   17   27   37   47
[3,]    8   18   28   38   48
[4,]    9   19   29   39   49
[5,]   10   20   30   40   50
> 
> ## assignment of whole columns
> tmp3[,1] <- c(1:10*100.0)
> tmp3[,1:2] <- tmp3[,1:2]*100
> tmp3[,1:2] <- tmp3[,2:1]
> tmp3[,1:2]
      [,1]  [,2]
 [1,] 1100 1e+04
 [2,] 1200 2e+04
 [3,] 1300 3e+04
 [4,] 1400 4e+04
 [5,] 1500 5e+04
 [6,] 1600 6e+04
 [7,] 1700 7e+04
 [8,] 1800 8e+04
 [9,] 1900 9e+04
[10,] 2000 1e+05
> 
> 
> tmp3[,-1] <- tmp3[,1:9]
> tmp3[,1:10]
      [,1] [,2]  [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,] 1100 1100 1e+04   21   31   41   51   61   71    81
 [2,] 1200 1200 2e+04   22   32   42   52   62   72    82
 [3,] 1300 1300 3e+04   23   33   43   53   63   73    83
 [4,] 1400 1400 4e+04   24   34   44   54   64   74    84
 [5,] 1500 1500 5e+04   25   35   45   55   65   75    85
 [6,] 1600 1600 6e+04   26   36   46   56   66   76    86
 [7,] 1700 1700 7e+04   27   37   47   57   67   77    87
 [8,] 1800 1800 8e+04   28   38   48   58   68   78    88
 [9,] 1900 1900 9e+04   29   39   49   59   69   79    89
[10,] 2000 2000 1e+05   30   40   50   60   70   80    90
> 
> tmp3[,1:2] <- rep(1,10)
> tmp3[,1:2] <- rep(1,20)
> tmp3[,1:2] <- matrix(c(1:5),1,5)
> 
> tmp3[,-c(1:8)] <- matrix(c(1:5),1,5)
> 
> tmp3[1,] <- 1:10
> tmp3[1,]
     [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,]    1    2    3    4    5    6    7    8    9    10
> tmp3[-1,] <- c(1,2)
> tmp3[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    1    2    3    4    5    6    7    8    9    10
 [2,]    1    2    1    2    1    2    1    2    1     2
 [3,]    2    1    2    1    2    1    2    1    2     1
 [4,]    1    2    1    2    1    2    1    2    1     2
 [5,]    2    1    2    1    2    1    2    1    2     1
 [6,]    1    2    1    2    1    2    1    2    1     2
 [7,]    2    1    2    1    2    1    2    1    2     1
 [8,]    1    2    1    2    1    2    1    2    1     2
 [9,]    2    1    2    1    2    1    2    1    2     1
[10,]    1    2    1    2    1    2    1    2    1     2
> tmp3[-c(1:8),] <- matrix(c(1:5),1,5)
> tmp3[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    1    2    3    4    5    6    7    8    9    10
 [2,]    1    2    1    2    1    2    1    2    1     2
 [3,]    2    1    2    1    2    1    2    1    2     1
 [4,]    1    2    1    2    1    2    1    2    1     2
 [5,]    2    1    2    1    2    1    2    1    2     1
 [6,]    1    2    1    2    1    2    1    2    1     2
 [7,]    2    1    2    1    2    1    2    1    2     1
 [8,]    1    2    1    2    1    2    1    2    1     2
 [9,]    1    3    5    2    4    1    3    5    2     4
[10,]    2    4    1    3    5    2    4    1    3     5
> 
> 
> tmp3[1:2,1:2] <- 5555.04
> tmp3[-(1:2),1:2] <- 1234.56789
> 
> 
> 
> ## testing accessors for the directory and prefix
> directory(tmp3)
[1] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests"
> prefix(tmp3)
[1] "BM"
> 
> ## testing if we can remove these objects
> rm(tmp, tmp2, tmp3)
> gc()
         used (Mb) gc trigger (Mb) limit (Mb) max used (Mb)
Ncells 484141 25.9    1067251   57         NA   632017 33.8
Vcells 896965  6.9    8388608   64     196608  2112089 16.2
> 
> 
> 
> 
> ##
> ## checking reads
> ##
> 
> tmp2 <- createBufferedMatrix(10,20)
> 
> test.sample <- rnorm(10*20)
> 
> tmp2[1:10,1:20] <- test.sample
> 
> test.matrix <- matrix(test.sample,10,20)
> 
> ## testing reads
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   which.col <- sample(1:20,1)
+   if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> date()
[1] "Mon Apr 20 18:46:07 2026"
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> date()
[1] "Mon Apr 20 18:46:07 2026"
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,which.col] == test.matrix[which.row,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> 
> 
> RowMode(tmp2)
<pointer: 0x101862c60>
> 
> 
> 
> 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] "Mon Apr 20 18:46:09 2026"
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col <- sample(1:20,5,replace=TRUE)
+   if (!all(tmp2[which.row,which.col] == test.matrix[which.row,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> date()
[1] "Mon Apr 20 18:46:09 2026"
> 
> ColMode(tmp2)
<pointer: 0x101862c60>
> 
> 
> 
> ### Now testing assignments
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+ 
+   new.data <- rnorm(20)
+   tmp2[which.row,] <- new.data
+   test.matrix[which.row,] <- new.data
+   if (rep > 1){
+     if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+   
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   new.data <- rnorm(10)
+   tmp2[,which.col] <- new.data
+   test.matrix[,which.col]<- new.data
+ 
+   if (rep > 1){
+     if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.col <- which.col
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,5,replace=TRUE)
+   new.data <- matrix(rnorm(50),5,10)
+   tmp2[,which.col] <- new.data
+   test.matrix[,which.col]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.col <- which.col
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   new.data <- matrix(rnorm(50),5,10)
+   tmp2[which.row,] <- new.data
+   test.matrix[which.row,]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col  <- sample(1:20,5,replace=TRUE)
+   new.data <- matrix(rnorm(25),5,5)
+   tmp2[which.row,which.col] <- new.data
+   test.matrix[which.row,which.col]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[prev.row,prev.col] == test.matrix[prev.row,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+   prev.col <- which.col
+ }
> 
> 
> 
> 
> ###
> ###
> ### testing some more functions
> ###
> 
> 
> 
> ## duplication function
> tmp5 <- duplicate(tmp2)
> 
> # making sure really did copy everything.
> tmp5[1,1] <- tmp5[1,1] +100.00
> 
> if (tmp5[1,1] == tmp2[1,1]){
+   stop("Problem with duplication")
+ }
> 
> 
> 
> 
> ### testing elementwise applying of functions
> 
> tmp5[1:4,1:4]
            [,1]        [,2]        [,3]      [,4]
[1,] 99.40131670 -1.92806747 -1.38095217 1.2359784
[2,] -0.01851318  1.37879798  0.50214366 0.2132982
[3,]  0.71571227  0.95835380 -0.06153029 0.3307544
[4,]  0.75456999 -0.02680212  0.34844374 1.0581834
> ewApply(tmp5,abs)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
            [,1]       [,2]       [,3]      [,4]
[1,] 99.40131670 1.92806747 1.38095217 1.2359784
[2,]  0.01851318 1.37879798 0.50214366 0.2132982
[3,]  0.71571227 0.95835380 0.06153029 0.3307544
[4,]  0.75456999 0.02680212 0.34844374 1.0581834
> ewApply(tmp5,sqrt)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
          [,1]      [,2]      [,3]      [,4]
[1,] 9.9700209 1.3885487 1.1751392 1.1117457
[2,] 0.1360631 1.1742223 0.7086210 0.4618422
[3,] 0.8459978 0.9789555 0.2480530 0.5751125
[4,] 0.8686599 0.1637135 0.5902912 1.0286804
> 
> my.function <- function(x,power){
+   (x+5)^power
+ }
> 
> ewApply(tmp5,my.function,power=2)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
          [,1]     [,2]     [,3]     [,4]
[1,] 224.10153 40.81355 38.13234 37.35344
[2,]  26.37914 38.12102 32.58835 29.83172
[3,]  34.17569 35.74791 27.54206 31.08188
[4,]  34.44117 26.66394 31.25136 36.34499
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x101862cc0>
> exp(tmp5)
<pointer: 0x101862cc0>
> log(tmp5,2)
<pointer: 0x101862cc0>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 466.438
> Min(tmp5)
[1] 52.94894
> mean(tmp5)
[1] 72.70376
> Sum(tmp5)
[1] 14540.75
> Var(tmp5)
[1] 868.3837
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 94.49966 68.69212 68.68378 71.13911 67.77146 72.05181 72.93544 70.65886
 [9] 69.17238 71.43299
> rowSums(tmp5)
 [1] 1889.993 1373.842 1373.676 1422.782 1355.429 1441.036 1458.709 1413.177
 [9] 1383.448 1428.660
> rowVars(tmp5)
 [1] 7766.34535   91.10387   50.05594  121.09720   78.13517   89.28027
 [7]   70.19803   69.98307   90.65865   86.38591
> rowSd(tmp5)
 [1] 88.126871  9.544835  7.075023 11.004417  8.839410  9.448824  8.378426
 [8]  8.365589  9.521484  9.294402
> rowMax(tmp5)
 [1] 466.43796  85.57735  78.94470  96.91418  81.75193  99.42858  93.76601
 [8]  85.10277  88.46361  88.00903
> rowMin(tmp5)
 [1] 58.18790 54.90473 57.32519 55.49749 52.94894 56.93091 59.45125 57.48909
 [9] 55.19930 55.57791
> 
> colMeans(tmp5)
 [1] 113.27932  69.58121  67.50882  67.78076  73.06831  69.14700  76.25653
 [8]  70.58782  76.70814  71.37198  68.15060  71.84526  71.94903  66.98503
[15]  69.04751  68.82933  66.91401  71.57719  71.71016  71.77723
> colSums(tmp5)
 [1] 1132.7932  695.8121  675.0882  677.8076  730.6831  691.4700  762.5653
 [8]  705.8782  767.0814  713.7198  681.5060  718.4526  719.4903  669.8503
[15]  690.4751  688.2933  669.1401  715.7719  717.1016  717.7723
> colVars(tmp5)
 [1] 15566.52685   126.17505    95.06414    81.92061    86.10391    65.55925
 [7]    29.26816    58.70800   136.85533    52.77234    55.28032   122.64072
[13]    48.85550    81.50684    78.63664   135.27329    45.64763   112.79604
[19]    76.87804    61.35066
> colSd(tmp5)
 [1] 124.765888  11.232767   9.750084   9.051001   9.279219   8.096867
 [7]   5.410005   7.662115  11.698518   7.264457   7.435073  11.074327
[13]   6.989671   9.028114   8.867730  11.630704   6.756303  10.620548
[19]   8.768012   7.832666
> colMax(tmp5)
 [1] 466.43796  84.94807  79.48792  81.59960  86.23022  79.76943  83.26603
 [8]  77.35706  93.76601  82.32240  80.56827  96.91418  85.10277  80.79183
[15]  88.39931  86.28522  79.48160  93.15564  88.00903  83.46948
> colMin(tmp5)
 [1] 54.90473 55.49749 52.94894 55.93254 61.75463 56.66092 68.99743 58.91131
 [9] 57.53999 62.41169 55.69223 57.72909 60.64887 56.31275 58.09127 55.19930
[17] 58.18790 58.15569 60.57634 58.47000
> 
> 
> ### 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] 94.49966 68.69212 68.68378 71.13911       NA 72.05181 72.93544 70.65886
 [9] 69.17238 71.43299
> rowSums(tmp5)
 [1] 1889.993 1373.842 1373.676 1422.782       NA 1441.036 1458.709 1413.177
 [9] 1383.448 1428.660
> rowVars(tmp5)
 [1] 7766.34535   91.10387   50.05594  121.09720   76.13339   89.28027
 [7]   70.19803   69.98307   90.65865   86.38591
> rowSd(tmp5)
 [1] 88.126871  9.544835  7.075023 11.004417  8.725445  9.448824  8.378426
 [8]  8.365589  9.521484  9.294402
> rowMax(tmp5)
 [1] 466.43796  85.57735  78.94470  96.91418        NA  99.42858  93.76601
 [8]  85.10277  88.46361  88.00903
> rowMin(tmp5)
 [1] 58.18790 54.90473 57.32519 55.49749       NA 56.93091 59.45125 57.48909
 [9] 55.19930 55.57791
> 
> colMeans(tmp5)
 [1]       NA 69.58121 67.50882 67.78076 73.06831 69.14700 76.25653 70.58782
 [9] 76.70814 71.37198 68.15060 71.84526 71.94903 66.98503 69.04751 68.82933
[17] 66.91401 71.57719 71.71016 71.77723
> colSums(tmp5)
 [1]       NA 695.8121 675.0882 677.8076 730.6831 691.4700 762.5653 705.8782
 [9] 767.0814 713.7198 681.5060 718.4526 719.4903 669.8503 690.4751 688.2933
[17] 669.1401 715.7719 717.1016 717.7723
> colVars(tmp5)
 [1]        NA 126.17505  95.06414  81.92061  86.10391  65.55925  29.26816
 [8]  58.70800 136.85533  52.77234  55.28032 122.64072  48.85550  81.50684
[15]  78.63664 135.27329  45.64763 112.79604  76.87804  61.35066
> colSd(tmp5)
 [1]        NA 11.232767  9.750084  9.051001  9.279219  8.096867  5.410005
 [8]  7.662115 11.698518  7.264457  7.435073 11.074327  6.989671  9.028114
[15]  8.867730 11.630704  6.756303 10.620548  8.768012  7.832666
> colMax(tmp5)
 [1]       NA 84.94807 79.48792 81.59960 86.23022 79.76943 83.26603 77.35706
 [9] 93.76601 82.32240 80.56827 96.91418 85.10277 80.79183 88.39931 86.28522
[17] 79.48160 93.15564 88.00903 83.46948
> colMin(tmp5)
 [1]       NA 55.49749 52.94894 55.93254 61.75463 56.66092 68.99743 58.91131
 [9] 57.53999 62.41169 55.69223 57.72909 60.64887 56.31275 58.09127 55.19930
[17] 58.18790 58.15569 60.57634 58.47000
> 
> Max(tmp5,na.rm=TRUE)
[1] 466.438
> Min(tmp5,na.rm=TRUE)
[1] 52.94894
> mean(tmp5,na.rm=TRUE)
[1] 72.78088
> Sum(tmp5,na.rm=TRUE)
[1] 14483.4
> Var(tmp5,na.rm=TRUE)
[1] 871.574
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 94.49966 68.69212 68.68378 71.13911 68.31958 72.05181 72.93544 70.65886
 [9] 69.17238 71.43299
> rowSums(tmp5,na.rm=TRUE)
 [1] 1889.993 1373.842 1373.676 1422.782 1298.072 1441.036 1458.709 1413.177
 [9] 1383.448 1428.660
> rowVars(tmp5,na.rm=TRUE)
 [1] 7766.34535   91.10387   50.05594  121.09720   76.13339   89.28027
 [7]   70.19803   69.98307   90.65865   86.38591
> rowSd(tmp5,na.rm=TRUE)
 [1] 88.126871  9.544835  7.075023 11.004417  8.725445  9.448824  8.378426
 [8]  8.365589  9.521484  9.294402
> rowMax(tmp5,na.rm=TRUE)
 [1] 466.43796  85.57735  78.94470  96.91418  81.75193  99.42858  93.76601
 [8]  85.10277  88.46361  88.00903
> rowMin(tmp5,na.rm=TRUE)
 [1] 58.18790 54.90473 57.32519 55.49749 52.94894 56.93091 59.45125 57.48909
 [9] 55.19930 55.57791
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 119.49289  69.58121  67.50882  67.78076  73.06831  69.14700  76.25653
 [8]  70.58782  76.70814  71.37198  68.15060  71.84526  71.94903  66.98503
[15]  69.04751  68.82933  66.91401  71.57719  71.71016  71.77723
> colSums(tmp5,na.rm=TRUE)
 [1] 1075.4360  695.8121  675.0882  677.8076  730.6831  691.4700  762.5653
 [8]  705.8782  767.0814  713.7198  681.5060  718.4526  719.4903  669.8503
[15]  690.4751  688.2933  669.1401  715.7719  717.1016  717.7723
> colVars(tmp5,na.rm=TRUE)
 [1] 17077.99645   126.17505    95.06414    81.92061    86.10391    65.55925
 [7]    29.26816    58.70800   136.85533    52.77234    55.28032   122.64072
[13]    48.85550    81.50684    78.63664   135.27329    45.64763   112.79604
[19]    76.87804    61.35066
> colSd(tmp5,na.rm=TRUE)
 [1] 130.682809  11.232767   9.750084   9.051001   9.279219   8.096867
 [7]   5.410005   7.662115  11.698518   7.264457   7.435073  11.074327
[13]   6.989671   9.028114   8.867730  11.630704   6.756303  10.620548
[19]   8.768012   7.832666
> colMax(tmp5,na.rm=TRUE)
 [1] 466.43796  84.94807  79.48792  81.59960  86.23022  79.76943  83.26603
 [8]  77.35706  93.76601  82.32240  80.56827  96.91418  85.10277  80.79183
[15]  88.39931  86.28522  79.48160  93.15564  88.00903  83.46948
> colMin(tmp5,na.rm=TRUE)
 [1] 54.90473 55.49749 52.94894 55.93254 61.75463 56.66092 68.99743 58.91131
 [9] 57.53999 62.41169 55.69223 57.72909 60.64887 56.31275 58.09127 55.19930
[17] 58.18790 58.15569 60.57634 58.47000
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1] 94.49966 68.69212 68.68378 71.13911      NaN 72.05181 72.93544 70.65886
 [9] 69.17238 71.43299
> rowSums(tmp5,na.rm=TRUE)
 [1] 1889.993 1373.842 1373.676 1422.782    0.000 1441.036 1458.709 1413.177
 [9] 1383.448 1428.660
> rowVars(tmp5,na.rm=TRUE)
 [1] 7766.34535   91.10387   50.05594  121.09720         NA   89.28027
 [7]   70.19803   69.98307   90.65865   86.38591
> rowSd(tmp5,na.rm=TRUE)
 [1] 88.126871  9.544835  7.075023 11.004417        NA  9.448824  8.378426
 [8]  8.365589  9.521484  9.294402
> rowMax(tmp5,na.rm=TRUE)
 [1] 466.43796  85.57735  78.94470  96.91418        NA  99.42858  93.76601
 [8]  85.10277  88.46361  88.00903
> rowMin(tmp5,na.rm=TRUE)
 [1] 58.18790 54.90473 57.32519 55.49749       NA 56.93091 59.45125 57.48909
 [9] 55.19930 55.57791
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1]      NaN 70.06293 69.12659 66.24533 72.10347 68.09813 77.06310 71.88521
 [9] 78.09085 71.16593 67.35530 73.41372 72.18506 68.17084 68.58091 68.74984
[17] 67.51934 71.55734 71.11519 73.05393
> colSums(tmp5,na.rm=TRUE)
 [1]   0.0000 630.5664 622.1393 596.2080 648.9312 612.8832 693.5679 646.9669
 [9] 702.8177 640.4934 606.1977 660.7235 649.6656 613.5376 617.2282 618.7485
[17] 607.6740 644.0161 640.0367 657.4853
> colVars(tmp5,na.rm=TRUE)
 [1]        NA 139.33626  77.50409  65.63841  86.39395  61.37773  25.60800
 [8]  47.11028 132.45334  58.89122  55.07479 110.29496  54.33570  75.87608
[15]  86.01693 152.11136  47.23133 126.89112  82.50547  50.68263
> colSd(tmp5,na.rm=TRUE)
 [1]        NA 11.804078  8.803641  8.101754  9.294835  7.834394  5.060434
 [8]  6.863693 11.508837  7.674062  7.421239 10.502141  7.371276  8.710688
[15]  9.274531 12.333343  6.872505 11.264596  9.083252  7.119173
> colMax(tmp5,na.rm=TRUE)
 [1]     -Inf 84.94807 79.48792 77.74628 86.23022 79.76943 83.26603 77.35706
 [9] 93.76601 82.32240 80.56827 96.91418 85.10277 80.79183 88.39931 86.28522
[17] 79.48160 93.15564 88.00903 83.46948
> colMin(tmp5,na.rm=TRUE)
 [1]      Inf 55.49749 57.32519 55.93254 61.75463 56.66092 69.78080 60.54049
 [9] 57.53999 62.41169 55.69223 63.81828 60.64887 56.68909 58.09127 55.19930
[17] 58.18790 58.15569 60.57634 58.47000
> 
> 
> 
> 
> 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] 205.4318 170.0463 186.9685 168.5681 167.3732 173.6664 208.3987 170.6562
 [9] 173.8518 241.1269
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 205.4318 170.0463 186.9685 168.5681 167.3732 173.6664 208.3987 170.6562
 [9] 173.8518 241.1269
> 
> 
> 
> copymatrix <- matrix(rnorm(200,150,15),10,20)
> 
> tmp5[1:10,1:20] <- copymatrix
> which.row <- 1
> which.col  <- 3
> cat(which.row," ",which.col,"\n")
1   3 
> tmp5[which.row,which.col] <- NA
> copymatrix[which.row,which.col] <- NA
> 
> colVars(tmp5,na.rm=TRUE)-apply(copymatrix,2,var,na.rm=TRUE)
 [1]  0.000000e+00 -5.684342e-14 -2.273737e-13  0.000000e+00 -5.684342e-14
 [6]  5.684342e-14 -2.273737e-13 -5.684342e-14  0.000000e+00 -1.705303e-13
[11]  2.557954e-13 -5.684342e-14 -4.263256e-14  5.684342e-14  0.000000e+00
[16] -1.421085e-13  0.000000e+00  1.705303e-13 -5.684342e-14  2.273737e-13
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> ## making sure these things agree
> ##
> ## first when there is no NA
> 
> 
> 
> agree.checks <- function(buff.matrix,r.matrix,err.tol=1e-10){
+ 
+   if (Max(buff.matrix,na.rm=TRUE) != max(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Max")
+   }
+   
+ 
+   if (Min(buff.matrix,na.rm=TRUE) != min(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Min")
+   }
+ 
+ 
+   if (abs(Sum(buff.matrix,na.rm=TRUE)- sum(r.matrix,na.rm=TRUE)) > err.tol){
+ 
+     cat(Sum(buff.matrix,na.rm=TRUE),"\n")
+     cat(sum(r.matrix,na.rm=TRUE),"\n")
+     cat(Sum(buff.matrix,na.rm=TRUE) - sum(r.matrix,na.rm=TRUE),"\n")
+     
+     stop("No agreement in Sum")
+   }
+   
+   if (abs(mean(buff.matrix,na.rm=TRUE) - mean(r.matrix,na.rm=TRUE)) > err.tol){
+     stop("No agreement in mean")
+   }
+   
+   
+   if(abs(Var(buff.matrix,na.rm=TRUE) - var(as.vector(r.matrix),na.rm=TRUE)) > err.tol){
+     stop("No agreement in Var")
+   }
+   
+   
+ 
+   if(any(abs(rowMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,mean,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowMeans")
+   }
+   
+   
+   if(any(abs(colMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,mean,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colMeans")
+   }
+   
+   
+   if(any(abs(rowSums(buff.matrix,na.rm=TRUE)  -  apply(r.matrix,1,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in rowSums")
+   }
+   
+   
+   if(any(abs(colSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colSums")
+   }
+   
+   ### this is to get around the fact that R doesn't like to compute NA on an entire vector of NA when 
+   ### computing variance
+   my.Var <- function(x,na.rm=FALSE){
+    if (all(is.na(x))){
+      return(NA)
+    } else {
+      var(x,na.rm=na.rm)
+    }
+ 
+   }
+   
+   if(any(abs(rowVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+   
+   
+   if(any(abs(colVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+ 
+ 
+   if(any(abs(rowMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+ 
+   if(any(abs(colMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+   
+   
+   if(any(abs(rowMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+   
+ 
+   if(any(abs(colMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+ 
+   if(any(abs(colMedians(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,median,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMedian")
+   }
+ 
+   if(any(abs(colRanges(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,range,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colRanges")
+   }
+ 
+ 
+   
+ }
> 
> 
> 
> 
> 
> 
> 
> 
> 
> for (rep in 1:20){
+   copymatrix <- matrix(rnorm(200,150,15),10,20)
+   
+   tmp5[1:10,1:20] <- copymatrix
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ## now lets assign some NA values and check agreement
+ 
+   which.row <- sample(1:10,1,replace=TRUE)
+   which.col  <- sample(1:20,1,replace=TRUE)
+   
+   cat(which.row," ",which.col,"\n")
+   
+   tmp5[which.row,which.col] <- NA
+   copymatrix[which.row,which.col] <- NA
+   
+   agree.checks(tmp5,copymatrix)
+ 
+   ## make an entire row NA
+   tmp5[which.row,] <- NA
+   copymatrix[which.row,] <- NA
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ### also make an entire col NA
+   tmp5[,which.col] <- NA
+   copymatrix[,which.col] <- NA
+ 
+   agree.checks(tmp5,copymatrix)
+ 
+   ### now make 1 element non NA with NA in the rest of row and column
+ 
+   tmp5[which.row,which.col] <- rnorm(1,150,15)
+   copymatrix[which.row,which.col] <- tmp5[which.row,which.col]
+ 
+   agree.checks(tmp5,copymatrix)
+ }
4   9 
6   15 
1   3 
7   4 
1   7 
8   18 
6   4 
1   12 
4   19 
4   4 
1   3 
10   19 
2   6 
3   5 
7   9 
2   14 
1   10 
6   18 
9   5 
5   4 
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.555424
> Min(tmp)
[1] -2.494584
> mean(tmp)
[1] -0.1120665
> Sum(tmp)
[1] -11.20665
> Var(tmp)
[1] 1.062901
> 
> rowMeans(tmp)
[1] -0.1120665
> rowSums(tmp)
[1] -11.20665
> rowVars(tmp)
[1] 1.062901
> rowSd(tmp)
[1] 1.030971
> rowMax(tmp)
[1] 2.555424
> rowMin(tmp)
[1] -2.494584
> 
> colMeans(tmp)
  [1] -0.74307038  0.20496174 -0.30815850  0.03624862  0.98055621 -0.01192056
  [7]  0.70549253  1.60652940  0.48773059  1.58775273  0.52317343  1.16210809
 [13]  2.13229589  0.74466274 -0.89685292 -1.08838628  0.67916961 -1.93178250
 [19] -1.30274982  2.55542411 -0.32640614 -0.37945764 -1.09783814  0.05292835
 [25]  1.25657104 -1.03082171  0.92493032 -0.35515023  0.61160225 -1.10400322
 [31]  1.43187901 -0.71421676  0.42269545  0.54964309 -1.31833415 -0.49822472
 [37] -2.49458408  0.75589568 -1.00831448 -1.08039467  0.01898980  1.84113291
 [43] -0.20184883  0.20193370 -0.76502221 -1.45095682 -1.79711928  0.16619227
 [49] -0.57596374  1.49862867 -1.00327806  0.03660008 -2.16201648 -1.10679389
 [55] -1.62023088 -1.61050007 -0.29322136 -1.16921931 -1.02198135  0.11360318
 [61]  0.20354704  1.23749670  0.46942175 -0.31217496  0.10711183  1.20957532
 [67]  0.15481515  0.75904890  0.45849915  0.31797478  0.79957502 -1.16701059
 [73] -1.26096942 -1.97131246 -0.37414199  1.14434391  0.63001213 -1.05259257
 [79] -1.27796781 -0.32158348 -0.32478878 -0.83368109 -1.00178013  1.42245408
 [85] -0.39591236  0.81114446  0.90323971  0.15232298  0.16002725  0.40602060
 [91] -0.85244068 -0.04584311 -1.33010892  0.25094402  0.61018414 -1.24997069
 [97]  0.62697824 -1.81012372  0.40162661  0.31887628
> colSums(tmp)
  [1] -0.74307038  0.20496174 -0.30815850  0.03624862  0.98055621 -0.01192056
  [7]  0.70549253  1.60652940  0.48773059  1.58775273  0.52317343  1.16210809
 [13]  2.13229589  0.74466274 -0.89685292 -1.08838628  0.67916961 -1.93178250
 [19] -1.30274982  2.55542411 -0.32640614 -0.37945764 -1.09783814  0.05292835
 [25]  1.25657104 -1.03082171  0.92493032 -0.35515023  0.61160225 -1.10400322
 [31]  1.43187901 -0.71421676  0.42269545  0.54964309 -1.31833415 -0.49822472
 [37] -2.49458408  0.75589568 -1.00831448 -1.08039467  0.01898980  1.84113291
 [43] -0.20184883  0.20193370 -0.76502221 -1.45095682 -1.79711928  0.16619227
 [49] -0.57596374  1.49862867 -1.00327806  0.03660008 -2.16201648 -1.10679389
 [55] -1.62023088 -1.61050007 -0.29322136 -1.16921931 -1.02198135  0.11360318
 [61]  0.20354704  1.23749670  0.46942175 -0.31217496  0.10711183  1.20957532
 [67]  0.15481515  0.75904890  0.45849915  0.31797478  0.79957502 -1.16701059
 [73] -1.26096942 -1.97131246 -0.37414199  1.14434391  0.63001213 -1.05259257
 [79] -1.27796781 -0.32158348 -0.32478878 -0.83368109 -1.00178013  1.42245408
 [85] -0.39591236  0.81114446  0.90323971  0.15232298  0.16002725  0.40602060
 [91] -0.85244068 -0.04584311 -1.33010892  0.25094402  0.61018414 -1.24997069
 [97]  0.62697824 -1.81012372  0.40162661  0.31887628
> 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.74307038  0.20496174 -0.30815850  0.03624862  0.98055621 -0.01192056
  [7]  0.70549253  1.60652940  0.48773059  1.58775273  0.52317343  1.16210809
 [13]  2.13229589  0.74466274 -0.89685292 -1.08838628  0.67916961 -1.93178250
 [19] -1.30274982  2.55542411 -0.32640614 -0.37945764 -1.09783814  0.05292835
 [25]  1.25657104 -1.03082171  0.92493032 -0.35515023  0.61160225 -1.10400322
 [31]  1.43187901 -0.71421676  0.42269545  0.54964309 -1.31833415 -0.49822472
 [37] -2.49458408  0.75589568 -1.00831448 -1.08039467  0.01898980  1.84113291
 [43] -0.20184883  0.20193370 -0.76502221 -1.45095682 -1.79711928  0.16619227
 [49] -0.57596374  1.49862867 -1.00327806  0.03660008 -2.16201648 -1.10679389
 [55] -1.62023088 -1.61050007 -0.29322136 -1.16921931 -1.02198135  0.11360318
 [61]  0.20354704  1.23749670  0.46942175 -0.31217496  0.10711183  1.20957532
 [67]  0.15481515  0.75904890  0.45849915  0.31797478  0.79957502 -1.16701059
 [73] -1.26096942 -1.97131246 -0.37414199  1.14434391  0.63001213 -1.05259257
 [79] -1.27796781 -0.32158348 -0.32478878 -0.83368109 -1.00178013  1.42245408
 [85] -0.39591236  0.81114446  0.90323971  0.15232298  0.16002725  0.40602060
 [91] -0.85244068 -0.04584311 -1.33010892  0.25094402  0.61018414 -1.24997069
 [97]  0.62697824 -1.81012372  0.40162661  0.31887628
> colMin(tmp)
  [1] -0.74307038  0.20496174 -0.30815850  0.03624862  0.98055621 -0.01192056
  [7]  0.70549253  1.60652940  0.48773059  1.58775273  0.52317343  1.16210809
 [13]  2.13229589  0.74466274 -0.89685292 -1.08838628  0.67916961 -1.93178250
 [19] -1.30274982  2.55542411 -0.32640614 -0.37945764 -1.09783814  0.05292835
 [25]  1.25657104 -1.03082171  0.92493032 -0.35515023  0.61160225 -1.10400322
 [31]  1.43187901 -0.71421676  0.42269545  0.54964309 -1.31833415 -0.49822472
 [37] -2.49458408  0.75589568 -1.00831448 -1.08039467  0.01898980  1.84113291
 [43] -0.20184883  0.20193370 -0.76502221 -1.45095682 -1.79711928  0.16619227
 [49] -0.57596374  1.49862867 -1.00327806  0.03660008 -2.16201648 -1.10679389
 [55] -1.62023088 -1.61050007 -0.29322136 -1.16921931 -1.02198135  0.11360318
 [61]  0.20354704  1.23749670  0.46942175 -0.31217496  0.10711183  1.20957532
 [67]  0.15481515  0.75904890  0.45849915  0.31797478  0.79957502 -1.16701059
 [73] -1.26096942 -1.97131246 -0.37414199  1.14434391  0.63001213 -1.05259257
 [79] -1.27796781 -0.32158348 -0.32478878 -0.83368109 -1.00178013  1.42245408
 [85] -0.39591236  0.81114446  0.90323971  0.15232298  0.16002725  0.40602060
 [91] -0.85244068 -0.04584311 -1.33010892  0.25094402  0.61018414 -1.24997069
 [97]  0.62697824 -1.81012372  0.40162661  0.31887628
> colMedians(tmp)
  [1] -0.74307038  0.20496174 -0.30815850  0.03624862  0.98055621 -0.01192056
  [7]  0.70549253  1.60652940  0.48773059  1.58775273  0.52317343  1.16210809
 [13]  2.13229589  0.74466274 -0.89685292 -1.08838628  0.67916961 -1.93178250
 [19] -1.30274982  2.55542411 -0.32640614 -0.37945764 -1.09783814  0.05292835
 [25]  1.25657104 -1.03082171  0.92493032 -0.35515023  0.61160225 -1.10400322
 [31]  1.43187901 -0.71421676  0.42269545  0.54964309 -1.31833415 -0.49822472
 [37] -2.49458408  0.75589568 -1.00831448 -1.08039467  0.01898980  1.84113291
 [43] -0.20184883  0.20193370 -0.76502221 -1.45095682 -1.79711928  0.16619227
 [49] -0.57596374  1.49862867 -1.00327806  0.03660008 -2.16201648 -1.10679389
 [55] -1.62023088 -1.61050007 -0.29322136 -1.16921931 -1.02198135  0.11360318
 [61]  0.20354704  1.23749670  0.46942175 -0.31217496  0.10711183  1.20957532
 [67]  0.15481515  0.75904890  0.45849915  0.31797478  0.79957502 -1.16701059
 [73] -1.26096942 -1.97131246 -0.37414199  1.14434391  0.63001213 -1.05259257
 [79] -1.27796781 -0.32158348 -0.32478878 -0.83368109 -1.00178013  1.42245408
 [85] -0.39591236  0.81114446  0.90323971  0.15232298  0.16002725  0.40602060
 [91] -0.85244068 -0.04584311 -1.33010892  0.25094402  0.61018414 -1.24997069
 [97]  0.62697824 -1.81012372  0.40162661  0.31887628
> colRanges(tmp)
           [,1]      [,2]       [,3]       [,4]      [,5]        [,6]      [,7]
[1,] -0.7430704 0.2049617 -0.3081585 0.03624862 0.9805562 -0.01192056 0.7054925
[2,] -0.7430704 0.2049617 -0.3081585 0.03624862 0.9805562 -0.01192056 0.7054925
         [,8]      [,9]    [,10]     [,11]    [,12]    [,13]     [,14]
[1,] 1.606529 0.4877306 1.587753 0.5231734 1.162108 2.132296 0.7446627
[2,] 1.606529 0.4877306 1.587753 0.5231734 1.162108 2.132296 0.7446627
          [,15]     [,16]     [,17]     [,18]    [,19]    [,20]      [,21]
[1,] -0.8968529 -1.088386 0.6791696 -1.931783 -1.30275 2.555424 -0.3264061
[2,] -0.8968529 -1.088386 0.6791696 -1.931783 -1.30275 2.555424 -0.3264061
          [,22]     [,23]      [,24]    [,25]     [,26]     [,27]      [,28]
[1,] -0.3794576 -1.097838 0.05292835 1.256571 -1.030822 0.9249303 -0.3551502
[2,] -0.3794576 -1.097838 0.05292835 1.256571 -1.030822 0.9249303 -0.3551502
         [,29]     [,30]    [,31]      [,32]     [,33]     [,34]     [,35]
[1,] 0.6116022 -1.104003 1.431879 -0.7142168 0.4226955 0.5496431 -1.318334
[2,] 0.6116022 -1.104003 1.431879 -0.7142168 0.4226955 0.5496431 -1.318334
          [,36]     [,37]     [,38]     [,39]     [,40]     [,41]    [,42]
[1,] -0.4982247 -2.494584 0.7558957 -1.008314 -1.080395 0.0189898 1.841133
[2,] -0.4982247 -2.494584 0.7558957 -1.008314 -1.080395 0.0189898 1.841133
          [,43]     [,44]      [,45]     [,46]     [,47]     [,48]      [,49]
[1,] -0.2018488 0.2019337 -0.7650222 -1.450957 -1.797119 0.1661923 -0.5759637
[2,] -0.2018488 0.2019337 -0.7650222 -1.450957 -1.797119 0.1661923 -0.5759637
        [,50]     [,51]      [,52]     [,53]     [,54]     [,55]   [,56]
[1,] 1.498629 -1.003278 0.03660008 -2.162016 -1.106794 -1.620231 -1.6105
[2,] 1.498629 -1.003278 0.03660008 -2.162016 -1.106794 -1.620231 -1.6105
          [,57]     [,58]     [,59]     [,60]    [,61]    [,62]     [,63]
[1,] -0.2932214 -1.169219 -1.021981 0.1136032 0.203547 1.237497 0.4694218
[2,] -0.2932214 -1.169219 -1.021981 0.1136032 0.203547 1.237497 0.4694218
         [,64]     [,65]    [,66]     [,67]     [,68]     [,69]     [,70]
[1,] -0.312175 0.1071118 1.209575 0.1548151 0.7590489 0.4584991 0.3179748
[2,] -0.312175 0.1071118 1.209575 0.1548151 0.7590489 0.4584991 0.3179748
        [,71]     [,72]     [,73]     [,74]     [,75]    [,76]     [,77]
[1,] 0.799575 -1.167011 -1.260969 -1.971312 -0.374142 1.144344 0.6300121
[2,] 0.799575 -1.167011 -1.260969 -1.971312 -0.374142 1.144344 0.6300121
         [,78]     [,79]      [,80]      [,81]      [,82]    [,83]    [,84]
[1,] -1.052593 -1.277968 -0.3215835 -0.3247888 -0.8336811 -1.00178 1.422454
[2,] -1.052593 -1.277968 -0.3215835 -0.3247888 -0.8336811 -1.00178 1.422454
          [,85]     [,86]     [,87]    [,88]     [,89]     [,90]      [,91]
[1,] -0.3959124 0.8111445 0.9032397 0.152323 0.1600272 0.4060206 -0.8524407
[2,] -0.3959124 0.8111445 0.9032397 0.152323 0.1600272 0.4060206 -0.8524407
           [,92]     [,93]    [,94]     [,95]     [,96]     [,97]     [,98]
[1,] -0.04584311 -1.330109 0.250944 0.6101841 -1.249971 0.6269782 -1.810124
[2,] -0.04584311 -1.330109 0.250944 0.6101841 -1.249971 0.6269782 -1.810124
         [,99]    [,100]
[1,] 0.4016266 0.3188763
[2,] 0.4016266 0.3188763
> 
> 
> Max(tmp2)
[1] 3.116495
> Min(tmp2)
[1] -1.955662
> mean(tmp2)
[1] 0.04951322
> Sum(tmp2)
[1] 4.951322
> Var(tmp2)
[1] 1.091588
> 
> rowMeans(tmp2)
  [1]  2.595579513 -0.136819516 -1.100719201 -1.596233533 -0.996848127
  [6]  1.111979696 -0.799203448 -0.218706297 -0.936214873  2.211478050
 [11]  0.795970951  1.071573131  1.221165350  0.802558837 -0.039935350
 [16]  0.881070275 -0.699099560 -1.294307444 -0.377508628 -0.923003121
 [21]  1.824261674 -0.684676305 -0.811375172 -0.672953079  0.826150522
 [26]  0.480321771 -1.088798565  1.285903012  0.820702466  0.050115288
 [31]  0.497791355 -0.301049941  0.851671211  1.227932865 -1.955661666
 [36]  1.716572677  0.098042823 -0.007673055  0.358769356  0.821783188
 [41]  2.211188603 -0.028876382  0.139391934  3.116494528 -0.412425637
 [46]  0.357790816 -1.780586641 -0.200679939 -0.850001977 -0.045426277
 [51]  0.036821613  0.469864560 -0.294758921 -1.071424506 -0.108464478
 [56] -1.132771168 -0.138262986  0.626537379 -1.246093575 -0.730693101
 [61] -0.667497431  1.697554154 -1.321906249 -1.241979713  0.735717285
 [66] -1.072409080 -0.974084225 -0.892800176 -1.035014013  0.904514631
 [71]  0.372138217 -0.732323588 -0.638203144  1.133889071  1.083212801
 [76]  1.872649705 -0.273332112  0.958826596  0.967092169 -0.378188590
 [81] -0.610848490  0.010049182  1.525331680 -1.434003391  0.395682461
 [86]  0.661634696 -0.767043254 -0.946726634 -1.038645970  0.956960445
 [91] -0.616001504  0.054982181  1.463995775  1.063945649 -0.483909440
 [96] -1.081666032  0.632881909 -1.139104895 -0.720675507  0.698396222
> rowSums(tmp2)
  [1]  2.595579513 -0.136819516 -1.100719201 -1.596233533 -0.996848127
  [6]  1.111979696 -0.799203448 -0.218706297 -0.936214873  2.211478050
 [11]  0.795970951  1.071573131  1.221165350  0.802558837 -0.039935350
 [16]  0.881070275 -0.699099560 -1.294307444 -0.377508628 -0.923003121
 [21]  1.824261674 -0.684676305 -0.811375172 -0.672953079  0.826150522
 [26]  0.480321771 -1.088798565  1.285903012  0.820702466  0.050115288
 [31]  0.497791355 -0.301049941  0.851671211  1.227932865 -1.955661666
 [36]  1.716572677  0.098042823 -0.007673055  0.358769356  0.821783188
 [41]  2.211188603 -0.028876382  0.139391934  3.116494528 -0.412425637
 [46]  0.357790816 -1.780586641 -0.200679939 -0.850001977 -0.045426277
 [51]  0.036821613  0.469864560 -0.294758921 -1.071424506 -0.108464478
 [56] -1.132771168 -0.138262986  0.626537379 -1.246093575 -0.730693101
 [61] -0.667497431  1.697554154 -1.321906249 -1.241979713  0.735717285
 [66] -1.072409080 -0.974084225 -0.892800176 -1.035014013  0.904514631
 [71]  0.372138217 -0.732323588 -0.638203144  1.133889071  1.083212801
 [76]  1.872649705 -0.273332112  0.958826596  0.967092169 -0.378188590
 [81] -0.610848490  0.010049182  1.525331680 -1.434003391  0.395682461
 [86]  0.661634696 -0.767043254 -0.946726634 -1.038645970  0.956960445
 [91] -0.616001504  0.054982181  1.463995775  1.063945649 -0.483909440
 [96] -1.081666032  0.632881909 -1.139104895 -0.720675507  0.698396222
> 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]  2.595579513 -0.136819516 -1.100719201 -1.596233533 -0.996848127
  [6]  1.111979696 -0.799203448 -0.218706297 -0.936214873  2.211478050
 [11]  0.795970951  1.071573131  1.221165350  0.802558837 -0.039935350
 [16]  0.881070275 -0.699099560 -1.294307444 -0.377508628 -0.923003121
 [21]  1.824261674 -0.684676305 -0.811375172 -0.672953079  0.826150522
 [26]  0.480321771 -1.088798565  1.285903012  0.820702466  0.050115288
 [31]  0.497791355 -0.301049941  0.851671211  1.227932865 -1.955661666
 [36]  1.716572677  0.098042823 -0.007673055  0.358769356  0.821783188
 [41]  2.211188603 -0.028876382  0.139391934  3.116494528 -0.412425637
 [46]  0.357790816 -1.780586641 -0.200679939 -0.850001977 -0.045426277
 [51]  0.036821613  0.469864560 -0.294758921 -1.071424506 -0.108464478
 [56] -1.132771168 -0.138262986  0.626537379 -1.246093575 -0.730693101
 [61] -0.667497431  1.697554154 -1.321906249 -1.241979713  0.735717285
 [66] -1.072409080 -0.974084225 -0.892800176 -1.035014013  0.904514631
 [71]  0.372138217 -0.732323588 -0.638203144  1.133889071  1.083212801
 [76]  1.872649705 -0.273332112  0.958826596  0.967092169 -0.378188590
 [81] -0.610848490  0.010049182  1.525331680 -1.434003391  0.395682461
 [86]  0.661634696 -0.767043254 -0.946726634 -1.038645970  0.956960445
 [91] -0.616001504  0.054982181  1.463995775  1.063945649 -0.483909440
 [96] -1.081666032  0.632881909 -1.139104895 -0.720675507  0.698396222
> rowMin(tmp2)
  [1]  2.595579513 -0.136819516 -1.100719201 -1.596233533 -0.996848127
  [6]  1.111979696 -0.799203448 -0.218706297 -0.936214873  2.211478050
 [11]  0.795970951  1.071573131  1.221165350  0.802558837 -0.039935350
 [16]  0.881070275 -0.699099560 -1.294307444 -0.377508628 -0.923003121
 [21]  1.824261674 -0.684676305 -0.811375172 -0.672953079  0.826150522
 [26]  0.480321771 -1.088798565  1.285903012  0.820702466  0.050115288
 [31]  0.497791355 -0.301049941  0.851671211  1.227932865 -1.955661666
 [36]  1.716572677  0.098042823 -0.007673055  0.358769356  0.821783188
 [41]  2.211188603 -0.028876382  0.139391934  3.116494528 -0.412425637
 [46]  0.357790816 -1.780586641 -0.200679939 -0.850001977 -0.045426277
 [51]  0.036821613  0.469864560 -0.294758921 -1.071424506 -0.108464478
 [56] -1.132771168 -0.138262986  0.626537379 -1.246093575 -0.730693101
 [61] -0.667497431  1.697554154 -1.321906249 -1.241979713  0.735717285
 [66] -1.072409080 -0.974084225 -0.892800176 -1.035014013  0.904514631
 [71]  0.372138217 -0.732323588 -0.638203144  1.133889071  1.083212801
 [76]  1.872649705 -0.273332112  0.958826596  0.967092169 -0.378188590
 [81] -0.610848490  0.010049182  1.525331680 -1.434003391  0.395682461
 [86]  0.661634696 -0.767043254 -0.946726634 -1.038645970  0.956960445
 [91] -0.616001504  0.054982181  1.463995775  1.063945649 -0.483909440
 [96] -1.081666032  0.632881909 -1.139104895 -0.720675507  0.698396222
> 
> colMeans(tmp2)
[1] 0.04951322
> colSums(tmp2)
[1] 4.951322
> colVars(tmp2)
[1] 1.091588
> colSd(tmp2)
[1] 1.044791
> colMax(tmp2)
[1] 3.116495
> colMin(tmp2)
[1] -1.955662
> colMedians(tmp2)
[1] -0.04268081
> colRanges(tmp2)
          [,1]
[1,] -1.955662
[2,]  3.116495
> 
> dataset1 <- matrix(dataset1,1,100)
> 
> agree.checks(tmp,dataset1)
> 
> dataset2 <- matrix(dataset2,100,1)
> agree.checks(tmp2,dataset2)
>   
> 
> tmp <- createBufferedMatrix(10,10)
> 
> tmp[1:10,1:10] <- rnorm(100)
> colApply(tmp,sum)
 [1] -3.0444203 -3.3452070  0.1190689  1.1489130 -2.5990780 -0.6415484
 [7]  0.3501704  2.0487601 -1.2488613 -3.3831089
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -2.6156608
[2,] -0.6974414
[3,] -0.4036931
[4,]  0.4756792
[5,]  1.3542366
> 
> rowApply(tmp,sum)
 [1] -5.7436769  2.0934799  4.6176085 -0.3842025 -5.4392160 -4.7265390
 [7]  2.0609318 -5.3251594 -0.2556120  2.5070742
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    7    6    2    4    6    3    7    2   10     6
 [2,]    4    5    3    6    9    5    4    3    3     5
 [3,]    5   10    7    3    8    6   10    1    7     3
 [4,]    9    3    6    2   10    9    5    6    8     4
 [5,]    2    2    5    9    5    4    6    9    2     2
 [6,]    6    8    8    5    4    8    1    8    9     1
 [7,]    1    9   10    7    7    7    3    5    4     9
 [8,]   10    7    9    1    3   10    8    4    6     7
 [9,]    3    4    1   10    2    2    9    7    5     8
[10,]    8    1    4    8    1    1    2   10    1    10
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1] -2.3870049 -0.5513443  0.1637764 -0.8328121 -2.4142242  0.2531075
 [7]  2.3227530  0.2935445  1.9777749 -0.8564647 -3.4409914  0.6582679
[13]  0.2303560 -1.1282197  1.0158581  2.3873321 -0.9896383  2.9183128
[19]  1.6727307 -0.7733458
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -1.1162020
[2,] -0.8722757
[3,] -0.5787432
[4,] -0.4865822
[5,]  0.6667981
> 
> rowApply(tmp,sum)
[1] -2.9034583 -0.8819424 -3.0767307  2.3303249  5.0515748
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]   16    4    4    6    5
[2,]    7   14    7    4   19
[3,]   15   11    5   10   14
[4,]    9   17    1   18    3
[5,]   13    9   10    5    1
> 
> 
> as.matrix(tmp)
           [,1]        [,2]         [,3]       [,4]        [,5]       [,6]
[1,]  0.6667981 -0.56026457  0.490457538 -0.4456084 -0.03761683 -1.7732490
[2,] -0.8722757  0.02241886 -0.108936890  0.3187076 -0.14131592 -0.3645082
[3,] -1.1162020 -0.62218825 -0.912777259 -1.4847654 -0.19213520  0.5471834
[4,] -0.5787432 -1.19178206 -0.003650041  1.6315290 -0.66884195  1.0645979
[5,] -0.4865822  1.80047170  0.698683017 -0.8526748 -1.37431434  0.7790834
           [,7]       [,8]       [,9]      [,10]      [,11]       [,12]
[1,] -0.1262930 -0.4408327  0.7096124 -1.0881884 -2.0579396  0.20515525
[2,] -0.9848691 -0.1205413 -0.1928918 -0.2856630 -1.6584111  0.18547687
[3,]  0.8351908 -0.6697454 -1.1951092  0.2135129  0.3192128  0.54024671
[4,]  2.2309762  0.5526232  1.7962155 -1.6905257  1.1859887 -0.20722696
[5,]  0.3677481  0.9720406  0.8599480  1.9943995 -1.2298422 -0.06538401
          [,13]      [,14]       [,15]       [,16]      [,17]      [,18]
[1,]  0.7561475 -0.2165443 -0.67446914  1.13459464  2.5232385 -0.6137303
[2,]  0.3097387 -0.5593904 -0.08661191  1.06660790 -1.6874862  2.8333816
[3,]  0.8796437 -0.2193154  1.51629194 -0.14004648  0.5012383 -0.0954068
[4,] -1.2829799 -0.3489478  0.21807380  0.29038330 -1.6495424  0.2792850
[5,] -0.4321940  0.2159783  0.04257338  0.03579274 -0.6770865  0.5147833
          [,19]       [,20]
[1,] -0.8715546 -0.48317128
[2,]  1.5174811 -0.07285345
[3,] -1.2071465 -0.57441319
[4,]  0.9386383 -0.23574609
[5,]  1.2953125  0.59283818
> 
> 
> is.BufferedMatrix(tmp)
[1] TRUE
> 
> as.BufferedMatrix(as.matrix(tmp))
BufferedMatrix object
Matrix size:  5 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  800  bytes.
> 
> 
> 
> subBufferedMatrix(tmp,1:5,1:5)
BufferedMatrix object
Matrix size:  5 5 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  655  bytes.
Disk usage :  200  bytes.
> subBufferedMatrix(tmp,,5:8)
BufferedMatrix object
Matrix size:  5 4 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  567  bytes.
Disk usage :  160  bytes.
> subBufferedMatrix(tmp,1:3,)
BufferedMatrix object
Matrix size:  3 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  480  bytes.
> 
> 
> rm(tmp)
> 
> 
> ###
> ### Testing colnames and rownames
> ###
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> 
> 
> colnames(tmp)
NULL
> rownames(tmp)
NULL
> 
> 
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> colnames(tmp)
 [1] "col1"  "col2"  "col3"  "col4"  "col5"  "col6"  "col7"  "col8"  "col9" 
[10] "col10" "col11" "col12" "col13" "col14" "col15" "col16" "col17" "col18"
[19] "col19" "col20"
> rownames(tmp)
[1] "row1" "row2" "row3" "row4" "row5"
> 
> 
> tmp["row1",]
         col1     col2     col3        col4      col5       col6     col7
row1 1.246528 1.589246 0.644929 -0.05932197 0.7880438 -0.3325771 0.921383
           col8       col9     col10      col11      col12      col13     col14
row1 -0.8818766 -0.7901499 -1.492318 -0.0727276 -0.8860874 -0.1376456 0.9793122
          col15      col16     col17    col18    col19      col20
row1 -0.2773607 -0.5147213 0.3001742 2.427996 2.743452 -0.7646187
> tmp[,"col10"]
           col10
row1 -1.49231753
row2  0.28394197
row3 -0.34884095
row4 -0.38108597
row5 -0.04967543
> tmp[c("row1","row5"),]
          col1       col2     col3        col4       col5       col6      col7
row1  1.246528  1.5892464 0.644929 -0.05932197  0.7880438 -0.3325771 0.9213830
row5 -1.079710 -0.2063932 1.662528  1.04166528 -0.4023238 -0.4340406 0.8262168
           col8       col9       col10      col11      col12      col13
row1 -0.8818766 -0.7901499 -1.49231753 -0.0727276 -0.8860874 -0.1376456
row5  0.3113106 -0.1999222 -0.04967543 -0.3544440 -0.8119170 -0.9537418
          col14      col15      col16      col17      col18     col19
row1  0.9793122 -0.2773607 -0.5147213  0.3001742  2.4279956  2.743452
row5 -0.8459877 -1.1890976  0.8062589 -1.2932607 -0.8165128 -1.661149
          col20
row1 -0.7646187
row5 -0.5697126
> tmp[,c("col6","col20")]
           col6      col20
row1 -0.3325771 -0.7646187
row2  0.6236514 -2.1385361
row3  0.4105213  0.3616592
row4  0.7150634  0.4888259
row5 -0.4340406 -0.5697126
> tmp[c("row1","row5"),c("col6","col20")]
           col6      col20
row1 -0.3325771 -0.7646187
row5 -0.4340406 -0.5697126
> 
> 
> 
> 
> 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 49.4213 50.36051 50.3106 49.86711 50.56391 104.3768 50.40334 49.34205
         col9    col10    col11    col12   col13    col14    col15    col16
row1 49.59386 49.49687 49.60239 48.64357 49.9053 50.05109 48.63011 49.97261
        col17    col18    col19    col20
row1 50.22485 48.70699 49.16512 105.0388
> tmp[,"col10"]
        col10
row1 49.49687
row2 28.41505
row3 29.98760
row4 30.92118
row5 50.02483
> tmp[c("row1","row5"),]
         col1     col2    col3     col4     col5     col6     col7     col8
row1 49.42130 50.36051 50.3106 49.86711 50.56391 104.3768 50.40334 49.34205
row5 50.96182 50.22540 48.3745 49.51391 48.43333 106.3719 48.03597 48.24404
         col9    col10    col11    col12    col13    col14    col15    col16
row1 49.59386 49.49687 49.60239 48.64357 49.90530 50.05109 48.63011 49.97261
row5 51.32434 50.02483 48.79322 47.30171 51.01168 51.17324 50.40301 50.60285
        col17    col18    col19    col20
row1 50.22485 48.70699 49.16512 105.0388
row5 51.30849 49.31478 48.94643 105.9103
> tmp[,c("col6","col20")]
          col6     col20
row1 104.37678 105.03882
row2  75.07641  74.52765
row3  76.23788  74.55033
row4  75.74324  74.47599
row5 106.37193 105.91034
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 104.3768 105.0388
row5 106.3719 105.9103
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 104.3768 105.0388
row5 106.3719 105.9103
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
          col13
[1,]  1.0383761
[2,] -0.8064887
[3,]  0.5725268
[4,]  0.2230642
[5,]  1.4916914
> tmp[,c("col17","col7")]
          col17       col7
[1,]  0.3947253  2.1550098
[2,]  2.0624790 -0.8965063
[3,] -0.5982829  0.2428536
[4,]  1.7813194 -0.7539631
[5,] -2.2975517  0.1089557
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
           col6      col20
[1,]  0.2342350 -0.6778276
[2,]  1.3962516 -1.1487771
[3,]  1.5110880  0.8114376
[4,]  0.2590166 -1.5065423
[5,] -0.2540796  0.2477536
> subBufferedMatrix(tmp,1,c("col6"))[,1]
         col1
[1,] 0.234235
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
         col6
[1,] 0.234235
[2,] 1.396252
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> 
> 
> 
> subBufferedMatrix(tmp,c("row3","row1"),)[,1:20]
           [,1]       [,2]      [,3]      [,4]       [,5]      [,6]        [,7]
row3 -0.3580978 -0.1712076 1.8763556 0.2149551 0.08007602 1.4713027 -0.07616135
row1 -0.4068569 -0.2298056 0.0466987 0.8887529 0.91460233 0.2542729  0.25489359
          [,8]      [,9]      [,10]      [,11]      [,12]     [,13]     [,14]
row3 0.2660669 0.3318739 -0.6576149  0.5795978 -1.7104152 -1.460764 0.3589321
row1 1.2354657 0.4928198  0.4725075 -0.4591702  0.9375717  2.065785 1.2008903
         [,15]      [,16]     [,17]      [,18]    [,19]      [,20]
row3 0.6341549 -0.4915142 0.4818042 -1.2992694 1.297660  0.8615721
row1 1.9171849  0.6732515 0.6669606 -0.9307235 1.566531 -0.7780966
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
          [,1]       [,2]       [,3]       [,4]      [,5]      [,6]     [,7]
row2 0.5894685 -0.6968299 -0.3889978 -0.4383045 0.4929494 0.2088211 1.186082
           [,8]       [,9]      [,10]
row2 -0.2363437 -0.1773043 -0.7180774
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
          [,1]      [,2]       [,3]     [,4]     [,5]     [,6]      [,7]
row5 0.1546254 -1.203516 0.06200352 1.371527 1.760281 1.037852 0.4546145
         [,8]     [,9]    [,10]      [,11]    [,12]      [,13]    [,14]
row5 0.396068 1.051834 1.018318 -0.4583035 1.873709 -0.4957113 0.266486
         [,15]      [,16]     [,17]      [,18]     [,19]     [,20]
row5 0.5647273 -0.8048168 -1.111108 -0.4769384 0.6918472 -1.107916
> 
> 
> 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: 0x927874600>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM12aa5762e20ca"
 [2] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM12aa54e6aea63"
 [3] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM12aa54d4231cd"
 [4] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM12aa534d3b15b"
 [5] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM12aa53620e875"
 [6] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM12aa52a7d7516"
 [7] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM12aa512920d25"
 [8] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM12aa5329d01a9"
 [9] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM12aa561d81834"
[10] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM12aa5321d301b"
[11] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM12aa51a415651"
[12] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM12aa53789ed4e"
[13] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM12aa5403ab85e"
[14] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM12aa54f1e4443"
[15] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM12aa54c13b349"
> 
> 
> ### 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: 0x9278750e0>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x9278750e0>
Warning message:
In dir.create(new.directory) :
  '/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x9278750e0>
> rowMedians(tmp)
  [1]  0.090701154 -0.226862512  0.612893572  0.504612341  0.174806059
  [6] -0.426960969  0.158073938 -0.122392367  0.454485669  0.308228001
 [11]  0.347153123 -0.135136728  0.081990193  0.453506521 -0.208915200
 [16] -0.201150646 -0.468255168  0.088319506  0.151436902 -0.018579044
 [21]  0.336108483  0.549284049  0.215307136  0.015907100  0.310797626
 [26]  0.282894969  0.006368186  0.235240275  0.040630482  0.588975034
 [31]  0.030507154  0.010231358  0.291808377  0.439123854  0.236010193
 [36]  0.058879702 -0.034273759  0.140396157  0.145590919 -0.412607955
 [41]  0.125414113 -0.029440507 -0.481924286 -0.174504443  0.399722553
 [46]  0.404271818 -0.160807098 -0.023754779 -0.280518253 -0.116035994
 [51] -0.120795448 -0.218378067 -0.571231664  0.285498266  0.470446493
 [56] -0.411492364 -0.220189625 -0.210743537  0.304732831  0.185340182
 [61] -0.079388572  0.459693667 -0.259458730  0.080481077  0.218224358
 [66]  0.153684959  0.069373357 -0.273703762 -0.378041484 -0.489977333
 [71]  0.152129493  0.500133335  0.220107207 -0.651495666  0.168038282
 [76]  0.197707474  0.096601523 -0.020151034 -0.326183810  0.233725739
 [81]  0.100338894  0.008912317 -0.708147915  0.493093612  0.034795008
 [86]  0.443792567 -0.198604316  0.582969537  0.111481740 -0.463544413
 [91]  0.069399343  0.008893357  0.216606435 -0.092295366 -0.588680269
 [96]  0.170983078  0.275060968 -0.192067427  0.019530900  0.175711012
[101] -0.365009449 -0.516708094  0.032298605  0.269675623 -0.476050374
[106] -0.292380577  0.130704141  0.101643816  0.408293916  0.261255879
[111]  0.669735072 -0.321920942  0.257577246  0.310384817  0.204873111
[116] -0.201671638 -0.633035129  0.280874914 -0.422189420  0.470526349
[121] -0.538683243 -0.085865559  0.019157973  0.235530218 -0.294291051
[126]  0.116400885 -0.247469736  0.650760910 -0.204739763 -0.182971827
[131] -0.607260065 -0.253418666  0.010068544  0.576081646 -0.444119113
[136]  0.155216227  0.183212606 -0.502681796 -0.293923266  0.005750588
[141] -0.242258638 -0.579935598  0.112462073 -0.184560917 -0.458349543
[146]  0.180266558 -0.252385436 -0.348407302  0.049605730  0.474671831
[151]  0.219366437 -0.300656268  0.058739197  0.095981117 -0.617210714
[156]  0.322408546 -0.260188715 -0.586538489 -0.408556448 -0.601324227
[161] -0.499822034  0.400353651  0.778632326 -0.626177207  0.333946195
[166] -0.247179659 -0.369353210 -0.031042444 -0.067796971  0.098260309
[171]  0.163167599 -0.148131818  0.409503390  0.263342847  0.018817518
[176] -0.274262353  0.277595409  0.060769860 -0.112092117 -0.511699888
[181]  0.404132243 -0.014669173 -0.139443944 -0.515840695 -0.029434495
[186] -0.562703644  0.451283300  0.019364787 -0.166493423 -0.264258138
[191]  0.705560633  0.149450596 -0.469791503 -0.085246598  0.296173793
[196] -0.288919012  0.106818645 -0.247881975 -0.215780368  0.433069095
[201]  0.110753742  0.258691358 -0.121347479  0.088910338  0.252580957
[206]  0.138428767  0.108309720 -0.218864748 -0.311480357 -0.258101847
[211]  0.026303494  0.037177515 -0.125791756  0.170679363 -0.251425088
[216]  0.435610687 -0.146463738 -0.035373080 -0.009198881 -0.244649317
[221] -0.155006644 -0.182819480 -0.038519763 -0.003342167 -0.191022619
[226]  0.387821879 -0.096445327  0.339738978 -0.193391553  0.517668282
> 
> proc.time()
   user  system elapsed 
  0.801   5.136   6.392 

BufferedMatrix.Rcheck/tests/rawCalltesting.Rout


R version 4.6.0 alpha (2026-04-08 r89818)
Copyright (C) 2026 The R Foundation for Statistical Computing
Platform: aarch64-apple-darwin23

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: 0x101bf72d0>
> .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: 0x101bf72d0>
> .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: 0x101bf72d0>
> .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: 0x101bf72d0>
> 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: 0x8dadf03c0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x8dadf03c0>
> .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: 0x8dadf03c0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x8dadf03c0>
> .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: 0x8dadf03c0>
> 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: 0x8dadf05a0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x8dadf05a0>
> .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: 0x8dadf05a0>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x8dadf05a0>
> .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: 0x8dadf05a0>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x8dadf05a0>
> .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: 0x8dadf05a0>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x8dadf05a0>
> .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: 0x8dadf05a0>
> 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: 0x8dadf0780>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x8dadf0780>
> .Call("R_bm_AddColumn",P)
<pointer: 0x8dadf0780>
> .Call("R_bm_AddColumn",P)
<pointer: 0x8dadf0780>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile12dbf1e95077a" "BufferedMatrixFile12dbf58605d6a"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile12dbf1e95077a" "BufferedMatrixFile12dbf58605d6a"
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x8dadf0a20>
> .Call("R_bm_AddColumn",P)
<pointer: 0x8dadf0a20>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x8dadf0a20>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x8dadf0a20>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x8dadf0a20>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x8dadf0a20>
> .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: 0x8dadf0c00>
> .Call("R_bm_AddColumn",P)
<pointer: 0x8dadf0c00>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x8dadf0c00>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x8dadf0c00>
> 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: 0x8dadf0de0>
> .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: 0x8dadf0de0>
> rm(P)
> 
> proc.time()
   user  system elapsed 
  0.131   0.056   0.186 

BufferedMatrix.Rcheck/tests/Rcodetesting.Rout


R version 4.6.0 alpha (2026-04-08 r89818)
Copyright (C) 2026 The R Foundation for Statistical Computing
Platform: aarch64-apple-darwin23

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.120   0.029   0.143 

Example timings