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

This page was generated on 2025-11-27 12:04 -0500 (Thu, 27 Nov 2025).

HostnameOSArch (*)R versionInstalled pkgs
nebbiolo2Linux (Ubuntu 24.04.3 LTS)x86_644.5.2 (2025-10-31) -- "[Not] Part in a Rumble" 4876
merida1macOS 12.7.6 Montereyx86_644.5.2 Patched (2025-11-05 r88990) -- "[Not] Part in a Rumble" 4656
kjohnson1macOS 13.7.5 Venturaarm644.5.2 Patched (2025-11-04 r88984) -- "[Not] Part in a Rumble" 4602
taishanLinux (openEuler 24.03 LTS)aarch644.5.0 (2025-04-11) -- "How About a Twenty-Six" 4668
Click on any hostname to see more info about the system (e.g. compilers)      (*) as reported by 'uname -p', except on Windows and Mac OS X

Package 257/2361HostnameOS / ArchINSTALLBUILDCHECKBUILD BIN
BufferedMatrix 1.74.0  (landing page)
Ben Bolstad
Snapshot Date: 2025-11-24 13:45 -0500 (Mon, 24 Nov 2025)
git_url: https://git.bioconductor.org/packages/BufferedMatrix
git_branch: RELEASE_3_22
git_last_commit: d2ce144
git_last_commit_date: 2025-10-29 09:58:55 -0500 (Wed, 29 Oct 2025)
nebbiolo2Linux (Ubuntu 24.04.3 LTS) / x86_64  OK    OK    OK  UNNEEDED, same version is already published
merida1macOS 12.7.6 Monterey / x86_64  OK    OK    WARNINGS    OK  UNNEEDED, same version is already published
kjohnson1macOS 13.7.5 Ventura / arm64  OK    OK    WARNINGS    OK  UNNEEDED, same version is already published
taishanLinux (openEuler 24.03 LTS) / aarch64  OK    OK    OK  


CHECK results for BufferedMatrix on kjohnson1

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

raw results


Summary

Package: BufferedMatrix
Version: 1.74.0
Command: /Library/Frameworks/R.framework/Resources/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/Library/Frameworks/R.framework/Resources/library --no-vignettes --timings BufferedMatrix_1.74.0.tar.gz
StartedAt: 2025-11-25 17:53:02 -0500 (Tue, 25 Nov 2025)
EndedAt: 2025-11-25 17:54:00 -0500 (Tue, 25 Nov 2025)
EllapsedTime: 57.7 seconds
RetCode: 0
Status:   WARNINGS  
CheckDir: BufferedMatrix.Rcheck
Warnings: 1

Command output

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


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

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


Installation output

BufferedMatrix.Rcheck/00install.out

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


* installing to library ‘/Library/Frameworks/R.framework/Versions/4.5-arm64/Resources/library’
* installing *source* package ‘BufferedMatrix’ ...
** this is package ‘BufferedMatrix’ version ‘1.74.0’
** using staged installation
** libs
using C compiler: ‘Apple clang version 15.0.0 (clang-1500.0.40.1)’
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.2 Patched (2025-11-04 r88984) -- "[Not] Part in a Rumble"
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.344   0.112   0.572 

BufferedMatrix.Rcheck/tests/objectTesting.Rout


R version 4.5.2 Patched (2025-11-04 r88984) -- "[Not] Part in a Rumble"
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 480695 25.7    1056201 56.5         NA   634425 33.9
Vcells 890553  6.8    8388608 64.0      65536  2109045 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] "Tue Nov 25 17:53:28 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] "Tue Nov 25 17:53:28 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: 0x60000300c480>
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   which.col <- sample(1:20,1)
+   if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,5,replace=TRUE)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> date()
[1] "Tue Nov 25 17:53:32 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] "Tue Nov 25 17:53:34 2025"
> 
> ColMode(tmp2)
<pointer: 0x60000300c480>
> 
> 
> 
> ### 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.5030733 -0.16621784 -0.7442281176 -1.1568425
[2,]   0.8064573 -0.47212322  0.0008599425 -1.2144727
[3,]   0.1497868 -0.02247619 -1.0521343386 -0.5756494
[4,]   0.5628168 -1.26946318  0.0460375588  0.3108581
> ewApply(tmp5,abs)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
            [,1]       [,2]         [,3]      [,4]
[1,] 100.5030733 0.16621784 0.7442281176 1.1568425
[2,]   0.8064573 0.47212322 0.0008599425 1.2144727
[3,]   0.1497868 0.02247619 1.0521343386 0.5756494
[4,]   0.5628168 1.26946318 0.0460375588 0.3108581
> ewApply(tmp5,sqrt)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
           [,1]      [,2]       [,3]      [,4]
[1,] 10.0251221 0.4076982 0.86268657 1.0755661
[2,]  0.8980297 0.6871122 0.02932478 1.1020312
[3,]  0.3870230 0.1499206 1.02573600 0.7587156
[4,]  0.7502111 1.1267046 0.21456365 0.5575465
> 
> my.function <- function(x,power){
+   (x+5)^power
+ }
> 
> ewApply(tmp5,my.function,power=2)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
          [,1]     [,2]     [,3]     [,4]
[1,] 225.75429 29.24320 34.37109 36.91250
[2,]  34.78675 32.34325 25.29411 37.23478
[3,]  29.02002 26.52168 36.30949 33.16281
[4,]  33.06493 37.53651 27.19167 30.88632
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x600003010120>
> exp(tmp5)
<pointer: 0x600003010120>
> log(tmp5,2)
<pointer: 0x600003010120>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 469.878
> Min(tmp5)
[1] 52.64637
> mean(tmp5)
[1] 73.04306
> Sum(tmp5)
[1] 14608.61
> Var(tmp5)
[1] 867.4771
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 91.91633 69.29361 67.50036 72.27415 69.51373 71.33875 71.35195 71.53548
 [9] 71.88667 73.81962
> rowSums(tmp5)
 [1] 1838.327 1385.872 1350.007 1445.483 1390.275 1426.775 1427.039 1430.710
 [9] 1437.733 1476.392
> rowVars(tmp5)
 [1] 7990.22768   86.28743   78.24580   94.84344   91.82144   44.82994
 [7]   68.70438   60.47470   58.79530   65.13045
> rowSd(tmp5)
 [1] 89.388073  9.289103  8.845665  9.738760  9.582351  6.695517  8.288810
 [8]  7.776548  7.667810  8.070344
> rowMax(tmp5)
 [1] 469.87799  86.70444  82.48503  94.10051  94.01837  82.80534  91.99447
 [8]  83.41669  89.26876  89.40904
> rowMin(tmp5)
 [1] 56.37239 52.64637 55.20141 56.59591 56.67122 59.93252 58.26414 53.73983
 [9] 53.30397 55.29035
> 
> colMeans(tmp5)
 [1] 111.99303  71.35430  71.89059  71.07375  69.87386  70.55622  68.76936
 [8]  71.28381  71.40024  69.58114  71.40622  75.40983  71.85651  71.39384
[15]  72.09036  67.82502  69.76193  70.85989  74.00388  68.47751
> colSums(tmp5)
 [1] 1119.9303  713.5430  718.9059  710.7375  698.7386  705.5622  687.6936
 [8]  712.8381  714.0024  695.8114  714.0622  754.0983  718.5651  713.9384
[15]  720.9036  678.2502  697.6193  708.5989  740.0388  684.7751
> colVars(tmp5)
 [1] 15872.49108   108.27052   132.97217    48.20997    56.96864   119.47337
 [7]    44.53562    71.05330    68.74984    29.56519    84.95239    33.82408
