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

This page was generated on 2026-04-29 10:15 -0400 (Wed, 29 Apr 2026).

HostnameOSArch (*)R versionInstalled pkgs
nebbiolo1Linux (Ubuntu 24.04.4 LTS)x86_644.6.0 RC (2026-04-17 r89917) -- "Because it was There" 4988
kjohnson3macOS 13.7.7 Venturaarm644.6.0 Patched (2026-04-24 r89963) -- "Because it was There" 4694
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 260/2415HostnameOS / ArchINSTALLBUILDCHECKBUILD BIN
BufferedMatrix 1.76.0  (landing page)
Ben Bolstad
Snapshot Date: 2026-04-28 14:14 -0400 (Tue, 28 Apr 2026)
git_url: https://git.bioconductor.org/packages/BufferedMatrix
git_branch: RELEASE_3_23
git_last_commit: 9d72964
git_last_commit_date: 2026-04-28 08:32:08 -0400 (Tue, 28 Apr 2026)
nebbiolo1Linux (Ubuntu 24.04.4 LTS) / x86_64  OK    OK    OK  YES
kjohnson3macOS 13.7.7 Ventura / arm64  OK    OK    WARNINGS    OK  YES
See other builds for BufferedMatrix in R Universe.


CHECK results for BufferedMatrix on kjohnson3

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

raw results


Summary

Package: BufferedMatrix
Version: 1.76.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.76.0.tar.gz
StartedAt: 2026-04-28 20:22:28 -0400 (Tue, 28 Apr 2026)
EndedAt: 2026-04-28 20:22:47 -0400 (Tue, 28 Apr 2026)
EllapsedTime: 19.2 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.76.0.tar.gz
###
##############################################################################
##############################################################################


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

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


Installation output

BufferedMatrix.Rcheck/00install.out

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


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

Tests output

BufferedMatrix.Rcheck/tests/c_code_level_tests.Rout


R version 4.6.0 Patched (2026-04-24 r89963) -- "Because it was There"
Copyright (C) 2026 The R Foundation for Statistical Computing
Platform: aarch64-apple-darwin23

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

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

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

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

Attaching package: 'BufferedMatrix'

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

    colMeans, colSums, rowMeans, rowSums

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

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

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

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

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

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

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

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

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

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

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

[[1]]
[1] 0

> 
> proc.time()
   user  system elapsed 
  0.123   0.051   0.169 

BufferedMatrix.Rcheck/tests/objectTesting.Rout


R version 4.6.0 Patched (2026-04-24 r89963) -- "Because it was There"
Copyright (C) 2026 The R Foundation for Statistical Computing
Platform: aarch64-apple-darwin23

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

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

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

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

Attaching package: 'BufferedMatrix'

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

    colMeans, colSums, rowMeans, rowSums

> 
> 
> ### this is used to control how many repetitions in something below
> ### higher values result in more checks.
> nreps <-100 ##20000
> 
> 
> ## test creation and some simple assignments and subsetting operations
> 
> ## first on single elements
> tmp <- createBufferedMatrix(1000,10)
> 
> tmp[10,5]
[1] 0
> tmp[10,5] <- 10
> tmp[10,5]
[1] 10
> tmp[10,5] <- 12.445
> tmp[10,5]
[1] 12.445
> 
> 
> 
> ## now testing accessing multiple elements
> tmp2 <- createBufferedMatrix(10,20)
> 
> 
> tmp2[3,1] <- 51.34
> tmp2[9,2] <- 9.87654
> tmp2[,1:2]
       [,1]    [,2]
 [1,]  0.00 0.00000
 [2,]  0.00 0.00000
 [3,] 51.34 0.00000
 [4,]  0.00 0.00000
 [5,]  0.00 0.00000
 [6,]  0.00 0.00000
 [7,]  0.00 0.00000
 [8,]  0.00 0.00000
 [9,]  0.00 9.87654
[10,]  0.00 0.00000
> tmp2[,-(3:20)]
       [,1]    [,2]
 [1,]  0.00 0.00000
 [2,]  0.00 0.00000
 [3,] 51.34 0.00000
 [4,]  0.00 0.00000
 [5,]  0.00 0.00000
 [6,]  0.00 0.00000
 [7,]  0.00 0.00000
 [8,]  0.00 0.00000
 [9,]  0.00 9.87654
