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

This page was generated on 2025-03-10 12:10 -0400 (Mon, 10 Mar 2025).

HostnameOSArch (*)R versionInstalled pkgs
nebbiolo2Linux (Ubuntu 24.04.1 LTS)x86_644.4.3 (2025-02-28) -- "Trophy Case" 4670
palomino8Windows Server 2022 Datacenterx644.4.3 (2025-02-28 ucrt) -- "Trophy Case" 4355
merida1macOS 12.7.5 Montereyx86_644.4.3 (2025-02-28) -- "Trophy Case" 4446
kjohnson1macOS 13.6.6 Venturaarm644.4.3 (2025-02-28) -- "Trophy Case" 4439
taishanLinux (openEuler 24.03 LTS)aarch644.4.3 (2025-02-28) -- "Trophy Case" 4306
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 251/2289HostnameOS / ArchINSTALLBUILDCHECKBUILD BIN
BufferedMatrix 1.70.0  (landing page)
Ben Bolstad
Snapshot Date: 2025-03-06 13:00 -0500 (Thu, 06 Mar 2025)
git_url: https://git.bioconductor.org/packages/BufferedMatrix
git_branch: RELEASE_3_20
git_last_commit: 32b6f6a
git_last_commit_date: 2024-10-29 09:27:20 -0500 (Tue, 29 Oct 2024)
nebbiolo2Linux (Ubuntu 24.04.1 LTS) / x86_64  OK    OK    OK  UNNEEDED, same version is already published
palomino8Windows Server 2022 Datacenter / x64  OK    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
taishanLinux (openEuler 24.03 LTS) / aarch64  OK    OK    OK  


CHECK results for BufferedMatrix on kjohnson1

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

raw results


Summary

Package: BufferedMatrix
Version: 1.70.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.70.0.tar.gz
StartedAt: 2025-03-07 13:52:32 -0500 (Fri, 07 Mar 2025)
EndedAt: 2025-03-07 13:53:11 -0500 (Fri, 07 Mar 2025)
EllapsedTime: 39.2 seconds
RetCode: 0
Status:   WARNINGS  
CheckDir: BufferedMatrix.Rcheck
Warnings: 1

Command output

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


* using log directory ‘/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck’
* using R version 4.4.3 (2025-02-28)
* using platform: aarch64-apple-darwin20
* R was compiled by
    Apple clang version 14.0.0 (clang-1400.0.29.202)
    GNU Fortran (GCC) 12.2.0
* running under: macOS Ventura 13.7.1
* using session charset: UTF-8
* using option ‘--no-vignettes’
* checking for file ‘BufferedMatrix/DESCRIPTION’ ... OK
* this is package ‘BufferedMatrix’ version ‘1.70.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.20-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.20-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.4-arm64/Resources/library’
* installing *source* package ‘BufferedMatrix’ ...
** 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 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/opt/R/arm64/include    -fPIC  -falign-functions=64 -Wall -g -O2  -c RBufferedMatrix.c -o RBufferedMatrix.o
clang -arch arm64 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/opt/R/arm64/include    -fPIC  -falign-functions=64 -Wall -g -O2  -c doubleBufferedMatrix.c -o doubleBufferedMatrix.o
doubleBufferedMatrix.c:1580:7: warning: logical not is only applied to the left hand side of this bitwise operator [-Wlogical-not-parentheses]
  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 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/opt/R/arm64/include    -fPIC  -falign-functions=64 -Wall -g -O2  -c doubleBufferedMatrix_C_tests.c -o doubleBufferedMatrix_C_tests.o
clang -arch arm64 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/opt/R/arm64/include    -fPIC  -falign-functions=64 -Wall -g -O2  -c init_package.c -o init_package.o
clang -arch arm64 -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -L/Library/Frameworks/R.framework/Resources/lib -L/opt/R/arm64/lib -o BufferedMatrix.so RBufferedMatrix.o doubleBufferedMatrix.o doubleBufferedMatrix_C_tests.o init_package.o -F/Library/Frameworks/R.framework/.. -framework R -Wl,-framework -Wl,CoreFoundation
installing to /Library/Frameworks/R.framework/Versions/4.4-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.4.3 (2025-02-28) -- "Trophy Case"
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.313   0.103   0.419 

BufferedMatrix.Rcheck/tests/objectTesting.Rout


R version 4.4.3 (2025-02-28) -- "Trophy Case"
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.20-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 473648 25.3    1033988 55.3         NA   638582 34.2
Vcells 877222  6.7    8388608 64.0      65536  2072452 15.9
> 
> 
> 
> 
> ##
> ## 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 Mar  7 13:52:51 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 Mar  7 13:52:51 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: 0x600003bfc000>
> 
> 
> 
> 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 Mar  7 13:52:54 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 Mar  7 13:52:55 2025"
> 
> ColMode(tmp2)
<pointer: 0x600003bfc000>
> 
> 
> 
> ### 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,] 99.782034 -0.36391669 -0.04963353 -0.009025274
[2,] -2.877506 -0.07099964 -0.44164054  0.199101014
[3,] -1.645639  0.83126202 -0.30834029  0.801676772
[4,] -1.755866 -2.69197157  1.92797491 -0.699882602
> ewApply(tmp5,abs)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.20-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,] 99.782034 0.36391669 0.04963353 0.009025274
[2,]  2.877506 0.07099964 0.44164054 0.199101014
[3,]  1.645639 0.83126202 0.30834029 0.801676772
[4,]  1.755866 2.69197157 1.92797491 0.699882602
> ewApply(tmp5,sqrt)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.20-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,] 9.989096 0.6032551 0.2227858 0.09500144
[2,] 1.696321 0.2664576 0.6645604 0.44620737
[3,] 1.282825 0.9117357 0.5552840 0.89536404
[4,] 1.325091 1.6407229 1.3885154 0.83658987
> 
> 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.20-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,] 224.67299 31.39647 27.27749 25.95904
[2,]  44.84072 27.73558 32.08724 29.66117
[3,]  39.47388 34.94862 30.86118 34.75532
[4,]  40.00677 44.09920 40.81313 34.06578
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x600003bf41e0>
> exp(tmp5)
<pointer: 0x600003bf41e0>
> log(tmp5,2)
<pointer: 0x600003bf41e0>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 467.6274
> Min(tmp5)
[1] 53.19819
> mean(tmp5)
[1] 71.67942
> Sum(tmp5)
[1] 14335.88
> Var(tmp5)
[1] 869.8314
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 87.35271 67.71607 70.15195 74.60007 69.13031 69.40484 69.39551 68.48423
 [9] 71.26231 69.29619
> rowSums(tmp5)
 [1] 1747.054 1354.321 1403.039 1492.001 1382.606 1388.097 1387.910 1369.685
 [9] 1425.246 1385.924
> rowVars(tmp5)
 [1] 8078.65244  112.08766   60.46913   83.38736   40.79821   92.00227
 [7]   89.99048   76.21498   74.56318   80.93781
> rowSd(tmp5)
 [1] 89.881324 10.587146  7.776190  9.131668  6.387347  9.591782  9.486331
 [8]  8.730119  8.634997  8.996544
> rowMax(tmp5)
 [1] 467.62740  93.33008  85.19963  91.78671  79.64721  95.66220  92.80121
 [8]  85.02949  89.61488  84.89046
> rowMin(tmp5)
 [1] 53.19819 55.70176 57.07984 57.64677 56.44417 58.03660 58.12973 54.97060
 [9] 57.59207 57.06774
> 
> colMeans(tmp5)
 [1] 115.12885  68.85717  67.46150  68.01698  72.54227  70.06043  69.39277
 [8]  67.82196  68.83806  68.26936  68.93583  65.73698  68.22167  72.72528
[15]  68.05718  70.92688  69.41635  75.05743  65.11196  73.00947
> colSums(tmp5)
 [1] 1151.2885  688.5717  674.6150  680.1698  725.4227  700.6043  693.9277
 [8]  678.2196  688.3806  682.6936  689.3583  657.3698  682.2167  727.2528
