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

This page was generated on 2025-11-11 12:03 -0500 (Tue, 11 Nov 2025).

HostnameOSArch (*)R versionInstalled pkgs
nebbiolo2Linux (Ubuntu 24.04.3 LTS)x86_644.5.1 Patched (2025-08-23 r88802) -- "Great Square Root" 4902
kjohnson3macOS 13.7.7 Venturaarm644.5.1 Patched (2025-09-10 r88807) -- "Great Square Root" 4638
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 257/2361HostnameOS / ArchINSTALLBUILDCHECKBUILD BIN
BufferedMatrix 1.74.0  (landing page)
Ben Bolstad
Snapshot Date: 2025-11-10 13:45 -0500 (Mon, 10 Nov 2025)
git_url: https://git.bioconductor.org/packages/BufferedMatrix
git_branch: RELEASE_3_22
git_last_commit: d2ce144
git_last_commit_date: 2025-10-29 09:58:55 -0500 (Wed, 29 Oct 2025)
nebbiolo2Linux (Ubuntu 24.04.3 LTS) / x86_64  OK    OK    OK  UNNEEDED, same version is already published
kjohnson3macOS 13.7.7 Ventura / arm64  OK    OK    WARNINGS    OK  UNNEEDED, same version is already published


CHECK results for BufferedMatrix on kjohnson3

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

raw results


Summary

Package: BufferedMatrix
Version: 1.74.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.74.0.tar.gz
StartedAt: 2025-11-10 19:03:35 -0500 (Mon, 10 Nov 2025)
EndedAt: 2025-11-10 19:03:52 -0500 (Mon, 10 Nov 2025)
EllapsedTime: 16.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.74.0.tar.gz
###
##############################################################################
##############################################################################


* using log directory ‘/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck’
* using R version 4.5.1 Patched (2025-09-10 r88807)
* using platform: aarch64-apple-darwin20
* R was compiled by
    Apple clang version 16.0.0 (clang-1600.0.26.6)
    GNU Fortran (GCC) 14.2.0
* running under: macOS Ventura 13.7.7
* using session charset: UTF-8
* using option ‘--no-vignettes’
* checking for file ‘BufferedMatrix/DESCRIPTION’ ... OK
* this is package ‘BufferedMatrix’ version ‘1.74.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.22-bioc/meat/BufferedMatrix.Rcheck/00install.out’ for details.
* used C compiler: ‘Apple clang version 15.0.0 (clang-1500.1.0.2.5)’
* used SDK: ‘MacOSX11.3.1.sdk’
* checking installed package size ... OK
* checking package directory ... OK
* checking ‘build’ directory ... OK
* checking DESCRIPTION meta-information ... OK
* checking top-level files ... OK
* checking for left-over files ... OK
* checking index information ... OK
* checking package subdirectories ... OK
* checking code files for non-ASCII characters ... OK
* checking R files for syntax errors ... OK
* checking whether the package can be loaded ... OK
* checking whether the package can be loaded with stated dependencies ... OK
* checking whether the package can be unloaded cleanly ... OK
* checking whether the namespace can be loaded with stated dependencies ... OK
* checking whether the namespace can be unloaded cleanly ... OK
* checking dependencies in R code ... OK
* checking S3 generic/method consistency ... OK
* checking replacement functions ... OK
* checking foreign function calls ... OK
* checking R code for possible problems ... OK
* checking Rd files ... NOTE
checkRd: (-1) BufferedMatrix-class.Rd:209: Lost braces; missing escapes or markup?
   209 |     $x^{power}$ elementwise of the matrix
       |        ^
prepare_Rd: createBufferedMatrix.Rd:26: Dropping empty section \keyword
prepare_Rd: createBufferedMatrix.Rd:17-18: Dropping empty section \details
prepare_Rd: createBufferedMatrix.Rd:15-16: Dropping empty section \value
prepare_Rd: createBufferedMatrix.Rd:19-20: Dropping empty section \references
prepare_Rd: createBufferedMatrix.Rd:21-22: Dropping empty section \seealso
prepare_Rd: createBufferedMatrix.Rd:23-24: Dropping empty section \examples
* checking Rd metadata ... OK
* checking Rd cross-references ... OK
* checking for missing documentation entries ... OK
* checking for code/documentation mismatches ... OK
* checking Rd \usage sections ... OK
* checking Rd contents ... OK
* checking for unstated dependencies in examples ... OK
* checking line endings in C/C++/Fortran sources/headers ... OK
* checking compiled code ... NOTE
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, 2 NOTEs
See
  ‘/Users/biocbuild/bbs-3.22-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.5-arm64/Resources/library’
