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

This page was generated on 2026-01-08 11:35 -0500 (Thu, 08 Jan 2026).

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

Package 253/2332HostnameOS / ArchINSTALLBUILDCHECKBUILD BIN
BufferedMatrix 1.75.0  (landing page)
Ben Bolstad
Snapshot Date: 2026-01-07 13:40 -0500 (Wed, 07 Jan 2026)
git_url: https://git.bioconductor.org/packages/BufferedMatrix
git_branch: devel
git_last_commit: ecdbf23
git_last_commit_date: 2025-10-29 09:58:55 -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: 2026-01-07 18:49:04 -0500 (Wed, 07 Jan 2026)
EndedAt: 2026-01-07 18:49:24 -0500 (Wed, 07 Jan 2026)
EllapsedTime: 20.3 seconds
RetCode: 0
Status:   WARNINGS  
CheckDir: BufferedMatrix.Rcheck
Warnings: 1

Command output

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


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

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] "Wed Jan  7 18:49:15 2026"
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> date()
[1] "Wed Jan  7 18:49:16 2026"
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,which.col] == test.matrix[which.row,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> 
> 
> RowMode(tmp2)
<pointer: 0x600002e90000>
> 
> 
> 
> 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] "Wed Jan  7 18:49:17 2026"
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col <- sample(1:20,5,replace=TRUE)
+   if (!all(tmp2[which.row,which.col] == test.matrix[which.row,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> date()
[1] "Wed Jan  7 18:49:17 2026"
> 
> ColMode(tmp2)
<pointer: 0x600002e90000>
> 
> 
> 
> ### Now testing assignments
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+ 
+   new.data <- rnorm(20)
+   tmp2[which.row,] <- new.data
+   test.matrix[which.row,] <- new.data
+   if (rep > 1){
+     if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+   
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   new.data <- rnorm(10)
+   tmp2[,which.col] <- new.data
+   test.matrix[,which.col]<- new.data
+ 
+   if (rep > 1){
+     if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.col <- which.col
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,5,replace=TRUE)
+   new.data <- matrix(rnorm(50),5,10)
+   tmp2[,which.col] <- new.data
+   test.matrix[,which.col]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.col <- which.col
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   new.data <- matrix(rnorm(50),5,10)
+   tmp2[which.row,] <- new.data
+   test.matrix[which.row,]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col  <- sample(1:20,5,replace=TRUE)
+   new.data <- matrix(rnorm(25),5,5)
+   tmp2[which.row,which.col] <- new.data
+   test.matrix[which.row,which.col]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[prev.row,prev.col] == test.matrix[prev.row,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+   prev.col <- which.col
+ }
> 
> 
> 
> 
> ###
> ###
> ### testing some more functions
> ###
> 
> 
> 
> ## duplication function
> tmp5 <- duplicate(tmp2)
> 
> # making sure really did copy everything.
> tmp5[1,1] <- tmp5[1,1] +100.00
> 
> if (tmp5[1,1] == tmp2[1,1]){
+   stop("Problem with duplication")
+ }
> 
> 
> 
> 
> ### testing elementwise applying of functions
> 
> tmp5[1:4,1:4]
            [,1]       [,2]       [,3]       [,4]
[1,] 100.3593436 -1.3761170  1.6679829  0.8816781
[2,]   0.9341515  0.7844463 -1.9126308 -0.2204385
[3,]  -2.1718210 -1.0302596 -0.2365890  0.5310853
[4,]   1.2984276 -1.0960463  0.7508826  0.8153896
> 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,] 100.3593436 1.3761170 1.6679829 0.8816781
[2,]   0.9341515 0.7844463 1.9126308 0.2204385
[3,]   2.1718210 1.0302596 0.2365890 0.5310853
[4,]   1.2984276 1.0960463 0.7508826 0.8153896
> 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,] 10.0179511 1.1730801 1.2915041 0.9389772
[2,]  0.9665152 0.8856897 1.3829790 0.4695088
[3,]  1.4737100 1.0150171 0.4864041 0.7287560
[4,]  1.1394857 1.0469223 0.8665348 0.9029893
> 
> 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,] 225.53885 38.10692 39.58302 35.27145
[2,]  35.59930 34.64134 40.74242 29.91553
[3,]  41.90892 36.18043 30.10063 32.81865
[4,]  37.69328 36.56527 34.41623 34.84528
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x600002e98000>
> exp(tmp5)
<pointer: 0x600002e98000>
> log(tmp5,2)
<pointer: 0x600002e98000>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 469.4296
> Min(tmp5)
[1] 53.18326
> mean(tmp5)
[1] 72.6406
> Sum(tmp5)
[1] 14528.12
> Var(tmp5)
[1] 868.045
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 92.12860 70.94399 72.43183 73.95953 71.97815 69.08023 68.29405 71.34936
 [9] 67.35081 68.88940
> rowSums(tmp5)
 [1] 1842.572 1418.880 1448.637 1479.191 1439.563 1381.605 1365.881 1426.987
 [9] 1347.016 1377.788
> rowVars(tmp5)
 [1] 7957.49767   51.20142   78.60629   44.40479   76.06598   49.60818
 [7]   45.39809   97.88944  100.26339  106.30245
> rowSd(tmp5)
 [1] 89.204807  7.155517  8.866019  6.663692  8.721581  7.043308  6.737810
 [8]  9.893909 10.013161 10.310308
> rowMax(tmp5)
 [1] 469.42958  84.80001  87.22793  88.58359  91.48316  86.63791  78.32125
 [8]  92.51996  85.18119  95.34513
> rowMin(tmp5)
 [1] 53.41854 58.75639 55.07161 60.92050 56.87099 57.33839 53.30318 53.18326
 [9] 53.89868 55.68043
> 
> colMeans(tmp5)
 [1] 112.76208  72.96456  68.32164  73.58344  71.71319  71.31940  68.97964
 [8]  69.94723  68.10075  70.03725  71.03913  71.61814  69.60306  67.42588
[15]  70.68050  69.88781  74.65841  70.14784  67.35843  72.66353
> colSums(tmp5)
 [1] 1127.6208  729.6456  683.2164  735.8344  717.1319  713.1940  689.7964
 [8]  699.4723  681.0075  700.3725  710.3913  716.1814  696.0306  674.2588
[15]  706.8050  698.8781  746.5841  701.4784  673.5843  726.6353
> colVars(tmp5)
 [1] 15755.45737    56.94739    90.60483   116.78218    61.27944    26.69262
 [7]    38.53233    52.44981    34.83734    74.84358    33.98232   119.35900
[13]    26.51609   113.94986    84.30331   112.76135    88.83568   145.47022
[19]   103.25697    90.28035
> colSd(tmp5)
 [1] 125.520745   7.546349   9.518657  10.806580   7.828119   5.166490
 [7]   6.207442   7.242224   5.902316   8.651218   5.829436  10.925154
[13]   5.149377  10.674730   9.181683  10.618915   9.425268  12.061104
[19]  10.161544   9.501597
> colMax(tmp5)
 [1] 469.42958  79.31456  84.80001  91.48316  83.41866  76.63487  81.90749
 [8]  82.96260  75.22388  80.27809  77.73321  95.34513  76.20257  88.95884
[15]  85.18119  92.51996  88.58359  89.80828  87.05715  83.66315
> colMin(tmp5)
 [1] 63.08520 53.89868 55.00895 55.68043 55.07161 61.34118 60.23085 60.42780
 [9] 58.75639 54.03257 61.90725 57.33839 58.61968 55.09173 59.35333 53.41854
[17] 57.52260 55.86391 53.30318 53.18326
> 
> 
> ### 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.12860 70.94399       NA 73.95953 71.97815 69.08023 68.29405 71.34936
 [9] 67.35081 68.88940
> rowSums(tmp5)
 [1] 1842.572 1418.880       NA 1479.191 1439.563 1381.605 1365.881 1426.987
 [9] 1347.016 1377.788
> rowVars(tmp5)
 [1] 7957.49767   51.20142   77.42230   44.40479   76.06598   49.60818
 [7]   45.39809   97.88944  100.26339  106.30245
> rowSd(tmp5)
 [1] 89.204807  7.155517  8.798994  6.663692  8.721581  7.043308  6.737810
 [8]  9.893909 10.013161 10.310308
> rowMax(tmp5)
 [1] 469.42958  84.80001        NA  88.58359  91.48316  86.63791  78.32125
 [8]  92.51996  85.18119  95.34513
> rowMin(tmp5)
 [1] 53.41854 58.75639       NA 60.92050 56.87099 57.33839 53.30318 53.18326
 [9] 53.89868 55.68043
> 
> colMeans(tmp5)
 [1] 112.76208  72.96456  68.32164  73.58344  71.71319  71.31940  68.97964
 [8]  69.94723  68.10075  70.03725  71.03913  71.61814  69.60306  67.42588
[15]  70.68050  69.88781  74.65841        NA  67.35843  72.66353
> colSums(tmp5)
 [1] 1127.6208  729.6456  683.2164  735.8344  717.1319  713.1940  689.7964
 [8]  699.4723  681.0075  700.3725  710.3913  716.1814  696.0306  674.2588
[15]  706.8050  698.8781  746.5841        NA  673.5843  726.6353
> colVars(tmp5)
 [1] 15755.45737    56.94739    90.60483   116.78218    61.27944    26.69262
 [7]    38.53233    52.44981    34.83734    74.84358    33.98232   119.35900
[13]    26.51609   113.94986    84.30331   112.76135    88.83568          NA
[19]   103.25697    90.28035
> colSd(tmp5)
 [1] 125.520745   7.546349   9.518657  10.806580   7.828119   5.166490
 [7]   6.207442   7.242224   5.902316   8.651218   5.829436  10.925154
[13]   5.149377  10.674730   9.181683  10.618915   9.425268         NA
[19]  10.161544   9.501597
> colMax(tmp5)
 [1] 469.42958  79.31456  84.80001  91.48316  83.41866  76.63487  81.90749
 [8]  82.96260  75.22388  80.27809  77.73321  95.34513  76.20257  88.95884
[15]  85.18119  92.51996  88.58359        NA  87.05715  83.66315
> colMin(tmp5)
 [1] 63.08520 53.89868 55.00895 55.68043 55.07161 61.34118 60.23085 60.42780
 [9] 58.75639 54.03257 61.90725 57.33839 58.61968 55.09173 59.35333 53.41854
[17] 57.52260       NA 53.30318 53.18326
> 
> Max(tmp5,na.rm=TRUE)
[1] 469.4296
> Min(tmp5,na.rm=TRUE)
[1] 53.18326
> mean(tmp5,na.rm=TRUE)
[1] 72.59269
> Sum(tmp5,na.rm=TRUE)
[1] 14445.94
> Var(tmp5,na.rm=TRUE)
[1] 871.9677
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 92.12860 70.94399 71.91906 73.95953 71.97815 69.08023 68.29405 71.34936
 [9] 67.35081 68.88940
> rowSums(tmp5,na.rm=TRUE)
 [1] 1842.572 1418.880 1366.462 1479.191 1439.563 1381.605 1365.881 1426.987
 [9] 1347.016 1377.788
> rowVars(tmp5,na.rm=TRUE)
 [1] 7957.49767   51.20142   77.42230   44.40479   76.06598   49.60818
 [7]   45.39809   97.88944  100.26339  106.30245
> rowSd(tmp5,na.rm=TRUE)
 [1] 89.204807  7.155517  8.798994  6.663692  8.721581  7.043308  6.737810
 [8]  9.893909 10.013161 10.310308
> rowMax(tmp5,na.rm=TRUE)
 [1] 469.42958  84.80001  87.22793  88.58359  91.48316  86.63791  78.32125
 [8]  92.51996  85.18119  95.34513
> rowMin(tmp5,na.rm=TRUE)
 [1] 53.41854 58.75639 55.07161 60.92050 56.87099 57.33839 53.30318 53.18326
 [9] 53.89868 55.68043
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 112.76208  72.96456  68.32164  73.58344  71.71319  71.31940  68.97964
 [8]  69.94723  68.10075  70.03725  71.03913  71.61814  69.60306  67.42588
[15]  70.68050  69.88781  74.65841  68.81152  67.35843  72.66353
> colSums(tmp5,na.rm=TRUE)
 [1] 1127.6208  729.6456  683.2164  735.8344  717.1319  713.1940  689.7964
 [8]  699.4723  681.0075  700.3725  710.3913  716.1814  696.0306  674.2588
[15]  706.8050  698.8781  746.5841  619.3037  673.5843  726.6353
> colVars(tmp5,na.rm=TRUE)
 [1] 15755.45737    56.94739    90.60483   116.78218    61.27944    26.69262
 [7]    38.53233    52.44981    34.83734    74.84358    33.98232   119.35900
[13]    26.51609   113.94986    84.30331   112.76135    88.83568   143.56455
[19]   103.25697    90.28035
> colSd(tmp5,na.rm=TRUE)
 [1] 125.520745   7.546349   9.518657  10.806580   7.828119   5.166490
 [7]   6.207442   7.242224   5.902316   8.651218   5.829436  10.925154
[13]   5.149377  10.674730   9.181683  10.618915   9.425268  11.981843
[19]  10.161544   9.501597
> colMax(tmp5,na.rm=TRUE)
 [1] 469.42958  79.31456  84.80001  91.48316  83.41866  76.63487  81.90749
 [8]  82.96260  75.22388  80.27809  77.73321  95.34513  76.20257  88.95884
[15]  85.18119  92.51996  88.58359  89.80828  87.05715  83.66315
> colMin(tmp5,na.rm=TRUE)
 [1] 63.08520 53.89868 55.00895 55.68043 55.07161 61.34118 60.23085 60.42780
 [9] 58.75639 54.03257 61.90725 57.33839 58.61968 55.09173 59.35333 53.41854
[17] 57.52260 55.86391 53.30318 53.18326
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1] 92.12860 70.94399      NaN 73.95953 71.97815 69.08023 68.29405 71.34936
 [9] 67.35081 68.88940