[15]  680.5718  709.2688  694.1635  750.5743  651.1196  730.0947
> colVars(tmp5)
 [1] 15406.55096   108.09082    68.33570    62.16646   131.02915    98.67184
 [7]    78.14837    77.61385    37.74137    37.48605   141.03192    79.94869
[13]    41.85364    50.83546    74.44726   109.03333   135.67087    37.71237
[19]    31.36513    90.53008
> colSd(tmp5)
 [1] 124.123128  10.396674   8.266541   7.884571  11.446797   9.933370
 [7]   8.840157   8.809872   6.143401   6.122585  11.875686   8.941403
[13]   6.469439   7.129899   8.628283  10.441903  11.647784   6.141040
[19]   5.600458   9.514730
> colMax(tmp5)
 [1] 467.62740  91.78671  84.94718  77.07558  92.80121  89.50157  79.99714
 [8]  84.89046  78.33932  79.86715  87.63903  85.56128  85.02949  84.36290
[15]  87.69832  89.61488  95.66220  84.66770  77.33516  85.19963
> colMin(tmp5)
 [1] 67.42057 54.97060 56.77453 54.03034 58.19994 57.89910 58.19102 56.44417
 [9] 61.94360 58.03660 57.06774 53.19819 59.73397 61.97697 56.35296 56.64503
[17] 55.70176 68.41800 57.07984 60.83159
> 
> 
> ### 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] 87.35271 67.71607 70.15195 74.60007 69.13031 69.40484 69.39551       NA
 [9] 71.26231 69.29619
> rowSums(tmp5)
 [1] 1747.054 1354.321 1403.039 1492.001 1382.606 1388.097 1387.910       NA
 [9] 1425.246 1385.924
> rowVars(tmp5)
 [1] 8078.65244  112.08766   60.46913   83.38736   40.79821   92.00227
 [7]   89.99048   72.99000   74.56318   80.93781
> rowSd(tmp5)
 [1] 89.881324 10.587146  7.776190  9.131668  6.387347  9.591782  9.486331
 [8]  8.543419  8.634997  8.996544
> rowMax(tmp5)
 [1] 467.62740  93.33008  85.19963  91.78671  79.64721  95.66220  92.80121
 [8]        NA  89.61488  84.89046
> rowMin(tmp5)
 [1] 53.19819 55.70176 57.07984 57.64677 56.44417 58.03660 58.12973       NA
 [9] 57.59207 57.06774
> 
> colMeans(tmp5)
 [1] 115.12885  68.85717  67.46150  68.01698  72.54227  70.06043  69.39277
 [8]  67.82196  68.83806  68.26936        NA  65.73698  68.22167  72.72528
[15]  68.05718  70.92688  69.41635  75.05743  65.11196  73.00947
> colSums(tmp5)
 [1] 1151.2885  688.5717  674.6150  680.1698  725.4227  700.6043  693.9277
 [8]  678.2196  688.3806  682.6936        NA  657.3698  682.2167  727.2528
[15]  680.5718  709.2688  694.1635  750.5743  651.1196  730.0947
> colVars(tmp5)
 [1] 15406.55096   108.09082    68.33570    62.16646   131.02915    98.67184
 [7]    78.14837    77.61385    37.74137    37.48605          NA    79.94869
[13]    41.85364    50.83546    74.44726   109.03333   135.67087    37.71237
[19]    31.36513    90.53008
> colSd(tmp5)
 [1] 124.123128  10.396674   8.266541   7.884571  11.446797   9.933370
 [7]   8.840157   8.809872   6.143401   6.122585         NA   8.941403
[13]   6.469439   7.129899   8.628283  10.441903  11.647784   6.141040
[19]   5.600458   9.514730
> colMax(tmp5)
 [1] 467.62740  91.78671  84.94718  77.07558  92.80121  89.50157  79.99714
 [8]  84.89046  78.33932  79.86715        NA  85.56128  85.02949  84.36290
[15]  87.69832  89.61488  95.66220  84.66770  77.33516  85.19963
> colMin(tmp5)
 [1] 67.42057 54.97060 56.77453 54.03034 58.19994 57.89910 58.19102 56.44417
 [9] 61.94360 58.03660       NA 53.19819 59.73397 61.97697 56.35296 56.64503
[17] 55.70176 68.41800 57.07984 60.83159
> 
> Max(tmp5,na.rm=TRUE)
[1] 467.6274
> Min(tmp5,na.rm=TRUE)
[1] 53.19819
> mean(tmp5,na.rm=TRUE)
[1] 71.75223
> Sum(tmp5,na.rm=TRUE)
[1] 14278.69
> Var(tmp5,na.rm=TRUE)
[1] 873.1589
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 87.35271 67.71607 70.15195 74.60007 69.13031 69.40484 69.39551 69.07864
 [9] 71.26231 69.29619
> rowSums(tmp5,na.rm=TRUE)
 [1] 1747.054 1354.321 1403.039 1492.001 1382.606 1388.097 1387.910 1312.494
 [9] 1425.246 1385.924
> rowVars(tmp5,na.rm=TRUE)
 [1] 8078.65244  112.08766   60.46913   83.38736   40.79821   92.00227
 [7]   89.99048   72.99000   74.56318   80.93781
> rowSd(tmp5,na.rm=TRUE)
 [1] 89.881324 10.587146  7.776190  9.131668  6.387347  9.591782  9.486331
 [8]  8.543419  8.634997  8.996544
> rowMax(tmp5,na.rm=TRUE)
 [1] 467.62740  93.33008  85.19963  91.78671  79.64721  95.66220  92.80121
 [8]  85.02949  89.61488  84.89046
> rowMin(tmp5,na.rm=TRUE)
 [1] 53.19819 55.70176 57.07984 57.64677 56.44417 58.03660 58.12973 54.97060
 [9] 57.59207 57.06774
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 115.12885  68.85717  67.46150  68.01698  72.54227  70.06043  69.39277
 [8]  67.82196  68.83806  68.26936  70.24088  65.73698  68.22167  72.72528
[15]  68.05718  70.92688  69.41635  75.05743  65.11196  73.00947
> colSums(tmp5,na.rm=TRUE)
 [1] 1151.2885  688.5717  674.6150  680.1698  725.4227  700.6043  693.9277
 [8]  678.2196  688.3806  682.6936  632.1679  657.3698  682.2167  727.2528
[15]  680.5718  709.2688  694.1635  750.5743  651.1196  730.0947
> colVars(tmp5,na.rm=TRUE)
 [1] 15406.55096   108.09082    68.33570    62.16646   131.02915    98.67184
 [7]    78.14837    77.61385    37.74137    37.48605   139.50038    79.94869
[13]    41.85364    50.83546    74.44726   109.03333   135.67087    37.71237
[19]    31.36513    90.53008
> colSd(tmp5,na.rm=TRUE)
 [1] 124.123128  10.396674   8.266541   7.884571  11.446797   9.933370
 [7]   8.840157   8.809872   6.143401   6.122585  11.811028   8.941403
[13]   6.469439   7.129899   8.628283  10.441903  11.647784   6.141040
[19]   5.600458   9.514730
> colMax(tmp5,na.rm=TRUE)
 [1] 467.62740  91.78671  84.94718  77.07558  92.80121  89.50157  79.99714
 [8]  84.89046  78.33932  79.86715  87.63903  85.56128  85.02949  84.36290
[15]  87.69832  89.61488  95.66220  84.66770  77.33516  85.19963
> colMin(tmp5,na.rm=TRUE)
 [1] 67.42057 54.97060 56.77453 54.03034 58.19994 57.89910 58.19102 56.44417
 [9] 61.94360 58.03660 57.06774 53.19819 59.73397 61.97697 56.35296 56.64503
[17] 55.70176 68.41800 57.07984 60.83159
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1] 87.35271 67.71607 70.15195 74.60007 69.13031 69.40484 69.39551      NaN
 [9] 71.26231 69.29619
> rowSums(tmp5,na.rm=TRUE)
 [1] 1747.054 1354.321 1403.039 1492.001 1382.606 1388.097 1387.910    0.000
 [9] 1425.246 1385.924
> rowVars(tmp5,na.rm=TRUE)
 [1] 8078.65244  112.08766   60.46913   83.38736   40.79821   92.00227
 [7]   89.99048         NA   74.56318   80.93781
