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

This page was generated on 2025-10-25 12:05 -0400 (Sat, 25 Oct 2025).

HostnameOSArch (*)R versionInstalled pkgs
nebbiolo2Linux (Ubuntu 24.04.3 LTS)x86_644.5.1 Patched (2025-08-23 r88802) -- "Great Square Root" 4901
lconwaymacOS 12.7.6 Montereyx86_644.5.1 Patched (2025-09-10 r88807) -- "Great Square Root" 4691
kjohnson3macOS 13.7.7 Venturaarm644.5.1 Patched (2025-09-10 r88807) -- "Great Square Root" 4637
taishanLinux (openEuler 24.03 LTS)aarch644.5.0 (2025-04-11) -- "How About a Twenty-Six" 4658
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.73.0  (landing page)
Ben Bolstad
Snapshot Date: 2025-10-24 13:45 -0400 (Fri, 24 Oct 2025)
git_url: https://git.bioconductor.org/packages/BufferedMatrix
git_branch: devel
git_last_commit: 0147962
git_last_commit_date: 2025-04-15 09:39:39 -0400 (Tue, 15 Apr 2025)
nebbiolo2Linux (Ubuntu 24.04.3 LTS) / x86_64  OK    OK    OK  UNNEEDED, same version is already published
lconwaymacOS 12.7.6 Monterey / x86_64  OK    OK    WARNINGS    OK  UNNEEDED, same version is already published
kjohnson3macOS 13.7.7 Ventura / arm64  OK    OK    WARNINGS    OK  UNNEEDED, same version is already published
taishanLinux (openEuler 24.03 LTS) / aarch64  OK    NA    NA  


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.73.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.73.0.tar.gz
StartedAt: 2025-10-24 18:47:31 -0400 (Fri, 24 Oct 2025)
EndedAt: 2025-10-24 18:47:47 -0400 (Fri, 24 Oct 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.73.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.73.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.73.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.107   0.035   0.139 

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    1056615 56.5         NA   634357 33.9
Vcells 891019  6.8    8388608 64.0     196608  2109489 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] "Fri Oct 24 18:47:40 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] "Fri Oct 24 18:47:40 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: 0x600003010000>
> 
> 
> 
> 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] "Fri Oct 24 18:47:41 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] "Fri Oct 24 18:47:42 2025"
> 
> ColMode(tmp2)
<pointer: 0x600003010000>
> 
> 
> 
> ### Now testing assignments
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+ 
+   new.data <- rnorm(20)
+   tmp2[which.row,] <- new.data
+   test.matrix[which.row,] <- new.data
+   if (rep > 1){
+     if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+   
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   new.data <- rnorm(10)
+   tmp2[,which.col] <- new.data
+   test.matrix[,which.col]<- new.data
+ 
+   if (rep > 1){
+     if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.col <- which.col
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,5,replace=TRUE)
+   new.data <- matrix(rnorm(50),5,10)
+   tmp2[,which.col] <- new.data
+   test.matrix[,which.col]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.col <- which.col
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   new.data <- matrix(rnorm(50),5,10)
+   tmp2[which.row,] <- new.data
+   test.matrix[which.row,]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col  <- sample(1:20,5,replace=TRUE)
+   new.data <- matrix(rnorm(25),5,5)
+   tmp2[which.row,which.col] <- new.data
+   test.matrix[which.row,which.col]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[prev.row,prev.col] == test.matrix[prev.row,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+   prev.col <- which.col
+ }
> 
> 
> 
> 
> ###
> ###
> ### testing some more functions
> ###
> 
> 
> 
> ## duplication function
> tmp5 <- duplicate(tmp2)
> 
> # making sure really did copy everything.
> tmp5[1,1] <- tmp5[1,1] +100.00
> 
> if (tmp5[1,1] == tmp2[1,1]){
+   stop("Problem with duplication")
+ }
> 
> 
> 
> 
> ### testing elementwise applying of functions
> 
> tmp5[1:4,1:4]
            [,1]       [,2]        [,3]       [,4]
[1,] 100.5961494  0.1015978  0.48844013  0.4740607
[2,]  -0.2393286 -0.1022116  0.33111471 -0.3795374
[3,]  -0.5599194 -1.0844059 -0.02998175 -0.4524102
[4,]  -1.1605364 -2.7884437  0.97606667 -1.2593785
> 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 :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
            [,1]      [,2]       [,3]      [,4]
[1,] 100.5961494 0.1015978 0.48844013 0.4740607
[2,]   0.2393286 0.1022116 0.33111471 0.3795374
[3,]   0.5599194 1.0844059 0.02998175 0.4524102
[4,]   1.1605364 2.7884437 0.97606667 1.2593785
> 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 :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
           [,1]      [,2]      [,3]      [,4]
[1,] 10.0297632 0.3187441 0.6988849 0.6885206
[2,]  0.4892122 0.3197056 0.5754257 0.6160661
[3,]  0.7482776 1.0413481 0.1731524 0.6726145
[4,]  1.0772820 1.6698634 0.9879609 1.1222203
> 
> 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 :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
          [,1]     [,2]     [,3]     [,4]
[1,] 225.89378 28.28904 32.47729 32.35927
[2,]  30.13145 28.29927 31.08537 31.54020
[3,]  33.04270 36.49789 26.76151 32.17855
[4,]  36.93336 44.48708 35.85568 37.48158
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x600003004000>
> exp(tmp5)
<pointer: 0x600003004000>
> log(tmp5,2)
<pointer: 0x600003004000>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 470.1683
> Min(tmp5)
[1] 54.09846
> mean(tmp5)
[1] 72.63537
> Sum(tmp5)
[1] 14527.07
> Var(tmp5)
[1] 870.3966
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 90.09894 68.34309 72.27725 73.09911 68.81329 69.69320 69.20536 70.80446
 [9] 70.58066 73.43830
> rowSums(tmp5)
 [1] 1801.979 1366.862 1445.545 1461.982 1376.266 1393.864 1384.107 1416.089
 [9] 1411.613 1468.766
> rowVars(tmp5)
 [1] 8065.95453   58.55280  104.49441   99.76191   79.88835   67.07932
 [7]   43.23253   23.73428   89.47888   97.77458
> rowSd(tmp5)
 [1] 89.810659  7.651980 10.222251  9.988089  8.938028  8.190196  6.575145
 [8]  4.871785  9.459328  9.888103
> rowMax(tmp5)
 [1] 470.16831  82.76980  91.81266  92.59402  83.58975  81.85570  78.17170
 [8]  79.08003  87.59851  89.69892
> rowMin(tmp5)
 [1] 57.52263 55.04875 54.09846 58.55550 55.95444 54.32423 56.44597 62.23544
 [9] 54.61828 55.34987
> 
> colMeans(tmp5)
 [1] 108.27271  70.95966  68.07434  71.46303  67.36286  71.51660  69.39739
 [8]  73.12127  68.61256  71.27145  74.89857  76.61799  71.73667  69.79265
[15]  70.58065  68.24134  69.94553  70.06757  72.41917  68.35529
> colSums(tmp5)
 [1] 1082.7271  709.5966  680.7434  714.6303  673.6286  715.1660  693.9739
 [8]  731.2127  686.1256  712.7145  748.9857  766.1799  717.3667  697.9265
[15]  705.8065  682.4134  699.4553  700.6757  724.1917  683.5529
> colVars(tmp5)
 [1] 16223.83030    90.24156    71.21226    49.70766    45.65559    37.99519
 [7]   123.04354    68.69576   114.18085    65.49259   110.40006   106.45803
[13]    57.36842    66.37897    49.32071    93.10539    70.55481    41.35605
[19]   110.89190    51.30513
> colSd(tmp5)
 [1] 127.372800   9.499556   8.438736   7.050366   6.756892   6.164023
 [7]  11.092499   8.288291  10.685544   8.092749  10.507143  10.317850
[13]   7.574195   8.147329   7.022871   9.649113   8.399691   6.430867
[19]  10.530522   7.162760
> colMax(tmp5)
 [1] 470.16831  92.59402  83.23833  86.00476  74.86687  85.04540  84.05450
 [8]  84.85217  85.32208  83.60154  89.44090  89.69892  81.40691  83.15318
[15]  78.75376  91.81266  82.08207  76.78556  85.08941  81.09856
> colMin(tmp5)
 [1] 57.60283 58.87993 55.70057 63.09384 54.32423 64.03163 54.09846 59.27892
 [9] 55.86169 60.72945 55.04875 58.78449 57.32875 54.61828 61.00898 55.95444
[17] 60.74279 60.38297 55.34987 58.55550
> 
> 
> ### 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.09894 68.34309 72.27725 73.09911       NA 69.69320 69.20536 70.80446
 [9] 70.58066 73.43830
> rowSums(tmp5)
 [1] 1801.979 1366.862 1445.545 1461.982       NA 1393.864 1384.107 1416.089
 [9] 1411.613 1468.766
> rowVars(tmp5)
 [1] 8065.95453   58.55280  104.49441   99.76191   78.44490   67.07932
 [7]   43.23253   23.73428   89.47888   97.77458
> rowSd(tmp5)
 [1] 89.810659  7.651980 10.222251  9.988089  8.856912  8.190196  6.575145
 [8]  4.871785  9.459328  9.888103
> rowMax(tmp5)
 [1] 470.16831  82.76980  91.81266  92.59402        NA  81.85570  78.17170
 [8]  79.08003  87.59851  89.69892
> rowMin(tmp5)
 [1] 57.52263 55.04875 54.09846 58.55550       NA 54.32423 56.44597 62.23544
 [9] 54.61828 55.34987
> 
> colMeans(tmp5)
 [1] 108.27271  70.95966  68.07434  71.46303  67.36286  71.51660  69.39739
 [8]  73.12127  68.61256  71.27145  74.89857        NA  71.73667  69.79265
[15]  70.58065  68.24134  69.94553  70.06757  72.41917  68.35529
> colSums(tmp5)
 [1] 1082.7271  709.5966  680.7434  714.6303  673.6286  715.1660  693.9739
 [8]  731.2127  686.1256  712.7145  748.9857        NA  717.3667  697.9265
[15]  705.8065  682.4134  699.4553  700.6757  724.1917  683.5529
> colVars(tmp5)
 [1] 16223.83030    90.24156    71.21226    49.70766    45.65559    37.99519
 [7]   123.04354    68.69576   114.18085    65.49259   110.40006          NA
[13]    57.36842    66.37897    49.32071    93.10539    70.55481    41.35605
[19]   110.89190    51.30513
> colSd(tmp5)
 [1] 127.372800   9.499556   8.438736   7.050366   6.756892   6.164023
 [7]  11.092499   8.288291  10.685544   8.092749  10.507143         NA
[13]   7.574195   8.147329   7.022871   9.649113   8.399691   6.430867
[19]  10.530522   7.162760
> colMax(tmp5)
 [1] 470.16831  92.59402  83.23833  86.00476  74.86687  85.04540  84.05450
 [8]  84.85217  85.32208  83.60154  89.44090        NA  81.40691  83.15318
[15]  78.75376  91.81266  82.08207  76.78556  85.08941  81.09856
> colMin(tmp5)
 [1] 57.60283 58.87993 55.70057 63.09384 54.32423 64.03163 54.09846 59.27892
 [9] 55.86169 60.72945 55.04875       NA 57.32875 54.61828 61.00898 55.95444
[17] 60.74279 60.38297 55.34987 58.55550
> 
> Max(tmp5,na.rm=TRUE)
[1] 470.1683
> Min(tmp5,na.rm=TRUE)
[1] 54.09846
> mean(tmp5,na.rm=TRUE)
[1] 72.70497
> Sum(tmp5,na.rm=TRUE)
[1] 14468.29
> Var(tmp5,na.rm=TRUE)
[1] 873.8187
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 90.09894 68.34309 72.27725 73.09911 69.34112 69.69320 69.20536 70.80446
 [9] 70.58066 73.43830
> rowSums(tmp5,na.rm=TRUE)
 [1] 1801.979 1366.862 1445.545 1461.982 1317.481 1393.864 1384.107 1416.089
 [9] 1411.613 1468.766
> rowVars(tmp5,na.rm=TRUE)
 [1] 8065.95453   58.55280  104.49441   99.76191   78.44490   67.07932
 [7]   43.23253   23.73428   89.47888   97.77458
> rowSd(tmp5,na.rm=TRUE)
 [1] 89.810659  7.651980 10.222251  9.988089  8.856912  8.190196  6.575145
 [8]  4.871785  9.459328  9.888103
> rowMax(tmp5,na.rm=TRUE)
 [1] 470.16831  82.76980  91.81266  92.59402  83.58975  81.85570  78.17170
 [8]  79.08003  87.59851  89.69892
> rowMin(tmp5,na.rm=TRUE)
 [1] 57.52263 55.04875 54.09846 58.55550 55.95444 54.32423 56.44597 62.23544
 [9] 54.61828 55.34987
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 108.27271  70.95966  68.07434  71.46303  67.36286  71.51660  69.39739
 [8]  73.12127  68.61256  71.27145  74.89857  78.59949  71.73667  69.79265
[15]  70.58065  68.24134  69.94553  70.06757  72.41917  68.35529
> colSums(tmp5,na.rm=TRUE)
 [1] 1082.7271  709.5966  680.7434  714.6303  673.6286  715.1660  693.9739
 [8]  731.2127  686.1256  712.7145  748.9857  707.3954  717.3667  697.9265
[15]  705.8065  682.4134  699.4553  700.6757  724.1917  683.5529
> colVars(tmp5,na.rm=TRUE)
 [1] 16223.83030    90.24156    71.21226    49.70766    45.65559    37.99519
 [7]   123.04354    68.69576   114.18085    65.49259   110.40006    75.59394
[13]    57.36842    66.37897    49.32071    93.10539    70.55481    41.35605
[19]   110.89190    51.30513
> colSd(tmp5,na.rm=TRUE)
 [1] 127.372800   9.499556   8.438736   7.050366   6.756892   6.164023
 [7]  11.092499   8.288291  10.685544   8.092749  10.507143   8.694478
[13]   7.574195   8.147329   7.022871   9.649113   8.399691   6.430867
[19]  10.530522   7.162760
> colMax(tmp5,na.rm=TRUE)
 [1] 470.16831  92.59402  83.23833  86.00476  74.86687  85.04540  84.05450
 [8]  84.85217  85.32208  83.60154  89.44090  89.69892  81.40691  83.15318
[15]  78.75376  91.81266  82.08207  76.78556  85.08941  81.09856
> colMin(tmp5,na.rm=TRUE)
 [1] 57.60283 58.87993 55.70057 63.09384 54.32423 64.03163 54.09846 59.27892
 [9] 55.86169 60.72945 55.04875 62.58221 57.32875 54.61828 61.00898 55.95444
[17] 60.74279 60.38297 55.34987 58.55550
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1] 90.09894 68.34309 72.27725 73.09911      NaN 69.69320 69.20536 70.80446
 [9] 70.58066 73.43830