> rowSums(tmp5,na.rm=TRUE)
 [1] 1842.572 1418.880    0.000 1479.191 1439.563 1381.605 1365.881 1426.987
 [9] 1347.016 1377.788
> rowVars(tmp5,na.rm=TRUE)
 [1] 7957.49767   51.20142         NA   44.40479   76.06598   49.60818
 [7]   45.39809   97.88944  100.26339  106.30245
> rowSd(tmp5,na.rm=TRUE)
 [1] 89.204807  7.155517        NA  6.663692  8.721581  7.043308  6.737810
 [8]  9.893909 10.013161 10.310308
> rowMax(tmp5,na.rm=TRUE)
 [1] 469.42958  84.80001        NA  88.58359  91.48316  86.63791  78.32125
 [8]  92.51996  85.18119  95.34513
> rowMin(tmp5,na.rm=TRUE)
 [1] 53.41854 58.75639       NA 60.92050 56.87099 57.33839 53.30318 53.18326
 [9] 53.89868 55.68043
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1] 115.59921  72.70453  68.95177  74.16963  73.56225  70.91473  68.87827
 [8]  70.23546  67.91836  69.60010  71.05197  71.94012  70.82344  67.42942
[15]  70.24557  69.95589  73.28342       NaN  65.16969  72.03046
> colSums(tmp5,na.rm=TRUE)
 [1] 1040.3929  654.3408  620.5659  667.5266  662.0603  638.2326  619.9045
 [8]  632.1191  611.2653  626.4009  639.4677  647.4611  637.4109  606.8648