[13]    82.00065   158.18078    63.69476    30.33556    69.00881    87.72166
[19]    93.96111    85.72141
> colSd(tmp5)
 [1] 125.986075  10.405312  11.531356   6.943340   7.547757  10.930387
 [7]   6.673501   8.429312   8.291552   5.437388   9.216962   5.815848
[13]   9.055421  12.576994   7.980900   5.507772   8.307154   9.365984
[19]   9.693354   9.258586
> colMax(tmp5)
 [1] 469.87799  86.03539  84.30554  82.80534  82.39391  91.99447  77.69016
 [8]  82.48503  87.50260  78.28490  86.70444  82.86622  85.19838  94.10051
[15]  88.57629  76.01074  79.68899  83.75260  89.26876  85.69660
> colMin(tmp5)
 [1] 60.40136 55.20141 52.64637 61.92950 60.19377 56.37239 55.29035 53.73983
 [9] 57.94584 62.23904 56.21127 66.43507 61.07632 59.93252 56.67122 58.49981
[17] 55.86283 53.30397 55.48988 56.33974
> 
> 
> ### 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] 91.91633 69.29361 67.50036 72.27415 69.51373       NA 71.35195 71.53548
 [9] 71.88667 73.81962
> rowSums(tmp5)
 [1] 1838.327 1385.872 1350.007 1445.483 1390.275       NA 1427.039 1430.710
 [9] 1437.733 1476.392
> rowVars(tmp5)
 [1] 7990.22768   86.28743   78.24580   94.84344   91.82144   46.75944
 [7]   68.70438   60.47470   58.79530   65.13045
> rowSd(tmp5)
 [1] 89.388073  9.289103  8.845665  9.738760  9.582351  6.838088  8.288810
 [8]  7.776548  7.667810  8.070344
> rowMax(tmp5)
 [1] 469.87799  86.70444  82.48503  94.10051  94.01837        NA  91.99447
 [8]  83.41669  89.26876  89.40904
> rowMin(tmp5)
 [1] 56.37239 52.64637 55.20141 56.59591 56.67122       NA 58.26414 53.73983
 [9] 53.30397 55.29035
> 
> colMeans(tmp5)
 [1] 111.99303  71.35430  71.89059  71.07375  69.87386  70.55622  68.76936
 [8]  71.28381  71.40024  69.58114  71.40622  75.40983  71.85651  71.39384
[15]  72.09036  67.82502        NA  70.85989  74.00388  68.47751
> colSums(tmp5)
 [1] 1119.9303  713.5430  718.9059  710.7375  698.7386  705.5622  687.6936
 [8]  712.8381  714.0024  695.8114  714.0622  754.0983  718.5651  713.9384
[15]  720.9036  678.2502        NA  708.5989  740.0388  684.7751
> colVars(tmp5)
 [1] 15872.49108   108.27052   132.97217    48.20997    56.96864   119.47337
 [7]    44.53562    71.05330    68.74984    29.56519    84.95239    33.82408
[13]    82.00065   158.18078    63.69476    30.33556          NA    87.72166
[19]    93.96111    85.72141
> colSd(tmp5)
 [1] 125.986075  10.405312  11.531356   6.943340   7.547757  10.930387
 [7]   6.673501   8.429312   8.291552   5.437388   9.216962   5.815848
[13]   9.055421  12.576994   7.980900   5.507772         NA   9.365984
[19]   9.693354   9.258586
> colMax(tmp5)
 [1] 469.87799  86.03539  84.30554  82.80534  82.39391  91.99447  77.69016
 [8]  82.48503  87.50260  78.28490  86.70444  82.86622  85.19838  94.10051
[15]  88.57629  76.01074        NA  83.75260  89.26876  85.69660
> colMin(tmp5)
 [1] 60.40136 55.20141 52.64637 61.92950 60.19377 56.37239 55.29035 53.73983
 [9] 57.94584 62.23904 56.21127 66.43507 61.07632 59.93252 56.67122 58.49981
[17]       NA 53.30397 55.48988 56.33974
> 
> Max(tmp5,na.rm=TRUE)
[1] 469.878
> Min(tmp5,na.rm=TRUE)
[1] 52.64637
> mean(tmp5,na.rm=TRUE)
[1] 73.06719
> Sum(tmp5,na.rm=TRUE)
[1] 14540.37
> Var(tmp5,na.rm=TRUE)
[1] 871.7413
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 91.91633 69.29361 67.50036 72.27415 69.51373 71.50177 71.35195 71.53548
 [9] 71.88667 73.81962
> rowSums(tmp5,na.rm=TRUE)
 [1] 1838.327 1385.872 1350.007 1445.483 1390.275 1358.534 1427.039 1430.710
 [9] 1437.733 1476.392
> rowVars(tmp5,na.rm=TRUE)
 [1] 7990.22768   86.28743   78.24580   94.84344   91.82144   46.75944
 [7]   68.70438   60.47470   58.79530   65.13045
> rowSd(tmp5,na.rm=TRUE)
 [1] 89.388073  9.289103  8.845665  9.738760  9.582351  6.838088  8.288810
 [8]  7.776548  7.667810  8.070344
> rowMax(tmp5,na.rm=TRUE)
 [1] 469.87799  86.70444  82.48503  94.10051  94.01837  82.80534  91.99447
 [8]  83.41669  89.26876  89.40904
> rowMin(tmp5,na.rm=TRUE)
 [1] 56.37239 52.64637 55.20141 56.59591 56.67122 59.93252 58.26414 53.73983
 [9] 53.30397 55.29035
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 111.99303  71.35430  71.89059  71.07375  69.87386  70.55622  68.76936
 [8]  71.28381  71.40024  69.58114  71.40622  75.40983  71.85651  71.39384
[15]  72.09036  67.82502  69.93088  70.85989  74.00388  68.47751
> colSums(tmp5,na.rm=TRUE)
 [1] 1119.9303  713.5430  718.9059  710.7375  698.7386  705.5622  687.6936
 [8]  712.8381  714.0024  695.8114  714.0622  754.0983  718.5651  713.9384
[15]  720.9036  678.2502  629.3779  708.5989  740.0388  684.7751
> colVars(tmp5,na.rm=TRUE)
 [1] 15872.49108   108.27052   132.97217    48.20997    56.96864   119.47337
 [7]    44.53562    71.05330    68.74984    29.56519    84.95239    33.82408
[13]    82.00065   158.18078    63.69476    30.33556    77.31377    87.72166
[19]    93.96111    85.72141
> colSd(tmp5,na.rm=TRUE)
 [1] 125.986075  10.405312  11.531356   6.943340   7.547757  10.930387
 [7]   6.673501   8.429312   8.291552   5.437388   9.216962   5.815848
[13]   9.055421  12.576994   7.980900   5.507772   8.792825   9.365984
[19]   9.693354   9.258586
> colMax(tmp5,na.rm=TRUE)
 [1] 469.87799  86.03539  84.30554  82.80534  82.39391  91.99447  77.69016
 [8]  82.48503  87.50260  78.28490  86.70444  82.86622  85.19838  94.10051
[15]  88.57629  76.01074  79.68899  83.75260  89.26876  85.69660
> colMin(tmp5,na.rm=TRUE)
 [1] 60.40136 55.20141 52.64637 61.92950 60.19377 56.37239 55.29035 53.73983
 [9] 57.94584 62.23904 56.21127 66.43507 61.07632 59.93252 56.67122 58.49981
[17] 55.86283 53.30397 55.48988 56.33974
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1] 91.91633 69.29361 67.50036 72.27415 69.51373      NaN 71.35195 71.53548
 [9] 71.88667 73.81962