> rowSums(tmp5,na.rm=TRUE)
 [1] 1801.979 1366.862 1445.545 1461.982    0.000 1393.864 1384.107 1416.089
 [9] 1411.613 1468.766
> rowVars(tmp5,na.rm=TRUE)
 [1] 8065.95453   58.55280  104.49441   99.76191         NA   67.07932
 [7]   43.23253   23.73428   89.47888   97.77458
> rowSd(tmp5,na.rm=TRUE)
 [1] 89.810659  7.651980 10.222251  9.988089        NA  8.190196  6.575145
 [8]  4.871785  9.459328  9.888103
> rowMax(tmp5,na.rm=TRUE)
 [1] 470.16831  82.76980  91.81266  92.59402        NA  81.85570  78.17170
 [8]  79.08003  87.59851  89.69892
> rowMin(tmp5,na.rm=TRUE)
 [1] 57.52263 55.04875 54.09846 58.55550       NA 54.32423 56.44597 62.23544
 [9] 54.61828 55.34987
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1] 113.22034  70.95841  68.86767  70.81064  67.33502  71.43058  70.65092
 [8]  72.03059  67.94575  69.90275  74.52808       NaN  73.33755  69.87861
[15]  71.64417  69.60656  70.49182  70.81658  72.20591  66.93937
> colSums(tmp5,na.rm=TRUE)
 [1] 1018.9831  638.6257  619.8091  637.2958  606.0152  642.8752  635.8583
 [8]  648.2753  611.5118  629.1248  670.7527    0.0000  660.0379  628.9075