[15]  632.2102  629.6030  659.5508    0.0000  586.5272  648.2742
> colVars(tmp5,na.rm=TRUE)
 [1] 17634.33493    63.30514    97.46353   127.51422    30.47520    28.18692
 [7]    43.23328    58.07141    38.81777    82.04913    38.22826   133.11253
[13]    13.07579   128.19346    92.71314   126.80437    78.67087          NA
[19]    62.26973    97.05661
> colSd(tmp5,na.rm=TRUE)
 [1] 132.794333   7.956453   9.872362  11.292219   5.520435   5.309135
 [7]   6.575202   7.620460   6.230391   9.058098   6.182900  11.537440
[13]   3.616046  11.322255   9.628766  11.260745   8.869660         NA
[19]   7.891117   9.851731
> colMax(tmp5,na.rm=TRUE)
 [1] 469.42958  79.31456  84.80001  91.48316  83.41866  76.63487  81.90749
 [8]  82.96260  75.22388  80.27809  77.73321  95.34513  76.20257  88.95884
[15]  85.18119  92.51996  88.58359      -Inf  76.90141  83.66315
> colMin(tmp5,na.rm=TRUE)
 [1] 63.08520 53.89868 55.00895 55.68043 65.39517 61.34118 60.23085 60.42780
 [9] 58.75639 54.03257 61.90725 57.33839 64.83953 55.09173 59.35333 53.41854
[17] 57.52260      Inf 53.30318 53.18326
> 
> 
> 
> 
> 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] 167.5743 196.1835 275.8086 154.8004 263.3794 222.9463 154.8173 161.5884
 [9] 299.3482 272.3892
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 167.5743 196.1835 275.8086 154.8004 263.3794 222.9463 154.8173 161.5884
 [9] 299.3482 272.3892
> 
> 
> 
> copymatrix <- matrix(rnorm(200,150,15),10,20)
> 
> tmp5[1:10,1:20] <- copymatrix
> which.row <- 1
> which.col  <- 3
> cat(which.row," ",which.col,"\n")
1   3 
> tmp5[which.row,which.col] <- NA
> copymatrix[which.row,which.col] <- NA
> 
> colVars(tmp5,na.rm=TRUE)-apply(copymatrix,2,var,na.rm=TRUE)
 [1]  1.136868e-13  0.000000e+00 -1.705303e-13  8.526513e-14 -5.684342e-14
 [6]  1.136868e-13  2.842171e-14  1.136868e-13 -1.136868e-13 -2.842171e-14
[11] -2.842171e-14  1.421085e-13  0.000000e+00  0.000000e+00 -1.705303e-13
[16]  8.526513e-14 -2.842171e-14  5.684342e-14  1.421085e-14 -1.421085e-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)
+ }
2   5 
10   17 
4   1 
9   9 
6   5 
7   9 
9   8 
8   10 
2   7 
2   20 
10   4 
7   8 
2   19 
3   12 
7   10 
5   13 
7   18 
6   2 
6   7 
5   10 
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] 3.112716
> Min(tmp)
[1] -1.91809
> mean(tmp)
[1] 0.04746813
> Sum(tmp)
[1] 4.746813
> Var(tmp)
[1] 0.7712787
> 
> rowMeans(tmp)
[1] 0.04746813
> rowSums(tmp)
[1] 4.746813
> rowVars(tmp)
[1] 0.7712787
> rowSd(tmp)
[1] 0.8782247
> rowMax(tmp)
[1] 3.112716
> rowMin(tmp)
[1] -1.91809
> 
> colMeans(tmp)
  [1] -0.419386608 -0.673077271  0.249066659  0.333312869 -0.236671717
  [6]  0.929758694 -0.005377846  1.041439612 -0.232728632 -0.246976380
 [11]  0.174494215  0.885951323 -0.235148846 -0.380608867 -0.694719101
 [16]  0.892894710 -0.611099431  0.011681443 -0.213201925  0.773836987
 [21]  0.093224735  0.060518390  0.146362765 -1.429575103 -0.308438762
 [26] -0.081203652  0.527735778  0.312907248  0.607544368  3.112716494
 [31] -1.557637198  1.485845163 -0.004712488  0.192264390  0.980770626
 [36]  1.175374432  1.274002669  1.321066197 -0.105766628 -1.399845443
 [41] -1.345682418  0.603232234 -0.191551892 -0.386702806  0.898762984
 [46] -0.321321498  0.383799124 -0.412897997 -1.140774725  0.162930103
 [51] -1.504766145 -0.764916805 -0.984198654  0.363767908  0.402661102
 [56]  0.647497249 -0.915460582 -0.374321563 -0.090243542  0.042625280
 [61]  1.584215063 -0.015079421  2.364924725  0.535322422 -1.360949422
 [66] -1.366364551  1.009535357 -1.126224555 -1.918089528  0.107662833
 [71] -0.563199151 -1.131207063  0.208170777 -0.153536958  0.529918288
 [76] -0.887766152  1.099551816 -1.221053434 -0.629459776 -0.868018313
 [81]  0.675562454  0.413552477 -0.629940112  0.590511140 -0.102192610
 [86]  1.009837517  0.811231979  0.908716425 -0.476538015  0.719338503
 [91] -0.111226737 -0.248554534  0.647218346  0.991752656 -0.718592927
 [96] -0.603524104  0.321409469  1.479864413 -0.677741130  0.728744055
> colSums(tmp)
  [1] -0.419386608 -0.673077271  0.249066659  0.333312869 -0.236671717
  [6]  0.929758694 -0.005377846  1.041439612 -0.232728632 -0.246976380
 [11]  0.174494215  0.885951323 -0.235148846 -0.380608867 -0.694719101
 [16]  0.892894710 -0.611099431  0.011681443 -0.213201925  0.773836987
 [21]  0.093224735  0.060518390  0.146362765 -1.429575103 -0.308438762
 [26] -0.081203652  0.527735778  0.312907248  0.607544368  3.112716494
 [31] -1.557637198  1.485845163 -0.004712488  0.192264390  0.980770626
 [36]  1.175374432  1.274002669  1.321066197 -0.105766628 -1.399845443
 [41] -1.345682418  0.603232234 -0.191551892 -0.386702806  0.898762984
 [46] -0.321321498  0.383799124 -0.412897997 -1.140774725  0.162930103
 [51] -1.504766145 -0.764916805 -0.984198654  0.363767908  0.402661102
 [56]  0.647497249 -0.915460582 -0.374321563 -0.090243542  0.042625280
 [61]  1.584215063 -0.015079421  2.364924725  0.535322422 -1.360949422
 [66] -1.366364551  1.009535357 -1.126224555 -1.918089528  0.107662833
 [71] -0.563199151 -1.131207063  0.208170777 -0.153536958  0.529918288
 [76] -0.887766152  1.099551816 -1.221053434 -0.629459776 -0.868018313
 [81]  0.675562454  0.413552477 -0.629940112  0.590511140 -0.102192610
 [86]  1.009837517  0.811231979  0.908716425 -0.476538015  0.719338503
 [91] -0.111226737 -0.248554534  0.647218346  0.991752656 -0.718592927
 [96] -0.603524104  0.321409469  1.479864413 -0.677741130  0.728744055
