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

This page was generated on 2025-09-22 11:40 -0400 (Mon, 22 Sep 2025).

HostnameOSArch (*)R versionInstalled pkgs
nebbiolo1Linux (Ubuntu 24.04.3 LTS)x86_644.5.1 (2025-06-13) -- "Great Square Root" 4827
merida1macOS 12.7.5 Montereyx86_644.5.1 RC (2025-06-05 r88288) -- "Great Square Root" 4608
kjohnson1macOS 13.6.6 Venturaarm644.5.1 Patched (2025-06-14 r88325) -- "Great Square Root" 4549
kunpeng2Linux (openEuler 24.03 LTS)aarch64R Under development (unstable) (2025-02-19 r87757) -- "Unsuffered Consequences" 4581
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 252/2341HostnameOS / ArchINSTALLBUILDCHECKBUILD BIN
BufferedMatrix 1.72.0  (landing page)
Ben Bolstad
Snapshot Date: 2025-09-18 13:40 -0400 (Thu, 18 Sep 2025)
git_url: https://git.bioconductor.org/packages/BufferedMatrix
git_branch: RELEASE_3_21
git_last_commit: aa9e634
git_last_commit_date: 2025-04-15 09:39:39 -0400 (Tue, 15 Apr 2025)
nebbiolo1Linux (Ubuntu 24.04.3 LTS) / x86_64  OK    OK    OK  UNNEEDED, same version is already published
merida1macOS 12.7.5 Monterey / x86_64  OK    OK    WARNINGS    OK  UNNEEDED, same version is already published
kjohnson1macOS 13.6.6 Ventura / arm64  OK    OK    WARNINGS    OK  UNNEEDED, same version is already published
kunpeng2Linux (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.72.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.72.0.tar.gz
StartedAt: 2025-09-19 15:04:15 -0400 (Fri, 19 Sep 2025)
EndedAt: 2025-09-19 15:04:55 -0400 (Fri, 19 Sep 2025)
EllapsedTime: 40.4 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.72.0.tar.gz
###
##############################################################################
##############################################################################


* using log directory ‘/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck’
* using R version 4.5.1 Patched (2025-06-14 r88325)
* 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.5
* using session charset: UTF-8
* using option ‘--no-vignettes’
* checking for file ‘BufferedMatrix/DESCRIPTION’ ... OK
* this is package ‘BufferedMatrix’ version ‘1.72.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.21-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.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.21-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.72.0’
** using staged installation
** libs
using C compiler: ‘Apple clang version 15.0.0 (clang-1500.0.40.1)’
using SDK: ‘MacOSX11.3.sdk’
clang -arch arm64 -std=gnu2x -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/opt/R/arm64/include    -fPIC  -falign-functions=64 -Wall -g -O2  -c RBufferedMatrix.c -o RBufferedMatrix.o
clang -arch arm64 -std=gnu2x -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/opt/R/arm64/include    -fPIC  -falign-functions=64 -Wall -g -O2  -c doubleBufferedMatrix.c -o doubleBufferedMatrix.o
doubleBufferedMatrix.c:1580:7: warning: logical not is only applied to the left hand side of this bitwise operator [-Wlogical-not-parentheses]
  if (!(Matrix->readonly) & setting){
      ^                   ~
doubleBufferedMatrix.c:1580:7: note: add parentheses after the '!' to evaluate the bitwise operator first
  if (!(Matrix->readonly) & setting){
      ^
       (                           )
doubleBufferedMatrix.c:1580:7: note: add parentheses around left hand side expression to silence this warning
  if (!(Matrix->readonly) & setting){
      ^
      (                  )
doubleBufferedMatrix.c:3327:12: warning: unused function 'sort_double' [-Wunused-function]
static int sort_double(const double *a1,const double *a2){
           ^
2 warnings generated.
clang -arch arm64 -std=gnu2x -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/opt/R/arm64/include    -fPIC  -falign-functions=64 -Wall -g -O2  -c doubleBufferedMatrix_C_tests.c -o doubleBufferedMatrix_C_tests.o
clang -arch arm64 -std=gnu2x -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/opt/R/arm64/include    -fPIC  -falign-functions=64 -Wall -g -O2  -c init_package.c -o init_package.o
clang -arch arm64 -std=gnu2x -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -L/Library/Frameworks/R.framework/Resources/lib -L/opt/R/arm64/lib -o BufferedMatrix.so RBufferedMatrix.o doubleBufferedMatrix.o doubleBufferedMatrix_C_tests.o init_package.o -F/Library/Frameworks/R.framework/.. -framework R
installing to /Library/Frameworks/R.framework/Versions/4.5-arm64/Resources/library/00LOCK-BufferedMatrix/00new/BufferedMatrix/libs
** R
** inst
** byte-compile and prepare package for lazy loading
Creating a new generic function for ‘rowMeans’ in package ‘BufferedMatrix’
Creating a new generic function for ‘rowSums’ in package ‘BufferedMatrix’
Creating a new generic function for ‘colMeans’ in package ‘BufferedMatrix’
Creating a new generic function for ‘colSums’ in package ‘BufferedMatrix’
Creating a generic function for ‘ncol’ from package ‘base’ in package ‘BufferedMatrix’
Creating a generic function for ‘nrow’ from package ‘base’ in package ‘BufferedMatrix’
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
** checking absolute paths in shared objects and dynamic libraries
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (BufferedMatrix)

Tests output

BufferedMatrix.Rcheck/tests/c_code_level_tests.Rout


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

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

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

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

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

Attaching package: 'BufferedMatrix'

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

    colMeans, colSums, rowMeans, rowSums

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

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

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

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

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

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

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

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

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

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

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

[[1]]
[1] 0

> 
> proc.time()
   user  system elapsed 
  0.336   0.118   0.446 

BufferedMatrix.Rcheck/tests/objectTesting.Rout


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

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

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

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

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

Attaching package: 'BufferedMatrix'

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

    colMeans, colSums, rowMeans, rowSums

> 
> 
> ### this is used to control how many repetitions in something below
> ### higher values result in more checks.
> nreps <-100 ##20000
> 
> 
> ## test creation and some simple assignments and subsetting operations
> 
> ## first on single elements
> tmp <- createBufferedMatrix(1000,10)
> 
> tmp[10,5]
[1] 0
> tmp[10,5] <- 10
> tmp[10,5]
[1] 10
> tmp[10,5] <- 12.445
> tmp[10,5]
[1] 12.445
> 
> 
> 
> ## now testing accessing multiple elements
> tmp2 <- createBufferedMatrix(10,20)
> 
> 
> tmp2[3,1] <- 51.34
> tmp2[9,2] <- 9.87654
> tmp2[,1:2]
       [,1]    [,2]
 [1,]  0.00 0.00000
 [2,]  0.00 0.00000
 [3,] 51.34 0.00000
 [4,]  0.00 0.00000
 [5,]  0.00 0.00000
 [6,]  0.00 0.00000
 [7,]  0.00 0.00000
 [8,]  0.00 0.00000
 [9,]  0.00 9.87654
[10,]  0.00 0.00000
> tmp2[,-(3:20)]
       [,1]    [,2]
 [1,]  0.00 0.00000
 [2,]  0.00 0.00000
 [3,] 51.34 0.00000
 [4,]  0.00 0.00000
 [5,]  0.00 0.00000
 [6,]  0.00 0.00000
 [7,]  0.00 0.00000
 [8,]  0.00 0.00000
 [9,]  0.00 9.87654
[10,]  0.00 0.00000
> tmp2[3,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
[1,] 51.34    0    0    0    0    0    0    0    0     0     0     0     0
     [,14] [,15] [,16] [,17] [,18] [,19] [,20]
[1,]     0     0     0     0     0     0     0
> tmp2[-3,]
      [,1]    [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [2,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [3,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [4,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [5,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [6,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [7,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [8,]    0 9.87654    0    0    0    0    0    0    0     0     0     0     0
 [9,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
      [,14] [,15] [,16] [,17] [,18] [,19] [,20]
 [1,]     0     0     0     0     0     0     0
 [2,]     0     0     0     0     0     0     0
 [3,]     0     0     0     0     0     0     0
 [4,]     0     0     0     0     0     0     0
 [5,]     0     0     0     0     0     0     0
 [6,]     0     0     0     0     0     0     0
 [7,]     0     0     0     0     0     0     0
 [8,]     0     0     0     0     0     0     0
 [9,]     0     0     0     0     0     0     0
> tmp2[2,1:3]
     [,1] [,2] [,3]
[1,]    0    0    0
> tmp2[3:9,1:3]
      [,1]    [,2] [,3]
[1,] 51.34 0.00000    0
[2,]  0.00 0.00000    0
[3,]  0.00 0.00000    0
[4,]  0.00 0.00000    0
[5,]  0.00 0.00000    0
[6,]  0.00 0.00000    0
[7,]  0.00 9.87654    0
> tmp2[-4,-4]
       [,1]    [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [2,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [3,] 51.34 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [4,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [5,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [6,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [7,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [8,]  0.00 9.87654    0    0    0    0    0    0    0     0     0     0     0
 [9,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
      [,14] [,15] [,16] [,17] [,18] [,19]
 [1,]     0     0     0     0     0     0
 [2,]     0     0     0     0     0     0
 [3,]     0     0     0     0     0     0
 [4,]     0     0     0     0     0     0
 [5,]     0     0     0     0     0     0
 [6,]     0     0     0     0     0     0
 [7,]     0     0     0     0     0     0
 [8,]     0     0     0     0     0     0
 [9,]     0     0     0     0     0     0
> 
> ## now testing accessing/assigning multiple elements
> tmp3 <- createBufferedMatrix(10,10)
> 
> for (i in 1:10){
+   for (j in 1:10){
+     tmp3[i,j] <- (j-1)*10 + i
+   }
+ }
> 
> tmp3[2:4,2:4]
     [,1] [,2] [,3]
[1,]   12   22   32
[2,]   13   23   33
[3,]   14   24   34
> tmp3[c(-10),c(2:4,2:4,10,1,2,1:10,10:1)]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]   11   21   31   11   21   31   91    1   11     1    11    21    31
 [2,]   12   22   32   12   22   32   92    2   12     2    12    22    32
 [3,]   13   23   33   13   23   33   93    3   13     3    13    23    33
 [4,]   14   24   34   14   24   34   94    4   14     4    14    24    34
 [5,]   15   25   35   15   25   35   95    5   15     5    15    25    35
 [6,]   16   26   36   16   26   36   96    6   16     6    16    26    36
 [7,]   17   27   37   17   27   37   97    7   17     7    17    27    37
 [8,]   18   28   38   18   28   38   98    8   18     8    18    28    38
 [9,]   19   29   39   19   29   39   99    9   19     9    19    29    39
      [,14] [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24] [,25]
 [1,]    41    51    61    71    81    91    91    81    71    61    51    41
 [2,]    42    52    62    72    82    92    92    82    72    62    52    42
 [3,]    43    53    63    73    83    93    93    83    73    63    53    43
 [4,]    44    54    64    74    84    94    94    84    74    64    54    44
 [5,]    45    55    65    75    85    95    95    85    75    65    55    45
 [6,]    46    56    66    76    86    96    96    86    76    66    56    46
 [7,]    47    57    67    77    87    97    97    87    77    67    57    47
 [8,]    48    58    68    78    88    98    98    88    78    68    58    48
 [9,]    49    59    69    79    89    99    99    89    79    69    59    49
      [,26] [,27] [,28] [,29]
 [1,]    31    21    11     1
 [2,]    32    22    12     2
 [3,]    33    23    13     3
 [4,]    34    24    14     4
 [5,]    35    25    15     5
 [6,]    36    26    16     6
 [7,]    37    27    17     7
 [8,]    38    28    18     8
 [9,]    39    29    19     9
> tmp3[-c(1:5),-c(6:10)]
     [,1] [,2] [,3] [,4] [,5]
[1,]    6   16   26   36   46
[2,]    7   17   27   37   47
[3,]    8   18   28   38   48
[4,]    9   19   29   39   49
[5,]   10   20   30   40   50
> 
> ## assignment of whole columns
> tmp3[,1] <- c(1:10*100.0)
> tmp3[,1:2] <- tmp3[,1:2]*100
> tmp3[,1:2] <- tmp3[,2:1]
> tmp3[,1:2]
      [,1]  [,2]
 [1,] 1100 1e+04
 [2,] 1200 2e+04
 [3,] 1300 3e+04
 [4,] 1400 4e+04
 [5,] 1500 5e+04
 [6,] 1600 6e+04
 [7,] 1700 7e+04
 [8,] 1800 8e+04
 [9,] 1900 9e+04
[10,] 2000 1e+05
> 
> 
> tmp3[,-1] <- tmp3[,1:9]
> tmp3[,1:10]
      [,1] [,2]  [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,] 1100 1100 1e+04   21   31   41   51   61   71    81
 [2,] 1200 1200 2e+04   22   32   42   52   62   72    82
 [3,] 1300 1300 3e+04   23   33   43   53   63   73    83
 [4,] 1400 1400 4e+04   24   34   44   54   64   74    84
 [5,] 1500 1500 5e+04   25   35   45   55   65   75    85
 [6,] 1600 1600 6e+04   26   36   46   56   66   76    86
 [7,] 1700 1700 7e+04   27   37   47   57   67   77    87
 [8,] 1800 1800 8e+04   28   38   48   58   68   78    88
 [9,] 1900 1900 9e+04   29   39   49   59   69   79    89
[10,] 2000 2000 1e+05   30   40   50   60   70   80    90
> 
> tmp3[,1:2] <- rep(1,10)
> tmp3[,1:2] <- rep(1,20)
> tmp3[,1:2] <- matrix(c(1:5),1,5)
> 
> tmp3[,-c(1:8)] <- matrix(c(1:5),1,5)
> 
> tmp3[1,] <- 1:10
> tmp3[1,]
     [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,]    1    2    3    4    5    6    7    8    9    10
> tmp3[-1,] <- c(1,2)
> tmp3[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    1    2    3    4    5    6    7    8    9    10
 [2,]    1    2    1    2    1    2    1    2    1     2
 [3,]    2    1    2    1    2    1    2    1    2     1
 [4,]    1    2    1    2    1    2    1    2    1     2
 [5,]    2    1    2    1    2    1    2    1    2     1
 [6,]    1    2    1    2    1    2    1    2    1     2
 [7,]    2    1    2    1    2    1    2    1    2     1
 [8,]    1    2    1    2    1    2    1    2    1     2
 [9,]    2    1    2    1    2    1    2    1    2     1
[10,]    1    2    1    2    1    2    1    2    1     2
> tmp3[-c(1:8),] <- matrix(c(1:5),1,5)
> tmp3[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    1    2    3    4    5    6    7    8    9    10
 [2,]    1    2    1    2    1    2    1    2    1     2
 [3,]    2    1    2    1    2    1    2    1    2     1
 [4,]    1    2    1    2    1    2    1    2    1     2
 [5,]    2    1    2    1    2    1    2    1    2     1
 [6,]    1    2    1    2    1    2    1    2    1     2
 [7,]    2    1    2    1    2    1    2    1    2     1
 [8,]    1    2    1    2    1    2    1    2    1     2
 [9,]    1    3    5    2    4    1    3    5    2     4
[10,]    2    4    1    3    5    2    4    1    3     5
> 
> 
> tmp3[1:2,1:2] <- 5555.04
> tmp3[-(1:2),1:2] <- 1234.56789
> 
> 
> 
> ## testing accessors for the directory and prefix
> directory(tmp3)
[1] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests"
> prefix(tmp3)
[1] "BM"
> 
> ## testing if we can remove these objects
> rm(tmp, tmp2, tmp3)
> gc()
         used (Mb) gc trigger (Mb) limit (Mb) max used (Mb)
Ncells 480828 25.7    1056581 56.5         NA   634425 33.9
Vcells 891011  6.8    8388608 64.0      65536  2109041 16.1
> 
> 
> 
> 
> ##
> ## checking reads
> ##
> 
> tmp2 <- createBufferedMatrix(10,20)
> 
> test.sample <- rnorm(10*20)
> 
> tmp2[1:10,1:20] <- test.sample
> 
> test.matrix <- matrix(test.sample,10,20)
> 
> ## testing reads
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   which.col <- sample(1:20,1)
+   if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> date()
[1] "Fri Sep 19 15:04:35 2025"
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> date()
[1] "Fri Sep 19 15:04:35 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: 0x600000ab00c0>
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   which.col <- sample(1:20,1)
+   if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,5,replace=TRUE)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> date()
[1] "Fri Sep 19 15:04:37 2025"
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col <- sample(1:20,5,replace=TRUE)
+   if (!all(tmp2[which.row,which.col] == test.matrix[which.row,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> date()
[1] "Fri Sep 19 15:04:38 2025"
> 
> ColMode(tmp2)
<pointer: 0x600000ab00c0>
> 
> 
> 
> ### 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.6412557 -0.1080340  1.59936399 -0.3569980
[2,]   1.0368756  1.6663340 -0.18695169 -0.1935073
[3,]  -1.1569807 -0.8946074  1.31253748  0.6488535
[4,]  -0.6389508 -0.1612991  0.09738559 -0.2640380
> ewApply(tmp5,abs)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.21-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.6412557 0.1080340 1.59936399 0.3569980
[2,]   1.0368756 1.6663340 0.18695169 0.1935073
[3,]   1.1569807 0.8946074 1.31253748 0.6488535
[4,]   0.6389508 0.1612991 0.09738559 0.2640380
> ewApply(tmp5,sqrt)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.21-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.032012 0.3286853 1.2646596 0.5974931
[2,]  1.018271 1.2908656 0.4323791 0.4398947
[3,]  1.075630 0.9458369 1.1456603 0.8055144
[4,]  0.799344 0.4016206 0.3120666 0.5138463
> 
> 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.21-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.96137 28.39489 39.24596 31.33193
[2,]  36.21958 39.57499 29.51074 29.59245
[3,]  36.91328 35.35298 37.76914 33.70400
[4,]  33.63239 29.17751 28.21805 30.40250
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x600000abc0c0>
> exp(tmp5)
<pointer: 0x600000abc0c0>
> log(tmp5,2)
<pointer: 0x600000abc0c0>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 470.309
> Min(tmp5)
[1] 53.67477
> mean(tmp5)
[1] 73.65047
> Sum(tmp5)
[1] 14730.09
> Var(tmp5)
[1] 864.1513
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 90.81752 71.44981 72.77439 72.38847 70.77159 75.39050 68.82585 73.13061
 [9] 70.57303 70.38293
> rowSums(tmp5)
 [1] 1816.350 1428.996 1455.488 1447.769 1415.432 1507.810 1376.517 1462.612
 [9] 1411.461 1407.659
> rowVars(tmp5)
 [1] 8054.58112   52.44368   61.50723   89.96780   81.73446   58.33275
 [7]   97.91737   78.04779   67.65366   32.95598
> rowSd(tmp5)
 [1] 89.747318  7.241801  7.842655  9.485136  9.040711  7.637588  9.895321
 [8]  8.834466  8.225185  5.740730
> rowMax(tmp5)
 [1] 470.30899  85.47640  85.80955  89.94631  85.00213  89.94024  87.44903
 [8]  84.59264  85.39059  80.58571
> rowMin(tmp5)
 [1] 55.88656 59.56821 59.43075 57.76732 56.36661 64.87577 53.67477 56.95966
 [9] 53.86177 61.34692
> 
> colMeans(tmp5)
 [1] 109.84945  72.07068  68.60975  66.74504  71.07447  69.07683  73.13918
 [8]  67.31605  74.47970  70.54586  72.55191  73.28424  74.11461  76.93567
[15]  75.04150  74.45770  73.71307  66.13950  70.72359  73.14057
> colSums(tmp5)
 [1] 1098.4945  720.7068  686.0975  667.4504  710.7447  690.7683  731.3918
 [8]  673.1605  744.7970  705.4586  725.5191  732.8424  741.1461  769.3567
[15]  750.4150  744.5770  737.1307  661.3950  707.2359  731.4057
> colVars(tmp5)
 [1] 16091.62201   122.98538    78.11778    14.22254    53.66060    63.77111
 [7]    18.77086    86.16542    49.82923    62.46431   127.87737    72.18705
[13]    60.54016    32.94690   104.70797    52.00757    46.46238    60.91365
[19]    65.15495   126.93523
> colSd(tmp5)
 [1] 126.852757  11.089877   8.838426   3.771278   7.325339   7.985682
 [7]   4.332535   9.282533   7.058982   7.903436  11.308287   8.496296
[13]   7.780756   5.739939  10.232691   7.211627   6.816332   7.804720
[19]   8.071862  11.266554
> colMax(tmp5)
 [1] 470.30899  86.62390  81.68532  72.67352  81.33997  79.20814  78.34829
 [8]  85.00213  85.39059  84.83152  89.94024  84.17172  87.44569  85.80955
[15]  87.44903  85.96871  79.38525  80.74539  82.37188  89.94631
> colMin(tmp5)
 [1] 59.79862 56.36661 53.67477 61.59282 57.52601 55.88066 65.60064 53.86177
 [9] 62.83416 59.56821 56.95966 58.86679 63.50377 69.79310 56.63704 66.39380
[17] 60.25818 55.88656 61.34692 57.34281
> 
> 
> ### setting a random element to NA and then testing with na.rm=TRUE or na.rm=FALSE (The default)
> 
> 
> which.row <- sample(1:10,1,replace=TRUE)
> which.col  <- sample(1:20,1,replace=TRUE)
> 
> tmp5[which.row,which.col] <- NA
> 
> Max(tmp5)
[1] NA
> Min(tmp5)
[1] NA
> mean(tmp5)
[1] NA
> Sum(tmp5)
[1] NA
> Var(tmp5)
[1] NA
> 
> rowMeans(tmp5)
 [1] 90.81752 71.44981 72.77439 72.38847       NA 75.39050 68.82585 73.13061
 [9] 70.57303 70.38293
> rowSums(tmp5)
 [1] 1816.350 1428.996 1455.488 1447.769       NA 1507.810 1376.517 1462.612
 [9] 1411.461 1407.659
> rowVars(tmp5)
 [1] 8054.58112   52.44368   61.50723   89.96780   80.08131   58.33275
 [7]   97.91737   78.04779   67.65366   32.95598
> rowSd(tmp5)
 [1] 89.747318  7.241801  7.842655  9.485136  8.948816  7.637588  9.895321
 [8]  8.834466  8.225185  5.740730
> rowMax(tmp5)
 [1] 470.30899  85.47640  85.80955  89.94631        NA  89.94024  87.44903
 [8]  84.59264  85.39059  80.58571
> rowMin(tmp5)
 [1] 55.88656 59.56821 59.43075 57.76732       NA 64.87577 53.67477 56.95966
 [9] 53.86177 61.34692
> 
> colMeans(tmp5)
 [1] 109.84945  72.07068  68.60975  66.74504  71.07447  69.07683  73.13918
 [8]  67.31605  74.47970  70.54586  72.55191  73.28424  74.11461  76.93567
[15]  75.04150  74.45770  73.71307  66.13950        NA  73.14057
> colSums(tmp5)
 [1] 1098.4945  720.7068  686.0975  667.4504  710.7447  690.7683  731.3918
 [8]  673.1605  744.7970  705.4586  725.5191  732.8424  741.1461  769.3567
[15]  750.4150  744.5770  737.1307  661.3950        NA  731.4057
> colVars(tmp5)
 [1] 16091.62201   122.98538    78.11778    14.22254    53.66060    63.77111
 [7]    18.77086    86.16542    49.82923    62.46431   127.87737    72.18705
[13]    60.54016    32.94690   104.70797    52.00757    46.46238    60.91365
[19]          NA   126.93523
> colSd(tmp5)
 [1] 126.852757  11.089877   8.838426   3.771278   7.325339   7.985682
 [7]   4.332535   9.282533   7.058982   7.903436  11.308287   8.496296
[13]   7.780756   5.739939  10.232691   7.211627   6.816332   7.804720
[19]         NA  11.266554
> colMax(tmp5)
 [1] 470.30899  86.62390  81.68532  72.67352  81.33997  79.20814  78.34829
 [8]  85.00213  85.39059  84.83152  89.94024  84.17172  87.44569  85.80955
[15]  87.44903  85.96871  79.38525  80.74539        NA  89.94631
> colMin(tmp5)
 [1] 59.79862 56.36661 53.67477 61.59282 57.52601 55.88066 65.60064 53.86177
 [9] 62.83416 59.56821 56.95966 58.86679 63.50377 69.79310 56.63704 66.39380
[17] 60.25818 55.88656       NA 57.34281
> 
> Max(tmp5,na.rm=TRUE)
[1] 470.309
> Min(tmp5,na.rm=TRUE)
[1] 53.67477
> mean(tmp5,na.rm=TRUE)
[1] 73.61322
> Sum(tmp5,na.rm=TRUE)
[1] 14649.03
> Var(tmp5,na.rm=TRUE)
[1] 868.2368
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 90.81752 71.44981 72.77439 72.38847 70.22993 75.39050 68.82585 73.13061
 [9] 70.57303 70.38293
> rowSums(tmp5,na.rm=TRUE)
 [1] 1816.350 1428.996 1455.488 1447.769 1334.369 1507.810 1376.517 1462.612
 [9] 1411.461 1407.659
> rowVars(tmp5,na.rm=TRUE)
 [1] 8054.58112   52.44368   61.50723   89.96780   80.08131   58.33275
 [7]   97.91737   78.04779   67.65366   32.95598
> rowSd(tmp5,na.rm=TRUE)
 [1] 89.747318  7.241801  7.842655  9.485136  8.948816  7.637588  9.895321
 [8]  8.834466  8.225185  5.740730
> rowMax(tmp5,na.rm=TRUE)
 [1] 470.30899  85.47640  85.80955  89.94631  85.00213  89.94024  87.44903
 [8]  84.59264  85.39059  80.58571
> rowMin(tmp5,na.rm=TRUE)
 [1] 55.88656 59.56821 59.43075 57.76732 56.36661 64.87577 53.67477 56.95966
 [9] 53.86177 61.34692
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 109.84945  72.07068  68.60975  66.74504  71.07447  69.07683  73.13918
 [8]  67.31605  74.47970  70.54586  72.55191  73.28424  74.11461  76.93567
[15]  75.04150  74.45770  73.71307  66.13950  69.57475  73.14057
> colSums(tmp5,na.rm=TRUE)
 [1] 1098.4945  720.7068  686.0975  667.4504  710.7447  690.7683  731.3918
 [8]  673.1605  744.7970  705.4586  725.5191  732.8424  741.1461  769.3567
[15]  750.4150  744.5770  737.1307  661.3950  626.1728  731.4057
> colVars(tmp5,na.rm=TRUE)
 [1] 16091.62201   122.98538    78.11778    14.22254    53.66060    63.77111
 [7]    18.77086    86.16542    49.82923    62.46431   127.87737    72.18705
[13]    60.54016    32.94690   104.70797    52.00757    46.46238    60.91365
[19]    58.45115   126.93523
> colSd(tmp5,na.rm=TRUE)
 [1] 126.852757  11.089877   8.838426   3.771278   7.325339   7.985682
 [7]   4.332535   9.282533   7.058982   7.903436  11.308287   8.496296
[13]   7.780756   5.739939  10.232691   7.211627   6.816332   7.804720
[19]   7.645335  11.266554
> colMax(tmp5,na.rm=TRUE)
 [1] 470.30899  86.62390  81.68532  72.67352  81.33997  79.20814  78.34829
 [8]  85.00213  85.39059  84.83152  89.94024  84.17172  87.44569  85.80955
[15]  87.44903  85.96871  79.38525  80.74539  82.37188  89.94631
> colMin(tmp5,na.rm=TRUE)
 [1] 59.79862 56.36661 53.67477 61.59282 57.52601 55.88066 65.60064 53.86177
 [9] 62.83416 59.56821 56.95966 58.86679 63.50377 69.79310 56.63704 66.39380
[17] 60.25818 55.88656 61.34692 57.34281
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1] 90.81752 71.44981 72.77439 72.38847      NaN 75.39050 68.82585 73.13061
 [9] 70.57303 70.38293
> rowSums(tmp5,na.rm=TRUE)
 [1] 1816.350 1428.996 1455.488 1447.769    0.000 1507.810 1376.517 1462.612
 [9] 1411.461 1407.659
> rowVars(tmp5,na.rm=TRUE)
 [1] 8054.58112   52.44368   61.50723   89.96780         NA   58.33275
 [7]   97.91737   78.04779   67.65366   32.95598
> rowSd(tmp5,na.rm=TRUE)
 [1] 89.747318  7.241801  7.842655  9.485136        NA  7.637588  9.895321
 [8]  8.834466  8.225185  5.740730
> rowMax(tmp5,na.rm=TRUE)
 [1] 470.30899  85.47640  85.80955  89.94631        NA  89.94024  87.44903
 [8]  84.59264  85.39059  80.58571
> rowMin(tmp5,na.rm=TRUE)
 [1] 55.88656 59.56821 59.43075 57.76732       NA 64.87577 53.67477 56.95966
 [9] 53.86177 61.34692
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1] 114.04695  73.81558  68.38690  66.92505  71.43681  69.80317  73.97679
 [8]  65.35093  74.70787  70.90193  71.55110  73.03764  73.70913  76.65802
[15]  77.08644  73.60752  73.33861  66.61934       NaN  74.87235
> colSums(tmp5,na.rm=TRUE)
 [1] 1026.4226  664.3402  615.4821  602.3255  642.9313  628.2285  665.7911
 [8]  588.1583  672.3709  638.1173  643.9599  657.3388  663.3822  689.9222
[15]  693.7779  662.4677  660.0474  599.5740    0.0000  673.8512
> colVars(tmp5,na.rm=TRUE)
 [1] 17904.86106   104.10608    87.32379    15.63579    58.89115    65.80742
 [7]    13.22422    53.49198    55.47216    68.84604   132.59387    80.52630
[13]    66.25806    36.19803    70.75148    50.37704    50.69269    65.93769
[19]          NA   109.06279
> colSd(tmp5,na.rm=TRUE)
 [1] 133.809047  10.203239   9.344720   3.954212   7.674057   8.112177
 [7]   3.636512   7.313821   7.447964   8.297351  11.514941   8.973645
[13]   8.139905   6.016480   8.411390   7.097678   7.119880   8.120203
[19]         NA  10.443313
> colMax(tmp5,na.rm=TRUE)
 [1] 470.30899  86.62390  81.68532  72.67352  81.33997  79.20814  78.34829
 [8]  74.89900  85.39059  84.83152  89.94024  84.17172  87.44569  85.80955
[15]  87.44903  85.96871  79.38525  80.74539      -Inf  89.94631
> colMin(tmp5,na.rm=TRUE)
 [1] 59.79862 59.10024 53.67477 61.59282 57.52601 55.88066 67.96284 53.86177
 [9] 62.83416 59.56821 56.95966 58.86679 63.50377 69.79310 59.43075 66.39380
[17] 60.25818 55.88656      Inf 57.34281
> 
> 
> 
> 
> 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] 302.8204 282.6669 212.3599 236.0243 256.3705 190.2574 215.6274 205.2628
 [9] 233.7884 366.2253
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 302.8204 282.6669 212.3599 236.0243 256.3705 190.2574 215.6274 205.2628
 [9] 233.7884 366.2253
> 
> 
> 
> 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 -3.410605e-13  2.273737e-13  0.000000e+00  8.526513e-14
 [6]  0.000000e+00 -5.684342e-14 -2.842171e-14 -5.684342e-14  0.000000e+00
[11] -5.684342e-14  5.684342e-14 -2.557954e-13  0.000000e+00  1.989520e-13
[16] -2.842171e-14  2.842171e-14 -4.263256e-13 -4.263256e-14 -1.563194e-13
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> ## making sure these things agree
> ##
> ## first when there is no NA
> 
> 
> 
> agree.checks <- function(buff.matrix,r.matrix,err.tol=1e-10){
+ 
+   if (Max(buff.matrix,na.rm=TRUE) != max(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Max")
+   }
+   
+ 
+   if (Min(buff.matrix,na.rm=TRUE) != min(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Min")
+   }
+ 
+ 
+   if (abs(Sum(buff.matrix,na.rm=TRUE)- sum(r.matrix,na.rm=TRUE)) > err.tol){
+ 
+     cat(Sum(buff.matrix,na.rm=TRUE),"\n")
+     cat(sum(r.matrix,na.rm=TRUE),"\n")
+     cat(Sum(buff.matrix,na.rm=TRUE) - sum(r.matrix,na.rm=TRUE),"\n")
+     
+     stop("No agreement in Sum")
+   }
+   
+   if (abs(mean(buff.matrix,na.rm=TRUE) - mean(r.matrix,na.rm=TRUE)) > err.tol){
+     stop("No agreement in mean")
+   }
+   
+   
+   if(abs(Var(buff.matrix,na.rm=TRUE) - var(as.vector(r.matrix),na.rm=TRUE)) > err.tol){
+     stop("No agreement in Var")
+   }
+   
+   
+ 
+   if(any(abs(rowMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,mean,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowMeans")
+   }
+   
+   
+   if(any(abs(colMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,mean,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colMeans")
+   }
+   
+   
+   if(any(abs(rowSums(buff.matrix,na.rm=TRUE)  -  apply(r.matrix,1,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in rowSums")
+   }
+   
+   
+   if(any(abs(colSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colSums")
+   }
+   
+   ### this is to get around the fact that R doesn't like to compute NA on an entire vector of NA when 
+   ### computing variance
+   my.Var <- function(x,na.rm=FALSE){
+    if (all(is.na(x))){
+      return(NA)
+    } else {
+      var(x,na.rm=na.rm)
+    }
+ 
+   }
+   
+   if(any(abs(rowVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+   
+   
+   if(any(abs(colVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+ 
+ 
+   if(any(abs(rowMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+ 
+   if(any(abs(colMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+   
+   
+   if(any(abs(rowMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+   
+ 
+   if(any(abs(colMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+ 
+   if(any(abs(colMedians(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,median,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMedian")
+   }
+ 
+   if(any(abs(colRanges(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,range,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colRanges")
+   }
+ 
+ 
+   
+ }
> 
> 
> 
> 
> 
> 
> 
> 
> 
> for (rep in 1:20){
+   copymatrix <- matrix(rnorm(200,150,15),10,20)
+   
+   tmp5[1:10,1:20] <- copymatrix
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ## now lets assign some NA values and check agreement
+ 
+   which.row <- sample(1:10,1,replace=TRUE)
+   which.col  <- sample(1:20,1,replace=TRUE)
+   
+   cat(which.row," ",which.col,"\n")
+   
+   tmp5[which.row,which.col] <- NA
+   copymatrix[which.row,which.col] <- NA
+   
+   agree.checks(tmp5,copymatrix)
+ 
+   ## make an entire row NA
+   tmp5[which.row,] <- NA
+   copymatrix[which.row,] <- NA
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ### also make an entire col NA
+   tmp5[,which.col] <- NA
+   copymatrix[,which.col] <- NA
+ 
+   agree.checks(tmp5,copymatrix)
+ 
+   ### now make 1 element non NA with NA in the rest of row and column
+ 
+   tmp5[which.row,which.col] <- rnorm(1,150,15)
+   copymatrix[which.row,which.col] <- tmp5[which.row,which.col]
+ 
+   agree.checks(tmp5,copymatrix)
+ }
10   12 
1   19 
5   19 
1   2 
5   15 
8   3 
3   10 
6   8 
4   15 
5   19 
8   4 
8   1 
2   16 
3   12 
1   14 
7   15 
2   7 
6   5 
2   19 
3   15 
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.541775
> Min(tmp)
[1] -2.08523
> mean(tmp)
[1] 0.04764428
> Sum(tmp)
[1] 4.764428
> Var(tmp)
[1] 0.9092767
> 
> rowMeans(tmp)
[1] 0.04764428
> rowSums(tmp)
[1] 4.764428
> rowVars(tmp)
[1] 0.9092767
> rowSd(tmp)
[1] 0.95356
> rowMax(tmp)
[1] 2.541775
> rowMin(tmp)
[1] -2.08523
> 
> colMeans(tmp)
  [1]  0.24596207 -2.08523016  1.45293033 -0.11386102 -0.21207311 -0.86502407
  [7] -0.65352610  0.04183482  0.03485097  2.51055419 -0.32659329 -1.10177930
 [13]  0.46024155  0.68960449 -0.88101598  0.08785093  0.11547558  0.54045124
 [19] -0.40343961 -0.42833037 -0.30368868  0.75428842  0.35910175 -1.19361634
 [25]  1.75114460 -1.17677376  1.24723271  1.16045380 -0.44694285 -0.02967069
 [31]  0.22954260 -1.23357193  0.75892216 -0.41260241 -0.26878415  0.06610073
 [37]  0.28917156 -1.04197165 -0.51473340  0.86350735 -1.11173874  0.26527971
 [43]  0.10858089 -1.99886697  1.12215477 -0.71304807 -1.24826054  1.53395555
 [49]  1.10202936  0.36073041  0.54686641 -0.39508229 -0.77947149 -0.71592788
 [55] -0.59056067  0.77740655  0.75292768  0.74650068  0.47640980 -0.81361571
 [61]  1.26435029 -1.19261216 -0.50043606 -1.15272607 -0.71274881  1.00726583
 [67]  0.47820051 -0.14489357  0.83312484  1.28276399 -1.15708203  0.53936211
 [73]  0.44732598 -1.27089225 -0.21235539 -0.74370997  1.09139149  1.71510157
 [79] -0.97875164  0.81454111 -0.59976516  0.54991750 -1.09012911  1.37480482
 [85]  1.33123665  2.54177475 -0.21842782 -0.75865222 -0.48790256 -1.00842060
 [91]  0.58797145  1.49294663  0.18914760  1.11005539  0.01729191 -0.40224775
 [97] -1.93135845 -0.32340650  0.95894377  0.63116537
> colSums(tmp)
  [1]  0.24596207 -2.08523016  1.45293033 -0.11386102 -0.21207311 -0.86502407
  [7] -0.65352610  0.04183482  0.03485097  2.51055419 -0.32659329 -1.10177930
 [13]  0.46024155  0.68960449 -0.88101598  0.08785093  0.11547558  0.54045124
 [19] -0.40343961 -0.42833037 -0.30368868  0.75428842  0.35910175 -1.19361634
 [25]  1.75114460 -1.17677376  1.24723271  1.16045380 -0.44694285 -0.02967069
 [31]  0.22954260 -1.23357193  0.75892216 -0.41260241 -0.26878415  0.06610073
 [37]  0.28917156 -1.04197165 -0.51473340  0.86350735 -1.11173874  0.26527971
 [43]  0.10858089 -1.99886697  1.12215477 -0.71304807 -1.24826054  1.53395555
 [49]  1.10202936  0.36073041  0.54686641 -0.39508229 -0.77947149 -0.71592788
 [55] -0.59056067  0.77740655  0.75292768  0.74650068  0.47640980 -0.81361571
 [61]  1.26435029 -1.19261216 -0.50043606 -1.15272607 -0.71274881  1.00726583
 [67]  0.47820051 -0.14489357  0.83312484  1.28276399 -1.15708203  0.53936211
 [73]  0.44732598 -1.27089225 -0.21235539 -0.74370997  1.09139149  1.71510157
 [79] -0.97875164  0.81454111 -0.59976516  0.54991750 -1.09012911  1.37480482
 [85]  1.33123665  2.54177475 -0.21842782 -0.75865222 -0.48790256 -1.00842060
 [91]  0.58797145  1.49294663  0.18914760  1.11005539  0.01729191 -0.40224775
 [97] -1.93135845 -0.32340650  0.95894377  0.63116537
> 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.24596207 -2.08523016  1.45293033 -0.11386102 -0.21207311 -0.86502407
  [7] -0.65352610  0.04183482  0.03485097  2.51055419 -0.32659329 -1.10177930
 [13]  0.46024155  0.68960449 -0.88101598  0.08785093  0.11547558  0.54045124
 [19] -0.40343961 -0.42833037 -0.30368868  0.75428842  0.35910175 -1.19361634
 [25]  1.75114460 -1.17677376  1.24723271  1.16045380 -0.44694285 -0.02967069
 [31]  0.22954260 -1.23357193  0.75892216 -0.41260241 -0.26878415  0.06610073
 [37]  0.28917156 -1.04197165 -0.51473340  0.86350735 -1.11173874  0.26527971
 [43]  0.10858089 -1.99886697  1.12215477 -0.71304807 -1.24826054  1.53395555
 [49]  1.10202936  0.36073041  0.54686641 -0.39508229 -0.77947149 -0.71592788
 [55] -0.59056067  0.77740655  0.75292768  0.74650068  0.47640980 -0.81361571
 [61]  1.26435029 -1.19261216 -0.50043606 -1.15272607 -0.71274881  1.00726583
 [67]  0.47820051 -0.14489357  0.83312484  1.28276399 -1.15708203  0.53936211
 [73]  0.44732598 -1.27089225 -0.21235539 -0.74370997  1.09139149  1.71510157
 [79] -0.97875164  0.81454111 -0.59976516  0.54991750 -1.09012911  1.37480482
 [85]  1.33123665  2.54177475 -0.21842782 -0.75865222 -0.48790256 -1.00842060
 [91]  0.58797145  1.49294663  0.18914760  1.11005539  0.01729191 -0.40224775
 [97] -1.93135845 -0.32340650  0.95894377  0.63116537
> colMin(tmp)
  [1]  0.24596207 -2.08523016  1.45293033 -0.11386102 -0.21207311 -0.86502407
  [7] -0.65352610  0.04183482  0.03485097  2.51055419 -0.32659329 -1.10177930
 [13]  0.46024155  0.68960449 -0.88101598  0.08785093  0.11547558  0.54045124
 [19] -0.40343961 -0.42833037 -0.30368868  0.75428842  0.35910175 -1.19361634
 [25]  1.75114460 -1.17677376  1.24723271  1.16045380 -0.44694285 -0.02967069
 [31]  0.22954260 -1.23357193  0.75892216 -0.41260241 -0.26878415  0.06610073
 [37]  0.28917156 -1.04197165 -0.51473340  0.86350735 -1.11173874  0.26527971
 [43]  0.10858089 -1.99886697  1.12215477 -0.71304807 -1.24826054  1.53395555
 [49]  1.10202936  0.36073041  0.54686641 -0.39508229 -0.77947149 -0.71592788
 [55] -0.59056067  0.77740655  0.75292768  0.74650068  0.47640980 -0.81361571
 [61]  1.26435029 -1.19261216 -0.50043606 -1.15272607 -0.71274881  1.00726583
 [67]  0.47820051 -0.14489357  0.83312484  1.28276399 -1.15708203  0.53936211
 [73]  0.44732598 -1.27089225 -0.21235539 -0.74370997  1.09139149  1.71510157
 [79] -0.97875164  0.81454111 -0.59976516  0.54991750 -1.09012911  1.37480482
 [85]  1.33123665  2.54177475 -0.21842782 -0.75865222 -0.48790256 -1.00842060
 [91]  0.58797145  1.49294663  0.18914760  1.11005539  0.01729191 -0.40224775
 [97] -1.93135845 -0.32340650  0.95894377  0.63116537
> colMedians(tmp)
  [1]  0.24596207 -2.08523016  1.45293033 -0.11386102 -0.21207311 -0.86502407
  [7] -0.65352610  0.04183482  0.03485097  2.51055419 -0.32659329 -1.10177930
 [13]  0.46024155  0.68960449 -0.88101598  0.08785093  0.11547558  0.54045124
 [19] -0.40343961 -0.42833037 -0.30368868  0.75428842  0.35910175 -1.19361634
 [25]  1.75114460 -1.17677376  1.24723271  1.16045380 -0.44694285 -0.02967069
 [31]  0.22954260 -1.23357193  0.75892216 -0.41260241 -0.26878415  0.06610073
 [37]  0.28917156 -1.04197165 -0.51473340  0.86350735 -1.11173874  0.26527971
 [43]  0.10858089 -1.99886697  1.12215477 -0.71304807 -1.24826054  1.53395555
 [49]  1.10202936  0.36073041  0.54686641 -0.39508229 -0.77947149 -0.71592788
 [55] -0.59056067  0.77740655  0.75292768  0.74650068  0.47640980 -0.81361571
 [61]  1.26435029 -1.19261216 -0.50043606 -1.15272607 -0.71274881  1.00726583
 [67]  0.47820051 -0.14489357  0.83312484  1.28276399 -1.15708203  0.53936211
 [73]  0.44732598 -1.27089225 -0.21235539 -0.74370997  1.09139149  1.71510157
 [79] -0.97875164  0.81454111 -0.59976516  0.54991750 -1.09012911  1.37480482
 [85]  1.33123665  2.54177475 -0.21842782 -0.75865222 -0.48790256 -1.00842060
 [91]  0.58797145  1.49294663  0.18914760  1.11005539  0.01729191 -0.40224775
 [97] -1.93135845 -0.32340650  0.95894377  0.63116537
> colRanges(tmp)
          [,1]     [,2]    [,3]      [,4]       [,5]       [,6]       [,7]
[1,] 0.2459621 -2.08523 1.45293 -0.113861 -0.2120731 -0.8650241 -0.6535261
[2,] 0.2459621 -2.08523 1.45293 -0.113861 -0.2120731 -0.8650241 -0.6535261
           [,8]       [,9]    [,10]      [,11]     [,12]     [,13]     [,14]
[1,] 0.04183482 0.03485097 2.510554 -0.3265933 -1.101779 0.4602416 0.6896045
[2,] 0.04183482 0.03485097 2.510554 -0.3265933 -1.101779 0.4602416 0.6896045
         [,15]      [,16]     [,17]     [,18]      [,19]      [,20]      [,21]
[1,] -0.881016 0.08785093 0.1154756 0.5404512 -0.4034396 -0.4283304 -0.3036887
[2,] -0.881016 0.08785093 0.1154756 0.5404512 -0.4034396 -0.4283304 -0.3036887
         [,22]     [,23]     [,24]    [,25]     [,26]    [,27]    [,28]
[1,] 0.7542884 0.3591017 -1.193616 1.751145 -1.176774 1.247233 1.160454
[2,] 0.7542884 0.3591017 -1.193616 1.751145 -1.176774 1.247233 1.160454
          [,29]       [,30]     [,31]     [,32]     [,33]      [,34]      [,35]
[1,] -0.4469429 -0.02967069 0.2295426 -1.233572 0.7589222 -0.4126024 -0.2687842
[2,] -0.4469429 -0.02967069 0.2295426 -1.233572 0.7589222 -0.4126024 -0.2687842
          [,36]     [,37]     [,38]      [,39]     [,40]     [,41]     [,42]
[1,] 0.06610073 0.2891716 -1.041972 -0.5147334 0.8635074 -1.111739 0.2652797
[2,] 0.06610073 0.2891716 -1.041972 -0.5147334 0.8635074 -1.111739 0.2652797
         [,43]     [,44]    [,45]      [,46]     [,47]    [,48]    [,49]
[1,] 0.1085809 -1.998867 1.122155 -0.7130481 -1.248261 1.533956 1.102029
[2,] 0.1085809 -1.998867 1.122155 -0.7130481 -1.248261 1.533956 1.102029
         [,50]     [,51]      [,52]      [,53]      [,54]      [,55]     [,56]
[1,] 0.3607304 0.5468664 -0.3950823 -0.7794715 -0.7159279 -0.5905607 0.7774065
[2,] 0.3607304 0.5468664 -0.3950823 -0.7794715 -0.7159279 -0.5905607 0.7774065
         [,57]     [,58]     [,59]      [,60]   [,61]     [,62]      [,63]
[1,] 0.7529277 0.7465007 0.4764098 -0.8136157 1.26435 -1.192612 -0.5004361
[2,] 0.7529277 0.7465007 0.4764098 -0.8136157 1.26435 -1.192612 -0.5004361
         [,64]      [,65]    [,66]     [,67]      [,68]     [,69]    [,70]
[1,] -1.152726 -0.7127488 1.007266 0.4782005 -0.1448936 0.8331248 1.282764
[2,] -1.152726 -0.7127488 1.007266 0.4782005 -0.1448936 0.8331248 1.282764
         [,71]     [,72]    [,73]     [,74]      [,75]    [,76]    [,77]
[1,] -1.157082 0.5393621 0.447326 -1.270892 -0.2123554 -0.74371 1.091391
[2,] -1.157082 0.5393621 0.447326 -1.270892 -0.2123554 -0.74371 1.091391
        [,78]      [,79]     [,80]      [,81]     [,82]     [,83]    [,84]
[1,] 1.715102 -0.9787516 0.8145411 -0.5997652 0.5499175 -1.090129 1.374805
[2,] 1.715102 -0.9787516 0.8145411 -0.5997652 0.5499175 -1.090129 1.374805
        [,85]    [,86]      [,87]      [,88]      [,89]     [,90]     [,91]
[1,] 1.331237 2.541775 -0.2184278 -0.7586522 -0.4879026 -1.008421 0.5879714
[2,] 1.331237 2.541775 -0.2184278 -0.7586522 -0.4879026 -1.008421 0.5879714
        [,92]     [,93]    [,94]      [,95]      [,96]     [,97]      [,98]
[1,] 1.492947 0.1891476 1.110055 0.01729191 -0.4022477 -1.931358 -0.3234065
[2,] 1.492947 0.1891476 1.110055 0.01729191 -0.4022477 -1.931358 -0.3234065
         [,99]    [,100]
[1,] 0.9589438 0.6311654
[2,] 0.9589438 0.6311654
> 
> 
> Max(tmp2)
[1] 3.432346
> Min(tmp2)
[1] -2.853327
> mean(tmp2)
[1] -0.04850799
> Sum(tmp2)
[1] -4.850799
> Var(tmp2)
[1] 1.185478
> 
> rowMeans(tmp2)
  [1]  0.81965239 -0.39011920  1.25429291 -0.42299082  1.55721770 -0.30510150
  [7]  0.42991875 -0.02853051  0.77437058  0.97161752 -0.19742681 -2.11627138
 [13]  1.00610083  0.18746136  0.29994913 -0.37906791 -0.04119876  0.46540359
 [19]  0.24648933  0.20131799 -0.36207896 -2.51629597 -0.64553110  0.92432890
 [25]  1.95003733  0.51259263 -0.27261398 -0.31256378 -1.54535158  0.32592933
 [31] -1.20860470 -0.03830864 -0.41949531 -1.48767390 -2.85332747  2.02272246
 [37] -0.10967390 -0.89205151 -0.39016262  1.39772547  0.64840591  0.63063020
 [43] -1.50928388 -1.20275695  0.30941960  1.32231170 -1.94379356  1.06721252
 [49]  0.45953913  1.71287148  1.10772930  1.02489980 -0.93294410 -0.99143743
 [55]  0.39800490 -0.28790815 -0.71223451 -0.80077452 -1.15977179  0.72409171
 [61]  0.01255172 -0.73538172 -0.62593981  0.11458529 -1.40805149  0.86592675
 [67]  3.43234568 -0.82798928 -0.79415061 -0.36919276 -0.33029857 -0.84142022
 [73]  1.23932631 -1.03824764  1.00946781 -1.21542308  0.08490328 -1.56350358
 [79]  0.32247655 -0.77499117  0.66541682 -0.43655275  0.46201561  1.30778273
 [85]  1.26975838  0.59263513 -1.12437283  0.82255886  0.38004095  1.05731270
 [91] -2.07440962 -0.44308834  1.56062174 -1.38796128 -0.74074299  1.35054514
 [97] -1.48796122 -1.04353200  0.50347397 -0.91823260
> rowSums(tmp2)
  [1]  0.81965239 -0.39011920  1.25429291 -0.42299082  1.55721770 -0.30510150
  [7]  0.42991875 -0.02853051  0.77437058  0.97161752 -0.19742681 -2.11627138
 [13]  1.00610083  0.18746136  0.29994913 -0.37906791 -0.04119876  0.46540359
 [19]  0.24648933  0.20131799 -0.36207896 -2.51629597 -0.64553110  0.92432890
 [25]  1.95003733  0.51259263 -0.27261398 -0.31256378 -1.54535158  0.32592933
 [31] -1.20860470 -0.03830864 -0.41949531 -1.48767390 -2.85332747  2.02272246
 [37] -0.10967390 -0.89205151 -0.39016262  1.39772547  0.64840591  0.63063020
 [43] -1.50928388 -1.20275695  0.30941960  1.32231170 -1.94379356  1.06721252
 [49]  0.45953913  1.71287148  1.10772930  1.02489980 -0.93294410 -0.99143743
 [55]  0.39800490 -0.28790815 -0.71223451 -0.80077452 -1.15977179  0.72409171
 [61]  0.01255172 -0.73538172 -0.62593981  0.11458529 -1.40805149  0.86592675
 [67]  3.43234568 -0.82798928 -0.79415061 -0.36919276 -0.33029857 -0.84142022
 [73]  1.23932631 -1.03824764  1.00946781 -1.21542308  0.08490328 -1.56350358
 [79]  0.32247655 -0.77499117  0.66541682 -0.43655275  0.46201561  1.30778273
 [85]  1.26975838  0.59263513 -1.12437283  0.82255886  0.38004095  1.05731270
 [91] -2.07440962 -0.44308834  1.56062174 -1.38796128 -0.74074299  1.35054514
 [97] -1.48796122 -1.04353200  0.50347397 -0.91823260
> 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.81965239 -0.39011920  1.25429291 -0.42299082  1.55721770 -0.30510150
  [7]  0.42991875 -0.02853051  0.77437058  0.97161752 -0.19742681 -2.11627138
 [13]  1.00610083  0.18746136  0.29994913 -0.37906791 -0.04119876  0.46540359
 [19]  0.24648933  0.20131799 -0.36207896 -2.51629597 -0.64553110  0.92432890
 [25]  1.95003733  0.51259263 -0.27261398 -0.31256378 -1.54535158  0.32592933
 [31] -1.20860470 -0.03830864 -0.41949531 -1.48767390 -2.85332747  2.02272246
 [37] -0.10967390 -0.89205151 -0.39016262  1.39772547  0.64840591  0.63063020
 [43] -1.50928388 -1.20275695  0.30941960  1.32231170 -1.94379356  1.06721252
 [49]  0.45953913  1.71287148  1.10772930  1.02489980 -0.93294410 -0.99143743
 [55]  0.39800490 -0.28790815 -0.71223451 -0.80077452 -1.15977179  0.72409171
 [61]  0.01255172 -0.73538172 -0.62593981  0.11458529 -1.40805149  0.86592675
 [67]  3.43234568 -0.82798928 -0.79415061 -0.36919276 -0.33029857 -0.84142022
 [73]  1.23932631 -1.03824764  1.00946781 -1.21542308  0.08490328 -1.56350358
 [79]  0.32247655 -0.77499117  0.66541682 -0.43655275  0.46201561  1.30778273
 [85]  1.26975838  0.59263513 -1.12437283  0.82255886  0.38004095  1.05731270
 [91] -2.07440962 -0.44308834  1.56062174 -1.38796128 -0.74074299  1.35054514
 [97] -1.48796122 -1.04353200  0.50347397 -0.91823260
> rowMin(tmp2)
  [1]  0.81965239 -0.39011920  1.25429291 -0.42299082  1.55721770 -0.30510150
  [7]  0.42991875 -0.02853051  0.77437058  0.97161752 -0.19742681 -2.11627138
 [13]  1.00610083  0.18746136  0.29994913 -0.37906791 -0.04119876  0.46540359
 [19]  0.24648933  0.20131799 -0.36207896 -2.51629597 -0.64553110  0.92432890
 [25]  1.95003733  0.51259263 -0.27261398 -0.31256378 -1.54535158  0.32592933
 [31] -1.20860470 -0.03830864 -0.41949531 -1.48767390 -2.85332747  2.02272246
 [37] -0.10967390 -0.89205151 -0.39016262  1.39772547  0.64840591  0.63063020
 [43] -1.50928388 -1.20275695  0.30941960  1.32231170 -1.94379356  1.06721252
 [49]  0.45953913  1.71287148  1.10772930  1.02489980 -0.93294410 -0.99143743
 [55]  0.39800490 -0.28790815 -0.71223451 -0.80077452 -1.15977179  0.72409171
 [61]  0.01255172 -0.73538172 -0.62593981  0.11458529 -1.40805149  0.86592675
 [67]  3.43234568 -0.82798928 -0.79415061 -0.36919276 -0.33029857 -0.84142022
 [73]  1.23932631 -1.03824764  1.00946781 -1.21542308  0.08490328 -1.56350358
 [79]  0.32247655 -0.77499117  0.66541682 -0.43655275  0.46201561  1.30778273
 [85]  1.26975838  0.59263513 -1.12437283  0.82255886  0.38004095  1.05731270
 [91] -2.07440962 -0.44308834  1.56062174 -1.38796128 -0.74074299  1.35054514
 [97] -1.48796122 -1.04353200  0.50347397 -0.91823260
> 
> colMeans(tmp2)
[1] -0.04850799
> colSums(tmp2)
[1] -4.850799
> colVars(tmp2)
[1] 1.185478
> colSd(tmp2)
[1] 1.088797
> colMax(tmp2)
[1] 3.432346
> colMin(tmp2)
[1] -2.853327
> colMedians(tmp2)
[1] -0.0397537
> colRanges(tmp2)
          [,1]
[1,] -2.853327
[2,]  3.432346
> 
> dataset1 <- matrix(dataset1,1,100)
> 
> agree.checks(tmp,dataset1)
> 
> dataset2 <- matrix(dataset2,100,1)
> agree.checks(tmp2,dataset2)
>   
> 
> tmp <- createBufferedMatrix(10,10)
> 
> tmp[1:10,1:10] <- rnorm(100)
> colApply(tmp,sum)
 [1]  0.5906877  2.3707478  6.5980623  2.7090485 -7.3945946  0.8108616
 [7]  3.6807450  1.5254612  2.4836066  2.5613216
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -1.7271317
[2,] -0.1961827
[3,]  0.2055897
[4,]  0.8261630
[5,]  1.0711221
> 
> rowApply(tmp,sum)
 [1]  4.44680858 -0.05872287  5.33687784  1.11980853  2.65025467 -0.15388228
 [7] -1.75289053  1.79525624  3.88971881 -1.33728127
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    5    4    6    7    1    7    1   10    7     4
 [2,]    1    6    2    8   10    6    9    4    3     5
 [3,]    4    5   10   10    5   10    3    7    9     3
 [4,]    6    2    4    3    9    4   10    6    5     8
 [5,]    7    1    1    2    4    3    6    3    2     2
 [6,]    2    8    5    5    3    2    4    9    8     9
 [7,]   10    3    7    9    6    8    2    2    4     6
 [8,]    9   10    9    4    2    1    8    8    6     1
 [9,]    8    7    3    6    8    9    7    1    1     7
[10,]    3    9    8    1    7    5    5    5   10    10
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1]  1.45422455  0.09716940  0.71426922 -2.05556227 -0.59845284  2.58036338
 [7]  1.20783882 -1.69507460  0.02816359 -0.99106014  5.35791322 -1.14848500
[13]  0.28618655  0.82935024  4.11292511 -0.37674034 -3.43757476 -0.91537859
[19] -0.60154367  2.00712893
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -0.7049243
[2,] -0.6250029
[3,]  0.3180330
[4,]  0.5414130
[5,]  1.9247057
> 
> rowApply(tmp,sum)
[1]  2.2507276 -3.7843464  5.9548569  0.1577524  2.2766703
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]   12   19    5    7   16
[2,]    5   14   17    3   12
[3,]   19    3   14   16    3
[4,]    4    6   15    4    4
[5,]   15    5    4   11   15
> 
> 
> as.matrix(tmp)
           [,1]        [,2]       [,3]       [,4]       [,5]       [,6]
[1,]  0.3180330 -0.48069899  1.2613078 -0.4811104  0.7384124  0.6645001
[2,]  1.9247057  0.18730880 -1.1405296 -0.9269249 -0.9310441  0.3303949
[3,] -0.7049243  1.44488470  0.8863660  0.9737909 -1.1154417  0.5782701
[4,] -0.6250029 -1.14655388  0.6204391 -0.9678394  0.2136403  1.2081294
[5,]  0.5414130  0.09222878 -0.9133141 -0.6534785  0.4959802 -0.2009312
           [,7]        [,8]       [,9]       [,10]     [,11]       [,12]
[1,]  1.6244278  0.18396335 -1.0887796  0.02725226 1.0781481 -0.42638332
[2,] -0.8277869 -1.73204394 -1.2846396  0.59411944 1.5780400 -0.04999705
[3,]  0.6465693 -0.04912056  2.5982357 -0.37714316 0.8056836 -1.30970678
[4,]  0.9688224  0.28484706 -0.6159496 -1.20986409 0.3293946  0.30919779
[5,] -1.2041938 -0.38272050  0.4192967 -0.02542458 1.5666468  0.32840436
           [,13]       [,14]     [,15]      [,16]      [,17]       [,18]
[1,]  0.09391405  0.76598642 0.3236429 -0.1374485 -1.4575455 -1.87137544
[2,] -0.10246435 -0.56225389 0.3000040  1.9668669 -0.5735664 -0.88691015
[3,]  1.62438413  0.78872443 1.5404635 -0.3719444 -1.8313168  0.56606150
[4,] -1.24704345 -0.20788596 1.1312993 -0.7268325 -0.8640855  0.08187809
[5,] -0.08260382  0.04477924 0.8175154 -1.1073818  1.2889395  1.19496742
           [,19]        [,20]
[1,]  1.16092757 -0.046446426
[2,] -0.53888810 -1.108737250
[3,] -1.72083914  0.981860020
[4,]  0.45007175  2.171089797
[5,]  0.04718425  0.009362785
> 
> 
> 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.21-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.21-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  650  bytes.
Disk usage :  200  bytes.
> subBufferedMatrix(tmp,,5:8)
BufferedMatrix object
Matrix size:  5 4 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.21-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.21-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 -2.251842 -0.6573313 0.2567223 0.2144413 -1.267948 -0.6367207 -1.46392
          col8       col9      col10     col11     col12     col13    col14
row1 0.1559578 -0.8911253 -0.7930245 -1.162121 0.8424431 0.5149301 1.186352
         col15     col16      col17      col18    col19     col20
row1 0.2642006 0.1988697 -0.6257291 -0.5570099 0.385715 0.6215843
> tmp[,"col10"]
          col10
row1 -0.7930245
row2  0.4796489
row3  0.8611191
row4  1.3483648
row5  0.8148555
> tmp[c("row1","row5"),]
           col1       col2       col3      col4       col5       col6      col7
row1 -2.2518420 -0.6573313  0.2567223 0.2144413 -1.2679478 -0.6367207 -1.463920
row5 -0.2238695  0.9031204 -0.1013506 1.6977278 -0.4555184 -1.1307816  1.428555
          col8       col9      col10       col11      col12     col13    col14
row1 0.1559578 -0.8911253 -0.7930245 -1.16212078  0.8424431 0.5149301 1.186352
row5 0.3745330  1.2987168  0.8148555 -0.09366775 -0.3693834 0.7593263 2.322820
         col15      col16      col17      col18    col19      col20
row1 0.2642006  0.1988697 -0.6257291 -0.5570099 0.385715  0.6215843
row5 0.5841836 -0.2455375  1.0330638 -1.1385610 2.160414 -1.3750513
> tmp[,c("col6","col20")]
           col6      col20
row1 -0.6367207  0.6215843
row2  0.1713620  1.5323695
row3  0.4477822 -0.9704051
row4 -0.2932205 -0.1979746
row5 -1.1307816 -1.3750513
> tmp[c("row1","row5"),c("col6","col20")]
           col6      col20
row1 -0.6367207  0.6215843
row5 -1.1307816 -1.3750513
> 
> 
> 
> 
> 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 48.25875 50.66509 50.26659 49.1827 49.27126 103.4621 48.82615 48.09771
        col9   col10    col11    col12    col13   col14    col15    col16
row1 48.9186 49.2594 48.54579 49.59727 50.70613 49.0057 51.34553 50.54514
       col17    col18    col19    col20
row1 49.7178 49.32979 49.10908 106.8153
> tmp[,"col10"]
        col10
row1 49.25940
row2 30.59426
row3 30.62200
row4 30.02258
row5 47.98700
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 48.25875 50.66509 50.26659 49.18270 49.27126 103.4621 48.82615 48.09771
row5 50.13786 51.46429 48.79890 49.89403 49.69445 106.1676 48.03050 51.31170
         col9   col10    col11    col12    col13    col14    col15    col16
row1 48.91860 49.2594 48.54579 49.59727 50.70613 49.00570 51.34553 50.54514
row5 48.88981 47.9870 50.53128 49.83298 51.70444 50.76709 51.78603 50.54667
        col17    col18    col19    col20
row1 49.71780 49.32979 49.10908 106.8153
row5 49.90195 49.95388 50.51231 104.2455
> tmp[,c("col6","col20")]
          col6     col20
row1 103.46211 106.81530
row2  75.28915  73.67302
row3  74.23659  74.70486
row4  76.15495  74.74545
row5 106.16761 104.24553
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 103.4621 106.8153
row5 106.1676 104.2455
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 103.4621 106.8153
row5 106.1676 104.2455
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
          col13
[1,] -0.6741016
[2,]  0.4942409
[3,]  0.1273852
[4,] -0.4630619
[5,] -0.1471217
> tmp[,c("col17","col7")]
          col17       col7
[1,] -2.2162436 -1.2807908
[2,]  1.3476852 -1.1676927
[3,] -0.9481037 -1.8929659
[4,] -0.2989612 -0.5380026
[5,] -1.5738925  0.3244379
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
           col6      col20
[1,] -0.1953463 -0.8205086
[2,] -1.4641827 -1.2899559
[3,] -0.7087590 -0.8253916
[4,] -1.2147998 -0.1342102
[5,] -0.8345790 -0.3796235
> subBufferedMatrix(tmp,1,c("col6"))[,1]
           col1
[1,] -0.1953463
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
           col6
[1,] -0.1953463
[2,] -1.4641827
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> 
> 
> 
> subBufferedMatrix(tmp,c("row3","row1"),)[,1:20]
          [,1]      [,2]       [,3]      [,4]     [,5]      [,6]       [,7]
row3 0.5563266  2.295418 -0.8221779 -1.240355 1.585060 1.1043970 -1.0734828
row1 1.5870792 -0.428909 -0.1368187 -2.224490 1.154109 0.4870158  0.3085477
           [,8]       [,9]      [,10]      [,11]      [,12]     [,13]
row3 -0.7895599  0.8889927  0.1111420  0.2992378 -0.5920061 2.1083076
row1  0.5437418 -1.5338899 -0.2134302 -0.2744830 -1.1147993 0.7139556
          [,14]      [,15]       [,16]    [,17]      [,18]      [,19]
row3 -0.4233795 -0.1822470 -0.15120232 1.202869 1.29103902 -1.2695271
row1  0.6668294 -0.5887869  0.05576616 2.201622 0.08689967  0.3799298
          [,20]
row3  0.9770772
row1 -0.5174947
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
           [,1]       [,2]       [,3]      [,4]      [,5]      [,6]       [,7]
row2 0.04165821 -0.8473875 -0.8479037 -0.744853 0.1127933 0.4993013 -0.6537376
         [,8]      [,9]     [,10]
row2 0.298172 -1.781978 0.2021484
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
         [,1]      [,2]      [,3]      [,4]       [,5]       [,6]      [,7]
row5 -1.06259 0.3751439 -0.450586 0.6276784 -0.5433422 -0.6707996 0.7410078
          [,8]      [,9]    [,10]      [,11]      [,12]      [,13]   [,14]
row5 0.6306319 0.1852218 2.286532 -0.5408046 0.08963901 -0.5137681 1.22054
         [,15]     [,16]     [,17]      [,18]     [,19]     [,20]
row5 0.6261815 -2.178111 -1.783008 -0.1607824 -1.933505 0.6457345
> 
> 
> 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: 0x600000ab8660>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BMd394600d6df1"
 [2] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BMd39411ad1a7b"
 [3] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BMd3947ba58a4d"
 [4] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BMd394311b04a6"
 [5] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BMd39464ce4779"
 [6] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BMd39422b68ca3"
 [7] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BMd3947ecb3322"
 [8] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BMd3944e8a3e36"
 [9] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BMd39455fa7382"
[10] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BMd3942db587e7"
[11] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BMd39468ed6622"
[12] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BMd39439cc77ff"
[13] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BMd3941eda23fe"
[14] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BMd3943710885" 
[15] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BMd39471e65586"
> 
> 
> ### 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: 0x600000ab45a0>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x600000ab45a0>
Warning message:
In dir.create(new.directory) :
  '/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x600000ab45a0>
> rowMedians(tmp)
  [1]  0.148578379  0.497270103 -0.299194387  0.519485354  0.309562534
  [6]  0.471149344  0.111052283 -0.339837240  0.192345829  0.333493751
 [11]  0.096398068  0.344387512  0.462576527 -0.146287898 -0.085228599
 [16] -0.197983106 -0.262711096  0.424821584 -0.328033058  0.124101520
 [21] -0.366410194  0.140763007  0.262608590  0.009636688 -0.033168889
 [26]  0.635108154  0.120948750  0.064833896  0.026823600  0.075348484
 [31]  0.315985939 -0.234947190  0.416899691  0.230035325 -0.244612737
 [36]  0.192771129  0.709874628  0.129051566  0.130987933  0.533416872
 [41]  0.421308851 -0.027879154  0.236016106  0.025473673  0.208083550
 [46] -0.599987622 -0.314115007 -0.159675348  0.341876507 -0.007562601
 [51]  0.003413679 -0.144173887 -0.074763511 -0.092300659  0.252638086
 [56]  0.400785105  0.028064932 -0.567981054 -0.393133089  0.129956688
 [61] -0.022264417 -0.119696525 -0.024780506  0.137895000  0.020097578
 [66]  0.101458507 -0.512659724  0.351182384  0.123649012 -0.364878808
 [71] -0.161112681  0.614439389 -0.246169969  0.351131409  0.422074530
 [76]  0.395806969  0.050569168 -0.392463600 -0.003186576  0.141742927
 [81]  0.115108397 -0.582248608  0.182508926 -0.133914244 -0.047167177
 [86]  0.136394921  0.387044306 -0.483079199 -0.368567244 -0.167408523
 [91] -0.404333091  0.225429044 -0.254312196  0.275661258  0.245383176
 [96] -0.209682404 -0.036735148  0.258283612  0.139468547 -0.174082230
[101]  0.064115362  0.497896104  0.208193658  0.091122198 -0.024262318
[106]  0.165120943 -0.375664512 -0.449146798 -0.221036073 -0.420330482
[111] -0.092882392 -0.102106531  0.222482602 -0.571199174 -0.325357560
[116] -0.069917689 -0.204680090 -0.728870417 -0.464550867 -0.028275838
[121]  0.305630748  0.624746174  0.369250850  0.109204545 -0.494957457
[126] -0.220315509  0.179521200  0.091809502  0.074540563  0.023675801
[131] -0.178836510  0.345106365 -0.296230010 -0.365770809 -0.492828366
[136]  0.384350101 -0.505712978  0.213762264 -0.386514434 -0.129666703
[141]  0.154449236 -0.214592800 -0.139057750  0.321060292 -0.287018082
[146] -0.498102792  0.115649757  0.242441324 -0.214108854  0.006472844
[151]  0.498228699 -0.119710335  0.197245402  0.040658332  0.051055373
[156] -0.358882588  0.167772368  0.343324663 -0.161882505 -0.933411070
[161]  0.409357528  0.394893860  0.070379418 -0.157973337 -0.290193770
[166] -0.012373633  0.317799986  0.180587213 -0.463002082 -0.072824628
[171] -0.016686113 -0.239207793 -0.411141591  0.103383666 -0.282569898
[176]  0.193908949 -0.265551483  0.044259526 -0.097973133  0.433093991
[181]  0.338921768 -0.282666307  0.332580602 -0.477765851 -0.214628382
[186] -0.292383106  0.658554688  0.121224402 -0.239429506  0.357664475
[191] -0.249362864  0.086603291 -0.490499340  0.457903222 -0.366503058
[196]  0.356820068  0.348784271  0.094440530 -0.122526549  0.090430792
[201] -0.177972750  0.203269230 -0.132938845 -0.285898121  0.322262593
[206]  0.133155387 -0.519913518 -0.187490647  0.264475060 -0.243608204
[211] -0.382187165  0.020544404  0.271776323  0.242435913  0.337805557
[216] -0.127993382  0.353234387 -0.042632398  0.285934867  0.680168604
[221] -0.277392745  0.583037130 -0.461375244  0.101758140  0.282741339
[226] -0.468944341  0.741376533  0.082771456 -0.412091932  0.639095770
> 
> proc.time()
   user  system elapsed 
  2.043   8.434  10.852 

BufferedMatrix.Rcheck/tests/rawCalltesting.Rout


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

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

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

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

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

Attaching package: 'BufferedMatrix'

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

    colMeans, colSums, rowMeans, rowSums

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

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

<pointer: 0x600003adc060>
> .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: 0x600003adc060>
> .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: 0x600003adc060>
> .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: 0x600003adc060>
> 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: 0x600003ad4b40>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600003ad4b40>
> .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: 0x600003ad4b40>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600003ad4b40>
> .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: 0x600003ad4b40>
> 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: 0x600003ad8240>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600003ad8240>
> .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: 0x600003ad8240>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x600003ad8240>
> .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: 0x600003ad8240>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x600003ad8240>
> .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: 0x600003ad8240>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x600003ad8240>
> .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: 0x600003ad8240>
> 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: 0x600003ad83c0>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x600003ad83c0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600003ad83c0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600003ad83c0>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFiled3bf1067a5cd" "BufferedMatrixFiled3bf4b63e25" 
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFiled3bf1067a5cd" "BufferedMatrixFiled3bf4b63e25" 
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x600003ad00c0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600003ad00c0>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x600003ad00c0>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x600003ad00c0>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x600003ad00c0>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x600003ad00c0>
> .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: 0x600003ad0240>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600003ad0240>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x600003ad0240>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x600003ad0240>
> 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: 0x600003ad0420>
> .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: 0x600003ad0420>
> rm(P)
> 
> proc.time()
   user  system elapsed 
  0.342   0.113   0.445 

BufferedMatrix.Rcheck/tests/Rcodetesting.Rout


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

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

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

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

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

Attaching package: 'BufferedMatrix'

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

    colMeans, colSums, rowMeans, rowSums

> 
> Temp <- createBufferedMatrix(100)
> dim(Temp)
[1] 100   0
> buffer.dim(Temp)
[1] 1 1
> 
> 
> proc.time()
   user  system elapsed 
  0.345   0.078   0.413 

Example timings