> rowSums(tmp5,na.rm=TRUE)
 [1] 1838.327 1385.872 1350.007 1445.483 1390.275    0.000 1427.039 1430.710
 [9] 1437.733 1476.392
> rowVars(tmp5,na.rm=TRUE)
 [1] 7990.22768   86.28743   78.24580   94.84344   91.82144         NA
 [7]   68.70438   60.47470   58.79530   65.13045
> rowSd(tmp5,na.rm=TRUE)
 [1] 89.388073  9.289103  8.845665  9.738760  9.582351        NA  8.288810
 [8]  7.776548  7.667810  8.070344
> rowMax(tmp5,na.rm=TRUE)
 [1] 469.87799  86.70444  82.48503  94.10051  94.01837        NA  91.99447
 [8]  83.41669  89.26876  89.40904
> rowMin(tmp5,na.rm=TRUE)
 [1] 56.37239 52.64637 55.20141 56.59591 56.67122       NA 58.26414 53.73983
 [9] 53.30397 55.29035
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1] 116.58504  71.27877  71.03460  69.77024  70.94943  70.74442  67.77816
 [8]  71.15258  71.23833  68.82678  70.52412  74.85787  73.05431  72.66732
[15]  72.83887  67.45092       NaN  70.87474  74.84392  68.24736
> colSums(tmp5,na.rm=TRUE)
 [1] 1049.2653  641.5089  639.3114  627.9321  638.5448  636.6998  610.0035
 [8]  640.3732  641.1450  619.4411  634.7170  673.7208  657.4887  654.0059
[15]  655.5498  607.0583    0.0000  637.8726  673.5953  614.2262
> colVars(tmp5,na.rm=TRUE)
 [1] 17619.32882   121.74016   141.35064    35.12091    51.07525   134.00907
 [7]    39.04970    79.74122    77.04865    26.85898    86.81776    34.62473
[13]    76.11013   159.70867    65.35369    32.55303          NA    98.68438
[19]    97.76745    95.84068
> colSd(tmp5,na.rm=TRUE)
 [1] 132.737820  11.033592  11.889098   5.926290   7.146695  11.576228
 [7]   6.248976   8.929794   8.777736   5.182565   9.317605   5.884278
[13]   8.724112  12.637590   8.084163   5.705527         NA   9.934001
[19]   9.887742   9.789825
> colMax(tmp5,na.rm=TRUE)
 [1] 469.87799  86.03539  84.30554  77.49933  82.39391  91.99447  77.52713
 [8]  82.48503  87.50260  78.28490  86.70444  82.86622  85.19838  94.10051
[15]  88.57629  76.01074      -Inf  83.75260  89.26876  85.69660
> colMin(tmp5,na.rm=TRUE)
 [1] 60.40136 55.20141 52.64637 61.92950 61.21568 56.37239 55.29035 53.73983
 [9] 57.94584 62.23904 56.21127 66.43507 62.01262 60.26755 56.67122 58.49981
[17]      Inf 53.30397 55.48988 56.33974
> 
> 
> 
> 
> 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] 375.55243 199.53076 135.73300 195.88422 370.26006  67.12758 275.94912
 [8] 245.84397 232.57763 224.44992
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 375.55243 199.53076 135.73300 195.88422 370.26006  67.12758 275.94912
 [8] 245.84397 232.57763 224.44992
> 
> 
> 
> 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]  5.684342e-14  0.000000e+00  1.421085e-14 -1.136868e-13 -3.410605e-13
 [6] -2.273737e-13 -1.136868e-13  2.842171e-13  0.000000e+00  0.000000e+00
[11] -2.842171e-14  7.105427e-14  4.263256e-14  0.000000e+00 -5.684342e-14
[16] -9.947598e-14  8.526513e-14 -1.705303e-13 -1.705303e-13  2.842171e-14
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> ## 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)
+ }
1   10 
5   20 
1   18 
5   1 
1   11 
3   19 
10   5 
10   12 
1   16 
3   19 
8   2 
8   4 
9   4 
7   18 
4   20 
9   13 
5   14 
1   17 
2   20 
3   6 
There were 50 or more warnings (use warnings() to see the first 50)
> 
> 
> ### now test 1 by n and n by 1 matrix
> 
> 
> err.tol <- 1e-12
> 
> rm(tmp5)
> 
> dataset1 <- rnorm(100)
> dataset2 <- rnorm(100)
> 
> tmp <- createBufferedMatrix(1,100)
> tmp[1,] <- dataset1
> 
> tmp2 <- createBufferedMatrix(100,1)
> tmp2[,1] <- dataset2
> 
> 
> 
> 
> 
> Max(tmp)
[1] 2.622881
> Min(tmp)
[1] -2.780017
> mean(tmp)
[1] -0.0267654
> Sum(tmp)
[1] -2.67654
> Var(tmp)
[1] 0.930901
> 
> rowMeans(tmp)
[1] -0.0267654
> rowSums(tmp)
[1] -2.67654
> rowVars(tmp)
[1] 0.930901
> rowSd(tmp)
[1] 0.9648321
> rowMax(tmp)
[1] 2.622881
> rowMin(tmp)
[1] -2.780017
> 
> colMeans(tmp)
  [1] -0.548871143 -0.779396055 -0.881204426 -0.357056296 -0.260285926
  [6]  1.609900228  0.122938944 -0.261080099 -0.185537146  0.833390618
 [11] -1.515910448  0.206481600 -0.810884493 -0.617006682  0.551946622
 [16]  0.292079935 -0.492698282  1.053213154 -0.178095264 -1.253964309
 [21] -0.251876349 -0.230192077  1.633363626  2.145383864 -0.040270806
 [26]  1.009053069 -2.780017065 -0.628799354  1.206073264  0.496546836
 [31]  0.509012641 -0.975682926 -0.102527809  1.200485259 -1.676469235
 [36] -1.179370350  0.393512980 -1.060718861 -1.180644894  0.129227066
 [41]  0.447348914 -0.270917768 -0.263211525 -1.686536643  0.223140889
 [46] -0.532100115 -0.268073798 -0.470730025  0.005929051 -1.122196248
 [51]  0.892907913  0.229892974 -0.237059934  1.368898062 -0.130118605
 [56]  0.166937720 -0.502672212 -0.200493675 -0.532987910  0.266991837
 [61]  0.685200874 -0.070336634  0.232264047  0.896792897 -0.759348611
 [66] -0.387804344 -0.336181545 -1.381188067  2.622880957 -0.652747049
 [71] -1.908395720  0.378178117  1.295907059 -0.560992255 -0.014821980
 [76] -2.216818271  1.056457626  1.708015693  0.762546657  0.928819951
 [81] -0.474940917  0.910116879  0.447009528  0.358454732  0.907340102
 [86] -0.349092633  0.891133367 -1.052719155  0.581698448 -0.984595828
 [91]  0.759505567 -0.807030298  1.271219276  0.583200176 -1.330858807
 [96]  0.707256197 -1.580937486  0.081767138 -0.083366703  1.680872550