[10,]  0.00 0.00000
> tmp2[3,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
[1,] 51.34    0    0    0    0    0    0    0    0     0     0     0     0
     [,14] [,15] [,16] [,17] [,18] [,19] [,20]
[1,]     0     0     0     0     0     0     0
> tmp2[-3,]
      [,1]    [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [2,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [3,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [4,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [5,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [6,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [7,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [8,]    0 9.87654    0    0    0    0    0    0    0     0     0     0     0
 [9,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
      [,14] [,15] [,16] [,17] [,18] [,19] [,20]
 [1,]     0     0     0     0     0     0     0
 [2,]     0     0     0     0     0     0     0
 [3,]     0     0     0     0     0     0     0
 [4,]     0     0     0     0     0     0     0
 [5,]     0     0     0     0     0     0     0
 [6,]     0     0     0     0     0     0     0
 [7,]     0     0     0     0     0     0     0
 [8,]     0     0     0     0     0     0     0
 [9,]     0     0     0     0     0     0     0
> tmp2[2,1:3]
     [,1] [,2] [,3]
[1,]    0    0    0
> tmp2[3:9,1:3]
      [,1]    [,2] [,3]
[1,] 51.34 0.00000    0
[2,]  0.00 0.00000    0
[3,]  0.00 0.00000    0
[4,]  0.00 0.00000    0
[5,]  0.00 0.00000    0
[6,]  0.00 0.00000    0
[7,]  0.00 9.87654    0
> tmp2[-4,-4]
       [,1]    [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [2,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [3,] 51.34 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [4,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [5,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [6,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [7,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [8,]  0.00 9.87654    0    0    0    0    0    0    0     0     0     0     0
 [9,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
      [,14] [,15] [,16] [,17] [,18] [,19]
 [1,]     0     0     0     0     0     0
 [2,]     0     0     0     0     0     0
 [3,]     0     0     0     0     0     0
 [4,]     0     0     0     0     0     0
 [5,]     0     0     0     0     0     0
 [6,]     0     0     0     0     0     0
 [7,]     0     0     0     0     0     0
 [8,]     0     0     0     0     0     0
 [9,]     0     0     0     0     0     0
> 
> ## now testing accessing/assigning multiple elements
> tmp3 <- createBufferedMatrix(10,10)
> 
> for (i in 1:10){
+   for (j in 1:10){
+     tmp3[i,j] <- (j-1)*10 + i
+   }
+ }
> 
> tmp3[2:4,2:4]
     [,1] [,2] [,3]
[1,]   12   22   32
[2,]   13   23   33
[3,]   14   24   34
> tmp3[c(-10),c(2:4,2:4,10,1,2,1:10,10:1)]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]   11   21   31   11   21   31   91    1   11     1    11    21    31
 [2,]   12   22   32   12   22   32   92    2   12     2    12    22    32
 [3,]   13   23   33   13   23   33   93    3   13     3    13    23    33
 [4,]   14   24   34   14   24   34   94    4   14     4    14    24    34
 [5,]   15   25   35   15   25   35   95    5   15     5    15    25    35
 [6,]   16   26   36   16   26   36   96    6   16     6    16    26    36
 [7,]   17   27   37   17   27   37   97    7   17     7    17    27    37
 [8,]   18   28   38   18   28   38   98    8   18     8    18    28    38
 [9,]   19   29   39   19   29   39   99    9   19     9    19    29    39
      [,14] [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24] [,25]
 [1,]    41    51    61    71    81    91    91    81    71    61    51    41
 [2,]    42    52    62    72    82    92    92    82    72    62    52    42
 [3,]    43    53    63    73    83    93    93    83    73    63    53    43
 [4,]    44    54    64    74    84    94    94    84    74    64    54    44
 [5,]    45    55    65    75    85    95    95    85    75    65    55    45
 [6,]    46    56    66    76    86    96    96    86    76    66    56    46
 [7,]    47    57    67    77    87    97    97    87    77    67    57    47
 [8,]    48    58    68    78    88    98    98    88    78    68    58    48
 [9,]    49    59    69    79    89    99    99    89    79    69    59    49
      [,26] [,27] [,28] [,29]
 [1,]    31    21    11     1
 [2,]    32    22    12     2
 [3,]    33    23    13     3
 [4,]    34    24    14     4
 [5,]    35    25    15     5
 [6,]    36    26    16     6
 [7,]    37    27    17     7
 [8,]    38    28    18     8
 [9,]    39    29    19     9
> tmp3[-c(1:5),-c(6:10)]
     [,1] [,2] [,3] [,4] [,5]
[1,]    6   16   26   36   46
[2,]    7   17   27   37   47
[3,]    8   18   28   38   48
[4,]    9   19   29   39   49
[5,]   10   20   30   40   50
> 
> ## assignment of whole columns
> tmp3[,1] <- c(1:10*100.0)
> tmp3[,1:2] <- tmp3[,1:2]*100
> tmp3[,1:2] <- tmp3[,2:1]
> tmp3[,1:2]
      [,1]  [,2]
 [1,] 1100 1e+04
 [2,] 1200 2e+04
 [3,] 1300 3e+04
 [4,] 1400 4e+04
 [5,] 1500 5e+04
 [6,] 1600 6e+04
 [7,] 1700 7e+04
 [8,] 1800 8e+04
 [9,] 1900 9e+04
[10,] 2000 1e+05
> 
> 
> tmp3[,-1] <- tmp3[,1:9]
> tmp3[,1:10]
      [,1] [,2]  [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,] 1100 1100 1e+04   21   31   41   51   61   71    81
 [2,] 1200 1200 2e+04   22   32   42   52   62   72    82
 [3,] 1300 1300 3e+04   23   33   43   53   63   73    83
 [4,] 1400 1400 4e+04   24   34   44   54   64   74    84
 [5,] 1500 1500 5e+04   25   35   45   55   65   75    85
 [6,] 1600 1600 6e+04   26   36   46   56   66   76    86
 [7,] 1700 1700 7e+04   27   37   47   57   67   77    87
 [8,] 1800 1800 8e+04   28   38   48   58   68   78    88
 [9,] 1900 1900 9e+04   29   39   49   59   69   79    89
[10,] 2000 2000 1e+05   30   40   50   60   70   80    90
> 
> tmp3[,1:2] <- rep(1,10)
> tmp3[,1:2] <- rep(1,20)
> tmp3[,1:2] <- matrix(c(1:5),1,5)
> 
> tmp3[,-c(1:8)] <- matrix(c(1:5),1,5)
> 
> tmp3[1,] <- 1:10
> tmp3[1,]
     [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,]    1    2    3    4    5    6    7    8    9    10
> tmp3[-1,] <- c(1,2)
> tmp3[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    1    2    3    4    5    6    7    8    9    10
 [2,]    1    2    1    2    1    2    1    2    1     2
 [3,]    2    1    2    1    2    1    2    1    2     1
 [4,]    1    2    1    2    1    2    1    2    1     2
 [5,]    2    1    2    1    2    1    2    1    2     1
 [6,]    1    2    1    2    1    2    1    2    1     2
 [7,]    2    1    2    1    2    1    2    1    2     1
 [8,]    1    2    1    2    1    2    1    2    1     2
 [9,]    2    1    2    1    2    1    2    1    2     1
[10,]    1    2    1    2    1    2    1    2    1     2
> tmp3[-c(1:8),] <- matrix(c(1:5),1,5)
> tmp3[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    1    2    3    4    5    6    7    8    9    10
 [2,]    1    2    1    2    1    2    1    2    1     2
 [3,]    2    1    2    1    2    1    2    1    2     1
 [4,]    1    2    1    2    1    2    1    2    1     2
 [5,]    2    1    2    1    2    1    2    1    2     1
 [6,]    1    2    1    2    1    2    1    2    1     2
 [7,]    2    1    2    1    2    1    2    1    2     1
 [8,]    1    2    1    2    1    2    1    2    1     2
 [9,]    1    3    5    2    4    1    3    5    2     4
[10,]    2    4    1    3    5    2    4    1    3     5
> 
> 
> tmp3[1:2,1:2] <- 5555.04
> tmp3[-(1:2),1:2] <- 1234.56789
> 
> 
> 
> ## testing accessors for the directory and prefix
> directory(tmp3)
[1] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests"
> prefix(tmp3)
[1] "BM"
> 
> ## testing if we can remove these objects
> rm(tmp, tmp2, tmp3)
> gc()
         used (Mb) gc trigger (Mb) limit (Mb) max used (Mb)
Ncells 482663 25.8    1063027 56.8         NA   632020 33.8
Vcells 893071  6.9    8388608 64.0     196608  2112201 16.2
> 
> 
> 
> 
> ##
> ## checking reads
> ##
> 
> tmp2 <- createBufferedMatrix(10,20)
> 
> test.sample <- rnorm(10*20)
> 
> tmp2[1:10,1:20] <- test.sample
> 
> test.matrix <- matrix(test.sample,10,20)
> 
> ## testing reads
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   which.col <- sample(1:20,1)
+   if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> date()
[1] "Tue Apr 28 20:22:39 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] "Tue Apr 28 20:22:39 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: 0x103f0c180>
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   which.col <- sample(1:20,1)
+   if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,5,replace=TRUE)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> date()
[1] "Tue Apr 28 20:22:40 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] "Tue Apr 28 20:22:41 2026"
> 
> ColMode(tmp2)
<pointer: 0x103f0c180>
> 
> 
> 
> ### 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,] 101.0432252  0.2630910 -0.03122765  1.1740261
[2,]  -0.1274754 -0.2880763 -0.17762193 -0.4168962
[3,]  -0.4686701  1.2389204 -1.77867769  1.5783924
[4,]   0.7217521  1.0731263  1.13838141  0.2529094
> 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,] 101.0432252 0.2630910 0.03122765 1.1740261
[2,]   0.1274754 0.2880763 0.17762193 0.4168962
[3,]   0.4686701 1.2389204 1.77867769 1.5783924
[4,]   0.7217521 1.0731263 1.13838141 0.2529094
> 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.0520259 0.5129240 0.1767135 1.0835248
[2,]  0.3570370 0.5367274 0.4214522 0.6456750
[3,]  0.6845948 1.1130680 1.3336708 1.2563409
[4,]  0.8495599 1.0359181 1.0669496 0.5029009
> 
> 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,] 226.56348 30.39233 26.79836 37.00927
[2,]  28.69785 30.65535 29.39214 31.87365
[3,]  32.31462 37.36960 40.11539 39.14180
[4,]  34.21735 36.43231 36.80788 30.28192
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0xc3a8a4000>
> exp(tmp5)
<pointer: 0xc3a8a4000>
> log(tmp5,2)
<pointer: 0xc3a8a4000>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 471.5622
> Min(tmp5)
[1] 53.17134
> mean(tmp5)
[1] 72.4677
> Sum(tmp5)
[1] 14493.54
> Var(tmp5)
[1] 873.9926
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 88.09955 68.83005 71.48159 71.36355 71.75368 68.94363 69.30370 70.95530
 [9] 72.06851 71.87747
> rowSums(tmp5)
 [1] 1761.991 1376.601 1429.632 1427.271 1435.074 1378.873 1386.074 1419.106
 [9] 1441.370 1437.549
> rowVars(tmp5)
 [1] 8229.32529   56.96472   43.80937   38.98041   71.87080   72.50324
 [7]   79.53965   94.12426   74.76594   91.49856
> rowSd(tmp5)
 [1] 90.715629  7.547497  6.618865  6.243429  8.477665  8.514884  8.918500
 [8]  9.701766  8.646730  9.565488
> rowMax(tmp5)
 [1] 471.56221  83.46775  83.49492  81.61322  88.57259  84.09181  88.56469
 [8]  90.73100  88.96780  88.11687
> rowMin(tmp5)
 [1] 54.21998 59.73081 61.27671 57.61257 56.80355 54.66416 53.17134 56.05669
 [9] 56.91396 55.70267
> 
> colMeans(tmp5)
 [1] 109.29862  72.83463  73.33763  70.73201  73.82157  73.89292  74.30891
 [8]  69.76045  68.38879  73.40511  68.84644  70.12199  68.92570  68.70348
[15]  72.71557  65.61832  67.25721  69.26582  70.50698  67.61193
> colSums(tmp5)
 [1] 1092.9862  728.3463  733.3763  707.3201  738.2157  738.9292  743.0891
 [8]  697.6045  683.8879  734.0511  688.4644  701.2199  689.2570  687.0348
[15]  727.1557  656.1832  672.5721  692.6582  705.0698  676.1193
> colVars(tmp5)
 [1] 16236.59301   105.55062   146.65681   111.38424    38.53376    57.21464
 [7]    20.82696    53.83652   119.68230    69.48558    71.40733    51.68253
[13]    31.25280    63.42602    73.77314    38.23945    82.83123    97.28820
[19]    93.31947    40.12960
> colSd(tmp5)
 [1] 127.422890  10.273783  12.110195  10.553873   6.207557   7.564036
 [7]   4.563656   7.337337  10.939941   8.335801   8.450286   7.189056
[13]   5.590420   7.964046   8.589129   6.183806   9.101167   9.863478
[19]   9.660201   6.334792
> colMax(tmp5)
 [1] 471.56221  88.56469  88.96780  88.11687  83.46775  81.59662  82.23253
 [8]  76.77260  88.25104  86.81827  81.61322  84.54240  79.56785  76.87365
[15]  81.45638  79.26845  81.31517  91.31250  90.73100  81.15241
> colMin(tmp5)
 [1] 59.73081 56.05669 55.77728 54.66416 65.85567 61.27671 68.87995 54.21998
 [9] 54.51101 60.29709 55.70267 63.54705 61.70106 57.36247 55.36884 56.34307
[17] 53.17134 56.91396 57.61257 58.65685
> 
> 
> ### 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] 88.09955 68.83005 71.48159 71.36355       NA 68.94363 69.30370 70.95530
 [9] 72.06851 71.87747
> rowSums(tmp5)
 [1] 1761.991 1376.601 1429.632 1427.271       NA 1378.873 1386.074 1419.106
 [9] 1441.370 1437.549
> rowVars(tmp5)
 [1] 8229.32529   56.96472   43.80937   38.98041   67.50214   72.50324
 [7]   79.53965   94.12426   74.76594   91.49856
> rowSd(tmp5)
 [1] 90.715629  7.547497  6.618865  6.243429  8.215969  8.514884  8.918500
 [8]  9.701766  8.646730  9.565488
> rowMax(tmp5)
 [1] 471.56221  83.46775  83.49492  81.61322        NA  84.09181  88.56469
 [8]  90.73100  88.96780  88.11687
> rowMin(tmp5)
 [1] 54.21998 59.73081 61.27671 57.61257       NA 54.66416 53.17134 56.05669
 [9] 56.91396 55.70267
> 
> colMeans(tmp5)
 [1] 109.29862  72.83463  73.33763        NA  73.82157  73.89292  74.30891
 [8]  69.76045  68.38879  73.40511  68.84644  70.12199  68.92570  68.70348
[15]  72.71557  65.61832  67.25721  69.26582  70.50698  67.61193
> colSums(tmp5)
 [1] 1092.9862  728.3463  733.3763        NA  738.2157  738.9292  743.0891
 [8]  697.6045  683.8879  734.0511  688.4644  701.2199  689.2570  687.0348
[15]  727.1557  656.1832  672.5721  692.6582  705.0698  676.1193
> colVars(tmp5)
 [1] 16236.59301   105.55062   146.65681          NA    38.53376    57.21464
 [7]    20.82696    53.83652   119.68230    69.48558    71.40733    51.68253
[13]    31.25280    63.42602    73.77314    38.23945    82.83123    97.28820
[19]    93.31947    40.12960
> colSd(tmp5)
 [1] 127.422890  10.273783  12.110195         NA   6.207557   7.564036
 [7]   4.563656   7.337337  10.939941   8.335801   8.450286   7.189056
[13]   5.590420   7.964046   8.589129   6.183806   9.101167   9.863478
[19]   9.660201   6.334792
> colMax(tmp5)
 [1] 471.56221  88.56469  88.96780        NA  83.46775  81.59662  82.23253
 [8]  76.77260  88.25104  86.81827  81.61322  84.54240  79.56785  76.87365
[15]  81.45638  79.26845  81.31517  91.31250  90.73100  81.15241
> colMin(tmp5)
 [1] 59.73081 56.05669 55.77728       NA 65.85567 61.27671 68.87995 54.21998
 [9] 54.51101 60.29709 55.70267 63.54705 61.70106 57.36247 55.36884 56.34307
[17] 53.17134 56.91396 57.61257 58.65685
> 
> Max(tmp5,na.rm=TRUE)
[1] 471.5622
> Min(tmp5,na.rm=TRUE)
[1] 53.17134
> mean(tmp5,na.rm=TRUE)
[1] 72.53138
> Sum(tmp5,na.rm=TRUE)
[1] 14433.74
> Var(tmp5,na.rm=TRUE)
[1] 877.5917
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 88.09955 68.83005 71.48159 71.36355 72.38302 68.94363 69.30370 70.95530
 [9] 72.06851 71.87747
> rowSums(tmp5,na.rm=TRUE)
 [1] 1761.991 1376.601 1429.632 1427.271 1375.277 1378.873 1386.074 1419.106
 [9] 1441.370 1437.549
> rowVars(tmp5,na.rm=TRUE)
 [1] 8229.32529   56.96472   43.80937   38.98041   67.50214   72.50324
 [7]   79.53965   94.12426   74.76594   91.49856
> rowSd(tmp5,na.rm=TRUE)
 [1] 90.715629  7.547497  6.618865  6.243429  8.215969  8.514884  8.918500
 [8]  9.701766  8.646730  9.565488
> rowMax(tmp5,na.rm=TRUE)
 [1] 471.56221  83.46775  83.49492  81.61322  88.57259  84.09181  88.56469
 [8]  90.73100  88.96780  88.11687
> rowMin(tmp5,na.rm=TRUE)
 [1] 54.21998 59.73081 61.27671 57.61257 56.80355 54.66416 53.17134 56.05669
 [9] 56.91396 55.70267
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 109.29862  72.83463  73.33763  71.94710  73.82157  73.89292  74.30891
 [8]  69.76045  68.38879  73.40511  68.84644  70.12199  68.92570  68.70348
[15]  72.71557  65.61832  67.25721  69.26582  70.50698  67.61193
> colSums(tmp5,na.rm=TRUE)
 [1] 1092.9862  728.3463  733.3763  647.5239  738.2157  738.9292  743.0891
 [8]  697.6045  683.8879  734.0511  688.4644  701.2199  689.2570  687.0348
[15]  727.1557  656.1832  672.5721  692.6582  705.0698  676.1193
> colVars(tmp5,na.rm=TRUE)
 [1] 16236.59301   105.55062   146.65681   108.69727    38.53376    57.21464
 [7]    20.82696    53.83652   119.68230    69.48558    71.40733    51.68253
[13]    31.25280    63.42602    73.77314    38.23945    82.83123    97.28820
[19]    93.31947    40.12960
> colSd(tmp5,na.rm=TRUE)
 [1] 127.422890  10.273783  12.110195  10.425798   6.207557   7.564036
 [7]   4.563656   7.337337  10.939941   8.335801   8.450286   7.189056
[13]   5.590420   7.964046   8.589129   6.183806   9.101167   9.863478
[19]   9.660201   6.334792
> colMax(tmp5,na.rm=TRUE)
 [1] 471.56221  88.56469  88.96780  88.11687  83.46775  81.59662  82.23253
 [8]  76.77260  88.25104  86.81827  81.61322  84.54240  79.56785  76.87365
[15]  81.45638  79.26845  81.31517  91.31250  90.73100  81.15241
> colMin(tmp5,na.rm=TRUE)
 [1] 59.73081 56.05669 55.77728 54.66416 65.85567 61.27671 68.87995 54.21998
 [9] 54.51101 60.29709 55.70267 63.54705 61.70106 57.36247 55.36884 56.34307
[17] 53.17134 56.91396 57.61257 58.65685
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1] 88.09955 68.83005 71.48159 71.36355      NaN 68.94363 69.30370 70.95530
 [9] 72.06851 71.87747
> rowSums(tmp5,na.rm=TRUE)
 [1] 1761.991 1376.601 1429.632 1427.271    0.000 1378.873 1386.074 1419.106
 [9] 1441.370 1437.549
> rowVars(tmp5,na.rm=TRUE)
 [1] 8229.32529   56.96472   43.80937   38.98041         NA   72.50324
 [7]   79.53965   94.12426   74.76594   91.49856
> rowSd(tmp5,na.rm=TRUE)
 [1] 90.715629  7.547497  6.618865  6.243429        NA  8.514884  8.918500
 [8]  9.701766  8.646730  9.565488
> rowMax(tmp5,na.rm=TRUE)
 [1] 471.56221  83.46775  83.49492  81.61322        NA  84.09181  88.56469
 [8]  90.73100  88.96780  88.11687
> rowMin(tmp5,na.rm=TRUE)
 [1] 54.21998 59.73081 61.27671 57.61257       NA 54.66416 53.17134 56.05669
 [9] 56.91396 55.70267
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1] 113.24365  73.63552  71.64486       NaN  74.59855  73.18199  74.64241
 [8]  69.25305  69.67604  71.91476  67.75564  70.65834  68.43034  68.48379
[15]  72.11976  65.67239  67.76133  69.70862  69.67137  66.94128
> colSums(tmp5,na.rm=TRUE)
 [1] 1019.1928  662.7197  644.8037    0.0000  671.3869  658.6379  671.7817
 [8]  623.2775  627.0843  647.2328  609.8008  635.9251  615.8731  616.3541
[15]  649.0779  591.0516  609.8520  627.3776  627.0424  602.4715
> colVars(tmp5,na.rm=TRUE)
 [1] 18091.08012   111.52841   132.75227          NA    36.55884    58.68051
 [7]    22.17907    57.66979   116.00122    53.18338    66.94752    54.90655
[13]    32.39884    70.81131    79.00119    42.98649    90.32613   107.24341
[19]    97.12919    40.08593
> colSd(tmp5,na.rm=TRUE)
 [1] 134.503086  10.560701  11.521817         NA   6.046390   7.660320
 [7]   4.709466   7.594063  10.770386   7.292694   8.182147   7.409895
[13]   5.691998   8.414946   8.888261   6.556408   9.504006  10.355840
[19]   9.855414   6.331345
> colMax(tmp5,na.rm=TRUE)
 [1] 471.56221  88.56469  88.96780      -Inf  83.46775  81.59662  82.23253
 [8]  76.77260  88.25104  85.35353  81.61322  84.54240  79.56785  76.87365
[15]  81.45638  79.26845  81.31517  91.31250  90.73100  81.15241
> colMin(tmp5,na.rm=TRUE)
 [1] 59.73081 56.05669 55.77728      Inf 65.85567 61.27671 68.87995 54.21998
 [9] 54.51101 60.29709 55.70267 63.54705 61.70106 57.36247 55.36884 56.34307
[17] 53.17134 56.91396 57.61257 58.65685
> 
> 
> 
> 
> 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] 208.3257 401.0397 262.9892 152.2723 445.9969 207.7122 252.5842 202.9147
 [9] 423.6123 232.0862
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 208.3257 401.0397 262.9892 152.2723 445.9969 207.7122 252.5842 202.9147
 [9] 423.6123 232.0862
> 
> 
> 
> 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  2.842171e-14  4.973799e-14  0.000000e+00
 [6] -1.136868e-13  1.705303e-13  5.684342e-14 -5.684342e-14  1.136868e-13
[11]  0.000000e+00 -4.263256e-14 -2.842171e-14  1.421085e-14  0.000000e+00
[16] -5.684342e-14 -1.136868e-13 -2.842171e-14 -8.526513e-14  1.705303e-13
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> ## making sure these things agree
> ##
> ## first when there is no NA
> 
> 
> 
> agree.checks <- function(buff.matrix,r.matrix,err.tol=1e-10){
+ 
+   if (Max(buff.matrix,na.rm=TRUE) != max(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Max")
+   }
+   
+ 
+   if (Min(buff.matrix,na.rm=TRUE) != min(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Min")
+   }
+ 
+ 
+   if (abs(Sum(buff.matrix,na.rm=TRUE)- sum(r.matrix,na.rm=TRUE)) > err.tol){
+ 
+     cat(Sum(buff.matrix,na.rm=TRUE),"\n")
+     cat(sum(r.matrix,na.rm=TRUE),"\n")
+     cat(Sum(buff.matrix,na.rm=TRUE) - sum(r.matrix,na.rm=TRUE),"\n")
+     
+     stop("No agreement in Sum")
+   }
+   
+   if (abs(mean(buff.matrix,na.rm=TRUE) - mean(r.matrix,na.rm=TRUE)) > err.tol){
+     stop("No agreement in mean")
+   }
+   
+   
+   if(abs(Var(buff.matrix,na.rm=TRUE) - var(as.vector(r.matrix),na.rm=TRUE)) > err.tol){
+     stop("No agreement in Var")
+   }
+   
+   
+ 
+   if(any(abs(rowMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,mean,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowMeans")
+   }
+   
+   
+   if(any(abs(colMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,mean,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colMeans")
+   }
+   
+   
+   if(any(abs(rowSums(buff.matrix,na.rm=TRUE)  -  apply(r.matrix,1,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in rowSums")
+   }
+   
+   
+   if(any(abs(colSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colSums")
+   }
+   
+   ### this is to get around the fact that R doesn't like to compute NA on an entire vector of NA when 
+   ### computing variance
+   my.Var <- function(x,na.rm=FALSE){
+    if (all(is.na(x))){
+      return(NA)
+    } else {
+      var(x,na.rm=na.rm)
+    }
+ 
+   }
+   
+   if(any(abs(rowVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+   
+   
+   if(any(abs(colVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+ 
+ 
+   if(any(abs(rowMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+ 
+   if(any(abs(colMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+   
+   
+   if(any(abs(rowMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+   
+ 
+   if(any(abs(colMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+ 
+   if(any(abs(colMedians(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,median,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMedian")
+   }
+ 
+   if(any(abs(colRanges(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,range,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colRanges")
+   }
+ 
+ 
+   
+ }
> 
> 
> 
> 
> 
> 
> 
> 
> 
> for (rep in 1:20){
+   copymatrix <- matrix(rnorm(200,150,15),10,20)
+   
+   tmp5[1:10,1:20] <- copymatrix
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ## now lets assign some NA values and check agreement
+ 
+   which.row <- sample(1:10,1,replace=TRUE)
+   which.col  <- sample(1:20,1,replace=TRUE)
+   
+   cat(which.row," ",which.col,"\n")
+   
+   tmp5[which.row,which.col] <- NA
+   copymatrix[which.row,which.col] <- NA
+   
+   agree.checks(tmp5,copymatrix)
+ 
+   ## make an entire row NA
+   tmp5[which.row,] <- NA
+   copymatrix[which.row,] <- NA
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ### also make an entire col NA
+   tmp5[,which.col] <- NA
+   copymatrix[,which.col] <- NA
+ 
+   agree.checks(tmp5,copymatrix)
+ 
+   ### now make 1 element non NA with NA in the rest of row and column
+ 
+   tmp5[which.row,which.col] <- rnorm(1,150,15)
+   copymatrix[which.row,which.col] <- tmp5[which.row,which.col]
+ 
+   agree.checks(tmp5,copymatrix)
+ }
6   11 
3   17 
3   13 
6   2 
10   11 
5   12 
8   9 
7   18 
4   18 
2   18 
1   2 
10   15 
3   9 
5   12 
4   17 
8   8 
3   9 
5   8 
4   13 
8   13 
There were 50 or more warnings (use warnings() to see the first 50)
> 
> 
> ### now test 1 by n and n by 1 matrix
> 
> 
> err.tol <- 1e-12
> 
> rm(tmp5)
> 
> dataset1 <- rnorm(100)
> dataset2 <- rnorm(100)
> 
> tmp <- createBufferedMatrix(1,100)
> tmp[1,] <- dataset1
> 
> tmp2 <- createBufferedMatrix(100,1)
> tmp2[,1] <- dataset2
> 
> 
> 
> 
> 
> Max(tmp)
[1] 2.507133
> Min(tmp)
[1] -2.444541
> mean(tmp)
[1] -0.03789935
> Sum(tmp)
[1] -3.789935
> Var(tmp)
[1] 0.8339199
> 
> rowMeans(tmp)
[1] -0.03789935
> rowSums(tmp)
[1] -3.789935
> rowVars(tmp)
[1] 0.8339199
> rowSd(tmp)
[1] 0.9131921
> rowMax(tmp)
[1] 2.507133
> rowMin(tmp)
[1] -2.444541
> 
> colMeans(tmp)
  [1]  1.00424645 -0.34244125 -0.26746146  0.94699839  0.56644864  0.92955730
  [7]  0.82613681 -0.69696474 -0.69932206  0.74280508  0.14058826 -1.73422062
 [13] -2.44454075  0.97911307  1.27621733  0.44579213  1.44621968 -0.28614305
 [19]  0.48653406  1.43178822  1.80336490 -0.63115125 -0.25872952 -1.42380056
 [25] -0.35039736 -1.39094086 -0.37123333  0.32115301  0.53207199 -0.68298876
 [31] -0.18933519 -0.50414288  0.20294031  0.30532495 -0.35619932 -1.26843863
 [37] -0.02510502  0.55327161 -0.46339229 -1.35500474 -0.07001405 -0.48300727
 [43]  1.52640130  0.36370803 -1.54488295  0.16349296 -0.82648854  0.56151719
 [49]  2.50713278  0.54443839 -1.40840533  0.62987044  0.26137701 -0.32378516
 [55] -0.97174784 -0.18005011  1.02191719  1.01065307  0.44932214 -0.53083687
 [61]  0.08528582  0.52182858 -0.62559045  0.32534735 -0.32989788 -0.09439054
 [67] -1.36139116  1.37327550 -0.63832746 -0.12003112  0.44646230 -0.87237436
 [73]  1.49327753 -1.80936391 -0.34711964 -1.55590530  0.92620445 -0.03708012
 [79] -0.39976444  0.64947214 -0.18276293  0.39804928  1.12924816  0.63094899
 [85] -0.68981995  0.06521924 -0.01051859 -0.35771420  1.22678003 -0.81419948
 [91] -0.67605594  0.22441713 -1.47839815  0.24062864  1.12137842 -1.45270842
 [97] -1.38576293 -0.23591713 -0.35226284 -0.71963287
> colSums(tmp)
  [1]  1.00424645 -0.34244125 -0.26746146  0.94699839  0.56644864  0.92955730
  [7]  0.82613681 -0.69696474 -0.69932206  0.74280508  0.14058826 -1.73422062
 [13] -2.44454075  0.97911307  1.27621733  0.44579213  1.44621968 -0.28614305
 [19]  0.48653406  1.43178822  1.80336490 -0.63115125 -0.25872952 -1.42380056
 [25] -0.35039736 -1.39094086 -0.37123333  0.32115301  0.53207199 -0.68298876
 [31] -0.18933519 -0.50414288  0.20294031  0.30532495 -0.35619932 -1.26843863
 [37] -0.02510502  0.55327161 -0.46339229 -1.35500474 -0.07001405 -0.48300727
 [43]  1.52640130  0.36370803 -1.54488295  0.16349296 -0.82648854  0.56151719
 [49]  2.50713278  0.54443839 -1.40840533  0.62987044  0.26137701 -0.32378516
 [55] -0.97174784 -0.18005011  1.02191719  1.01065307  0.44932214 -0.53083687
 [61]  0.08528582  0.52182858 -0.62559045  0.32534735 -0.32989788 -0.09439054
 [67] -1.36139116  1.37327550 -0.63832746 -0.12003112  0.44646230 -0.87237436
 [73]  1.49327753 -1.80936391 -0.34711964 -1.55590530  0.92620445 -0.03708012
 [79] -0.39976444  0.64947214 -0.18276293  0.39804928  1.12924816  0.63094899
 [85] -0.68981995  0.06521924 -0.01051859 -0.35771420  1.22678003 -0.81419948
 [91] -0.67605594  0.22441713 -1.47839815  0.24062864  1.12137842 -1.45270842
 [97] -1.38576293 -0.23591713 -0.35226284 -0.71963287
> colVars(tmp)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> colSd(tmp)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> colMax(tmp)
  [1]  1.00424645 -0.34244125 -0.26746146  0.94699839  0.56644864  0.92955730
  [7]  0.82613681 -0.69696474 -0.69932206  0.74280508  0.14058826 -1.73422062
 [13] -2.44454075  0.97911307  1.27621733  0.44579213  1.44621968 -0.28614305
 [19]  0.48653406  1.43178822  1.80336490 -0.63115125 -0.25872952 -1.42380056
 [25] -0.35039736 -1.39094086 -0.37123333  0.32115301  0.53207199 -0.68298876
 [31] -0.18933519 -0.50414288  0.20294031  0.30532495 -0.35619932 -1.26843863
 [37] -0.02510502  0.55327161 -0.46339229 -1.35500474 -0.07001405 -0.48300727
 [43]  1.52640130  0.36370803 -1.54488295  0.16349296 -0.82648854  0.56151719
 [49]  2.50713278  0.54443839 -1.40840533  0.62987044  0.26137701 -0.32378516
 [55] -0.97174784 -0.18005011  1.02191719  1.01065307  0.44932214 -0.53083687
 [61]  0.08528582  0.52182858 -0.62559045  0.32534735 -0.32989788 -0.09439054
 [67] -1.36139116  1.37327550 -0.63832746 -0.12003112  0.44646230 -0.87237436
 [73]  1.49327753 -1.80936391 -0.34711964 -1.55590530  0.92620445 -0.03708012
 [79] -0.39976444  0.64947214 -0.18276293  0.39804928  1.12924816  0.63094899
 [85] -0.68981995  0.06521924 -0.01051859 -0.35771420  1.22678003 -0.81419948
 [91] -0.67605594  0.22441713 -1.47839815  0.24062864  1.12137842 -1.45270842
 [97] -1.38576293 -0.23591713 -0.35226284 -0.71963287
> colMin(tmp)
  [1]  1.00424645 -0.34244125 -0.26746146  0.94699839  0.56644864  0.92955730
  [7]  0.82613681 -0.69696474 -0.69932206  0.74280508  0.14058826 -1.73422062
 [13] -2.44454075  0.97911307  1.27621733  0.44579213  1.44621968 -0.28614305
 [19]  0.48653406  1.43178822  1.80336490 -0.63115125 -0.25872952 -1.42380056
 [25] -0.35039736 -1.39094086 -0.37123333  0.32115301  0.53207199 -0.68298876
 [31] -0.18933519 -0.50414288  0.20294031  0.30532495 -0.35619932 -1.26843863
 [37] -0.02510502  0.55327161 -0.46339229 -1.35500474 -0.07001405 -0.48300727
 [43]  1.52640130  0.36370803 -1.54488295  0.16349296 -0.82648854  0.56151719
 [49]  2.50713278  0.54443839 -1.40840533  0.62987044  0.26137701 -0.32378516
 [55] -0.97174784 -0.18005011  1.02191719  1.01065307  0.44932214 -0.53083687
 [61]  0.08528582  0.52182858 -0.62559045  0.32534735 -0.32989788 -0.09439054
 [67] -1.36139116  1.37327550 -0.63832746 -0.12003112  0.44646230 -0.87237436
 [73]  1.49327753 -1.80936391 -0.34711964 -1.55590530  0.92620445 -0.03708012
 [79] -0.39976444  0.64947214 -0.18276293  0.39804928  1.12924816  0.63094899
 [85] -0.68981995  0.06521924 -0.01051859 -0.35771420  1.22678003 -0.81419948
 [91] -0.67605594  0.22441713 -1.47839815  0.24062864  1.12137842 -1.45270842
 [97] -1.38576293 -0.23591713 -0.35226284 -0.71963287
> colMedians(tmp)
  [1]  1.00424645 -0.34244125 -0.26746146  0.94699839  0.56644864  0.92955730
  [7]  0.82613681 -0.69696474 -0.69932206  0.74280508  0.14058826 -1.73422062
 [13] -2.44454075  0.97911307  1.27621733  0.44579213  1.44621968 -0.28614305
 [19]  0.48653406  1.43178822  1.80336490 -0.63115125 -0.25872952 -1.42380056
 [25] -0.35039736 -1.39094086 -0.37123333  0.32115301  0.53207199 -0.68298876
 [31] -0.18933519 -0.50414288  0.20294031  0.30532495 -0.35619932 -1.26843863
 [37] -0.02510502  0.55327161 -0.46339229 -1.35500474 -0.07001405 -0.48300727
 [43]  1.52640130  0.36370803 -1.54488295  0.16349296 -0.82648854  0.56151719
 [49]  2.50713278  0.54443839 -1.40840533  0.62987044  0.26137701 -0.32378516
 [55] -0.97174784 -0.18005011  1.02191719  1.01065307  0.44932214 -0.53083687
 [61]  0.08528582  0.52182858 -0.62559045  0.32534735 -0.32989788 -0.09439054
 [67] -1.36139116  1.37327550 -0.63832746 -0.12003112  0.44646230 -0.87237436
 [73]  1.49327753 -1.80936391 -0.34711964 -1.55590530  0.92620445 -0.03708012
 [79] -0.39976444  0.64947214 -0.18276293  0.39804928  1.12924816  0.63094899
 [85] -0.68981995  0.06521924 -0.01051859 -0.35771420  1.22678003 -0.81419948
 [91] -0.67605594  0.22441713 -1.47839815  0.24062864  1.12137842 -1.45270842
 [97] -1.38576293 -0.23591713 -0.35226284 -0.71963287
> colRanges(tmp)
         [,1]       [,2]       [,3]      [,4]      [,5]      [,6]      [,7]
[1,] 1.004246 -0.3424413 -0.2674615 0.9469984 0.5664486 0.9295573 0.8261368
[2,] 1.004246 -0.3424413 -0.2674615 0.9469984 0.5664486 0.9295573 0.8261368
           [,8]       [,9]     [,10]     [,11]     [,12]     [,13]     [,14]
[1,] -0.6969647 -0.6993221 0.7428051 0.1405883 -1.734221 -2.444541 0.9791131
[2,] -0.6969647 -0.6993221 0.7428051 0.1405883 -1.734221 -2.444541 0.9791131
        [,15]     [,16]   [,17]      [,18]     [,19]    [,20]    [,21]
[1,] 1.276217 0.4457921 1.44622 -0.2861431 0.4865341 1.431788 1.803365
[2,] 1.276217 0.4457921 1.44622 -0.2861431 0.4865341 1.431788 1.803365
          [,22]      [,23]     [,24]      [,25]     [,26]      [,27]    [,28]
[1,] -0.6311513 -0.2587295 -1.423801 -0.3503974 -1.390941 -0.3712333 0.321153
[2,] -0.6311513 -0.2587295 -1.423801 -0.3503974 -1.390941 -0.3712333 0.321153
        [,29]      [,30]      [,31]      [,32]     [,33]    [,34]      [,35]
[1,] 0.532072 -0.6829888 -0.1893352 -0.5041429 0.2029403 0.305325 -0.3561993
[2,] 0.532072 -0.6829888 -0.1893352 -0.5041429 0.2029403 0.305325 -0.3561993
         [,36]       [,37]     [,38]      [,39]     [,40]       [,41]
[1,] -1.268439 -0.02510502 0.5532716 -0.4633923 -1.355005 -0.07001405
[2,] -1.268439 -0.02510502 0.5532716 -0.4633923 -1.355005 -0.07001405
          [,42]    [,43]    [,44]     [,45]    [,46]      [,47]     [,48]
[1,] -0.4830073 1.526401 0.363708 -1.544883 0.163493 -0.8264885 0.5615172
[2,] -0.4830073 1.526401 0.363708 -1.544883 0.163493 -0.8264885 0.5615172
        [,49]     [,50]     [,51]     [,52]    [,53]      [,54]      [,55]
[1,] 2.507133 0.5444384 -1.408405 0.6298704 0.261377 -0.3237852 -0.9717478
[2,] 2.507133 0.5444384 -1.408405 0.6298704 0.261377 -0.3237852 -0.9717478
          [,56]    [,57]    [,58]     [,59]      [,60]      [,61]     [,62]
[1,] -0.1800501 1.021917 1.010653 0.4493221 -0.5308369 0.08528582 0.5218286
[2,] -0.1800501 1.021917 1.010653 0.4493221 -0.5308369 0.08528582 0.5218286
          [,63]     [,64]      [,65]       [,66]     [,67]    [,68]      [,69]
[1,] -0.6255905 0.3253473 -0.3298979 -0.09439054 -1.361391 1.373275 -0.6383275
[2,] -0.6255905 0.3253473 -0.3298979 -0.09439054 -1.361391 1.373275 -0.6383275
          [,70]     [,71]      [,72]    [,73]     [,74]      [,75]     [,76]
[1,] -0.1200311 0.4464623 -0.8723744 1.493278 -1.809364 -0.3471196 -1.555905
[2,] -0.1200311 0.4464623 -0.8723744 1.493278 -1.809364 -0.3471196 -1.555905
         [,77]       [,78]      [,79]     [,80]      [,81]     [,82]    [,83]
[1,] 0.9262044 -0.03708012 -0.3997644 0.6494721 -0.1827629 0.3980493 1.129248
[2,] 0.9262044 -0.03708012 -0.3997644 0.6494721 -0.1827629 0.3980493 1.129248
        [,84]      [,85]      [,86]       [,87]      [,88]   [,89]      [,90]
[1,] 0.630949 -0.6898199 0.06521924 -0.01051859 -0.3577142 1.22678 -0.8141995
[2,] 0.630949 -0.6898199 0.06521924 -0.01051859 -0.3577142 1.22678 -0.8141995
          [,91]     [,92]     [,93]     [,94]    [,95]     [,96]     [,97]
[1,] -0.6760559 0.2244171 -1.478398 0.2406286 1.121378 -1.452708 -1.385763
[2,] -0.6760559 0.2244171 -1.478398 0.2406286 1.121378 -1.452708 -1.385763
          [,98]      [,99]     [,100]
[1,] -0.2359171 -0.3522628 -0.7196329
[2,] -0.2359171 -0.3522628 -0.7196329
> 
> 
> Max(tmp2)
[1] 2.143449
> Min(tmp2)
[1] -2.152066
> mean(tmp2)
[1] -0.003668957
> Sum(tmp2)
[1] -0.3668957
> Var(tmp2)
[1] 0.9511498
> 
> rowMeans(tmp2)
  [1]  0.46659052  0.03579624 -0.02035818  0.62728501  1.80996854 -0.27982800
  [7]  0.04113934  1.24791557  0.15869901 -1.59683983  1.10481245  0.83444448
 [13] -0.85446607  0.19973710 -2.15206622 -0.62818860 -1.74773835  0.61522615
 [19]  0.55361306  2.09190557  1.34492651  1.51644233 -1.01513128  0.90946107
 [25] -0.06231246 -0.36012340 -0.11239750 -0.55616981  0.61771011  0.93613558
 [31] -0.75468321 -0.58585020 -0.65852740  0.80894631 -0.87747620 -1.11978884
 [37] -1.50190154 -0.51481295 -0.44189040 -0.31660528 -0.56753041  0.37062217
 [43]  0.08816834  0.17103642 -1.24493002  0.48014890  1.21641803 -0.64627466
 [49] -0.43244328 -0.25755274  1.18032898 -1.01706122  0.74661814 -0.79473256
 [55]  0.55793922 -0.44674142  1.20960716 -0.87856634  0.99454983  0.19611502
 [61]  1.46383755 -0.36662077  1.10100492 -0.21234836  0.22724254  0.35627035
 [67] -1.46518434  1.35943553 -0.77356310 -1.30259400  1.01905969  0.05346000
 [73]  1.64598775 -1.42963119 -1.68220341  0.16040343  1.40156161 -1.09608500
 [79] -0.78626217  1.15375512 -0.37606082 -1.06284159  1.01420388 -0.44162539
 [85]  2.14344860 -0.77722584  0.49254146  0.97178817  0.58205960 -0.90497380
 [91]  0.12872429  0.41984154 -1.04006551  0.57769720 -0.22603034 -1.69317339
 [97]  0.51603488 -1.01626708  0.73743126 -1.92924770
> rowSums(tmp2)
  [1]  0.46659052  0.03579624 -0.02035818  0.62728501  1.80996854 -0.27982800
  [7]  0.04113934  1.24791557  0.15869901 -1.59683983  1.10481245  0.83444448
 [13] -0.85446607  0.19973710 -2.15206622 -0.62818860 -1.74773835  0.61522615
 [19]  0.55361306  2.09190557  1.34492651  1.51644233 -1.01513128  0.90946107
 [25] -0.06231246 -0.36012340 -0.11239750 -0.55616981  0.61771011  0.93613558
 [31] -0.75468321 -0.58585020 -0.65852740  0.80894631 -0.87747620 -1.11978884
 [37] -1.50190154 -0.51481295 -0.44189040 -0.31660528 -0.56753041  0.37062217
 [43]  0.08816834  0.17103642 -1.24493002  0.48014890  1.21641803 -0.64627466
 [49] -0.43244328 -0.25755274  1.18032898 -1.01706122  0.74661814 -0.79473256
 [55]  0.55793922 -0.44674142  1.20960716 -0.87856634  0.99454983  0.19611502
 [61]  1.46383755 -0.36662077  1.10100492 -0.21234836  0.22724254  0.35627035
 [67] -1.46518434  1.35943553 -0.77356310 -1.30259400  1.01905969  0.05346000
 [73]  1.64598775 -1.42963119 -1.68220341  0.16040343  1.40156161 -1.09608500
 [79] -0.78626217  1.15375512 -0.37606082 -1.06284159  1.01420388 -0.44162539
 [85]  2.14344860 -0.77722584  0.49254146  0.97178817  0.58205960 -0.90497380
 [91]  0.12872429  0.41984154 -1.04006551  0.57769720 -0.22603034 -1.69317339
 [97]  0.51603488 -1.01626708  0.73743126 -1.92924770
> 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.46659052  0.03579624 -0.02035818  0.62728501  1.80996854 -0.27982800
  [7]  0.04113934  1.24791557  0.15869901 -1.59683983  1.10481245  0.83444448
 [13] -0.85446607  0.19973710 -2.15206622 -0.62818860 -1.74773835  0.61522615
 [19]  0.55361306  2.09190557  1.34492651  1.51644233 -1.01513128  0.90946107
 [25] -0.06231246 -0.36012340 -0.11239750 -0.55616981  0.61771011  0.93613558
 [31] -0.75468321 -0.58585020 -0.65852740  0.80894631 -0.87747620 -1.11978884
 [37] -1.50190154 -0.51481295 -0.44189040 -0.31660528 -0.56753041  0.37062217
 [43]  0.08816834  0.17103642 -1.24493002  0.48014890  1.21641803 -0.64627466
 [49] -0.43244328 -0.25755274  1.18032898 -1.01706122  0.74661814 -0.79473256
 [55]  0.55793922 -0.44674142  1.20960716 -0.87856634  0.99454983  0.19611502
 [61]  1.46383755 -0.36662077  1.10100492 -0.21234836  0.22724254  0.35627035
 [67] -1.46518434  1.35943553 -0.77356310 -1.30259400  1.01905969  0.05346000
 [73]  1.64598775 -1.42963119 -1.68220341  0.16040343  1.40156161 -1.09608500
 [79] -0.78626217  1.15375512 -0.37606082 -1.06284159  1.01420388 -0.44162539
 [85]  2.14344860 -0.77722584  0.49254146  0.97178817  0.58205960 -0.90497380
 [91]  0.12872429  0.41984154 -1.04006551  0.57769720 -0.22603034 -1.69317339
 [97]  0.51603488 -1.01626708  0.73743126 -1.92924770
> rowMin(tmp2)
  [1]  0.46659052  0.03579624 -0.02035818  0.62728501  1.80996854 -0.27982800
  [7]  0.04113934  1.24791557  0.15869901 -1.59683983  1.10481245  0.83444448
 [13] -0.85446607  0.19973710 -2.15206622 -0.62818860 -1.74773835  0.61522615
 [19]  0.55361306  2.09190557  1.34492651  1.51644233 -1.01513128  0.90946107
 [25] -0.06231246 -0.36012340 -0.11239750 -0.55616981  0.61771011  0.93613558
 [31] -0.75468321 -0.58585020 -0.65852740  0.80894631 -0.87747620 -1.11978884
 [37] -1.50190154 -0.51481295 -0.44189040 -0.31660528 -0.56753041  0.37062217
 [43]  0.08816834  0.17103642 -1.24493002  0.48014890  1.21641803 -0.64627466
 [49] -0.43244328 -0.25755274  1.18032898 -1.01706122  0.74661814 -0.79473256
 [55]  0.55793922 -0.44674142  1.20960716 -0.87856634  0.99454983  0.19611502
 [61]  1.46383755 -0.36662077  1.10100492 -0.21234836  0.22724254  0.35627035
 [67] -1.46518434  1.35943553 -0.77356310 -1.30259400  1.01905969  0.05346000
 [73]  1.64598775 -1.42963119 -1.68220341  0.16040343  1.40156161 -1.09608500
 [79] -0.78626217  1.15375512 -0.37606082 -1.06284159  1.01420388 -0.44162539
 [85]  2.14344860 -0.77722584  0.49254146  0.97178817  0.58205960 -0.90497380
 [91]  0.12872429  0.41984154 -1.04006551  0.57769720 -0.22603034 -1.69317339
 [97]  0.51603488 -1.01626708  0.73743126 -1.92924770
> 
> colMeans(tmp2)
[1] -0.003668957
> colSums(tmp2)
[1] -0.3668957
> colVars(tmp2)
[1] 0.9511498
> colSd(tmp2)
[1] 0.9752691
> colMax(tmp2)
[1] 2.143449
> colMin(tmp2)
[1] -2.152066
> colMedians(tmp2)
[1] 0.03846779
> colRanges(tmp2)
          [,1]
[1,] -2.152066
[2,]  2.143449
> 
> 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.1461926 -4.0438702 -4.0630901 -0.9332066 -1.4749691  2.1227096
 [7] -3.0216288  1.5336714  3.2880069  4.3709766
> colApply(tmp,quantile)[,1]
            [,1]
[1,] -0.57371360
[2,]  0.05265362
[3,]  0.34398638
[4,]  0.80271720
[5,]  1.55938960
> 
> rowApply(tmp,sum)
 [1] -0.21572842  3.10369927 -3.76816652  1.20192552 -1.01569751  1.21359217
 [7]  0.07731903  0.55362880 -1.26304971  2.03726973
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    9   10    8    6    8    3    7    3    5    10
 [2,]    1    6    7   10    2    7    1    5    1     8
 [3,]    4    4    4    3    4    2    3    4    7     2
 [4,]    7    9    5    1    9    4    2    7    4     6
 [5,]    5    7    3    9    1    8    8    2    3     5
 [6,]    8    2    6    2    6    6   10    8    8     7
 [7,]   10    1    9    8    3    1    4    1    2     4
 [8,]    3    3    1    7   10    5    6    6   10     1
 [9,]    2    5   10    4    7    9    5   10    9     9
[10,]    6    8    2    5    5   10    9    9    6     3
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1]  3.26665701  4.72283672  2.12663201 -2.60642905 -5.02778402 -1.37183402
 [7] -3.45686919 -4.57254571  2.38045300  5.28498114  0.29072122  0.74460401
[13]  0.42474762  1.62426518  5.39683613  5.28609054  2.80039673 -0.08999964
[19] -0.13068052  1.19502137
> colApply(tmp,quantile)[,1]
          [,1]
[1,] 0.2923275
[2,] 0.5780480
[3,] 0.7375443
[4,] 0.8226474
[5,] 0.8360898
> 
> rowApply(tmp,sum)
[1] -0.3547961 -3.7517043  9.9926952  7.6094673  4.7924384
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]   15   17   14   12   15
[2,]   19   20   19    7   11
[3,]   17    7   17   10    9
[4,]    8    5    7    9    2
[5,]    4    9    3    2    1
> 
> 
> as.matrix(tmp)
          [,1]        [,2]        [,3]         [,4]       [,5]        [,6]
[1,] 0.5780480  1.75735067  1.04608223 -0.341913073 -0.9902125  0.33322083
[2,] 0.8226474  1.47158827 -0.54485179 -0.758395715 -0.4070385 -2.53151067
[3,] 0.8360898  1.78027679  1.53068219  0.014389461 -0.4153437 -0.01223587
[4,] 0.2923275 -0.34867276  0.17006672 -0.004219637 -1.4811483  0.28651139
[5,] 0.7375443  0.06229375 -0.07534734 -1.516290092 -1.7340410  0.55218031
           [,7]        [,8]       [,9]      [,10]      [,11]      [,12]
[1,] -1.6705383 -2.09497761  1.3896097 1.80453783 -0.4984071  0.4701042
[2,] -0.8069076 -0.27221338 -0.7726415 1.46482546 -0.6953245 -0.4906179
[3,]  0.4583036 -1.17644513  0.8126960 0.05453945  1.8776128  0.4940450
[4,] -1.5400103 -1.05532269  1.2335578 1.76591290 -0.2512534  0.7148324
[5,]  0.1022834  0.02641309 -0.2827689 0.19516550 -0.1419065 -0.4437597
           [,13]      [,14]     [,15]       [,16]      [,17]       [,18]
[1,] -0.14602913  0.1178516 -1.202314 -0.49681570 -0.3210972  0.68547486
[2,] -0.36423725  0.3415503  1.352294  0.04751787 -0.4009232  0.01666449
[3,] -0.06794781 -1.5209381  1.353262  0.94670957  1.7783046  0.61832258
[4,]  2.34661320  0.6419142  1.684942  2.54491589 -0.5504203 -0.38435602
[5,] -1.34365139  2.0438873  2.208651  2.24376291  2.2945329 -1.02610556
           [,19]      [,20]
[1,]  0.05164974 -0.8264213
[2,] -1.68212392  0.4579934
[3,] -0.05312180  0.6834938
[4,]  2.21505304 -0.6717767
[5,] -0.66213758  1.5517321
> 
> 
> is.BufferedMatrix(tmp)
[1] TRUE
> 
> as.BufferedMatrix(as.matrix(tmp))
BufferedMatrix object
Matrix size:  5 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  800  bytes.
> 
> 
> 
> subBufferedMatrix(tmp,1:5,1:5)
BufferedMatrix object
Matrix size:  5 5 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  655  bytes.
Disk usage :  200  bytes.
> subBufferedMatrix(tmp,,5:8)
BufferedMatrix object
Matrix size:  5 4 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  567  bytes.
Disk usage :  160  bytes.
> subBufferedMatrix(tmp,1:3,)
BufferedMatrix object
Matrix size:  3 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  480  bytes.
> 
> 
> rm(tmp)
> 
> 
> ###
> ### Testing colnames and rownames
> ###
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> 
> 
> colnames(tmp)
NULL
> rownames(tmp)
NULL
> 
> 
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> colnames(tmp)
 [1] "col1"  "col2"  "col3"  "col4"  "col5"  "col6"  "col7"  "col8"  "col9" 
[10] "col10" "col11" "col12" "col13" "col14" "col15" "col16" "col17" "col18"
[19] "col19" "col20"
> rownames(tmp)
[1] "row1" "row2" "row3" "row4" "row5"
> 
> 
> tmp["row1",]
         col1       col2       col3          col4      col5      col6
row1 1.464476 -0.4162075 -0.6159223 -0.0009854296 0.5161501 0.9421965
           col7      col8       col9     col10    col11     col12      col13
row1 0.01146593 -2.255521 -0.8320277 -1.041123 1.676663 -1.832962 -0.8906349
          col14      col15     col16     col17    col18       col19       col20
row1 -0.6022085 0.06346648 0.3653362 -1.540508 1.248529 -0.08225078 -0.04901865
> tmp[,"col10"]
           col10
row1 -1.04112307
row2 -1.50846141
row3 -0.21988107
row4 -0.03452441
row5  0.11797717
> tmp[c("row1","row5"),]
          col1       col2       col3          col4      col5       col6
row1  1.464476 -0.4162075 -0.6159223 -0.0009854296 0.5161501  0.9421965
row5 -1.604929  0.5410750  1.9640094  1.1223519265 1.8581456 -0.5821487
            col7      col8        col9      col10     col11     col12
row1  0.01146593 -2.255521 -0.83202774 -1.0411231 1.6766626 -1.832962
row5 -0.26296154  1.255565 -0.07220066  0.1179772 0.1043476  1.669593
           col13      col14       col15      col16      col17      col18
row1 -0.89063489 -0.6022085  0.06346648  0.3653362 -1.5405081  1.2485287
row5  0.08751874 -0.5055256 -1.64424761 -0.5313394  0.4859605 -0.1498959
           col19       col20
row1 -0.08225078 -0.04901865
row5  0.48442963  0.55376140
> tmp[,c("col6","col20")]
           col6       col20
row1  0.9421965 -0.04901865
row2  0.4186974  1.56250015
row3 -0.8746838  0.61030955
row4 -1.5433641  2.01429692
row5 -0.5821487  0.55376140
> tmp[c("row1","row5"),c("col6","col20")]
           col6       col20
row1  0.9421965 -0.04901865
row5 -0.5821487  0.55376140
> 
> 
> 
> 
> 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.63405 49.2242 49.80342 50.35559 51.06215 104.961 49.09661 50.01425
         col9    col10    col11    col12    col13    col14    col15    col16
row1 50.77451 49.46149 50.00048 49.42325 49.60407 50.15231 49.62854 49.95688
        col17    col18    col19    col20
row1 49.08523 50.97413 50.54071 104.0702
> tmp[,"col10"]
        col10
row1 49.46149
row2 30.84860
row3 29.29643
row4 31.79064
row5 50.08698
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 50.63405 49.22420 49.80342 50.35559 51.06215 104.9610 49.09661 50.01425
row5 48.84137 49.30373 51.13385 51.06949 51.47442 105.9151 50.62493 49.97140
         col9    col10    col11    col12    col13    col14    col15    col16
row1 50.77451 49.46149 50.00048 49.42325 49.60407 50.15231 49.62854 49.95688
row5 50.46392 50.08698 51.23595 49.83266 49.97659 49.74797 49.47881 48.03359
        col17    col18    col19    col20
row1 49.08523 50.97413 50.54071 104.0702
row5 49.78477 52.77860 50.67992 104.8635
> tmp[,c("col6","col20")]
          col6     col20
row1 104.96097 104.07017
row2  75.27939  75.79248
row3  74.04856  74.96270
row4  75.68012  76.29765
row5 105.91506 104.86352
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 104.9610 104.0702
row5 105.9151 104.8635
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 104.9610 104.0702
row5 105.9151 104.8635
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
            col13
[1,] -1.120146767
[2,]  0.002534197
[3,] -0.283488361
[4,]  0.636193008
[5,] -0.479866281
> tmp[,c("col17","col7")]
           col17        col7
[1,]  0.03389305 -1.06123915
[2,]  1.58003386  0.07915311
[3,]  0.90899195 -0.08684736
[4,]  0.91223168 -0.82068557
[5,] -1.20094402  0.75037587
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
           col6      col20
[1,]  0.6212034 -0.2791979
[2,] -0.3861952 -0.7841023
[3,] -0.7785182 -1.7781503
[4,]  0.4808454 -0.5788089
[5,] -0.8061807 -0.1764903
> subBufferedMatrix(tmp,1,c("col6"))[,1]
          col1
[1,] 0.6212034
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
           col6
[1,]  0.6212034
[2,] -0.3861952
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> 
> 
> 
> subBufferedMatrix(tmp,c("row3","row1"),)[,1:20]
           [,1]       [,2]       [,3]       [,4]       [,5]       [,6]
row3 0.02960294 -0.4260202 -1.3188859 -1.2629416 -0.2951817 -1.3807460
row1 0.98611578  0.5295906 -0.2398447 -0.1156697 -0.9944924  0.8810895
           [,7]       [,8]        [,9]       [,10]      [,11]      [,12]
row3 -1.3579712 -0.8294424  0.06158182 -0.04759233  0.9075944 -1.0756436
row1  0.5181782 -0.1172426 -0.35720248 -0.98710595 -0.6235198 -0.4040505
          [,13]      [,14]      [,15]      [,16]      [,17]      [,18]
row3  0.1988325  0.2232210  2.2939515  0.1167984 -0.7757048  0.2004949
row1 -0.8295481 -0.9058518 -0.6019168 -1.9487692 -0.1278201 -0.4515997
          [,19]     [,20]
row3 -0.5892050 0.8735230
row1  0.7270841 0.3873293
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
           [,1]     [,2]       [,3]       [,4]       [,5]     [,6]       [,7]
row2 -0.5537247 -1.00834 -0.7534794 -0.6533441 -0.2396811 2.094452 -0.4056423
           [,8]      [,9]      [,10]
row2 -0.4312668 -1.161698 -0.2280013
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
           [,1]       [,2]       [,3]      [,4]      [,5]     [,6]      [,7]
row5 -0.2071241 -0.9349855 -0.2446685 0.1580837 -1.031556 1.213268 -1.422906
           [,8]      [,9]       [,10]     [,11]     [,12]      [,13]      [,14]
row5 -0.7096309 0.1864087 -0.05876601 0.7214826 0.6877093 -0.7523094 -0.7227307
           [,15]     [,16]     [,17]    [,18]    [,19]     [,20]
row5 -0.06109391 -1.004839 0.4768582 -1.05526 1.234534 0.4139635
> 
> 
> 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: 0xc3a8a4660>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1803c64c5fcf1"
 [2] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1803c26165e7" 
 [3] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1803c486921e9"
 [4] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1803c6e316d22"
 [5] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1803c6ef40bb2"
 [6] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1803c582c0c06"
 [7] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1803c33c98b23"
 [8] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1803c74cdc164"
 [9] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1803c7053c824"
[10] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1803cc78ed19" 
[11] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1803c57160ab4"
[12] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1803c6818dc16"
[13] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1803c38195dbe"
[14] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1803c95981b8" 
[15] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1803c53535bd3"
> 
> 
> ### 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: 0xc3a8a5200>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0xc3a8a5200>
Warning message:
In dir.create(new.directory) :
  '/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0xc3a8a5200>
> rowMedians(tmp)
  [1]  0.0360233738 -0.0138507765 -0.0250585784  0.3069571221 -0.2149392772
  [6]  0.0908853156  0.1888003139 -0.2588251359  0.0697194257 -0.5600191364
 [11]  0.0623985204 -0.0310876006 -0.0892162968  0.2606595894  0.0321320670
 [16] -0.2137342445  0.0024566891 -0.1385688752  0.1595725622  0.2460160055
 [21]  0.6654466686 -0.0612450635  0.3942170806 -0.3751422622 -0.3933458625
 [26]  0.3457336867 -0.0201271222  0.2046138188 -0.1336382365  0.1232917690
 [31]  0.1792085278  0.1730737035 -0.0656742528  0.0955526777  0.1439390340
 [36] -0.1138504483  0.0522446077  0.5945477692 -0.1922465242  0.2370565609
 [41] -0.0193946960  0.2379736396  0.6774757839  0.0526863954 -0.5617967739
 [46]  0.5421561420  0.5942143032  0.2429333673 -0.7371124689 -0.0154897614
 [51]  0.3015197408  0.1672803587 -0.0946270307  0.1605251573 -0.3992048710
 [56]  0.1102764949 -0.2900064746  0.0071776766 -0.4994264153  0.2387398946
 [61] -0.2427637146 -0.0058070201 -0.4387501347 -0.0221814924 -0.3241736378
 [66] -0.3500104801 -0.5254400374  0.1280877984  0.0910751429  0.2572550245
 [71]  0.3423437858 -0.1156780768 -0.5928009386 -0.1118601203  0.3681720465
 [76] -0.2148385381 -0.2566041003 -0.3242811826 -0.2941622113  0.5566543227
 [81]  0.4449511422 -0.4865261910 -0.4957979561  0.1481049828  0.1178755577
 [86]  0.1516612289 -0.1067790790  0.6787840128  0.1136201325  0.8584010962
 [91] -0.4116617588  0.0812073773 -0.1949442361 -0.3606277024 -0.0908444214
 [96] -0.8095473221 -0.2610162519 -0.1021630435 -0.1611581487 -0.3706553966
[101] -0.2370225841 -0.2323656860 -0.3376613844 -0.0238970309 -0.4201386623
[106]  0.6576248241 -0.1662059335 -0.0339531827  0.0009008526  0.4765418496
[111] -0.3701949998 -0.1017198959 -0.4389720072 -0.7050894393 -0.2853566012
[116]  0.1455362347  0.0134282556 -0.0275176064  0.0576394238 -0.2829722870
[121]  0.3252057429  0.1777938619  0.2836984400  0.6899415283 -0.0647310839
[126]  0.0814510272 -0.3590272972  0.0323481820 -0.3577991924 -0.2386916767
[131]  0.3644339465  0.2501535773 -0.1749567989 -0.2394663486 -0.1089546012
[136]  0.5426069164 -0.1243375444  0.0340535188  0.2820588300 -0.6451553272
[141] -0.4846834127 -0.1572082068  0.4347859587 -0.4568594613  0.0391832856
[146]  0.7403613278  0.2395158917 -0.1819373463  0.5014965330 -0.3560010598
[151]  0.1139295555 -0.0236312031 -0.2823496160 -0.1479048269 -0.3673176213
[156] -0.1607650797 -0.1015062596 -0.3004520714 -0.4778804863  0.0488947547
[161]  0.2143133301  0.1062977902  0.3237689288  0.2896136031 -0.3829582865
[166] -0.4464242482  0.0834024819 -0.3015655053 -0.1497610197 -0.1862127819
[171] -0.1483799200 -0.3808156394  0.6824967930 -0.0698829613  0.4366595225
[176] -0.0443865761  0.2744561217  0.0444605267  0.1659684368  0.1204355433
[181] -0.2218513524  0.1940496831 -0.0136680566  0.0294430832 -0.2849960499
[186]  0.5967577981  0.0369112232  0.1386160815 -0.3948430324 -0.8719957240
[191]  0.0298114451 -0.0651654766  0.6349926235  0.1769913994 -0.1952799665
[196] -0.1916828882  0.0137347811  0.3163749035 -0.2474729677  0.1007833665
[201] -0.1037999639 -0.0035838061 -0.0065074141  0.1186212995  0.4482921491
[206]  0.4212155991 -0.2599921252 -0.1295136967  0.4070882077  0.0788720757
[211] -0.3434498873  0.0516416969  0.3950229444 -0.5648091865 -0.3424317515
[216] -0.0675960717 -0.1406629754 -0.0342868450  0.3809386068  0.1158318684
[221]  0.4508230301  0.3188216629 -0.3694353778  0.2824130074 -0.1043836025
[226]  0.4481538850  0.4003989499 -0.1340280103 -0.2522665502  0.4769100054
> 
> proc.time()
   user  system elapsed 
  0.726   4.819   5.641 

BufferedMatrix.Rcheck/tests/rawCalltesting.Rout


R version 4.6.0 Patched (2026-04-24 r89963) -- "Because it was There"
Copyright (C) 2026 The R Foundation for Statistical Computing
Platform: aarch64-apple-darwin23

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

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

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

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

Attaching package: 'BufferedMatrix'

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

    colMeans, colSums, rowMeans, rowSums

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

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

<pointer: 0x80f000000>
> .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: 0x80f000000>
> .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: 0x80f000000>
> .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: 0x80f000000>
> 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: 0x80f000060>
> .Call("R_bm_AddColumn",P)
<pointer: 0x80f000060>
> .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: 0x80f000060>
> .Call("R_bm_AddColumn",P)
<pointer: 0x80f000060>
> .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: 0x80f000060>
> 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: 0x80f000480>
> .Call("R_bm_AddColumn",P)
<pointer: 0x80f000480>
> .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: 0x80f000480>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x80f000480>
> .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: 0x80f000480>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x80f000480>
> .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: 0x80f000480>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x80f000480>
> .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: 0x80f000480>
> 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: 0x80f0005a0>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x80f0005a0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x80f0005a0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x80f0005a0>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile183722c0452b6" "BufferedMatrixFile18372f20b3ec" 
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile183722c0452b6" "BufferedMatrixFile18372f20b3ec" 
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x80f0006c0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x80f0006c0>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x80f0006c0>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x80f0006c0>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x80f0006c0>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x80f0006c0>
> .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: 0x80f000840>
> .Call("R_bm_AddColumn",P)
<pointer: 0x80f000840>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x80f000840>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x80f000840>
> 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: 0x80f000960>
> .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: 0x80f000960>
> rm(P)
> 
> proc.time()
   user  system elapsed 
  0.119   0.050   0.163 

BufferedMatrix.Rcheck/tests/Rcodetesting.Rout


R version 4.6.0 Patched (2026-04-24 r89963) -- "Because it was There"
Copyright (C) 2026 The R Foundation for Statistical Computing
Platform: aarch64-apple-darwin23

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

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

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

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

Attaching package: 'BufferedMatrix'

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

    colMeans, colSums, rowMeans, rowSums

> 
> Temp <- createBufferedMatrix(100)
> dim(Temp)
[1] 100   0
> buffer.dim(Temp)
[1] 1 1
> 
> 
> proc.time()
   user  system elapsed 
  0.120   0.033   0.146 

Example timings