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

This page was generated on 2025-12-19 11:35 -0500 (Fri, 19 Dec 2025).

HostnameOSArch (*)R versionInstalled pkgs
nebbiolo1Linux (Ubuntu 24.04.3 LTS)x86_64R Under development (unstable) (2025-10-20 r88955) -- "Unsuffered Consequences" 4875
kjohnson3macOS 13.7.7 Venturaarm64R Under development (unstable) (2025-11-04 r88984) -- "Unsuffered Consequences" 4593
Click on any hostname to see more info about the system (e.g. compilers)      (*) as reported by 'uname -p', except on Windows and Mac OS X

Package 253/2332HostnameOS / ArchINSTALLBUILDCHECKBUILD BIN
BufferedMatrix 1.75.0  (landing page)
Ben Bolstad
Snapshot Date: 2025-12-18 13:40 -0500 (Thu, 18 Dec 2025)
git_url: https://git.bioconductor.org/packages/BufferedMatrix
git_branch: devel
git_last_commit: ecdbf23
git_last_commit_date: 2025-10-29 09:58:55 -0500 (Wed, 29 Oct 2025)
nebbiolo1Linux (Ubuntu 24.04.3 LTS) / x86_64  OK    OK    OK  UNNEEDED, same version is already published
kjohnson3macOS 13.7.7 Ventura / arm64  OK    OK    WARNINGS    OK  UNNEEDED, same version is already published


CHECK results for BufferedMatrix on kjohnson3

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

raw results


Summary

Package: BufferedMatrix
Version: 1.75.0
Command: /Library/Frameworks/R.framework/Resources/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/Library/Frameworks/R.framework/Resources/library --no-vignettes --timings BufferedMatrix_1.75.0.tar.gz
StartedAt: 2025-12-18 18:44:11 -0500 (Thu, 18 Dec 2025)
EndedAt: 2025-12-18 18:44:30 -0500 (Thu, 18 Dec 2025)
EllapsedTime: 19.3 seconds
RetCode: 0
Status:   WARNINGS  
CheckDir: BufferedMatrix.Rcheck
Warnings: 1

Command output

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


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

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


Installation output

BufferedMatrix.Rcheck/00install.out

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


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

Tests output

BufferedMatrix.Rcheck/tests/c_code_level_tests.Rout


R Under development (unstable) (2025-11-04 r88984) -- "Unsuffered Consequences"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: aarch64-apple-darwin20

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

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

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

> library(BufferedMatrix);library.dynam("BufferedMatrix", "BufferedMatrix", .libPaths());.C("dbm_c_tester",integer(1))

Attaching package: 'BufferedMatrix'

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

    colMeans, colSums, rowMeans, rowSums

Checking dimensions
Rows: 5
Cols: 5
Buffer Rows: 1
Buffer Cols: 1

Assigning Values
0.000000 1.000000 2.000000 3.000000 4.000000 
1.000000 2.000000 3.000000 4.000000 5.000000 
2.000000 3.000000 4.000000 5.000000 6.000000 
3.000000 4.000000 5.000000 6.000000 7.000000 
4.000000 5.000000 6.000000 7.000000 8.000000 

Adding Additional Column
Checking dimensions
Rows: 5
Cols: 6
Buffer Rows: 1
Buffer Cols: 1
0.000000 1.000000 2.000000 3.000000 4.000000 0.000000 
1.000000 2.000000 3.000000 4.000000 5.000000 0.000000 
2.000000 3.000000 4.000000 5.000000 6.000000 0.000000 
3.000000 4.000000 5.000000 6.000000 7.000000 0.000000 
4.000000 5.000000 6.000000 7.000000 8.000000 0.000000 

Reassigning values
1.000000 6.000000 11.000000 16.000000 21.000000 26.000000 
2.000000 7.000000 12.000000 17.000000 22.000000 27.000000 
3.000000 8.000000 13.000000 18.000000 23.000000 28.000000 
4.000000 9.000000 14.000000 19.000000 24.000000 29.000000 
5.000000 10.000000 15.000000 20.000000 25.000000 30.000000 

Resizing Buffers
Checking dimensions
Rows: 5
Cols: 6
Buffer Rows: 3
Buffer Cols: 3
1.000000 6.000000 11.000000 16.000000 21.000000 26.000000 
2.000000 7.000000 12.000000 17.000000 22.000000 27.000000 
3.000000 8.000000 13.000000 18.000000 23.000000 28.000000 
4.000000 9.000000 14.000000 19.000000 24.000000 29.000000 
5.000000 10.000000 15.000000 20.000000 25.000000 30.000000 

Activating Row Buffer
In row mode: 1
1.000000 6.000000 11.000000 16.000000 21.000000 26.000000 
2.000000 7.000000 12.000000 17.000000 22.000000 27.000000 
3.000000 8.000000 13.000000 18.000000 23.000000 28.000000 
4.000000 9.000000 14.000000 19.000000 24.000000 29.000000 
5.000000 10.000000 15.000000 20.000000 25.000000 30.000000 

Squaring Last Column
1.000000 6.000000 11.000000 16.000000 21.000000 676.000000 
2.000000 7.000000 12.000000 17.000000 22.000000 729.000000 
3.000000 8.000000 13.000000 18.000000 23.000000 784.000000 
4.000000 9.000000 14.000000 19.000000 24.000000 841.000000 
5.000000 10.000000 15.000000 20.000000 25.000000 900.000000 

Square rooting Last Row, then turing off Row Buffer
In row mode: 0
Checking on value that should be not be in column buffer2.236068 
1.000000 6.000000 11.000000 16.000000 21.000000 676.000000 
2.000000 7.000000 12.000000 17.000000 22.000000 729.000000 
3.000000 8.000000 13.000000 18.000000 23.000000 784.000000 
4.000000 9.000000 14.000000 19.000000 24.000000 841.000000 
2.236068 3.162278 3.872983 4.472136 5.000000 30.000000 

Single Indexing. Assign each value its square
1.000000 36.000000 121.000000 256.000000 441.000000 676.000000 
4.000000 49.000000 144.000000 289.000000 484.000000 729.000000 
9.000000 64.000000 169.000000 324.000000 529.000000 784.000000 
16.000000 81.000000 196.000000 361.000000 576.000000 841.000000 
25.000000 100.000000 225.000000 400.000000 625.000000 900.000000 

Resizing Buffers Smaller
Checking dimensions
Rows: 5
Cols: 6
Buffer Rows: 1
Buffer Cols: 1
1.000000 36.000000 121.000000 256.000000 441.000000 676.000000 
4.000000 49.000000 144.000000 289.000000 484.000000 729.000000 
9.000000 64.000000 169.000000 324.000000 529.000000 784.000000 
16.000000 81.000000 196.000000 361.000000 576.000000 841.000000 
25.000000 100.000000 225.000000 400.000000 625.000000 900.000000 

Activating Row Mode.
Resizing Buffers
Checking dimensions
Rows: 5
Cols: 6
Buffer Rows: 1
Buffer Cols: 1
Activating ReadOnly Mode.
The results of assignment is: 0
Printing matrix reversed.
900.000000 625.000000 400.000000 225.000000 100.000000 25.000000 
841.000000 576.000000 361.000000 196.000000 81.000000 16.000000 
784.000000 529.000000 324.000000 169.000000 64.000000 9.000000 
729.000000 484.000000 289.000000 144.000000 49.000000 -30.000000 
676.000000 441.000000 256.000000 121.000000 -20.000000 -10.000000 

[[1]]
[1] 0

> 
> proc.time()
   user  system elapsed 
  0.130   0.048   0.177 

BufferedMatrix.Rcheck/tests/objectTesting.Rout


R Under development (unstable) (2025-11-04 r88984) -- "Unsuffered Consequences"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: aarch64-apple-darwin20

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

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

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

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

Attaching package: 'BufferedMatrix'

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

    colMeans, colSums, rowMeans, rowSums

> 
> 
> ### this is used to control how many repetitions in something below
> ### higher values result in more checks.
> nreps <-100 ##20000
> 
> 
> ## test creation and some simple assignments and subsetting operations
> 
> ## first on single elements
> tmp <- createBufferedMatrix(1000,10)
> 
> tmp[10,5]
[1] 0
> tmp[10,5] <- 10
> tmp[10,5]
[1] 10
> tmp[10,5] <- 12.445
> tmp[10,5]
[1] 12.445
> 
> 
> 
> ## now testing accessing multiple elements
> tmp2 <- createBufferedMatrix(10,20)
> 
> 
> tmp2[3,1] <- 51.34
> tmp2[9,2] <- 9.87654
> tmp2[,1:2]
       [,1]    [,2]
 [1,]  0.00 0.00000
 [2,]  0.00 0.00000
 [3,] 51.34 0.00000
 [4,]  0.00 0.00000
 [5,]  0.00 0.00000
 [6,]  0.00 0.00000
 [7,]  0.00 0.00000
 [8,]  0.00 0.00000
 [9,]  0.00 9.87654
[10,]  0.00 0.00000
> tmp2[,-(3:20)]
       [,1]    [,2]
 [1,]  0.00 0.00000
 [2,]  0.00 0.00000
 [3,] 51.34 0.00000
 [4,]  0.00 0.00000
 [5,]  0.00 0.00000
 [6,]  0.00 0.00000
 [7,]  0.00 0.00000
 [8,]  0.00 0.00000
 [9,]  0.00 9.87654