> colSums(tmp)
  [1] -0.548871143 -0.779396055 -0.881204426 -0.357056296 -0.260285926
  [6]  1.609900228  0.122938944 -0.261080099 -0.185537146  0.833390618
 [11] -1.515910448  0.206481600 -0.810884493 -0.617006682  0.551946622
 [16]  0.292079935 -0.492698282  1.053213154 -0.178095264 -1.253964309
 [21] -0.251876349 -0.230192077  1.633363626  2.145383864 -0.040270806
 [26]  1.009053069 -2.780017065 -0.628799354  1.206073264  0.496546836
 [31]  0.509012641 -0.975682926 -0.102527809  1.200485259 -1.676469235
 [36] -1.179370350  0.393512980 -1.060718861 -1.180644894  0.129227066
 [41]  0.447348914 -0.270917768 -0.263211525 -1.686536643  0.223140889
 [46] -0.532100115 -0.268073798 -0.470730025  0.005929051 -1.122196248
 [51]  0.892907913  0.229892974 -0.237059934  1.368898062 -0.130118605
 [56]  0.166937720 -0.502672212 -0.200493675 -0.532987910  0.266991837
 [61]  0.685200874 -0.070336634  0.232264047  0.896792897 -0.759348611
 [66] -0.387804344 -0.336181545 -1.381188067  2.622880957 -0.652747049
 [71] -1.908395720  0.378178117  1.295907059 -0.560992255 -0.014821980
 [76] -2.216818271  1.056457626  1.708015693  0.762546657  0.928819951
 [81] -0.474940917  0.910116879  0.447009528  0.358454732  0.907340102
 [86] -0.349092633  0.891133367 -1.052719155  0.581698448 -0.984595828
 [91]  0.759505567 -0.807030298  1.271219276  0.583200176 -1.330858807
 [96]  0.707256197 -1.580937486  0.081767138 -0.083366703  1.680872550
> 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.548871143 -0.779396055 -0.881204426 -0.357056296 -0.260285926
  [6]  1.609900228  0.122938944 -0.261080099 -0.185537146  0.833390618
 [11] -1.515910448  0.206481600 -0.810884493 -0.617006682  0.551946622
 [16]  0.292079935 -0.492698282  1.053213154 -0.178095264 -1.253964309
 [21] -0.251876349 -0.230192077  1.633363626  2.145383864 -0.040270806
 [26]  1.009053069 -2.780017065 -0.628799354  1.206073264  0.496546836
 [31]  0.509012641 -0.975682926 -0.102527809  1.200485259 -1.676469235
 [36] -1.179370350  0.393512980 -1.060718861 -1.180644894  0.129227066
 [41]  0.447348914 -0.270917768 -0.263211525 -1.686536643  0.223140889
 [46] -0.532100115 -0.268073798 -0.470730025  0.005929051 -1.122196248
 [51]  0.892907913  0.229892974 -0.237059934  1.368898062 -0.130118605
 [56]  0.166937720 -0.502672212 -0.200493675 -0.532987910  0.266991837
 [61]  0.685200874 -0.070336634  0.232264047  0.896792897 -0.759348611
 [66] -0.387804344 -0.336181545 -1.381188067  2.622880957 -0.652747049
 [71] -1.908395720  0.378178117  1.295907059 -0.560992255 -0.014821980
 [76] -2.216818271  1.056457626  1.708015693  0.762546657  0.928819951
 [81] -0.474940917  0.910116879  0.447009528  0.358454732  0.907340102
 [86] -0.349092633  0.891133367 -1.052719155  0.581698448 -0.984595828
 [91]  0.759505567 -0.807030298  1.271219276  0.583200176 -1.330858807
 [96]  0.707256197 -1.580937486  0.081767138 -0.083366703  1.680872550
> colMin(tmp)
  [1] -0.548871143 -0.779396055 -0.881204426 -0.357056296 -0.260285926
  [6]  1.609900228  0.122938944 -0.261080099 -0.185537146  0.833390618
 [11] -1.515910448  0.206481600 -0.810884493 -0.617006682  0.551946622
 [16]  0.292079935 -0.492698282  1.053213154 -0.178095264 -1.253964309
 [21] -0.251876349 -0.230192077  1.633363626  2.145383864 -0.040270806
 [26]  1.009053069 -2.780017065 -0.628799354  1.206073264  0.496546836
 [31]  0.509012641 -0.975682926 -0.102527809  1.200485259 -1.676469235
 [36] -1.179370350  0.393512980 -1.060718861 -1.180644894  0.129227066
 [41]  0.447348914 -0.270917768 -0.263211525 -1.686536643  0.223140889
 [46] -0.532100115 -0.268073798 -0.470730025  0.005929051 -1.122196248
 [51]  0.892907913  0.229892974 -0.237059934  1.368898062 -0.130118605
 [56]  0.166937720 -0.502672212 -0.200493675 -0.532987910  0.266991837
 [61]  0.685200874 -0.070336634  0.232264047  0.896792897 -0.759348611
 [66] -0.387804344 -0.336181545 -1.381188067  2.622880957 -0.652747049
 [71] -1.908395720  0.378178117  1.295907059 -0.560992255 -0.014821980
 [76] -2.216818271  1.056457626  1.708015693  0.762546657  0.928819951
 [81] -0.474940917  0.910116879  0.447009528  0.358454732  0.907340102
 [86] -0.349092633  0.891133367 -1.052719155  0.581698448 -0.984595828
 [91]  0.759505567 -0.807030298  1.271219276  0.583200176 -1.330858807
 [96]  0.707256197 -1.580937486  0.081767138 -0.083366703  1.680872550
> colMedians(tmp)
  [1] -0.548871143 -0.779396055 -0.881204426 -0.357056296 -0.260285926
  [6]  1.609900228  0.122938944 -0.261080099 -0.185537146  0.833390618
 [11] -1.515910448  0.206481600 -0.810884493 -0.617006682  0.551946622
 [16]  0.292079935 -0.492698282  1.053213154 -0.178095264 -1.253964309
 [21] -0.251876349 -0.230192077  1.633363626  2.145383864 -0.040270806
 [26]  1.009053069 -2.780017065 -0.628799354  1.206073264  0.496546836
 [31]  0.509012641 -0.975682926 -0.102527809  1.200485259 -1.676469235
 [36] -1.179370350  0.393512980 -1.060718861 -1.180644894  0.129227066
 [41]  0.447348914 -0.270917768 -0.263211525 -1.686536643  0.223140889
 [46] -0.532100115 -0.268073798 -0.470730025  0.005929051 -1.122196248
 [51]  0.892907913  0.229892974 -0.237059934  1.368898062 -0.130118605
 [56]  0.166937720 -0.502672212 -0.200493675 -0.532987910  0.266991837
 [61]  0.685200874 -0.070336634  0.232264047  0.896792897 -0.759348611
 [66] -0.387804344 -0.336181545 -1.381188067  2.622880957 -0.652747049
 [71] -1.908395720  0.378178117  1.295907059 -0.560992255 -0.014821980
 [76] -2.216818271  1.056457626  1.708015693  0.762546657  0.928819951
 [81] -0.474940917  0.910116879  0.447009528  0.358454732  0.907340102
 [86] -0.349092633  0.891133367 -1.052719155  0.581698448 -0.984595828
 [91]  0.759505567 -0.807030298  1.271219276  0.583200176 -1.330858807
 [96]  0.707256197 -1.580937486  0.081767138 -0.083366703  1.680872550
> colRanges(tmp)
           [,1]       [,2]       [,3]       [,4]       [,5]   [,6]      [,7]
[1,] -0.5488711 -0.7793961 -0.8812044 -0.3570563 -0.2602859 1.6099 0.1229389
[2,] -0.5488711 -0.7793961 -0.8812044 -0.3570563 -0.2602859 1.6099 0.1229389
           [,8]       [,9]     [,10]    [,11]     [,12]      [,13]      [,14]
[1,] -0.2610801 -0.1855371 0.8333906 -1.51591 0.2064816 -0.8108845 -0.6170067
[2,] -0.2610801 -0.1855371 0.8333906 -1.51591 0.2064816 -0.8108845 -0.6170067
         [,15]     [,16]      [,17]    [,18]      [,19]     [,20]      [,21]
