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

This page was generated on 2025-12-17 11:35 -0500 (Wed, 17 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" 4589
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-16 13:40 -0500 (Tue, 16 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-16 18:45:48 -0500 (Tue, 16 Dec 2025)
EndedAt: 2025-12-16 18:46:08 -0500 (Tue, 16 Dec 2025)
EllapsedTime: 20.3 seconds
RetCode: 0
Status:   WARNINGS  
CheckDir: BufferedMatrix.Rcheck
Warnings: 1

Command output

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


* using log directory ‘/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck’
* using R 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.135   0.062   0.198 

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] "Tue Dec 16 18:45:59 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] "Tue Dec 16 18:45:59 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: 0x6000002dc000>
> 
> 
> 
> 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] "Tue Dec 16 18:46:00 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] "Tue Dec 16 18:46:01 2025"
> 
> ColMode(tmp2)
<pointer: 0x6000002dc000>
> 
> 
> 
> ### 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.5751094 -0.4152576  0.7545663  0.3803852
[2,]   0.9019187  0.5301815 -0.5743683 -0.9043442
[3,]   0.4986565 -0.8692558 -0.2655492  1.0922155
[4,]   1.9829784  0.9091536  0.2636567 -0.1196489
> 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.5751094 0.4152576 0.7545663 0.3803852
[2,]   0.9019187 0.5301815 0.5743683 0.9043442
[3,]   0.4986565 0.8692558 0.2655492 1.0922155
[4,]   1.9829784 0.9091536 0.2636567 0.1196489
> 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.0287142 0.6444049 0.8686578 0.6167538
[2,]  0.9496940 0.7281357 0.7578709 0.9509701
[3,]  0.7061562 0.9323389 0.5153146 1.0450911
[4,]  1.4081827 0.9534955 0.5134751 0.3459030
> 
> 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.86225 31.85931 34.44114 31.54792
[2,]  35.39886 32.81154 33.15308 35.41405
[3,]  32.56022 35.19264 30.41870 36.54313
[4,]  41.06481 35.44411 30.39841 28.57868
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x6000002d8000>
> exp(tmp5)
<pointer: 0x6000002d8000>
> log(tmp5,2)
<pointer: 0x6000002d8000>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 470.1027
> Min(tmp5)
[1] 54.47073
> mean(tmp5)
[1] 72.36869
> Sum(tmp5)
[1] 14473.74
> Var(tmp5)
[1] 864.0659
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 90.77208 72.33771 69.32146 69.84152 69.08248 70.02420 70.07333 69.99181
 [9] 69.52834 72.71399
> rowSums(tmp5)
 [1] 1815.442 1446.754 1386.429 1396.830 1381.650 1400.484 1401.467 1399.836
 [9] 1390.567 1454.280
> rowVars(tmp5)
 [1] 8015.75940   38.65641   83.31350   67.33665   46.92809   62.12651
 [7]   72.01803  119.33751   55.28848   78.91674
> rowSd(tmp5)
 [1] 89.530773  6.217428  9.127623  8.205891  6.850408  7.882037  8.486344
 [8] 10.924171  7.435623  8.883510
> rowMax(tmp5)
 [1] 470.10269  82.15172  87.29822  85.47101  86.07281  82.86271  86.97874
 [8]  95.03129  82.30404  91.57048
> rowMin(tmp5)
 [1] 57.45126 59.23182 56.19639 59.08973 59.53333 54.47073 56.63028 54.80907
 [9] 57.33317 58.84697
> 
> colMeans(tmp5)
 [1] 112.08936  70.82235  68.36748  69.65932  67.29718  68.56457  69.64929
 [8]  74.17278  68.59959  71.38645  73.02963  72.21871  73.86555  70.62272
[15]  71.48865  71.18234  69.86742  71.00383  64.20275  69.28391
> colSums(tmp5)
 [1] 1120.8936  708.2235  683.6748  696.5932  672.9718  685.6457  696.4929
 [8]  741.7278  685.9959  713.8645  730.2963  722.1871  738.6555  706.2272
[15]  714.8865  711.8234  698.6742  710.0383  642.0275  692.8391
> colVars(tmp5)
 [1] 15897.80924    50.36828    19.79015    39.83034    55.23069    62.37159
 [7]    61.23144    83.91781    72.70554    72.45551   118.54209    76.05350
[13]    66.84047    63.65893    83.67227   104.55714    53.04353    83.75595
[19]    44.74546    37.39609
> colSd(tmp5)
 [1] 126.086515   7.097061   4.448612   6.311128   7.431735   7.897568
 [7]   7.825052   9.160666   8.526754   8.512080  10.887704   8.720866
[13]   8.175602   7.978655   9.147255  10.225318   7.283099   9.151828
[19]   6.689204   6.115234
> colMax(tmp5)
 [1] 470.10269  79.24606  74.64722  78.93880  77.85751  79.28466  82.02821
 [8]  87.29822  81.82593  85.76878  95.03129  84.69206  91.57048  80.81882
[15]  86.97874  91.43265  79.62766  86.37377  75.76115  82.30404
> colMin(tmp5)
 [1] 58.84697 54.80907 62.64018 59.48277 54.47073 56.63028 57.45126 57.99813
 [9] 57.33317 56.19639 59.08973 58.81818 63.43074 57.82249 59.23182 59.53912
[17] 58.15320 61.98201 55.19753 60.77750
> 
> 
> ### 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] 90.77208 72.33771 69.32146       NA 69.08248 70.02420 70.07333 69.99181
 [9] 69.52834 72.71399
> rowSums(tmp5)
 [1] 1815.442 1446.754 1386.429       NA 1381.650 1400.484 1401.467 1399.836
 [9] 1390.567 1454.280
> rowVars(tmp5)
 [1] 8015.75940   38.65641   83.31350   56.79215   46.92809   62.12651
 [7]   72.01803  119.33751   55.28848   78.91674
> rowSd(tmp5)
 [1] 89.530773  6.217428  9.127623  7.536056  6.850408  7.882037  8.486344
 [8] 10.924171  7.435623  8.883510
> rowMax(tmp5)
 [1] 470.10269  82.15172  87.29822        NA  86.07281  82.86271  86.97874
 [8]  95.03129  82.30404  91.57048
> rowMin(tmp5)
 [1] 57.45126 59.23182 56.19639       NA 59.53333 54.47073 56.63028 54.80907
 [9] 57.33317 58.84697
> 
> colMeans(tmp5)
 [1]       NA 70.82235 68.36748 69.65932 67.29718 68.56457 69.64929 74.17278
 [9] 68.59959 71.38645 73.02963 72.21871 73.86555 70.62272 71.48865 71.18234
[17] 69.86742 71.00383 64.20275 69.28391
> colSums(tmp5)
 [1]       NA 708.2235 683.6748 696.5932 672.9718 685.6457 696.4929 741.7278
 [9] 685.9959 713.8645 730.2963 722.1871 738.6555 706.2272 714.8865 711.8234
[17] 698.6742 710.0383 642.0275 692.8391
> colVars(tmp5)
 [1]        NA  50.36828  19.79015  39.83034  55.23069  62.37159  61.23144
 [8]  83.91781  72.70554  72.45551 118.54209  76.05350  66.84047  63.65893
[15]  83.67227 104.55714  53.04353  83.75595  44.74546  37.39609
> colSd(tmp5)
 [1]        NA  7.097061  4.448612  6.311128  7.431735  7.897568  7.825052
 [8]  9.160666  8.526754  8.512080 10.887704  8.720866  8.175602  7.978655