> colVars(tmp)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> colSd(tmp)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> colMax(tmp)
  [1] -0.419386608 -0.673077271  0.249066659  0.333312869 -0.236671717
  [6]  0.929758694 -0.005377846  1.041439612 -0.232728632 -0.246976380
 [11]  0.174494215  0.885951323 -0.235148846 -0.380608867 -0.694719101
 [16]  0.892894710 -0.611099431  0.011681443 -0.213201925  0.773836987
 [21]  0.093224735  0.060518390  0.146362765 -1.429575103 -0.308438762
 [26] -0.081203652  0.527735778  0.312907248  0.607544368  3.112716494
 [31] -1.557637198  1.485845163 -0.004712488  0.192264390  0.980770626
 [36]  1.175374432  1.274002669  1.321066197 -0.105766628 -1.399845443
 [41] -1.345682418  0.603232234 -0.191551892 -0.386702806  0.898762984
 [46] -0.321321498  0.383799124 -0.412897997 -1.140774725  0.162930103
 [51] -1.504766145 -0.764916805 -0.984198654  0.363767908  0.402661102
 [56]  0.647497249 -0.915460582 -0.374321563 -0.090243542  0.042625280
 [61]  1.584215063 -0.015079421  2.364924725  0.535322422 -1.360949422
 [66] -1.366364551  1.009535357 -1.126224555 -1.918089528  0.107662833
 [71] -0.563199151 -1.131207063  0.208170777 -0.153536958  0.529918288
 [76] -0.887766152  1.099551816 -1.221053434 -0.629459776 -0.868018313
 [81]  0.675562454  0.413552477 -0.629940112  0.590511140 -0.102192610
 [86]  1.009837517  0.811231979  0.908716425 -0.476538015  0.719338503
 [91] -0.111226737 -0.248554534  0.647218346  0.991752656 -0.718592927
 [96] -0.603524104  0.321409469  1.479864413 -0.677741130  0.728744055
> colMin(tmp)
  [1] -0.419386608 -0.673077271  0.249066659  0.333312869 -0.236671717
  [6]  0.929758694 -0.005377846  1.041439612 -0.232728632 -0.246976380
 [11]  0.174494215  0.885951323 -0.235148846 -0.380608867 -0.694719101
 [16]  0.892894710 -0.611099431  0.011681443 -0.213201925  0.773836987
 [21]  0.093224735  0.060518390  0.146362765 -1.429575103 -0.308438762
 [26] -0.081203652  0.527735778  0.312907248  0.607544368  3.112716494
 [31] -1.557637198  1.485845163 -0.004712488  0.192264390  0.980770626
 [36]  1.175374432  1.274002669  1.321066197 -0.105766628 -1.399845443
 [41] -1.345682418  0.603232234 -0.191551892 -0.386702806  0.898762984
 [46] -0.321321498  0.383799124 -0.412897997 -1.140774725  0.162930103
 [51] -1.504766145 -0.764916805 -0.984198654  0.363767908  0.402661102
 [56]  0.647497249 -0.915460582 -0.374321563 -0.090243542  0.042625280
 [61]  1.584215063 -0.015079421  2.364924725  0.535322422 -1.360949422
 [66] -1.366364551  1.009535357 -1.126224555 -1.918089528  0.107662833
 [71] -0.563199151 -1.131207063  0.208170777 -0.153536958  0.529918288
 [76] -0.887766152  1.099551816 -1.221053434 -0.629459776 -0.868018313
 [81]  0.675562454  0.413552477 -0.629940112  0.590511140 -0.102192610
 [86]  1.009837517  0.811231979  0.908716425 -0.476538015  0.719338503
 [91] -0.111226737 -0.248554534  0.647218346  0.991752656 -0.718592927
 [96] -0.603524104  0.321409469  1.479864413 -0.677741130  0.728744055
> colMedians(tmp)
  [1] -0.419386608 -0.673077271  0.249066659  0.333312869 -0.236671717
  [6]  0.929758694 -0.005377846  1.041439612 -0.232728632 -0.246976380
 [11]  0.174494215  0.885951323 -0.235148846 -0.380608867 -0.694719101
 [16]  0.892894710 -0.611099431  0.011681443 -0.213201925  0.773836987
 [21]  0.093224735  0.060518390  0.146362765 -1.429575103 -0.308438762
 [26] -0.081203652  0.527735778  0.312907248  0.607544368  3.112716494
 [31] -1.557637198  1.485845163 -0.004712488  0.192264390  0.980770626
 [36]  1.175374432  1.274002669  1.321066197 -0.105766628 -1.399845443
 [41] -1.345682418  0.603232234 -0.191551892 -0.386702806  0.898762984
 [46] -0.321321498  0.383799124 -0.412897997 -1.140774725  0.162930103
 [51] -1.504766145 -0.764916805 -0.984198654  0.363767908  0.402661102
 [56]  0.647497249 -0.915460582 -0.374321563 -0.090243542  0.042625280
 [61]  1.584215063 -0.015079421  2.364924725  0.535322422 -1.360949422
 [66] -1.366364551  1.009535357 -1.126224555 -1.918089528  0.107662833
 [71] -0.563199151 -1.131207063  0.208170777 -0.153536958  0.529918288
 [76] -0.887766152  1.099551816 -1.221053434 -0.629459776 -0.868018313
 [81]  0.675562454  0.413552477 -0.629940112  0.590511140 -0.102192610
 [86]  1.009837517  0.811231979  0.908716425 -0.476538015  0.719338503
 [91] -0.111226737 -0.248554534  0.647218346  0.991752656 -0.718592927
 [96] -0.603524104  0.321409469  1.479864413 -0.677741130  0.728744055
> colRanges(tmp)
           [,1]       [,2]      [,3]      [,4]       [,5]      [,6]
[1,] -0.4193866 -0.6730773 0.2490667 0.3333129 -0.2366717 0.9297587
[2,] -0.4193866 -0.6730773 0.2490667 0.3333129 -0.2366717 0.9297587
             [,7]    [,8]       [,9]      [,10]     [,11]     [,12]      [,13]
[1,] -0.005377846 1.04144 -0.2327286 -0.2469764 0.1744942 0.8859513 -0.2351488
[2,] -0.005377846 1.04144 -0.2327286 -0.2469764 0.1744942 0.8859513 -0.2351488
          [,14]      [,15]     [,16]      [,17]      [,18]      [,19]    [,20]
[1,] -0.3806089 -0.6947191 0.8928947 -0.6110994 0.01168144 -0.2132019 0.773837
[2,] -0.3806089 -0.6947191 0.8928947 -0.6110994 0.01168144 -0.2132019 0.773837
          [,21]      [,22]     [,23]     [,24]      [,25]       [,26]     [,27]