[1,] 0.5519466 0.2920799 -0.4926983 1.053213 -0.1780953 -1.253964 -0.2518763
[2,] 0.5519466 0.2920799 -0.4926983 1.053213 -0.1780953 -1.253964 -0.2518763
          [,22]    [,23]    [,24]       [,25]    [,26]     [,27]      [,28]
[1,] -0.2301921 1.633364 2.145384 -0.04027081 1.009053 -2.780017 -0.6287994
[2,] -0.2301921 1.633364 2.145384 -0.04027081 1.009053 -2.780017 -0.6287994
        [,29]     [,30]     [,31]      [,32]      [,33]    [,34]     [,35]
[1,] 1.206073 0.4965468 0.5090126 -0.9756829 -0.1025278 1.200485 -1.676469
[2,] 1.206073 0.4965468 0.5090126 -0.9756829 -0.1025278 1.200485 -1.676469
        [,36]    [,37]     [,38]     [,39]     [,40]     [,41]      [,42]
[1,] -1.17937 0.393513 -1.060719 -1.180645 0.1292271 0.4473489 -0.2709178
[2,] -1.17937 0.393513 -1.060719 -1.180645 0.1292271 0.4473489 -0.2709178
          [,43]     [,44]     [,45]      [,46]      [,47]    [,48]       [,49]
[1,] -0.2632115 -1.686537 0.2231409 -0.5321001 -0.2680738 -0.47073 0.005929051
[2,] -0.2632115 -1.686537 0.2231409 -0.5321001 -0.2680738 -0.47073 0.005929051
         [,50]     [,51]    [,52]      [,53]    [,54]      [,55]     [,56]
[1,] -1.122196 0.8929079 0.229893 -0.2370599 1.368898 -0.1301186 0.1669377
[2,] -1.122196 0.8929079 0.229893 -0.2370599 1.368898 -0.1301186 0.1669377
          [,57]      [,58]      [,59]     [,60]     [,61]       [,62]    [,63]
[1,] -0.5026722 -0.2004937 -0.5329879 0.2669918 0.6852009 -0.07033663 0.232264
[2,] -0.5026722 -0.2004937 -0.5329879 0.2669918 0.6852009 -0.07033663 0.232264
         [,64]      [,65]      [,66]      [,67]     [,68]    [,69]     [,70]
[1,] 0.8967929 -0.7593486 -0.3878043 -0.3361815 -1.381188 2.622881 -0.652747
[2,] 0.8967929 -0.7593486 -0.3878043 -0.3361815 -1.381188 2.622881 -0.652747
         [,71]     [,72]    [,73]      [,74]       [,75]     [,76]    [,77]
[1,] -1.908396 0.3781781 1.295907 -0.5609923 -0.01482198 -2.216818 1.056458
[2,] -1.908396 0.3781781 1.295907 -0.5609923 -0.01482198 -2.216818 1.056458
        [,78]     [,79]   [,80]      [,81]     [,82]     [,83]     [,84]
[1,] 1.708016 0.7625467 0.92882 -0.4749409 0.9101169 0.4470095 0.3584547
[2,] 1.708016 0.7625467 0.92882 -0.4749409 0.9101169 0.4470095 0.3584547
         [,85]      [,86]     [,87]     [,88]     [,89]      [,90]     [,91]
[1,] 0.9073401 -0.3490926 0.8911334 -1.052719 0.5816984 -0.9845958 0.7595056
[2,] 0.9073401 -0.3490926 0.8911334 -1.052719 0.5816984 -0.9845958 0.7595056
          [,92]    [,93]     [,94]     [,95]     [,96]     [,97]      [,98]
[1,] -0.8070303 1.271219 0.5832002 -1.330859 0.7072562 -1.580937 0.08176714
[2,] -0.8070303 1.271219 0.5832002 -1.330859 0.7072562 -1.580937 0.08176714
          [,99]   [,100]
[1,] -0.0833667 1.680873
[2,] -0.0833667 1.680873
> 
> 
> Max(tmp2)
[1] 2.068509
> Min(tmp2)
[1] -2.401027
> mean(tmp2)
[1] 0.01827467
> Sum(tmp2)
[1] 1.827467
> Var(tmp2)
[1] 0.9649516
> 
> rowMeans(tmp2)
  [1] -0.90149151 -1.19970415 -0.14328903  0.73341909  0.10901862  0.85449501
  [7] -1.77632872  0.06256149  0.54641936 -0.02476825  0.64983738 -0.33399585
 [13]  0.96985858  1.11078508  0.11627555 -0.22591917 -0.08603804  2.02361681
 [19] -1.27314472  1.28383973  0.29384659  0.62769978 -1.12679297  1.24586921
 [25] -1.38803024 -1.36367996 -1.77939198 -0.47233573  0.19803268 -0.29181226
 [31]  0.61980269 -0.88677999  0.28826698 -0.77223821  1.26350947  2.06850851
 [37] -1.02543392 -0.85063226 -0.79583905 -0.42396999 -0.32260349  0.75154988
 [43]  1.30849223 -0.61969150  0.16696242  1.22975959  0.80567905  1.89075807
 [49] -0.14699142  1.18182081  1.48544217  0.86152138 -0.19582044  1.18539479
 [55]  1.19299309  1.82359459 -0.53688660 -1.21436558 -0.12620937 -0.61474204
 [61]  0.63756093 -2.40102653  0.36581841  0.62229775  0.44831453 -2.05589986
 [67]  0.80650721 -0.88149061 -0.03896171 -0.16955046 -0.76430119  0.48443313
 [73] -0.61643748 -0.51402807  0.06673144 -0.47483818 -0.31499017  0.39181906
 [79] -0.68513058  0.58635989 -1.90806571 -0.62756919 -0.35607558 -0.75012638
 [85] -0.66065412 -1.24132217  0.56567057  1.39875501  0.25774825  0.63318993
 [91] -1.83720750 -0.17101885  0.04724139 -0.44196615  0.14419153  1.01273945
 [97]  1.75594833  1.63028198 -1.03031565 -0.11786980
> rowSums(tmp2)
  [1] -0.90149151 -1.19970415 -0.14328903  0.73341909  0.10901862  0.85449501
  [7] -1.77632872  0.06256149  0.54641936 -0.02476825  0.64983738 -0.33399585
 [13]  0.96985858  1.11078508  0.11627555 -0.22591917 -0.08603804  2.02361681
 [19] -1.27314472  1.28383973  0.29384659  0.62769978 -1.12679297  1.24586921
 [25] -1.38803024 -1.36367996 -1.77939198 -0.47233573  0.19803268 -0.29181226
 [31]  0.61980269 -0.88677999  0.28826698 -0.77223821  1.26350947  2.06850851
 [37] -1.02543392 -0.85063226 -0.79583905 -0.42396999 -0.32260349  0.75154988
 [43]  1.30849223 -0.61969150  0.16696242  1.22975959  0.80567905  1.89075807
 [49] -0.14699142  1.18182081  1.48544217  0.86152138 -0.19582044  1.18539479
 [55]  1.19299309  1.82359459 -0.53688660 -1.21436558 -0.12620937 -0.61474204
 [61]  0.63756093 -2.40102653  0.36581841  0.62229775  0.44831453 -2.05589986
 [67]  0.80650721 -0.88149061 -0.03896171 -0.16955046 -0.76430119  0.48443313
 [73] -0.61643748 -0.51402807  0.06673144 -0.47483818 -0.31499017  0.39181906
 [79] -0.68513058  0.58635989 -1.90806571 -0.62756919 -0.35607558 -0.75012638
 [85] -0.66065412 -1.24132217  0.56567057  1.39875501  0.25774825  0.63318993
 [91] -1.83720750 -0.17101885  0.04724139 -0.44196615  0.14419153  1.01273945
 [97]  1.75594833  1.63028198 -1.03031565 -0.11786980