[10,]  0.00 0.00000
> tmp2[3,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
[1,] 51.34    0    0    0    0    0    0    0    0     0     0     0     0
     [,14] [,15] [,16] [,17] [,18] [,19] [,20]
[1,]     0     0     0     0     0     0     0
> tmp2[-3,]
      [,1]    [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [2,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [3,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [4,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [5,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [6,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [7,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [8,]    0 9.87654    0    0    0    0    0    0    0     0     0     0     0
 [9,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
      [,14] [,15] [,16] [,17] [,18] [,19] [,20]
 [1,]     0     0     0     0     0     0     0
 [2,]     0     0     0     0     0     0     0
 [3,]     0     0     0     0     0     0     0
 [4,]     0     0     0     0     0     0     0
 [5,]     0     0     0     0     0     0     0
 [6,]     0     0     0     0     0     0     0
 [7,]     0     0     0     0     0     0     0
 [8,]     0     0     0     0     0     0     0
 [9,]     0     0     0     0     0     0     0
> tmp2[2,1:3]
     [,1] [,2] [,3]
[1,]    0    0    0
> tmp2[3:9,1:3]
      [,1]    [,2] [,3]
[1,] 51.34 0.00000    0
[2,]  0.00 0.00000    0
[3,]  0.00 0.00000    0
[4,]  0.00 0.00000    0
[5,]  0.00 0.00000    0
[6,]  0.00 0.00000    0
[7,]  0.00 9.87654    0
> tmp2[-4,-4]
       [,1]    [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [2,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [3,] 51.34 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [4,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [5,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [6,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [7,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [8,]  0.00 9.87654    0    0    0    0    0    0    0     0     0     0     0
 [9,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
      [,14] [,15] [,16] [,17] [,18] [,19]
 [1,]     0     0     0     0     0     0
 [2,]     0     0     0     0     0     0
 [3,]     0     0     0     0     0     0
 [4,]     0     0     0     0     0     0
 [5,]     0     0     0     0     0     0
 [6,]     0     0     0     0     0     0
 [7,]     0     0     0     0     0     0
 [8,]     0     0     0     0     0     0
 [9,]     0     0     0     0     0     0
> 
> ## now testing accessing/assigning multiple elements
> tmp3 <- createBufferedMatrix(10,10)
> 
> for (i in 1:10){
+   for (j in 1:10){
+     tmp3[i,j] <- (j-1)*10 + i
+   }
+ }
> 
> tmp3[2:4,2:4]
     [,1] [,2] [,3]
[1,]   12   22   32
[2,]   13   23   33
[3,]   14   24   34
> tmp3[c(-10),c(2:4,2:4,10,1,2,1:10,10:1)]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]   11   21   31   11   21   31   91    1   11     1    11    21    31
 [2,]   12   22   32   12   22   32   92    2   12     2    12    22    32
 [3,]   13   23   33   13   23   33   93    3   13     3    13    23    33
 [4,]   14   24   34   14   24   34   94    4   14     4    14    24    34
 [5,]   15   25   35   15   25   35   95    5   15     5    15    25    35
 [6,]   16   26   36   16   26   36   96    6   16     6    16    26    36
 [7,]   17   27   37   17   27   37   97    7   17     7    17    27    37
 [8,]   18   28   38   18   28   38   98    8   18     8    18    28    38
 [9,]   19   29   39   19   29   39   99    9   19     9    19    29    39
      [,14] [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24] [,25]
 [1,]    41    51    61    71    81    91    91    81    71    61    51    41
 [2,]    42    52    62    72    82    92    92    82    72    62    52    42
 [3,]    43    53    63    73    83    93    93    83    73    63    53    43
 [4,]    44    54    64    74    84    94    94    84    74    64    54    44
 [5,]    45    55    65    75    85    95    95    85    75    65    55    45
 [6,]    46    56    66    76    86    96    96    86    76    66    56    46
 [7,]    47    57    67    77    87    97    97    87    77    67    57    47
 [8,]    48    58    68    78    88    98    98    88    78    68    58    48
 [9,]    49    59    69    79    89    99    99    89    79    69    59    49
      [,26] [,27] [,28] [,29]
 [1,]    31    21    11     1
 [2,]    32    22    12     2
 [3,]    33    23    13     3
 [4,]    34    24    14     4
 [5,]    35    25    15     5
 [6,]    36    26    16     6
 [7,]    37    27    17     7
 [8,]    38    28    18     8
 [9,]    39    29    19     9
> tmp3[-c(1:5),-c(6:10)]
     [,1] [,2] [,3] [,4] [,5]
[1,]    6   16   26   36   46
[2,]    7   17   27   37   47
[3,]    8   18   28   38   48
[4,]    9   19   29   39   49
[5,]   10   20   30   40   50
> 
> ## assignment of whole columns
> tmp3[,1] <- c(1:10*100.0)
> tmp3[,1:2] <- tmp3[,1:2]*100
> tmp3[,1:2] <- tmp3[,2:1]
> tmp3[,1:2]
      [,1]  [,2]
 [1,] 1100 1e+04
 [2,] 1200 2e+04
 [3,] 1300 3e+04
 [4,] 1400 4e+04
 [5,] 1500 5e+04
 [6,] 1600 6e+04
 [7,] 1700 7e+04
 [8,] 1800 8e+04
 [9,] 1900 9e+04
[10,] 2000 1e+05
> 
> 
> tmp3[,-1] <- tmp3[,1:9]
> tmp3[,1:10]
      [,1] [,2]  [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,] 1100 1100 1e+04   21   31   41   51   61   71    81
 [2,] 1200 1200 2e+04   22   32   42   52   62   72    82
 [3,] 1300 1300 3e+04   23   33   43   53   63   73    83
 [4,] 1400 1400 4e+04   24   34   44   54   64   74    84
 [5,] 1500 1500 5e+04   25   35   45   55   65   75    85
 [6,] 1600 1600 6e+04   26   36   46   56   66   76    86
 [7,] 1700 1700 7e+04   27   37   47   57   67   77    87
 [8,] 1800 1800 8e+04   28   38   48   58   68   78    88
 [9,] 1900 1900 9e+04   29   39   49   59   69   79    89
[10,] 2000 2000 1e+05   30   40   50   60   70   80    90
> 
> tmp3[,1:2] <- rep(1,10)
> tmp3[,1:2] <- rep(1,20)
> tmp3[,1:2] <- matrix(c(1:5),1,5)
> 
> tmp3[,-c(1:8)] <- matrix(c(1:5),1,5)
> 
> tmp3[1,] <- 1:10
> tmp3[1,]
     [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,]    1    2    3    4    5    6    7    8    9    10
> tmp3[-1,] <- c(1,2)
> tmp3[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    1    2    3    4    5    6    7    8    9    10
 [2,]    1    2    1    2    1    2    1    2    1     2
 [3,]    2    1    2    1    2    1    2    1    2     1
 [4,]    1    2    1    2    1    2    1    2    1     2
 [5,]    2    1    2    1    2    1    2    1    2     1
 [6,]    1    2    1    2    1    2    1    2    1     2
 [7,]    2    1    2    1    2    1    2    1    2     1
 [8,]    1    2    1    2    1    2    1    2    1     2
 [9,]    2    1    2    1    2    1    2    1    2     1
[10,]    1    2    1    2    1    2    1    2    1     2
> tmp3[-c(1:8),] <- matrix(c(1:5),1,5)
> tmp3[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    1    2    3    4    5    6    7    8    9    10
 [2,]    1    2    1    2    1    2    1    2    1     2
 [3,]    2    1    2    1    2    1    2    1    2     1
 [4,]    1    2    1    2    1    2    1    2    1     2
 [5,]    2    1    2    1    2    1    2    1    2     1
 [6,]    1    2    1    2    1    2    1    2    1     2
 [7,]    2    1    2    1    2    1    2    1    2     1
 [8,]    1    2    1    2    1    2    1    2    1     2
 [9,]    1    3    5    2    4    1    3    5    2     4
[10,]    2    4    1    3    5    2    4    1    3     5
> 
> 
> tmp3[1:2,1:2] <- 5555.04
> tmp3[-(1:2),1:2] <- 1234.56789
> 
> 
> 
> ## testing accessors for the directory and prefix
> directory(tmp3)
[1] "/Users/biocbuild/bbs-3.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 481248 25.8    1058085 56.6         NA   633817 33.9
Vcells 891449  6.9    8388608 64.0     196608  2110969 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] "Thu Dec 18 18:44:22 2025"
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> date()
[1] "Thu Dec 18 18:44:22 2025"
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,which.col] == test.matrix[which.row,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> 
> 
> RowMode(tmp2)
<pointer: 0x600003f70120>
> 
> 
> 
> 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] "Thu Dec 18 18:44:23 2025"
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col <- sample(1:20,5,replace=TRUE)
+   if (!all(tmp2[which.row,which.col] == test.matrix[which.row,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> date()
[1] "Thu Dec 18 18:44:23 2025"
> 
> ColMode(tmp2)
<pointer: 0x600003f70120>
> 
> 
> 
> ### 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,] 100.1105843  1.22251601  0.5428902 0.5558548
[2,]   0.3397642 -0.21886406 -0.6219095 1.0710955
[3,]   0.2892826  0.25511541  1.2727495 0.1294405
[4,]   0.1095607 -0.01029703 -0.6770124 0.8820729
> 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 :  1.9  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
            [,1]       [,2]      [,3]      [,4]
[1,] 100.1105843 1.22251601 0.5428902 0.5558548
[2,]   0.3397642 0.21886406 0.6219095 1.0710955
[3,]   0.2892826 0.25511541 1.2727495 0.1294405
[4,]   0.1095607 0.01029703 0.6770124 0.8820729
> 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 :  1.9  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
           [,1]      [,2]      [,3]      [,4]
[1,] 10.0055277 1.1056745 0.7368108 0.7455567
[2,]  0.5828930 0.4678291 0.7886124 1.0349374
[3,]  0.5378500 0.5050895 1.1281620 0.3597784
[4,]  0.3309996 0.1014743 0.8228076 0.9391873
> 
> 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 :  1.9  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
          [,1]     [,2]     [,3]     [,4]
[1,] 225.16586 37.27926 32.91100 33.01142
[2,]  31.16869 29.89716 33.50803 36.42047
[3,]  30.66778 30.30601 37.55437 28.72722
[4,]  28.41956 26.02504 33.90509 35.27395
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x600003f68420>
> exp(tmp5)
<pointer: 0x600003f68420>
> log(tmp5,2)
<pointer: 0x600003f68420>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 468.6532
> Min(tmp5)
[1] 54.16771
> mean(tmp5)
[1] 72.78448
> Sum(tmp5)
[1] 14556.9
> Var(tmp5)
[1] 866.4736
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 89.72015 74.18290 69.08047 71.53620 72.94750 71.20784 71.12458 70.63469
 [9] 68.63830 68.77219
> rowSums(tmp5)
 [1] 1794.403 1483.658 1381.609 1430.724 1458.950 1424.157 1422.492 1412.694
 [9] 1372.766 1375.444
> rowVars(tmp5)
 [1] 8024.70847   81.17481   81.36643   79.89368   93.84918   57.17609
 [7]   56.68272   62.31572   94.43858   78.06110
> rowSd(tmp5)
 [1] 89.580737  9.009706  9.020334  8.938326  9.687579  7.561487  7.528793
 [8]  7.894031  9.717951  8.835219
> rowMax(tmp5)
 [1] 468.65324  87.22394  86.83940  92.08058  98.21839  83.15569  84.03111
 [8]  82.05356  88.90524  88.73322
> rowMin(tmp5)
 [1] 56.62567 56.85550 54.43185 54.16771 58.85373 59.75514 58.18138 58.49412
 [9] 54.65964 57.88685
> 
> colMeans(tmp5)
 [1] 110.14799  66.88122  70.28492  68.89706  72.58244  71.88388  72.39050
 [8]  71.47685  70.16708  68.18852  73.64554  73.51898  73.23592  74.35438
[15]  68.75166  69.73222  72.52740  69.53359  66.75339  70.73609
> colSums(tmp5)
 [1] 1101.4799  668.8122  702.8492  688.9706  725.8244  718.8388  723.9050
 [8]  714.7685  701.6708  681.8852  736.4554  735.1898  732.3592  743.5438
[15]  687.5166  697.3222  725.2740  695.3359  667.5339  707.3609
> colVars(tmp5)
 [1] 15924.46679    68.01643    46.40418    61.50089    79.94507   111.88207
 [7]   157.23744    32.00292    93.53577    29.59901    65.28494    70.76566
[13]    55.44084    56.29545    96.19036    75.17610   105.59114   126.38984
[19]    89.54105    76.02368
> colSd(tmp5)
 [1] 126.192182   8.247207   6.812062   7.842251   8.941201  10.577432
 [7]  12.539435   5.657113   9.671389   5.440497   8.079910   8.412233
[13]   7.445861   7.503029   9.807669   8.670415  10.275755  11.242323
[19]   9.462613   8.719156
> colMax(tmp5)
 [1] 468.65324  79.14532  84.03111  83.86089  83.15569  87.22394  98.21839
 [8]  83.57386  92.08058  77.88003  81.00574  84.08319  86.47314  88.90524
[15]  86.98354  81.14393  86.66772  88.73322  78.77950  82.59526
> colMin(tmp5)
 [1] 59.15158 54.16771 59.25260 58.48753 58.91813 60.34738 56.14628 62.30982
 [9] 58.18138 61.08894 59.41780 58.15337 61.80706 64.88632 58.85373 56.46702
[17] 56.85550 56.62567 54.43185 58.49412
> 
> 
> ### 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] 89.72015 74.18290 69.08047 71.53620 72.94750 71.20784 71.12458 70.63469
 [9]       NA 68.77219
> rowSums(tmp5)
 [1] 1794.403 1483.658 1381.609 1430.724 1458.950 1424.157 1422.492 1412.694
 [9]       NA 1375.444
> rowVars(tmp5)
 [1] 8024.70847   81.17481   81.36643   79.89368   93.84918   57.17609
 [7]   56.68272   62.31572   90.55941   78.06110
> rowSd(tmp5)
 [1] 89.580737  9.009706  9.020334  8.938326  9.687579  7.561487  7.528793
 [8]  7.894031  9.516271  8.835219
> rowMax(tmp5)
 [1] 468.65324  87.22394  86.83940  92.08058  98.21839  83.15569  84.03111
 [8]  82.05356        NA  88.73322
> rowMin(tmp5)
 [1] 56.62567 56.85550 54.43185 54.16771 58.85373 59.75514 58.18138 58.49412
 [9]       NA 57.88685
> 
> colMeans(tmp5)
 [1] 110.14799  66.88122  70.28492  68.89706  72.58244  71.88388        NA
 [8]  71.47685  70.16708  68.18852  73.64554  73.51898  73.23592  74.35438
[15]  68.75166  69.73222  72.52740  69.53359  66.75339  70.73609
> colSums(tmp5)
 [1] 1101.4799  668.8122  702.8492  688.9706  725.8244  718.8388        NA
 [8]  714.7685  701.6708  681.8852  736.4554  735.1898  732.3592  743.5438
[15]  687.5166  697.3222  725.2740  695.3359  667.5339  707.3609
> colVars(tmp5)
 [1] 15924.46679    68.01643    46.40418    61.50089    79.94507   111.88207
 [7]          NA    32.00292    93.53577    29.59901    65.28494    70.76566
[13]    55.44084    56.29545    96.19036    75.17610   105.59114   126.38984
[19]    89.54105    76.02368
> colSd(tmp5)
 [1] 126.192182   8.247207   6.812062   7.842251   8.941201  10.577432
 [7]         NA   5.657113   9.671389   5.440497   8.079910   8.412233
[13]   7.445861   7.503029   9.807669   8.670415  10.275755  11.242323
[19]   9.462613   8.719156
> colMax(tmp5)
 [1] 468.65324  79.14532  84.03111  83.86089  83.15569  87.22394        NA
 [8]  83.57386  92.08058  77.88003  81.00574  84.08319  86.47314  88.90524
[15]  86.98354  81.14393  86.66772  88.73322  78.77950  82.59526
> colMin(tmp5)
 [1] 59.15158 54.16771 59.25260 58.48753 58.91813 60.34738       NA 62.30982
 [9] 58.18138 61.08894 59.41780 58.15337 61.80706 64.88632 58.85373 56.46702
[17] 56.85550 56.62567 54.43185 58.49412
> 
> Max(tmp5,na.rm=TRUE)
[1] 468.6532
> Min(tmp5,na.rm=TRUE)
[1] 54.16771
> mean(tmp5,na.rm=TRUE)
[1] 72.86809
> Sum(tmp5,na.rm=TRUE)
[1] 14500.75
> Var(tmp5,na.rm=TRUE)
[1] 869.4446
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 89.72015 74.18290 69.08047 71.53620 72.94750 71.20784 71.12458 70.63469
 [9] 69.29577 68.77219
> rowSums(tmp5,na.rm=TRUE)
 [1] 1794.403 1483.658 1381.609 1430.724 1458.950 1424.157 1422.492 1412.694
 [9] 1316.620 1375.444
> rowVars(tmp5,na.rm=TRUE)
 [1] 8024.70847   81.17481   81.36643   79.89368   93.84918   57.17609
 [7]   56.68272   62.31572   90.55941   78.06110
> rowSd(tmp5,na.rm=TRUE)
 [1] 89.580737  9.009706  9.020334  8.938326  9.687579  7.561487  7.528793
 [8]  7.894031  9.516271  8.835219
> rowMax(tmp5,na.rm=TRUE)
 [1] 468.65324  87.22394  86.83940  92.08058  98.21839  83.15569  84.03111
 [8]  82.05356  88.90524  88.73322
> rowMin(tmp5,na.rm=TRUE)
 [1] 56.62567 56.85550 54.43185 54.16771 58.85373 59.75514 58.18138 58.49412
 [9] 54.65964 57.88685
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 110.14799  66.88122  70.28492  68.89706  72.58244  71.88388  74.19542
 [8]  71.47685  70.16708  68.18852  73.64554  73.51898  73.23592  74.35438
[15]  68.75166  69.73222  72.52740  69.53359  66.75339  70.73609
> colSums(tmp5,na.rm=TRUE)
 [1] 1101.4799  668.8122  702.8492  688.9706  725.8244  718.8388  667.7588
 [8]  714.7685  701.6708  681.8852  736.4554  735.1898  732.3592  743.5438
[15]  687.5166  697.3222  725.2740  695.3359  667.5339  707.3609
> colVars(tmp5,na.rm=TRUE)
 [1] 15924.46679    68.01643    46.40418    61.50089    79.94507   111.88207
 [7]   140.24286    32.00292    93.53577    29.59901    65.28494    70.76566
[13]    55.44084    56.29545    96.19036    75.17610   105.59114   126.38984
[19]    89.54105    76.02368
> colSd(tmp5,na.rm=TRUE)
 [1] 126.192182   8.247207   6.812062   7.842251   8.941201  10.577432
 [7]  11.842418   5.657113   9.671389   5.440497   8.079910   8.412233
[13]   7.445861   7.503029   9.807669   8.670415  10.275755  11.242323
[19]   9.462613   8.719156
> colMax(tmp5,na.rm=TRUE)
 [1] 468.65324  79.14532  84.03111  83.86089  83.15569  87.22394  98.21839
 [8]  83.57386  92.08058  77.88003  81.00574  84.08319  86.47314  88.90524
[15]  86.98354  81.14393  86.66772  88.73322  78.77950  82.59526
> colMin(tmp5,na.rm=TRUE)
 [1] 59.15158 54.16771 59.25260 58.48753 58.91813 60.34738 59.92837 62.30982
 [9] 58.18138 61.08894 59.41780 58.15337 61.80706 64.88632 58.85373 56.46702
[17] 56.85550 56.62567 54.43185 58.49412
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1] 89.72015 74.18290 69.08047 71.53620 72.94750 71.20784 71.12458 70.63469
 [9]      NaN 68.77219
> rowSums(tmp5,na.rm=TRUE)
 [1] 1794.403 1483.658 1381.609 1430.724 1458.950 1424.157 1422.492 1412.694
 [9]    0.000 1375.444
> rowVars(tmp5,na.rm=TRUE)
 [1] 8024.70847   81.17481   81.36643   79.89368   93.84918   57.17609
 [7]   56.68272   62.31572         NA   78.06110
> rowSd(tmp5,na.rm=TRUE)
 [1] 89.580737  9.009706  9.020334  8.938326  9.687579  7.561487  7.528793
 [8]  7.894031        NA  8.835219
> rowMax(tmp5,na.rm=TRUE)
 [1] 468.65324  87.22394  86.83940  92.08058  98.21839  83.15569  84.03111
 [8]  82.05356        NA  88.73322
> rowMin(tmp5,na.rm=TRUE)
 [1] 56.62567 56.85550 54.43185 54.16771 58.85373 59.75514 58.18138 58.49412
 [9]       NA 57.88685
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1] 114.63788  67.02643  70.18562  70.05368  72.93263  73.16572       NaN
 [8]  71.63154  69.60167  68.28719  73.36918  74.09416  73.62014  72.73762
[15]  69.29423  71.20613  70.95625  70.39236  68.09714  69.41840
> colSums(tmp5,na.rm=TRUE)
 [1] 1031.7409  603.2379  631.6706  630.4831  656.3937  658.4914    0.0000
 [8]  644.6838  626.4150  614.5847  660.3226  666.8475  662.5813  654.6386
[15]  623.6481  640.8552  638.6062  633.5312  612.8743  624.7656
> colVars(tmp5,na.rm=TRUE)
 [1] 17688.23513    76.28127    52.09376    54.13873    88.55856   107.38249
 [7]          NA    35.73409   101.63117    33.18935    72.58635    75.88945
[13]    60.71010    33.92579   104.90234    60.13346    91.01938   133.89192
[19]    80.41995    65.99330
> colSd(tmp5,na.rm=TRUE)
 [1] 132.997125   8.733915   7.217601   7.357902   9.410556  10.362552
 [7]         NA   5.977800  10.081228   5.761020   8.519762   8.711455
[13]   7.791668   5.824585  10.242184   7.754577   9.540408  11.571167
[19]   8.967717   8.123626
> colMax(tmp5,na.rm=TRUE)
 [1] 468.65324  79.14532  84.03111  83.86089  83.15569  87.22394      -Inf
 [8]  83.57386  92.08058  77.88003  81.00574  84.08319  86.47314  80.57319
[15]  86.98354  81.14393  79.23698  88.73322  78.77950  81.04572
> colMin(tmp5,na.rm=TRUE)
 [1] 59.15158 54.16771 59.25260 59.79195 58.91813 61.59549      Inf 62.30982
 [9] 58.18138 61.08894 59.41780 58.15337 61.80706 64.88632 58.85373 59.75514
[17] 56.85550 56.62567 54.43185 58.49412
> 
> 
> 
> 
> 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] 233.4203 196.4547 190.5375 235.1916 273.0955 285.0970 210.4637 250.5411
 [9] 267.9960 181.1985
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 233.4203 196.4547 190.5375 235.1916 273.0955 285.0970 210.4637 250.5411
 [9] 267.9960 181.1985
> 
> 
> 
> 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]  2.842171e-14  0.000000e+00  0.000000e+00 -2.842171e-14 -7.105427e-14
 [6]  0.000000e+00  1.136868e-13  1.421085e-13 -2.273737e-13  5.684342e-14
[11]  2.842171e-14 -7.105427e-14 -8.526513e-14  1.705303e-13  8.526513e-14
[16] -1.705303e-13  8.526513e-14  0.000000e+00  0.000000e+00  2.842171e-14
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> ## making sure these things agree
> ##
> ## first when there is no NA
> 
> 
> 
> agree.checks <- function(buff.matrix,r.matrix,err.tol=1e-10){
+ 
+   if (Max(buff.matrix,na.rm=TRUE) != max(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Max")
+   }
+   
+ 
+   if (Min(buff.matrix,na.rm=TRUE) != min(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Min")
+   }
+ 
+ 
+   if (abs(Sum(buff.matrix,na.rm=TRUE)- sum(r.matrix,na.rm=TRUE)) > err.tol){
+ 
+     cat(Sum(buff.matrix,na.rm=TRUE),"\n")
+     cat(sum(r.matrix,na.rm=TRUE),"\n")
+     cat(Sum(buff.matrix,na.rm=TRUE) - sum(r.matrix,na.rm=TRUE),"\n")
+     
+     stop("No agreement in Sum")
+   }
+   
+   if (abs(mean(buff.matrix,na.rm=TRUE) - mean(r.matrix,na.rm=TRUE)) > err.tol){
+     stop("No agreement in mean")
+   }
+   
+   
+   if(abs(Var(buff.matrix,na.rm=TRUE) - var(as.vector(r.matrix),na.rm=TRUE)) > err.tol){
+     stop("No agreement in Var")
+   }
+   
+   
+ 
+   if(any(abs(rowMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,mean,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowMeans")
+   }
+   
+   
+   if(any(abs(colMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,mean,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colMeans")
+   }
+   
+   
+   if(any(abs(rowSums(buff.matrix,na.rm=TRUE)  -  apply(r.matrix,1,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in rowSums")
+   }
+   
+   
+   if(any(abs(colSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colSums")
+   }
+   
+   ### this is to get around the fact that R doesn't like to compute NA on an entire vector of NA when 
+   ### computing variance
+   my.Var <- function(x,na.rm=FALSE){
+    if (all(is.na(x))){
+      return(NA)
+    } else {
+      var(x,na.rm=na.rm)
+    }
+ 
+   }
+   
+   if(any(abs(rowVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+   
+   
+   if(any(abs(colVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+ 
+ 
+   if(any(abs(rowMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+ 
+   if(any(abs(colMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+   
+   
+   if(any(abs(rowMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+   
+ 
+   if(any(abs(colMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+ 
+   if(any(abs(colMedians(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,median,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMedian")
+   }
+ 
+   if(any(abs(colRanges(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,range,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colRanges")
+   }
+ 
+ 
+   
+ }
> 
> 
> 
> 
> 
> 
> 
> 
> 
> for (rep in 1:20){
+   copymatrix <- matrix(rnorm(200,150,15),10,20)
+   
+   tmp5[1:10,1:20] <- copymatrix
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ## now lets assign some NA values and check agreement
+ 
+   which.row <- sample(1:10,1,replace=TRUE)
+   which.col  <- sample(1:20,1,replace=TRUE)
+   
+   cat(which.row," ",which.col,"\n")
+   
+   tmp5[which.row,which.col] <- NA
+   copymatrix[which.row,which.col] <- NA
+   
+   agree.checks(tmp5,copymatrix)
+ 
+   ## make an entire row NA
+   tmp5[which.row,] <- NA
+   copymatrix[which.row,] <- NA
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ### also make an entire col NA
+   tmp5[,which.col] <- NA
+   copymatrix[,which.col] <- NA
+ 
+   agree.checks(tmp5,copymatrix)
+ 
+   ### now make 1 element non NA with NA in the rest of row and column
+ 
+   tmp5[which.row,which.col] <- rnorm(1,150,15)
+   copymatrix[which.row,which.col] <- tmp5[which.row,which.col]
+ 
+   agree.checks(tmp5,copymatrix)
+ }
5   20 
6   1 
4   7 
2   15 
10   4 
5   5 
5   17 
5   1 
4   4 
7   20 
4   1 
10   3 
9   2 
6   8 
6   6 
7   18 
1   15 
7   14 
4   9 
6   17 
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.489577
> Min(tmp)
[1] -3.016197
> mean(tmp)
[1] 0.1128188
> Sum(tmp)
[1] 11.28188
> Var(tmp)
[1] 1.172176
> 
> rowMeans(tmp)
[1] 0.1128188
> rowSums(tmp)
[1] 11.28188
> rowVars(tmp)
[1] 1.172176
> rowSd(tmp)
[1] 1.082671
> rowMax(tmp)
[1] 2.489577
> rowMin(tmp)
[1] -3.016197
> 
> colMeans(tmp)
  [1]  0.53511306  0.96666555  0.02149241 -0.82074463 -1.98237000 -1.48052491
  [7]  0.31341933  0.53788610  0.60616417 -0.81338435  0.69130021 -0.07215014
 [13] -0.34830814 -0.02470786 -0.01084059  0.61862249  0.11791596  0.69613472
 [19]  2.24001420 -1.86275016  1.28849532  0.24293639  0.12762581 -0.75419083
 [25] -1.60494772  1.51008890  1.11410714  0.36164669 -0.22529098  0.40405241
 [31]  0.37159013  1.94098848  1.82853809  0.34176767  0.00171682  0.26922438
 [37]  0.19950797 -0.67466189  0.90863565 -0.23997478  1.22451248 -0.99933479
 [43]  1.18561458  1.09878576  1.64174137 -0.89614709 -0.57763626 -1.58109616
 [49]  0.36197751  1.31811357 -0.19827286 -0.87793617  0.67703079  1.01003473
 [55]  1.72221042 -0.39740719  0.79751759 -0.38258125  1.46644509 -3.01619710
 [61]  0.90851554  0.41131696 -0.89072975  0.89963204  0.52828925  0.43027379
 [67]  0.21419150  0.92663373  1.63353427 -1.64954283 -0.36342713  0.08451663
 [73] -1.09258101 -1.82457207 -1.16618359  1.53824771 -2.46396211  0.75510987
 [79] -0.78892307  0.04947197  0.24792098 -0.61501827  0.56985185  1.53880851
 [85]  0.22952284 -0.48491229  0.94358969  1.48345500  0.01639552 -0.98054327
 [91]  2.48957673  0.08179014  0.64724719  1.57965470 -0.75478750 -1.10503597
 [97] -0.86013741 -0.64238449 -2.24535235  0.08424787
> colSums(tmp)
  [1]  0.53511306  0.96666555  0.02149241 -0.82074463 -1.98237000 -1.48052491
  [7]  0.31341933  0.53788610  0.60616417 -0.81338435  0.69130021 -0.07215014
 [13] -0.34830814 -0.02470786 -0.01084059  0.61862249  0.11791596  0.69613472
 [19]  2.24001420 -1.86275016  1.28849532  0.24293639  0.12762581 -0.75419083
 [25] -1.60494772  1.51008890  1.11410714  0.36164669 -0.22529098  0.40405241
 [31]  0.37159013  1.94098848  1.82853809  0.34176767  0.00171682  0.26922438
 [37]  0.19950797 -0.67466189  0.90863565 -0.23997478  1.22451248 -0.99933479
 [43]  1.18561458  1.09878576  1.64174137 -0.89614709 -0.57763626 -1.58109616
 [49]  0.36197751  1.31811357 -0.19827286 -0.87793617  0.67703079  1.01003473
 [55]  1.72221042 -0.39740719  0.79751759 -0.38258125  1.46644509 -3.01619710
 [61]  0.90851554  0.41131696 -0.89072975  0.89963204  0.52828925  0.43027379
 [67]  0.21419150  0.92663373  1.63353427 -1.64954283 -0.36342713  0.08451663
 [73] -1.09258101 -1.82457207 -1.16618359  1.53824771 -2.46396211  0.75510987
 [79] -0.78892307  0.04947197  0.24792098 -0.61501827  0.56985185  1.53880851
 [85]  0.22952284 -0.48491229  0.94358969  1.48345500  0.01639552 -0.98054327
 [91]  2.48957673  0.08179014  0.64724719  1.57965470 -0.75478750 -1.10503597
 [97] -0.86013741 -0.64238449 -2.24535235  0.08424787
> 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.53511306  0.96666555  0.02149241 -0.82074463 -1.98237000 -1.48052491
  [7]  0.31341933  0.53788610  0.60616417 -0.81338435  0.69130021 -0.07215014
 [13] -0.34830814 -0.02470786 -0.01084059  0.61862249  0.11791596  0.69613472
 [19]  2.24001420 -1.86275016  1.28849532  0.24293639  0.12762581 -0.75419083
 [25] -1.60494772  1.51008890  1.11410714  0.36164669 -0.22529098  0.40405241
 [31]  0.37159013  1.94098848  1.82853809  0.34176767  0.00171682  0.26922438
 [37]  0.19950797 -0.67466189  0.90863565 -0.23997478  1.22451248 -0.99933479
 [43]  1.18561458  1.09878576  1.64174137 -0.89614709 -0.57763626 -1.58109616
 [49]  0.36197751  1.31811357 -0.19827286 -0.87793617  0.67703079  1.01003473
 [55]  1.72221042 -0.39740719  0.79751759 -0.38258125  1.46644509 -3.01619710
 [61]  0.90851554  0.41131696 -0.89072975  0.89963204  0.52828925  0.43027379
 [67]  0.21419150  0.92663373  1.63353427 -1.64954283 -0.36342713  0.08451663
 [73] -1.09258101 -1.82457207 -1.16618359  1.53824771 -2.46396211  0.75510987
 [79] -0.78892307  0.04947197  0.24792098 -0.61501827  0.56985185  1.53880851
 [85]  0.22952284 -0.48491229  0.94358969  1.48345500  0.01639552 -0.98054327
 [91]  2.48957673  0.08179014  0.64724719  1.57965470 -0.75478750 -1.10503597
 [97] -0.86013741 -0.64238449 -2.24535235  0.08424787
> colMin(tmp)
  [1]  0.53511306  0.96666555  0.02149241 -0.82074463 -1.98237000 -1.48052491
  [7]  0.31341933  0.53788610  0.60616417 -0.81338435  0.69130021 -0.07215014
 [13] -0.34830814 -0.02470786 -0.01084059  0.61862249  0.11791596  0.69613472
 [19]  2.24001420 -1.86275016  1.28849532  0.24293639  0.12762581 -0.75419083
 [25] -1.60494772  1.51008890  1.11410714  0.36164669 -0.22529098  0.40405241
 [31]  0.37159013  1.94098848  1.82853809  0.34176767  0.00171682  0.26922438
 [37]  0.19950797 -0.67466189  0.90863565 -0.23997478  1.22451248 -0.99933479
 [43]  1.18561458  1.09878576  1.64174137 -0.89614709 -0.57763626 -1.58109616
 [49]  0.36197751  1.31811357 -0.19827286 -0.87793617  0.67703079  1.01003473
 [55]  1.72221042 -0.39740719  0.79751759 -0.38258125  1.46644509 -3.01619710
 [61]  0.90851554  0.41131696 -0.89072975  0.89963204  0.52828925  0.43027379
 [67]  0.21419150  0.92663373  1.63353427 -1.64954283 -0.36342713  0.08451663
 [73] -1.09258101 -1.82457207 -1.16618359  1.53824771 -2.46396211  0.75510987
 [79] -0.78892307  0.04947197  0.24792098 -0.61501827  0.56985185  1.53880851
 [85]  0.22952284 -0.48491229  0.94358969  1.48345500  0.01639552 -0.98054327
 [91]  2.48957673  0.08179014  0.64724719  1.57965470 -0.75478750 -1.10503597
 [97] -0.86013741 -0.64238449 -2.24535235  0.08424787
> colMedians(tmp)
  [1]  0.53511306  0.96666555  0.02149241 -0.82074463 -1.98237000 -1.48052491
  [7]  0.31341933  0.53788610  0.60616417 -0.81338435  0.69130021 -0.07215014
 [13] -0.34830814 -0.02470786 -0.01084059  0.61862249  0.11791596  0.69613472
 [19]  2.24001420 -1.86275016  1.28849532  0.24293639  0.12762581 -0.75419083
 [25] -1.60494772  1.51008890  1.11410714  0.36164669 -0.22529098  0.40405241
 [31]  0.37159013  1.94098848  1.82853809  0.34176767  0.00171682  0.26922438
 [37]  0.19950797 -0.67466189  0.90863565 -0.23997478  1.22451248 -0.99933479
 [43]  1.18561458  1.09878576  1.64174137 -0.89614709 -0.57763626 -1.58109616
 [49]  0.36197751  1.31811357 -0.19827286 -0.87793617  0.67703079  1.01003473
 [55]  1.72221042 -0.39740719  0.79751759 -0.38258125  1.46644509 -3.01619710
 [61]  0.90851554  0.41131696 -0.89072975  0.89963204  0.52828925  0.43027379
 [67]  0.21419150  0.92663373  1.63353427 -1.64954283 -0.36342713  0.08451663
 [73] -1.09258101 -1.82457207 -1.16618359  1.53824771 -2.46396211  0.75510987
 [79] -0.78892307  0.04947197  0.24792098 -0.61501827  0.56985185  1.53880851
 [85]  0.22952284 -0.48491229  0.94358969  1.48345500  0.01639552 -0.98054327
 [91]  2.48957673  0.08179014  0.64724719  1.57965470 -0.75478750 -1.10503597
 [97] -0.86013741 -0.64238449 -2.24535235  0.08424787
> colRanges(tmp)
          [,1]      [,2]       [,3]       [,4]     [,5]      [,6]      [,7]
[1,] 0.5351131 0.9666656 0.02149241 -0.8207446 -1.98237 -1.480525 0.3134193
[2,] 0.5351131 0.9666656 0.02149241 -0.8207446 -1.98237 -1.480525 0.3134193
          [,8]      [,9]      [,10]     [,11]       [,12]      [,13]
[1,] 0.5378861 0.6061642 -0.8133844 0.6913002 -0.07215014 -0.3483081
[2,] 0.5378861 0.6061642 -0.8133844 0.6913002 -0.07215014 -0.3483081
           [,14]       [,15]     [,16]    [,17]     [,18]    [,19]    [,20]
[1,] -0.02470786 -0.01084059 0.6186225 0.117916 0.6961347 2.240014 -1.86275
[2,] -0.02470786 -0.01084059 0.6186225 0.117916 0.6961347 2.240014 -1.86275
        [,21]     [,22]     [,23]      [,24]     [,25]    [,26]    [,27]
[1,] 1.288495 0.2429364 0.1276258 -0.7541908 -1.604948 1.510089 1.114107
[2,] 1.288495 0.2429364 0.1276258 -0.7541908 -1.604948 1.510089 1.114107
         [,28]     [,29]     [,30]     [,31]    [,32]    [,33]     [,34]
[1,] 0.3616467 -0.225291 0.4040524 0.3715901 1.940988 1.828538 0.3417677
[2,] 0.3616467 -0.225291 0.4040524 0.3715901 1.940988 1.828538 0.3417677
          [,35]     [,36]    [,37]      [,38]     [,39]      [,40]    [,41]
[1,] 0.00171682 0.2692244 0.199508 -0.6746619 0.9086357 -0.2399748 1.224512
[2,] 0.00171682 0.2692244 0.199508 -0.6746619 0.9086357 -0.2399748 1.224512
          [,42]    [,43]    [,44]    [,45]      [,46]      [,47]     [,48]
[1,] -0.9993348 1.185615 1.098786 1.641741 -0.8961471 -0.5776363 -1.581096
[2,] -0.9993348 1.185615 1.098786 1.641741 -0.8961471 -0.5776363 -1.581096
         [,49]    [,50]      [,51]      [,52]     [,53]    [,54]   [,55]
[1,] 0.3619775 1.318114 -0.1982729 -0.8779362 0.6770308 1.010035 1.72221
[2,] 0.3619775 1.318114 -0.1982729 -0.8779362 0.6770308 1.010035 1.72221
          [,56]     [,57]      [,58]    [,59]     [,60]     [,61]    [,62]
[1,] -0.3974072 0.7975176 -0.3825813 1.466445 -3.016197 0.9085155 0.411317
[2,] -0.3974072 0.7975176 -0.3825813 1.466445 -3.016197 0.9085155 0.411317
          [,63]    [,64]     [,65]     [,66]     [,67]     [,68]    [,69]
[1,] -0.8907298 0.899632 0.5282893 0.4302738 0.2141915 0.9266337 1.633534
[2,] -0.8907298 0.899632 0.5282893 0.4302738 0.2141915 0.9266337 1.633534
         [,70]      [,71]      [,72]     [,73]     [,74]     [,75]    [,76]
[1,] -1.649543 -0.3634271 0.08451663 -1.092581 -1.824572 -1.166184 1.538248
[2,] -1.649543 -0.3634271 0.08451663 -1.092581 -1.824572 -1.166184 1.538248
         [,77]     [,78]      [,79]      [,80]    [,81]      [,82]     [,83]
[1,] -2.463962 0.7551099 -0.7889231 0.04947197 0.247921 -0.6150183 0.5698518
[2,] -2.463962 0.7551099 -0.7889231 0.04947197 0.247921 -0.6150183 0.5698518
        [,84]     [,85]      [,86]     [,87]    [,88]      [,89]      [,90]
[1,] 1.538809 0.2295228 -0.4849123 0.9435897 1.483455 0.01639552 -0.9805433
[2,] 1.538809 0.2295228 -0.4849123 0.9435897 1.483455 0.01639552 -0.9805433
        [,91]      [,92]     [,93]    [,94]      [,95]     [,96]      [,97]
[1,] 2.489577 0.08179014 0.6472472 1.579655 -0.7547875 -1.105036 -0.8601374
[2,] 2.489577 0.08179014 0.6472472 1.579655 -0.7547875 -1.105036 -0.8601374
          [,98]     [,99]     [,100]
[1,] -0.6423845 -2.245352 0.08424787
[2,] -0.6423845 -2.245352 0.08424787
> 
> 
> Max(tmp2)
[1] 3.10921
> Min(tmp2)
[1] -2.215241
> mean(tmp2)
[1] 0.05156729
> Sum(tmp2)
[1] 5.156729
> Var(tmp2)
[1] 0.9201158
> 
> rowMeans(tmp2)
  [1]  1.351253626 -0.534685122 -1.880674033  1.117526144  0.167970996
  [6] -0.114303069 -1.249122474 -0.703419138  0.105388066  0.295822825
 [11]  0.649067593  0.565422130 -0.632112156 -0.382201966 -1.259572580
 [16] -0.134820276 -0.083053341 -0.672527359  1.285298486 -0.186119058
 [21]  0.810896642  0.171778296 -2.215241210  0.007231922 -0.116984757
 [26]  0.024961951 -1.973629123  0.512329274  0.104287310 -0.211890164
 [31]  0.039324462 -0.335139685 -0.869291929 -0.802619813 -0.188491460
 [36] -0.829800339  0.032720373  1.833031505  0.713414457  0.328601482
 [41] -1.395939688 -0.193011944 -0.578669929 -1.522817137  1.613440561
 [46] -0.825814758  1.047059645 -1.109043460 -0.195724527  0.881330815
 [51] -1.777197485  0.437203587  0.388770780 -0.212863434  1.053896916
 [56]  0.415872255 -0.193436154 -0.366416846  0.480175778  1.505285920
 [61] -0.383868435  0.415724792 -0.012788949 -0.687062516  0.790772753
 [66]  0.337811045 -0.060899041 -0.484273340  0.809359294  2.066221831
 [71]  0.337725881 -1.035257906 -0.850037383 -0.979371679  1.239364685
 [76] -0.326254980  0.792320210 -0.987489739 -0.741060578  0.607973407
 [81]  0.056491714  0.580700525  0.384923891 -0.841020600  0.882846244
 [86]  0.124726741  0.889162951  0.674426252 -0.050218148  1.864972927
 [91]  1.245421994 -1.303345099 -0.670810631 -1.042655617  1.360112298
 [96]  0.393038164  0.080957912  2.391066816 -0.014918565  3.109210272
> rowSums(tmp2)
  [1]  1.351253626 -0.534685122 -1.880674033  1.117526144  0.167970996
  [6] -0.114303069 -1.249122474 -0.703419138  0.105388066  0.295822825
 [11]  0.649067593  0.565422130 -0.632112156 -0.382201966 -1.259572580
 [16] -0.134820276 -0.083053341 -0.672527359  1.285298486 -0.186119058
 [21]  0.810896642  0.171778296 -2.215241210  0.007231922 -0.116984757
 [26]  0.024961951 -1.973629123  0.512329274  0.104287310 -0.211890164
 [31]  0.039324462 -0.335139685 -0.869291929 -0.802619813 -0.188491460
 [36] -0.829800339  0.032720373  1.833031505  0.713414457  0.328601482
 [41] -1.395939688 -0.193011944 -0.578669929 -1.522817137  1.613440561
 [46] -0.825814758  1.047059645 -1.109043460 -0.195724527  0.881330815
 [51] -1.777197485  0.437203587  0.388770780 -0.212863434  1.053896916
 [56]  0.415872255 -0.193436154 -0.366416846  0.480175778  1.505285920
 [61] -0.383868435  0.415724792 -0.012788949 -0.687062516  0.790772753
 [66]  0.337811045 -0.060899041 -0.484273340  0.809359294  2.066221831
 [71]  0.337725881 -1.035257906 -0.850037383 -0.979371679  1.239364685
 [76] -0.326254980  0.792320210 -0.987489739 -0.741060578  0.607973407
 [81]  0.056491714  0.580700525  0.384923891 -0.841020600  0.882846244
 [86]  0.124726741  0.889162951  0.674426252 -0.050218148  1.864972927
 [91]  1.245421994 -1.303345099 -0.670810631 -1.042655617  1.360112298
 [96]  0.393038164  0.080957912  2.391066816 -0.014918565  3.109210272
> rowVars(tmp2)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowSd(tmp2)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowMax(tmp2)
  [1]  1.351253626 -0.534685122 -1.880674033  1.117526144  0.167970996
  [6] -0.114303069 -1.249122474 -0.703419138  0.105388066  0.295822825
 [11]  0.649067593  0.565422130 -0.632112156 -0.382201966 -1.259572580
 [16] -0.134820276 -0.083053341 -0.672527359  1.285298486 -0.186119058
 [21]  0.810896642  0.171778296 -2.215241210  0.007231922 -0.116984757
 [26]  0.024961951 -1.973629123  0.512329274  0.104287310 -0.211890164
 [31]  0.039324462 -0.335139685 -0.869291929 -0.802619813 -0.188491460
 [36] -0.829800339  0.032720373  1.833031505  0.713414457  0.328601482
 [41] -1.395939688 -0.193011944 -0.578669929 -1.522817137  1.613440561
 [46] -0.825814758  1.047059645 -1.109043460 -0.195724527  0.881330815
 [51] -1.777197485  0.437203587  0.388770780 -0.212863434  1.053896916
 [56]  0.415872255 -0.193436154 -0.366416846  0.480175778  1.505285920
 [61] -0.383868435  0.415724792 -0.012788949 -0.687062516  0.790772753
 [66]  0.337811045 -0.060899041 -0.484273340  0.809359294  2.066221831
 [71]  0.337725881 -1.035257906 -0.850037383 -0.979371679  1.239364685
 [76] -0.326254980  0.792320210 -0.987489739 -0.741060578  0.607973407
 [81]  0.056491714  0.580700525  0.384923891 -0.841020600  0.882846244
 [86]  0.124726741  0.889162951  0.674426252 -0.050218148  1.864972927
 [91]  1.245421994 -1.303345099 -0.670810631 -1.042655617  1.360112298
 [96]  0.393038164  0.080957912  2.391066816 -0.014918565  3.109210272
> rowMin(tmp2)
  [1]  1.351253626 -0.534685122 -1.880674033  1.117526144  0.167970996
  [6] -0.114303069 -1.249122474 -0.703419138  0.105388066  0.295822825
 [11]  0.649067593  0.565422130 -0.632112156 -0.382201966 -1.259572580
 [16] -0.134820276 -0.083053341 -0.672527359  1.285298486 -0.186119058
 [21]  0.810896642  0.171778296 -2.215241210  0.007231922 -0.116984757
 [26]  0.024961951 -1.973629123  0.512329274  0.104287310 -0.211890164
 [31]  0.039324462 -0.335139685 -0.869291929 -0.802619813 -0.188491460
 [36] -0.829800339  0.032720373  1.833031505  0.713414457  0.328601482
 [41] -1.395939688 -0.193011944 -0.578669929 -1.522817137  1.613440561
 [46] -0.825814758  1.047059645 -1.109043460 -0.195724527  0.881330815
 [51] -1.777197485  0.437203587  0.388770780 -0.212863434  1.053896916
 [56]  0.415872255 -0.193436154 -0.366416846  0.480175778  1.505285920
 [61] -0.383868435  0.415724792 -0.012788949 -0.687062516  0.790772753
 [66]  0.337811045 -0.060899041 -0.484273340  0.809359294  2.066221831
 [71]  0.337725881 -1.035257906 -0.850037383 -0.979371679  1.239364685
 [76] -0.326254980  0.792320210 -0.987489739 -0.741060578  0.607973407
 [81]  0.056491714  0.580700525  0.384923891 -0.841020600  0.882846244
 [86]  0.124726741  0.889162951  0.674426252 -0.050218148  1.864972927
 [91]  1.245421994 -1.303345099 -0.670810631 -1.042655617  1.360112298
 [96]  0.393038164  0.080957912  2.391066816 -0.014918565  3.109210272
> 
> colMeans(tmp2)
[1] 0.05156729
> colSums(tmp2)
[1] 5.156729
> colVars(tmp2)
[1] 0.9201158
> colSd(tmp2)
[1] 0.9592267
> colMax(tmp2)
[1] 3.10921
> colMin(tmp2)
[1] -2.215241
> colMedians(tmp2)
[1] 0.01609694
> colRanges(tmp2)
          [,1]
[1,] -2.215241
[2,]  3.109210
> 
> 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]  2.5500210  2.9564451  3.9306304 -3.0094744 -2.4211252  2.0644033
 [7]  3.8951788 -0.7586551 -2.3800392  1.7205459
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -1.5306238
[2,] -0.3052192
[3,]  0.0259193
[4,]  0.4448385
[5,]  2.1708287
> 
> rowApply(tmp,sum)
 [1]  3.94683865  0.02838444 -3.35741294  1.15340499  2.26617317  6.35558301
 [7] -1.66798454 -2.17622571  1.17406406  0.82510552
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    6    3    8    5    9    8    6    2    3     4
 [2,]    4    8    1    9    6    4   10    4    9     8
 [3,]    8    6    7    7    8    2    9    6    8     7
 [4,]    3    4    5    3    2    3    4    9    2     6
 [5,]   10    1    9    6    4    1    3   10    6     1
 [6,]    9    5    3    8    3    9    1    7    7     5
 [7,]    5    9    2    2   10   10    7    1    5    10
 [8,]    2    2    4    4    7    7    5    8    1     9
 [9,]    1   10   10    1    1    5    8    3    4     3
[10,]    7    7    6   10    5    6    2    5   10     2
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1]  4.7006877  1.6966054  5.2326090  2.8393490  3.3054484  0.6904145
 [7]  4.2041492 -3.9931124 -0.9749422 -3.3389143 -2.4521782  0.1852862
[13] -2.8673857 -1.4119925  2.4292806 -2.1968368 -2.2385641  0.4789891
[19] -0.2338996 -3.3820063
> colApply(tmp,quantile)[,1]
          [,1]
[1,] 0.4988112
[2,] 0.9459065
[3,] 0.9579490
[4,] 1.1407914
[5,] 1.1572295
> 
> rowApply(tmp,sum)
[1] -2.9735665 10.8309469 -2.1510795 -0.4187777 -2.6145363
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]   14   13   18   16   19
[2,]   17    5    9    7   20
[3,]   20   14   20   17    4
[4,]    9    4   19   20   15
[5,]   16   20   10   14    9
> 
> 
> as.matrix(tmp)
          [,1]       [,2]       [,3]       [,4]        [,5]       [,6]
[1,] 0.4988112  1.3302698  1.9193069 -0.4046260  1.00573183 -0.1970131
[2,] 1.1407914 -0.1298562  1.1660746 -0.5581900  2.08620080  1.2326437
[3,] 1.1572295 -0.3759143  2.0320564  1.2654502 -0.37485920 -0.7266863
[4,] 0.9459065 -0.2147264  1.1146613  2.2497365  0.65169550  0.7001280
[5,] 0.9579490  1.0868326 -0.9994903  0.2869783 -0.06332051 -0.3186578
          [,7]       [,8]        [,9]      [,10]       [,11]       [,12]
[1,] 0.7527251 -2.2257811 -1.26987659 -0.2012939 -2.74206283 -0.41260745
[2,] 1.8727610  1.2929182  1.79639282 -0.8849815  0.68524853 -0.09529467
[3,] 0.6419293 -0.1803768 -1.37933859 -0.4432774  0.27637789 -0.91706913
[4,] 0.3910046 -1.2590422 -0.21362260 -0.5979871 -0.08693185  1.56576127
[5,] 0.5457291 -1.6208305  0.09150278 -1.2113745 -0.58480992  0.04449617
          [,13]      [,14]      [,15]      [,16]     [,17]       [,18]
[1,] -0.8633194  1.6988402  0.1422895 -0.5530424 -1.612019 -0.04222438
[2,] -1.1848904  0.2011093  1.7057948  0.6626209  0.387376 -0.11623650
[3,] -0.6079747  0.8984910 -0.7579595 -0.7734821  0.529613  0.12459305
[4,]  0.1838354 -2.1917807  1.4457544 -1.6386828 -1.740169 -0.02168069
[5,] -0.3950366 -2.0186523 -0.1065985  0.1057495  0.196635  0.53453758
          [,19]       [,20]
[1,]  1.4542983 -1.25197274
[2,] -1.3997961  0.97026023
[3,]  0.7463147 -3.28619658
[4,] -1.8766492  0.17401095
[5,]  0.8419327  0.01189185
> 
> 
> 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 :  649  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 :  563  bytes.
Disk usage :  160  bytes.
> subBufferedMatrix(tmp,1:3,)
BufferedMatrix object
Matrix size:  3 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  480  bytes.
> 
> 
> rm(tmp)
> 
> 
> ###
> ### Testing colnames and rownames
> ###
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> 
> 
> colnames(tmp)
NULL
> rownames(tmp)
NULL
> 
> 
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> colnames(tmp)
 [1] "col1"  "col2"  "col3"  "col4"  "col5"  "col6"  "col7"  "col8"  "col9" 
[10] "col10" "col11" "col12" "col13" "col14" "col15" "col16" "col17" "col18"
[19] "col19" "col20"
> rownames(tmp)
[1] "row1" "row2" "row3" "row4" "row5"
> 
> 
> tmp["row1",]
           col1       col2      col3       col4     col5      col6       col7
row1 -0.4173099 0.05668397 0.2642244 -0.3061434 1.808356 -1.501111 -0.9160042
          col8        col9      col10     col11    col12     col13     col14
row1 -1.037022 -0.05456617 -0.9657978 0.1041867 1.061933 0.9765431 0.4154449
         col15      col16      col17     col18      col19      col20
row1 -1.123795 -0.6445995 -0.2987451 0.7760271 -0.7780108 0.01278314
> tmp[,"col10"]
          col10
row1 -0.9657978
row2 -0.6084917
row3  0.9639715
row4 -0.3388435
row5  1.8590475
> tmp[c("row1","row5"),]
           col1        col2      col3       col4      col5       col6
row1 -0.4173099  0.05668397 0.2642244 -0.3061434 1.8083563 -1.5011115
row5 -0.3550221 -0.34962967 1.7884629  0.1347426 0.8372178  0.8259134
           col7      col8        col9      col10        col11      col12
row1 -0.9160042 -1.037022 -0.05456617 -0.9657978  0.104186750  1.0619335
row5 -0.7673258  1.453008  0.34917035  1.8590475 -0.001889258 -0.3923041
         col13      col14      col15      col16      col17     col18      col19
row1 0.9765431  0.4154449 -1.1237949 -0.6445995 -0.2987451 0.7760271 -0.7780108
row5 1.6962198 -0.9324305 -0.0727687  1.0504536 -0.5204179 1.0057402  1.0125407
          col20
row1 0.01278314
row5 0.85667004
> tmp[,c("col6","col20")]
           col6       col20
row1 -1.5011115  0.01278314
row2  0.2207528 -0.55294949
row3 -0.4934750 -1.14732716
row4  1.8458146  0.59653592
row5  0.8259134  0.85667004
> tmp[c("row1","row5"),c("col6","col20")]
           col6      col20
row1 -1.5011115 0.01278314
row5  0.8259134 0.85667004
> 
> 
> 
> 
> 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.40462 51.9042 50.40014 48.3039 51.8588 104.5135 51.53294 50.48649
         col9    col10    col11    col12    col13    col14    col15    col16
row1 51.51886 49.35114 51.49336 49.88486 48.81597 48.40617 48.95559 48.49416
        col17    col18    col19    col20
row1 50.30808 49.63163 49.33416 107.3307
> tmp[,"col10"]
        col10
row1 49.35114
row2 30.35335
row3 30.61719
row4 29.46352
row5 51.38116
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 49.40462 51.90420 50.40014 48.30390 51.85880 104.5135 51.53294 50.48649
row5 51.60204 50.34536 49.43422 50.54746 49.46522 106.2009 50.62624 50.74930
         col9    col10    col11    col12    col13    col14    col15    col16
row1 51.51886 49.35114 51.49336 49.88486 48.81597 48.40617 48.95559 48.49416
row5 50.18920 51.38116 50.24352 50.82100 50.84814 50.43989 50.33477 49.22933
        col17    col18    col19    col20
row1 50.30808 49.63163 49.33416 107.3307
row5 51.05635 49.11794 49.75287 104.5869
> tmp[,c("col6","col20")]
          col6     col20
row1 104.51347 107.33071
row2  74.97510  75.43972
row3  76.32324  75.88832
row4  74.49043  75.82244
row5 106.20092 104.58693
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 104.5135 107.3307
row5 106.2009 104.5869
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 104.5135 107.3307
row5 106.2009 104.5869
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
          col13
[1,]  0.8465544
[2,]  0.1402164
[3,] -0.9840253
[4,]  0.5316208
[5,] -0.8005553
> tmp[,c("col17","col7")]
          col17       col7
[1,]  0.1270684  1.1143696
[2,]  2.4904311  0.5626898
[3,] -1.5348908  0.8380398
[4,] -0.1937163 -0.1113629
[5,]  0.8432523  0.5162441
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
           col6       col20
[1,]  1.5711017 -0.34236839
[2,] -0.7781087 -1.24485332
[3,] -0.6401341  0.04792711
[4,] -1.1816652 -0.71267550
[5,]  0.1251590  2.06687731
> subBufferedMatrix(tmp,1,c("col6"))[,1]
         col1
[1,] 1.571102
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
           col6
[1,]  1.5711017
[2,] -0.7781087
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> 
> 
> 
> subBufferedMatrix(tmp,c("row3","row1"),)[,1:20]
           [,1]        [,2]       [,3]       [,4]       [,5]       [,6]
row3  0.6482191 -0.04078097 -0.2086375  0.6539213  1.6698262  0.5255976
row1 -2.0137983 -1.53771385  2.1559068 -0.3499747 -0.9428763 -1.0840517
           [,7]       [,8]        [,9]      [,10]      [,11]      [,12]
row3 0.26159648 -0.8210932 -0.68924508  0.2326546  0.7768813 -1.4799388
row1 0.08667052 -0.4953783 -0.09715016 -0.3750137 -1.6616586  0.5049398
          [,13]     [,14]     [,15]      [,16]      [,17]      [,18]     [,19]
row3 0.34449361 0.5416133 0.3743657  0.8002712 -0.5797033 -0.4466915 1.1480797
row1 0.09498935 0.2284273 0.6187607 -0.6345476  0.6178020 -1.2291219 0.4709502
          [,20]
row3 -1.1063396
row1 -0.9970773
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
        [,1]      [,2]     [,3]     [,4]      [,5]       [,6]      [,7]
row2 0.42704 0.2423721 1.204015 1.019524 0.8146094 -0.1288879 0.9484981
         [,8]     [,9]     [,10]
row2 1.423025 1.295783 -0.855985
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
          [,1]      [,2]       [,3]      [,4]     [,5]       [,6]     [,7]
row5 0.9075953 0.4897486 -0.7273524 -1.523476 1.683942 -0.8690809 1.561935
           [,8]       [,9]     [,10]     [,11]      [,12]     [,13]       [,14]
row5 -0.7601895 -0.6111125 -0.450207 0.1290095 -0.3260723 -1.127266 -0.06564033
          [,15]     [,16]     [,17]      [,18]     [,19]      [,20]
row5 -0.1825663 0.8281985 -1.602177 -0.1077271 0.2255938 -0.5426779
> 
> 
> 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: 0x600003f40000>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM32cf37c54b8e"
 [2] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM32cf79e3743c"
 [3] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM32cf43e44da8"
 [4] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM32cf41a6736a"
 [5] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM32cf16e355d2"
 [6] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM32cf271759bb"
 [7] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM32cf6e041809"
 [8] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM32cf4ec62f4c"
 [9] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM32cf354b4efb"
[10] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM32cf632e5c12"
[11] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM32cf789ed49c"
[12] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM32cf3988ba2" 
[13] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM32cf13f73a86"
[14] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM32cf4c233da7"
[15] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM32cf1da4c5fe"
> 
> 
> ### 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: 0x600003f4c060>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x600003f4c060>
Warning message:
In dir.create(new.directory) :
  '/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x600003f4c060>
> rowMedians(tmp)
  [1] -0.072734209  0.286621894  0.041182723  0.122109091  0.556912683
  [6] -0.221482180 -0.598601356  0.457987771 -0.470859213 -0.210249446
 [11] -0.087096167 -0.421078698  0.472536372 -0.194542212  0.203999083
 [16]  0.044751750 -0.859924230 -0.532906131  0.010754317  0.425589722
 [21] -0.287311235 -0.270795585  0.064710930 -0.014620116 -0.090718575
 [26]  0.235997084 -0.352809318 -0.120025670  0.552091876 -0.427663906
 [31] -0.294458356  0.533874352 -0.184040563  0.147893505  0.473243690
 [36] -0.563371047  0.589130340  0.263672215 -0.428645575 -0.167249047
 [41] -0.216415417  0.307414945  0.121374671 -0.156472063  0.372511249
 [46] -0.002244571  0.071579801  0.187934779 -0.513320373 -0.271998376
 [51]  0.253190846  0.045701066  0.121370471  0.139897567 -0.343801747
 [56]  0.145219217 -0.406126509 -0.562715422 -0.107210998  0.434372144
 [61] -0.379811856  0.128517091  0.034771316  0.086101750 -0.112045303
 [66]  0.322330547  0.132596182  0.557057593  0.155037756 -0.377852269
 [71]  0.022632908  0.177940143 -0.106090478  0.049243583 -0.213723165
 [76] -0.831807345  0.001697831 -0.016380294 -0.202260078 -0.004366357
 [81] -0.039024774 -0.040923554  0.257053934 -0.429650717 -0.178230094
 [86] -0.140023044 -0.245677491 -0.164846632 -0.189822832 -0.493221223
 [91]  0.014310102  0.196951150  0.127253482  0.115898335  0.033720629
 [96] -0.184927294  0.412050753 -0.151375343 -0.093563429 -0.171711967
[101]  0.045630994  0.122737956 -0.210667624  0.241754538  0.196344864
[106] -0.248503093 -0.317396768  0.349083402  0.055395366  0.401918062
[111]  0.130560957  0.557220252 -0.045970294  0.161441409 -0.040254754
[116] -0.008726054 -0.500057511 -0.175607818 -0.270262643  0.636898511
[121] -0.251733751  0.559146791  0.276557072  0.313376158 -0.610386487
[126]  0.702106274 -0.403211519 -0.339747344  0.146004588  0.463636388
[131]  0.078734400 -0.108722648 -0.359707705  0.112252346  0.409030305
[136] -0.492800968 -0.053931107 -0.554081412  0.109460588 -0.323177245
[141]  0.414573606  0.024204096 -0.111093424 -0.214410902  0.203581780
[146]  0.093395383 -0.539153199 -0.156879317 -0.144330259  0.405741689
[151] -0.232482229 -0.094625131  0.146668537 -0.136367638 -0.171210003
[156]  0.257392899  0.023503383  0.213730159 -0.277507756  0.691524210
[161] -0.461334537  0.225109643  0.534044571  0.326675131 -0.027305332
[166]  0.411635744 -0.044179418  0.220244740  0.294079166 -0.108368762
[171] -0.280418057  0.237478554  0.328321788  0.264132185  0.533048515
[176] -0.068656523  0.188054638 -0.435488461  0.170026709  0.178435928
[181]  0.425002014  0.132647171 -0.322399662  0.517231010 -0.145491263
[186]  0.148539355 -0.098293363 -0.569789990 -0.156529878  0.253920322
[191] -0.122462163  0.379204053  0.455692738 -0.195080159 -0.048889288
[196] -0.935903378  0.475245852 -0.228333312 -0.231579358 -0.219282886
[201] -0.192280500  0.068849373 -0.418086827 -0.035633353 -0.394219729
[206]  0.097315348 -0.032890512  0.016654238  0.182067438  0.180856737
[211]  0.234220532  0.087805416 -0.305024414 -0.323127870  0.665573977
[216] -0.251033362  0.034645612 -0.438625827 -0.623425377 -0.290519010
[221] -0.207130213 -0.115014244  0.443673820  0.068810608 -0.291379346
[226]  0.043521031 -0.214748591  0.731785859 -0.178668231 -0.184040022
> 
> proc.time()
   user  system elapsed 
  0.690   3.535   4.692 

BufferedMatrix.Rcheck/tests/rawCalltesting.Rout


R Under development (unstable) (2025-11-04 r88984) -- "Unsuffered Consequences"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: aarch64-apple-darwin20

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

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

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

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

Attaching package: 'BufferedMatrix'

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

    colMeans, colSums, rowMeans, rowSums

> 
> prefix <- "dbmtest"
> directory <- getwd()
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_Test_C",P)
RBufferedMatrix
Checking dimensions
Rows: 5
Cols: 5
Buffer Rows: 1
Buffer Cols: 1

Assigning Values
0.000000 1.000000 2.000000 3.000000 4.000000 
1.000000 2.000000 3.000000 4.000000 5.000000 
2.000000 3.000000 4.000000 5.000000 6.000000 
3.000000 4.000000 5.000000 6.000000 7.000000 
4.000000 5.000000 6.000000 7.000000 8.000000 

<pointer: 0x600003e4c000>
> .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: 0x600003e4c000>
> .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: 0x600003e4c000>
> .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: 0x600003e4c000>
> 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: 0x600003e40360>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600003e40360>
> .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: 0x600003e40360>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600003e40360>
> .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: 0x600003e40360>
> 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: 0x600003e40540>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600003e40540>
> .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: 0x600003e40540>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x600003e40540>
> .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: 0x600003e40540>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x600003e40540>
> .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: 0x600003e40540>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x600003e40540>
> .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: 0x600003e40540>
> 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: 0x600003e40720>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x600003e40720>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600003e40720>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600003e40720>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile36fa73647d5"  "BufferedMatrixFile36fa7ca5f4a5"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile36fa73647d5"  "BufferedMatrixFile36fa7ca5f4a5"
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x600003e6c6c0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600003e6c6c0>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x600003e6c6c0>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x600003e6c6c0>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x600003e6c6c0>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x600003e6c6c0>
> .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: 0x600003e6c840>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600003e6c840>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x600003e6c840>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x600003e6c840>
> 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: 0x600003e6ca20>
> .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: 0x600003e6ca20>
> rm(P)
> 
> proc.time()
   user  system elapsed 
  0.136   0.060   0.197 

BufferedMatrix.Rcheck/tests/Rcodetesting.Rout


R Under development (unstable) (2025-11-04 r88984) -- "Unsuffered Consequences"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: aarch64-apple-darwin20

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

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

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

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

Attaching package: 'BufferedMatrix'

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

    colMeans, colSums, rowMeans, rowSums

> 
> Temp <- createBufferedMatrix(100)
> dim(Temp)
[1] 100   0
> buffer.dim(Temp)
[1] 1 1
> 
> 
> proc.time()
   user  system elapsed 
  0.133   0.035   0.163 

Example timings