[15]  9.147255 10.225318  7.283099  9.151828  6.689204  6.115234
> colMax(tmp5)
 [1]       NA 79.24606 74.64722 78.93880 77.85751 79.28466 82.02821 87.29822
 [9] 81.82593 85.76878 95.03129 84.69206 91.57048 80.81882 86.97874 91.43265
[17] 79.62766 86.37377 75.76115 82.30404
> colMin(tmp5)
 [1]       NA 54.80907 62.64018 59.48277 54.47073 56.63028 57.45126 57.99813
 [9] 57.33317 56.19639 59.08973 58.81818 63.43074 57.82249 59.23182 59.53912
[17] 58.15320 61.98201 55.19753 60.77750
> 
> Max(tmp5,na.rm=TRUE)
[1] 470.1027
> Min(tmp5,na.rm=TRUE)
[1] 54.47073
> mean(tmp5,na.rm=TRUE)
[1] 72.30285
> Sum(tmp5,na.rm=TRUE)
[1] 14388.27
> Var(tmp5,na.rm=TRUE)
[1] 867.5585
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 90.77208 72.33771 69.32146 69.01892 69.08248 70.02420 70.07333 69.99181
 [9] 69.52834 72.71399
> rowSums(tmp5,na.rm=TRUE)
 [1] 1815.442 1446.754 1386.429 1311.359 1381.650 1400.484 1401.467 1399.836
 [9] 1390.567 1454.280
> rowVars(tmp5,na.rm=TRUE)
 [1] 8015.75940   38.65641   83.31350   56.79215   46.92809   62.12651
 [7]   72.01803  119.33751   55.28848   78.91674
> rowSd(tmp5,na.rm=TRUE)
 [1] 89.530773  6.217428  9.127623  7.536056  6.850408  7.882037  8.486344
 [8] 10.924171  7.435623  8.883510
> rowMax(tmp5,na.rm=TRUE)
 [1] 470.10269  82.15172  87.29822  82.47816  86.07281  82.86271  86.97874
 [8]  95.03129  82.30404  91.57048
> rowMin(tmp5,na.rm=TRUE)
 [1] 57.45126 59.23182 56.19639 59.08973 59.53333 54.47073 56.63028 54.80907
 [9] 57.33317 58.84697
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 115.04696  70.82235  68.36748  69.65932  67.29718  68.56457  69.64929
 [8]  74.17278  68.59959  71.38645  73.02963  72.21871  73.86555  70.62272
[15]  71.48865  71.18234  69.86742  71.00383  64.20275  69.28391
> colSums(tmp5,na.rm=TRUE)
 [1] 1035.4226  708.2235  683.6748  696.5932  672.9718  685.6457  696.4929
 [8]  741.7278  685.9959  713.8645  730.2963  722.1871  738.6555  706.2272
[15]  714.8865  711.8234  698.6742  710.0383  642.0275  692.8391
> colVars(tmp5,na.rm=TRUE)
 [1] 17786.62751    50.36828    19.79015    39.83034    55.23069    62.37159
 [7]    61.23144    83.91781    72.70554    72.45551   118.54209    76.05350
[13]    66.84047    63.65893    83.67227   104.55714    53.04353    83.75595
[19]    44.74546    37.39609
> colSd(tmp5,na.rm=TRUE)
 [1] 133.366516   7.097061   4.448612   6.311128   7.431735   7.897568
 [7]   7.825052   9.160666   8.526754   8.512080  10.887704   8.720866
[13]   8.175602   7.978655   9.147255  10.225318   7.283099   9.151828
[19]   6.689204   6.115234
> colMax(tmp5,na.rm=TRUE)
 [1] 470.10269  79.24606  74.64722  78.93880  77.85751  79.28466  82.02821
 [8]  87.29822  81.82593  85.76878  95.03129  84.69206  91.57048  80.81882
[15]  86.97874  91.43265  79.62766  86.37377  75.76115  82.30404
> colMin(tmp5,na.rm=TRUE)
 [1] 58.84697 54.80907 62.64018 59.48277 54.47073 56.63028 57.45126 57.99813
 [9] 57.33317 56.19639 59.08973 58.81818 63.43074 57.82249 59.23182 59.53912
[17] 58.15320 61.98201 55.19753 60.77750
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1] 90.77208 72.33771 69.32146      NaN 69.08248 70.02420 70.07333 69.99181
 [9] 69.52834 72.71399
> rowSums(tmp5,na.rm=TRUE)
 [1] 1815.442 1446.754 1386.429    0.000 1381.650 1400.484 1401.467 1399.836
 [9] 1390.567 1454.280
> rowVars(tmp5,na.rm=TRUE)
 [1] 8015.75940   38.65641   83.31350         NA   46.92809   62.12651
 [7]   72.01803  119.33751   55.28848   78.91674
> rowSd(tmp5,na.rm=TRUE)
 [1] 89.530773  6.217428  9.127623        NA  6.850408  7.882037  8.486344
 [8] 10.924171  7.435623  8.883510
> rowMax(tmp5,na.rm=TRUE)
 [1] 470.10269  82.15172  87.29822        NA  86.07281  82.86271  86.97874
 [8]  95.03129  82.30404  91.57048
> rowMin(tmp5,na.rm=TRUE)
 [1] 57.45126 59.23182 56.19639       NA 59.53333 54.47073 56.63028 54.80907
 [9] 57.33317 58.84697
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1]      NaN 70.49458 68.93383 70.79005 67.69902 67.41733 69.63829 73.24996
 [9] 68.22951 71.36370 74.57851 71.59467 74.16638 71.65756 71.27552 72.47603
[17] 68.78295 71.16780 64.19811 70.22906
> colSums(tmp5,na.rm=TRUE)
 [1]   0.0000 634.4512 620.4045 637.1105 609.2912 606.7560 626.7446 659.2496
 [9] 614.0656 642.2733 671.2066 644.3520 667.4974 644.9180 641.4796 652.2843
[17] 619.0466 640.5102 577.7830 632.0616
> colVars(tmp5,na.rm=TRUE)
 [1]        NA  55.45569  18.65542  30.42550  60.31785  55.36135  68.88400
 [8]  84.82706  80.25290  81.50663 106.37084  81.17906  74.17745  59.56876
[15]  93.62024  98.79836  46.44312  93.92296  50.33840  32.02074
> colSd(tmp5,na.rm=TRUE)
 [1]        NA  7.446858  4.319192  5.515932  7.766457  7.440521  8.299639
 [8]  9.210161  8.958398  9.028102 10.313624  9.009943  8.612633  7.718080
[15]  9.675755  9.939736  6.814919  9.691386  7.094956  5.658687
> colMax(tmp5,na.rm=TRUE)
 [1]     -Inf 79.24606 74.64722 78.93880 77.85751 79.28466 82.02821 87.29822
 [9] 81.82593 85.76878 95.03129 84.69206 91.57048 80.81882 86.97874 91.43265
[17] 76.46371 86.37377 75.76115 82.30404
> colMin(tmp5,na.rm=TRUE)
 [1]      Inf 54.80907 62.64018 61.05878 54.47073 56.63028 57.45126 57.99813
 [9] 57.33317 56.19639 62.60800 58.81818 63.43074 57.82249 59.23182 62.95105
[17] 58.15320 61.98201 55.19753 62.42229
> 
> 
> 
> 
> 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] 222.52827 228.66846 183.54021 199.26610 211.91300  85.45867 211.76556
 [8] 342.52743 232.63894 270.62403
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 222.52827 228.66846 183.54021 199.26610 211.91300  85.45867 211.76556
 [8] 342.52743 232.63894 270.62403