> rowSd(tmp5,na.rm=TRUE)
 [1] 89.881324 10.587146  7.776190  9.131668  6.387347  9.591782  9.486331
 [8]        NA  8.634997  8.996544
> rowMax(tmp5,na.rm=TRUE)
 [1] 467.62740  93.33008  85.19963  91.78671  79.64721  95.66220  92.80121
 [8]        NA  89.61488  84.89046
> rowMin(tmp5,na.rm=TRUE)
 [1] 53.19819 55.70176 57.07984 57.64677 56.44417 58.03660 58.12973       NA
 [9] 57.59207 57.06774
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1] 119.44973  70.40013  67.99708  67.97515  72.32118  70.15771  69.31846
 [8]  68.35485  68.31445  66.98072       NaN  65.75515  66.35414  73.59316
[15]  67.37358  72.51376  70.77092  75.13703  65.49795  72.18279
> colSums(tmp5,na.rm=TRUE)
 [1] 1075.0475  633.6011  611.9737  611.7764  650.8906  631.4194  623.8661
 [8]  615.1936  614.8301  602.8265    0.0000  591.7963  597.1872  662.3384
[15]  606.3622  652.6238  636.9383  676.2333  589.4815  649.6452
> colVars(tmp5,na.rm=TRUE)
 [1] 17122.332846    94.819285    73.650735    69.917584   146.857911
 [6]   110.899377    87.854794    84.120909    39.374715    23.490053
[11]           NA    89.938567     7.848869    48.716165    78.495978
[16]    94.333124   131.987386    42.355128    33.609667    94.158242
> colSd(tmp5,na.rm=TRUE)
 [1] 130.852332   9.737519   8.582001   8.361674  12.118495  10.530877
 [7]   9.373089   9.171745   6.274927   4.846654         NA   9.483595
[13]   2.801583   6.979697   8.859796   9.712524  11.488576   6.508082
[19]   5.797385   9.703517
> colMax(tmp5,na.rm=TRUE)
 [1] 467.62740  91.78671  84.94718  77.07558  92.80121  89.50157  79.99714
 [8]  84.89046  78.33932  71.97236      -Inf  85.56128  69.64137  84.36290
[15]  87.69832  89.61488  95.66220  84.66770  77.33516  85.19963
> colMin(tmp5,na.rm=TRUE)
 [1] 67.42057 57.72797 56.77453 54.03034 58.19994 57.89910 58.19102 56.44417
 [9] 61.94360 58.03660      Inf 53.19819 59.73397 61.97697 56.35296 58.86851
[17] 55.70176 68.41800 57.07984 60.83159
> 
> 
> 
> 
> 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] 185.4140 335.7151 153.5169 140.0244 317.3796 145.9490 183.5729 186.5787
 [9] 249.7331 217.1147
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 185.4140 335.7151 153.5169 140.0244 317.3796 145.9490 183.5729 186.5787
 [9] 249.7331 217.1147
> 
> 
> 
> 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 -1.278977e-13 -1.421085e-13  0.000000e+00  0.000000e+00
 [6]  0.000000e+00  0.000000e+00  3.410605e-13 -2.842171e-14 -9.947598e-14