[15]  644.7975  626.4590  634.4264  637.3492  649.8532  602.4543
> colVars(tmp5,na.rm=TRUE)
 [1] 17976.41971   101.52173    73.03334    51.13309    51.35382    42.66134
 [7]   120.74657    63.89981   123.45131    52.60409   122.65586          NA
[13]    35.70779    74.59321    42.76123    83.77580    76.01677    40.21413
[19]   124.24173    35.16397
> colSd(tmp5,na.rm=TRUE)
 [1] 134.076171  10.075799   8.545954   7.150740   7.166158   6.531565
 [7]  10.988474   7.993736  11.110864   7.252868  11.075011         NA
[13]   5.975599   8.636736   6.539207   9.152912   8.718759   6.341461
[19]  11.146378   5.929922
> colMax(tmp5,na.rm=TRUE)
 [1] 470.16831  92.59402  83.23833  86.00476  74.86687  85.04540  84.05450
 [8]  84.85217  85.32208  83.60154  89.44090      -Inf  81.40691  83.15318
[15]  78.75376  91.81266  82.08207  76.78556  85.08941  78.14758
> colMin(tmp5,na.rm=TRUE)
 [1] 57.60283 58.87993 55.70057 63.09384 54.32423 64.03163 54.09846 59.27892
 [9] 55.86169 60.72945 55.04875      Inf 64.28361 54.61828 64.02949 58.60094
[17] 60.74279 60.38297 55.34987 58.55550
> 
> 
> 
> 
> 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] 203.1152 136.4460 318.2558 136.5965 211.1902 173.1351 341.5767 299.4643
 [9] 116.0015 250.2746
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 203.1152 136.4460 318.2558 136.5965 211.1902 173.1351 341.5767 299.4643
 [9] 116.0015 250.2746
> 
> 
> 
> 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  5.684342e-14 -8.526513e-14  8.526513e-14 -1.136868e-13
 [6] -1.136868e-13  5.684342e-14 -2.842171e-14  2.842171e-14 -5.684342e-14