> 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.90149151 -1.19970415 -0.14328903  0.73341909  0.10901862  0.85449501
  [7] -1.77632872  0.06256149  0.54641936 -0.02476825  0.64983738 -0.33399585
 [13]  0.96985858  1.11078508  0.11627555 -0.22591917 -0.08603804  2.02361681
 [19] -1.27314472  1.28383973  0.29384659  0.62769978 -1.12679297  1.24586921
 [25] -1.38803024 -1.36367996 -1.77939198 -0.47233573  0.19803268 -0.29181226
 [31]  0.61980269 -0.88677999  0.28826698 -0.77223821  1.26350947  2.06850851
 [37] -1.02543392 -0.85063226 -0.79583905 -0.42396999 -0.32260349  0.75154988
 [43]  1.30849223 -0.61969150  0.16696242  1.22975959  0.80567905  1.89075807
 [49] -0.14699142  1.18182081  1.48544217  0.86152138 -0.19582044  1.18539479
 [55]  1.19299309  1.82359459 -0.53688660 -1.21436558 -0.12620937 -0.61474204
 [61]  0.63756093 -2.40102653  0.36581841  0.62229775  0.44831453 -2.05589986
 [67]  0.80650721 -0.88149061 -0.03896171 -0.16955046 -0.76430119  0.48443313
 [73] -0.61643748 -0.51402807  0.06673144 -0.47483818 -0.31499017  0.39181906
 [79] -0.68513058  0.58635989 -1.90806571 -0.62756919 -0.35607558 -0.75012638
 [85] -0.66065412 -1.24132217  0.56567057  1.39875501  0.25774825  0.63318993
 [91] -1.83720750 -0.17101885  0.04724139 -0.44196615  0.14419153  1.01273945
 [97]  1.75594833  1.63028198 -1.03031565 -0.11786980
> rowMin(tmp2)
  [1] -0.90149151 -1.19970415 -0.14328903  0.73341909  0.10901862  0.85449501
  [7] -1.77632872  0.06256149  0.54641936 -0.02476825  0.64983738 -0.33399585
 [13]  0.96985858  1.11078508  0.11627555 -0.22591917 -0.08603804  2.02361681
 [19] -1.27314472  1.28383973  0.29384659  0.62769978 -1.12679297  1.24586921
 [25] -1.38803024 -1.36367996 -1.77939198 -0.47233573  0.19803268 -0.29181226
 [31]  0.61980269 -0.88677999  0.28826698 -0.77223821  1.26350947  2.06850851
 [37] -1.02543392 -0.85063226 -0.79583905 -0.42396999 -0.32260349  0.75154988
 [43]  1.30849223 -0.61969150  0.16696242  1.22975959  0.80567905  1.89075807
 [49] -0.14699142  1.18182081  1.48544217  0.86152138 -0.19582044  1.18539479
 [55]  1.19299309  1.82359459 -0.53688660 -1.21436558 -0.12620937 -0.61474204
 [61]  0.63756093 -2.40102653  0.36581841  0.62229775  0.44831453 -2.05589986
 [67]  0.80650721 -0.88149061 -0.03896171 -0.16955046 -0.76430119  0.48443313
 [73] -0.61643748 -0.51402807  0.06673144 -0.47483818 -0.31499017  0.39181906
 [79] -0.68513058  0.58635989 -1.90806571 -0.62756919 -0.35607558 -0.75012638
 [85] -0.66065412 -1.24132217  0.56567057  1.39875501  0.25774825  0.63318993
 [91] -1.83720750 -0.17101885  0.04724139 -0.44196615  0.14419153  1.01273945
 [97]  1.75594833  1.63028198 -1.03031565 -0.11786980
> 
> colMeans(tmp2)
[1] 0.01827467
> colSums(tmp2)
[1] 1.827467
> colVars(tmp2)
[1] 0.9649516
> colSd(tmp2)
[1] 0.9823195
> colMax(tmp2)
[1] 2.068509
> colMin(tmp2)
[1] -2.401027
> colMedians(tmp2)
[1] -0.03186498
> colRanges(tmp2)
          [,1]
[1,] -2.401027
[2,]  2.068509
> 
> 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] -1.1493347  5.1070076  3.3619668  4.3280851  4.8581018  6.8529392
 [7] -1.8152296  0.1964481 -1.1043268  3.6830271
> colApply(tmp,quantile)[,1]
            [,1]
[1,] -2.25063443
[2,] -0.38532303
[3,] -0.08633593
[4,]  0.22275256
[5,]  1.67584075
> 
> rowApply(tmp,sum)
 [1]  1.6101509  4.2176625  8.4500886 -1.3072008 -3.3362753  3.5187536
 [7]  9.5982710  3.9418297 -2.7255851  0.3509895
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    4    6    7    5    4    4    2    1    1    10
 [2,]    5    9    2    8    5    1    8    4    9     5
 [3,]    1    1    4    7   10    3    9    9    4     9
 [4,]    6    4    3    6    9   10    6   10    3     2
 [5,]   10    3    6    2    3    9   10    8    8     8
 [6,]    8    7    9   10    6    7    7    7    7     3
 [7,]    2    2    5    4    7    2    3    2    5     6
 [8,]    3    5    8    9    2    8    4    3    2     4
 [9,]    9    8   10    1    1    5    1    6    6     1
[10,]    7   10    1    3    8    6    5    5   10     7
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1] -3.1629531 -0.9851526 -1.2915008  2.2067514  1.5589988  1.8324459
 [7]  0.6595905 -2.9740395  3.8220412  0.1243613 -0.8420506  1.8175641
[13] -0.8555770 -2.1852828 -2.1468239 -1.0056261 -1.7192500  0.6023358
[19] -2.1510304  1.2455363
> colApply(tmp,quantile)[,1]
            [,1]
[1,] -1.22534240
[2,] -1.10640370
[3,] -0.42449274
[4,] -0.33968243
[5,] -0.06703187
> 
> rowApply(tmp,sum)
[1]  1.391325 -4.933877  3.290448  1.345488 -6.543046
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]    7    9    3    7    4
[2,]    5   10   14   19    1
[3,]   20    2    2   10   14
[4,]    8   18   19   15    9
[5,]   13    7   20   16   13
> 
> 
> as.matrix(tmp)
            [,1]       [,2]       [,3]       [,4]        [,5]       [,6]
[1,] -0.33968243 -0.3961879  1.4454530 -0.3119538 -0.01563895  1.2320525
[2,] -0.42449274 -0.4077086 -1.7799556  1.1119192 -0.72574794  0.5203555
[3,] -1.22534240  0.7561432 -1.3666312  1.4384878  1.52600125  1.1541286
[4,] -0.06703187  1.1299422  0.2565139  0.6263527  0.75315394 -0.2947499
[5,] -1.10640370 -2.0673415  0.1531191 -0.6580545  0.02123045 -0.7793409
           [,7]        [,8]       [,9]      [,10]      [,11]      [,12]
[1,]  0.2026354 -0.64008919 -0.2392063 -0.5818344 -0.1870279  0.4766302
[2,]  0.8368535  0.08810269  1.4083551  1.8087417 -1.7794334 -0.1658817
[3,]  0.7306944 -0.75456147  1.1767582 -0.8266203  0.6866074  0.6203954
[4,] -0.1110372 -0.71140655  1.0257599  0.3185933 -0.8192149  0.1592034
[5,] -0.9995556 -0.95608500  0.4503743 -0.5945190  1.2570182  0.7272168
          [,13]      [,14]       [,15]      [,16]       [,17]      [,18]
