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

This page was generated on 2025-11-14 11:36 -0500 (Fri, 14 Nov 2025).

HostnameOSArch (*)R versionInstalled pkgs
nebbiolo1Linux (Ubuntu 24.04.3 LTS)x86_64R Under development (unstable) (2025-10-20 r88955) -- "Unsuffered Consequences" 4825
kjohnson3macOS 13.7.7 Venturaarm64R Under development (unstable) (2025-11-04 r88984) -- "Unsuffered Consequences" 4547
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 251/2325HostnameOS / ArchINSTALLBUILDCHECKBUILD BIN
BufferedMatrix 1.75.0  (landing page)
Ben Bolstad
Snapshot Date: 2025-11-13 13:40 -0500 (Thu, 13 Nov 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-11-13 18:51:24 -0500 (Thu, 13 Nov 2025)
EndedAt: 2025-11-13 18:51:45 -0500 (Thu, 13 Nov 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.142   0.059   0.202 

BufferedMatrix.Rcheck/tests/objectTesting.Rout


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

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

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

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

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

Attaching package: 'BufferedMatrix'

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

    colMeans, colSums, rowMeans, rowSums

> 
> 
> ### this is used to control how many repetitions in something below
> ### higher values result in more checks.
> nreps <-100 ##20000
> 
> 
> ## test creation and some simple assignments and subsetting operations
> 
> ## first on single elements
> tmp <- createBufferedMatrix(1000,10)
> 
> tmp[10,5]
[1] 0
> tmp[10,5] <- 10
> tmp[10,5]
[1] 10
> tmp[10,5] <- 12.445
> tmp[10,5]
[1] 12.445
> 
> 
> 
> ## now testing accessing multiple elements
> tmp2 <- createBufferedMatrix(10,20)
> 
> 
> tmp2[3,1] <- 51.34
> tmp2[9,2] <- 9.87654
> tmp2[,1:2]
       [,1]    [,2]
 [1,]  0.00 0.00000
 [2,]  0.00 0.00000
 [3,] 51.34 0.00000
 [4,]  0.00 0.00000
 [5,]  0.00 0.00000
 [6,]  0.00 0.00000
 [7,]  0.00 0.00000
 [8,]  0.00 0.00000
 [9,]  0.00 9.87654
[10,]  0.00 0.00000
> tmp2[,-(3:20)]
       [,1]    [,2]
 [1,]  0.00 0.00000
 [2,]  0.00 0.00000
 [3,] 51.34 0.00000
 [4,]  0.00 0.00000
 [5,]  0.00 0.00000
 [6,]  0.00 0.00000
 [7,]  0.00 0.00000
 [8,]  0.00 0.00000
 [9,]  0.00 9.87654
[10,]  0.00 0.00000
> tmp2[3,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
[1,] 51.34    0    0    0    0    0    0    0    0     0     0     0     0
     [,14] [,15] [,16] [,17] [,18] [,19] [,20]
[1,]     0     0     0     0     0     0     0
> tmp2[-3,]
      [,1]    [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [2,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [3,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [4,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [5,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [6,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [7,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [8,]    0 9.87654    0    0    0    0    0    0    0     0     0     0     0
 [9,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
      [,14] [,15] [,16] [,17] [,18] [,19] [,20]
 [1,]     0     0     0     0     0     0     0
 [2,]     0     0     0     0     0     0     0
 [3,]     0     0     0     0     0     0     0
 [4,]     0     0     0     0     0     0     0
 [5,]     0     0     0     0     0     0     0
 [6,]     0     0     0     0     0     0     0
 [7,]     0     0     0     0     0     0     0
 [8,]     0     0     0     0     0     0     0
 [9,]     0     0     0     0     0     0     0
> tmp2[2,1:3]
     [,1] [,2] [,3]
[1,]    0    0    0
> tmp2[3:9,1:3]
      [,1]    [,2] [,3]
[1,] 51.34 0.00000    0
[2,]  0.00 0.00000    0
[3,]  0.00 0.00000    0
[4,]  0.00 0.00000    0
[5,]  0.00 0.00000    0
[6,]  0.00 0.00000    0
[7,]  0.00 9.87654    0
> tmp2[-4,-4]
       [,1]    [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [2,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [3,] 51.34 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [4,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [5,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [6,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [7,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [8,]  0.00 9.87654    0    0    0    0    0    0    0     0     0     0     0
 [9,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
      [,14] [,15] [,16] [,17] [,18] [,19]
 [1,]     0     0     0     0     0     0
 [2,]     0     0     0     0     0     0
 [3,]     0     0     0     0     0     0
 [4,]     0     0     0     0     0     0
 [5,]     0     0     0     0     0     0
 [6,]     0     0     0     0     0     0
 [7,]     0     0     0     0     0     0
 [8,]     0     0     0     0     0     0
 [9,]     0     0     0     0     0     0
> 
> ## now testing accessing/assigning multiple elements
> tmp3 <- createBufferedMatrix(10,10)
> 
> for (i in 1:10){
+   for (j in 1:10){
+     tmp3[i,j] <- (j-1)*10 + i
+   }
+ }
> 
> tmp3[2:4,2:4]
     [,1] [,2] [,3]
[1,]   12   22   32
[2,]   13   23   33
[3,]   14   24   34
> tmp3[c(-10),c(2:4,2:4,10,1,2,1:10,10:1)]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]   11   21   31   11   21   31   91    1   11     1    11    21    31
 [2,]   12   22   32   12   22   32   92    2   12     2    12    22    32
 [3,]   13   23   33   13   23   33   93    3   13     3    13    23    33
 [4,]   14   24   34   14   24   34   94    4   14     4    14    24    34
 [5,]   15   25   35   15   25   35   95    5   15     5    15    25    35
 [6,]   16   26   36   16   26   36   96    6   16     6    16    26    36
 [7,]   17   27   37   17   27   37   97    7   17     7    17    27    37
 [8,]   18   28   38   18   28   38   98    8   18     8    18    28    38
 [9,]   19   29   39   19   29   39   99    9   19     9    19    29    39
      [,14] [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24] [,25]
 [1,]    41    51    61    71    81    91    91    81    71    61    51    41
 [2,]    42    52    62    72    82    92    92    82    72    62    52    42
 [3,]    43    53    63    73    83    93    93    83    73    63    53    43
 [4,]    44    54    64    74    84    94    94    84    74    64    54    44
 [5,]    45    55    65    75    85    95    95    85    75    65    55    45
 [6,]    46    56    66    76    86    96    96    86    76    66    56    46
 [7,]    47    57    67    77    87    97    97    87    77    67    57    47
 [8,]    48    58    68    78    88    98    98    88    78    68    58    48
 [9,]    49    59    69    79    89    99    99    89    79    69    59    49
      [,26] [,27] [,28] [,29]
 [1,]    31    21    11     1
 [2,]    32    22    12     2
 [3,]    33    23    13     3
 [4,]    34    24    14     4
 [5,]    35    25    15     5
 [6,]    36    26    16     6
 [7,]    37    27    17     7
 [8,]    38    28    18     8
 [9,]    39    29    19     9
> tmp3[-c(1:5),-c(6:10)]
     [,1] [,2] [,3] [,4] [,5]
[1,]    6   16   26   36   46
[2,]    7   17   27   37   47
[3,]    8   18   28   38   48
[4,]    9   19   29   39   49
[5,]   10   20   30   40   50
> 
> ## assignment of whole columns
> tmp3[,1] <- c(1:10*100.0)
> tmp3[,1:2] <- tmp3[,1:2]*100
> tmp3[,1:2] <- tmp3[,2:1]
> tmp3[,1:2]
      [,1]  [,2]
 [1,] 1100 1e+04
 [2,] 1200 2e+04
 [3,] 1300 3e+04
 [4,] 1400 4e+04
 [5,] 1500 5e+04
 [6,] 1600 6e+04
 [7,] 1700 7e+04
 [8,] 1800 8e+04
 [9,] 1900 9e+04
[10,] 2000 1e+05
> 
> 
> tmp3[,-1] <- tmp3[,1:9]
> tmp3[,1:10]
      [,1] [,2]  [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,] 1100 1100 1e+04   21   31   41   51   61   71    81
 [2,] 1200 1200 2e+04   22   32   42   52   62   72    82
 [3,] 1300 1300 3e+04   23   33   43   53   63   73    83
 [4,] 1400 1400 4e+04   24   34   44   54   64   74    84
 [5,] 1500 1500 5e+04   25   35   45   55   65   75    85
 [6,] 1600 1600 6e+04   26   36   46   56   66   76    86
 [7,] 1700 1700 7e+04   27   37   47   57   67   77    87
 [8,] 1800 1800 8e+04   28   38   48   58   68   78    88
 [9,] 1900 1900 9e+04   29   39   49   59   69   79    89
[10,] 2000 2000 1e+05   30   40   50   60   70   80    90
> 
> tmp3[,1:2] <- rep(1,10)
> tmp3[,1:2] <- rep(1,20)
> tmp3[,1:2] <- matrix(c(1:5),1,5)
> 
> tmp3[,-c(1:8)] <- matrix(c(1:5),1,5)
> 
> tmp3[1,] <- 1:10
> tmp3[1,]
     [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,]    1    2    3    4    5    6    7    8    9    10
> tmp3[-1,] <- c(1,2)
> tmp3[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    1    2    3    4    5    6    7    8    9    10
 [2,]    1    2    1    2    1    2    1    2    1     2
 [3,]    2    1    2    1    2    1    2    1    2     1
 [4,]    1    2    1    2    1    2    1    2    1     2
 [5,]    2    1    2    1    2    1    2    1    2     1
 [6,]    1    2    1    2    1    2    1    2    1     2
 [7,]    2    1    2    1    2    1    2    1    2     1
 [8,]    1    2    1    2    1    2    1    2    1     2
 [9,]    2    1    2    1    2    1    2    1    2     1
[10,]    1    2    1    2    1    2    1    2    1     2
> tmp3[-c(1:8),] <- matrix(c(1:5),1,5)
> tmp3[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    1    2    3    4    5    6    7    8    9    10
 [2,]    1    2    1    2    1    2    1    2    1     2
 [3,]    2    1    2    1    2    1    2    1    2     1
 [4,]    1    2    1    2    1    2    1    2    1     2
 [5,]    2    1    2    1    2    1    2    1    2     1
 [6,]    1    2    1    2    1    2    1    2    1     2
 [7,]    2    1    2    1    2    1    2    1    2     1
 [8,]    1    2    1    2    1    2    1    2    1     2
 [9,]    1    3    5    2    4    1    3    5    2     4
[10,]    2    4    1    3    5    2    4    1    3     5
> 
> 
> tmp3[1:2,1:2] <- 5555.04
> tmp3[-(1:2),1:2] <- 1234.56789
> 
> 
> 
> ## testing accessors for the directory and prefix
> directory(tmp3)
[1] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests"
> prefix(tmp3)
[1] "BM"
> 
> ## testing if we can remove these objects
> rm(tmp, tmp2, tmp3)
> gc()
         used (Mb) gc trigger (Mb) limit (Mb) max used (Mb)
Ncells 481248 25.8    1058085 56.6         NA   633817 33.9
Vcells 891449  6.9    8388608 64.0     196608  2110969 16.2
> 
> 
> 
> 
> ##
> ## checking reads
> ##
> 
> tmp2 <- createBufferedMatrix(10,20)
> 
> test.sample <- rnorm(10*20)
> 
> tmp2[1:10,1:20] <- test.sample
> 
> test.matrix <- matrix(test.sample,10,20)
> 
> ## testing reads
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   which.col <- sample(1:20,1)
+   if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> date()
[1] "Thu Nov 13 18:51:35 2025"
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> date()
[1] "Thu Nov 13 18:51:36 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: 0x600000da0180>
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   which.col <- sample(1:20,1)
+   if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,5,replace=TRUE)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> date()
[1] "Thu Nov 13 18:51:37 2025"
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col <- sample(1:20,5,replace=TRUE)
+   if (!all(tmp2[which.row,which.col] == test.matrix[which.row,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> date()
[1] "Thu Nov 13 18:51:37 2025"
> 
> ColMode(tmp2)
<pointer: 0x600000da0180>
> 
> 
> 
> ### Now testing assignments
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+ 
+   new.data <- rnorm(20)
+   tmp2[which.row,] <- new.data
+   test.matrix[which.row,] <- new.data
+   if (rep > 1){
+     if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+   
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   new.data <- rnorm(10)
+   tmp2[,which.col] <- new.data
+   test.matrix[,which.col]<- new.data
+ 
+   if (rep > 1){
+     if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.col <- which.col
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,5,replace=TRUE)
+   new.data <- matrix(rnorm(50),5,10)
+   tmp2[,which.col] <- new.data
+   test.matrix[,which.col]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.col <- which.col
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   new.data <- matrix(rnorm(50),5,10)
+   tmp2[which.row,] <- new.data
+   test.matrix[which.row,]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col  <- sample(1:20,5,replace=TRUE)
+   new.data <- matrix(rnorm(25),5,5)
+   tmp2[which.row,which.col] <- new.data
+   test.matrix[which.row,which.col]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[prev.row,prev.col] == test.matrix[prev.row,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+   prev.col <- which.col
+ }
> 
> 
> 
> 
> ###
> ###
> ### testing some more functions
> ###
> 
> 
> 
> ## duplication function
> tmp5 <- duplicate(tmp2)
> 
> # making sure really did copy everything.
> tmp5[1,1] <- tmp5[1,1] +100.00
> 
> if (tmp5[1,1] == tmp2[1,1]){
+   stop("Problem with duplication")
+ }
> 
> 
> 
> 
> ### testing elementwise applying of functions
> 
> tmp5[1:4,1:4]
          [,1]       [,2]       [,3]       [,4]
[1,] 98.713766  2.6399684  0.5039362  0.9255521
[2,] -1.174345  0.1905830  0.1337386 -1.6296635
[3,] -1.386819 -0.3234447 -0.9971620 -0.3935116
[4,] -1.785917 -0.3465023  1.0308631  0.6429409
> ewApply(tmp5,abs)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
          [,1]      [,2]      [,3]      [,4]
[1,] 98.713766 2.6399684 0.5039362 0.9255521
[2,]  1.174345 0.1905830 0.1337386 1.6296635
[3,]  1.386819 0.3234447 0.9971620 0.3935116
[4,]  1.785917 0.3465023 1.0308631 0.6429409
> ewApply(tmp5,sqrt)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
         [,1]      [,2]      [,3]      [,4]
[1,] 9.935480 1.6247979 0.7098846 0.9620562
[2,] 1.083672 0.4365581 0.3657029 1.2765827
[3,] 1.177633 0.5687220 0.9985800 0.6273050
[4,] 1.336382 0.5886444 1.0153143 0.8018360
> 
> my.function <- function(x,power){
+   (x+5)^power
+ }
> 
> ewApply(tmp5,my.function,power=2)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
          [,1]     [,2]     [,3]     [,4]
[1,] 223.06857 43.88795 32.60278 35.54611
[2,]  37.01107 29.55616 28.79077 39.39549
[3,]  38.16315 31.01066 35.98296 31.66656
[4,]  40.14974 31.23295 36.18401 33.66130
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x600000db8780>
> exp(tmp5)
<pointer: 0x600000db8780>
> log(tmp5,2)
<pointer: 0x600000db8780>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 464.288
> Min(tmp5)
[1] 53.40964
> mean(tmp5)
[1] 73.14818
> Sum(tmp5)
[1] 14629.64
> Var(tmp5)
[1] 843.8265
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 92.93374 72.02381 69.49500 72.41790 68.91677 70.74099 71.63231 68.99323
 [9] 73.10223 71.22579
> rowSums(tmp5)
 [1] 1858.675 1440.476 1389.900 1448.358 1378.335 1414.820 1432.646 1379.865
 [9] 1462.045 1424.516
> rowVars(tmp5)
 [1] 7716.01816   60.22279   63.84165   75.22499   60.63529   70.30827
 [7]  114.96344   38.95884  112.38209   47.97445
> rowSd(tmp5)
 [1] 87.840868  7.760334  7.990097  8.673234  7.786867  8.385003 10.722100
 [8]  6.241702 10.601042  6.926359
> rowMax(tmp5)
 [1] 464.28800  82.64567  82.40055  86.42690  81.92242  84.82300  91.89781
 [8]  78.74148  92.69273  90.15739
> rowMin(tmp5)
 [1] 59.13631 59.92421 55.61137 56.50433 55.10624 57.69543 53.40964 56.46941
 [9] 56.14957 62.21208
> 
> colMeans(tmp5)
 [1] 112.04763  70.32606  68.43183  68.83891  68.44855  72.13337  71.15025
 [8]  72.33332  66.91114  74.75670  73.74673  70.78371  68.22939  76.85385
[15]  68.34848  68.49234  73.53157  72.35586  72.74175  72.50209
> colSums(tmp5)
 [1] 1120.4763  703.2606  684.3183  688.3891  684.4855  721.3337  711.5025
 [8]  723.3332  669.1114  747.5670  737.4673  707.8371  682.2939  768.5385
[15]  683.4848  684.9234  735.3157  723.5586  727.4175  725.0209
> colVars(tmp5)
 [1] 15412.36781    99.23666    41.17149    40.93732    67.87174    58.77752
 [7]    53.12682    23.47295    91.41459    96.44426    71.96361    58.77412
[13]    71.99627    57.08474    74.59977   115.12047    94.42969   117.03090
[19]    65.37464    34.35432
> colSd(tmp5)
 [1] 124.146558   9.961760   6.416501   6.398228   8.238431   7.666650
 [7]   7.288815   4.844889   9.561098   9.820604   8.483137   7.666428
[13]   8.485061   7.555445   8.637116  10.729421   9.717494  10.818082
[19]   8.085458   5.861256
> colMax(tmp5)
 [1] 464.28800  91.34701  78.62930  81.99655  82.64567  79.67991  82.40055
 [8]  78.23419  85.22574  92.69273  89.18682  82.93176  81.54990  91.89781
[15]  81.99522  86.42690  90.91789  90.15739  89.16739  83.43490
> colMin(tmp5)
 [1] 53.40964 60.33605 59.92421 58.56953 56.50433 59.45859 62.08035 64.08883
 [9] 56.14957 57.69543 58.14664 56.46941 54.93540 64.64010 55.61137 55.10624
[17] 60.22103 58.09511 63.52972 64.13809
> 
> 
> ### 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] 92.93374 72.02381 69.49500 72.41790       NA 70.74099 71.63231 68.99323
 [9] 73.10223 71.22579
> rowSums(tmp5)
 [1] 1858.675 1440.476 1389.900 1448.358       NA 1414.820 1432.646 1379.865
 [9] 1462.045 1424.516
> rowVars(tmp5)
 [1] 7716.01816   60.22279   63.84165   75.22499   58.63088   70.30827
 [7]  114.96344   38.95884  112.38209   47.97445
> rowSd(tmp5)
 [1] 87.840868  7.760334  7.990097  8.673234  7.657080  8.385003 10.722100
 [8]  6.241702 10.601042  6.926359
> rowMax(tmp5)
 [1] 464.28800  82.64567  82.40055  86.42690        NA  84.82300  91.89781
 [8]  78.74148  92.69273  90.15739
> rowMin(tmp5)
 [1] 59.13631 59.92421 55.61137 56.50433       NA 57.69543 53.40964 56.46941
 [9] 56.14957 62.21208
> 
> colMeans(tmp5)
 [1] 112.04763  70.32606  68.43183  68.83891  68.44855  72.13337  71.15025
 [8]  72.33332  66.91114  74.75670  73.74673  70.78371  68.22939  76.85385
[15]  68.34848  68.49234  73.53157        NA  72.74175  72.50209
> colSums(tmp5)
 [1] 1120.4763  703.2606  684.3183  688.3891  684.4855  721.3337  711.5025
 [8]  723.3332  669.1114  747.5670  737.4673  707.8371  682.2939  768.5385
[15]  683.4848  684.9234  735.3157        NA  727.4175  725.0209
> colVars(tmp5)
 [1] 15412.36781    99.23666    41.17149    40.93732    67.87174    58.77752
 [7]    53.12682    23.47295    91.41459    96.44426    71.96361    58.77412
[13]    71.99627    57.08474    74.59977   115.12047    94.42969          NA
[19]    65.37464    34.35432
> colSd(tmp5)
 [1] 124.146558   9.961760   6.416501   6.398228   8.238431   7.666650
 [7]   7.288815   4.844889   9.561098   9.820604   8.483137   7.666428
[13]   8.485061   7.555445   8.637116  10.729421   9.717494         NA
[19]   8.085458   5.861256
> colMax(tmp5)
 [1] 464.28800  91.34701  78.62930  81.99655  82.64567  79.67991  82.40055
 [8]  78.23419  85.22574  92.69273  89.18682  82.93176  81.54990  91.89781
[15]  81.99522  86.42690  90.91789        NA  89.16739  83.43490
> colMin(tmp5)
 [1] 53.40964 60.33605 59.92421 58.56953 56.50433 59.45859 62.08035 64.08883
 [9] 56.14957 57.69543 58.14664 56.46941 54.93540 64.64010 55.61137 55.10624
[17] 60.22103       NA 63.52972 64.13809
> 
> Max(tmp5,na.rm=TRUE)
[1] 464.288
> Min(tmp5,na.rm=TRUE)
[1] 53.40964
> mean(tmp5,na.rm=TRUE)
[1] 73.12127
> Sum(tmp5,na.rm=TRUE)
[1] 14551.13
> Var(tmp5,na.rm=TRUE)
[1] 847.9427
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 92.93374 72.02381 69.49500 72.41790 68.41228 70.74099 71.63231 68.99323
 [9] 73.10223 71.22579
> rowSums(tmp5,na.rm=TRUE)
 [1] 1858.675 1440.476 1389.900 1448.358 1299.833 1414.820 1432.646 1379.865
 [9] 1462.045 1424.516
> rowVars(tmp5,na.rm=TRUE)
 [1] 7716.01816   60.22279   63.84165   75.22499   58.63088   70.30827
 [7]  114.96344   38.95884  112.38209   47.97445
> rowSd(tmp5,na.rm=TRUE)
 [1] 87.840868  7.760334  7.990097  8.673234  7.657080  8.385003 10.722100
 [8]  6.241702 10.601042  6.926359
> rowMax(tmp5,na.rm=TRUE)
 [1] 464.28800  82.64567  82.40055  86.42690  81.92242  84.82300  91.89781
 [8]  78.74148  92.69273  90.15739
> rowMin(tmp5,na.rm=TRUE)
 [1] 59.13631 59.92421 55.61137 56.50433 55.10624 57.69543 53.40964 56.46941
 [9] 56.14957 62.21208
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 112.04763  70.32606  68.43183  68.83891  68.44855  72.13337  71.15025
 [8]  72.33332  66.91114  74.75670  73.74673  70.78371  68.22939  76.85385
[15]  68.34848  68.49234  73.53157  71.67294  72.74175  72.50209
> colSums(tmp5,na.rm=TRUE)
 [1] 1120.4763  703.2606  684.3183  688.3891  684.4855  721.3337  711.5025
 [8]  723.3332  669.1114  747.5670  737.4673  707.8371  682.2939  768.5385
[15]  683.4848  684.9234  735.3157  645.0565  727.4175  725.0209
> colVars(tmp5,na.rm=TRUE)
 [1] 15412.36781    99.23666    41.17149    40.93732    67.87174    58.77752
 [7]    53.12682    23.47295    91.41459    96.44426    71.96361    58.77412
[13]    71.99627    57.08474    74.59977   115.12047    94.42969   126.41301
[19]    65.37464    34.35432
> colSd(tmp5,na.rm=TRUE)
 [1] 124.146558   9.961760   6.416501   6.398228   8.238431   7.666650
 [7]   7.288815   4.844889   9.561098   9.820604   8.483137   7.666428
[13]   8.485061   7.555445   8.637116  10.729421   9.717494  11.243354
[19]   8.085458   5.861256
> colMax(tmp5,na.rm=TRUE)
 [1] 464.28800  91.34701  78.62930  81.99655  82.64567  79.67991  82.40055
 [8]  78.23419  85.22574  92.69273  89.18682  82.93176  81.54990  91.89781
[15]  81.99522  86.42690  90.91789  90.15739  89.16739  83.43490
> colMin(tmp5,na.rm=TRUE)
 [1] 53.40964 60.33605 59.92421 58.56953 56.50433 59.45859 62.08035 64.08883
 [9] 56.14957 57.69543 58.14664 56.46941 54.93540 64.64010 55.61137 55.10624
[17] 60.22103 58.09511 63.52972 64.13809
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1] 92.93374 72.02381 69.49500 72.41790      NaN 70.74099 71.63231 68.99323
 [9] 73.10223 71.22579
> rowSums(tmp5,na.rm=TRUE)
 [1] 1858.675 1440.476 1389.900 1448.358    0.000 1414.820 1432.646 1379.865
 [9] 1462.045 1424.516
> rowVars(tmp5,na.rm=TRUE)
 [1] 7716.01816   60.22279   63.84165   75.22499         NA   70.30827
 [7]  114.96344   38.95884  112.38209   47.97445
> rowSd(tmp5,na.rm=TRUE)
 [1] 87.840868  7.760334  7.990097  8.673234        NA  8.385003 10.722100
 [8]  6.241702 10.601042  6.926359
> rowMax(tmp5,na.rm=TRUE)
 [1] 464.28800  82.64567  82.40055  86.42690        NA  84.82300  91.89781
 [8]  78.74148  92.69273  90.15739
> rowMin(tmp5,na.rm=TRUE)
 [1] 59.13631 59.92421 55.61137 56.50433       NA 57.69543 53.40964 56.46941
 [9] 56.14957 62.21208
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1] 115.39488  71.43606  69.15748  69.59205  68.75741  72.54725  72.15802
 [8]  72.88687  67.68195  74.95382  73.23742  70.47098  66.74934  76.82008
[15]  68.92560  69.97969  73.86600       NaN  73.14508  72.93375
> colSums(tmp5,na.rm=TRUE)
 [1] 1038.5539  642.9245  622.4173  626.3285  618.8167  652.9253  649.4222
 [8]  655.9818  609.1376  674.5844  659.1367  634.2388  600.7440  691.3807
[15]  620.3304  629.8172  664.7940    0.0000  658.3057  656.4038
> colVars(tmp5,na.rm=TRUE)
 [1] 17212.86817    97.78011    40.39405    39.67325    75.28248    64.19762
 [7]    48.34224    22.95990    96.15717   108.06266    78.04085    65.02064
[13]    56.35193    64.20750    80.17781   104.62334   104.97515          NA
[19]    71.71634    36.55235
> colSd(tmp5,na.rm=TRUE)
 [1] 131.197821   9.888382   6.355631   6.298671   8.676548   8.012342
 [7]   6.952858   4.791649   9.805976  10.395319   8.834073   8.063538
[13]   7.506792   8.012958   8.954206  10.228555  10.245738         NA
[19]   8.468550   6.045854
> colMax(tmp5,na.rm=TRUE)
 [1] 464.28800  91.34701  78.62930  81.99655  82.64567  79.67991  82.40055
 [8]  78.23419  85.22574  92.69273  89.18682  82.93176  78.66653  91.89781
[15]  81.99522  86.42690  90.91789      -Inf  89.16739  83.43490
> colMin(tmp5,na.rm=TRUE)
 [1] 53.40964 61.51728 59.92421 58.56953 56.50433 59.45859 63.39287 64.08883
 [9] 56.14957 57.69543 58.14664 56.46941 54.93540 64.64010 55.61137 57.70874
[17] 60.22103      Inf 63.52972 64.13809
> 
> 
> 
> 
> 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] 131.6971 103.2874 277.2510 222.8581 305.7897 328.4383 196.7087 267.9488
 [9] 268.6139 157.4896
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 131.6971 103.2874 277.2510 222.8581 305.7897 328.4383 196.7087 267.9488
 [9] 268.6139 157.4896
> 
> 
> 
> 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]  7.105427e-14 -1.136868e-13 -5.684342e-14 -4.263256e-14 -8.526513e-14
 [6]  5.684342e-14  5.684342e-14  7.105427e-15 -5.684342e-14 -5.684342e-14
[11] -1.136868e-13  2.842171e-14 -1.705303e-13 -2.842171e-14  5.684342e-14
[16]  2.842171e-14  5.684342e-14 -1.136868e-13 -8.526513e-14 -2.842171e-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)
+ }
5   11 
4   15 
1   16 
10   5 
3   4 
8   1 
5   9 
1   20 
10   7 
4   3 
8   17 
10   17 
4   6 
4   10 
3   18 
4   17 
8   10 
8   15 
8   20 
8   9 
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.893013
> Min(tmp)
[1] -1.991093
> mean(tmp)
[1] -0.115648
> Sum(tmp)
[1] -11.5648
> Var(tmp)
[1] 1.00235
> 
> rowMeans(tmp)
[1] -0.115648
> rowSums(tmp)
[1] -11.5648
> rowVars(tmp)
[1] 1.00235
> rowSd(tmp)
[1] 1.001174
> rowMax(tmp)
[1] 2.893013
> rowMin(tmp)
[1] -1.991093
> 
> colMeans(tmp)
  [1]  1.078207328 -0.630260689 -1.950184563  1.065653823  1.171066943
  [6]  0.681080602 -0.529592228  1.250197452 -1.680749583 -0.601439134
 [11]  2.893013420 -0.136352327 -0.019028293  0.395658305 -1.407363356
 [16] -1.924716628  0.961838349 -1.555457511 -0.660995445 -0.394182694
 [21] -0.294874310 -0.963038363  0.362713793 -1.406924191  0.892740428
 [26] -0.613260776 -1.926949549 -0.516457743  0.298186912  0.007236885
 [31]  1.183140433  1.039047696  1.896146837  1.570295124  1.499697070
 [36] -0.791467023  0.499737756 -0.300013682  0.501421852  1.257707234
 [41] -0.692790866 -1.169999851 -1.090752707 -1.318389026  0.072663686
 [46]  1.063128426 -0.230358000 -1.267606572 -0.423459503 -1.991092957
 [51]  0.276769052 -0.671475671 -0.705584935  0.918979050 -1.248254445
 [56]  1.964460476 -1.302640294 -1.119645978  0.766828196 -0.174628399
 [61]  0.889285380 -0.187769209 -0.511543995  0.254722460  0.729817051
 [66] -0.751564911 -0.755484857  0.919262399 -0.150821209 -0.646451553
 [71] -0.540024522  0.138886990 -0.372313683 -0.399010768 -1.733008222
 [76] -1.207522151 -0.027196680  0.657633092 -0.113640009  0.193528794
 [81]  0.289079071  0.433493728  1.882436216  0.420930637  1.213704322
 [86]  0.159133535  0.318869725 -1.421063132 -0.184622990 -0.283859229
 [91]  0.620045527 -1.051868320 -0.450021214 -0.066689914 -0.308965459
 [96] -0.728722123 -0.643281762 -1.082122734  0.717450790 -1.643139683
> colSums(tmp)
  [1]  1.078207328 -0.630260689 -1.950184563  1.065653823  1.171066943
  [6]  0.681080602 -0.529592228  1.250197452 -1.680749583 -0.601439134
 [11]  2.893013420 -0.136352327 -0.019028293  0.395658305 -1.407363356
 [16] -1.924716628  0.961838349 -1.555457511 -0.660995445 -0.394182694
 [21] -0.294874310 -0.963038363  0.362713793 -1.406924191  0.892740428
 [26] -0.613260776 -1.926949549 -0.516457743  0.298186912  0.007236885
 [31]  1.183140433  1.039047696  1.896146837  1.570295124  1.499697070
 [36] -0.791467023  0.499737756 -0.300013682  0.501421852  1.257707234
 [41] -0.692790866 -1.169999851 -1.090752707 -1.318389026  0.072663686
 [46]  1.063128426 -0.230358000 -1.267606572 -0.423459503 -1.991092957
 [51]  0.276769052 -0.671475671 -0.705584935  0.918979050 -1.248254445
 [56]  1.964460476 -1.302640294 -1.119645978  0.766828196 -0.174628399
 [61]  0.889285380 -0.187769209 -0.511543995  0.254722460  0.729817051
 [66] -0.751564911 -0.755484857  0.919262399 -0.150821209 -0.646451553
 [71] -0.540024522  0.138886990 -0.372313683 -0.399010768 -1.733008222
 [76] -1.207522151 -0.027196680  0.657633092 -0.113640009  0.193528794
 [81]  0.289079071  0.433493728  1.882436216  0.420930637  1.213704322
 [86]  0.159133535  0.318869725 -1.421063132 -0.184622990 -0.283859229
 [91]  0.620045527 -1.051868320 -0.450021214 -0.066689914 -0.308965459
 [96] -0.728722123 -0.643281762 -1.082122734  0.717450790 -1.643139683
> 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.078207328 -0.630260689 -1.950184563  1.065653823  1.171066943
  [6]  0.681080602 -0.529592228  1.250197452 -1.680749583 -0.601439134
 [11]  2.893013420 -0.136352327 -0.019028293  0.395658305 -1.407363356
 [16] -1.924716628  0.961838349 -1.555457511 -0.660995445 -0.394182694
 [21] -0.294874310 -0.963038363  0.362713793 -1.406924191  0.892740428
 [26] -0.613260776 -1.926949549 -0.516457743  0.298186912  0.007236885
 [31]  1.183140433  1.039047696  1.896146837  1.570295124  1.499697070
 [36] -0.791467023  0.499737756 -0.300013682  0.501421852  1.257707234
 [41] -0.692790866 -1.169999851 -1.090752707 -1.318389026  0.072663686
 [46]  1.063128426 -0.230358000 -1.267606572 -0.423459503 -1.991092957
 [51]  0.276769052 -0.671475671 -0.705584935  0.918979050 -1.248254445
 [56]  1.964460476 -1.302640294 -1.119645978  0.766828196 -0.174628399
 [61]  0.889285380 -0.187769209 -0.511543995  0.254722460  0.729817051
 [66] -0.751564911 -0.755484857  0.919262399 -0.150821209 -0.646451553
 [71] -0.540024522  0.138886990 -0.372313683 -0.399010768 -1.733008222
 [76] -1.207522151 -0.027196680  0.657633092 -0.113640009  0.193528794
 [81]  0.289079071  0.433493728  1.882436216  0.420930637  1.213704322
 [86]  0.159133535  0.318869725 -1.421063132 -0.184622990 -0.283859229
 [91]  0.620045527 -1.051868320 -0.450021214 -0.066689914 -0.308965459
 [96] -0.728722123 -0.643281762 -1.082122734  0.717450790 -1.643139683
> colMin(tmp)
  [1]  1.078207328 -0.630260689 -1.950184563  1.065653823  1.171066943
  [6]  0.681080602 -0.529592228  1.250197452 -1.680749583 -0.601439134
 [11]  2.893013420 -0.136352327 -0.019028293  0.395658305 -1.407363356
 [16] -1.924716628  0.961838349 -1.555457511 -0.660995445 -0.394182694
 [21] -0.294874310 -0.963038363  0.362713793 -1.406924191  0.892740428
 [26] -0.613260776 -1.926949549 -0.516457743  0.298186912  0.007236885
 [31]  1.183140433  1.039047696  1.896146837  1.570295124  1.499697070
 [36] -0.791467023  0.499737756 -0.300013682  0.501421852  1.257707234
 [41] -0.692790866 -1.169999851 -1.090752707 -1.318389026  0.072663686
 [46]  1.063128426 -0.230358000 -1.267606572 -0.423459503 -1.991092957
 [51]  0.276769052 -0.671475671 -0.705584935  0.918979050 -1.248254445
 [56]  1.964460476 -1.302640294 -1.119645978  0.766828196 -0.174628399
 [61]  0.889285380 -0.187769209 -0.511543995  0.254722460  0.729817051
 [66] -0.751564911 -0.755484857  0.919262399 -0.150821209 -0.646451553
 [71] -0.540024522  0.138886990 -0.372313683 -0.399010768 -1.733008222
 [76] -1.207522151 -0.027196680  0.657633092 -0.113640009  0.193528794
 [81]  0.289079071  0.433493728  1.882436216  0.420930637  1.213704322
 [86]  0.159133535  0.318869725 -1.421063132 -0.184622990 -0.283859229
 [91]  0.620045527 -1.051868320 -0.450021214 -0.066689914 -0.308965459
 [96] -0.728722123 -0.643281762 -1.082122734  0.717450790 -1.643139683
> colMedians(tmp)
  [1]  1.078207328 -0.630260689 -1.950184563  1.065653823  1.171066943
  [6]  0.681080602 -0.529592228  1.250197452 -1.680749583 -0.601439134
 [11]  2.893013420 -0.136352327 -0.019028293  0.395658305 -1.407363356
 [16] -1.924716628  0.961838349 -1.555457511 -0.660995445 -0.394182694
 [21] -0.294874310 -0.963038363  0.362713793 -1.406924191  0.892740428
 [26] -0.613260776 -1.926949549 -0.516457743  0.298186912  0.007236885
 [31]  1.183140433  1.039047696  1.896146837  1.570295124  1.499697070
 [36] -0.791467023  0.499737756 -0.300013682  0.501421852  1.257707234
 [41] -0.692790866 -1.169999851 -1.090752707 -1.318389026  0.072663686
 [46]  1.063128426 -0.230358000 -1.267606572 -0.423459503 -1.991092957
 [51]  0.276769052 -0.671475671 -0.705584935  0.918979050 -1.248254445
 [56]  1.964460476 -1.302640294 -1.119645978  0.766828196 -0.174628399
 [61]  0.889285380 -0.187769209 -0.511543995  0.254722460  0.729817051
 [66] -0.751564911 -0.755484857  0.919262399 -0.150821209 -0.646451553
 [71] -0.540024522  0.138886990 -0.372313683 -0.399010768 -1.733008222
 [76] -1.207522151 -0.027196680  0.657633092 -0.113640009  0.193528794
 [81]  0.289079071  0.433493728  1.882436216  0.420930637  1.213704322
 [86]  0.159133535  0.318869725 -1.421063132 -0.184622990 -0.283859229
 [91]  0.620045527 -1.051868320 -0.450021214 -0.066689914 -0.308965459
 [96] -0.728722123 -0.643281762 -1.082122734  0.717450790 -1.643139683
> colRanges(tmp)
         [,1]       [,2]      [,3]     [,4]     [,5]      [,6]       [,7]
[1,] 1.078207 -0.6302607 -1.950185 1.065654 1.171067 0.6810806 -0.5295922
[2,] 1.078207 -0.6302607 -1.950185 1.065654 1.171067 0.6810806 -0.5295922
         [,8]     [,9]      [,10]    [,11]      [,12]       [,13]     [,14]
[1,] 1.250197 -1.68075 -0.6014391 2.893013 -0.1363523 -0.01902829 0.3956583
[2,] 1.250197 -1.68075 -0.6014391 2.893013 -0.1363523 -0.01902829 0.3956583
         [,15]     [,16]     [,17]     [,18]      [,19]      [,20]      [,21]
[1,] -1.407363 -1.924717 0.9618383 -1.555458 -0.6609954 -0.3941827 -0.2948743
[2,] -1.407363 -1.924717 0.9618383 -1.555458 -0.6609954 -0.3941827 -0.2948743
          [,22]     [,23]     [,24]     [,25]      [,26]    [,27]      [,28]
[1,] -0.9630384 0.3627138 -1.406924 0.8927404 -0.6132608 -1.92695 -0.5164577
[2,] -0.9630384 0.3627138 -1.406924 0.8927404 -0.6132608 -1.92695 -0.5164577
         [,29]       [,30]   [,31]    [,32]    [,33]    [,34]    [,35]
[1,] 0.2981869 0.007236885 1.18314 1.039048 1.896147 1.570295 1.499697
[2,] 0.2981869 0.007236885 1.18314 1.039048 1.896147 1.570295 1.499697
         [,36]     [,37]      [,38]     [,39]    [,40]      [,41] [,42]
[1,] -0.791467 0.4997378 -0.3000137 0.5014219 1.257707 -0.6927909 -1.17
[2,] -0.791467 0.4997378 -0.3000137 0.5014219 1.257707 -0.6927909 -1.17
         [,43]     [,44]      [,45]    [,46]     [,47]     [,48]      [,49]
[1,] -1.090753 -1.318389 0.07266369 1.063128 -0.230358 -1.267607 -0.4234595
[2,] -1.090753 -1.318389 0.07266369 1.063128 -0.230358 -1.267607 -0.4234595
         [,50]     [,51]      [,52]      [,53]     [,54]     [,55]   [,56]
[1,] -1.991093 0.2767691 -0.6714757 -0.7055849 0.9189791 -1.248254 1.96446
[2,] -1.991093 0.2767691 -0.6714757 -0.7055849 0.9189791 -1.248254 1.96446
        [,57]     [,58]     [,59]      [,60]     [,61]      [,62]     [,63]
[1,] -1.30264 -1.119646 0.7668282 -0.1746284 0.8892854 -0.1877692 -0.511544
[2,] -1.30264 -1.119646 0.7668282 -0.1746284 0.8892854 -0.1877692 -0.511544
         [,64]     [,65]      [,66]      [,67]     [,68]      [,69]      [,70]
[1,] 0.2547225 0.7298171 -0.7515649 -0.7554849 0.9192624 -0.1508212 -0.6464516
[2,] 0.2547225 0.7298171 -0.7515649 -0.7554849 0.9192624 -0.1508212 -0.6464516
          [,71]    [,72]      [,73]      [,74]     [,75]     [,76]       [,77]
[1,] -0.5400245 0.138887 -0.3723137 -0.3990108 -1.733008 -1.207522 -0.02719668
[2,] -0.5400245 0.138887 -0.3723137 -0.3990108 -1.733008 -1.207522 -0.02719668
         [,78]    [,79]     [,80]     [,81]     [,82]    [,83]     [,84]
[1,] 0.6576331 -0.11364 0.1935288 0.2890791 0.4334937 1.882436 0.4209306
[2,] 0.6576331 -0.11364 0.1935288 0.2890791 0.4334937 1.882436 0.4209306
        [,85]     [,86]     [,87]     [,88]     [,89]      [,90]     [,91]
[1,] 1.213704 0.1591335 0.3188697 -1.421063 -0.184623 -0.2838592 0.6200455
[2,] 1.213704 0.1591335 0.3188697 -1.421063 -0.184623 -0.2838592 0.6200455
         [,92]      [,93]       [,94]      [,95]      [,96]      [,97]
[1,] -1.051868 -0.4500212 -0.06668991 -0.3089655 -0.7287221 -0.6432818
[2,] -1.051868 -0.4500212 -0.06668991 -0.3089655 -0.7287221 -0.6432818
         [,98]     [,99]   [,100]
[1,] -1.082123 0.7174508 -1.64314
[2,] -1.082123 0.7174508 -1.64314
> 
> 
> Max(tmp2)
[1] 3.164713
> Min(tmp2)
[1] -2.924198
> mean(tmp2)
[1] -0.1276014
> Sum(tmp2)
[1] -12.76014
> Var(tmp2)
[1] 1.078182
> 
> rowMeans(tmp2)
  [1]  0.12413669 -2.05025054 -0.38921000  1.73509565 -0.55232827 -1.19957335
  [7]  0.05326495  1.61802781 -0.13117760  0.28466700 -0.45580077 -2.20572318
 [13]  0.62145510  0.48892141 -0.89872970 -0.39248487  0.40013355  0.06553669
 [19]  1.64130074  0.68114248 -0.69443347  1.07476570 -1.11902450  0.55260831
 [25] -0.15696080  0.18679066  0.36863883 -0.56757770  1.51095792  0.38650200
 [31] -1.56304349 -0.49917833 -0.64032596 -0.93802742 -1.78653175 -0.13672156
 [37]  1.05474737  1.39193659  0.67358560  0.48685785  0.46130801 -0.54563233
 [43]  0.09566866  0.03067410  0.17512883 -1.33612744 -0.01641884  0.55346842
 [49]  0.28536411 -0.55604486  0.79949560 -0.93839893  0.43152541 -0.59855051
 [55] -0.49409185 -1.01111216  1.07846344 -1.52077491 -0.97202223 -1.01996654
 [61] -0.67451509  0.27026281  1.07591606 -0.29766782  0.74731714  0.43134606
 [67]  2.10214305 -2.23890124 -0.09956157 -1.17046247 -1.12271195 -1.47310574
 [73]  0.11098585 -0.23891665  0.66492733 -0.44300607  0.02286479  3.16471326
 [79]  0.17532655 -0.05619969  0.08181325 -0.01035402 -1.92569633 -2.92419795
 [85]  0.84647029 -0.45779465  0.17962964 -0.50145682 -0.38362264  0.82481453
 [91] -0.55022864  1.52971795 -0.94309421 -1.25438397 -0.40159330  0.71175932
 [97] -0.53601226 -0.64499570 -2.70318984  1.42559496
> rowSums(tmp2)
  [1]  0.12413669 -2.05025054 -0.38921000  1.73509565 -0.55232827 -1.19957335
  [7]  0.05326495  1.61802781 -0.13117760  0.28466700 -0.45580077 -2.20572318
 [13]  0.62145510  0.48892141 -0.89872970 -0.39248487  0.40013355  0.06553669
 [19]  1.64130074  0.68114248 -0.69443347  1.07476570 -1.11902450  0.55260831
 [25] -0.15696080  0.18679066  0.36863883 -0.56757770  1.51095792  0.38650200
 [31] -1.56304349 -0.49917833 -0.64032596 -0.93802742 -1.78653175 -0.13672156
 [37]  1.05474737  1.39193659  0.67358560  0.48685785  0.46130801 -0.54563233
 [43]  0.09566866  0.03067410  0.17512883 -1.33612744 -0.01641884  0.55346842
 [49]  0.28536411 -0.55604486  0.79949560 -0.93839893  0.43152541 -0.59855051
 [55] -0.49409185 -1.01111216  1.07846344 -1.52077491 -0.97202223 -1.01996654
 [61] -0.67451509  0.27026281  1.07591606 -0.29766782  0.74731714  0.43134606
 [67]  2.10214305 -2.23890124 -0.09956157 -1.17046247 -1.12271195 -1.47310574
 [73]  0.11098585 -0.23891665  0.66492733 -0.44300607  0.02286479  3.16471326
 [79]  0.17532655 -0.05619969  0.08181325 -0.01035402 -1.92569633 -2.92419795
 [85]  0.84647029 -0.45779465  0.17962964 -0.50145682 -0.38362264  0.82481453
 [91] -0.55022864  1.52971795 -0.94309421 -1.25438397 -0.40159330  0.71175932
 [97] -0.53601226 -0.64499570 -2.70318984  1.42559496
> 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.12413669 -2.05025054 -0.38921000  1.73509565 -0.55232827 -1.19957335
  [7]  0.05326495  1.61802781 -0.13117760  0.28466700 -0.45580077 -2.20572318
 [13]  0.62145510  0.48892141 -0.89872970 -0.39248487  0.40013355  0.06553669
 [19]  1.64130074  0.68114248 -0.69443347  1.07476570 -1.11902450  0.55260831
 [25] -0.15696080  0.18679066  0.36863883 -0.56757770  1.51095792  0.38650200
 [31] -1.56304349 -0.49917833 -0.64032596 -0.93802742 -1.78653175 -0.13672156
 [37]  1.05474737  1.39193659  0.67358560  0.48685785  0.46130801 -0.54563233
 [43]  0.09566866  0.03067410  0.17512883 -1.33612744 -0.01641884  0.55346842
 [49]  0.28536411 -0.55604486  0.79949560 -0.93839893  0.43152541 -0.59855051
 [55] -0.49409185 -1.01111216  1.07846344 -1.52077491 -0.97202223 -1.01996654
 [61] -0.67451509  0.27026281  1.07591606 -0.29766782  0.74731714  0.43134606
 [67]  2.10214305 -2.23890124 -0.09956157 -1.17046247 -1.12271195 -1.47310574
 [73]  0.11098585 -0.23891665  0.66492733 -0.44300607  0.02286479  3.16471326
 [79]  0.17532655 -0.05619969  0.08181325 -0.01035402 -1.92569633 -2.92419795
 [85]  0.84647029 -0.45779465  0.17962964 -0.50145682 -0.38362264  0.82481453
 [91] -0.55022864  1.52971795 -0.94309421 -1.25438397 -0.40159330  0.71175932
 [97] -0.53601226 -0.64499570 -2.70318984  1.42559496
> rowMin(tmp2)
  [1]  0.12413669 -2.05025054 -0.38921000  1.73509565 -0.55232827 -1.19957335
  [7]  0.05326495  1.61802781 -0.13117760  0.28466700 -0.45580077 -2.20572318
 [13]  0.62145510  0.48892141 -0.89872970 -0.39248487  0.40013355  0.06553669
 [19]  1.64130074  0.68114248 -0.69443347  1.07476570 -1.11902450  0.55260831
 [25] -0.15696080  0.18679066  0.36863883 -0.56757770  1.51095792  0.38650200
 [31] -1.56304349 -0.49917833 -0.64032596 -0.93802742 -1.78653175 -0.13672156
 [37]  1.05474737  1.39193659  0.67358560  0.48685785  0.46130801 -0.54563233
 [43]  0.09566866  0.03067410  0.17512883 -1.33612744 -0.01641884  0.55346842
 [49]  0.28536411 -0.55604486  0.79949560 -0.93839893  0.43152541 -0.59855051
 [55] -0.49409185 -1.01111216  1.07846344 -1.52077491 -0.97202223 -1.01996654
 [61] -0.67451509  0.27026281  1.07591606 -0.29766782  0.74731714  0.43134606
 [67]  2.10214305 -2.23890124 -0.09956157 -1.17046247 -1.12271195 -1.47310574
 [73]  0.11098585 -0.23891665  0.66492733 -0.44300607  0.02286479  3.16471326
 [79]  0.17532655 -0.05619969  0.08181325 -0.01035402 -1.92569633 -2.92419795
 [85]  0.84647029 -0.45779465  0.17962964 -0.50145682 -0.38362264  0.82481453
 [91] -0.55022864  1.52971795 -0.94309421 -1.25438397 -0.40159330  0.71175932
 [97] -0.53601226 -0.64499570 -2.70318984  1.42559496
> 
> colMeans(tmp2)
[1] -0.1276014
> colSums(tmp2)
[1] -12.76014
> colVars(tmp2)
[1] 1.078182
> colSd(tmp2)
[1] 1.038356
> colMax(tmp2)
[1] 3.164713
> colMin(tmp2)
[1] -2.924198
> colMedians(tmp2)
[1] -0.07788063
> colRanges(tmp2)
          [,1]
[1,] -2.924198
[2,]  3.164713
> 
> dataset1 <- matrix(dataset1,1,100)
> 
> agree.checks(tmp,dataset1)
> 
> dataset2 <- matrix(dataset2,100,1)
> agree.checks(tmp2,dataset2)
>   
> 
> tmp <- createBufferedMatrix(10,10)
> 
> tmp[1:10,1:10] <- rnorm(100)
> colApply(tmp,sum)
 [1]  0.38670530  3.52418692 -0.86357457 -2.01837546  4.08808949 -1.33955769
 [7] -0.67339139  0.07765003 -1.38764281  4.86989612
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -0.9027992
[2,] -0.6914731
[3,] -0.2286618
[4,]  0.5432520
[5,]  1.6726767
> 
> rowApply(tmp,sum)
 [1] -2.2070115  5.2800652  6.0566888 -3.0059726  0.5035777  2.5192190
 [7] -0.6958152  4.3977441 -5.1257758 -1.0587338
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    8    9    3    3    6    2    6    9    7     3
 [2,]    5    2   10    5   10    9   10    4    9     4
 [3,]    4    7    6   10    8    7    2    1    2     2
 [4,]    2    3    7    4    4    6    1    2    6     6
 [5,]    1   10    1    8    9    8    8   10    8     5
 [6,]    6    5    4    1    2   10    5    8    1     8
 [7,]    3    1    9    2    1    1    3    6   10    10
 [8,]    9    4    2    9    5    3    9    3    3     7
 [9,]    7    8    5    6    3    5    7    5    5     1
[10,]   10    6    8    7    7    4    4    7    4     9
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1]  1.41114148 -3.06404705 -1.80993475 -0.55188842  3.49340619  0.49533453
 [7] -1.12045594 -1.56290741 -1.05204444  0.79321210 -0.99279362 -0.09274441
[13] -0.61720298 -2.60410229 -1.98211435  0.81679106  2.61671926 -2.05668418
[19]  1.56025450 -0.06516042
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -0.7425915
[2,] -0.5369033
[3,]  0.1882358
[4,]  1.1237109
[5,]  1.3786896
> 
> rowApply(tmp,sum)
[1] -3.945579 -2.005129  2.721141 -4.919149  1.763494
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]   18    7   12    7   18
[2,]    4   19    4   15    1
[3,]    5    1   19   16   11
[4,]    2   18   17    1   13
[5,]   19   20    9    5    7
> 
> 
> as.matrix(tmp)
           [,1]        [,2]       [,3]       [,4]         [,5]       [,6]
[1,]  1.1237109 -1.06109171 -0.9258995 -1.3627312  1.157404875  2.0381006
[2,] -0.5369033  0.97924866 -2.7195165  0.8456194  3.307807910 -0.6757624
[3,]  0.1882358 -0.79875133  1.2980857  1.2026494 -0.002631938 -0.8290848
[4,] -0.7425915 -0.02233563  0.4163917 -1.5563166 -0.958229215 -0.2743530
[5,]  1.3786896 -2.16111705  0.1210038  0.3188906 -0.010945443  0.2364341
            [,7]       [,8]       [,9]        [,10]       [,11]       [,12]
[1,] -0.03052561 -0.4389117  0.6322377 -0.360332051 -0.49976863 -0.10476905
[2,] -1.38448531  0.1458824  0.8037622  0.005768972 -0.20138228  0.32143795
[3,] -0.57981375 -1.1867125 -1.4697803  0.462726198 -0.18060294  0.12866201
[4,]  0.83713846 -0.7537814 -0.4181995 -0.209411403 -0.14802381 -0.52228224
[5,]  0.03723027  0.6706158 -0.6000645  0.894460388  0.03698405  0.08420693
           [,13]      [,14]       [,15]      [,16]       [,17]      [,18]
[1,] -0.66396866 -0.4981477 -0.91520557 -1.3466376 -0.67454612  1.0413669
[2,] -0.54986119 -0.1440836 -1.63045477  0.2518567 -0.00402658 -1.7595845
[3,]  0.08900427  1.0759195  0.23240618  0.4778192  1.21530018 -0.6865856
[4,] -1.38682885 -1.4311778 -0.03529531  2.2864475  1.43090717  0.4306873
[5,]  1.89445144 -1.6066127  0.36643513 -0.8526946  0.64908461 -1.0825682
          [,19]       [,20]
[1,]  0.3819637 -1.43782841
[2,]  0.7708551  0.16869229
[3,]  2.0978731 -0.01357698
[4,] -1.2824984 -0.57939626
[5,] -0.4079390  1.79694893
> 
> 
> is.BufferedMatrix(tmp)
[1] TRUE
> 
> as.BufferedMatrix(as.matrix(tmp))
BufferedMatrix object
Matrix size:  5 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  800  bytes.
> 
> 
> 
> subBufferedMatrix(tmp,1:5,1:5)
BufferedMatrix object
Matrix size:  5 5 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  655  bytes.
Disk usage :  200  bytes.
> subBufferedMatrix(tmp,,5:8)
BufferedMatrix object
Matrix size:  5 4 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  566  bytes.
Disk usage :  160  bytes.
> subBufferedMatrix(tmp,1:3,)
BufferedMatrix object
Matrix size:  3 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  480  bytes.
> 
> 
> rm(tmp)
> 
> 
> ###
> ### Testing colnames and rownames
> ###
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> 
> 
> colnames(tmp)
NULL
> rownames(tmp)
NULL
> 
> 
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> colnames(tmp)
 [1] "col1"  "col2"  "col3"  "col4"  "col5"  "col6"  "col7"  "col8"  "col9" 
[10] "col10" "col11" "col12" "col13" "col14" "col15" "col16" "col17" "col18"
[19] "col19" "col20"
> rownames(tmp)
[1] "row1" "row2" "row3" "row4" "row5"
> 
> 
> tmp["row1",]
           col1       col2      col3      col4      col5     col6       col7
row1 0.08472585 -0.9841503 -1.504415 -1.029001 0.9340939 1.562199 -0.7178045
           col8       col9      col10    col11     col12     col13     col14
row1 -0.2251703 -0.1869429 -0.7115046 0.786088 0.2032674 -1.068355 0.5505386
          col15    col16     col17     col18    col19    col20
row1 -0.6631468 1.258739 0.6193277 0.2988527 1.210167 1.112359
> tmp[,"col10"]
             col10
row1 -0.7115046257
row2 -0.0004315644
row3  0.7533951849
row4  0.8220400852
row5 -0.2111474805
> tmp[c("row1","row5"),]
            col1       col2      col3      col4      col5     col6       col7
row1  0.08472585 -0.9841503 -1.504415 -1.029001 0.9340939 1.562199 -0.7178045
row5 -1.11202838  1.4806257  2.963702 -1.785997 1.3028600 1.864545 -0.7786395
           col8        col9      col10    col11      col12      col13
row1 -0.2251703 -0.18694287 -0.7115046 0.786088  0.2032674 -1.0683550
row5 -1.3970581 -0.09392061 -0.2111475 1.183043 -1.0975554 -0.6964716
          col14      col15     col16     col17       col18     col19     col20
row1  0.5505386 -0.6631468 1.2587387 0.6193277  0.29885268  1.210167  1.112359
row5 -0.8885736 -0.5393655 0.7833511 0.3884182 -0.03028885 -1.635662 -1.721961
> tmp[,c("col6","col20")]
           col6      col20
row1  1.5621989  1.1123594
row2 -1.4595341 -0.5558539
row3  0.5470549  1.0700090
row4 -0.7201932  0.5538764
row5  1.8645453 -1.7219615
> tmp[c("row1","row5"),c("col6","col20")]
         col6     col20
row1 1.562199  1.112359
row5 1.864545 -1.721961
> 
> 
> 
> 
> tmp["row1",] <- rnorm(20,mean=10)
> tmp[,"col10"] <- rnorm(5,mean=30)
> tmp[c("row1","row5"),] <- rnorm(40,mean=50)
> tmp[,c("col6","col20")] <- rnorm(10,mean=75)
> tmp[c("row1","row5"),c("col6","col20")]  <- rnorm(4,mean=105)
> 
> tmp["row1",]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 49.20279 50.69512 51.67207 51.07771 49.72242 104.4115 51.68267 51.76676
         col9    col10    col11    col12   col13    col14    col15    col16
row1 47.33004 51.10961 50.46636 49.47986 51.3911 49.66891 51.70994 49.69919
        col17   col18    col19    col20
row1 49.51151 49.2668 50.17834 104.3741
> tmp[,"col10"]
        col10
row1 51.10961
row2 30.62787
row3 29.24746
row4 30.73298
row5 50.31326
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 49.20279 50.69512 51.67207 51.07771 49.72242 104.4115 51.68267 51.76676
row5 49.68571 48.07824 49.44917 51.24885 52.72061 105.7890 49.03206 49.12056
         col9    col10    col11    col12    col13    col14    col15    col16
row1 47.33004 51.10961 50.46636 49.47986 51.39110 49.66891 51.70994 49.69919
row5 50.71317 50.31326 51.49101 51.46988 49.83242 49.96572 51.36954 49.41591
        col17    col18    col19    col20
row1 49.51151 49.26680 50.17834 104.3741
row5 49.44342 48.87738 49.77700 105.3339
> tmp[,c("col6","col20")]
          col6     col20
row1 104.41154 104.37410
row2  75.73677  73.20988
row3  74.81121  74.18613
row4  74.81210  77.29396
row5 105.78901 105.33393
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 104.4115 104.3741
row5 105.7890 105.3339
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 104.4115 104.3741
row5 105.7890 105.3339
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
          col13
[1,] -0.6743645
[2,] -1.7345367
[3,]  1.5286511
[4,]  0.6456544
[5,] -1.1526778
> tmp[,c("col17","col7")]
          col17       col7
[1,] -1.5626230  1.3458716
[2,]  1.9425510 -0.2502187
[3,] -1.6381752  0.6573197
[4,]  0.5558132  0.4154200
[5,]  1.2114660  0.5912430
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
            col6      col20
[1,]  0.68847068 -1.1936608
[2,]  1.01651479  0.6315449
[3,] -0.18185969  0.9740370
[4,] -0.04809527  0.1747494
[5,] -1.44863200 -0.3220067
> subBufferedMatrix(tmp,1,c("col6"))[,1]
          col1
[1,] 0.6884707
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
          col6
[1,] 0.6884707
[2,] 1.0165148
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> 
> 
> 
> subBufferedMatrix(tmp,c("row3","row1"),)[,1:20]
           [,1]       [,2]       [,3]       [,4]       [,5]      [,6]
row3 -0.1783040 -0.2625812  0.7627951 -1.0695191 -0.6914069 0.9883828
row1  0.6503477 -0.3665178 -1.7711980  0.1213588  0.2597710 0.1794134
           [,7]     [,8]         [,9]      [,10]       [,11]     [,12]
row3  0.9865609 1.350390  0.009710896 -0.7926899 -2.23792811 -1.669768
row1 -0.8709514 1.710807 -0.743503898  1.0493599  0.02838053 -1.326827
          [,13]        [,14]      [,15]     [,16]     [,17]      [,18]
row3 -0.3530042 -2.203963036  1.9241576 0.8378474 0.5480256 -0.4155626
row1 -0.8526980 -0.001581037 -0.4712535 0.6901003 0.3935789 -0.9878960
          [,19]      [,20]
row3 -1.7122292 -0.2711664
row1  0.1127299 -1.7735237
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
           [,1]       [,2]       [,3]      [,4]     [,5]      [,6]       [,7]
row2 -0.5408908 -0.7134443 -0.5698528 -0.669811 1.184405 0.6174538 -0.2231836
           [,8]      [,9]     [,10]
row2 -0.3117513 -1.038727 -1.368205
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
          [,1]       [,2]      [,3]     [,4]      [,5]      [,6]     [,7]
row5 0.1538988 -0.1023422 -2.252637 2.778366 0.4730941 0.1019107 1.919318
          [,8]      [,9]     [,10]   [,11]     [,12]     [,13]      [,14]
row5 -1.175455 0.3888448 0.0867518 0.93885 -2.301292 -1.787957 -0.9838374
         [,15]    [,16]      [,17]     [,18]     [,19]     [,20]
row5 0.4179254 2.124832 -0.4257094 0.4291806 0.1458852 -1.295367
> 
> 
> 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: 0x600000dac5a0>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1030c3560ac56"
 [2] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1030c5dd25d7a"
 [3] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1030c1df724b5"
 [4] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1030c4c8af671"
 [5] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1030c37399bf9"
 [6] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1030c272f14c2"
 [7] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1030c3fbe0a7" 
 [8] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1030cd59f5fc" 
 [9] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1030cd247a3d" 
[10] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1030c55d54188"
[11] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1030c23c173be"
[12] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1030c7195d148"
[13] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1030c22df083a"
[14] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1030c609529b8"
[15] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1030c60e62091"
> 
> 
> ### 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: 0x600000da09c0>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x600000da09c0>
Warning message:
In dir.create(new.directory) :
  '/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x600000da09c0>
> rowMedians(tmp)
  [1] -0.803538069 -0.120688284  0.172551784 -0.196833496  0.437952501
  [6] -0.310339857 -0.116086740  0.182035459  0.075348935 -0.176373330
 [11]  0.128392439 -0.125412401  0.014124413 -0.199402613  0.084938444
 [16]  0.361784695 -0.417770879  0.090653129  0.301413120 -0.539469204
 [21]  0.336007466  0.386408093 -0.361696069 -0.024853185  0.014778628
 [26]  0.104933793 -0.004070706 -0.195013768 -0.102118314  0.359143732
 [31]  0.637307406 -0.101355043 -0.296579454  0.304579450 -0.542734161
 [36]  0.370488424  0.067827946  0.349445010  0.316384907  0.891185968
 [41]  0.509928510 -0.083038906  0.128443641 -0.134285576 -0.378296605
 [46]  0.277584385  0.256608197  0.304236186  0.280562660  0.410304316
 [51] -0.311788204  0.374065552 -0.503067501  0.595783685 -0.338122302
 [56]  0.596896954  0.114639343 -0.395648059 -0.045103195 -0.588302317
 [61]  0.357762054 -0.186691628 -0.503230204 -0.028032666 -0.200188180
 [66] -0.652762152 -0.269189138 -0.019480678 -0.326716863  0.138934813
 [71] -0.334234404  0.155611107 -0.353177681 -0.559001535 -0.345086678
 [76] -0.329692063 -0.567219734  0.200132321 -0.252093383 -0.486279046
 [81] -0.182044819 -0.278747314 -0.042146252  0.434444145 -0.639835272
 [86] -0.261573640 -0.143118589 -0.196296386  0.037588850  0.095206762
 [91] -0.254239994  0.139657890 -0.193968410  0.219471655 -0.201442220
 [96]  0.066976587  0.235903904 -0.249900082 -0.052895122  0.289624659
[101] -0.145879342  0.226369748  0.177618130  0.043423310  0.184289256
[106] -0.182928227  0.023295081 -0.083902858 -0.441950058 -0.922996659
[111]  0.506014895 -0.066061824  0.316523869  0.306723999 -0.011175247
[116]  0.117020291 -0.473358674 -0.518496950 -0.204119812  0.234530839
[121]  0.266807018  0.313306113 -0.221595825  0.010847691  0.098679372
[126]  0.007876814 -0.250801408 -0.370554573 -0.318455631 -0.128217324
[131]  0.200417644 -0.700064618 -0.099025899  0.330587809  0.057242918
[136]  0.162504824 -0.352463456  0.385890445 -0.154219700  0.236125940
[141] -0.083059118  0.155055661 -0.186807035 -0.195663753 -0.176519239
[146]  0.483581313  0.136770270  0.041509171  0.075241446  0.038868675
[151]  0.048952782 -0.248214388 -0.171831559  0.415240237 -0.182201397
[156] -0.208321360 -0.854614613 -0.741005009 -0.112603468 -0.076569178
[161] -0.266520130  0.162308222 -0.129094654  0.315093558  0.086217258
[166] -0.416127489  0.143921103  0.392598404 -0.157801872 -0.071915208
[171] -0.256206429  0.082472016  0.023225329  0.770791690  0.515589959
[176]  0.450073623  0.057911230  0.601506544 -0.371390295  0.332182660
[181] -0.446264162 -0.387548042 -0.011372588  0.330655372 -0.004041705
[186] -0.524192404  0.211157829  0.500376668  0.168967602 -0.251966283
[191] -0.342770819 -0.134698864  0.264389051 -0.415450824  0.216589470
[196]  0.006631445  0.242597532 -0.030331464  0.312547534 -0.627355201
[201] -0.102134641 -0.393074901  0.257438106  0.240830413 -0.040368201
[206] -0.526008374 -0.179251811  0.288816600  0.111850332 -0.045641524
[211] -0.097196609  0.222983720 -0.515736623  0.079991338 -0.310804816
[216] -0.296295936  0.313037276 -0.287244905  0.158215802  0.631847757
[221] -0.347738413  0.425687259  0.072434548  0.440871615 -0.560452900
[226]  0.280844476  0.268908004  0.233004334  0.232499844  0.325655333
> 
> proc.time()
   user  system elapsed 
  0.697   3.661   4.981 

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: 0x6000035801e0>
> .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: 0x6000035801e0>
> .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: 0x6000035801e0>
> .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: 0x6000035801e0>
> 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: 0x600003590060>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600003590060>
> .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: 0x600003590060>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600003590060>
> .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: 0x600003590060>
> 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: 0x600003590240>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600003590240>
> .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: 0x600003590240>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x600003590240>
> .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: 0x600003590240>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x600003590240>
> .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: 0x600003590240>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x600003590240>
> .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: 0x600003590240>
> 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: 0x600003590420>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x600003590420>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600003590420>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600003590420>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile108325dc81432" "BufferedMatrixFile108327aa60eb7"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile108325dc81432" "BufferedMatrixFile108327aa60eb7"
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000035906c0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000035906c0>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x6000035906c0>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x6000035906c0>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x6000035906c0>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x6000035906c0>
> .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: 0x6000035908a0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000035908a0>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x6000035908a0>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x6000035908a0>
> 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: 0x600003590a80>
> .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: 0x600003590a80>
> rm(P)
> 
> proc.time()
   user  system elapsed 
  0.129   0.056   0.183 

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.134   0.039   0.175 

Example timings