[11]  2.842171e-14 -5.684342e-14 -1.421085e-14  7.105427e-15  0.000000e+00
[16]  8.526513e-14  5.684342e-14 -1.136868e-13 -1.136868e-13  1.421085e-13
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> ## making sure these things agree
> ##
> ## first when there is no NA
> 
> 
> 
> agree.checks <- function(buff.matrix,r.matrix,err.tol=1e-10){
+ 
+   if (Max(buff.matrix,na.rm=TRUE) != max(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Max")
+   }
+   
+ 
+   if (Min(buff.matrix,na.rm=TRUE) != min(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Min")
+   }
+ 
+ 
+   if (abs(Sum(buff.matrix,na.rm=TRUE)- sum(r.matrix,na.rm=TRUE)) > err.tol){
+ 
+     cat(Sum(buff.matrix,na.rm=TRUE),"\n")
+     cat(sum(r.matrix,na.rm=TRUE),"\n")
+     cat(Sum(buff.matrix,na.rm=TRUE) - sum(r.matrix,na.rm=TRUE),"\n")
+     
+     stop("No agreement in Sum")
+   }
+   
+   if (abs(mean(buff.matrix,na.rm=TRUE) - mean(r.matrix,na.rm=TRUE)) > err.tol){
+     stop("No agreement in mean")
+   }
+   
+   
+   if(abs(Var(buff.matrix,na.rm=TRUE) - var(as.vector(r.matrix),na.rm=TRUE)) > err.tol){
+     stop("No agreement in Var")
+   }
+   
+   
+ 
+   if(any(abs(rowMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,mean,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowMeans")
+   }
+   
+   
+   if(any(abs(colMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,mean,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colMeans")
+   }
+   
+   
+   if(any(abs(rowSums(buff.matrix,na.rm=TRUE)  -  apply(r.matrix,1,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in rowSums")
+   }
+   
+   
+   if(any(abs(colSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colSums")
+   }
+   
+   ### this is to get around the fact that R doesn't like to compute NA on an entire vector of NA when 
+   ### computing variance
+   my.Var <- function(x,na.rm=FALSE){
+    if (all(is.na(x))){
+      return(NA)
+    } else {
+      var(x,na.rm=na.rm)
+    }
+ 
+   }
+   
+   if(any(abs(rowVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+   
+   
+   if(any(abs(colVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+ 
+ 
+   if(any(abs(rowMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+ 
+   if(any(abs(colMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+   
+   
+   if(any(abs(rowMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+   
+ 
+   if(any(abs(colMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+ 
+   if(any(abs(colMedians(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,median,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMedian")
+   }
+ 
+   if(any(abs(colRanges(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,range,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colRanges")
+   }
+ 
+ 
+   
+ }
> 
> 
> 
> 
> 
> 
> 
> 
> 
> for (rep in 1:20){
+   copymatrix <- matrix(rnorm(200,150,15),10,20)
+   
+   tmp5[1:10,1:20] <- copymatrix
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ## now lets assign some NA values and check agreement
+ 
+   which.row <- sample(1:10,1,replace=TRUE)
+   which.col  <- sample(1:20,1,replace=TRUE)
+   
+   cat(which.row," ",which.col,"\n")
+   
+   tmp5[which.row,which.col] <- NA
+   copymatrix[which.row,which.col] <- NA
+   
+   agree.checks(tmp5,copymatrix)
+ 
+   ## make an entire row NA
+   tmp5[which.row,] <- NA
+   copymatrix[which.row,] <- NA
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ### also make an entire col NA
+   tmp5[,which.col] <- NA
+   copymatrix[,which.col] <- NA
+ 
+   agree.checks(tmp5,copymatrix)
+ 
+   ### now make 1 element non NA with NA in the rest of row and column
+ 
+   tmp5[which.row,which.col] <- rnorm(1,150,15)
+   copymatrix[which.row,which.col] <- tmp5[which.row,which.col]
+ 
+   agree.checks(tmp5,copymatrix)
+ }
7   4 
2   1 
2   3 
7   6 
2   20 
3   13 
9   14 
3   1 
5   5 
10   12 
4   10 
6   16 
2   6 
8   2 
6   9 
6   12 
7   19 
2   15 
9   14 
9   5 
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] 1.953201
> Min(tmp)
[1] -2.809662
> mean(tmp)
[1] -0.03301412
> Sum(tmp)
[1] -3.301412
> Var(tmp)
[1] 0.9343147
> 
> rowMeans(tmp)
[1] -0.03301412
> rowSums(tmp)
[1] -3.301412
> rowVars(tmp)
[1] 0.9343147
> rowSd(tmp)
[1] 0.9665996
> rowMax(tmp)
[1] 1.953201
> rowMin(tmp)
[1] -2.809662
> 
> colMeans(tmp)
  [1] -0.982035629 -0.883578666  1.516486131 -0.587990511 -1.098546089
  [6]  0.259620030  0.760530604  1.619508812 -0.033121640 -1.707892727
 [11]  1.764526981  0.897392191  0.525823146  1.521924810  1.842521449
 [16] -0.334101890 -2.298976030  1.127923373 -0.274364380  0.525431101
 [21] -0.008601624 -0.411789698  0.099360265  0.624912601 -1.226861871
 [26] -0.538466479  0.558213084 -1.083189451  1.019753622  1.166532857
 [31]  0.904743926 -0.112029473 -1.268406867 -0.593915367  0.730406471
 [36]  0.823321228 -1.155671674 -1.606108877 -1.468609907 -0.941760965
 [41] -0.561712940 -0.536654596  0.803834772 -1.414886869  0.756003252
 [46]  1.953200651 -0.137656444  0.737709269 -1.570997715  0.491729286
 [51] -0.679126021 -0.260713273  0.041869138  0.304936171  1.205823384
 [56]  1.069402505  0.092762074  0.918603595 -0.364328777  0.359746781
 [61]  0.521669867 -0.319718560 -1.435644968  1.254160515 -0.279490943
 [66] -1.653268296  0.126916500  0.367450421  0.359832366  0.093562760
 [71] -0.576207779  0.501770130 -0.209016442  0.470227382 -1.811132381
 [76] -0.429072804  0.945293865  1.540705454  0.447338894 -0.188057331
 [81] -0.869108849 -0.349952407  0.951910222 -0.110946159 -1.472005124
 [86]  1.091937892 -0.761558347 -2.809661840 -0.234141056 -0.147442161
 [91]  0.945270230 -0.303771218 -0.208873133 -0.426228832  0.626662385
 [96] -0.023016497 -0.276301615 -0.415009899 -0.962155894 -0.156795660
> colSums(tmp)
  [1] -0.982035629 -0.883578666  1.516486131 -0.587990511 -1.098546089
  [6]  0.259620030  0.760530604  1.619508812 -0.033121640 -1.707892727
 [11]  1.764526981  0.897392191  0.525823146  1.521924810  1.842521449
 [16] -0.334101890 -2.298976030  1.127923373 -0.274364380  0.525431101
 [21] -0.008601624 -0.411789698  0.099360265  0.624912601 -1.226861871
 [26] -0.538466479  0.558213084 -1.083189451  1.019753622  1.166532857
 [31]  0.904743926 -0.112029473 -1.268406867 -0.593915367  0.730406471
 [36]  0.823321228 -1.155671674 -1.606108877 -1.468609907 -0.941760965
 [41] -0.561712940 -0.536654596  0.803834772 -1.414886869  0.756003252
 [46]  1.953200651 -0.137656444  0.737709269 -1.570997715  0.491729286
 [51] -0.679126021 -0.260713273  0.041869138  0.304936171  1.205823384
 [56]  1.069402505  0.092762074  0.918603595 -0.364328777  0.359746781
 [61]  0.521669867 -0.319718560 -1.435644968  1.254160515 -0.279490943
 [66] -1.653268296  0.126916500  0.367450421  0.359832366  0.093562760
 [71] -0.576207779  0.501770130 -0.209016442  0.470227382 -1.811132381
 [76] -0.429072804  0.945293865  1.540705454  0.447338894 -0.188057331
 [81] -0.869108849 -0.349952407  0.951910222 -0.110946159 -1.472005124
 [86]  1.091937892 -0.761558347 -2.809661840 -0.234141056 -0.147442161
 [91]  0.945270230 -0.303771218 -0.208873133 -0.426228832  0.626662385
 [96] -0.023016497 -0.276301615 -0.415009899 -0.962155894 -0.156795660
> 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.982035629 -0.883578666  1.516486131 -0.587990511 -1.098546089
  [6]  0.259620030  0.760530604  1.619508812 -0.033121640 -1.707892727
 [11]  1.764526981  0.897392191  0.525823146  1.521924810  1.842521449
 [16] -0.334101890 -2.298976030  1.127923373 -0.274364380  0.525431101
 [21] -0.008601624 -0.411789698  0.099360265  0.624912601 -1.226861871
 [26] -0.538466479  0.558213084 -1.083189451  1.019753622  1.166532857
 [31]  0.904743926 -0.112029473 -1.268406867 -0.593915367  0.730406471
 [36]  0.823321228 -1.155671674 -1.606108877 -1.468609907 -0.941760965
 [41] -0.561712940 -0.536654596  0.803834772 -1.414886869  0.756003252
 [46]  1.953200651 -0.137656444  0.737709269 -1.570997715  0.491729286
 [51] -0.679126021 -0.260713273  0.041869138  0.304936171  1.205823384
 [56]  1.069402505  0.092762074  0.918603595 -0.364328777  0.359746781
 [61]  0.521669867 -0.319718560 -1.435644968  1.254160515 -0.279490943
 [66] -1.653268296  0.126916500  0.367450421  0.359832366  0.093562760
 [71] -0.576207779  0.501770130 -0.209016442  0.470227382 -1.811132381
 [76] -0.429072804  0.945293865  1.540705454  0.447338894 -0.188057331
 [81] -0.869108849 -0.349952407  0.951910222 -0.110946159 -1.472005124
 [86]  1.091937892 -0.761558347 -2.809661840 -0.234141056 -0.147442161
 [91]  0.945270230 -0.303771218 -0.208873133 -0.426228832  0.626662385
 [96] -0.023016497 -0.276301615 -0.415009899 -0.962155894 -0.156795660
> colMin(tmp)
  [1] -0.982035629 -0.883578666  1.516486131 -0.587990511 -1.098546089
  [6]  0.259620030  0.760530604  1.619508812 -0.033121640 -1.707892727
 [11]  1.764526981  0.897392191  0.525823146  1.521924810  1.842521449
 [16] -0.334101890 -2.298976030  1.127923373 -0.274364380  0.525431101
 [21] -0.008601624 -0.411789698  0.099360265  0.624912601 -1.226861871
 [26] -0.538466479  0.558213084 -1.083189451  1.019753622  1.166532857
 [31]  0.904743926 -0.112029473 -1.268406867 -0.593915367  0.730406471
 [36]  0.823321228 -1.155671674 -1.606108877 -1.468609907 -0.941760965
 [41] -0.561712940 -0.536654596  0.803834772 -1.414886869  0.756003252
 [46]  1.953200651 -0.137656444  0.737709269 -1.570997715  0.491729286
 [51] -0.679126021 -0.260713273  0.041869138  0.304936171  1.205823384
 [56]  1.069402505  0.092762074  0.918603595 -0.364328777  0.359746781
 [61]  0.521669867 -0.319718560 -1.435644968  1.254160515 -0.279490943
 [66] -1.653268296  0.126916500  0.367450421  0.359832366  0.093562760
 [71] -0.576207779  0.501770130 -0.209016442  0.470227382 -1.811132381
 [76] -0.429072804  0.945293865  1.540705454  0.447338894 -0.188057331
 [81] -0.869108849 -0.349952407  0.951910222 -0.110946159 -1.472005124
 [86]  1.091937892 -0.761558347 -2.809661840 -0.234141056 -0.147442161
 [91]  0.945270230 -0.303771218 -0.208873133 -0.426228832  0.626662385
 [96] -0.023016497 -0.276301615 -0.415009899 -0.962155894 -0.156795660
> colMedians(tmp)
  [1] -0.982035629 -0.883578666  1.516486131 -0.587990511 -1.098546089
  [6]  0.259620030  0.760530604  1.619508812 -0.033121640 -1.707892727
 [11]  1.764526981  0.897392191  0.525823146  1.521924810  1.842521449
 [16] -0.334101890 -2.298976030  1.127923373 -0.274364380  0.525431101
 [21] -0.008601624 -0.411789698  0.099360265  0.624912601 -1.226861871
 [26] -0.538466479  0.558213084 -1.083189451  1.019753622  1.166532857
 [31]  0.904743926 -0.112029473 -1.268406867 -0.593915367  0.730406471
 [36]  0.823321228 -1.155671674 -1.606108877 -1.468609907 -0.941760965
 [41] -0.561712940 -0.536654596  0.803834772 -1.414886869  0.756003252
 [46]  1.953200651 -0.137656444  0.737709269 -1.570997715  0.491729286
 [51] -0.679126021 -0.260713273  0.041869138  0.304936171  1.205823384
 [56]  1.069402505  0.092762074  0.918603595 -0.364328777  0.359746781
 [61]  0.521669867 -0.319718560 -1.435644968  1.254160515 -0.279490943
 [66] -1.653268296  0.126916500  0.367450421  0.359832366  0.093562760
 [71] -0.576207779  0.501770130 -0.209016442  0.470227382 -1.811132381
 [76] -0.429072804  0.945293865  1.540705454  0.447338894 -0.188057331
 [81] -0.869108849 -0.349952407  0.951910222 -0.110946159 -1.472005124
 [86]  1.091937892 -0.761558347 -2.809661840 -0.234141056 -0.147442161
 [91]  0.945270230 -0.303771218 -0.208873133 -0.426228832  0.626662385
 [96] -0.023016497 -0.276301615 -0.415009899 -0.962155894 -0.156795660
> colRanges(tmp)
           [,1]       [,2]     [,3]       [,4]      [,5]    [,6]      [,7]
[1,] -0.9820356 -0.8835787 1.516486 -0.5879905 -1.098546 0.25962 0.7605306
[2,] -0.9820356 -0.8835787 1.516486 -0.5879905 -1.098546 0.25962 0.7605306
         [,8]        [,9]     [,10]    [,11]     [,12]     [,13]    [,14]
[1,] 1.619509 -0.03312164 -1.707893 1.764527 0.8973922 0.5258231 1.521925
[2,] 1.619509 -0.03312164 -1.707893 1.764527 0.8973922 0.5258231 1.521925
        [,15]      [,16]     [,17]    [,18]      [,19]     [,20]        [,21]
[1,] 1.842521 -0.3341019 -2.298976 1.127923 -0.2743644 0.5254311 -0.008601624
[2,] 1.842521 -0.3341019 -2.298976 1.127923 -0.2743644 0.5254311 -0.008601624
          [,22]      [,23]     [,24]     [,25]      [,26]     [,27]     [,28]
[1,] -0.4117897 0.09936026 0.6249126 -1.226862 -0.5384665 0.5582131 -1.083189
[2,] -0.4117897 0.09936026 0.6249126 -1.226862 -0.5384665 0.5582131 -1.083189
        [,29]    [,30]     [,31]      [,32]     [,33]      [,34]     [,35]
[1,] 1.019754 1.166533 0.9047439 -0.1120295 -1.268407 -0.5939154 0.7304065
[2,] 1.019754 1.166533 0.9047439 -0.1120295 -1.268407 -0.5939154 0.7304065
         [,36]     [,37]     [,38]    [,39]     [,40]      [,41]      [,42]
[1,] 0.8233212 -1.155672 -1.606109 -1.46861 -0.941761 -0.5617129 -0.5366546
[2,] 0.8233212 -1.155672 -1.606109 -1.46861 -0.941761 -0.5617129 -0.5366546
         [,43]     [,44]     [,45]    [,46]      [,47]     [,48]     [,49]
[1,] 0.8038348 -1.414887 0.7560033 1.953201 -0.1376564 0.7377093 -1.570998
[2,] 0.8038348 -1.414887 0.7560033 1.953201 -0.1376564 0.7377093 -1.570998
         [,50]     [,51]      [,52]      [,53]     [,54]    [,55]    [,56]
[1,] 0.4917293 -0.679126 -0.2607133 0.04186914 0.3049362 1.205823 1.069403
[2,] 0.4917293 -0.679126 -0.2607133 0.04186914 0.3049362 1.205823 1.069403
          [,57]     [,58]      [,59]     [,60]     [,61]      [,62]     [,63]
[1,] 0.09276207 0.9186036 -0.3643288 0.3597468 0.5216699 -0.3197186 -1.435645
[2,] 0.09276207 0.9186036 -0.3643288 0.3597468 0.5216699 -0.3197186 -1.435645
        [,64]      [,65]     [,66]     [,67]     [,68]     [,69]      [,70]
[1,] 1.254161 -0.2794909 -1.653268 0.1269165 0.3674504 0.3598324 0.09356276
[2,] 1.254161 -0.2794909 -1.653268 0.1269165 0.3674504 0.3598324 0.09356276
          [,71]     [,72]      [,73]     [,74]     [,75]      [,76]     [,77]
[1,] -0.5762078 0.5017701 -0.2090164 0.4702274 -1.811132 -0.4290728 0.9452939
[2,] -0.5762078 0.5017701 -0.2090164 0.4702274 -1.811132 -0.4290728 0.9452939
        [,78]     [,79]      [,80]      [,81]      [,82]     [,83]      [,84]
[1,] 1.540705 0.4473389 -0.1880573 -0.8691088 -0.3499524 0.9519102 -0.1109462
[2,] 1.540705 0.4473389 -0.1880573 -0.8691088 -0.3499524 0.9519102 -0.1109462
         [,85]    [,86]      [,87]     [,88]      [,89]      [,90]     [,91]
[1,] -1.472005 1.091938 -0.7615583 -2.809662 -0.2341411 -0.1474422 0.9452702
[2,] -1.472005 1.091938 -0.7615583 -2.809662 -0.2341411 -0.1474422 0.9452702
          [,92]      [,93]      [,94]     [,95]      [,96]      [,97]
[1,] -0.3037712 -0.2088731 -0.4262288 0.6266624 -0.0230165 -0.2763016
[2,] -0.3037712 -0.2088731 -0.4262288 0.6266624 -0.0230165 -0.2763016
          [,98]      [,99]     [,100]
[1,] -0.4150099 -0.9621559 -0.1567957
[2,] -0.4150099 -0.9621559 -0.1567957
> 
> 
> Max(tmp2)
[1] 2.057996
> Min(tmp2)
[1] -2.298272
> mean(tmp2)
[1] 0.07603265
> Sum(tmp2)
[1] 7.603265
> Var(tmp2)
[1] 0.8256735
> 
> rowMeans(tmp2)
  [1] -0.89844281  1.21803282  1.06598488 -0.62513436  0.36411391  0.57155273
  [7]  0.23198220 -0.58811438  0.72973095  0.18261816 -0.29039351  0.88057550
 [13]  0.99934837 -0.71939043  0.33810117  0.27692611  0.01990809  0.80373328
 [19]  0.78706332  1.38034159 -0.23556077 -0.38087306 -0.54408793 -0.58543629
 [25]  1.66136868  0.12557355 -0.65835958 -0.98603318 -1.20644758 -1.29545352
 [31] -0.11909616  0.12595913 -1.31626112  0.30316056 -0.25989083 -0.07221527
 [37] -0.15219797 -1.41957147 -1.55145934  0.43896305  0.13356977  0.54654991
 [43] -0.58865444 -1.03569733  0.11550994 -0.41877704  1.83672793  0.41506233
 [49] -0.06739722  0.46910372  0.96782744 -2.04326297 -0.66845827  1.25891230
 [55]  0.12369839 -0.28742853  1.95012504 -0.65482553  0.79199988 -0.03823754
 [61]  0.68459521  1.66166379 -0.51417589  1.13768558 -0.10264846 -1.50547110
 [67]  0.05703891  0.70374429  0.44606957  0.26249441  2.05799555  1.36127064
 [73]  0.68633767 -1.02998802  0.92163931 -0.09943386 -0.71070605 -1.64379551
 [79]  0.36926232  1.34655348  0.09179338  0.43414862  1.74967428 -2.29827224
 [85] -0.08391244  0.25549380  1.54924908  0.55906645  0.12332668 -0.17138038
 [91] -1.80821799 -0.81081046 -0.27715083 -0.15258245  0.12394714  0.40639931
 [97] -1.01631295  0.41861013  0.67252441  0.34057350
> rowSums(tmp2)
  [1] -0.89844281  1.21803282  1.06598488 -0.62513436  0.36411391  0.57155273
  [7]  0.23198220 -0.58811438  0.72973095  0.18261816 -0.29039351  0.88057550
 [13]  0.99934837 -0.71939043  0.33810117  0.27692611  0.01990809  0.80373328
 [19]  0.78706332  1.38034159 -0.23556077 -0.38087306 -0.54408793 -0.58543629
 [25]  1.66136868  0.12557355 -0.65835958 -0.98603318 -1.20644758 -1.29545352
 [31] -0.11909616  0.12595913 -1.31626112  0.30316056 -0.25989083 -0.07221527
 [37] -0.15219797 -1.41957147 -1.55145934  0.43896305  0.13356977  0.54654991
 [43] -0.58865444 -1.03569733  0.11550994 -0.41877704  1.83672793  0.41506233
 [49] -0.06739722  0.46910372  0.96782744 -2.04326297 -0.66845827  1.25891230
 [55]  0.12369839 -0.28742853  1.95012504 -0.65482553  0.79199988 -0.03823754
 [61]  0.68459521  1.66166379 -0.51417589  1.13768558 -0.10264846 -1.50547110
 [67]  0.05703891  0.70374429  0.44606957  0.26249441  2.05799555  1.36127064
 [73]  0.68633767 -1.02998802  0.92163931 -0.09943386 -0.71070605 -1.64379551
 [79]  0.36926232  1.34655348  0.09179338  0.43414862  1.74967428 -2.29827224
 [85] -0.08391244  0.25549380  1.54924908  0.55906645  0.12332668 -0.17138038
 [91] -1.80821799 -0.81081046 -0.27715083 -0.15258245  0.12394714  0.40639931
 [97] -1.01631295  0.41861013  0.67252441  0.34057350
> rowVars(tmp2)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowSd(tmp2)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowMax(tmp2)
  [1] -0.89844281  1.21803282  1.06598488 -0.62513436  0.36411391  0.57155273
  [7]  0.23198220 -0.58811438  0.72973095  0.18261816 -0.29039351  0.88057550
 [13]  0.99934837 -0.71939043  0.33810117  0.27692611  0.01990809  0.80373328
 [19]  0.78706332  1.38034159 -0.23556077 -0.38087306 -0.54408793 -0.58543629
 [25]  1.66136868  0.12557355 -0.65835958 -0.98603318 -1.20644758 -1.29545352
 [31] -0.11909616  0.12595913 -1.31626112  0.30316056 -0.25989083 -0.07221527
 [37] -0.15219797 -1.41957147 -1.55145934  0.43896305  0.13356977  0.54654991
 [43] -0.58865444 -1.03569733  0.11550994 -0.41877704  1.83672793  0.41506233
 [49] -0.06739722  0.46910372  0.96782744 -2.04326297 -0.66845827  1.25891230
 [55]  0.12369839 -0.28742853  1.95012504 -0.65482553  0.79199988 -0.03823754
 [61]  0.68459521  1.66166379 -0.51417589  1.13768558 -0.10264846 -1.50547110
 [67]  0.05703891  0.70374429  0.44606957  0.26249441  2.05799555  1.36127064
 [73]  0.68633767 -1.02998802  0.92163931 -0.09943386 -0.71070605 -1.64379551
 [79]  0.36926232  1.34655348  0.09179338  0.43414862  1.74967428 -2.29827224
 [85] -0.08391244  0.25549380  1.54924908  0.55906645  0.12332668 -0.17138038
 [91] -1.80821799 -0.81081046 -0.27715083 -0.15258245  0.12394714  0.40639931
 [97] -1.01631295  0.41861013  0.67252441  0.34057350
> rowMin(tmp2)
  [1] -0.89844281  1.21803282  1.06598488 -0.62513436  0.36411391  0.57155273
  [7]  0.23198220 -0.58811438  0.72973095  0.18261816 -0.29039351  0.88057550
 [13]  0.99934837 -0.71939043  0.33810117  0.27692611  0.01990809  0.80373328
 [19]  0.78706332  1.38034159 -0.23556077 -0.38087306 -0.54408793 -0.58543629
 [25]  1.66136868  0.12557355 -0.65835958 -0.98603318 -1.20644758 -1.29545352
 [31] -0.11909616  0.12595913 -1.31626112  0.30316056 -0.25989083 -0.07221527
 [37] -0.15219797 -1.41957147 -1.55145934  0.43896305  0.13356977  0.54654991
 [43] -0.58865444 -1.03569733  0.11550994 -0.41877704  1.83672793  0.41506233
 [49] -0.06739722  0.46910372  0.96782744 -2.04326297 -0.66845827  1.25891230
 [55]  0.12369839 -0.28742853  1.95012504 -0.65482553  0.79199988 -0.03823754
 [61]  0.68459521  1.66166379 -0.51417589  1.13768558 -0.10264846 -1.50547110
 [67]  0.05703891  0.70374429  0.44606957  0.26249441  2.05799555  1.36127064
 [73]  0.68633767 -1.02998802  0.92163931 -0.09943386 -0.71070605 -1.64379551
 [79]  0.36926232  1.34655348  0.09179338  0.43414862  1.74967428 -2.29827224
 [85] -0.08391244  0.25549380  1.54924908  0.55906645  0.12332668 -0.17138038
 [91] -1.80821799 -0.81081046 -0.27715083 -0.15258245  0.12394714  0.40639931
 [97] -1.01631295  0.41861013  0.67252441  0.34057350
> 
> colMeans(tmp2)
[1] 0.07603265
> colSums(tmp2)
[1] 7.603265
> colVars(tmp2)
[1] 0.8256735
> colSd(tmp2)
[1] 0.9086658
> colMax(tmp2)
[1] 2.057996
> colMin(tmp2)
[1] -2.298272
> colMedians(tmp2)
[1] 0.1238228
> colRanges(tmp2)
          [,1]
[1,] -2.298272
[2,]  2.057996
> 
> dataset1 <- matrix(dataset1,1,100)
> 
> agree.checks(tmp,dataset1)
> 
> dataset2 <- matrix(dataset2,100,1)
> agree.checks(tmp2,dataset2)
>   
> 
> tmp <- createBufferedMatrix(10,10)
> 
> tmp[1:10,1:10] <- rnorm(100)
> colApply(tmp,sum)
 [1]  2.0032823 -4.7857336 -0.8511249  4.4448447  0.4125005  3.7306054
 [7]  1.3070283 -2.8833106 -0.1308688  0.2516110
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -1.0833956
[2,] -0.7986391
[3,]  0.1826581
[4,]  0.8715756
[5,]  2.2200868
> 
> rowApply(tmp,sum)
 [1] -0.6688005 -1.2210660  3.6178194 -0.1286006 -3.3298672  0.6742277
 [7]  6.0106845 -2.9150762 -3.0081067  4.4676200
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    2    7    8    6    9    3   10    2    3     5
 [2,]    3    2    1    1    3    9    4   10   10     1
 [3,]    9    3    2    4    7    7    6    6    1     8
 [4,]    6    9    9   10    4    2    7    8    7     6
 [5,]    4    4    7    3    6    8    9    3    8     3
 [6,]    1   10   10    5   10    5    2    4    6    10
 [7,]    8    6    4    7    2   10    8    9    2     4
 [8,]    5    8    3    8    5    1    1    1    9     2
 [9,]   10    1    5    2    8    6    3    7    4     7
[10,]    7    5    6    9    1    4    5    5    5     9
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1]  2.72816295  2.07866217  3.68589174 -2.35840653  1.94236203 -0.05388393
 [7]  1.20390933  0.64556134  0.49621752  3.83421718 -3.86406580  0.90884830
[13]  0.75918042 -4.55766564  0.48987421  0.52683209 -0.35572351  0.89369281
[19]  0.95698442 -2.40215572
> colApply(tmp,quantile)[,1]
            [,1]
[1,] -0.94706587
[2,] -0.05359485
[3,]  0.31881464
[4,]  0.53266086
[5,]  2.87734816
> 
> rowApply(tmp,sum)
[1] -6.325922 -4.605986  9.027894  7.276482  2.186027
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]    5   16   20    7   11
[2,]   12    5   16   15   15
[3,]    7   19   18   17   16
[4,]    3    6    2   12   12
[5,]   17    8   15    8   17
> 
> 
> as.matrix(tmp)
            [,1]       [,2]       [,3]       [,4]        [,5]       [,6]
[1,] -0.94706587  0.1772938 -0.9282249 -1.5771687  0.57147790  0.7627618
[2,]  0.53266086 -0.8275304  0.8484456 -0.8021524 -0.54372249  0.4107708
[3,]  2.87734816  1.1138708  1.4441409 -0.7495233  0.85556115  0.5483513
[4,] -0.05359485  0.8140768  1.3268464  0.3165442 -0.03222744 -0.9961431
[5,]  0.31881464  0.8009511  0.9946838  0.4538937  1.09127291 -0.7796247
           [,7]       [,8]       [,9]     [,10]      [,11]      [,12]
[1,] -0.1337211  0.9933308 -1.9994147 0.3596106 -1.4181789  0.4652609
[2,] -0.2462605 -0.4945652  0.5767035 0.3218582  0.1512015  0.7501353
[3,]  1.5545705 -0.2541998 -0.5283344 0.3114520 -0.2523885 -1.5646067
[4,] -1.1458618  0.5530770  3.0230896 1.6835055 -0.3150345  1.8332567
[5,]  1.1751821 -0.1520814 -0.5758265 1.1577910 -2.0296653 -0.5751979
           [,13]      [,14]       [,15]       [,16]       [,17]      [,18]
[1,] -0.39798031 -0.7883651  0.53047237  0.54561221 -0.43320034 -1.9283740
[2,] -1.41817755 -2.2105051  0.06492029  0.07409485 -1.31138148  1.7390475
[3,]  1.35716384 -0.2955660  0.48034089  0.21488307  0.75328376  0.2266084
[4,]  0.08803773 -1.0024250  0.02830194  0.26150486 -0.08588571  0.7134749
[5,]  1.13013670 -0.2608045 -0.61416128 -0.56926290  0.72146027  0.1429359
          [,19]      [,20]
[1,]  0.7487826 -0.9288311
[2,] -0.5518421 -1.6696868
[3,]  0.3612023  0.5737355
[4,]  1.1402496 -0.8743105
[5,] -0.7414078  0.4969372
> 
> 
> 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 :  655  bytes.
Disk usage :  200  bytes.
> subBufferedMatrix(tmp,,5:8)
BufferedMatrix object
Matrix size:  5 4 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  567  bytes.
Disk usage :  160  bytes.
> subBufferedMatrix(tmp,1:3,)
BufferedMatrix object
Matrix size:  3 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.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
row1 -0.3866848 0.0006075727 -0.5112538 -0.4714843 0.3340168 -0.362206
          col7      col8      col9     col10     col11       col12     col13
row1 0.5232918 -1.451336 -2.204604 -0.198306 -3.500699 -0.05203344 0.5570303
         col14     col15       col16     col17  col18    col19     col20
row1 -1.490271 0.3337095 -0.02741122 0.7668572 0.5477 1.977854 0.3062066
> tmp[,"col10"]
           col10
row1 -0.19830595
row2  2.06461306
row3  0.40633692
row4  0.60047836
row5 -0.02865372
> tmp[c("row1","row5"),]
           col1         col2       col3       col4       col5       col6
row1 -0.3866848 0.0006075727 -0.5112538 -0.4714843  0.3340168 -0.3622060
row5  0.4778659 0.8461199761  1.2760355  0.3938894 -0.4426996 -0.6049776
           col7      col8      col9       col10     col11       col12     col13
row1  0.5232918 -1.451336 -2.204604 -0.19830595 -3.500699 -0.05203344 0.5570303
row5 -0.2522364 -0.362749  1.100870 -0.02865372 -1.241168  1.05606598 0.6496935
          col14     col15       col16     col17    col18      col19       col20
row1 -1.4902707 0.3337095 -0.02741122 0.7668572 0.547700  1.9778545  0.30620661
row5  0.2683643 0.4263215 -0.53524338 0.0484520 1.044354 -0.6200545 -0.04255686
> tmp[,c("col6","col20")]
           col6       col20
row1 -0.3622060  0.30620661
row2 -0.4963359  1.05822893
row3 -2.4103338  0.72254829
row4  1.9057231  0.13014050
row5 -0.6049776 -0.04255686
> tmp[c("row1","row5"),c("col6","col20")]
           col6       col20
row1 -0.3622060  0.30620661
row5 -0.6049776 -0.04255686
> 
> 
> 
> 
> tmp["row1",] <- rnorm(20,mean=10)
> tmp[,"col10"] <- rnorm(5,mean=30)
> tmp[c("row1","row5"),] <- rnorm(40,mean=50)
> tmp[,c("col6","col20")] <- rnorm(10,mean=75)
> tmp[c("row1","row5"),c("col6","col20")]  <- rnorm(4,mean=105)
> 
> tmp["row1",]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 50.55936 51.49144 51.21307 49.17411 49.80649 105.6417 51.87069 48.85038
         col9    col10    col11    col12    col13    col14    col15    col16
row1 49.85569 50.14807 50.20171 48.84496 49.86463 49.85595 49.99447 49.50341
        col17    col18    col19    col20
row1 50.01664 50.17706 49.98651 105.1071
> tmp[,"col10"]
        col10
row1 50.14807
row2 30.95872
row3 28.86502
row4 27.08546
row5 50.10441
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 50.55936 51.49144 51.21307 49.17411 49.80649 105.6417 51.87069 48.85038
row5 51.16230 50.64817 50.64494 50.92609 48.67977 105.7597 50.32978 51.71090
         col9    col10    col11    col12    col13    col14    col15    col16
row1 49.85569 50.14807 50.20171 48.84496 49.86463 49.85595 49.99447 49.50341
row5 50.17875 50.10441 50.65567 50.21897 49.00358 50.30253 49.97867 51.58451
        col17    col18    col19    col20
row1 50.01664 50.17706 49.98651 105.1071
row5 49.94021 49.86512 48.69957 102.6112
> tmp[,c("col6","col20")]
          col6     col20
row1 105.64166 105.10713
row2  75.72199  75.19664
row3  74.69281  73.81310
row4  75.79256  74.87392
row5 105.75969 102.61121
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 105.6417 105.1071
row5 105.7597 102.6112
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 105.6417 105.1071
row5 105.7597 102.6112
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
          col13
[1,] -1.2782069
[2,]  0.6677130
[3,] -1.3280623
[4,]  1.1892328
[5,] -0.5202158
> tmp[,c("col17","col7")]
            col17      col7
[1,] -2.052221483 0.9006893
[2,]  0.007026299 0.5116972
[3,]  2.032053627 0.2584339
[4,]  0.117882491 0.6551952
[5,]  1.166827608 0.1657140
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
           col6      col20
[1,] -0.5621429  1.6720862
[2,]  0.7618617 -1.1796686
[3,] -0.9802343  0.9686198
[4,]  0.8987855  1.5190550
[5,]  0.8054900 -0.8891623
> subBufferedMatrix(tmp,1,c("col6"))[,1]
           col1
[1,] -0.5621429
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
           col6
[1,] -0.5621429
[2,]  0.7618617
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> 
> 
> 
> subBufferedMatrix(tmp,c("row3","row1"),)[,1:20]
           [,1]       [,2]       [,3]      [,4]       [,5]       [,6]
row3  1.1175451  0.9206503  1.5879144 0.2907810 -0.8581944 -1.6910257
row1 -0.1266903 -0.5836545 -0.2454332 0.1772952  0.5032154 -0.3973668
            [,7]      [,8]       [,9]      [,10]     [,11]      [,12]
row3  0.20013872 0.7574094 -0.7271279 -0.6562553 0.8228837  0.3573943
row1 -0.01306197 1.6748796 -0.2882522  0.1406745 1.1954026 -0.1389038
           [,13]      [,14]      [,15]       [,16]      [,17]      [,18]
row3 -0.02021645 -0.5432074 -0.9324708 -0.02355819  1.1500748 -2.2220180
row1 -1.09221922  0.0946048  0.5460507 -0.57821491 -0.9404247  0.5577004
          [,19]    [,20]
row3  1.3237387 1.116682
row1 -0.7097258 1.314283
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
          [,1]       [,2]       [,3]       [,4]      [,5]       [,6]     [,7]
row2 -1.008266 -0.1263882 -0.3311038 -0.3414353 -1.049652 -0.5848447 -1.14987
         [,8]      [,9]    [,10]
row2 1.002107 0.5641119 -1.50032
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
           [,1]        [,2]      [,3]      [,4]      [,5]       [,6]       [,7]
row5 0.04578486 -0.09750679 0.5731904 0.2778264 0.4867715 -0.3406614 -0.1540146
          [,8]      [,9]    [,10]     [,11]     [,12]     [,13]    [,14]
row5 0.3813256 0.8331116 1.261744 -1.014666 0.3701871 0.7206146 1.610074
         [,15]    [,16]      [,17]     [,18]    [,19]    [,20]
row5 -0.921494 1.101756 -0.6088642 0.2418532 1.252185 1.994933
> 
> 
> 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: 0x600003000600>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM1540d2881af13"
 [2] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM1540d5a0d1d2b"
 [3] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM1540d12f6203d"
 [4] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM1540d5cbe8e84"
 [5] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM1540d627eabad"
 [6] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM1540d6a391d5f"
 [7] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM1540d4bb77e74"
 [8] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM1540d7bcf1881"
 [9] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM1540d5951fca7"
[10] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM1540d15a265c1"
[11] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM1540d58c66cff"
[12] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM1540d4b1e06e1"
[13] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM1540d2055c44e"
[14] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM1540d5ecaed77"
[15] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM1540d5cac503f"
> 
> 
> ### 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: 0x60000300c180>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x60000300c180>
Warning message:
In dir.create(new.directory) :
  '/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x60000300c180>
> rowMedians(tmp)
  [1] -0.186941463  0.064577602 -0.184661939 -0.070486065  0.313329983
  [6]  0.353000819  0.111460618  0.275762968 -0.408373128  0.284546479
 [11] -0.669924733 -0.107107572 -0.331509183  0.553110795  0.538119197
 [16]  0.175209059 -0.783299869 -0.211832712 -0.528096342  0.040835207
 [21]  0.282875812 -0.325305394  0.270335456  0.409204637  0.180875711
 [26] -1.041689635  0.300061835  0.313327595 -0.034039915  0.094469045
 [31] -0.101045587  0.753768298 -0.269044397  0.052660618 -0.250709174
 [36]  0.030871986 -0.215300937 -0.166993462  0.156979620  0.268363632
 [41] -0.329116575  0.232051485  0.325917223  0.329328347  0.297703375
 [46] -0.012724603  0.242247772 -0.494084503  0.136864962 -0.100754645
 [51]  0.412572837  0.184850055 -0.300072827  0.184052588 -0.362403034
 [56] -0.096469444  0.514104563 -0.025823724  0.175438149 -0.486494252
 [61]  0.349794898 -0.427108524  0.416044359  0.205393037  0.136239123
 [66]  0.535585572 -0.179388953 -0.421307458 -0.249739961  0.467159889
 [71] -0.076526095  0.533066264 -0.115880991 -0.209681147  0.456908957
 [76] -0.072055875  0.096010316 -0.061528532  0.038224194  0.198736694
 [81]  0.173957810 -0.425343076 -0.132809448 -0.268867580 -0.283420815
 [86]  0.022567982  0.005950719  0.538904554  0.438738077  0.053909360
 [91]  0.649651457 -0.447173910 -0.069937582  0.320193574  0.028076241
 [96]  0.086961257  0.623614598  0.022443166 -0.498526953 -0.307789964
[101]  0.366389602 -0.198261831 -0.108083265 -0.063782691 -0.094909316
[106]  0.372846929  0.732373487  0.373148038 -0.255929056  0.424135973
[111]  0.028125405  0.352853069  0.011626822  0.185174112 -0.755545436
[116] -0.096991033  0.183226697  0.197398410 -0.483207376 -0.117354967
[121]  0.154211380 -0.692614684 -0.007090879  0.063363682  0.169135856
[126]  0.252152456 -0.362871987 -0.695642951 -0.204911736 -0.141583149
[131] -0.078081224  0.404353626 -0.358629293 -0.264910164 -0.715352054
[136]  0.051126147  0.402233496  0.247359937 -0.122685530  0.285807581
[141]  0.665611348  0.016737550  0.091199158 -0.295577660  0.392197514
[146]  0.097934976  0.274764198  0.249512142  0.246106438  0.453063897
[151]  0.108831800 -0.550521319  0.302514087 -0.215540326  0.091509286
[156] -0.044961236  0.157619033 -0.205848836  0.464080780 -0.112448215
[161]  0.028296700 -0.156686364  0.403750651 -0.676310774  0.042349021
[166] -0.148504845  0.085346301  0.860884428  0.686826139  0.287265307
[171]  0.325478929 -0.007771036 -0.253642718  0.064182180 -0.037837453
[176]  0.302887646 -0.356604398  0.332190215  0.361998100 -0.289815253
[181] -0.224983163  0.023426888 -0.438424742  0.242084579  0.218241267
[186]  0.286229120  0.386492657 -0.347590816  0.271888160  0.377779595
[191] -0.180640292  0.155740659 -0.708894458 -0.104542508 -0.113217419
[196] -0.094349931  0.386235362  0.312289633 -0.671800634  0.033796899
[201]  0.289294043  0.082732038 -0.324874313  0.290968495 -0.110262191
[206] -0.128885444  0.145230295  0.201510138  0.589401358 -0.073997896
[211] -0.010586550 -0.266122536 -0.028056577 -0.254893312  0.174259889
[216] -0.169803080 -0.222963632  0.353393244 -0.377509163  1.021539082
[221]  0.314426876  0.287793103  0.176905322  0.604319338  0.044554689
[226] -0.611059144 -0.620923860  0.124688329  0.420258846 -0.087047065
> 
> proc.time()
   user  system elapsed 
  0.630   2.923   3.710 

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: 0x6000037f0660>
> .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: 0x6000037f0660>
> .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: 0x6000037f0660>
> .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: 0x6000037f0660>
> 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: 0x6000037f4000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000037f4000>
> .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: 0x6000037f4000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000037f4000>
> .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: 0x6000037f4000>
> 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: 0x6000037f4180>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000037f4180>
> .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: 0x6000037f4180>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x6000037f4180>
> .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: 0x6000037f4180>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x6000037f4180>
> .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: 0x6000037f4180>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x6000037f4180>
> .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: 0x6000037f4180>
> 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: 0x6000037f4360>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x6000037f4360>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000037f4360>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000037f4360>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile1552517d40011" "BufferedMatrixFile155255f50684f"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile1552517d40011" "BufferedMatrixFile155255f50684f"
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000037f0de0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000037f0de0>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x6000037f0de0>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x6000037f0de0>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x6000037f0de0>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x6000037f0de0>
> .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: 0x6000037f0fc0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000037f0fc0>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x6000037f0fc0>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x6000037f0fc0>
> 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: 0x6000037f11a0>
> .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: 0x6000037f11a0>
> rm(P)
> 
> proc.time()
   user  system elapsed 
  0.109   0.036   0.142 

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.108   0.023   0.128 

Example timings