[1,] 0.09322473 0.06051839 0.1463628 -1.429575 -0.3084388 -0.08120365 0.5277358
[2,] 0.09322473 0.06051839 0.1463628 -1.429575 -0.3084388 -0.08120365 0.5277358
         [,28]     [,29]    [,30]     [,31]    [,32]        [,33]     [,34]
[1,] 0.3129072 0.6075444 3.112716 -1.557637 1.485845 -0.004712488 0.1922644
[2,] 0.3129072 0.6075444 3.112716 -1.557637 1.485845 -0.004712488 0.1922644
         [,35]    [,36]    [,37]    [,38]      [,39]     [,40]     [,41]
[1,] 0.9807706 1.175374 1.274003 1.321066 -0.1057666 -1.399845 -1.345682
[2,] 0.9807706 1.175374 1.274003 1.321066 -0.1057666 -1.399845 -1.345682
         [,42]      [,43]      [,44]    [,45]      [,46]     [,47]     [,48]
[1,] 0.6032322 -0.1915519 -0.3867028 0.898763 -0.3213215 0.3837991 -0.412898
[2,] 0.6032322 -0.1915519 -0.3867028 0.898763 -0.3213215 0.3837991 -0.412898
         [,49]     [,50]     [,51]      [,52]      [,53]     [,54]     [,55]
[1,] -1.140775 0.1629301 -1.504766 -0.7649168 -0.9841987 0.3637679 0.4026611
[2,] -1.140775 0.1629301 -1.504766 -0.7649168 -0.9841987 0.3637679 0.4026611
         [,56]      [,57]      [,58]       [,59]      [,60]    [,61]
[1,] 0.6474972 -0.9154606 -0.3743216 -0.09024354 0.04262528 1.584215
[2,] 0.6474972 -0.9154606 -0.3743216 -0.09024354 0.04262528 1.584215
           [,62]    [,63]     [,64]     [,65]     [,66]    [,67]     [,68]
[1,] -0.01507942 2.364925 0.5353224 -1.360949 -1.366365 1.009535 -1.126225
[2,] -0.01507942 2.364925 0.5353224 -1.360949 -1.366365 1.009535 -1.126225
        [,69]     [,70]      [,71]     [,72]     [,73]     [,74]     [,75]
[1,] -1.91809 0.1076628 -0.5631992 -1.131207 0.2081708 -0.153537 0.5299183
[2,] -1.91809 0.1076628 -0.5631992 -1.131207 0.2081708 -0.153537 0.5299183
          [,76]    [,77]     [,78]      [,79]      [,80]     [,81]     [,82]
[1,] -0.8877662 1.099552 -1.221053 -0.6294598 -0.8680183 0.6755625 0.4135525
[2,] -0.8877662 1.099552 -1.221053 -0.6294598 -0.8680183 0.6755625 0.4135525
          [,83]     [,84]      [,85]    [,86]    [,87]     [,88]     [,89]
[1,] -0.6299401 0.5905111 -0.1021926 1.009838 0.811232 0.9087164 -0.476538
[2,] -0.6299401 0.5905111 -0.1021926 1.009838 0.811232 0.9087164 -0.476538
         [,90]      [,91]      [,92]     [,93]     [,94]      [,95]      [,96]
[1,] 0.7193385 -0.1112267 -0.2485545 0.6472183 0.9917527 -0.7185929 -0.6035241
[2,] 0.7193385 -0.1112267 -0.2485545 0.6472183 0.9917527 -0.7185929 -0.6035241
         [,97]    [,98]      [,99]    [,100]
[1,] 0.3214095 1.479864 -0.6777411 0.7287441
[2,] 0.3214095 1.479864 -0.6777411 0.7287441
> 
> 
> Max(tmp2)
[1] 2.994206
> Min(tmp2)
[1] -2.44862
> mean(tmp2)
[1] -0.0157614
> Sum(tmp2)
[1] -1.57614
> Var(tmp2)
[1] 0.9611236
> 
> rowMeans(tmp2)
  [1]  0.46425824 -1.66960596 -0.90016659  0.51404099 -0.96040438 -0.06758088
  [7] -0.73645913 -1.56345462 -1.12041552  0.84530892 -1.79415984  1.06991928
 [13] -0.17264274  0.14837511  0.32689342 -2.05759932  0.20250197  0.25440707
 [19]  0.57750467 -0.61013119  0.85954573 -0.81017656 -0.39221786  0.49794666
 [25]  0.59639726  0.34517255  1.18624880 -0.39445771  0.09403164 -0.21423136
 [31] -2.02512318 -0.50151569 -0.45212731 -0.94786713  1.77180261 -0.36211225
 [37] -1.64481212  0.76370813 -2.44862023 -0.93361157  2.99420572 -0.11156121
 [43] -0.51064344 -0.15287234  1.68261721  0.81971961 -0.19414420 -0.20708146
 [49]  0.51633361  0.14561310 -0.28546809 -0.57416393  0.23037831 -0.27335338
 [55] -0.61156600  0.98353194 -0.31260849 -0.19232393  0.51719125  0.90774236
 [61]  0.53417188  0.64218951 -1.26972505  0.11623948  0.05605137  1.71997406
 [67] -0.06850029  0.18430795 -0.40812000  1.45318022  0.34309321  1.42103829
 [73]  0.09480086  0.89503588  1.06392224 -1.08242638  0.63047301 -1.63588268
 [79]  1.58023520 -0.41535995  0.59705881  0.10356277 -0.75116651  0.14043657
 [85] -0.93070923 -1.10121213 -1.32885870 -1.15561886  1.48370152 -0.78131734
 [91]  0.08820226  1.24447473  0.07110830 -0.95082041 -0.93280023  0.97680641
 [97]  0.10986784 -0.01936544  0.45350120  2.14219331
> rowSums(tmp2)
  [1]  0.46425824 -1.66960596 -0.90016659  0.51404099 -0.96040438 -0.06758088
  [7] -0.73645913 -1.56345462 -1.12041552  0.84530892 -1.79415984  1.06991928
 [13] -0.17264274  0.14837511  0.32689342 -2.05759932  0.20250197  0.25440707
 [19]  0.57750467 -0.61013119  0.85954573 -0.81017656 -0.39221786  0.49794666
 [25]  0.59639726  0.34517255  1.18624880 -0.39445771  0.09403164 -0.21423136
 [31] -2.02512318 -0.50151569 -0.45212731 -0.94786713  1.77180261 -0.36211225
 [37] -1.64481212  0.76370813 -2.44862023 -0.93361157  2.99420572 -0.11156121
 [43] -0.51064344 -0.15287234  1.68261721  0.81971961 -0.19414420 -0.20708146
 [49]  0.51633361  0.14561310 -0.28546809 -0.57416393  0.23037831 -0.27335338
 [55] -0.61156600  0.98353194 -0.31260849 -0.19232393  0.51719125  0.90774236
 [61]  0.53417188  0.64218951 -1.26972505  0.11623948  0.05605137  1.71997406
 [67] -0.06850029  0.18430795 -0.40812000  1.45318022  0.34309321  1.42103829
 [73]  0.09480086  0.89503588  1.06392224 -1.08242638  0.63047301 -1.63588268
 [79]  1.58023520 -0.41535995  0.59705881  0.10356277 -0.75116651  0.14043657
 [85] -0.93070923 -1.10121213 -1.32885870 -1.15561886  1.48370152 -0.78131734
 [91]  0.08820226  1.24447473  0.07110830 -0.95082041 -0.93280023  0.97680641
 [97]  0.10986784 -0.01936544  0.45350120  2.14219331