* installing *source* package ‘BufferedMatrix’ ...
** this is package ‘BufferedMatrix’ version ‘1.74.0’
** using staged installation
** libs
using C compiler: ‘Apple clang version 15.0.0 (clang-1500.1.0.2.5)’
using SDK: ‘MacOSX11.3.1.sdk’
clang -arch arm64 -std=gnu2x -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/opt/R/arm64/include    -fPIC  -falign-functions=64 -Wall -g -O2  -c RBufferedMatrix.c -o RBufferedMatrix.o
clang -arch arm64 -std=gnu2x -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/opt/R/arm64/include    -fPIC  -falign-functions=64 -Wall -g -O2  -c doubleBufferedMatrix.c -o doubleBufferedMatrix.o
doubleBufferedMatrix.c:1580:7: warning: logical not is only applied to the left hand side of this bitwise operator [-Wlogical-not-parentheses]
  if (!(Matrix->readonly) & setting){
      ^                   ~
doubleBufferedMatrix.c:1580:7: note: add parentheses after the '!' to evaluate the bitwise operator first
  if (!(Matrix->readonly) & setting){
      ^
       (                           )
doubleBufferedMatrix.c:1580:7: note: add parentheses around left hand side expression to silence this warning
  if (!(Matrix->readonly) & setting){
      ^
      (                  )
doubleBufferedMatrix.c:3327:12: warning: unused function 'sort_double' [-Wunused-function]
static int sort_double(const double *a1,const double *a2){
           ^
2 warnings generated.
clang -arch arm64 -std=gnu2x -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/opt/R/arm64/include    -fPIC  -falign-functions=64 -Wall -g -O2  -c doubleBufferedMatrix_C_tests.c -o doubleBufferedMatrix_C_tests.o
clang -arch arm64 -std=gnu2x -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/opt/R/arm64/include    -fPIC  -falign-functions=64 -Wall -g -O2  -c init_package.c -o init_package.o
clang -arch arm64 -std=gnu2x -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -L/Library/Frameworks/R.framework/Resources/lib -L/opt/R/arm64/lib -o BufferedMatrix.so RBufferedMatrix.o doubleBufferedMatrix.o doubleBufferedMatrix_C_tests.o init_package.o -F/Library/Frameworks/R.framework/.. -framework R
installing to /Library/Frameworks/R.framework/Versions/4.5-arm64/Resources/library/00LOCK-BufferedMatrix/00new/BufferedMatrix/libs
** R
** inst
** byte-compile and prepare package for lazy loading
Creating a new generic function for ‘rowMeans’ in package ‘BufferedMatrix’
Creating a new generic function for ‘rowSums’ in package ‘BufferedMatrix’
Creating a new generic function for ‘colMeans’ in package ‘BufferedMatrix’
Creating a new generic function for ‘colSums’ in package ‘BufferedMatrix’
Creating a generic function for ‘ncol’ from package ‘base’ in package ‘BufferedMatrix’
Creating a generic function for ‘nrow’ from package ‘base’ in package ‘BufferedMatrix’
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
** checking absolute paths in shared objects and dynamic libraries
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (BufferedMatrix)

Tests output

BufferedMatrix.Rcheck/tests/c_code_level_tests.Rout


R version 4.5.1 Patched (2025-09-10 r88807) -- "Great Square Root"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: aarch64-apple-darwin20

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

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

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

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

Attaching package: 'BufferedMatrix'

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

    colMeans, colSums, rowMeans, rowSums

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

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

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

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

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

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

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

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

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

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

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

[[1]]
[1] 0

> 
> proc.time()
   user  system elapsed 
  0.109   0.036   0.148 

BufferedMatrix.Rcheck/tests/objectTesting.Rout


R version 4.5.1 Patched (2025-09-10 r88807) -- "Great Square Root"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: aarch64-apple-darwin20

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

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

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

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

Attaching package: 'BufferedMatrix'

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

    colMeans, colSums, rowMeans, rowSums

> 
> 
> ### this is used to control how many repetitions in something below
> ### higher values result in more checks.
> nreps <-100 ##20000
> 
> 
> ## test creation and some simple assignments and subsetting operations
> 
> ## first on single elements
> tmp <- createBufferedMatrix(1000,10)
> 
> tmp[10,5]
[1] 0
> tmp[10,5] <- 10
> tmp[10,5]
[1] 10
> tmp[10,5] <- 12.445
> tmp[10,5]
[1] 12.445
> 
> 
> 
> ## now testing accessing multiple elements
> tmp2 <- createBufferedMatrix(10,20)
> 
> 
> tmp2[3,1] <- 51.34
> tmp2[9,2] <- 9.87654
> tmp2[,1:2]
       [,1]    [,2]
 [1,]  0.00 0.00000
 [2,]  0.00 0.00000
 [3,] 51.34 0.00000
 [4,]  0.00 0.00000
 [5,]  0.00 0.00000
 [6,]  0.00 0.00000
 [7,]  0.00 0.00000
 [8,]  0.00 0.00000
 [9,]  0.00 9.87654
[10,]  0.00 0.00000
> tmp2[,-(3:20)]
       [,1]    [,2]
 [1,]  0.00 0.00000
 [2,]  0.00 0.00000
 [3,] 51.34 0.00000
 [4,]  0.00 0.00000
 [5,]  0.00 0.00000
 [6,]  0.00 0.00000
 [7,]  0.00 0.00000
 [8,]  0.00 0.00000
 [9,]  0.00 9.87654
[10,]  0.00 0.00000
> tmp2[3,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
[1,] 51.34    0    0    0    0    0    0    0    0     0     0     0     0
     [,14] [,15] [,16] [,17] [,18] [,19] [,20]
[1,]     0     0     0     0     0     0     0
> tmp2[-3,]
      [,1]    [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [2,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [3,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [4,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [5,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [6,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [7,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [8,]    0 9.87654    0    0    0    0    0    0    0     0     0     0     0
 [9,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
      [,14] [,15] [,16] [,17] [,18] [,19] [,20]
 [1,]     0     0     0     0     0     0     0
 [2,]     0     0     0     0     0     0     0
 [3,]     0     0     0     0     0     0     0
 [4,]     0     0     0     0     0     0     0
 [5,]     0     0     0     0     0     0     0
 [6,]     0     0     0     0     0     0     0
 [7,]     0     0     0     0     0     0     0
 [8,]     0     0     0     0     0     0     0
 [9,]     0     0     0     0     0     0     0
> tmp2[2,1:3]
     [,1] [,2] [,3]
[1,]    0    0    0
> tmp2[3:9,1:3]
      [,1]    [,2] [,3]
[1,] 51.34 0.00000    0
[2,]  0.00 0.00000    0
[3,]  0.00 0.00000    0
[4,]  0.00 0.00000    0
[5,]  0.00 0.00000    0
[6,]  0.00 0.00000    0
[7,]  0.00 9.87654    0
> tmp2[-4,-4]
       [,1]    [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [2,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [3,] 51.34 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [4,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [5,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [6,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [7,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [8,]  0.00 9.87654    0    0    0    0    0    0    0     0     0     0     0
 [9,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
      [,14] [,15] [,16] [,17] [,18] [,19]
 [1,]     0     0     0     0     0     0
 [2,]     0     0     0     0     0     0
 [3,]     0     0     0     0     0     0
 [4,]     0     0     0     0     0     0
 [5,]     0     0     0     0     0     0
 [6,]     0     0     0     0     0     0
 [7,]     0     0     0     0     0     0
 [8,]     0     0     0     0     0     0
 [9,]     0     0     0     0     0     0
> 
> ## now testing accessing/assigning multiple elements
> tmp3 <- createBufferedMatrix(10,10)
> 
> for (i in 1:10){
+   for (j in 1:10){
+     tmp3[i,j] <- (j-1)*10 + i
+   }
+ }
> 
> tmp3[2:4,2:4]
     [,1] [,2] [,3]
[1,]   12   22   32
[2,]   13   23   33
[3,]   14   24   34
> tmp3[c(-10),c(2:4,2:4,10,1,2,1:10,10:1)]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]   11   21   31   11   21   31   91    1   11     1    11    21    31
 [2,]   12   22   32   12   22   32   92    2   12     2    12    22    32
 [3,]   13   23   33   13   23   33   93    3   13     3    13    23    33
 [4,]   14   24   34   14   24   34   94    4   14     4    14    24    34
 [5,]   15   25   35   15   25   35   95    5   15     5    15    25    35
 [6,]   16   26   36   16   26   36   96    6   16     6    16    26    36
 [7,]   17   27   37   17   27   37   97    7   17     7    17    27    37
 [8,]   18   28   38   18   28   38   98    8   18     8    18    28    38
 [9,]   19   29   39   19   29   39   99    9   19     9    19    29    39
      [,14] [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24] [,25]
 [1,]    41    51    61    71    81    91    91    81    71    61    51    41
 [2,]    42    52    62    72    82    92    92    82    72    62    52    42
 [3,]    43    53    63    73    83    93    93    83    73    63    53    43
 [4,]    44    54    64    74    84    94    94    84    74    64    54    44
 [5,]    45    55    65    75    85    95    95    85    75    65    55    45
 [6,]    46    56    66    76    86    96    96    86    76    66    56    46
 [7,]    47    57    67    77    87    97    97    87    77    67    57    47
 [8,]    48    58    68    78    88    98    98    88    78    68    58    48
 [9,]    49    59    69    79    89    99    99    89    79    69    59    49
      [,26] [,27] [,28] [,29]
 [1,]    31    21    11     1
 [2,]    32    22    12     2
 [3,]    33    23    13     3
 [4,]    34    24    14     4
 [5,]    35    25    15     5
 [6,]    36    26    16     6
 [7,]    37    27    17     7
 [8,]    38    28    18     8
 [9,]    39    29    19     9
> tmp3[-c(1:5),-c(6:10)]
     [,1] [,2] [,3] [,4] [,5]
[1,]    6   16   26   36   46
[2,]    7   17   27   37   47
[3,]    8   18   28   38   48
[4,]    9   19   29   39   49
[5,]   10   20   30   40   50
> 
> ## assignment of whole columns
> tmp3[,1] <- c(1:10*100.0)
> tmp3[,1:2] <- tmp3[,1:2]*100
> tmp3[,1:2] <- tmp3[,2:1]
> tmp3[,1:2]
      [,1]  [,2]
 [1,] 1100 1e+04
 [2,] 1200 2e+04
 [3,] 1300 3e+04
 [4,] 1400 4e+04
 [5,] 1500 5e+04
 [6,] 1600 6e+04
 [7,] 1700 7e+04
 [8,] 1800 8e+04
 [9,] 1900 9e+04
[10,] 2000 1e+05
> 
> 
> tmp3[,-1] <- tmp3[,1:9]
> tmp3[,1:10]
      [,1] [,2]  [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,] 1100 1100 1e+04   21   31   41   51   61   71    81
 [2,] 1200 1200 2e+04   22   32   42   52   62   72    82
 [3,] 1300 1300 3e+04   23   33   43   53   63   73    83
 [4,] 1400 1400 4e+04   24   34   44   54   64   74    84
 [5,] 1500 1500 5e+04   25   35   45   55   65   75    85
 [6,] 1600 1600 6e+04   26   36   46   56   66   76    86
 [7,] 1700 1700 7e+04   27   37   47   57   67   77    87
 [8,] 1800 1800 8e+04   28   38   48   58   68   78    88
 [9,] 1900 1900 9e+04   29   39   49   59   69   79    89
[10,] 2000 2000 1e+05   30   40   50   60   70   80    90
> 
> tmp3[,1:2] <- rep(1,10)
> tmp3[,1:2] <- rep(1,20)
> tmp3[,1:2] <- matrix(c(1:5),1,5)
> 
> tmp3[,-c(1:8)] <- matrix(c(1:5),1,5)
> 
> tmp3[1,] <- 1:10
> tmp3[1,]
     [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,]    1    2    3    4    5    6    7    8    9    10
> tmp3[-1,] <- c(1,2)
> tmp3[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    1    2    3    4    5    6    7    8    9    10
 [2,]    1    2    1    2    1    2    1    2    1     2
 [3,]    2    1    2    1    2    1    2    1    2     1
 [4,]    1    2    1    2    1    2    1    2    1     2
 [5,]    2    1    2    1    2    1    2    1    2     1
 [6,]    1    2    1    2    1    2    1    2    1     2
 [7,]    2    1    2    1    2    1    2    1    2     1
 [8,]    1    2    1    2    1    2    1    2    1     2
 [9,]    2    1    2    1    2    1    2    1    2     1
[10,]    1    2    1    2    1    2    1    2    1     2
> tmp3[-c(1:8),] <- matrix(c(1:5),1,5)
> tmp3[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    1    2    3    4    5    6    7    8    9    10
 [2,]    1    2    1    2    1    2    1    2    1     2
 [3,]    2    1    2    1    2    1    2    1    2     1
 [4,]    1    2    1    2    1    2    1    2    1     2
 [5,]    2    1    2    1    2    1    2    1    2     1
 [6,]    1    2    1    2    1    2    1    2    1     2
 [7,]    2    1    2    1    2    1    2    1    2     1
 [8,]    1    2    1    2    1    2    1    2    1     2
 [9,]    1    3    5    2    4    1    3    5    2     4
[10,]    2    4    1    3    5    2    4    1    3     5
> 
> 
> tmp3[1:2,1:2] <- 5555.04
> tmp3[-(1:2),1:2] <- 1234.56789
> 
> 
> 
> ## testing accessors for the directory and prefix
> directory(tmp3)
[1] "/Users/biocbuild/bbs-3.22-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 480828 25.7    1056614 56.5         NA   634360 33.9
Vcells 891019  6.8    8388608 64.0     196608  2109493 16.1
> 
> 
> 
> 
> ##
> ## 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] "Mon Nov 10 19:03:44 2025"
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> date()
[1] "Mon Nov 10 19:03:44 2025"
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,which.col] == test.matrix[which.row,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> 
> 
> RowMode(tmp2)
<pointer: 0x6000035c80c0>
> 
> 
> 
> 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] "Mon Nov 10 19:03:45 2025"
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col <- sample(1:20,5,replace=TRUE)
+   if (!all(tmp2[which.row,which.col] == test.matrix[which.row,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> date()
[1] "Mon Nov 10 19:03:46 2025"
> 
> ColMode(tmp2)
<pointer: 0x6000035c80c0>
> 
> 
> 
> ### 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.1246879  1.7654056  0.6811077 -1.382787
[2,]  -0.5870358 -0.9765529  0.4172592 -2.451051
[3,]  -0.5475985 -2.8218285  1.9728476 -1.395394
[4,]   2.1113646 -0.5230369 -0.6449881  1.018216
> ewApply(tmp5,abs)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
            [,1]      [,2]      [,3]     [,4]
[1,] 101.1246879 1.7654056 0.6811077 1.382787
[2,]   0.5870358 0.9765529 0.4172592 2.451051
[3,]   0.5475985 2.8218285 1.9728476 1.395394
[4,]   2.1113646 0.5230369 0.6449881 1.018216
> ewApply(tmp5,sqrt)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
           [,1]      [,2]      [,3]     [,4]
[1,] 10.0560772 1.3286857 0.8252925 1.175920
[2,]  0.7661826 0.9882069 0.6459560 1.565583
[3,]  0.7399990 1.6798299 1.4045809 1.181268
[4,]  1.4530535 0.7232129 0.8031115 1.009067
> 
> 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.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
          [,1]     [,2]     [,3]     [,4]
[1,] 226.68546 40.05226 33.93403 38.14199
[2,]  33.24886 35.85862 31.87682 43.10688
[3,]  32.94759 44.62013 41.01866 38.20807
[4,]  41.64190 32.75517 33.67610 36.10888
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x6000035c8120>
> exp(tmp5)
<pointer: 0x6000035c8120>
> log(tmp5,2)
<pointer: 0x6000035c8120>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 471.8161
> Min(tmp5)
[1] 52.61702
> mean(tmp5)
[1] 73.07037
> Sum(tmp5)
[1] 14614.07
> Var(tmp5)
[1] 883.1421
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 90.57201 70.77566 71.52533 73.52774 71.56524 72.90456 71.02088 71.03092
 [9] 69.13247 68.64891
> rowSums(tmp5)
 [1] 1811.440 1415.513 1430.507 1470.555 1431.305 1458.091 1420.418 1420.618
 [9] 1382.649 1372.978
> rowVars(tmp5)
 [1] 8103.01072   85.33108  131.68136  106.69430   97.92078   91.98493
 [7]   55.03607   78.53602   76.83772   43.89876
> rowSd(tmp5)
 [1] 90.016725  9.237482 11.475250 10.329293  9.895493  9.590877  7.418630
 [8]  8.862055  8.765712  6.625614
> rowMax(tmp5)
 [1] 471.81608  89.72133  92.87095  98.92148  93.97369  93.39609  81.21436
 [8]  81.26180  94.07936  81.68429
> rowMin(tmp5)
 [1] 56.71894 53.29524 54.51449 56.21309 55.54392 56.38443 56.64053 52.61702
 [9] 54.88519 53.77206
> 
> colMeans(tmp5)
 [1] 115.37987  70.31566  70.93180  75.75157  75.24997  67.94856  73.15363
 [8]  67.98271  68.25672  70.19027  74.83669  72.22095  68.78712  72.83889
[15]  67.56159  64.15615  70.54599  68.63093  75.73083  70.93756
> colSums(tmp5)
 [1] 1153.7987  703.1566  709.3180  757.5157  752.4997  679.4856  731.5363
 [8]  679.8271  682.5672  701.9027  748.3669  722.2095  687.8712  728.3889
[15]  675.6159  641.5615  705.4599  686.3093  757.3083  709.3756
> colVars(tmp5)
 [1] 15778.27054   143.36036    46.96803    74.50411   117.99538    93.94187
 [7]    62.67761    47.89460    74.22249    49.95735    61.80124    43.65371
[13]    54.11620   103.12546    73.35226    33.62314   153.02764    28.73086
[19]   126.27893    62.47853
> colSd(tmp5)
 [1] 125.611586  11.973319   6.853323   8.631576  10.862568   9.692362
 [7]   7.916919   6.920592   8.615248   7.068051   7.861377   6.607095
[13]   7.356371  10.155071   8.564593   5.798547  12.370434   5.360117
[19]  11.237390   7.904336
> colMax(tmp5)
 [1] 471.81608  92.87095  85.37496  89.72133  98.92148  81.68429  83.11981
 [8]  74.82624  78.62130  79.57895  83.27176  81.74788  79.57124  85.78910
[15]  80.51745  73.92047  94.07936  79.98577  93.97369  83.60731
> colMin(tmp5)
 [1] 58.45079 56.64053 62.48977 61.07421 62.12343 53.29524 54.88519 56.21309
 [9] 54.51449 60.14389 60.90584 62.58420 58.09118 52.61702 53.77206 55.54392
[17] 56.38443 59.62313 59.75442 58.89463
> 
> 
> ### setting a random element to NA and then testing with na.rm=TRUE or na.rm=FALSE (The default)
> 
> 
> which.row <- sample(1:10,1,replace=TRUE)
> which.col  <- sample(1:20,1,replace=TRUE)
> 
> tmp5[which.row,which.col] <- NA
> 
> Max(tmp5)
[1] NA
> Min(tmp5)
[1] NA
> mean(tmp5)
[1] NA
> Sum(tmp5)
[1] NA
> Var(tmp5)
[1] NA
> 
> rowMeans(tmp5)
 [1] 90.57201       NA 71.52533 73.52774 71.56524 72.90456 71.02088 71.03092
 [9] 69.13247 68.64891
> rowSums(tmp5)
 [1] 1811.440       NA 1430.507 1470.555 1431.305 1458.091 1420.418 1420.618
 [9] 1382.649 1372.978
> rowVars(tmp5)
 [1] 8103.01072   83.74971  131.68136  106.69430   97.92078   91.98493
 [7]   55.03607   78.53602   76.83772   43.89876
> rowSd(tmp5)
 [1] 90.016725  9.151487 11.475250 10.329293  9.895493  9.590877  7.418630
 [8]  8.862055  8.765712  6.625614
> rowMax(tmp5)
 [1] 471.81608        NA  92.87095  98.92148  93.97369  93.39609  81.21436
 [8]  81.26180  94.07936  81.68429
> rowMin(tmp5)
 [1] 56.71894       NA 54.51449 56.21309 55.54392 56.38443 56.64053 52.61702
 [9] 54.88519 53.77206
> 
> colMeans(tmp5)
 [1] 115.37987  70.31566  70.93180  75.75157  75.24997  67.94856  73.15363
 [8]  67.98271  68.25672  70.19027  74.83669  72.22095  68.78712  72.83889
[15]  67.56159  64.15615        NA  68.63093  75.73083  70.93756
> colSums(tmp5)
 [1] 1153.7987  703.1566  709.3180  757.5157  752.4997  679.4856  731.5363
 [8]  679.8271  682.5672  701.9027  748.3669  722.2095  687.8712  728.3889
[15]  675.6159  641.5615        NA  686.3093  757.3083  709.3756
> colVars(tmp5)
 [1] 15778.27054   143.36036    46.96803    74.50411   117.99538    93.94187
 [7]    62.67761    47.89460    74.22249    49.95735    61.80124    43.65371
[13]    54.11620   103.12546    73.35226    33.62314          NA    28.73086
[19]   126.27893    62.47853
> colSd(tmp5)
 [1] 125.611586  11.973319   6.853323   8.631576  10.862568   9.692362
 [7]   7.916919   6.920592   8.615248   7.068051   7.861377   6.607095
[13]   7.356371  10.155071   8.564593   5.798547         NA   5.360117
[19]  11.237390   7.904336
> colMax(tmp5)
 [1] 471.81608  92.87095  85.37496  89.72133  98.92148  81.68429  83.11981
 [8]  74.82624  78.62130  79.57895  83.27176  81.74788  79.57124  85.78910
[15]  80.51745  73.92047        NA  79.98577  93.97369  83.60731
> colMin(tmp5)
 [1] 58.45079 56.64053 62.48977 61.07421 62.12343 53.29524 54.88519 56.21309
 [9] 54.51449 60.14389 60.90584 62.58420 58.09118 52.61702 53.77206 55.54392
[17]       NA 59.62313 59.75442 58.89463
> 
> Max(tmp5,na.rm=TRUE)
[1] 471.8161
> Min(tmp5,na.rm=TRUE)
[1] 52.61702
> mean(tmp5,na.rm=TRUE)
[1] 73.13415
> Sum(tmp5,na.rm=TRUE)
[1] 14553.7
> Var(tmp5,na.rm=TRUE)
[1] 886.7847
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 90.57201 71.32289 71.52533 73.52774 71.56524 72.90456 71.02088 71.03092
 [9] 69.13247 68.64891
> rowSums(tmp5,na.rm=TRUE)
 [1] 1811.440 1355.135 1430.507 1470.555 1431.305 1458.091 1420.418 1420.618
 [9] 1382.649 1372.978
> rowVars(tmp5,na.rm=TRUE)
 [1] 8103.01072   83.74971  131.68136  106.69430   97.92078   91.98493
 [7]   55.03607   78.53602   76.83772   43.89876
> rowSd(tmp5,na.rm=TRUE)
 [1] 90.016725  9.151487 11.475250 10.329293  9.895493  9.590877  7.418630
 [8]  8.862055  8.765712  6.625614
> rowMax(tmp5,na.rm=TRUE)
 [1] 471.81608  89.72133  92.87095  98.92148  93.97369  93.39609  81.21436
 [8]  81.26180  94.07936  81.68429
> rowMin(tmp5,na.rm=TRUE)
 [1] 56.71894 53.29524 54.51449 56.21309 55.54392 56.38443 56.64053 52.61702
 [9] 54.88519 53.77206
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 115.37987  70.31566  70.93180  75.75157  75.24997  67.94856  73.15363
 [8]  67.98271  68.25672  70.19027  74.83669  72.22095  68.78712  72.83889
[15]  67.56159  64.15615  71.67574  68.63093  75.73083  70.93756
> colSums(tmp5,na.rm=TRUE)
 [1] 1153.7987  703.1566  709.3180  757.5157  752.4997  679.4856  731.5363
 [8]  679.8271  682.5672  701.9027  748.3669  722.2095  687.8712  728.3889
[15]  675.6159  641.5615  645.0817  686.3093  757.3083  709.3756
> colVars(tmp5,na.rm=TRUE)
 [1] 15778.27054   143.36036    46.96803    74.50411   117.99538    93.94187
 [7]    62.67761    47.89460    74.22249    49.95735    61.80124    43.65371
[13]    54.11620   103.12546    73.35226    33.62314   157.79737    28.73086
[19]   126.27893    62.47853
> colSd(tmp5,na.rm=TRUE)
 [1] 125.611586  11.973319   6.853323   8.631576  10.862568   9.692362
 [7]   7.916919   6.920592   8.615248   7.068051   7.861377   6.607095
[13]   7.356371  10.155071   8.564593   5.798547  12.561742   5.360117
[19]  11.237390   7.904336
> colMax(tmp5,na.rm=TRUE)
 [1] 471.81608  92.87095  85.37496  89.72133  98.92148  81.68429  83.11981
 [8]  74.82624  78.62130  79.57895  83.27176  81.74788  79.57124  85.78910
[15]  80.51745  73.92047  94.07936  79.98577  93.97369  83.60731
> colMin(tmp5,na.rm=TRUE)
 [1] 58.45079 56.64053 62.48977 61.07421 62.12343 53.29524 54.88519 56.21309
 [9] 54.51449 60.14389 60.90584 62.58420 58.09118 52.61702 53.77206 55.54392
[17] 56.38443 59.62313 59.75442 58.89463
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1] 90.57201      NaN 71.52533 73.52774 71.56524 72.90456 71.02088 71.03092
 [9] 69.13247 68.64891
> rowSums(tmp5,na.rm=TRUE)
 [1] 1811.440    0.000 1430.507 1470.555 1431.305 1458.091 1420.418 1420.618
 [9] 1382.649 1372.978
> rowVars(tmp5,na.rm=TRUE)
 [1] 8103.01072         NA  131.68136  106.69430   97.92078   91.98493
 [7]   55.03607   78.53602   76.83772   43.89876
> rowSd(tmp5,na.rm=TRUE)
 [1] 90.016725        NA 11.475250 10.329293  9.895493  9.590877  7.418630
 [8]  8.862055  8.765712  6.625614
> rowMax(tmp5,na.rm=TRUE)
 [1] 471.81608        NA  92.87095  98.92148  93.97369  93.39609  81.21436
 [8]  81.26180  94.07936  81.68429
> rowMin(tmp5,na.rm=TRUE)
 [1] 56.71894       NA 54.51449 56.21309 55.54392 56.38443 56.64053 52.61702
 [9] 54.88519 53.77206
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1] 120.51061  69.83573  71.44117  74.19938  75.95465  69.57671  72.04628
 [8]  67.45082  69.42300  69.79162  74.49815  71.16240  68.73231  72.03688
[15]  67.42300  64.75164       NaN  68.94326  76.69190  70.36153
> colSums(tmp5,na.rm=TRUE)
 [1] 1084.5955  628.5216  642.9706  667.7944  683.5919  626.1904  648.4165
 [8]  607.0574  624.8070  628.1246  670.4834  640.4616  618.5908  648.3319
[15]  606.8070  582.7648    0.0000  620.4893  690.2271  633.2538
> colVars(tmp5,na.rm=TRUE)
 [1] 17454.40306   158.68917    49.92008    56.71239   127.15838    75.86240
 [7]    56.71722    50.69871    68.19775    54.41418    68.23709    36.50453
[13]    60.84693   108.77993    82.30522    33.83664          NA    31.22477
[19]   131.67255    66.55555
> colSd(tmp5,na.rm=TRUE)
 [1] 132.115113  12.597189   7.065414   7.530763  11.276452   8.709902
 [7]   7.531084   7.120302   8.258193   7.376597   8.260574   6.041898
[13]   7.800444  10.429762   9.072222   5.816927         NA   5.587913
[19]  11.474866   8.158159
> colMax(tmp5,na.rm=TRUE)
 [1] 471.81608  92.87095  85.37496  81.26180  98.92148  81.68429  81.21436
 [8]  74.82624  78.62130  79.57895  83.27176  78.83859  79.57124  85.78910
[15]  80.51745  73.92047      -Inf  79.98577  93.97369  83.60731
> colMin(tmp5,na.rm=TRUE)
 [1] 58.45079 56.64053 62.48977 61.07421 62.12343 56.71894 54.88519 56.21309
 [9] 54.51449 60.14389 60.90584 62.58420 58.09118 52.61702 53.77206 55.54392
[17]      Inf 59.62313 59.75442 58.89463
> 
> 
> 
> 
> 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] 170.04940 158.49410  95.22355 172.92414 306.19065 218.71173 324.25531
 [8] 301.93691 284.74435 169.74065
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 170.04940 158.49410  95.22355 172.92414 306.19065 218.71173 324.25531
 [8] 301.93691 284.74435 169.74065
> 
> 
> 
> 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]  0.000000e+00  1.136868e-13  0.000000e+00 -1.705303e-13 -2.842171e-14
 [6]  5.684342e-14  1.705303e-13  5.684342e-14 -2.842171e-14  8.526513e-14
[11]  2.842171e-14  5.684342e-14  3.979039e-13 -2.842171e-13  0.000000e+00
[16]  0.000000e+00 -1.136868e-13 -1.136868e-13  0.000000e+00  0.000000e+00
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> ## 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)
+ }
9   1 
3   1 
10   4 
4   5 
8   3 
9   15 
9   17 
1   20 
2   8 
4   14 
8   10 
6   17 
10   20 
7   4 
7   11 
7   7 
1   4 
1   7 
10   8 
3   1 
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.169247
> Min(tmp)
[1] -3.86989
> mean(tmp)
[1] -0.1116466
> Sum(tmp)
[1] -11.16466
> Var(tmp)
[1] 1.133965
> 
> rowMeans(tmp)
[1] -0.1116466
> rowSums(tmp)
[1] -11.16466
> rowVars(tmp)
[1] 1.133965
> rowSd(tmp)
[1] 1.064878
> rowMax(tmp)
[1] 2.169247
> rowMin(tmp)
[1] -3.86989
> 
> colMeans(tmp)
  [1]  0.84676046  0.13137870  1.25130005 -0.47105213 -0.35854531 -2.11047551
  [7]  0.03467971  0.60051296 -0.72334861  0.01236006 -1.24522015  0.06673188
 [13]  0.09652768 -0.15472099 -2.48497763  0.51536862 -3.86989004  0.51560900
 [19] -1.63677831  0.27029064 -0.64559561 -0.24776701 -1.11037262 -1.26340962
 [25] -1.31299310  1.20700168  1.88314417 -0.63214735  0.15960421  1.22028702
 [31]  0.38505511  0.42972264  0.57090060  0.92870607  0.41315835 -0.29415152
 [37]  0.23516790 -0.35799340  0.20188218  0.10755018  0.72909407  0.92970698
 [43] -0.34726411 -0.84844902  2.16924676 -1.75737517  0.32677707 -2.58773641
 [49] -0.57405874 -1.30073204  0.89043375  1.02415691 -0.06040200  0.04391361
 [55] -0.30782054 -0.93849481  0.13932967 -0.19231555  0.93750875  0.28005698
 [61] -0.79651413  1.61274350  0.86949882 -2.06394326 -1.86700323  0.16246534
 [67]  1.39448271  0.77889958 -0.17278844 -0.68976989 -1.06693668 -0.16069711
 [73]  0.38696701  1.21882582  0.53119999  1.22740443 -0.24234921 -0.51887960
 [79] -1.08936311  0.95643591  0.55565194 -0.54247791  1.39701733  0.16533767
 [85] -0.02614734 -1.14390983  1.18703527  0.10267792 -0.87617934 -1.66101361
 [91]  0.09542626  0.32306472 -1.31011490 -0.18352245 -0.87606774 -2.38471684
 [97]  0.32321500  1.90984090 -0.28371192 -0.12657827
> colSums(tmp)
  [1]  0.84676046  0.13137870  1.25130005 -0.47105213 -0.35854531 -2.11047551
  [7]  0.03467971  0.60051296 -0.72334861  0.01236006 -1.24522015  0.06673188
 [13]  0.09652768 -0.15472099 -2.48497763  0.51536862 -3.86989004  0.51560900
 [19] -1.63677831  0.27029064 -0.64559561 -0.24776701 -1.11037262 -1.26340962
 [25] -1.31299310  1.20700168  1.88314417 -0.63214735  0.15960421  1.22028702
 [31]  0.38505511  0.42972264  0.57090060  0.92870607  0.41315835 -0.29415152
 [37]  0.23516790 -0.35799340  0.20188218  0.10755018  0.72909407  0.92970698
 [43] -0.34726411 -0.84844902  2.16924676 -1.75737517  0.32677707 -2.58773641
 [49] -0.57405874 -1.30073204  0.89043375  1.02415691 -0.06040200  0.04391361
 [55] -0.30782054 -0.93849481  0.13932967 -0.19231555  0.93750875  0.28005698
 [61] -0.79651413  1.61274350  0.86949882 -2.06394326 -1.86700323  0.16246534
 [67]  1.39448271  0.77889958 -0.17278844 -0.68976989 -1.06693668 -0.16069711
 [73]  0.38696701  1.21882582  0.53119999  1.22740443 -0.24234921 -0.51887960
 [79] -1.08936311  0.95643591  0.55565194 -0.54247791  1.39701733  0.16533767
 [85] -0.02614734 -1.14390983  1.18703527  0.10267792 -0.87617934 -1.66101361
 [91]  0.09542626  0.32306472 -1.31011490 -0.18352245 -0.87606774 -2.38471684
 [97]  0.32321500  1.90984090 -0.28371192 -0.12657827
> colVars(tmp)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> colSd(tmp)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> colMax(tmp)
  [1]  0.84676046  0.13137870  1.25130005 -0.47105213 -0.35854531 -2.11047551
  [7]  0.03467971  0.60051296 -0.72334861  0.01236006 -1.24522015  0.06673188
 [13]  0.09652768 -0.15472099 -2.48497763  0.51536862 -3.86989004  0.51560900
 [19] -1.63677831  0.27029064 -0.64559561 -0.24776701 -1.11037262 -1.26340962
 [25] -1.31299310  1.20700168  1.88314417 -0.63214735  0.15960421  1.22028702
 [31]  0.38505511  0.42972264  0.57090060  0.92870607  0.41315835 -0.29415152
 [37]  0.23516790 -0.35799340  0.20188218  0.10755018  0.72909407  0.92970698
 [43] -0.34726411 -0.84844902  2.16924676 -1.75737517  0.32677707 -2.58773641
 [49] -0.57405874 -1.30073204  0.89043375  1.02415691 -0.06040200  0.04391361
 [55] -0.30782054 -0.93849481  0.13932967 -0.19231555  0.93750875  0.28005698
 [61] -0.79651413  1.61274350  0.86949882 -2.06394326 -1.86700323  0.16246534
 [67]  1.39448271  0.77889958 -0.17278844 -0.68976989 -1.06693668 -0.16069711
 [73]  0.38696701  1.21882582  0.53119999  1.22740443 -0.24234921 -0.51887960
 [79] -1.08936311  0.95643591  0.55565194 -0.54247791  1.39701733  0.16533767
 [85] -0.02614734 -1.14390983  1.18703527  0.10267792 -0.87617934 -1.66101361
 [91]  0.09542626  0.32306472 -1.31011490 -0.18352245 -0.87606774 -2.38471684
 [97]  0.32321500  1.90984090 -0.28371192 -0.12657827
> colMin(tmp)
  [1]  0.84676046  0.13137870  1.25130005 -0.47105213 -0.35854531 -2.11047551
  [7]  0.03467971  0.60051296 -0.72334861  0.01236006 -1.24522015  0.06673188
 [13]  0.09652768 -0.15472099 -2.48497763  0.51536862 -3.86989004  0.51560900
 [19] -1.63677831  0.27029064 -0.64559561 -0.24776701 -1.11037262 -1.26340962
 [25] -1.31299310  1.20700168  1.88314417 -0.63214735  0.15960421  1.22028702
 [31]  0.38505511  0.42972264  0.57090060  0.92870607  0.41315835 -0.29415152
 [37]  0.23516790 -0.35799340  0.20188218  0.10755018  0.72909407  0.92970698
 [43] -0.34726411 -0.84844902  2.16924676 -1.75737517  0.32677707 -2.58773641
 [49] -0.57405874 -1.30073204  0.89043375  1.02415691 -0.06040200  0.04391361
 [55] -0.30782054 -0.93849481  0.13932967 -0.19231555  0.93750875  0.28005698
 [61] -0.79651413  1.61274350  0.86949882 -2.06394326 -1.86700323  0.16246534
 [67]  1.39448271  0.77889958 -0.17278844 -0.68976989 -1.06693668 -0.16069711
 [73]  0.38696701  1.21882582  0.53119999  1.22740443 -0.24234921 -0.51887960
 [79] -1.08936311  0.95643591  0.55565194 -0.54247791  1.39701733  0.16533767
 [85] -0.02614734 -1.14390983  1.18703527  0.10267792 -0.87617934 -1.66101361
 [91]  0.09542626  0.32306472 -1.31011490 -0.18352245 -0.87606774 -2.38471684
 [97]  0.32321500  1.90984090 -0.28371192 -0.12657827
> colMedians(tmp)
  [1]  0.84676046  0.13137870  1.25130005 -0.47105213 -0.35854531 -2.11047551
  [7]  0.03467971  0.60051296 -0.72334861  0.01236006 -1.24522015  0.06673188
 [13]  0.09652768 -0.15472099 -2.48497763  0.51536862 -3.86989004  0.51560900
 [19] -1.63677831  0.27029064 -0.64559561 -0.24776701 -1.11037262 -1.26340962
 [25] -1.31299310  1.20700168  1.88314417 -0.63214735  0.15960421  1.22028702
 [31]  0.38505511  0.42972264  0.57090060  0.92870607  0.41315835 -0.29415152
 [37]  0.23516790 -0.35799340  0.20188218  0.10755018  0.72909407  0.92970698
 [43] -0.34726411 -0.84844902  2.16924676 -1.75737517  0.32677707 -2.58773641
 [49] -0.57405874 -1.30073204  0.89043375  1.02415691 -0.06040200  0.04391361
 [55] -0.30782054 -0.93849481  0.13932967 -0.19231555  0.93750875  0.28005698
 [61] -0.79651413  1.61274350  0.86949882 -2.06394326 -1.86700323  0.16246534
 [67]  1.39448271  0.77889958 -0.17278844 -0.68976989 -1.06693668 -0.16069711
 [73]  0.38696701  1.21882582  0.53119999  1.22740443 -0.24234921 -0.51887960
 [79] -1.08936311  0.95643591  0.55565194 -0.54247791  1.39701733  0.16533767
 [85] -0.02614734 -1.14390983  1.18703527  0.10267792 -0.87617934 -1.66101361
 [91]  0.09542626  0.32306472 -1.31011490 -0.18352245 -0.87606774 -2.38471684
 [97]  0.32321500  1.90984090 -0.28371192 -0.12657827
> colRanges(tmp)
          [,1]      [,2]   [,3]       [,4]       [,5]      [,6]       [,7]
[1,] 0.8467605 0.1313787 1.2513 -0.4710521 -0.3585453 -2.110476 0.03467971
[2,] 0.8467605 0.1313787 1.2513 -0.4710521 -0.3585453 -2.110476 0.03467971
         [,8]       [,9]      [,10]    [,11]      [,12]      [,13]     [,14]
[1,] 0.600513 -0.7233486 0.01236006 -1.24522 0.06673188 0.09652768 -0.154721
[2,] 0.600513 -0.7233486 0.01236006 -1.24522 0.06673188 0.09652768 -0.154721
         [,15]     [,16]    [,17]    [,18]     [,19]     [,20]      [,21]
[1,] -2.484978 0.5153686 -3.86989 0.515609 -1.636778 0.2702906 -0.6455956
[2,] -2.484978 0.5153686 -3.86989 0.515609 -1.636778 0.2702906 -0.6455956
         [,22]     [,23]    [,24]     [,25]    [,26]    [,27]      [,28]
[1,] -0.247767 -1.110373 -1.26341 -1.312993 1.207002 1.883144 -0.6321473
[2,] -0.247767 -1.110373 -1.26341 -1.312993 1.207002 1.883144 -0.6321473
         [,29]    [,30]     [,31]     [,32]     [,33]     [,34]     [,35]
[1,] 0.1596042 1.220287 0.3850551 0.4297226 0.5709006 0.9287061 0.4131583
[2,] 0.1596042 1.220287 0.3850551 0.4297226 0.5709006 0.9287061 0.4131583
          [,36]     [,37]      [,38]     [,39]     [,40]     [,41]    [,42]
[1,] -0.2941515 0.2351679 -0.3579934 0.2018822 0.1075502 0.7290941 0.929707
[2,] -0.2941515 0.2351679 -0.3579934 0.2018822 0.1075502 0.7290941 0.929707
          [,43]     [,44]    [,45]     [,46]     [,47]     [,48]      [,49]
[1,] -0.3472641 -0.848449 2.169247 -1.757375 0.3267771 -2.587736 -0.5740587
[2,] -0.3472641 -0.848449 2.169247 -1.757375 0.3267771 -2.587736 -0.5740587
         [,50]     [,51]    [,52]     [,53]      [,54]      [,55]      [,56]
[1,] -1.300732 0.8904338 1.024157 -0.060402 0.04391361 -0.3078205 -0.9384948
[2,] -1.300732 0.8904338 1.024157 -0.060402 0.04391361 -0.3078205 -0.9384948
         [,57]      [,58]     [,59]    [,60]      [,61]    [,62]     [,63]
[1,] 0.1393297 -0.1923156 0.9375088 0.280057 -0.7965141 1.612744 0.8694988
[2,] 0.1393297 -0.1923156 0.9375088 0.280057 -0.7965141 1.612744 0.8694988
         [,64]     [,65]     [,66]    [,67]     [,68]      [,69]      [,70]
[1,] -2.063943 -1.867003 0.1624653 1.394483 0.7788996 -0.1727884 -0.6897699
[2,] -2.063943 -1.867003 0.1624653 1.394483 0.7788996 -0.1727884 -0.6897699
         [,71]      [,72]    [,73]    [,74]  [,75]    [,76]      [,77]
[1,] -1.066937 -0.1606971 0.386967 1.218826 0.5312 1.227404 -0.2423492
[2,] -1.066937 -0.1606971 0.386967 1.218826 0.5312 1.227404 -0.2423492
          [,78]     [,79]     [,80]     [,81]      [,82]    [,83]     [,84]
[1,] -0.5188796 -1.089363 0.9564359 0.5556519 -0.5424779 1.397017 0.1653377
[2,] -0.5188796 -1.089363 0.9564359 0.5556519 -0.5424779 1.397017 0.1653377
           [,85]    [,86]    [,87]     [,88]      [,89]     [,90]      [,91]
[1,] -0.02614734 -1.14391 1.187035 0.1026779 -0.8761793 -1.661014 0.09542626
[2,] -0.02614734 -1.14391 1.187035 0.1026779 -0.8761793 -1.661014 0.09542626
         [,92]     [,93]      [,94]      [,95]     [,96]    [,97]    [,98]
[1,] 0.3230647 -1.310115 -0.1835224 -0.8760677 -2.384717 0.323215 1.909841
[2,] 0.3230647 -1.310115 -0.1835224 -0.8760677 -2.384717 0.323215 1.909841
          [,99]     [,100]
[1,] -0.2837119 -0.1265783
[2,] -0.2837119 -0.1265783
> 
> 
> Max(tmp2)
[1] 2.549296
> Min(tmp2)
[1] -1.928099
> mean(tmp2)
[1] 0.1420893
> Sum(tmp2)
[1] 14.20893
> Var(tmp2)
[1] 0.889906
> 
> rowMeans(tmp2)
  [1] -1.219333348 -0.294084326 -0.635530984  0.221130008 -0.776175541
  [6]  0.029652001  0.782665777  0.942963746  0.135536293  0.026550698
 [11]  0.855782068  0.006188576  0.515807404 -0.409054381  0.633201529
 [16]  0.912724572  1.760458669 -0.288677882  2.426158060 -0.157546981
 [21] -0.199825161 -0.954161855 -0.233106462 -1.336235693  0.671323704
 [26] -0.578891632 -0.209157034  0.672403696  0.890346975  0.745442906
 [31]  1.109709560 -1.015712652  0.708656011  0.992373033  0.428698403
 [36] -1.011755586 -0.354878357 -0.708406051 -0.125063935  0.097463748
 [41] -0.361281187 -0.823202037  0.211204111  0.536691173  0.917784997
 [46] -1.409437874  0.888844846 -0.308522033  0.860741727  0.487415879
 [51]  1.716180747 -0.869185962  1.616420778 -0.851072480 -0.960408844
 [56] -0.088477089  0.795376052  1.140891787  0.592846284  1.309327278
 [61]  0.892704774  1.020270857 -0.729935202 -1.651260625 -0.702054426
 [66]  0.970643305 -1.261474996 -0.440275622  0.980234926  1.814482354
 [71]  0.884928230 -0.430338384  0.884777203  1.174165841  0.678703920
 [76]  0.599565141 -1.237316579  0.039002979 -0.280575118  0.579565923
 [81]  2.549296394 -0.086067268  0.736512778 -1.595912254 -0.630300316
 [86]  0.995287052  1.774960251  0.730586564 -1.928099271 -1.418999349
 [91] -0.242236887 -0.296909248  0.619130267 -1.392461838 -1.391749343
 [96]  1.143061835  0.096321834 -0.081017465  0.889394235 -0.507460883
> rowSums(tmp2)
  [1] -1.219333348 -0.294084326 -0.635530984  0.221130008 -0.776175541
  [6]  0.029652001  0.782665777  0.942963746  0.135536293  0.026550698
 [11]  0.855782068  0.006188576  0.515807404 -0.409054381  0.633201529
 [16]  0.912724572  1.760458669 -0.288677882  2.426158060 -0.157546981
 [21] -0.199825161 -0.954161855 -0.233106462 -1.336235693  0.671323704
 [26] -0.578891632 -0.209157034  0.672403696  0.890346975  0.745442906
 [31]  1.109709560 -1.015712652  0.708656011  0.992373033  0.428698403
 [36] -1.011755586 -0.354878357 -0.708406051 -0.125063935  0.097463748
 [41] -0.361281187 -0.823202037  0.211204111  0.536691173  0.917784997
 [46] -1.409437874  0.888844846 -0.308522033  0.860741727  0.487415879
 [51]  1.716180747 -0.869185962  1.616420778 -0.851072480 -0.960408844
 [56] -0.088477089  0.795376052  1.140891787  0.592846284  1.309327278
 [61]  0.892704774  1.020270857 -0.729935202 -1.651260625 -0.702054426
 [66]  0.970643305 -1.261474996 -0.440275622  0.980234926  1.814482354
 [71]  0.884928230 -0.430338384  0.884777203  1.174165841  0.678703920
 [76]  0.599565141 -1.237316579  0.039002979 -0.280575118  0.579565923
 [81]  2.549296394 -0.086067268  0.736512778 -1.595912254 -0.630300316
 [86]  0.995287052  1.774960251  0.730586564 -1.928099271 -1.418999349
 [91] -0.242236887 -0.296909248  0.619130267 -1.392461838 -1.391749343
 [96]  1.143061835  0.096321834 -0.081017465  0.889394235 -0.507460883
> rowVars(tmp2)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowSd(tmp2)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowMax(tmp2)
  [1] -1.219333348 -0.294084326 -0.635530984  0.221130008 -0.776175541
  [6]  0.029652001  0.782665777  0.942963746  0.135536293  0.026550698
 [11]  0.855782068  0.006188576  0.515807404 -0.409054381  0.633201529
 [16]  0.912724572  1.760458669 -0.288677882  2.426158060 -0.157546981
 [21] -0.199825161 -0.954161855 -0.233106462 -1.336235693  0.671323704
 [26] -0.578891632 -0.209157034  0.672403696  0.890346975  0.745442906
 [31]  1.109709560 -1.015712652  0.708656011  0.992373033  0.428698403
 [36] -1.011755586 -0.354878357 -0.708406051 -0.125063935  0.097463748
 [41] -0.361281187 -0.823202037  0.211204111  0.536691173  0.917784997
 [46] -1.409437874  0.888844846 -0.308522033  0.860741727  0.487415879
 [51]  1.716180747 -0.869185962  1.616420778 -0.851072480 -0.960408844
 [56] -0.088477089  0.795376052  1.140891787  0.592846284  1.309327278
 [61]  0.892704774  1.020270857 -0.729935202 -1.651260625 -0.702054426
 [66]  0.970643305 -1.261474996 -0.440275622  0.980234926  1.814482354
 [71]  0.884928230 -0.430338384  0.884777203  1.174165841  0.678703920
 [76]  0.599565141 -1.237316579  0.039002979 -0.280575118  0.579565923
 [81]  2.549296394 -0.086067268  0.736512778 -1.595912254 -0.630300316
 [86]  0.995287052  1.774960251  0.730586564 -1.928099271 -1.418999349
 [91] -0.242236887 -0.296909248  0.619130267 -1.392461838 -1.391749343
 [96]  1.143061835  0.096321834 -0.081017465  0.889394235 -0.507460883
> rowMin(tmp2)
  [1] -1.219333348 -0.294084326 -0.635530984  0.221130008 -0.776175541
  [6]  0.029652001  0.782665777  0.942963746  0.135536293  0.026550698
 [11]  0.855782068  0.006188576  0.515807404 -0.409054381  0.633201529
 [16]  0.912724572  1.760458669 -0.288677882  2.426158060 -0.157546981
 [21] -0.199825161 -0.954161855 -0.233106462 -1.336235693  0.671323704
 [26] -0.578891632 -0.209157034  0.672403696  0.890346975  0.745442906
 [31]  1.109709560 -1.015712652  0.708656011  0.992373033  0.428698403
 [36] -1.011755586 -0.354878357 -0.708406051 -0.125063935  0.097463748
 [41] -0.361281187 -0.823202037  0.211204111  0.536691173  0.917784997
 [46] -1.409437874  0.888844846 -0.308522033  0.860741727  0.487415879
 [51]  1.716180747 -0.869185962  1.616420778 -0.851072480 -0.960408844
 [56] -0.088477089  0.795376052  1.140891787  0.592846284  1.309327278
 [61]  0.892704774  1.020270857 -0.729935202 -1.651260625 -0.702054426
 [66]  0.970643305 -1.261474996 -0.440275622  0.980234926  1.814482354
 [71]  0.884928230 -0.430338384  0.884777203  1.174165841  0.678703920
 [76]  0.599565141 -1.237316579  0.039002979 -0.280575118  0.579565923
 [81]  2.549296394 -0.086067268  0.736512778 -1.595912254 -0.630300316
 [86]  0.995287052  1.774960251  0.730586564 -1.928099271 -1.418999349
 [91] -0.242236887 -0.296909248  0.619130267 -1.392461838 -1.391749343
 [96]  1.143061835  0.096321834 -0.081017465  0.889394235 -0.507460883
> 
> colMeans(tmp2)
[1] 0.1420893
> colSums(tmp2)
[1] 14.20893
> colVars(tmp2)
[1] 0.889906
> colSd(tmp2)
[1] 0.9433483
> colMax(tmp2)
[1] 2.549296
> colMin(tmp2)
[1] -1.928099
> colMedians(tmp2)
[1] 0.09689279
> colRanges(tmp2)
          [,1]
[1,] -1.928099
[2,]  2.549296
> 
> dataset1 <- matrix(dataset1,1,100)
> 
> agree.checks(tmp,dataset1)
> 
> dataset2 <- matrix(dataset2,100,1)
> agree.checks(tmp2,dataset2)
>   
> 
> tmp <- createBufferedMatrix(10,10)
> 
> tmp[1:10,1:10] <- rnorm(100)
> colApply(tmp,sum)
 [1]  0.04607292 -1.78252602 -0.75345772 -2.05338759  0.53569871 -4.67407365
 [7] -3.81913397 -4.76703006  1.49132201  0.07830072
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -1.7890105
[2,] -0.6116031
[3,]  0.2914195
[4,]  0.7992452
[5,]  0.8942250
> 
> rowApply(tmp,sum)
 [1]  1.4134640 -2.0483966 -0.1148353  1.2149557  1.1829853 -1.3307399
 [7] -7.0887005 -0.5902829 -5.7396100 -2.5970544
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    4    9    4    1    7    8   10    7   10     2
 [2,]    6    5    3   10    6    7    3    6    4     3
 [3,]    7    6    2    3   10   10    2    9    5     5
 [4,]   10    8    1    4    1    3    5    5    6     9
 [5,]    2    4    6    9    9    4    8    8    8     7
 [6,]    5   10    7    6    2    2    1    1    3     4
 [7,]    3    7    5    2    4    1    7    3    9     6
 [8,]    8    3    9    7    3    5    4    4    2     1
 [9,]    9    1   10    5    5    6    9   10    1     8
[10,]    1    2    8    8    8    9    6    2    7    10
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1]  2.1785807 -1.4768953 -2.7709209 -2.1415283  0.9576668 -1.5173179
 [7] -1.7677182  1.3964431 -5.3173588  1.9483216  0.5268502 -2.8133563
[13] -1.1793457  0.6593510 -0.4333770 -2.7397006  3.1246015  1.5734554
[19]  1.2347070  2.3742062
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -0.5126781
[2,] -0.4657569
[3,]  0.2496798
[4,]  0.2560238
[5,]  2.6513120
> 
> rowApply(tmp,sum)
[1]  2.1760580 -1.2015875  0.1861713 -5.3885324 -1.9554450
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]    5   15    6   14   20
[2,]   18    5    8    3    8
[3,]   10    7   17    1   11
[4,]    8   11   14    6    2
[5,]   20    6    4   19    3
> 
> 
> as.matrix(tmp)
           [,1]       [,2]        [,3]         [,4]       [,5]        [,6]
[1,] -0.4657569  1.4846433  0.03070905 -0.243644217  1.7204508  0.21424079
[2,]  0.2560238 -0.5760828 -0.42293358 -0.005195646 -0.5453499 -0.87136389
[3,] -0.5126781 -0.1956704  0.73484721  0.462125177 -0.7886030 -0.73110594
[4,]  0.2496798 -1.5424614 -2.65028296 -1.121992800  1.6473070 -0.03517167
[5,]  2.6513120 -0.6473240 -0.46326061 -1.232820853 -1.0761382 -0.09391715
           [,7]       [,8]       [,9]       [,10]         [,11]      [,12]
[1,] -0.8606382  1.1624678 -1.5487025 -0.57206558 -0.3942321896  0.6835375
[2,]  0.6135052 -1.4158211 -1.5348070  0.08231467  0.0007850616 -1.5896559
[3,]  0.7869578  2.0270948 -1.7606898 -0.29482361 -0.1705578666 -0.1534530
[4,] -1.7154772 -0.8081456 -0.9316812  0.60099396  1.5932185419 -0.7165291
[5,] -0.5920657  0.4308472  0.4585217  2.13190214 -0.5023633898 -1.0372558
           [,13]       [,14]      [,15]      [,16]      [,17]      [,18]
[1,]  0.07221996  0.66386657  0.9732722 -2.1470003  1.6388726  0.2903842
[2,]  0.18482294 -0.37915622 -0.3884227  0.8988872  1.3330445  2.2050345
[3,] -0.81408198  0.62328156  1.5205928 -1.5794915  0.2236997  0.2660388
[4,]  0.25193369 -0.29297256 -1.2645017 -1.2482314  0.7511188 -0.2602725
[5,] -0.87424030  0.04433167 -1.2743176  1.3361353 -0.8221342 -0.9277297
          [,19]       [,20]
[1,] -0.1808298 -0.34573717
[2,]  1.0373298 -0.08454643
[3,]  0.6390429 -0.09635438
[4,] -0.4827500  2.58768595
[5,]  0.2219142  0.31315823
> 
> 
> 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.22-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.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  650  bytes.
Disk usage :  200  bytes.
> subBufferedMatrix(tmp,,5:8)
BufferedMatrix object
Matrix size:  5 4 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  563  bytes.
Disk usage :  160  bytes.
> subBufferedMatrix(tmp,1:3,)
BufferedMatrix object
Matrix size:  3 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  480  bytes.
> 
> 
> rm(tmp)
> 
> 
> ###
> ### Testing colnames and rownames
> ###
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> 
> 
> colnames(tmp)
NULL
> rownames(tmp)
NULL
> 
> 
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> colnames(tmp)
 [1] "col1"  "col2"  "col3"  "col4"  "col5"  "col6"  "col7"  "col8"  "col9" 
[10] "col10" "col11" "col12" "col13" "col14" "col15" "col16" "col17" "col18"
[19] "col19" "col20"
> rownames(tmp)
[1] "row1" "row2" "row3" "row4" "row5"
> 
> 
> tmp["row1",]
          col1       col2        col3      col4       col5      col6      col7
row1 -1.264373 -0.5189842 -0.00168826 0.2569057 -0.1788404 -2.509836 0.3999698
          col8      col9    col10      col11     col12    col13    col14
row1 -0.654355 0.6726718 1.273783 -0.1464114 0.6650413 1.494759 1.316584
         col15     col16     col17     col18     col19      col20
row1 -1.140946 0.2519541 0.8845736 0.9343517 0.2569452 -0.3320857
> tmp[,"col10"]
          col10
row1  1.2737825
row2  1.1142719
row3 -0.3797311
row4  0.8892922
row5  1.2626216
> tmp[c("row1","row5"),]
          col1       col2        col3       col4       col5        col6
row1 -1.264373 -0.5189842 -0.00168826  0.2569057 -0.1788404 -2.50983647
row5  1.162720 -0.1395602 -0.77327733 -0.4757552 -0.4947129  0.08174774
            col7      col8      col9    col10      col11     col12      col13
row1  0.39996979 -0.654355 0.6726718 1.273783 -0.1464114 0.6650413  1.4947589
row5 -0.08916341 -1.251058 1.1226578 1.262622 -0.9680836 0.8288071 -0.8450447
         col14     col15     col16      col17      col18      col19       col20
row1 1.3165842 -1.140946 0.2519541  0.8845736  0.9343517 0.25694524 -0.33208573
row5 0.7368892 -0.623664 1.1285996 -0.4203758 -1.5740866 0.02447708  0.04764689
> tmp[,c("col6","col20")]
            col6       col20
row1 -2.50983647 -0.33208573
row2 -0.30910799  1.02660085
row3 -0.93750527  1.15763807
row4  0.49231512 -0.61458986
row5  0.08174774  0.04764689
> tmp[c("row1","row5"),c("col6","col20")]
            col6       col20
row1 -2.50983647 -0.33208573
row5  0.08174774  0.04764689
> 
> 
> 
> 
> tmp["row1",] <- rnorm(20,mean=10)
> tmp[,"col10"] <- rnorm(5,mean=30)
> tmp[c("row1","row5"),] <- rnorm(40,mean=50)
> tmp[,c("col6","col20")] <- rnorm(10,mean=75)
> tmp[c("row1","row5"),c("col6","col20")]  <- rnorm(4,mean=105)
> 
> tmp["row1",]
        col1     col2     col3     col4     col5     col6     col7     col8
row1 49.8026 48.18714 50.68023 47.22832 48.84437 105.4288 49.67311 48.73891
         col9    col10    col11    col12    col13  col14    col15    col16
row1 52.74825 49.61087 50.04368 49.94785 48.09711 49.721 49.32241 51.91923
        col17    col18    col19    col20
row1 51.45407 50.64063 48.97761 105.1569
> tmp[,"col10"]
        col10
row1 49.61087
row2 30.42518
row3 30.14141
row4 28.74831
row5 51.41883
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 49.80260 48.18714 50.68023 47.22832 48.84437 105.4288 49.67311 48.73891
row5 50.73331 49.57632 51.05891 49.42179 46.83667 104.2178 51.32149 50.12517
         col9    col10    col11    col12    col13    col14    col15    col16
row1 52.74825 49.61087 50.04368 49.94785 48.09711 49.72100 49.32241 51.91923
row5 50.39976 51.41883 49.17580 49.84655 49.33335 52.98018 49.58464 49.14106
        col17    col18    col19    col20
row1 51.45407 50.64063 48.97761 105.1569
row5 49.21071 48.45692 49.90267 104.1564
> tmp[,c("col6","col20")]
          col6     col20
row1 105.42881 105.15693
row2  75.80546  74.91436
row3  76.08312  76.23310
row4  75.40023  76.28622
row5 104.21778 104.15635
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 105.4288 105.1569
row5 104.2178 104.1564
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 105.4288 105.1569
row5 104.2178 104.1564
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
          col13
[1,]  0.4043868
[2,]  0.1961642
[3,]  0.1923619
[4,] -0.7572309
[5,] -0.2336112
> tmp[,c("col17","col7")]
          col17       col7
[1,]  0.5981759  0.6513170
[2,]  1.0938906  0.5186040
[3,]  0.9982399 -1.2755816
[4,]  0.6950558  1.3238816
[5,] -0.1346714 -0.4070168
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
           col6      col20
[1,] -0.9790528  0.8553644
[2,]  0.2133747  1.6554913
[3,] -0.2300068 -0.2261395
[4,]  0.9950747  1.9128838
[5,] -2.2422203  0.4825575
> subBufferedMatrix(tmp,1,c("col6"))[,1]
           col1
[1,] -0.9790528
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
           col6
[1,] -0.9790528
[2,]  0.2133747
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> 
> 
> 
> subBufferedMatrix(tmp,c("row3","row1"),)[,1:20]
           [,1]      [,2]       [,3]      [,4]       [,5]       [,6]       [,7]
row3  1.3067153  1.250433  1.4554684  1.890054  0.2570693  0.1320479  1.0602603
row1 -0.4021398 -2.033527 -0.7269317 -1.746713 -0.8057071 -1.3490400 -0.3245223
            [,8]      [,9]     [,10]      [,11]       [,12]      [,13]
row3  0.08159471 -1.739123 -1.049666  1.6481679 -0.07675043 -1.6392841
row1 -0.19726078 -1.690531  0.413526 -0.7653467 -0.99305681 -0.3124184
         [,14]      [,15]      [,16]      [,17]     [,18]      [,19]
row3  1.249669 -0.9700610 -1.1571141 -0.4207461 0.5369174 -0.3964348
row1 -1.762475 -0.5710982 -0.1596003 -0.6652783 0.4740999 -0.1460026
           [,20]
row3 -0.49806423
row1  0.07523605
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
           [,1]      [,2]       [,3]     [,4]       [,5]       [,6]     [,7]
row2 -0.9688516 0.7985302 -0.3719894 0.219361 -0.8369268 -0.9791569 1.733644
          [,8]     [,9]      [,10]
row2 0.1331207 1.316314 -0.9065885
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
           [,1]       [,2]       [,3]       [,4]     [,5]      [,6]     [,7]
row5 -0.4215442 -0.5012261 -0.3346844 -0.7277047 1.334019 0.6935168 1.555156
           [,8]       [,9]        [,10]    [,11]     [,12]      [,13]     [,14]
row5 -0.4639821 -0.5092689 -0.007528815 0.391028 -1.619498 -0.4846688 -1.644831
         [,15]      [,16]     [,17]     [,18]      [,19]      [,20]
row5 -1.841159 -0.2814004 -1.135292 0.3077892 -0.1100386 -0.4653698
> 
> 
> 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: 0x6000035f8180>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM7baa6dbb9dff"
 [2] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM7baa388208a1"
 [3] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM7baa61049f02"
 [4] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM7baa76636e10"
 [5] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM7baa79cf1928"
 [6] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM7baab7ccf92" 
 [7] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM7baa2f1f8022"
 [8] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM7baa3d155059"
 [9] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM7baa424e2263"
[10] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM7baa17b3b397"
[11] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM7baa16d38aa9"
[12] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM7baa1a3468f4"
[13] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM7baa66d6789c"
[14] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM7baaa887e83" 
[15] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM7baa729cfdc" 
> 
> 
> ### 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: 0x6000035d4360>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x6000035d4360>
Warning message:
In dir.create(new.directory) :
  '/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x6000035d4360>
> rowMedians(tmp)
  [1] -0.0058862170  0.0547877998  0.0611455583  0.3403786144  0.1025790325
  [6]  0.2562183208 -0.0745210558 -0.2918856165  0.1931394599  0.0160163519
 [11]  0.1690498453 -0.3423917432 -0.2036594165  0.1443738324  0.3472953576
 [16] -0.0078278829  0.3737887583  0.6760818030  0.1302971103  0.3664305471
 [21] -0.5773778459  0.1909543849 -0.3568931618  0.4692452786  0.4427792747
 [26]  0.2391908385  0.3411644910  0.6273960167  0.1960378570  0.1818176621
 [31] -0.8995414405  0.6718720618  0.0998332462 -1.1032097678  0.3590460721
 [36]  0.2208443746 -0.2051925094  0.1883105661 -0.3052554704  0.0961982597
 [41] -0.5231478122 -0.3191437838 -0.2833392568  0.2047556837 -0.5785788379
 [46] -0.0579573221 -0.2649812056 -0.3024521710  0.2079684137  0.1775758604
 [51]  0.1460612086 -0.1826162946 -0.0937232101  0.5577784400 -0.0662118784
 [56]  0.3757437117  0.0409842114  0.5174207497  0.5388687657  0.0658465807
 [61] -0.0257117511  0.1879027988  0.0452713468 -0.0615167253  0.4547415442
 [66]  0.0846752109  0.4627819992  0.2304195645  0.2226352993 -0.1276833885
 [71]  0.3409297555 -0.1597379204  0.3901241841 -0.5121243922 -0.0999226833
 [76] -0.0784626918  0.3162290045 -0.2725181274  0.2873136823 -0.1178276223
 [81] -0.1045421728  0.1191138958  0.3442531098  0.0788314646 -0.3545579805
 [86]  0.5158863660 -0.1962055014  0.2076019046 -0.4054662211  0.0758145499
 [91]  0.4458397720 -0.0421003837 -0.1491252916 -0.1259777085 -0.0745888866
 [96]  0.1560271721  0.1036509514  0.3475706339 -0.2037958265 -0.0986527183
[101]  0.5638238938  0.0951908723  0.4212695480 -0.0149572307 -0.1225540327
[106]  0.1816936332 -0.3208725067  0.4443237270 -0.1667621190  0.1591374609
[111]  0.0478482062 -0.2029009952  0.2292386050 -0.0421103775  0.1047603689
[116]  0.2220194638  0.1330649070  0.4069333306  0.6846993473  0.1263341717
[121]  0.3200312312 -0.2071691230  0.0286527041  0.5017851462 -0.0211248339
[126]  0.0860981511  0.0904549988 -0.2172287128 -0.2573098722 -0.3490884673
[131] -0.6583024520 -0.4536305943  0.5670267106 -0.2612984166  0.4618034330
[136] -0.3324895984  0.0168981915 -0.5233750613  0.2954066156  0.1811755068
[141] -0.4542855108  0.2855838435 -0.0654989802  0.0639445513  0.1846223505
[146] -0.1591908188  0.4713368727 -0.9620745156 -0.3964305540 -0.5152806008
[151] -0.0121716842 -0.1135799269 -0.6540789593  0.6028842678 -0.7909685747
[156] -0.4608255198 -0.0196395542  0.2075796941  0.1706765546  0.4919769457
[161]  0.1359884237 -0.3176398693  0.0054939433  0.3796695643  0.3499180037
[166] -0.0441270882 -0.3321668472 -0.1609808041  0.7543933701 -0.1316545186
[171] -0.2441716658  0.1279116128  0.4271130118 -0.3971460207  0.3301855314
[176]  0.0090505136 -0.2759014091 -0.1120751741 -0.1462042368  0.1187643315
[181] -0.5613689309 -0.0110703912  0.0850700175  0.0098602304 -0.1789375428
[186]  0.2392705836  0.2048851610  0.1250132432 -0.2747489941 -0.0565210971
[191]  0.3960100952  0.2460848396 -0.2370207842 -0.0401025748  0.0548450023
[196] -0.3531264735 -0.1184700658 -0.4928869135 -0.0392746083  0.0726158638
[201]  0.0432742735  0.3082867091 -0.2485967759  0.1399598161  0.2888053494
[206] -0.0138538528  0.0004370849 -0.4545891767 -0.4377123328  0.3747689538
[211]  0.4339395529  0.3410137022  0.0448559883  0.3192297578 -0.1515078265
[216] -0.2281825425  0.0953483775 -0.1990550962 -0.6151922218  0.0362499700
[221]  0.0144981194  0.0549588122 -0.0015449215 -0.1619731792  0.3387900181
[226] -0.5229995293  0.3640553552 -0.4398230056 -0.2966861761 -0.5683501623
> 
> proc.time()
   user  system elapsed 
  0.649   3.040   4.090 

BufferedMatrix.Rcheck/tests/rawCalltesting.Rout


R version 4.5.1 Patched (2025-09-10 r88807) -- "Great Square Root"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: aarch64-apple-darwin20

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

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

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

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

Attaching package: 'BufferedMatrix'

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

    colMeans, colSums, rowMeans, rowSums

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

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

<pointer: 0x6000026e0000>
> .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: 0x6000026e0000>
> .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: 0x6000026e0000>
> .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: 0x6000026e0000>
> 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: 0x6000026fc000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000026fc000>
> .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: 0x6000026fc000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000026fc000>
> .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: 0x6000026fc000>
> 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: 0x6000026fc180>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000026fc180>
> .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: 0x6000026fc180>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x6000026fc180>
> .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: 0x6000026fc180>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x6000026fc180>
> .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: 0x6000026fc180>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x6000026fc180>
> .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: 0x6000026fc180>
> 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: 0x6000026f82a0>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x6000026f82a0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000026f82a0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000026f82a0>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile7e522c218665" "BufferedMatrixFile7e524cfe6785"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile7e522c218665" "BufferedMatrixFile7e524cfe6785"
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000026f8540>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000026f8540>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x6000026f8540>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x6000026f8540>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x6000026f8540>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x6000026f8540>
> .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: 0x6000026f8720>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000026f8720>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x6000026f8720>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x6000026f8720>
> 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: 0x6000026f8900>
> .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: 0x6000026f8900>
> rm(P)
> 
> proc.time()
   user  system elapsed 
  0.111   0.038   0.145 

BufferedMatrix.Rcheck/tests/Rcodetesting.Rout


R version 4.5.1 Patched (2025-09-10 r88807) -- "Great Square Root"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: aarch64-apple-darwin20

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

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

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

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

Attaching package: 'BufferedMatrix'

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

    colMeans, colSums, rowMeans, rowSums

> 
> Temp <- createBufferedMatrix(100)
> dim(Temp)
[1] 100   0
> buffer.dim(Temp)
[1] 1 1
> 
> 
> proc.time()
   user  system elapsed 
  0.110   0.029   0.134 

Example timings