[11] -2.842171e-14  8.526513e-14  1.136868e-13  2.842171e-14  5.684342e-14
[16]  1.421085e-13 -5.684342e-14  0.000000e+00  2.842171e-13  5.684342e-14
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> ## making sure these things agree
> ##
> ## first when there is no NA
> 
> 
> 
> agree.checks <- function(buff.matrix,r.matrix,err.tol=1e-10){
+ 
+   if (Max(buff.matrix,na.rm=TRUE) != max(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Max")
+   }
+   
+ 
+   if (Min(buff.matrix,na.rm=TRUE) != min(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Min")
+   }
+ 
+ 
+   if (abs(Sum(buff.matrix,na.rm=TRUE)- sum(r.matrix,na.rm=TRUE)) > err.tol){
+ 
+     cat(Sum(buff.matrix,na.rm=TRUE),"\n")
+     cat(sum(r.matrix,na.rm=TRUE),"\n")
+     cat(Sum(buff.matrix,na.rm=TRUE) - sum(r.matrix,na.rm=TRUE),"\n")
+     
+     stop("No agreement in Sum")
+   }
+   
+   if (abs(mean(buff.matrix,na.rm=TRUE) - mean(r.matrix,na.rm=TRUE)) > err.tol){
+     stop("No agreement in mean")
+   }
+   
+   
+   if(abs(Var(buff.matrix,na.rm=TRUE) - var(as.vector(r.matrix),na.rm=TRUE)) > err.tol){
+     stop("No agreement in Var")
+   }
+   
+   
+ 
+   if(any(abs(rowMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,mean,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowMeans")
+   }
+   
+   
+   if(any(abs(colMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,mean,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colMeans")
+   }
+   
+   
+   if(any(abs(rowSums(buff.matrix,na.rm=TRUE)  -  apply(r.matrix,1,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in rowSums")
+   }
+   
+   
+   if(any(abs(colSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colSums")
+   }
+   
+   ### this is to get around the fact that R doesn't like to compute NA on an entire vector of NA when 
+   ### computing variance
+   my.Var <- function(x,na.rm=FALSE){
+    if (all(is.na(x))){
+      return(NA)
+    } else {
+      var(x,na.rm=na.rm)
+    }
+ 
+   }
+   
+   if(any(abs(rowVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+   
+   
+   if(any(abs(colVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+ 
+ 
+   if(any(abs(rowMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+ 
+   if(any(abs(colMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+   
+   
+   if(any(abs(rowMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+   
+ 
+   if(any(abs(colMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+ 
+   if(any(abs(colMedians(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,median,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMedian")
+   }
+ 
+   if(any(abs(colRanges(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,range,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colRanges")
+   }
+ 
+ 
+   
+ }
> 
> 
> 
> 
> 
> 
> 
> 
> 
> for (rep in 1:20){
+   copymatrix <- matrix(rnorm(200,150,15),10,20)
+   
+   tmp5[1:10,1:20] <- copymatrix
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ## now lets assign some NA values and check agreement
+ 
+   which.row <- sample(1:10,1,replace=TRUE)
+   which.col  <- sample(1:20,1,replace=TRUE)
+   
+   cat(which.row," ",which.col,"\n")
+   
+   tmp5[which.row,which.col] <- NA
+   copymatrix[which.row,which.col] <- NA
+   
+   agree.checks(tmp5,copymatrix)
+ 
+   ## make an entire row NA
+   tmp5[which.row,] <- NA
+   copymatrix[which.row,] <- NA
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ### also make an entire col NA
+   tmp5[,which.col] <- NA
+   copymatrix[,which.col] <- NA
+ 
+   agree.checks(tmp5,copymatrix)
+ 
+   ### now make 1 element non NA with NA in the rest of row and column
+ 
+   tmp5[which.row,which.col] <- rnorm(1,150,15)
+   copymatrix[which.row,which.col] <- tmp5[which.row,which.col]
+ 
+   agree.checks(tmp5,copymatrix)
+ }
9   1 
5   2 
4   12 
2   4 
6   2 
3   11 
7   1 
6   2 
8   16 
9   16 
9   12 
3   18 
5   1 
2   16 
6   2 
6   14 
5   16 
3   11 
4   7 
8   2 
There were 50 or more warnings (use warnings() to see the first 50)
> 
> 
> ### now test 1 by n and n by 1 matrix
> 
> 
> err.tol <- 1e-12
> 
> rm(tmp5)
> 
> dataset1 <- rnorm(100)
> dataset2 <- rnorm(100)
> 
> tmp <- createBufferedMatrix(1,100)
> tmp[1,] <- dataset1
> 
> tmp2 <- createBufferedMatrix(100,1)
> tmp2[,1] <- dataset2
> 
> 
> 
> 
> 
> Max(tmp)
[1] 1.956548
> Min(tmp)
[1] -2.271126
> mean(tmp)
[1] -0.07990599
> Sum(tmp)
[1] -7.990599
> Var(tmp)
[1] 0.7839545
> 
> rowMeans(tmp)
[1] -0.07990599
> rowSums(tmp)
[1] -7.990599
> rowVars(tmp)
[1] 0.7839545
> rowSd(tmp)
[1] 0.885412
> rowMax(tmp)
[1] 1.956548
> rowMin(tmp)
[1] -2.271126
> 
> colMeans(tmp)
  [1]  0.48785355 -0.82982182 -0.56320695 -0.35572716  0.07448376 -0.32407261
  [7] -2.16348160  0.11333586 -1.51253959 -0.49704971  0.06453591 -1.80531877
 [13]  0.48746592  0.06904901 -0.59235711 -0.53872968 -0.34846808 -0.63891719
 [19] -0.50885075  0.30810152 -0.13944326 -0.48039829 -0.60740136  0.58369713
 [25]  1.07238496 -0.61928322  0.76001790  0.43197322  0.41133905 -1.69084137
 [31] -1.21614181 -0.44419306 -0.80475063 -0.42317199 -0.67163764  1.23103369
 [37]  1.22774544  0.43056796 -0.57371805 -0.93398006 -0.28349872  0.55318366
 [43] -0.30899304  1.14808861 -1.63346577  0.71860557  0.42860066  1.10416632
 [49] -0.26494663 -0.59761736  0.37744293  1.26018996  0.12317625 -0.07982237
 [55] -0.08936998 -0.92703484 -2.01558777 -1.38314515  0.66336398 -0.08744307
 [61]  0.59476331 -0.39416880  0.33007633  0.51949929 -0.14465354 -0.32308508
 [67]  1.95654833  0.51622467  0.74987081  0.55496840 -2.27112565  0.83330448
 [73]  1.12188011 -0.15467270  0.22364074 -0.47099267  0.31056868 -0.34558692
 [79]  0.92965380  1.63252509 -0.60698476  0.28300119 -0.71794830 -1.93326140
 [85] -0.31594334  1.31289378  0.91384405 -1.75251424  0.49349981  0.67433778
 [91] -0.38360580  0.83547931 -0.37352371  0.30474202 -1.03389921  1.76844332
 [97] -0.15740750  0.10506465 -1.13458543  0.38255421
> colSums(tmp)
  [1]  0.48785355 -0.82982182 -0.56320695 -0.35572716  0.07448376 -0.32407261
  [7] -2.16348160  0.11333586 -1.51253959 -0.49704971  0.06453591 -1.80531877
 [13]  0.48746592  0.06904901 -0.59235711 -0.53872968 -0.34846808 -0.63891719
 [19] -0.50885075  0.30810152 -0.13944326 -0.48039829 -0.60740136  0.58369713
 [25]  1.07238496 -0.61928322  0.76001790  0.43197322  0.41133905 -1.69084137
 [31] -1.21614181 -0.44419306 -0.80475063 -0.42317199 -0.67163764  1.23103369
 [37]  1.22774544  0.43056796 -0.57371805 -0.93398006 -0.28349872  0.55318366
 [43] -0.30899304  1.14808861 -1.63346577  0.71860557  0.42860066  1.10416632
 [49] -0.26494663 -0.59761736  0.37744293  1.26018996  0.12317625 -0.07982237
 [55] -0.08936998 -0.92703484 -2.01558777 -1.38314515  0.66336398 -0.08744307
 [61]  0.59476331 -0.39416880  0.33007633  0.51949929 -0.14465354 -0.32308508
 [67]  1.95654833  0.51622467  0.74987081  0.55496840 -2.27112565  0.83330448
 [73]  1.12188011 -0.15467270  0.22364074 -0.47099267  0.31056868 -0.34558692
 [79]  0.92965380  1.63252509 -0.60698476  0.28300119 -0.71794830 -1.93326140
 [85] -0.31594334  1.31289378  0.91384405 -1.75251424  0.49349981  0.67433778
 [91] -0.38360580  0.83547931 -0.37352371  0.30474202 -1.03389921  1.76844332
 [97] -0.15740750  0.10506465 -1.13458543  0.38255421
> 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.48785355 -0.82982182 -0.56320695 -0.35572716  0.07448376 -0.32407261
  [7] -2.16348160  0.11333586 -1.51253959 -0.49704971  0.06453591 -1.80531877
 [13]  0.48746592  0.06904901 -0.59235711 -0.53872968 -0.34846808 -0.63891719
 [19] -0.50885075  0.30810152 -0.13944326 -0.48039829 -0.60740136  0.58369713
 [25]  1.07238496 -0.61928322  0.76001790  0.43197322  0.41133905 -1.69084137
 [31] -1.21614181 -0.44419306 -0.80475063 -0.42317199 -0.67163764  1.23103369
 [37]  1.22774544  0.43056796 -0.57371805 -0.93398006 -0.28349872  0.55318366
 [43] -0.30899304  1.14808861 -1.63346577  0.71860557  0.42860066  1.10416632
 [49] -0.26494663 -0.59761736  0.37744293  1.26018996  0.12317625 -0.07982237
 [55] -0.08936998 -0.92703484 -2.01558777 -1.38314515  0.66336398 -0.08744307
 [61]  0.59476331 -0.39416880  0.33007633  0.51949929 -0.14465354 -0.32308508
 [67]  1.95654833  0.51622467  0.74987081  0.55496840 -2.27112565  0.83330448
 [73]  1.12188011 -0.15467270  0.22364074 -0.47099267  0.31056868 -0.34558692
 [79]  0.92965380  1.63252509 -0.60698476  0.28300119 -0.71794830 -1.93326140
 [85] -0.31594334  1.31289378  0.91384405 -1.75251424  0.49349981  0.67433778
 [91] -0.38360580  0.83547931 -0.37352371  0.30474202 -1.03389921  1.76844332
 [97] -0.15740750  0.10506465 -1.13458543  0.38255421
> colMin(tmp)
  [1]  0.48785355 -0.82982182 -0.56320695 -0.35572716  0.07448376 -0.32407261
  [7] -2.16348160  0.11333586 -1.51253959 -0.49704971  0.06453591 -1.80531877
 [13]  0.48746592  0.06904901 -0.59235711 -0.53872968 -0.34846808 -0.63891719
 [19] -0.50885075  0.30810152 -0.13944326 -0.48039829 -0.60740136  0.58369713
 [25]  1.07238496 -0.61928322  0.76001790  0.43197322  0.41133905 -1.69084137
 [31] -1.21614181 -0.44419306 -0.80475063 -0.42317199 -0.67163764  1.23103369
 [37]  1.22774544  0.43056796 -0.57371805 -0.93398006 -0.28349872  0.55318366
 [43] -0.30899304  1.14808861 -1.63346577  0.71860557  0.42860066  1.10416632
 [49] -0.26494663 -0.59761736  0.37744293  1.26018996  0.12317625 -0.07982237
 [55] -0.08936998 -0.92703484 -2.01558777 -1.38314515  0.66336398 -0.08744307
 [61]  0.59476331 -0.39416880  0.33007633  0.51949929 -0.14465354 -0.32308508
 [67]  1.95654833  0.51622467  0.74987081  0.55496840 -2.27112565  0.83330448
 [73]  1.12188011 -0.15467270  0.22364074 -0.47099267  0.31056868 -0.34558692
 [79]  0.92965380  1.63252509 -0.60698476  0.28300119 -0.71794830 -1.93326140
 [85] -0.31594334  1.31289378  0.91384405 -1.75251424  0.49349981  0.67433778
 [91] -0.38360580  0.83547931 -0.37352371  0.30474202 -1.03389921  1.76844332
 [97] -0.15740750  0.10506465 -1.13458543  0.38255421
> colMedians(tmp)
  [1]  0.48785355 -0.82982182 -0.56320695 -0.35572716  0.07448376 -0.32407261
  [7] -2.16348160  0.11333586 -1.51253959 -0.49704971  0.06453591 -1.80531877
 [13]  0.48746592  0.06904901 -0.59235711 -0.53872968 -0.34846808 -0.63891719
 [19] -0.50885075  0.30810152 -0.13944326 -0.48039829 -0.60740136  0.58369713
 [25]  1.07238496 -0.61928322  0.76001790  0.43197322  0.41133905 -1.69084137
 [31] -1.21614181 -0.44419306 -0.80475063 -0.42317199 -0.67163764  1.23103369
 [37]  1.22774544  0.43056796 -0.57371805 -0.93398006 -0.28349872  0.55318366
 [43] -0.30899304  1.14808861 -1.63346577  0.71860557  0.42860066  1.10416632
 [49] -0.26494663 -0.59761736  0.37744293  1.26018996  0.12317625 -0.07982237
 [55] -0.08936998 -0.92703484 -2.01558777 -1.38314515  0.66336398 -0.08744307
 [61]  0.59476331 -0.39416880  0.33007633  0.51949929 -0.14465354 -0.32308508
 [67]  1.95654833  0.51622467  0.74987081  0.55496840 -2.27112565  0.83330448
 [73]  1.12188011 -0.15467270  0.22364074 -0.47099267  0.31056868 -0.34558692
 [79]  0.92965380  1.63252509 -0.60698476  0.28300119 -0.71794830 -1.93326140
 [85] -0.31594334  1.31289378  0.91384405 -1.75251424  0.49349981  0.67433778
 [91] -0.38360580  0.83547931 -0.37352371  0.30474202 -1.03389921  1.76844332
 [97] -0.15740750  0.10506465 -1.13458543  0.38255421
> colRanges(tmp)
          [,1]       [,2]       [,3]       [,4]       [,5]       [,6]      [,7]
[1,] 0.4878536 -0.8298218 -0.5632069 -0.3557272 0.07448376 -0.3240726 -2.163482
[2,] 0.4878536 -0.8298218 -0.5632069 -0.3557272 0.07448376 -0.3240726 -2.163482
          [,8]     [,9]      [,10]      [,11]     [,12]     [,13]      [,14]
[1,] 0.1133359 -1.51254 -0.4970497 0.06453591 -1.805319 0.4874659 0.06904901
[2,] 0.1133359 -1.51254 -0.4970497 0.06453591 -1.805319 0.4874659 0.06904901
          [,15]      [,16]      [,17]      [,18]      [,19]     [,20]
[1,] -0.5923571 -0.5387297 -0.3484681 -0.6389172 -0.5088508 0.3081015
[2,] -0.5923571 -0.5387297 -0.3484681 -0.6389172 -0.5088508 0.3081015
          [,21]      [,22]      [,23]     [,24]    [,25]      [,26]     [,27]
[1,] -0.1394433 -0.4803983 -0.6074014 0.5836971 1.072385 -0.6192832 0.7600179
[2,] -0.1394433 -0.4803983 -0.6074014 0.5836971 1.072385 -0.6192832 0.7600179
         [,28]    [,29]     [,30]     [,31]      [,32]      [,33]     [,34]
[1,] 0.4319732 0.411339 -1.690841 -1.216142 -0.4441931 -0.8047506 -0.423172
[2,] 0.4319732 0.411339 -1.690841 -1.216142 -0.4441931 -0.8047506 -0.423172
          [,35]    [,36]    [,37]    [,38]     [,39]      [,40]      [,41]
[1,] -0.6716376 1.231034 1.227745 0.430568 -0.573718 -0.9339801 -0.2834987
[2,] -0.6716376 1.231034 1.227745 0.430568 -0.573718 -0.9339801 -0.2834987
         [,42]     [,43]    [,44]     [,45]     [,46]     [,47]    [,48]
[1,] 0.5531837 -0.308993 1.148089 -1.633466 0.7186056 0.4286007 1.104166
[2,] 0.5531837 -0.308993 1.148089 -1.633466 0.7186056 0.4286007 1.104166
          [,49]      [,50]     [,51]   [,52]     [,53]       [,54]       [,55]
[1,] -0.2649466 -0.5976174 0.3774429 1.26019 0.1231762 -0.07982237 -0.08936998
[2,] -0.2649466 -0.5976174 0.3774429 1.26019 0.1231762 -0.07982237 -0.08936998
          [,56]     [,57]     [,58]    [,59]       [,60]     [,61]      [,62]
[1,] -0.9270348 -2.015588 -1.383145 0.663364 -0.08744307 0.5947633 -0.3941688
[2,] -0.9270348 -2.015588 -1.383145 0.663364 -0.08744307 0.5947633 -0.3941688
         [,63]     [,64]      [,65]      [,66]    [,67]     [,68]     [,69]
[1,] 0.3300763 0.5194993 -0.1446535 -0.3230851 1.956548 0.5162247 0.7498708
[2,] 0.3300763 0.5194993 -0.1446535 -0.3230851 1.956548 0.5162247 0.7498708
         [,70]     [,71]     [,72]   [,73]      [,74]     [,75]      [,76]
[1,] 0.5549684 -2.271126 0.8333045 1.12188 -0.1546727 0.2236407 -0.4709927
[2,] 0.5549684 -2.271126 0.8333045 1.12188 -0.1546727 0.2236407 -0.4709927
         [,77]      [,78]     [,79]    [,80]      [,81]     [,82]      [,83]
[1,] 0.3105687 -0.3455869 0.9296538 1.632525 -0.6069848 0.2830012 -0.7179483
[2,] 0.3105687 -0.3455869 0.9296538 1.632525 -0.6069848 0.2830012 -0.7179483
         [,84]      [,85]    [,86]     [,87]     [,88]     [,89]     [,90]
[1,] -1.933261 -0.3159433 1.312894 0.9138441 -1.752514 0.4934998 0.6743378
[2,] -1.933261 -0.3159433 1.312894 0.9138441 -1.752514 0.4934998 0.6743378
          [,91]     [,92]      [,93]    [,94]     [,95]    [,96]      [,97]
[1,] -0.3836058 0.8354793 -0.3735237 0.304742 -1.033899 1.768443 -0.1574075
[2,] -0.3836058 0.8354793 -0.3735237 0.304742 -1.033899 1.768443 -0.1574075
         [,98]     [,99]    [,100]
[1,] 0.1050647 -1.134585 0.3825542
[2,] 0.1050647 -1.134585 0.3825542
> 
> 
> Max(tmp2)
[1] 2.221749
> Min(tmp2)
[1] -2.671618
> mean(tmp2)
[1] 0.03843553
> Sum(tmp2)
[1] 3.843553
> Var(tmp2)
[1] 1.119726
> 
> rowMeans(tmp2)
  [1] -0.12395132  0.84043054  0.25688418  1.52989179  1.64407567 -0.88608244
  [7] -1.70247630 -0.39817299 -0.27472667 -0.68578883 -0.75817527  0.92113078
 [13]  1.10912270  0.06344602  0.29102489  0.76555649  0.31775224 -1.18227360
 [19] -0.77912914 -0.55886825 -2.04104476 -2.41290973 -0.54272936  0.53535542
 [25] -0.57890001 -0.90813517 -1.13263266  1.27536001 -0.21294817  0.62210622
 [31] -1.74755777  0.82026227  1.76285362  0.23952044  0.31620240  0.76376573
 [37]  1.08187708  0.84822747 -0.27041641  0.01502170 -1.50591622  1.47571132
 [43]  0.47100088  1.64268668 -0.46076550 -1.99776053 -0.23745723 -0.47641500
 [49] -0.48710754  0.01030445  0.90100062  0.85336575  0.27697497  0.53959075
 [55]  0.23023423 -0.90390230  0.90847382 -0.22890795  1.07447100  1.27845664
 [61] -0.72762005 -0.74823892 -0.34282169  0.55641499  0.24079945 -1.67708012
 [67] -0.98106145  2.17547320 -0.17337666  0.14023048 -0.35971024  0.70565113
 [73]  1.17369796 -0.85902547 -0.80867301 -0.82667394 -1.56534458 -0.08637821
 [79]  0.71693040  0.75365376 -2.67161815  2.22174891  1.78385352 -0.51231724
 [85]  1.10778224  0.84624323 -0.08352751  1.51240133 -0.26786545  1.49515582
 [91]  1.56080915 -0.52639119 -0.18952268 -0.17398087 -1.66238567 -0.19484177
 [97]  0.55948655 -1.10091876  1.86586603 -1.22025877
> rowSums(tmp2)
  [1] -0.12395132  0.84043054  0.25688418  1.52989179  1.64407567 -0.88608244
  [7] -1.70247630 -0.39817299 -0.27472667 -0.68578883 -0.75817527  0.92113078
 [13]  1.10912270  0.06344602  0.29102489  0.76555649  0.31775224 -1.18227360
 [19] -0.77912914 -0.55886825 -2.04104476 -2.41290973 -0.54272936  0.53535542
 [25] -0.57890001 -0.90813517 -1.13263266  1.27536001 -0.21294817  0.62210622
 [31] -1.74755777  0.82026227  1.76285362  0.23952044  0.31620240  0.76376573
 [37]  1.08187708  0.84822747 -0.27041641  0.01502170 -1.50591622  1.47571132
 [43]  0.47100088  1.64268668 -0.46076550 -1.99776053 -0.23745723 -0.47641500
 [49] -0.48710754  0.01030445  0.90100062  0.85336575  0.27697497  0.53959075
 [55]  0.23023423 -0.90390230  0.90847382 -0.22890795  1.07447100  1.27845664
 [61] -0.72762005 -0.74823892 -0.34282169  0.55641499  0.24079945 -1.67708012
 [67] -0.98106145  2.17547320 -0.17337666  0.14023048 -0.35971024  0.70565113
 [73]  1.17369796 -0.85902547 -0.80867301 -0.82667394 -1.56534458 -0.08637821
 [79]  0.71693040  0.75365376 -2.67161815  2.22174891  1.78385352 -0.51231724
 [85]  1.10778224  0.84624323 -0.08352751  1.51240133 -0.26786545  1.49515582
 [91]  1.56080915 -0.52639119 -0.18952268 -0.17398087 -1.66238567 -0.19484177
 [97]  0.55948655 -1.10091876  1.86586603 -1.22025877
> 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.12395132  0.84043054  0.25688418  1.52989179  1.64407567 -0.88608244
  [7] -1.70247630 -0.39817299 -0.27472667 -0.68578883 -0.75817527  0.92113078
 [13]  1.10912270  0.06344602  0.29102489  0.76555649  0.31775224 -1.18227360
 [19] -0.77912914 -0.55886825 -2.04104476 -2.41290973 -0.54272936  0.53535542
 [25] -0.57890001 -0.90813517 -1.13263266  1.27536001 -0.21294817  0.62210622
 [31] -1.74755777  0.82026227  1.76285362  0.23952044  0.31620240  0.76376573
 [37]  1.08187708  0.84822747 -0.27041641  0.01502170 -1.50591622  1.47571132
 [43]  0.47100088  1.64268668 -0.46076550 -1.99776053 -0.23745723 -0.47641500
 [49] -0.48710754  0.01030445  0.90100062  0.85336575  0.27697497  0.53959075
 [55]  0.23023423 -0.90390230  0.90847382 -0.22890795  1.07447100  1.27845664
 [61] -0.72762005 -0.74823892 -0.34282169  0.55641499  0.24079945 -1.67708012
 [67] -0.98106145  2.17547320 -0.17337666  0.14023048 -0.35971024  0.70565113
 [73]  1.17369796 -0.85902547 -0.80867301 -0.82667394 -1.56534458 -0.08637821
 [79]  0.71693040  0.75365376 -2.67161815  2.22174891  1.78385352 -0.51231724
 [85]  1.10778224  0.84624323 -0.08352751  1.51240133 -0.26786545  1.49515582
 [91]  1.56080915 -0.52639119 -0.18952268 -0.17398087 -1.66238567 -0.19484177
 [97]  0.55948655 -1.10091876  1.86586603 -1.22025877
> rowMin(tmp2)
  [1] -0.12395132  0.84043054  0.25688418  1.52989179  1.64407567 -0.88608244
  [7] -1.70247630 -0.39817299 -0.27472667 -0.68578883 -0.75817527  0.92113078
 [13]  1.10912270  0.06344602  0.29102489  0.76555649  0.31775224 -1.18227360
 [19] -0.77912914 -0.55886825 -2.04104476 -2.41290973 -0.54272936  0.53535542
 [25] -0.57890001 -0.90813517 -1.13263266  1.27536001 -0.21294817  0.62210622
 [31] -1.74755777  0.82026227  1.76285362  0.23952044  0.31620240  0.76376573
 [37]  1.08187708  0.84822747 -0.27041641  0.01502170 -1.50591622  1.47571132
 [43]  0.47100088  1.64268668 -0.46076550 -1.99776053 -0.23745723 -0.47641500
 [49] -0.48710754  0.01030445  0.90100062  0.85336575  0.27697497  0.53959075
 [55]  0.23023423 -0.90390230  0.90847382 -0.22890795  1.07447100  1.27845664
 [61] -0.72762005 -0.74823892 -0.34282169  0.55641499  0.24079945 -1.67708012
 [67] -0.98106145  2.17547320 -0.17337666  0.14023048 -0.35971024  0.70565113
 [73]  1.17369796 -0.85902547 -0.80867301 -0.82667394 -1.56534458 -0.08637821
 [79]  0.71693040  0.75365376 -2.67161815  2.22174891  1.78385352 -0.51231724
 [85]  1.10778224  0.84624323 -0.08352751  1.51240133 -0.26786545  1.49515582
 [91]  1.56080915 -0.52639119 -0.18952268 -0.17398087 -1.66238567 -0.19484177
 [97]  0.55948655 -1.10091876  1.86586603 -1.22025877
> 
> colMeans(tmp2)
[1] 0.03843553
> colSums(tmp2)
[1] 3.843553
> colVars(tmp2)
[1] 1.119726
> colSd(tmp2)
[1] 1.058171
> colMax(tmp2)
[1] 2.221749
> colMin(tmp2)
[1] -2.671618
> colMedians(tmp2)
[1] -0.03661153
> colRanges(tmp2)
          [,1]
[1,] -2.671618
[2,]  2.221749
> 
> 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.5128347  3.5958222  2.7226369 -2.3255936  0.2243502  2.2539374
 [7]  2.6534532  4.1542068 -1.1622046  1.2103808
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -0.8966178
[2,] -0.4659024
[3,]  0.1054907
[4,]  0.5695514
[5,]  0.9267977
> 
> rowApply(tmp,sum)
 [1]  3.4314531  4.0007966  3.7555314 -1.7914350 -1.9507029  8.3024543
 [7]  0.2253466  0.9962443 -1.1426384 -1.9872260
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    2    8    8    7    5    1    6    3    9     7
 [2,]    6    7   10    3    6    9    5    1    6     6
 [3,]    5    1    4    9    2    7    9    4    8    10
 [4,]    3    6    2   10    4    2    4    2   10     3
 [5,]    9    4    9    8    3    4    3   10    4     1
 [6,]    8    2    6    5    9    8    2    8    5     4
 [7,]    7    9    5    2    8   10    8    6    1     2
 [8,]    4   10    1    1   10    6    7    9    2     9
 [9,]    1    3    3    6    1    5   10    5    3     8
[10,]   10    5    7    4    7    3    1    7    7     5
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1] -0.09351629  1.23461728 -1.05888244  0.72449569  3.83407676 -0.30899973
 [7]  1.57620963  0.58359291 -2.50549816 -0.11724448 -2.20174118  0.46274248
[13]  2.41500801 -0.55652045 -1.61582705 -0.69004586 -0.37570241  1.13907717
[19]  2.74111171  5.89993497
> colApply(tmp,quantile)[,1]
            [,1]
[1,] -1.79685829
[2,] -0.60153043
[3,]  0.07009966
[4,]  0.22521659
[5,]  2.00955619
> 
> rowApply(tmp,sum)
[1]  4.211030  5.215553  1.827007  3.504967 -3.671668
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]   18   10    3    9    3
[2,]    1   20   20    8    6
[3,]    9   13    5    7    7
[4,]   13   14   14   18    1
[5,]   20   15    4   19   13
> 
> 
> as.matrix(tmp)
            [,1]       [,2]       [,3]       [,4]       [,5]       [,6]
[1,]  2.00955619 -1.7439235 -0.1558301  0.5202799  2.1372613 -0.4929728
[2,]  0.22521659  2.2609215  0.4091456  0.4366831  0.7493240 -0.4468472
[3,] -0.60153043  1.5264056 -0.5042099  0.5345893 -0.5324790 -0.2298543
[4,]  0.07009966 -0.1046434 -0.1771637  1.1404289  1.2868093  2.0727070
[5,] -1.79685829 -0.7041429 -0.6308243 -1.9074854  0.1931611 -1.2120324
           [,7]       [,8]       [,9]      [,10]      [,11]      [,12]
[1,]  0.6472739 -0.4050178 -0.5759784 -0.4081147  0.3182485 -1.2391849
[2,] -0.1029436  0.1611085 -0.2377634  0.3940734  0.8984109  1.0441540
[3,] -0.2242333  0.6731594 -0.7904170 -0.2104164 -0.4826372  1.0121275
[4,]  0.2597060 -0.4779697 -0.7873392 -0.4659374 -1.0934067  0.2369220
[5,]  0.9964066  0.6323126 -0.1140001  0.5731506 -1.8423567 -0.5912762
           [,13]       [,14]      [,15]       [,16]      [,17]      [,18]
[1,] 0.732976550  0.75137746 -1.3053724 -0.66245968  0.2087680  0.4191702
[2,] 0.003980561 -0.54012123 -0.9302262 -0.73425273  0.9257972  0.3943628
[3,] 0.144108964 -1.25219004  1.5128352 -0.02938150 -0.2293414 -0.3306193
[4,] 1.084378194  0.39457959  0.2713063  0.82205198 -0.9566824 -1.3573183
[5,] 0.449563742  0.08983377 -1.1643700 -0.08600392 -0.3242438  2.0134818
          [,19]     [,20]
[1,]  1.4199309 2.0350415
[2,] -1.0034208 1.3079497
[3,]  1.2444365 0.5966543
[4,]  0.1577064 1.1287327
[5,]  0.9224588 0.8315567
> 
> 
> 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.20-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.20-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  649  bytes.
Disk usage :  200  bytes.
> subBufferedMatrix(tmp,,5:8)
BufferedMatrix object
Matrix size:  5 4 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  561  bytes.
Disk usage :  160  bytes.
> subBufferedMatrix(tmp,1:3,)
BufferedMatrix object
Matrix size:  3 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  480  bytes.
> 
> 
> rm(tmp)
> 
> 
> ###
> ### Testing colnames and rownames
> ###
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> 
> 
> colnames(tmp)
NULL
> rownames(tmp)
NULL
> 
> 
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> colnames(tmp)
 [1] "col1"  "col2"  "col3"  "col4"  "col5"  "col6"  "col7"  "col8"  "col9" 
[10] "col10" "col11" "col12" "col13" "col14" "col15" "col16" "col17" "col18"
[19] "col19" "col20"
> rownames(tmp)
[1] "row1" "row2" "row3" "row4" "row5"
> 
> 
> tmp["row1",]
           col1      col2      col3      col4      col5      col6      col7
row1 -0.7294192 0.6166055 -1.152681 0.2883613 0.6658315 -1.836693 0.7140439
            col8    col9    col10     col11     col12      col13     col14
row1 -0.03793606 1.44322 1.759003 -2.182939 -1.502901 -0.9082823 -1.138128
         col15      col16     col17      col18     col19     col20
row1 0.7767034 -0.3651282 0.5830054 -0.8904876 -1.756074 -1.638673
> tmp[,"col10"]
          col10
row1  1.7590029
row2  0.7788634
row3  1.2097812
row4 -0.4221972
row5 -0.5035800
> tmp[c("row1","row5"),]
           col1       col2      col3      col4       col5      col6       col7
row1 -0.7294192  0.6166055 -1.152681 0.2883613  0.6658315 -1.836693  0.7140439
row5 -0.9410609 -1.4337053 -1.586484 0.3336187 -1.4466187 -1.143774 -1.4938485
            col8     col9     col10     col11      col12      col13      col14
row1 -0.03793606  1.44322  1.759003 -2.182939 -1.5029012 -0.9082823 -1.1381277
row5 -0.91561968 -2.56010 -0.503580 -1.946295  0.2721363 -1.0923654  0.1684897
          col15      col16     col17      col18      col19     col20
row1  0.7767034 -0.3651282 0.5830054 -0.8904876 -1.7560737 -1.638673
row5 -0.8447525 -0.5949528 0.5224258  0.4600949 -0.0147322 -0.820792
> tmp[,c("col6","col20")]
            col6      col20
row1 -1.83669252 -1.6386727
row2 -0.47397349 -0.1544299
row3  2.72622942 -1.0982218
row4 -0.08323377 -0.6315541
row5 -1.14377423 -0.8207920
> tmp[c("row1","row5"),c("col6","col20")]
          col6     col20
row1 -1.836693 -1.638673
row5 -1.143774 -0.820792
> 
> 
> 
> 
> tmp["row1",] <- rnorm(20,mean=10)
> tmp[,"col10"] <- rnorm(5,mean=30)
> tmp[c("row1","row5"),] <- rnorm(40,mean=50)
> tmp[,c("col6","col20")] <- rnorm(10,mean=75)
> tmp[c("row1","row5"),c("col6","col20")]  <- rnorm(4,mean=105)
> 
> tmp["row1",]
         col1     col2     col3     col4     col5     col6     col7    col8
row1 50.12128 49.36155 49.47882 50.38528 51.22249 104.1664 48.66654 50.1607
         col9    col10   col11    col12    col13    col14    col15    col16
row1 49.01668 49.36991 50.8706 50.14601 51.41254 49.48885 49.26572 50.49275
        col17   col18   col19    col20
row1 52.05347 50.3223 49.3441 105.0252
> tmp[,"col10"]
        col10
row1 49.36991
row2 29.32874
row3 28.29947
row4 28.52154
row5 50.19698
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 50.12128 49.36155 49.47882 50.38528 51.22249 104.1664 48.66654 50.16070
row5 50.28894 48.89152 49.70103 51.03245 48.67465 105.9007 50.17169 50.84625
         col9    col10    col11    col12    col13    col14    col15    col16
row1 49.01668 49.36991 50.87060 50.14601 51.41254 49.48885 49.26572 50.49275
row5 50.01263 50.19698 50.51735 48.97245 50.17358 51.47130 50.22125 52.07079
        col17    col18   col19    col20
row1 52.05347 50.32230 49.3441 105.0252
row5 49.36249 50.28312 49.1614 105.4389
> tmp[,c("col6","col20")]
          col6     col20
row1 104.16635 105.02516
row2  76.75711  75.80047
row3  75.51316  74.40209
row4  76.04423  75.06488
row5 105.90069 105.43893
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 104.1664 105.0252
row5 105.9007 105.4389
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 104.1664 105.0252
row5 105.9007 105.4389
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
           col13
[1,] -1.49412696
[2,] -0.35125362
[3,] -0.01455901
[4,] -0.09243918
[5,]  0.20527027
> tmp[,c("col17","col7")]
          col17        col7
[1,]  1.2884569  1.34530469
[2,]  0.5039975 -0.54262474
[3,] -0.1613072  1.41124774
[4,] -1.9591710 -0.16497881
[5,]  1.2757244 -0.05604867
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
           col6        col20
[1,] -0.2510523  0.004594132
[2,] -3.1450544  0.184977161
[3,] -0.6711299 -0.879293427
[4,] -1.2749825 -0.609771574
[5,]  0.3558363  0.420302039
> subBufferedMatrix(tmp,1,c("col6"))[,1]
           col1
[1,] -0.2510523
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
           col6
[1,] -0.2510523
[2,] -3.1450544
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> 
> 
> 
> subBufferedMatrix(tmp,c("row3","row1"),)[,1:20]
            [,1]      [,2]        [,3]       [,4]       [,5]      [,6]
row3 -0.09056234 0.3898155 -0.08551486 0.09321119 -0.5456469 1.0552065
row1 -0.04047210 0.1854620  0.09063587 1.24776110 -1.7329010 0.6006432
          [,7]       [,8]       [,9]      [,10]      [,11]      [,12]     [,13]
row3 1.4249800 -0.4188160 -1.0648622 -0.2824326 -0.4124492 -0.3590587  0.869912
row1 0.3731765  0.8774779  0.3911087  1.8078147 -1.5996221 -0.8362057 -2.494154
          [,14]      [,15]      [,16]      [,17]      [,18]      [,19]
row3  0.7156415  0.5718101 -1.2154458 -0.4742087  1.0988608 -0.4482893
row1 -1.4399347 -2.6191064  0.5895833  0.4695054 -0.8315355 -0.9409086
          [,20]
row3 -0.3903529
row1  0.3055222
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
         [,1]      [,2]      [,3]      [,4]       [,5]       [,6]       [,7]
row2 1.613412 0.6927596 0.2417378 0.4675045 -0.1081705 -0.0906996 0.09380927
           [,8]     [,9]     [,10]
row2 0.03490436 1.623496 -2.413178
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
         [,1]      [,2]     [,3]     [,4]      [,5]         [,6]     [,7]
row5 0.250586 0.3165221 1.332064 1.148712 -1.204002 -0.009780013 1.582785
          [,8]       [,9]     [,10]     [,11]     [,12]      [,13]       [,14]
row5 -1.062786 -0.7195343 0.2680933 -2.519529 0.7857299 -0.8726312 -0.08954734
          [,15]      [,16]      [,17]      [,18]      [,19]      [,20]
row5 0.03464203 -0.7790136 -0.8830324 -0.6894269 -0.4602456 0.07206013
> 
> 
> 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: 0x600003bc03c0>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BMc8aa313682c0"
 [2] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BMc8aa71c2247d"
 [3] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BMc8aae9c4e4"  
 [4] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BMc8aa737d5533"
 [5] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BMc8aa2964c281"
 [6] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BMc8aa161db862"
 [7] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BMc8aa79343545"
 [8] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BMc8aa5295832d"
 [9] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BMc8aa55d729b6"
[10] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BMc8aa20f397c1"
[11] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BMc8aa587010cd"
[12] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BMc8aa255f3017"
[13] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BMc8aac4e492c" 
[14] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BMc8aa67a5ee03"
[15] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BMc8aa3ead3c1e"
> 
> 
> ### 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: 0x600003bec1e0>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x600003bec1e0>
Warning message:
In dir.create(new.directory) :
  '/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x600003bec1e0>
> rowMedians(tmp)
  [1] -0.326707176  0.187621297  0.311923148 -0.104520608  0.346276691
  [6]  0.034122850  0.005757904 -0.366903769  0.153900451 -0.107069930
 [11] -0.171793478  0.097343596  0.292718070 -0.022419381 -0.096900238
 [16]  0.139394368 -0.761944726 -0.309131682 -0.171776788  0.097530380
 [21] -0.177717243 -0.399593480  0.153598712  0.401620771 -0.227247827
 [26] -0.201851322  0.173493885  0.373577449 -0.657826663 -0.087216632
 [31]  0.386862915  0.285489441  0.063718536  0.021061823  0.404651228
 [36]  0.774970670 -0.514536417 -0.066400112  0.188012987 -0.023395061
 [41]  0.364940895 -0.768518753 -0.032574441  0.124033767 -0.597659633
 [46] -0.076051614 -0.678461435  0.305184806 -0.245348226  0.432613760
 [51] -0.222908513 -0.235264525  0.257002323 -0.052085862  0.008187316
 [56] -0.143816293  0.048708136  0.167904643  0.397130626 -0.090762956
 [61] -0.634572091 -0.561743222 -0.249212724  0.208201394  0.097410863
 [66]  0.083467841  0.088297787 -0.472431199 -0.188585764  0.130934022
 [71]  0.394997572 -0.170245648 -0.229662791  0.176786582  0.373159976
 [76] -0.041093581  0.238821502  0.659405544 -0.126617210  0.116367797
 [81]  0.143180045 -0.233338516 -0.188430412 -0.464783743  0.487344691
 [86]  0.133745584 -0.309181616  0.184826517 -0.716020790  0.256995735
 [91] -0.724564597  0.049599527  0.126674291  0.312774342 -0.144227680
 [96]  0.069654607  0.343958190 -0.496547762  0.325797783  0.053256698
[101] -0.523548982 -0.160571183 -0.121749227  0.208565333  0.422199667
[106]  0.009224755 -0.099770436 -0.061896964  0.094489088 -0.002681239
[111]  0.019743094  0.065472838 -0.321759668  0.318545691 -0.413022788
[116] -0.062675882  0.031704544 -0.250671631  0.382109320 -0.285069919
[121]  0.029437984  0.179500025  0.492313384  0.111154867  0.064678210
[126]  0.696117937  0.071051036 -0.058557164  0.052829917  0.271693700
[131] -0.240944624  0.112165234  0.271790894 -0.585733160  0.188347159
[136] -0.452104093  0.424140471  0.225438422 -0.103825033 -0.353415414
[141] -0.367883059  0.427266143 -0.347368692  0.027196030 -0.116916684
[146] -0.095456042 -0.110679870 -0.465852695  0.240618805  0.188362363
[151]  0.610258727 -0.405807931 -0.223741201 -0.238869727  0.056056898
[156]  0.208996260  0.350506172 -0.082289911  0.047332266 -0.052854966
[161]  0.078113032 -0.287728958 -0.125858133 -0.377388381 -0.288679670
[166] -0.318904238  0.252425561 -0.107218512  0.158099175 -0.257439597
[171] -0.007360607 -0.095689249 -0.071325570 -0.415814002  0.360106179
[176]  0.168554978 -0.467293976 -0.179587639  0.376886183  0.129608607
[181] -0.189755265  0.296025624 -0.004740348 -0.281663692 -0.138316491
[186] -0.288908642 -0.172772689 -0.002979644 -0.211919686  0.025591971
[191] -0.423819330 -0.081373210  0.668931292  0.016714809  0.166167661
[196]  0.144758121  0.220125730 -0.278670266  0.394039057 -0.254486529
[201] -0.030361059  0.117220185 -0.262930013 -0.363642775  0.326975926
[206] -0.047424061 -0.157278022 -0.173890063 -0.197580473 -0.333730427
[211] -0.080658606  0.481771288  0.025333955  0.002325311  0.033611223
[216] -0.433007698 -0.233271946  0.181063218  0.512272562 -0.358970120
[221]  0.142238662  0.280022791  0.587651090 -0.423676068 -0.040023680
[226]  0.030549368 -0.114457320  0.077191344  0.255298931 -0.565109784
> 
> proc.time()
   user  system elapsed 
  1.988   8.649  10.970 

BufferedMatrix.Rcheck/tests/rawCalltesting.Rout


R version 4.4.3 (2025-02-28) -- "Trophy Case"
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: 0x600003c4c120>
> .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: 0x600003c4c120>
> .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: 0x600003c4c120>
> .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: 0x600003c4c120>
> 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: 0x600003c6c660>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600003c6c660>
> .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: 0x600003c6c660>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600003c6c660>
> .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: 0x600003c6c660>
> 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: 0x600003c6c840>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600003c6c840>
> .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: 0x600003c6c840>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x600003c6c840>
> .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: 0x600003c6c840>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x600003c6c840>
> .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: 0x600003c6c840>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x600003c6c840>
> .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: 0x600003c6c840>
> 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: 0x600003c6ca20>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x600003c6ca20>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600003c6ca20>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600003c6ca20>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFilec8dd146fa185" "BufferedMatrixFilec8dd2cd52d3e"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFilec8dd146fa185" "BufferedMatrixFilec8dd2cd52d3e"
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x600003c6ccc0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600003c6ccc0>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x600003c6ccc0>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x600003c6ccc0>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x600003c6ccc0>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x600003c6ccc0>
> .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: 0x600003c6cea0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600003c6cea0>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x600003c6cea0>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x600003c6cea0>
> 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: 0x600003c6d080>
> .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: 0x600003c6d080>
> rm(P)
> 
> proc.time()
   user  system elapsed 
  0.326   0.116   0.434 

BufferedMatrix.Rcheck/tests/Rcodetesting.Rout


R version 4.4.3 (2025-02-28) -- "Trophy Case"
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.322   0.071   0.379 

Example timings