> 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.46425824 -1.66960596 -0.90016659  0.51404099 -0.96040438 -0.06758088
  [7] -0.73645913 -1.56345462 -1.12041552  0.84530892 -1.79415984  1.06991928
 [13] -0.17264274  0.14837511  0.32689342 -2.05759932  0.20250197  0.25440707
 [19]  0.57750467 -0.61013119  0.85954573 -0.81017656 -0.39221786  0.49794666
 [25]  0.59639726  0.34517255  1.18624880 -0.39445771  0.09403164 -0.21423136
 [31] -2.02512318 -0.50151569 -0.45212731 -0.94786713  1.77180261 -0.36211225
 [37] -1.64481212  0.76370813 -2.44862023 -0.93361157  2.99420572 -0.11156121
 [43] -0.51064344 -0.15287234  1.68261721  0.81971961 -0.19414420 -0.20708146
 [49]  0.51633361  0.14561310 -0.28546809 -0.57416393  0.23037831 -0.27335338
 [55] -0.61156600  0.98353194 -0.31260849 -0.19232393  0.51719125  0.90774236
 [61]  0.53417188  0.64218951 -1.26972505  0.11623948  0.05605137  1.71997406
 [67] -0.06850029  0.18430795 -0.40812000  1.45318022  0.34309321  1.42103829
 [73]  0.09480086  0.89503588  1.06392224 -1.08242638  0.63047301 -1.63588268
 [79]  1.58023520 -0.41535995  0.59705881  0.10356277 -0.75116651  0.14043657
 [85] -0.93070923 -1.10121213 -1.32885870 -1.15561886  1.48370152 -0.78131734
 [91]  0.08820226  1.24447473  0.07110830 -0.95082041 -0.93280023  0.97680641
 [97]  0.10986784 -0.01936544  0.45350120  2.14219331
> rowMin(tmp2)
  [1]  0.46425824 -1.66960596 -0.90016659  0.51404099 -0.96040438 -0.06758088
  [7] -0.73645913 -1.56345462 -1.12041552  0.84530892 -1.79415984  1.06991928
 [13] -0.17264274  0.14837511  0.32689342 -2.05759932  0.20250197  0.25440707
 [19]  0.57750467 -0.61013119  0.85954573 -0.81017656 -0.39221786  0.49794666
 [25]  0.59639726  0.34517255  1.18624880 -0.39445771  0.09403164 -0.21423136
 [31] -2.02512318 -0.50151569 -0.45212731 -0.94786713  1.77180261 -0.36211225
 [37] -1.64481212  0.76370813 -2.44862023 -0.93361157  2.99420572 -0.11156121
 [43] -0.51064344 -0.15287234  1.68261721  0.81971961 -0.19414420 -0.20708146
 [49]  0.51633361  0.14561310 -0.28546809 -0.57416393  0.23037831 -0.27335338
 [55] -0.61156600  0.98353194 -0.31260849 -0.19232393  0.51719125  0.90774236
 [61]  0.53417188  0.64218951 -1.26972505  0.11623948  0.05605137  1.71997406
 [67] -0.06850029  0.18430795 -0.40812000  1.45318022  0.34309321  1.42103829
 [73]  0.09480086  0.89503588  1.06392224 -1.08242638  0.63047301 -1.63588268
 [79]  1.58023520 -0.41535995  0.59705881  0.10356277 -0.75116651  0.14043657
 [85] -0.93070923 -1.10121213 -1.32885870 -1.15561886  1.48370152 -0.78131734
 [91]  0.08820226  1.24447473  0.07110830 -0.95082041 -0.93280023  0.97680641
 [97]  0.10986784 -0.01936544  0.45350120  2.14219331
> 
> colMeans(tmp2)
[1] -0.0157614
> colSums(tmp2)
[1] -1.57614
> colVars(tmp2)
[1] 0.9611236
> colSd(tmp2)
[1] 0.9803691
> colMax(tmp2)
[1] 2.994206
> colMin(tmp2)
[1] -2.44862
> colMedians(tmp2)
[1] 0.06357984
> colRanges(tmp2)
          [,1]
[1,] -2.448620
[2,]  2.994206
> 
> 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]  4.0525536  4.2581505 -2.8467122 -2.4315310 -0.9516816 -4.9201508
 [7]  3.9797209  0.1615821 -1.0658998  4.1166717
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -0.9351995
[2,] -0.5115128
[3,] -0.0885505
[4,]  1.5988033
[5,]  2.3006302
> 
> rowApply(tmp,sum)
 [1]  2.3751439 -1.5035584 -2.9928514  2.8868807 -1.2586238  3.7847802
 [7] -0.4025844  1.6657651 -4.0664974  3.8642490
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]   10    3    5    9    2   10    8    5    6     1
 [2,]    8    1    8   10    6    7    6    8    8     6
 [3,]    4    2    9    3    4    1    2    7    9     8
 [4,]    3    5    4    5    8    3   10    1    5     3
 [5,]    5    8    1    6    9    8    5    6    2     4
 [6,]    2    9    6    7    1    4    1    2    3    10
 [7,]    9   10    2    2    7    6    4    4   10     7
 [8,]    1    4    3    8    5    5    9    9    7     2
 [9,]    6    6   10    1    3    9    3    3    4     5
[10,]    7    7    7    4   10    2    7   10    1     9
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1] -1.5863079 -0.8862900 -0.4245005  4.1339320 -0.2296726 -0.3814093
 [7]  0.9898341 -3.4504543 -5.1693488 -2.4846095  0.2143880  3.3234594
[13] -0.6395301 -4.3621632  4.3125419 -2.4709315 -6.5040437  0.9232659
[19] -5.3967289 -0.9175147
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -2.3141004
[2,] -0.7681949
[3,] -0.3182695
[4,]  0.8815573
[5,]  0.9326997
> 
> rowApply(tmp,sum)
[1] -4.067143 -4.345059 -4.926806 -1.836974 -5.830102
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]   18   10    1   20   10
[2,]   12   17    8   13    1
[3,]    8   15   15    1   18
[4,]   14    8   20    7   20
[5,]    9   16    7    9   15
> 
> 
> as.matrix(tmp)
           [,1]       [,2]       [,3]       [,4]         [,5]        [,6]
[1,]  0.8815573  0.4909023 -0.2024160  0.6032864  0.003609861  0.50108078
[2,] -0.3182695  0.4047023  0.1082110 -0.3777574  0.282918379 -0.87380702
[3,] -2.3141004 -0.5796874  0.2352002  2.5113004 -0.889564127  0.97064421
[4,]  0.9326997  0.1668005 -1.6737740 -0.2591709 -0.115344385  0.09653279
[5,] -0.7681949 -1.3690076  1.1082782  1.6562735  0.488707720 -1.07586008
           [,7]       [,8]       [,9]       [,10]      [,11]       [,12]