> 
> 
> 
> copymatrix <- matrix(rnorm(200,150,15),10,20)
> 
> tmp5[1:10,1:20] <- copymatrix
> which.row <- 1
> which.col  <- 3
> cat(which.row," ",which.col,"\n")
1   3 
> tmp5[which.row,which.col] <- NA
> copymatrix[which.row,which.col] <- NA
> 
> colVars(tmp5,na.rm=TRUE)-apply(copymatrix,2,var,na.rm=TRUE)
 [1] -1.705303e-13  1.136868e-13 -1.421085e-13  0.000000e+00 -7.105427e-14
 [6]  1.136868e-13  2.842171e-14  1.847411e-13 -1.136868e-13  1.136868e-13
[11]  8.526513e-14 -2.842171e-13 -1.136868e-13 -5.684342e-14  5.684342e-14
[16]  5.684342e-14  1.136868e-13  5.684342e-14  2.842171e-14  1.989520e-13
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> ## making sure these things agree
> ##
> ## first when there is no NA
> 
> 
> 
> agree.checks <- function(buff.matrix,r.matrix,err.tol=1e-10){
+ 
+   if (Max(buff.matrix,na.rm=TRUE) != max(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Max")
+   }
+   
+ 
+   if (Min(buff.matrix,na.rm=TRUE) != min(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Min")
+   }
+ 
+ 
+   if (abs(Sum(buff.matrix,na.rm=TRUE)- sum(r.matrix,na.rm=TRUE)) > err.tol){
+ 
+     cat(Sum(buff.matrix,na.rm=TRUE),"\n")
+     cat(sum(r.matrix,na.rm=TRUE),"\n")
+     cat(Sum(buff.matrix,na.rm=TRUE) - sum(r.matrix,na.rm=TRUE),"\n")
+     
+     stop("No agreement in Sum")
+   }
+   
+   if (abs(mean(buff.matrix,na.rm=TRUE) - mean(r.matrix,na.rm=TRUE)) > err.tol){
+     stop("No agreement in mean")
+   }
+   
+   
+   if(abs(Var(buff.matrix,na.rm=TRUE) - var(as.vector(r.matrix),na.rm=TRUE)) > err.tol){
+     stop("No agreement in Var")
+   }
+   
+   
+ 
+   if(any(abs(rowMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,mean,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowMeans")
+   }
+   
+   
+   if(any(abs(colMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,mean,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colMeans")
+   }
+   
+   
+   if(any(abs(rowSums(buff.matrix,na.rm=TRUE)  -  apply(r.matrix,1,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in rowSums")
+   }
+   
+   
+   if(any(abs(colSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colSums")
+   }
+   
+   ### this is to get around the fact that R doesn't like to compute NA on an entire vector of NA when 
+   ### computing variance
+   my.Var <- function(x,na.rm=FALSE){
+    if (all(is.na(x))){
+      return(NA)
+    } else {
+      var(x,na.rm=na.rm)
+    }
+ 
+   }
+   
+   if(any(abs(rowVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+   
+   
+   if(any(abs(colVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+ 
+ 
+   if(any(abs(rowMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+ 
+   if(any(abs(colMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+   
+   
+   if(any(abs(rowMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+   
+ 
+   if(any(abs(colMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+ 
+   if(any(abs(colMedians(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,median,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMedian")
+   }
+ 
+   if(any(abs(colRanges(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,range,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colRanges")
+   }
+ 
+ 
+   
+ }
> 
> 
> 
> 
> 
> 
> 
> 
> 
> for (rep in 1:20){
+   copymatrix <- matrix(rnorm(200,150,15),10,20)
+   
+   tmp5[1:10,1:20] <- copymatrix
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ## now lets assign some NA values and check agreement
+ 
+   which.row <- sample(1:10,1,replace=TRUE)
+   which.col  <- sample(1:20,1,replace=TRUE)
+   
+   cat(which.row," ",which.col,"\n")
+   
+   tmp5[which.row,which.col] <- NA
+   copymatrix[which.row,which.col] <- NA
+   
+   agree.checks(tmp5,copymatrix)
+ 
+   ## make an entire row NA
+   tmp5[which.row,] <- NA
+   copymatrix[which.row,] <- NA
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ### also make an entire col NA
+   tmp5[,which.col] <- NA
+   copymatrix[,which.col] <- NA
+ 
+   agree.checks(tmp5,copymatrix)
+ 
+   ### now make 1 element non NA with NA in the rest of row and column
+ 
+   tmp5[which.row,which.col] <- rnorm(1,150,15)
+   copymatrix[which.row,which.col] <- tmp5[which.row,which.col]
+ 
+   agree.checks(tmp5,copymatrix)
+ }
6   15 
4   20 
1   6 
6   1 
4   1 
7   8 
1   6 
4   7 
5   12 
10   12 
4   16 
6   6 
9   15 
7   14 
3   2 
7   10 
1   12 
8   20 
5   15 
2   13 
There were 50 or more warnings (use warnings() to see the first 50)
> 
> 
> ### now test 1 by n and n by 1 matrix
> 
> 
> err.tol <- 1e-12
> 
> rm(tmp5)
> 
> dataset1 <- rnorm(100)
> dataset2 <- rnorm(100)
> 
> tmp <- createBufferedMatrix(1,100)
> tmp[1,] <- dataset1
> 
> tmp2 <- createBufferedMatrix(100,1)
> tmp2[,1] <- dataset2
> 
> 
> 
> 
> 
> Max(tmp)
[1] 2.633172
> Min(tmp)
[1] -2.544778
> mean(tmp)
[1] 0.03161238
> Sum(tmp)
[1] 3.161238
> Var(tmp)
[1] 1.002766
> 
> rowMeans(tmp)
[1] 0.03161238
> rowSums(tmp)
[1] 3.161238
> rowVars(tmp)
[1] 1.002766
> rowSd(tmp)
[1] 1.001382
> rowMax(tmp)
[1] 2.633172
> rowMin(tmp)
[1] -2.544778
> 
> colMeans(tmp)
  [1] -1.078428231 -0.295706844 -1.231170312 -0.281995629  0.204138557
  [6]  0.064730876 -1.151647951  0.612920109  0.783469954 -1.661534344
 [11]  0.696328160  1.491271733 -0.470248420  0.214316803 -0.843380678
 [16]  0.275564976 -1.268938903 -0.592346537  0.391338279 -1.599121686
 [21] -0.193646903  0.726838956  2.253821978  2.633171578 -0.367147070
 [26]  0.692544853 -0.695558640  0.099239118  0.084027123 -0.997525919
 [31]  0.667223846 -0.129348247  0.628830779 -0.903521412  0.381397649
 [36]  0.944570114  0.460068936 -0.005869595 -0.794891241  0.435117889
 [41]  0.221111380  0.045056706  2.385410359  0.234089014  0.187210520
 [46]  0.238901166  0.853467298 -0.930988954 -0.180366083  0.342039289
 [51]  0.933244406  1.110753441 -0.210476950 -0.369332104 -0.621001846
 [56] -0.119531514 -1.124238551  0.453658338 -0.375726134  0.937320785
 [61] -0.701201334 -1.621015854 -2.544777970  0.719140243 -1.073919618
 [66] -0.433506867 -0.108352603 -1.180470970 -1.550393697  0.001035741
 [71] -0.383449148  0.714597103 -0.012230185 -1.014876857  0.197760318
 [76] -1.327998238  0.499447638  1.155080697  0.972329529 -0.850837738
 [81]  2.090982757 -0.127671703 -0.255798634  1.078502121  1.112369895
 [86] -0.950706890 -2.443297732  1.012035865 -1.951633826  2.237419356
 [91] -0.001022704 -0.328427662  0.583605368  0.869017417  0.973084761
 [96]  0.105770686  1.307880446  1.400701086  0.385132060  0.417431071
> colSums(tmp)
  [1] -1.078428231 -0.295706844 -1.231170312 -0.281995629  0.204138557
  [6]  0.064730876 -1.151647951  0.612920109  0.783469954 -1.661534344
 [11]  0.696328160  1.491271733 -0.470248420  0.214316803 -0.843380678
 [16]  0.275564976 -1.268938903 -0.592346537  0.391338279 -1.599121686
 [21] -0.193646903  0.726838956  2.253821978  2.633171578 -0.367147070
 [26]  0.692544853 -0.695558640  0.099239118  0.084027123 -0.997525919
 [31]  0.667223846 -0.129348247  0.628830779 -0.903521412  0.381397649
 [36]  0.944570114  0.460068936 -0.005869595 -0.794891241  0.435117889
 [41]  0.221111380  0.045056706  2.385410359  0.234089014  0.187210520
 [46]  0.238901166  0.853467298 -0.930988954 -0.180366083  0.342039289
 [51]  0.933244406  1.110753441 -0.210476950 -0.369332104 -0.621001846
 [56] -0.119531514 -1.124238551  0.453658338 -0.375726134  0.937320785
 [61] -0.701201334 -1.621015854 -2.544777970  0.719140243 -1.073919618
 [66] -0.433506867 -0.108352603 -1.180470970 -1.550393697  0.001035741
 [71] -0.383449148  0.714597103 -0.012230185 -1.014876857  0.197760318
 [76] -1.327998238  0.499447638  1.155080697  0.972329529 -0.850837738
 [81]  2.090982757 -0.127671703 -0.255798634  1.078502121  1.112369895
 [86] -0.950706890 -2.443297732  1.012035865 -1.951633826  2.237419356
 [91] -0.001022704 -0.328427662  0.583605368  0.869017417  0.973084761
 [96]  0.105770686  1.307880446  1.400701086  0.385132060  0.417431071
> 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] -1.078428231 -0.295706844 -1.231170312 -0.281995629  0.204138557
  [6]  0.064730876 -1.151647951  0.612920109  0.783469954 -1.661534344
 [11]  0.696328160  1.491271733 -0.470248420  0.214316803 -0.843380678
 [16]  0.275564976 -1.268938903 -0.592346537  0.391338279 -1.599121686
 [21] -0.193646903  0.726838956  2.253821978  2.633171578 -0.367147070
 [26]  0.692544853 -0.695558640  0.099239118  0.084027123 -0.997525919
 [31]  0.667223846 -0.129348247  0.628830779 -0.903521412  0.381397649
 [36]  0.944570114  0.460068936 -0.005869595 -0.794891241  0.435117889
 [41]  0.221111380  0.045056706  2.385410359  0.234089014  0.187210520
 [46]  0.238901166  0.853467298 -0.930988954 -0.180366083  0.342039289
 [51]  0.933244406  1.110753441 -0.210476950 -0.369332104 -0.621001846
 [56] -0.119531514 -1.124238551  0.453658338 -0.375726134  0.937320785
 [61] -0.701201334 -1.621015854 -2.544777970  0.719140243 -1.073919618
 [66] -0.433506867 -0.108352603 -1.180470970 -1.550393697  0.001035741
 [71] -0.383449148  0.714597103 -0.012230185 -1.014876857  0.197760318
 [76] -1.327998238  0.499447638  1.155080697  0.972329529 -0.850837738
 [81]  2.090982757 -0.127671703 -0.255798634  1.078502121  1.112369895
 [86] -0.950706890 -2.443297732  1.012035865 -1.951633826  2.237419356
 [91] -0.001022704 -0.328427662  0.583605368  0.869017417  0.973084761
 [96]  0.105770686  1.307880446  1.400701086  0.385132060  0.417431071
> colMin(tmp)
  [1] -1.078428231 -0.295706844 -1.231170312 -0.281995629  0.204138557
  [6]  0.064730876 -1.151647951  0.612920109  0.783469954 -1.661534344
 [11]  0.696328160  1.491271733 -0.470248420  0.214316803 -0.843380678
 [16]  0.275564976 -1.268938903 -0.592346537  0.391338279 -1.599121686
 [21] -0.193646903  0.726838956  2.253821978  2.633171578 -0.367147070
 [26]  0.692544853 -0.695558640  0.099239118  0.084027123 -0.997525919
 [31]  0.667223846 -0.129348247  0.628830779 -0.903521412  0.381397649
 [36]  0.944570114  0.460068936 -0.005869595 -0.794891241  0.435117889
 [41]  0.221111380  0.045056706  2.385410359  0.234089014  0.187210520
 [46]  0.238901166  0.853467298 -0.930988954 -0.180366083  0.342039289
 [51]  0.933244406  1.110753441 -0.210476950 -0.369332104 -0.621001846
 [56] -0.119531514 -1.124238551  0.453658338 -0.375726134  0.937320785
 [61] -0.701201334 -1.621015854 -2.544777970  0.719140243 -1.073919618
 [66] -0.433506867 -0.108352603 -1.180470970 -1.550393697  0.001035741
 [71] -0.383449148  0.714597103 -0.012230185 -1.014876857  0.197760318
 [76] -1.327998238  0.499447638  1.155080697  0.972329529 -0.850837738
 [81]  2.090982757 -0.127671703 -0.255798634  1.078502121  1.112369895
 [86] -0.950706890 -2.443297732  1.012035865 -1.951633826  2.237419356
 [91] -0.001022704 -0.328427662  0.583605368  0.869017417  0.973084761
 [96]  0.105770686  1.307880446  1.400701086  0.385132060  0.417431071
> colMedians(tmp)
  [1] -1.078428231 -0.295706844 -1.231170312 -0.281995629  0.204138557
  [6]  0.064730876 -1.151647951  0.612920109  0.783469954 -1.661534344
 [11]  0.696328160  1.491271733 -0.470248420  0.214316803 -0.843380678
 [16]  0.275564976 -1.268938903 -0.592346537  0.391338279 -1.599121686
 [21] -0.193646903  0.726838956  2.253821978  2.633171578 -0.367147070
 [26]  0.692544853 -0.695558640  0.099239118  0.084027123 -0.997525919
 [31]  0.667223846 -0.129348247  0.628830779 -0.903521412  0.381397649
 [36]  0.944570114  0.460068936 -0.005869595 -0.794891241  0.435117889
 [41]  0.221111380  0.045056706  2.385410359  0.234089014  0.187210520
 [46]  0.238901166  0.853467298 -0.930988954 -0.180366083  0.342039289
 [51]  0.933244406  1.110753441 -0.210476950 -0.369332104 -0.621001846
 [56] -0.119531514 -1.124238551  0.453658338 -0.375726134  0.937320785
 [61] -0.701201334 -1.621015854 -2.544777970  0.719140243 -1.073919618
 [66] -0.433506867 -0.108352603 -1.180470970 -1.550393697  0.001035741
 [71] -0.383449148  0.714597103 -0.012230185 -1.014876857  0.197760318
 [76] -1.327998238  0.499447638  1.155080697  0.972329529 -0.850837738
 [81]  2.090982757 -0.127671703 -0.255798634  1.078502121  1.112369895
 [86] -0.950706890 -2.443297732  1.012035865 -1.951633826  2.237419356
 [91] -0.001022704 -0.328427662  0.583605368  0.869017417  0.973084761
 [96]  0.105770686  1.307880446  1.400701086  0.385132060  0.417431071
> colRanges(tmp)
          [,1]       [,2]     [,3]       [,4]      [,5]       [,6]      [,7]
[1,] -1.078428 -0.2957068 -1.23117 -0.2819956 0.2041386 0.06473088 -1.151648
[2,] -1.078428 -0.2957068 -1.23117 -0.2819956 0.2041386 0.06473088 -1.151648
          [,8]    [,9]     [,10]     [,11]    [,12]      [,13]     [,14]
[1,] 0.6129201 0.78347 -1.661534 0.6963282 1.491272 -0.4702484 0.2143168
[2,] 0.6129201 0.78347 -1.661534 0.6963282 1.491272 -0.4702484 0.2143168
          [,15]    [,16]     [,17]      [,18]     [,19]     [,20]      [,21]
[1,] -0.8433807 0.275565 -1.268939 -0.5923465 0.3913383 -1.599122 -0.1936469
[2,] -0.8433807 0.275565 -1.268939 -0.5923465 0.3913383 -1.599122 -0.1936469
        [,22]    [,23]    [,24]      [,25]     [,26]      [,27]      [,28]
[1,] 0.726839 2.253822 2.633172 -0.3671471 0.6925449 -0.6955586 0.09923912
[2,] 0.726839 2.253822 2.633172 -0.3671471 0.6925449 -0.6955586 0.09923912
          [,29]      [,30]     [,31]      [,32]     [,33]      [,34]     [,35]
[1,] 0.08402712 -0.9975259 0.6672238 -0.1293482 0.6288308 -0.9035214 0.3813976
[2,] 0.08402712 -0.9975259 0.6672238 -0.1293482 0.6288308 -0.9035214 0.3813976
         [,36]     [,37]        [,38]      [,39]     [,40]     [,41]      [,42]
[1,] 0.9445701 0.4600689 -0.005869595 -0.7948912 0.4351179 0.2211114 0.04505671
[2,] 0.9445701 0.4600689 -0.005869595 -0.7948912 0.4351179 0.2211114 0.04505671
       [,43]    [,44]     [,45]     [,46]     [,47]     [,48]      [,49]
[1,] 2.38541 0.234089 0.1872105 0.2389012 0.8534673 -0.930989 -0.1803661
[2,] 2.38541 0.234089 0.1872105 0.2389012 0.8534673 -0.930989 -0.1803661
         [,50]     [,51]    [,52]     [,53]      [,54]      [,55]      [,56]
[1,] 0.3420393 0.9332444 1.110753 -0.210477 -0.3693321 -0.6210018 -0.1195315
[2,] 0.3420393 0.9332444 1.110753 -0.210477 -0.3693321 -0.6210018 -0.1195315
         [,57]     [,58]      [,59]     [,60]      [,61]     [,62]     [,63]
[1,] -1.124239 0.4536583 -0.3757261 0.9373208 -0.7012013 -1.621016 -2.544778
[2,] -1.124239 0.4536583 -0.3757261 0.9373208 -0.7012013 -1.621016 -2.544778
         [,64]    [,65]      [,66]      [,67]     [,68]     [,69]       [,70]
[1,] 0.7191402 -1.07392 -0.4335069 -0.1083526 -1.180471 -1.550394 0.001035741
[2,] 0.7191402 -1.07392 -0.4335069 -0.1083526 -1.180471 -1.550394 0.001035741
          [,71]     [,72]       [,73]     [,74]     [,75]     [,76]     [,77]
[1,] -0.3834491 0.7145971 -0.01223019 -1.014877 0.1977603 -1.327998 0.4994476
[2,] -0.3834491 0.7145971 -0.01223019 -1.014877 0.1977603 -1.327998 0.4994476
        [,78]     [,79]      [,80]    [,81]      [,82]      [,83]    [,84]
[1,] 1.155081 0.9723295 -0.8508377 2.090983 -0.1276717 -0.2557986 1.078502
[2,] 1.155081 0.9723295 -0.8508377 2.090983 -0.1276717 -0.2557986 1.078502
       [,85]      [,86]     [,87]    [,88]     [,89]    [,90]        [,91]
[1,] 1.11237 -0.9507069 -2.443298 1.012036 -1.951634 2.237419 -0.001022704
[2,] 1.11237 -0.9507069 -2.443298 1.012036 -1.951634 2.237419 -0.001022704
          [,92]     [,93]     [,94]     [,95]     [,96]   [,97]    [,98]
[1,] -0.3284277 0.5836054 0.8690174 0.9730848 0.1057707 1.30788 1.400701
[2,] -0.3284277 0.5836054 0.8690174 0.9730848 0.1057707 1.30788 1.400701
         [,99]    [,100]
[1,] 0.3851321 0.4174311
[2,] 0.3851321 0.4174311
> 
> 
> Max(tmp2)
[1] 2.874546
> Min(tmp2)
[1] -2.293641
> mean(tmp2)
[1] 0.03519269
> Sum(tmp2)
[1] 3.519269
> Var(tmp2)
[1] 0.9813101
> 
> rowMeans(tmp2)
  [1] -0.134302506  0.032245192  0.249745479  2.121401177 -1.572452664
  [6]  0.365822583  0.357409760 -0.280846232 -1.082731498  0.116823831
 [11] -1.507422835 -0.101763697 -1.313311512  2.079770558 -0.411373711
 [16]  0.041296484 -0.435111564 -1.961683575 -0.116444276  1.566845622
 [21]  1.800318255  1.071296915 -1.323077511  0.228092532 -0.348928228
 [26]  0.451275589 -0.695107684  0.462453481  0.052523789 -0.920676806
 [31] -2.293640650 -1.473581526  1.799053523  0.242828073 -0.494526564
 [36] -0.323283820  1.055380047 -0.684377790  2.874546199 -0.047243093
 [41] -0.202840578 -1.615269309 -1.966730943 -0.920327018  0.192852982
 [46] -0.286236770  1.879892883 -1.273291047  1.570254070  0.605579668
 [51] -0.330140400 -0.541002092  0.909138521  0.001235552  0.969198491
 [56] -0.798066062 -0.408726562 -0.912088128  1.432543460  0.619790881
 [61]  1.247474807  0.356658777 -0.952081463 -0.866886333  0.279636117
 [66]  0.210891753  0.330590222  0.563517410 -1.025762143  0.877936612
 [71] -0.573560379  0.476063808  0.094348778  0.334729968  0.133210811
 [76]  0.485755017  0.054531040  0.169819674  1.095240346  1.560794385
 [81]  0.375705515  0.238665605 -0.942101642  0.052226579 -0.473283563
 [86] -0.185580675 -0.320347784  0.648643973  1.462590460 -0.746807637
 [91]  0.316605925 -0.439251697 -0.134051323 -0.618845884 -0.379904908
 [96]  0.614023075  0.820908137  1.983367162 -0.588303478 -1.390906871
> rowSums(tmp2)
  [1] -0.134302506  0.032245192  0.249745479  2.121401177 -1.572452664
  [6]  0.365822583  0.357409760 -0.280846232 -1.082731498  0.116823831
 [11] -1.507422835 -0.101763697 -1.313311512  2.079770558 -0.411373711
 [16]  0.041296484 -0.435111564 -1.961683575 -0.116444276  1.566845622
 [21]  1.800318255  1.071296915 -1.323077511  0.228092532 -0.348928228
 [26]  0.451275589 -0.695107684  0.462453481  0.052523789 -0.920676806
 [31] -2.293640650 -1.473581526  1.799053523  0.242828073 -0.494526564
 [36] -0.323283820  1.055380047 -0.684377790  2.874546199 -0.047243093
 [41] -0.202840578 -1.615269309 -1.966730943 -0.920327018  0.192852982
 [46] -0.286236770  1.879892883 -1.273291047  1.570254070  0.605579668
 [51] -0.330140400 -0.541002092  0.909138521  0.001235552  0.969198491
 [56] -0.798066062 -0.408726562 -0.912088128  1.432543460  0.619790881
 [61]  1.247474807  0.356658777 -0.952081463 -0.866886333  0.279636117
 [66]  0.210891753  0.330590222  0.563517410 -1.025762143  0.877936612
 [71] -0.573560379  0.476063808  0.094348778  0.334729968  0.133210811
 [76]  0.485755017  0.054531040  0.169819674  1.095240346  1.560794385
 [81]  0.375705515  0.238665605 -0.942101642  0.052226579 -0.473283563
 [86] -0.185580675 -0.320347784  0.648643973  1.462590460 -0.746807637
 [91]  0.316605925 -0.439251697 -0.134051323 -0.618845884 -0.379904908
 [96]  0.614023075  0.820908137  1.983367162 -0.588303478 -1.390906871
> rowVars(tmp2)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowSd(tmp2)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowMax(tmp2)
  [1] -0.134302506  0.032245192  0.249745479  2.121401177 -1.572452664
  [6]  0.365822583  0.357409760 -0.280846232 -1.082731498  0.116823831
 [11] -1.507422835 -0.101763697 -1.313311512  2.079770558 -0.411373711
 [16]  0.041296484 -0.435111564 -1.961683575 -0.116444276  1.566845622
 [21]  1.800318255  1.071296915 -1.323077511  0.228092532 -0.348928228
 [26]  0.451275589 -0.695107684  0.462453481  0.052523789 -0.920676806
 [31] -2.293640650 -1.473581526  1.799053523  0.242828073 -0.494526564
 [36] -0.323283820  1.055380047 -0.684377790  2.874546199 -0.047243093
 [41] -0.202840578 -1.615269309 -1.966730943 -0.920327018  0.192852982
 [46] -0.286236770  1.879892883 -1.273291047  1.570254070  0.605579668
 [51] -0.330140400 -0.541002092  0.909138521  0.001235552  0.969198491
 [56] -0.798066062 -0.408726562 -0.912088128  1.432543460  0.619790881
 [61]  1.247474807  0.356658777 -0.952081463 -0.866886333  0.279636117
 [66]  0.210891753  0.330590222  0.563517410 -1.025762143  0.877936612
 [71] -0.573560379  0.476063808  0.094348778  0.334729968  0.133210811
 [76]  0.485755017  0.054531040  0.169819674  1.095240346  1.560794385
 [81]  0.375705515  0.238665605 -0.942101642  0.052226579 -0.473283563
 [86] -0.185580675 -0.320347784  0.648643973  1.462590460 -0.746807637
 [91]  0.316605925 -0.439251697 -0.134051323 -0.618845884 -0.379904908
 [96]  0.614023075  0.820908137  1.983367162 -0.588303478 -1.390906871
> rowMin(tmp2)
  [1] -0.134302506  0.032245192  0.249745479  2.121401177 -1.572452664
  [6]  0.365822583  0.357409760 -0.280846232 -1.082731498  0.116823831
 [11] -1.507422835 -0.101763697 -1.313311512  2.079770558 -0.411373711
 [16]  0.041296484 -0.435111564 -1.961683575 -0.116444276  1.566845622
 [21]  1.800318255  1.071296915 -1.323077511  0.228092532 -0.348928228
 [26]  0.451275589 -0.695107684  0.462453481  0.052523789 -0.920676806
 [31] -2.293640650 -1.473581526  1.799053523  0.242828073 -0.494526564
 [36] -0.323283820  1.055380047 -0.684377790  2.874546199 -0.047243093
 [41] -0.202840578 -1.615269309 -1.966730943 -0.920327018  0.192852982
 [46] -0.286236770  1.879892883 -1.273291047  1.570254070  0.605579668
 [51] -0.330140400 -0.541002092  0.909138521  0.001235552  0.969198491
 [56] -0.798066062 -0.408726562 -0.912088128  1.432543460  0.619790881
 [61]  1.247474807  0.356658777 -0.952081463 -0.866886333  0.279636117
 [66]  0.210891753  0.330590222  0.563517410 -1.025762143  0.877936612
 [71] -0.573560379  0.476063808  0.094348778  0.334729968  0.133210811
 [76]  0.485755017  0.054531040  0.169819674  1.095240346  1.560794385
 [81]  0.375705515  0.238665605 -0.942101642  0.052226579 -0.473283563
 [86] -0.185580675 -0.320347784  0.648643973  1.462590460 -0.746807637
 [91]  0.316605925 -0.439251697 -0.134051323 -0.618845884 -0.379904908
 [96]  0.614023075  0.820908137  1.983367162 -0.588303478 -1.390906871
> 
> colMeans(tmp2)
[1] 0.03519269
> colSums(tmp2)
[1] 3.519269
> colVars(tmp2)
[1] 0.9813101
> colSd(tmp2)
[1] 0.9906109
> colMax(tmp2)
[1] 2.874546
> colMin(tmp2)
[1] -2.293641
> colMedians(tmp2)
[1] 0.04676153
> colRanges(tmp2)
          [,1]
[1,] -2.293641
[2,]  2.874546
> 
> 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.641829395 -1.613826158  6.387837924  0.443041674  1.391654390
 [6]  1.936140787  3.492901036  0.857797897 -0.003905297  2.460936470
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -1.1673634
[2,] -0.1152124
[3,]  0.3729497
[4,]  0.5365341
[5,]  1.7190295
> 
> rowApply(tmp,sum)
 [1]  0.91556333  0.25549088 -0.53380079  1.53099135  1.65185631  1.94811354
 [7] -0.08959754 -0.91725732  6.18522944  7.04781892
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    7    7   10    3    1    9    6    8    4     4
 [2,]    9    3    4    1    5    4    2    3    8     8
 [3,]    2    4    8   10    9    1   10    6    9     5
 [4,]    3    9    2    7    3    7    9    1    1    10
 [5,]    1    8    9    5   10    2    7   10    3     3
 [6,]    8    2    5    8    2    8    8    4    7     6
 [7,]   10   10    1    9    6    3    5    2    6     7
 [8,]    5    6    7    2    4   10    3    9    5     1
 [9,]    6    5    3    4    7    6    1    7    2     9
[10,]    4    1    6    6    8    5    4    5   10     2
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1] -2.2146309 -1.0320031  2.9939568 -0.1273940 -1.7941328 -1.8723989
 [7] -2.0124529 -1.3200015  0.2087764  0.1518135  3.6635734  1.4078540
[13] -4.2091199 -0.6787083  0.9143236 -3.4857030  2.7874057 -3.3584211
[19]  0.9468316  4.0663543
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -1.4692862
[2,] -1.1182109
[3,] -0.9537655
[4,]  0.1286551
[5,]  1.1979767
> 
> rowApply(tmp,sum)
[1] -2.3373008 -4.4878693 -0.7830652  3.7029383 -1.0587803
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]    4    3    1   18   12
[2,]   12   13    2    8    7
[3,]   11   10   14   20   20
[4,]    7    9   16   17    4
[5,]    6    5    9    4   18
> 
> 
> as.matrix(tmp)
           [,1]        [,2]       [,3]       [,4]       [,5]       [,6]
[1,] -1.1182109  0.07222466 -0.1949753 -0.5164046 -1.0001806  0.5820639
[2,] -0.9537655  0.16810692 -0.4559901 -0.5038274 -0.7317156 -0.6085255
[3,] -1.4692862 -0.79105587  0.2175319  0.5593145 -0.3570345 -0.5965364
[4,]  1.1979767  0.03301642  2.3078603  1.1035371 -0.5868139 -1.4052777
[5,]  0.1286551 -0.51429523  1.1195300 -0.7700135  0.8816118  0.1558768
           [,7]       [,8]       [,9]       [,10]     [,11]       [,12]
[1,] -1.0347955 -0.2085290 -0.2008968 -0.45387935 0.6635734  0.10988689
[2,]  0.3252359 -1.1734370 -0.5883517  1.06758777 1.1425963 -0.36635337
[3,] -0.4415036  1.4289927  0.4885561 -0.08198489 0.8736781  0.86018696
[4,]  0.3877426 -0.3409497 -0.1856622  0.06047419 0.4063939  0.74131662
[5,] -1.2491324 -1.0260786  0.6951310 -0.44038420 0.5773319  0.06281685
          [,13]        [,14]       [,15]       [,16]      [,17]      [,18]
[1,] -1.3019441  0.072693963  0.81574728 -2.29653062  2.5474319 -1.3126723
[2,] -2.0096860  0.578421335  0.46465109 -0.90109609  0.5333784 -0.2637463
[3,] -0.6198203 -0.009192759  0.13759267 -0.65569161 -0.4439503 -0.6321976
[4,] -1.3273316 -2.002275890  0.08929494  0.46246188  0.8619011  0.3845829
[5,]  1.0496622  0.681645010 -0.59296241 -0.09484655 -0.7113554 -1.5343878
           [,19]      [,20]
[1,]  1.00811671 1.42997961
[2,] -0.51819131 0.30683915
[3,]  0.71246433 0.03687154
[4,] -0.05836284 1.57305361
[5,] -0.19719528 0.71961038
> 
> 
> 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 :  650  bytes.
Disk usage :  200  bytes.
> subBufferedMatrix(tmp,,5:8)
BufferedMatrix object
Matrix size:  5 4 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  562  bytes.
Disk usage :  160  bytes.
> subBufferedMatrix(tmp,1:3,)
BufferedMatrix object
Matrix size:  3 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.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 -2.528359 0.9515295 -0.1692881 1.646751 0.07955058 0.5756586 -1.42897
          col8       col9     col10    col11     col12    col13     col14
row1 0.1180732 0.07266767 0.3502781 1.447909 0.1485258 1.609858 -2.617071
        col15     col16     col17      col18     col19      col20
row1 0.252607 0.2381179 -2.261885 -0.9585365 0.5161008 0.07447615
> tmp[,"col10"]
          col10
row1  0.3502781
row2  0.7460217
row3 -0.3279991
row4  1.0071954
row5 -1.0220311
> tmp[c("row1","row5"),]
           col1       col2       col3       col4        col5      col6
row1 -2.5283587  0.9515295 -0.1692881 1.64675103  0.07955058 0.5756586
row5 -0.2930071 -0.5636343  2.0814746 0.07228302 -0.39406999 0.1458400
           col7       col8        col9      col10     col11      col12
row1 -1.4289701  0.1180732  0.07266767  0.3502781 1.4479087  0.1485258
row5 -0.1947559 -1.0566031 -1.22729548 -1.0220311 0.4423508 -0.3423257
         col13      col14       col15      col16       col17      col18
row1 1.6098576 -2.6170710  0.25260698  0.2381179 -2.26188461 -0.9585365
row5 0.4435472  0.5905384 -0.03867182 -0.8575110  0.08521314 -0.3837405
          col19       col20
row1  0.5161008  0.07447615
row5 -0.6180669 -1.20955041
> tmp[,c("col6","col20")]
           col6       col20
row1  0.5756586  0.07447615
row2 -0.5359509 -1.92329126
row3  1.2073179 -0.43801350
row4 -0.9748757 -0.73668518
row5  0.1458400 -1.20955041
> tmp[c("row1","row5"),c("col6","col20")]
          col6       col20
row1 0.5756586  0.07447615
row5 0.1458400 -1.20955041
> 
> 
> 
> 
> tmp["row1",] <- rnorm(20,mean=10)
> tmp[,"col10"] <- rnorm(5,mean=30)
> tmp[c("row1","row5"),] <- rnorm(40,mean=50)
> tmp[,c("col6","col20")] <- rnorm(10,mean=75)
> tmp[c("row1","row5"),c("col6","col20")]  <- rnorm(4,mean=105)
> 
> tmp["row1",]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 51.11435 48.86509 49.96625 50.29454 50.81792 103.9524 49.39332 48.89968
         col9    col10    col11    col12   col13    col14   col15    col16
row1 49.23825 50.84648 50.35108 50.07241 49.9548 50.09732 50.5598 50.02313
       col17    col18    col19    col20
row1 51.0145 49.05828 50.09431 105.6033
> tmp[,"col10"]
        col10
row1 50.84648
row2 29.65291
row3 30.89511
row4 29.78484
row5 49.09694
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 51.11435 48.86509 49.96625 50.29454 50.81792 103.9524 49.39332 48.89968
row5 50.26828 49.59945 49.45853 49.99278 50.86953 105.8324 49.97437 48.74160
         col9    col10    col11    col12    col13    col14   col15    col16
row1 49.23825 50.84648 50.35108 50.07241 49.95480 50.09732 50.5598 50.02313
row5 50.25340 49.09694 49.84770 50.77338 49.15257 48.99183 49.9670 49.13342
        col17    col18    col19    col20
row1 51.01450 49.05828 50.09431 105.6033
row5 49.66348 51.69244 49.77176 105.0314
> tmp[,c("col6","col20")]
          col6     col20
row1 103.95243 105.60330
row2  74.39979  75.15494
row3  75.12034  75.13070
row4  74.62295  74.23408
row5 105.83244 105.03138
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 103.9524 105.6033
row5 105.8324 105.0314
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 103.9524 105.6033
row5 105.8324 105.0314
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
          col13
[1,]  0.6950290
[2,]  1.0931417
[3,] -0.2753882
[4,] -0.1888743
[5,]  0.4065686
> tmp[,c("col17","col7")]
          col17        col7
[1,] -0.4251960  0.63625985
[2,] -1.9834105  0.03115183
[3,] -0.8753429  1.55867661
[4,] -1.0726191 -0.76744893
[5,]  0.3216395 -0.22664765
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
           col6      col20
[1,] -0.9978657 -0.4046276
[2,]  0.2232023  0.7591316
[3,] -0.6983987  0.2286466
[4,]  2.0135472 -0.4349915
[5,]  0.5768352  1.0311637
> subBufferedMatrix(tmp,1,c("col6"))[,1]
           col1
[1,] -0.9978657
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
           col6
[1,] -0.9978657
[2,]  0.2232023
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> 
> 
> 
> subBufferedMatrix(tmp,c("row3","row1"),)[,1:20]
           [,1]      [,2]      [,3]       [,4]        [,5]        [,6]
row3  1.2252099 -1.057260 -1.175126 -0.5230219 -0.01056389 -1.13186071
row1 -0.3990555  1.275973  1.393940 -1.4479972 -0.30255735 -0.08882799
          [,7]      [,8]       [,9]     [,10]       [,11]     [,12]      [,13]
row3 0.6840044 0.1545002  0.5530625 0.2143576 -0.04968484  1.147636 -0.6867479
row1 0.2595561 0.9646168 -1.1284994 2.1136128  1.81819766 -2.389135 -1.6901624
          [,14]     [,15]      [,16]      [,17]      [,18]      [,19]     [,20]
row3 -0.6274210 0.6005382 0.01418588  0.5353607  1.7295153 -0.7347559 -1.078273
row1 -0.3687025 0.7273430 1.70547571 -1.2348421 -0.5739034 -1.0586230  1.207035
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
            [,1]      [,2]      [,3]      [,4]       [,5]       [,6]     [,7]
row2 -0.02705444 0.2077993 -1.136802 0.8096796 0.07775417 -0.1258068 2.300156
         [,8]       [,9]      [,10]
row2 0.801877 -0.5874766 0.05577221
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
          [,1]     [,2]      [,3]      [,4]      [,5]     [,6]     [,7]
row5 0.4435958 1.231757 0.1488511 0.2416317 0.8556406 1.374548 1.789644
          [,8]     [,9]     [,10]     [,11]      [,12]     [,13]      [,14]
row5 0.8453274 0.192476 0.4644306 0.4295661 -0.3778197 0.6370017 -0.6195156
         [,15]     [,16]      [,17]     [,18]     [,19]    [,20]
row5 -1.491607 0.3310083 -0.6693998 -1.411784 0.1759572 -1.05104
> 
> 
> 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: 0x6000002c4480>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM242d13dad768"
 [2] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM242d473f707" 
 [3] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM242d595eeed9"
 [4] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM242d67931665"
 [5] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM242d69a37602"
 [6] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM242d6a98b37c"
 [7] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM242d4f2fc890"
 [8] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM242d4a188e8d"
 [9] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM242d1236f0fc"
[10] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM242d550739bb"
[11] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM242d4d5f4f99"
[12] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM242d2c62ed7e"
[13] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM242d12d601f6"
[14] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM242d201ac723"
[15] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM242d3e07db4c"
> 
> 
> ### 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: 0x6000002c44e0>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x6000002c44e0>
Warning message:
In dir.create(new.directory) :
  '/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x6000002c44e0>
> rowMedians(tmp)
  [1] -0.587124699  0.293526775  0.033221850  0.255086952 -0.363523066
  [6]  0.139030365 -0.267672792  0.140117622  0.021743042 -0.197027182
 [11]  0.109821731 -0.375326159 -0.033202592 -0.263917327  0.058401032
 [16] -0.075862200  0.380802654 -0.253598250  0.073760187 -0.198724088
 [21]  0.389852119 -0.033678897  0.360371145 -0.141030526  0.335472922
 [26] -0.406571416  0.067148973 -0.361909340  0.178971061 -0.562928618
 [31]  0.006674893 -0.072468558 -0.108663686 -0.080079935  0.882336970
 [36]  0.018304922 -0.716187364  0.059933479 -0.127546701  0.501012806
 [41]  0.122134741  0.132765577 -0.072084174  0.070664315 -0.206134928
 [46] -0.019450012 -0.179024617  0.859135362 -0.138405855  0.628488398
 [51]  0.005628280  0.145069477  0.430843087 -0.325883382  0.045411377
 [56] -0.025282910 -0.146740017 -0.203445267  0.168118441 -0.283818551
 [61]  0.191696590  0.257472841  0.038573504  0.311960590  0.120730612
 [66]  0.279309808 -0.426716537 -0.041666416 -0.658269605  0.212600250
 [71] -0.056866237  0.125591895 -0.323881517 -0.034893047  0.275349588
 [76]  0.333004573  0.062862729 -0.278005370  0.075510034 -0.064296219
 [81] -0.003456735 -0.281984578 -0.182570934  0.124276831  0.399153228
 [86] -0.005508120  0.106382703  0.599315808  0.173847960  0.419706455
 [91]  0.401735619 -0.352591509 -0.327210426  0.051266663  0.158307833
 [96] -0.133623611 -0.292457161 -0.361220502 -0.709800932 -0.072547914
[101]  0.017902403 -0.110573907 -0.011920118  0.301024394  0.511603636
[106]  0.003749968  0.373573239  0.208653082  0.027415436  0.441332619
[111]  0.407744612 -0.155487250  0.197091295 -0.156665004 -0.337184145
[116]  0.182487020  0.151293113 -0.236162909 -0.196927948 -0.133978061
[121] -0.459291741 -0.264327079 -0.203188634 -0.390665944 -0.456578818
[126]  0.259287236  0.194162538  0.136826164  0.550301256  0.174683750
[131]  0.314329947  0.433174758 -0.138761211 -0.222429639 -0.143437245
[136]  0.202022561  0.412400701 -0.163357933 -0.109770458  0.033999789
[141]  0.280792776 -0.487782085  0.365005656  0.031034473  0.124615126
[146] -0.379846621  0.175258930  0.246014326 -0.395566702  0.523070316
[151]  0.123867352  0.117892163  0.003224361  0.355591967 -0.056325198
[156]  0.053038926  0.449635310 -0.029808905  0.028194851  0.014959635
[161]  0.035336818 -0.498382600 -0.540284260  0.134114341  0.360598053
[166] -0.178414558  0.131954483  0.363706631  0.692818957 -0.623956451
[171]  0.055566657 -0.306439382  0.050011258 -0.358708860 -0.121486844
[176]  0.335038231  0.237541622 -0.067576611 -0.258721772 -0.407188748
[181]  0.658892598  0.009187468  0.500384914 -0.679501405  0.333324911
[186]  0.516363087 -0.167765174  0.120876535  0.452704391 -0.338043007
[191] -0.042445498  0.238730483  0.204187606  0.158191304  0.888738475
[196] -0.084676205  0.156544077  0.052242725 -0.281781388  0.896219670
[201] -0.014280281  0.218672305  0.348948817 -0.293670551  0.169205949
[206] -0.400016182 -0.527719122  0.718291857 -0.360229495 -0.046213763
[211] -0.084893658  0.139535011  0.402194747  0.480370045  0.272415429
[216]  0.170595683  0.056490590  0.022219921 -0.271668926  0.211820295
[221]  0.121985169  0.513138699 -0.167156923 -0.237864362  0.066321523
[226]  0.191565377  0.735032078  0.190595822 -0.318387812  0.856667312
> 
> proc.time()
   user  system elapsed 
  0.720   3.608   4.834 

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: 0x600003bfc000>
> .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: 0x600003bfc000>
> .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: 0x600003bfc000>
> .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: 0x600003bfc000>
> 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: 0x600003bfc0c0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600003bfc0c0>
> .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: 0x600003bfc0c0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600003bfc0c0>
> .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: 0x600003bfc0c0>
> 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: 0x600003bfc2a0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600003bfc2a0>
> .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: 0x600003bfc2a0>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x600003bfc2a0>
> .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: 0x600003bfc2a0>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x600003bfc2a0>
> .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: 0x600003bfc2a0>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x600003bfc2a0>
> .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: 0x600003bfc2a0>
> 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: 0x600003bfc480>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x600003bfc480>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600003bfc480>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600003bfc480>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile288e26dee068" "BufferedMatrixFile288e725edfc7"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile288e26dee068" "BufferedMatrixFile288e725edfc7"
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x600003bfc720>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600003bfc720>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x600003bfc720>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x600003bfc720>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x600003bfc720>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x600003bfc720>
> .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: 0x600003bfc900>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600003bfc900>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x600003bfc900>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x600003bfc900>
> 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: 0x600003bfcae0>
> .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: 0x600003bfcae0>
> rm(P)
> 
> proc.time()
   user  system elapsed 
  0.155   0.056   0.208 

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.112   0.029   0.149 

Example timings