[1,] -0.2268808  0.7840937  0.92385937  1.1259918 -0.56914963 -0.3783027
[2,] -2.2299874 -0.9067134  0.31340193 -0.4541742 -0.97220442 -0.2381071
[3,]  0.9117014  0.1430078 -0.01897977 -0.4136162 -0.21900383 -0.4918094
[4,]  0.3284917 -1.7484982 -2.58950237  0.4286995  0.12701836  0.9044837
[5,]  0.3610981 -0.4571727 -0.77560310 -1.6925271 -0.08591046  0.8060713
           [,19]      [,20]
[1,] -0.74322307 -0.1702143
[2,] -0.03396606 -0.9032337
[3,] -1.39832996  0.8614175
[4,]  1.17487953  0.4538366
[5,] -1.15039085  1.0037302
> 
> 
> 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 :  648  bytes.
Disk usage :  200  bytes.
> subBufferedMatrix(tmp,,5:8)
BufferedMatrix object
Matrix size:  5 4 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  563  bytes.
Disk usage :  160  bytes.
> subBufferedMatrix(tmp,1:3,)
BufferedMatrix object
Matrix size:  3 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  480  bytes.
> 
> 
> rm(tmp)
> 
> 
> ###
> ### Testing colnames and rownames
> ###
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> 
> 
> colnames(tmp)
NULL
> rownames(tmp)
NULL
> 
> 
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> colnames(tmp)
 [1] "col1"  "col2"  "col3"  "col4"  "col5"  "col6"  "col7"  "col8"  "col9" 
[10] "col10" "col11" "col12" "col13" "col14" "col15" "col16" "col17" "col18"
[19] "col19" "col20"
> rownames(tmp)
[1] "row1" "row2" "row3" "row4" "row5"
> 
> 
> tmp["row1",]
         col1       col2      col3      col4      col5       col6     col7
row1 0.803015 -0.4417372 -0.732723 -0.464035 -1.950328 -0.9012985 1.081257
            col8       col9      col10      col11     col12     col13     col14
row1 -0.02212121 -0.2713689 -0.1971587 -0.4636746 -0.576657 0.3669206 -1.086286
          col15     col16     col17     col18        col19     col20
row1 -0.1053536 0.8227868 -1.034301 0.1663382 -0.007234198 0.7938816
> tmp[,"col10"]
           col10
row1 -0.19715870
row2 -1.68521737
row3 -1.33786806
row4 -0.03285052
row5 -0.29605088
> tmp[c("row1","row5"),]
          col1       col2        col3       col4      col5       col6      col7
row1 0.8030150 -0.4417372 -0.73272304 -0.4640350 -1.950328 -0.9012985  1.081257
row5 0.7407448  1.4734507 -0.06701714  0.4385033  1.605629 -0.4165061 -1.090562
            col8       col9      col10      col11     col12      col13
row1 -0.02212121 -0.2713689 -0.1971587 -0.4636746 -0.576657  0.3669206
row5  0.68225767  1.0351456 -0.2960509 -0.7363085  3.281356 -0.2319642
          col14      col15      col16     col17       col18        col19
row1 -1.0862858 -0.1053536  0.8227868 -1.034301  0.16633817 -0.007234198
row5 -0.1953449  0.9678066 -0.6871076 -3.031140 -0.04399016  0.201734690
           col20
row1  0.79388158
row5 -0.08397402
> tmp[,c("col6","col20")]
            col6       col20
row1 -0.90129848  0.79388158
row2 -0.06985275 -1.76014121
row3 -0.20750472  0.10024261
row4 -0.99059917 -2.14946259
row5 -0.41650609 -0.08397402
> tmp[c("row1","row5"),c("col6","col20")]
           col6       col20
row1 -0.9012985  0.79388158
row5 -0.4165061 -0.08397402
> 
> 
> 
> 
> tmp["row1",] <- rnorm(20,mean=10)
> tmp[,"col10"] <- rnorm(5,mean=30)
> tmp[c("row1","row5"),] <- rnorm(40,mean=50)
> tmp[,c("col6","col20")] <- rnorm(10,mean=75)
> tmp[c("row1","row5"),c("col6","col20")]  <- rnorm(4,mean=105)
> 
> tmp["row1",]
         col1     col2    col3    col4     col5     col6     col7     col8
row1 49.63263 49.86786 50.4952 49.3427 50.07047 104.3587 51.82431 49.91202
         col9    col10    col11    col12    col13    col14    col15    col16
row1 48.82768 51.38066 49.34191 50.27981 50.17496 49.73391 47.96363 50.41569
        col17    col18   col19    col20
row1 50.75586 51.16133 50.5374 105.9799
> tmp[,"col10"]
        col10
row1 51.38066
row2 29.83132
row3 29.08565
row4 30.08210
row5 49.26823
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 49.63263 49.86786 50.49520 49.34270 50.07047 104.3587 51.82431 49.91202
row5 49.23625 49.64469 50.95268 49.18815 49.43934 104.5147 49.30911 49.31945
         col9    col10    col11    col12    col13    col14    col15    col16
row1 48.82768 51.38066 49.34191 50.27981 50.17496 49.73391 47.96363 50.41569
row5 50.19853 49.26823 51.34348 49.87484 49.84989 49.36810 49.38485 48.01710
        col17    col18    col19    col20
row1 50.75586 51.16133 50.53740 105.9799
row5 50.36751 49.88047 49.80072 106.0728
> tmp[,c("col6","col20")]
          col6     col20
row1 104.35868 105.97993
row2  73.84573  74.68928
row3  75.33204  74.85394
row4  75.35092  75.76123
row5 104.51474 106.07285
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 104.3587 105.9799
row5 104.5147 106.0728
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 104.3587 105.9799
row5 104.5147 106.0728
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
           col13
[1,] -1.23231990
[2,]  0.05632458
[3,] -1.10532207
[4,]  0.27886135
[5,]  0.27128738
> tmp[,c("col17","col7")]
           col17       col7
[1,]  0.03257489  0.5898454
[2,]  1.40113499  0.3154270
[3,]  0.91655768  0.2819438
[4,] -0.21854059  0.7646035
[5,]  0.67661812 -1.2888732
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
          col6       col20
[1,] 0.6035736  0.23646204
[2,] 0.4043519 -0.02697049
[3,] 0.7462487  1.37157853
[4,] 1.1596524 -1.50755510
[5,] 0.9010300  0.09648618
> subBufferedMatrix(tmp,1,c("col6"))[,1]
          col1
[1,] 0.6035736
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
          col6
[1,] 0.6035736
[2,] 0.4043519
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> 
> 
> 
> subBufferedMatrix(tmp,c("row3","row1"),)[,1:20]
           [,1]       [,2]       [,3]       [,4]        [,5]       [,6]
row3 -0.6006509 -0.7123556  1.7574144 -0.2132517  0.01780431 -1.2288693
row1 -0.5219673 -0.5682005 -0.4076561 -2.3237217 -0.98258938 -0.4220166
           [,7]       [,8]       [,9]      [,10]     [,11]      [,12]
row3 -0.6563237 -0.6378521 -0.6498429 -0.6423272 -0.919889 -1.1896841
row1 -0.1158996  0.5924222 -0.7765053  0.8195185 -2.091056  0.8948732
            [,13]      [,14]      [,15]     [,16]     [,17]     [,18]
row3 -0.004118162 0.05817728 -0.8759062  1.406205 0.2589924 0.1074654
row1 -2.059909052 0.44367461  0.5908597 -2.166608 0.1772685 1.2645409
          [,19]     [,20]