[1,]  0.7624942 -1.4260667 -1.3210800 -2.13615132  0.2514364  0.19983541
[2,] -0.8317021  0.1028765 -1.6343794 -0.02280782 -0.4108005  0.87821950
[3,]  0.9097216 -0.1855413 -1.6160105 -1.84193069  0.8180441  1.93027803
[4,]  0.8396572 -0.9384438 -1.1742616  0.47187410  0.1311498  0.33226616
[5,] -0.6903368 -1.0032790  0.5763826  1.04440619 -0.5754418 -0.01713969
          [,13]       [,14]     [,15]      [,16]      [,17]        [,18]
[1,]  0.7507552 -2.40530005 1.0010216 -1.1290397 -1.8259786  0.616317822
[2,] -0.3366012 -0.02385648 1.4132825  0.5174713 -1.6479367 -0.091895200
[3,] -0.3646775 -0.18396446 0.1090364 -0.1380275 -1.5688358 -0.006333373
[4,]  0.1024776 -0.86098693 0.5647283 -0.5012891 -0.1758532  0.444589563
[5,] -0.7914842 -0.88805532 1.2244731 -1.2200465 -1.2854394 -0.039412910
          [,19]      [,20]
[1,] -1.4473510  1.7639433
[2,] -0.8852049 -0.5977227
[3,] -1.3043040 -1.4180538
[4,] -0.5059370  0.2853111
[5,] -1.2539320 -0.9509926
> 
> 
> 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 :  654  bytes.
Disk usage :  200  bytes.
> subBufferedMatrix(tmp,,5:8)
BufferedMatrix object
Matrix size:  5 4 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  567  bytes.
Disk usage :  160  bytes.
> subBufferedMatrix(tmp,1:3,)
BufferedMatrix object
Matrix size:  3 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  480  bytes.
> 
> 
> rm(tmp)
> 
> 
> ###
> ### Testing colnames and rownames
> ###
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> 
> 
> colnames(tmp)
NULL
> rownames(tmp)
NULL
> 
> 
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> colnames(tmp)
 [1] "col1"  "col2"  "col3"  "col4"  "col5"  "col6"  "col7"  "col8"  "col9" 
[10] "col10" "col11" "col12" "col13" "col14" "col15" "col16" "col17" "col18"
[19] "col19" "col20"
> rownames(tmp)
[1] "row1" "row2" "row3" "row4" "row5"
> 
> 
> tmp["row1",]
          col1       col2       col3      col4      col5      col6      col7
row1 -1.167041 -0.6902885 -0.5301962 -1.921051 0.3492929 -2.268728 0.3121827
          col8     col9      col10      col11     col12     col13     col14
row1 -1.070202 0.274961 -0.8322822 -0.8939847 0.1277054 0.8247562 -1.112059
         col15    col16      col17    col18     col19      col20
row1 0.7208868 0.559267 -0.4231276 1.298376 0.5780171 -0.8252026
> tmp[,"col10"]
          col10
row1 -0.8322822
row2 -0.5893980
row3 -0.2411947
row4  1.8466811
row5 -1.2184154
> tmp[c("row1","row5"),]
           col1       col2       col3      col4      col5      col6      col7
row1 -1.1670413 -0.6902885 -0.5301962 -1.921051 0.3492929 -2.268728 0.3121827
row5 -0.5336596  0.3940868 -0.2801690 -1.018746 1.1587412  1.795933 0.2628709
          col8     col9      col10      col11      col12      col13      col14
row1 -1.070202 0.274961 -0.8322822 -0.8939847  0.1277054  0.8247562 -1.1120591
row5 -1.187629 1.900578 -1.2184154  0.3445745 -1.4972366 -1.2274944  0.8335311
          col15     col16      col17     col18     col19       col20
row1  0.7208868 0.5592670 -0.4231276 1.2983759 0.5780171 -0.82520260
row5 -1.0350192 0.9387159  0.2991769 0.1458926 1.7445135  0.02744608
> tmp[,c("col6","col20")]
           col6       col20
row1 -2.2687276 -0.82520260
row2  0.6534005  0.04628892
row3 -0.5014031  1.37330823
row4  0.3369121 -0.51793213
row5  1.7959326  0.02744608
> tmp[c("row1","row5"),c("col6","col20")]
          col6       col20
row1 -2.268728 -0.82520260
row5  1.795933  0.02744608
> 
> 
> 
> 
> 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 50.4366 51.71228 49.37892 49.18033 50.23693 105.7913 49.4104 49.17685
        col9    col10 col11    col12    col13    col14    col15    col16
row1 49.6196 51.04778 49.74 50.78993 48.37822 50.08359 50.39369 50.36799
       col17   col18    col19    col20
row1 49.8007 49.0753 52.03367 105.2471
> tmp[,"col10"]
        col10
row1 51.04778
row2 29.62348
row3 30.03107
row4 29.10928
row5 49.28656
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 50.43660 51.71228 49.37892 49.18033 50.23693 105.7913 49.41040 49.17685
row5 49.12829 49.67230 49.38323 50.95609 50.57866 105.0451 51.22984 49.98228
         col9    col10    col11    col12    col13    col14    col15    col16
row1 49.61960 51.04778 49.74000 50.78993 48.37822 50.08359 50.39369 50.36799
row5 49.23161 49.28656 50.79214 51.18707 50.30468 50.22755 50.33887 50.55131
        col17   col18    col19    col20
row1 49.80070 49.0753 52.03367 105.2471
row5 52.07221 51.1470 51.24019 104.4702
> tmp[,c("col6","col20")]
          col6     col20
row1 105.79127 105.24710
row2  74.45500  75.57991
row3  76.82587  76.00777
row4  76.33889  75.78345
row5 105.04511 104.47023
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 105.7913 105.2471
row5 105.0451 104.4702
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 105.7913 105.2471
row5 105.0451 104.4702
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
          col13
[1,]  0.6571361
[2,] -0.2652843
[3,]  0.3112512
[4,] -1.4101300
[5,] -0.8659312
> tmp[,c("col17","col7")]
          col17       col7
[1,] -0.3714568  0.2243535
[2,] -0.3979001  0.6888414
[3,]  1.4235185 -2.4606734
[4,]  0.5535477  2.2824876
[5,] -1.5339804  0.2378449
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
           col6      col20
[1,]  1.4154025 -0.9206147
[2,]  0.7351691 -1.0730721
[3,]  1.9976208 -1.8060380
[4,] -0.3780141  1.1825117
[5,] -0.5700163  1.0554241
> subBufferedMatrix(tmp,1,c("col6"))[,1]
         col1
[1,] 1.415403
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
          col6
[1,] 1.4154025
[2,] 0.7351691
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> 
> 
> 
> subBufferedMatrix(tmp,c("row3","row1"),)[,1:20]
           [,1]       [,2]      [,3]      [,4]      [,5]       [,6]       [,7]
row3 -0.9499588 -0.3605967 0.6779035 0.5390297  1.001572 -1.1941613 -1.9493179
row1  0.6875322  0.3720899 0.4371947 0.8363792 -1.366613  0.8233288 -0.8215828
           [,8]       [,9]     [,10]      [,11]      [,12]       [,13]
row3 -2.6130065  0.7235864 -0.168389 -1.3096811  1.1909609 -0.01668242
row1 -0.1936438 -0.6203154 -1.404558  0.1977175 -0.8150897 -1.53784479
          [,14]      [,15]     [,16]      [,17]      [,18]       [,19]