row3  0.7567627 0.2752273
row1 -0.4012015 0.9805231
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
           [,1]      [,2]     [,3]       [,4]      [,5]     [,6]       [,7]
row2 -0.9971149 0.1961313 1.255169 -0.5493327 0.1095192 2.173281 -0.6435323
          [,8]     [,9]      [,10]
row2 0.7256051 1.297278 -0.8640989
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
          [,1]      [,2]      [,3]       [,4]       [,5]       [,6]    [,7]
row5 0.9712052 0.5500082 0.6121042 -0.2900504 0.08056003 -0.5838567 1.30299
          [,8]     [,9]      [,10]    [,11]       [,12]    [,13]     [,14]
row5 0.1105103 3.691894 0.02007035 0.308764 -0.08244704 -1.11837 0.8355733
          [,15]     [,16]     [,17]     [,18]     [,19]      [,20]
row5 -0.1141183 -1.171221 -0.435213 -1.139484 0.3966706 -0.5488514
> 
> 
> 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: 0x60000301c120>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM70593053f0e3"
 [2] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM705956ebdfde"
 [3] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM705917b69467"
 [4] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM705953c9025a"
 [5] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM705931b98daf"
 [6] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM7059d04f5aa" 
 [7] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM7059409c7293"
 [8] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM70595f263208"
 [9] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM7059449edc05"
[10] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM7059197eef75"
[11] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM70595c9af766"
[12] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM705941e87909"
[13] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM70595625fad" 
[14] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM70597d77599d"
[15] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM7059269c92c5"
> 
> 
> ### 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: 0x600003020360>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x600003020360>
Warning message:
In dir.create(new.directory) :
  '/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x600003020360>
> rowMedians(tmp)
  [1] -0.295400353  0.250494485  0.515390345  0.380684903 -0.321488912
  [6]  0.065585913 -0.195853194 -0.619733570  0.189477230  0.352207936
 [11]  0.028168883 -0.364871767 -0.224015382  0.772994707  0.562523000
 [16] -0.369654545 -0.329403381  0.019955602  0.728924050 -0.388948872
 [21]  0.271468579  0.354682028  0.451617677 -0.138204624 -0.121162866
 [26] -0.769795904  0.342303462  0.242847264 -0.330931611  0.088688660
 [31]  0.099878203 -0.117921568 -0.537042616  0.013532496 -0.311347419
 [36]  0.007094728  0.385361903 -0.068041383 -0.379027866  0.003021918
 [41]  0.048300071 -0.517564019 -0.426587579  0.017533313 -0.081255765
 [46]  0.150031830 -0.250189716  0.036308529  0.214912770  0.013830648
 [51] -0.297627039  0.369893712  0.281354298 -0.236638735 -0.131732304
 [56]  0.022863521  0.498452152  0.208706934 -0.104460855 -0.193697861
 [61] -0.354518086  0.078763278  0.072155463  0.188784366 -0.040767389
 [66]  0.115305907  0.002657437  0.069242159  0.344722607 -0.142340401
 [71] -0.184986235  0.057857103 -0.369533093 -0.095529798 -0.133753899
 [76] -0.022315742  0.406900211 -0.005903938 -0.155776015  0.044448795
 [81]  0.103988453 -0.145188819  0.467607241  0.726877605 -0.153353127
 [86]  0.564681513 -0.087102510  0.352129966 -0.317091958 -0.149452663
 [91]  0.236437975 -0.037115872  0.099299652  0.342636296  0.491360329
 [96] -0.075221128 -0.405333064 -0.037689152  0.102256990 -0.143043561
[101]  0.031218669 -0.512486636  0.240143008  0.016625967  0.326562629
[106]  0.053614107  0.597307043  0.258510862 -0.133934711 -0.071706729
[111]  0.404824110 -0.051967550  0.206146817  0.065974890 -0.778225190
[116] -0.107457739  0.290224584  0.162103973 -0.055837319  0.201106339
[121]  0.795068525 -0.110458353  0.759657635  0.171564289  0.092391288
[126]  0.554626821  0.035254435 -0.130453648  0.690839834 -0.437922446
[131] -0.058686079  0.337863759  0.205581700  0.715732655 -0.482382355
[136] -0.427243161  0.220410931  0.135520774 -0.126171676 -0.184597489
[141] -0.725530200  0.120320475 -0.070867341 -0.173691068 -0.024110723
[146] -0.315676160 -0.064059358  0.094990999 -0.357056449  0.289242392
[151] -0.082895431 -0.018603542 -0.518844781 -0.580341117 -0.059826967
[156] -0.158734276  0.092060859  0.525880785  0.655042016  0.002163579
[161]  0.113175855  0.289455793 -0.001460387  0.169515019  0.374693747
[166]  0.482228192  0.144170966  0.689337938  0.220779548 -0.041277058
[171] -0.782517627 -0.765498879 -0.469908698  0.177564737  0.051970175
[176]  0.518508455 -0.054557271  0.136247092 -0.188149956  0.752256272
[181]  0.318041804  0.035860247 -0.048592527  0.479273346  0.368307275
[186] -0.284796616 -0.439215427 -0.511440682  0.347669618 -0.404357792
[191]  0.138339510 -0.165621570 -0.287727718  0.210926595  0.030858631
[196]  0.373811470 -0.139332060  0.100011968 -0.469490349  0.224987618
[201]  0.519455068 -0.140577340  0.689147204  0.010777615  0.381570252
[206]  0.341402118  0.231818198 -0.505530084  0.366670198 -0.652584036
[211] -0.044144270 -0.381494804  0.536629061  0.355721853 -0.292971667
[216] -0.240725813  0.094970650  0.189011137  0.235542538  0.927720612
[221] -0.395183801 -0.487172535  0.399953618 -0.515941317 -0.042222339
[226]  0.238773792 -0.009619835 -0.025145063  1.006271693 -0.110979759
> 
> proc.time()
   user  system elapsed 
  2.194   9.751  18.837 

BufferedMatrix.Rcheck/tests/rawCalltesting.Rout


R version 4.5.2 Patched (2025-11-04 r88984) -- "[Not] Part in a Rumble"
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: 0x6000037b0300>
> .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: 0x6000037b0300>
> .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: 0x6000037b0300>
> .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: 0x6000037b0300>
> 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: 0x6000037b81e0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000037b81e0>
> .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: 0x6000037b81e0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000037b81e0>
> .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: 0x6000037b81e0>
> 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: 0x6000037b8360>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000037b8360>
> .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: 0x6000037b8360>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x6000037b8360>
> .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: 0x6000037b8360>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x6000037b8360>
> .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: 0x6000037b8360>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x6000037b8360>
> .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: 0x6000037b8360>
> 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: 0x6000037bc240>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x6000037bc240>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000037bc240>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000037bc240>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile78c926bcda0a" "BufferedMatrixFile78c9388eda64"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile78c926bcda0a" "BufferedMatrixFile78c9388eda64"
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000037bc480>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000037bc480>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x6000037bc480>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x6000037bc480>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x6000037bc480>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x6000037bc480>
> .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: 0x6000037bc660>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000037bc660>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x6000037bc660>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x6000037bc660>
> 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: 0x6000037bc840>
> .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: 0x6000037bc840>
> rm(P)
> 
> proc.time()
   user  system elapsed 
  0.354   0.110   0.561 

BufferedMatrix.Rcheck/tests/Rcodetesting.Rout


R version 4.5.2 Patched (2025-11-04 r88984) -- "[Not] Part in a Rumble"
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.339   0.076   0.547 

Example timings