row3 -0.2622215 -1.4225804  1.639833  0.7053548  1.2016325 -1.36006771
row1 -2.1519439 -0.7853145 -2.165494 -0.8364827 -0.8302545 -0.07098871
         [,20]
row3 0.3984234
row1 2.4258705
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
          [,1]      [,2]      [,3]       [,4]     [,5]      [,6]       [,7]
row2 -1.111408 -1.906762 0.3677831 -0.3588373 -1.04512 0.1382464 -0.1775001
          [,8]     [,9]     [,10]
row2 -1.414601 1.881511 -2.700613
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
         [,1]       [,2]       [,3]    [,4]       [,5]      [,6]     [,7]
row5 1.053546 -0.6462496 -0.5835719 1.08803 -0.2268484 0.2940271 1.665907
          [,8]      [,9]     [,10]     [,11]      [,12]    [,13]      [,14]
row5 -1.200005 -1.682119 -1.559946 0.6985309 -0.5521284 -1.01735 -0.4722719
         [,15]      [,16]    [,17]     [,18]      [,19]     [,20]
row5 -2.132203 -0.5916064 0.325255 -1.142109 -0.2891038 0.9575643
> 
> 
> 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: 0x600002e981e0>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM16f406e850770"
 [2] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM16f405fab82bf"
 [3] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM16f407514faaa"
 [4] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM16f403454eaf3"
 [5] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM16f40330d125c"
 [6] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM16f401f307033"
 [7] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM16f4025163444"
 [8] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM16f4054c16f61"
 [9] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM16f40677774bf"
[10] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM16f405391dcaa"
[11] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM16f40d2e47c3" 
[12] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM16f40596959f7"
[13] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM16f40139194fd"
[14] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM16f403acc7814"
[15] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM16f4045df8734"
> 
> 
> ### 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: 0x600002ef84e0>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x600002ef84e0>
Warning message:
In dir.create(new.directory) :
  '/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x600002ef84e0>
> rowMedians(tmp)
  [1]  0.105875432 -0.318199641 -0.481378684  0.348205749  0.232304011
  [6] -0.478772128  0.070589506  0.037842770 -0.455442172  0.368666604
 [11] -0.161061525 -0.374048053  0.239238796 -0.189565380  0.333964909
 [16] -0.113344040  0.352036750  0.055112943  0.430758133 -0.114410858
 [21] -0.353977265 -0.351022798 -0.163767597 -0.133902362  0.060310649
 [26]  0.054523853  0.150823456 -0.476384875  0.056366924  0.240182782
 [31] -0.053084809 -0.045402422 -0.265992316 -0.120096889 -0.225016100
 [36] -0.220567814 -0.258382419  0.412634385  0.289960366  0.170846762
 [41]  0.013996302 -0.143118230 -0.228650037 -0.112090715  0.119015641
 [46] -0.113803174 -0.197717988 -0.115647201 -0.274337113  0.177314468
 [51]  0.315694981  0.289422108 -0.386329705 -0.511750696  0.020281372
 [56] -0.099390402 -0.518290672 -0.010861461 -0.349078790  0.133293034
 [61] -0.189080461 -0.259896373 -0.175888130  0.048512001 -0.103667762
 [66]  0.026443181 -0.220758986  0.069709875 -0.599503892 -0.188855609
 [71]  0.275034323  0.115786984 -0.013449196  0.388870760 -0.097559026
 [76] -0.021418708  0.133244276  0.023454843  0.666794759 -0.238232442
 [81] -0.585188939  0.145801327  0.192442375 -0.211357572 -0.088253213
 [86] -0.146591225 -0.005551663 -0.408651586  0.147479483  0.111477734
 [91] -0.245929785 -0.284092540 -0.150961684 -0.275055244 -0.674998631
 [96] -0.087612406 -0.244096182  0.006377889  0.405533857 -0.324258880
[101] -0.547847421 -0.134581396 -0.041198041  0.019613289  0.356748477
[106]  0.200235221  0.583214741 -0.145033322 -0.167933175 -0.118888774
[111] -0.531962163  0.334685211  0.034725394  0.145195965  0.051243917
[116]  0.570004032 -0.148589389  0.414361419 -0.018819636 -0.372946692
[121]  0.132604546  0.007841102  0.010934833  0.226186128 -0.012635486
[126]  0.410872738  0.058002140  0.266337336  0.798676483 -0.186003324
[131] -0.707742996  0.457381928  0.433724654  0.133155647 -0.503693981
[136]  0.325139089 -0.386674437  0.068068123 -0.097805421  0.177957436
[141]  0.454419490  0.032763546  0.334960511  0.095754050  0.299717149
[146] -0.430892470 -0.763444327 -0.267786368  0.467318224  0.393560817
[151] -0.163009211 -0.655363907 -0.131353970 -0.377744755  0.339830963
[156] -0.040151514  0.203921413 -0.294254724  0.012240575  0.124621474
[161] -0.613311571  0.574001510  0.064248764  0.025382190  0.078959270
[166]  0.324802573  0.123727023 -0.263773669 -0.224102523 -0.808686348
[171] -0.284501793 -0.183628163 -0.042199740  0.280818858  0.022842174
[176]  0.034279238 -0.104658520 -0.571230169  0.174629009  0.223477509
[181] -0.043192932  0.139227800  0.020449920  0.085545157 -0.246220755
[186]  0.246123094 -0.423895547 -0.621378313  0.098994563  0.280124439
[191]  0.410813241 -0.248209296  0.486538701 -0.029408887 -0.349555334
[196]  0.476193320 -0.100890718  0.039972030 -0.006742509 -0.327397520
[201]  0.111905467 -0.022093845 -0.338233636 -0.323119116  0.019114092
[206]  0.351729708  0.178458998 -0.054840704 -0.294742691  0.268850733
[211] -0.040638853  0.255725780 -0.488337353  0.065945811 -0.323515009
[216]  0.083698092  0.148865956  0.263998431 -0.629475068 -0.471478315
[221] -0.231385659  0.228049987  0.210685580  0.089347294 -0.068108936
[226] -0.166971145 -0.526173408 -0.321752477 -0.361061298 -0.275548301
> 
> proc.time()
   user  system elapsed 
  0.742   3.634   4.907 

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: 0x600000fa82a0>
> .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: 0x600000fa82a0>
> .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: 0x600000fa82a0>
> .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: 0x600000fa82a0>
> 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: 0x600000fac540>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600000fac540>
> .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: 0x600000fac540>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600000fac540>
> .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: 0x600000fac540>
> 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: 0x600000fac720>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600000fac720>
> .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: 0x600000fac720>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x600000fac720>
> .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: 0x600000fac720>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x600000fac720>
> .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: 0x600000fac720>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x600000fac720>
> .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: 0x600000fac720>
> 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: 0x600000fac900>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x600000fac900>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600000fac900>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600000fac900>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile174f21cf2d52d" "BufferedMatrixFile174f2a898c34" 
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile174f21cf2d52d" "BufferedMatrixFile174f2a898c34" 
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x600000facba0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600000facba0>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x600000facba0>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x600000facba0>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x600000facba0>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x600000facba0>
> .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: 0x600000facd80>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600000facd80>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x600000facd80>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x600000facd80>
> 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: 0x600000facf60>
> .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: 0x600000facf60>
> rm(P)
> 
> proc.time()
   user  system elapsed 
  0.125   0.048   0.186 

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.153   0.044   0.189 

Example timings