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

This page was generated on 2025-04-18 11:45 -0400 (Fri, 18 Apr 2025).

HostnameOSArch (*)R versionInstalled pkgs
nebbiolo1Linux (Ubuntu 24.04.1 LTS)x86_644.5.0 RC (2025-04-04 r88126) -- "How About a Twenty-Six" 4831
palomino7Windows Server 2022 Datacenterx644.5.0 RC (2025-04-04 r88126 ucrt) -- "How About a Twenty-Six" 4573
lconwaymacOS 12.7.1 Montereyx86_644.5.0 RC (2025-04-04 r88126) -- "How About a Twenty-Six" 4599
kjohnson3macOS 13.7.1 Venturaarm644.5.0 RC (2025-04-04 r88126) -- "How About a Twenty-Six" 4553
kunpeng2Linux (openEuler 24.03 LTS)aarch64R Under development (unstable) (2025-02-19 r87757) -- "Unsuffered Consequences" 4570
Click on any hostname to see more info about the system (e.g. compilers)      (*) as reported by 'uname -p', except on Windows and Mac OS X

Package 252/2341HostnameOS / ArchINSTALLBUILDCHECKBUILD BIN
BufferedMatrix 1.72.0  (landing page)
Ben Bolstad
Snapshot Date: 2025-04-17 13:40 -0400 (Thu, 17 Apr 2025)
git_url: https://git.bioconductor.org/packages/BufferedMatrix
git_branch: RELEASE_3_21
git_last_commit: aa9e634
git_last_commit_date: 2025-04-15 09:39:39 -0400 (Tue, 15 Apr 2025)
nebbiolo1Linux (Ubuntu 24.04.1 LTS) / x86_64  OK    OK    OK  UNNEEDED, same version is already published
palomino7Windows Server 2022 Datacenter / x64  OK    OK    OK    OK  UNNEEDED, same version is already published
lconwaymacOS 12.7.1 Monterey / x86_64  OK    OK    WARNINGS    OK  UNNEEDED, same version is already published
kjohnson3macOS 13.7.1 Ventura / arm64  OK    OK    WARNINGS    OK  UNNEEDED, same version is already published
kunpeng2Linux (openEuler 24.03 LTS) / aarch64  OK    OK    OK  


CHECK results for BufferedMatrix on kjohnson3

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

raw results


Summary

Package: BufferedMatrix
Version: 1.72.0
Command: /Library/Frameworks/R.framework/Resources/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/Library/Frameworks/R.framework/Resources/library --no-vignettes --timings BufferedMatrix_1.72.0.tar.gz
StartedAt: 2025-04-17 18:28:14 -0400 (Thu, 17 Apr 2025)
EndedAt: 2025-04-17 18:28:31 -0400 (Thu, 17 Apr 2025)
EllapsedTime: 17.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.72.0.tar.gz
###
##############################################################################
##############################################################################


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

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


Installation output

BufferedMatrix.Rcheck/00install.out

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


* installing to library ‘/Library/Frameworks/R.framework/Versions/4.5-arm64/Resources/library’
* installing *source* package ‘BufferedMatrix’ ...
** this is package ‘BufferedMatrix’ version ‘1.72.0’
** using staged installation
** libs
using C compiler: ‘Apple clang version 15.0.0 (clang-1500.1.0.2.5)’
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
installing to /Library/Frameworks/R.framework/Versions/4.5-arm64/Resources/library/00LOCK-BufferedMatrix/00new/BufferedMatrix/libs
** R
** inst
** byte-compile and prepare package for lazy loading
Creating a new generic function for ‘rowMeans’ in package ‘BufferedMatrix’
Creating a new generic function for ‘rowSums’ in package ‘BufferedMatrix’
Creating a new generic function for ‘colMeans’ in package ‘BufferedMatrix’
Creating a new generic function for ‘colSums’ in package ‘BufferedMatrix’
Creating a generic function for ‘ncol’ from package ‘base’ in package ‘BufferedMatrix’
Creating a generic function for ‘nrow’ from package ‘base’ in package ‘BufferedMatrix’
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
** checking absolute paths in shared objects and dynamic libraries
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (BufferedMatrix)

Tests output

BufferedMatrix.Rcheck/tests/c_code_level_tests.Rout


R version 4.5.0 RC (2025-04-04 r88126) -- "How About a Twenty-Six"
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.111   0.037   0.144 

BufferedMatrix.Rcheck/tests/objectTesting.Rout


R version 4.5.0 RC (2025-04-04 r88126) -- "How About a Twenty-Six"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: aarch64-apple-darwin20

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

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

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

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

Attaching package: 'BufferedMatrix'

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

    colMeans, colSums, rowMeans, rowSums

> 
> 
> ### this is used to control how many repetitions in something below
> ### higher values result in more checks.
> nreps <-100 ##20000
> 
> 
> ## test creation and some simple assignments and subsetting operations
> 
> ## first on single elements
> tmp <- createBufferedMatrix(1000,10)
> 
> tmp[10,5]
[1] 0
> tmp[10,5] <- 10
> tmp[10,5]
[1] 10
> tmp[10,5] <- 12.445
> tmp[10,5]
[1] 12.445
> 
> 
> 
> ## now testing accessing multiple elements
> tmp2 <- createBufferedMatrix(10,20)
> 
> 
> tmp2[3,1] <- 51.34
> tmp2[9,2] <- 9.87654
> tmp2[,1:2]
       [,1]    [,2]
 [1,]  0.00 0.00000
 [2,]  0.00 0.00000
 [3,] 51.34 0.00000
 [4,]  0.00 0.00000
 [5,]  0.00 0.00000
 [6,]  0.00 0.00000
 [7,]  0.00 0.00000
 [8,]  0.00 0.00000
 [9,]  0.00 9.87654
[10,]  0.00 0.00000
> tmp2[,-(3:20)]
       [,1]    [,2]
 [1,]  0.00 0.00000
 [2,]  0.00 0.00000
 [3,] 51.34 0.00000
 [4,]  0.00 0.00000
 [5,]  0.00 0.00000
 [6,]  0.00 0.00000
 [7,]  0.00 0.00000
 [8,]  0.00 0.00000
 [9,]  0.00 9.87654
[10,]  0.00 0.00000
> tmp2[3,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
[1,] 51.34    0    0    0    0    0    0    0    0     0     0     0     0
     [,14] [,15] [,16] [,17] [,18] [,19] [,20]
[1,]     0     0     0     0     0     0     0
> tmp2[-3,]
      [,1]    [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [2,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [3,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [4,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [5,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [6,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [7,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [8,]    0 9.87654    0    0    0    0    0    0    0     0     0     0     0
 [9,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
      [,14] [,15] [,16] [,17] [,18] [,19] [,20]
 [1,]     0     0     0     0     0     0     0
 [2,]     0     0     0     0     0     0     0
 [3,]     0     0     0     0     0     0     0
 [4,]     0     0     0     0     0     0     0
 [5,]     0     0     0     0     0     0     0
 [6,]     0     0     0     0     0     0     0
 [7,]     0     0     0     0     0     0     0
 [8,]     0     0     0     0     0     0     0
 [9,]     0     0     0     0     0     0     0
> tmp2[2,1:3]
     [,1] [,2] [,3]
[1,]    0    0    0
> tmp2[3:9,1:3]
      [,1]    [,2] [,3]
[1,] 51.34 0.00000    0
[2,]  0.00 0.00000    0
[3,]  0.00 0.00000    0
[4,]  0.00 0.00000    0
[5,]  0.00 0.00000    0
[6,]  0.00 0.00000    0
[7,]  0.00 9.87654    0
> tmp2[-4,-4]
       [,1]    [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [2,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [3,] 51.34 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [4,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [5,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [6,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [7,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [8,]  0.00 9.87654    0    0    0    0    0    0    0     0     0     0     0
 [9,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
      [,14] [,15] [,16] [,17] [,18] [,19]
 [1,]     0     0     0     0     0     0
 [2,]     0     0     0     0     0     0
 [3,]     0     0     0     0     0     0
 [4,]     0     0     0     0     0     0
 [5,]     0     0     0     0     0     0
 [6,]     0     0     0     0     0     0
 [7,]     0     0     0     0     0     0
 [8,]     0     0     0     0     0     0
 [9,]     0     0     0     0     0     0
> 
> ## now testing accessing/assigning multiple elements
> tmp3 <- createBufferedMatrix(10,10)
> 
> for (i in 1:10){
+   for (j in 1:10){
+     tmp3[i,j] <- (j-1)*10 + i
+   }
+ }
> 
> tmp3[2:4,2:4]
     [,1] [,2] [,3]
[1,]   12   22   32
[2,]   13   23   33
[3,]   14   24   34
> tmp3[c(-10),c(2:4,2:4,10,1,2,1:10,10:1)]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]   11   21   31   11   21   31   91    1   11     1    11    21    31
 [2,]   12   22   32   12   22   32   92    2   12     2    12    22    32
 [3,]   13   23   33   13   23   33   93    3   13     3    13    23    33
 [4,]   14   24   34   14   24   34   94    4   14     4    14    24    34
 [5,]   15   25   35   15   25   35   95    5   15     5    15    25    35
 [6,]   16   26   36   16   26   36   96    6   16     6    16    26    36
 [7,]   17   27   37   17   27   37   97    7   17     7    17    27    37
 [8,]   18   28   38   18   28   38   98    8   18     8    18    28    38
 [9,]   19   29   39   19   29   39   99    9   19     9    19    29    39
      [,14] [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24] [,25]
 [1,]    41    51    61    71    81    91    91    81    71    61    51    41
 [2,]    42    52    62    72    82    92    92    82    72    62    52    42
 [3,]    43    53    63    73    83    93    93    83    73    63    53    43
 [4,]    44    54    64    74    84    94    94    84    74    64    54    44
 [5,]    45    55    65    75    85    95    95    85    75    65    55    45
 [6,]    46    56    66    76    86    96    96    86    76    66    56    46
 [7,]    47    57    67    77    87    97    97    87    77    67    57    47
 [8,]    48    58    68    78    88    98    98    88    78    68    58    48
 [9,]    49    59    69    79    89    99    99    89    79    69    59    49
      [,26] [,27] [,28] [,29]
 [1,]    31    21    11     1
 [2,]    32    22    12     2
 [3,]    33    23    13     3
 [4,]    34    24    14     4
 [5,]    35    25    15     5
 [6,]    36    26    16     6
 [7,]    37    27    17     7
 [8,]    38    28    18     8
 [9,]    39    29    19     9
> tmp3[-c(1:5),-c(6:10)]
     [,1] [,2] [,3] [,4] [,5]
[1,]    6   16   26   36   46
[2,]    7   17   27   37   47
[3,]    8   18   28   38   48
[4,]    9   19   29   39   49
[5,]   10   20   30   40   50
> 
> ## assignment of whole columns
> tmp3[,1] <- c(1:10*100.0)
> tmp3[,1:2] <- tmp3[,1:2]*100
> tmp3[,1:2] <- tmp3[,2:1]
> tmp3[,1:2]
      [,1]  [,2]
 [1,] 1100 1e+04
 [2,] 1200 2e+04
 [3,] 1300 3e+04
 [4,] 1400 4e+04
 [5,] 1500 5e+04
 [6,] 1600 6e+04
 [7,] 1700 7e+04
 [8,] 1800 8e+04
 [9,] 1900 9e+04
[10,] 2000 1e+05
> 
> 
> tmp3[,-1] <- tmp3[,1:9]
> tmp3[,1:10]
      [,1] [,2]  [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,] 1100 1100 1e+04   21   31   41   51   61   71    81
 [2,] 1200 1200 2e+04   22   32   42   52   62   72    82
 [3,] 1300 1300 3e+04   23   33   43   53   63   73    83
 [4,] 1400 1400 4e+04   24   34   44   54   64   74    84
 [5,] 1500 1500 5e+04   25   35   45   55   65   75    85
 [6,] 1600 1600 6e+04   26   36   46   56   66   76    86
 [7,] 1700 1700 7e+04   27   37   47   57   67   77    87
 [8,] 1800 1800 8e+04   28   38   48   58   68   78    88
 [9,] 1900 1900 9e+04   29   39   49   59   69   79    89
[10,] 2000 2000 1e+05   30   40   50   60   70   80    90
> 
> tmp3[,1:2] <- rep(1,10)
> tmp3[,1:2] <- rep(1,20)
> tmp3[,1:2] <- matrix(c(1:5),1,5)
> 
> tmp3[,-c(1:8)] <- matrix(c(1:5),1,5)
> 
> tmp3[1,] <- 1:10
> tmp3[1,]
     [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,]    1    2    3    4    5    6    7    8    9    10
> tmp3[-1,] <- c(1,2)
> tmp3[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    1    2    3    4    5    6    7    8    9    10
 [2,]    1    2    1    2    1    2    1    2    1     2
 [3,]    2    1    2    1    2    1    2    1    2     1
 [4,]    1    2    1    2    1    2    1    2    1     2
 [5,]    2    1    2    1    2    1    2    1    2     1
 [6,]    1    2    1    2    1    2    1    2    1     2
 [7,]    2    1    2    1    2    1    2    1    2     1
 [8,]    1    2    1    2    1    2    1    2    1     2
 [9,]    2    1    2    1    2    1    2    1    2     1
[10,]    1    2    1    2    1    2    1    2    1     2
> tmp3[-c(1:8),] <- matrix(c(1:5),1,5)
> tmp3[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    1    2    3    4    5    6    7    8    9    10
 [2,]    1    2    1    2    1    2    1    2    1     2
 [3,]    2    1    2    1    2    1    2    1    2     1
 [4,]    1    2    1    2    1    2    1    2    1     2
 [5,]    2    1    2    1    2    1    2    1    2     1
 [6,]    1    2    1    2    1    2    1    2    1     2
 [7,]    2    1    2    1    2    1    2    1    2     1
 [8,]    1    2    1    2    1    2    1    2    1     2
 [9,]    1    3    5    2    4    1    3    5    2     4
[10,]    2    4    1    3    5    2    4    1    3     5
> 
> 
> tmp3[1:2,1:2] <- 5555.04
> tmp3[-(1:2),1:2] <- 1234.56789
> 
> 
> 
> ## testing accessors for the directory and prefix
> directory(tmp3)
[1] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests"
> prefix(tmp3)
[1] "BM"
> 
> ## testing if we can remove these objects
> rm(tmp, tmp2, tmp3)
> gc()
         used (Mb) gc trigger (Mb) limit (Mb) max used (Mb)
Ncells 480809 25.7    1056568 56.5         NA   634342 33.9
Vcells 890978  6.8    8388608 64.0     196608  2109696 16.1
> 
> 
> 
> 
> ##
> ## checking reads
> ##
> 
> tmp2 <- createBufferedMatrix(10,20)
> 
> test.sample <- rnorm(10*20)
> 
> tmp2[1:10,1:20] <- test.sample
> 
> test.matrix <- matrix(test.sample,10,20)
> 
> ## testing reads
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   which.col <- sample(1:20,1)
+   if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> date()
[1] "Thu Apr 17 18:28:23 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] "Thu Apr 17 18:28:23 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: 0x600000ff0000>
> 
> 
> 
> 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] "Thu Apr 17 18:28:24 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] "Thu Apr 17 18:28:25 2025"
> 
> ColMode(tmp2)
<pointer: 0x600000ff0000>
> 
> 
> 
> ### Now testing assignments
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+ 
+   new.data <- rnorm(20)
+   tmp2[which.row,] <- new.data
+   test.matrix[which.row,] <- new.data
+   if (rep > 1){
+     if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+   
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   new.data <- rnorm(10)
+   tmp2[,which.col] <- new.data
+   test.matrix[,which.col]<- new.data
+ 
+   if (rep > 1){
+     if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.col <- which.col
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,5,replace=TRUE)
+   new.data <- matrix(rnorm(50),5,10)
+   tmp2[,which.col] <- new.data
+   test.matrix[,which.col]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.col <- which.col
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   new.data <- matrix(rnorm(50),5,10)
+   tmp2[which.row,] <- new.data
+   test.matrix[which.row,]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col  <- sample(1:20,5,replace=TRUE)
+   new.data <- matrix(rnorm(25),5,5)
+   tmp2[which.row,which.col] <- new.data
+   test.matrix[which.row,which.col]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[prev.row,prev.col] == test.matrix[prev.row,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+   prev.col <- which.col
+ }
> 
> 
> 
> 
> ###
> ###
> ### testing some more functions
> ###
> 
> 
> 
> ## duplication function
> tmp5 <- duplicate(tmp2)
> 
> # making sure really did copy everything.
> tmp5[1,1] <- tmp5[1,1] +100.00
> 
> if (tmp5[1,1] == tmp2[1,1]){
+   stop("Problem with duplication")
+ }
> 
> 
> 
> 
> ### testing elementwise applying of functions
> 
> tmp5[1:4,1:4]
            [,1]       [,2]        [,3]       [,4]
[1,] 100.9324085 -0.2383241 -0.07619894  0.5992282
[2,]  -1.0370263  1.1571947  0.61391435  0.2167578
[3,]  -1.0759273 -0.2921145 -0.38895479 -0.1933739
[4,]   0.6468912  0.7452125 -1.17927713  1.2047048
> ewApply(tmp5,abs)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
            [,1]      [,2]       [,3]      [,4]
[1,] 100.9324085 0.2383241 0.07619894 0.5992282
[2,]   1.0370263 1.1571947 0.61391435 0.2167578
[3,]   1.0759273 0.2921145 0.38895479 0.1933739
[4,]   0.6468912 0.7452125 1.17927713 1.2047048
> ewApply(tmp5,sqrt)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
           [,1]      [,2]      [,3]      [,4]
[1,] 10.0465123 0.4881845 0.2760415 0.7740983
[2,]  1.0183449 1.0757298 0.7835269 0.4655726
[3,]  1.0372692 0.5404762 0.6236624 0.4397430
[4,]  0.8042955 0.8632569 1.0859453 1.0975904
> 
> my.function <- function(x,power){
+   (x+5)^power
+ }
> 
> ewApply(tmp5,my.function,power=2)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
          [,1]     [,2]     [,3]     [,4]
[1,] 226.39753 30.12017 27.83661 33.34021
[2,]  36.22048 36.91449 33.44918 29.87248
[3,]  36.44862 30.69688 31.62558 29.59080
[4,]  33.68985 34.37778 37.03873 37.18061
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x600000fe02a0>
> exp(tmp5)
<pointer: 0x600000fe02a0>
> log(tmp5,2)
<pointer: 0x600000fe02a0>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 471.2168
> Min(tmp5)
[1] 55.79278
> mean(tmp5)
[1] 72.97974
> Sum(tmp5)
[1] 14595.95
> Var(tmp5)
[1] 872.187
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 87.77484 70.84495 68.37984 71.99393 73.95595 70.68583 71.61747 71.01745
 [9] 72.06666 71.46048
> rowSums(tmp5)
 [1] 1755.497 1416.899 1367.597 1439.879 1479.119 1413.717 1432.349 1420.349
 [9] 1441.333 1429.210
> rowVars(tmp5)
 [1] 8204.29416   71.92692   74.51918   61.24675   43.32474  114.22471
 [7]   91.48774   32.19736  118.55335   48.87222
> rowSd(tmp5)
 [1] 90.577559  8.480974  8.632449  7.826030  6.582153 10.687596  9.564922
 [8]  5.674272 10.888221  6.990867
> rowMax(tmp5)
 [1] 471.21680  92.75328  86.26996  90.25384  88.10687  94.56147  86.24980
 [8]  78.94276  97.23034  83.30470
> rowMin(tmp5)
 [1] 57.07129 59.95578 57.29040 56.22491 61.30291 56.14030 57.41060 60.38878
 [9] 55.79278 57.10276
> 
> colMeans(tmp5)
 [1] 115.19862  70.12304  67.82817  67.42334  76.73762  66.83815  67.65669
 [8]  72.58761  69.99843  67.63195  65.78571  71.68370  69.56261  70.89036
[15]  71.68284  73.33786  74.67551  79.14145  70.61979  70.19138
> colSums(tmp5)
 [1] 1151.9862  701.2304  678.2817  674.2334  767.3762  668.3815  676.5669
 [8]  725.8761  699.9843  676.3195  657.8571  716.8370  695.6261  708.9036
[15]  716.8284  733.3786  746.7551  791.4145  706.1979  701.9138
> colVars(tmp5)
 [1] 15674.34051    67.88273    49.75251    68.82027    37.02885    35.23819
 [7]   129.99187    46.10878    70.51809    55.51868    80.60740    79.49548
[13]    40.17061    36.38071    62.82638    77.88743   117.63311    80.51249
[19]    82.22473    68.42337
> colSd(tmp5)
 [1] 125.197206   8.239098   7.053546   8.295798   6.085134   5.936177
 [7]  11.401398   6.790344   8.397505   7.451086   8.978163   8.916024
[13]   6.338029   6.031642   7.926310   8.825385  10.845880   8.972875
[19]   9.067785   8.271842
> colMax(tmp5)
 [1] 471.21680  85.19567  77.75382  78.31467  85.12064  78.10716  88.10687
 [8]  86.26996  80.36523  79.06810  78.25372  86.24980  80.82879  79.10587
[15]  84.59538  92.75328  97.23034  94.56147  90.25384  87.67053
> colMin(tmp5)
 [1] 67.55917 55.79278 57.93827 57.10276 69.38589 57.16538 56.22491 60.38878
 [9] 58.77061 57.61150 56.14030 61.32751 62.56834 61.39447 61.30291 60.65815
[17] 57.07129 60.69595 59.81965 57.29040
> 
> 
> ### 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.77484 70.84495       NA 71.99393 73.95595 70.68583 71.61747 71.01745
 [9] 72.06666 71.46048
> rowSums(tmp5)
 [1] 1755.497 1416.899       NA 1439.879 1479.119 1413.717 1432.349 1420.349
 [9] 1441.333 1429.210
> rowVars(tmp5)
 [1] 8204.29416   71.92692   78.41849   61.24675   43.32474  114.22471
 [7]   91.48774   32.19736  118.55335   48.87222
> rowSd(tmp5)
 [1] 90.577559  8.480974  8.855421  7.826030  6.582153 10.687596  9.564922
 [8]  5.674272 10.888221  6.990867
> rowMax(tmp5)
 [1] 471.21680  92.75328        NA  90.25384  88.10687  94.56147  86.24980
 [8]  78.94276  97.23034  83.30470
> rowMin(tmp5)
 [1] 57.07129 59.95578       NA 56.22491 61.30291 56.14030 57.41060 60.38878
 [9] 55.79278 57.10276
> 
> colMeans(tmp5)
 [1] 115.19862  70.12304  67.82817  67.42334  76.73762        NA  67.65669
 [8]  72.58761  69.99843  67.63195  65.78571  71.68370  69.56261  70.89036
[15]  71.68284  73.33786  74.67551  79.14145  70.61979  70.19138
> colSums(tmp5)
 [1] 1151.9862  701.2304  678.2817  674.2334  767.3762        NA  676.5669
 [8]  725.8761  699.9843  676.3195  657.8571  716.8370  695.6261  708.9036
[15]  716.8284  733.3786  746.7551  791.4145  706.1979  701.9138
> colVars(tmp5)
 [1] 15674.34051    67.88273    49.75251    68.82027    37.02885          NA
 [7]   129.99187    46.10878    70.51809    55.51868    80.60740    79.49548
[13]    40.17061    36.38071    62.82638    77.88743   117.63311    80.51249
[19]    82.22473    68.42337
> colSd(tmp5)
 [1] 125.197206   8.239098   7.053546   8.295798   6.085134         NA
 [7]  11.401398   6.790344   8.397505   7.451086   8.978163   8.916024
[13]   6.338029   6.031642   7.926310   8.825385  10.845880   8.972875
[19]   9.067785   8.271842
> colMax(tmp5)
 [1] 471.21680  85.19567  77.75382  78.31467  85.12064        NA  88.10687
 [8]  86.26996  80.36523  79.06810  78.25372  86.24980  80.82879  79.10587
[15]  84.59538  92.75328  97.23034  94.56147  90.25384  87.67053
> colMin(tmp5)
 [1] 67.55917 55.79278 57.93827 57.10276 69.38589       NA 56.22491 60.38878
 [9] 58.77061 57.61150 56.14030 61.32751 62.56834 61.39447 61.30291 60.65815
[17] 57.07129 60.69595 59.81965 57.29040
> 
> Max(tmp5,na.rm=TRUE)
[1] 471.2168
> Min(tmp5,na.rm=TRUE)
[1] 55.79278
> mean(tmp5,na.rm=TRUE)
[1] 73.01305
> Sum(tmp5,na.rm=TRUE)
[1] 14529.6
> Var(tmp5,na.rm=TRUE)
[1] 876.369
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 87.77484 70.84495 68.48661 71.99393 73.95595 70.68583 71.61747 71.01745
 [9] 72.06666 71.46048
> rowSums(tmp5,na.rm=TRUE)
 [1] 1755.497 1416.899 1301.246 1439.879 1479.119 1413.717 1432.349 1420.349
 [9] 1441.333 1429.210
> rowVars(tmp5,na.rm=TRUE)
 [1] 8204.29416   71.92692   78.41849   61.24675   43.32474  114.22471
 [7]   91.48774   32.19736  118.55335   48.87222
> rowSd(tmp5,na.rm=TRUE)
 [1] 90.577559  8.480974  8.855421  7.826030  6.582153 10.687596  9.564922
 [8]  5.674272 10.888221  6.990867
> rowMax(tmp5,na.rm=TRUE)
 [1] 471.21680  92.75328  86.26996  90.25384  88.10687  94.56147  86.24980
 [8]  78.94276  97.23034  83.30470
> rowMin(tmp5,na.rm=TRUE)
 [1] 57.07129 59.95578 57.29040 56.22491 61.30291 56.14030 57.41060 60.38878
 [9] 55.79278 57.10276
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 115.19862  70.12304  67.82817  67.42334  76.73762  66.89225  67.65669
 [8]  72.58761  69.99843  67.63195  65.78571  71.68370  69.56261  70.89036
[15]  71.68284  73.33786  74.67551  79.14145  70.61979  70.19138
> colSums(tmp5,na.rm=TRUE)
 [1] 1151.9862  701.2304  678.2817  674.2334  767.3762  602.0302  676.5669
 [8]  725.8761  699.9843  676.3195  657.8571  716.8370  695.6261  708.9036
[15]  716.8284  733.3786  746.7551  791.4145  706.1979  701.9138
> colVars(tmp5,na.rm=TRUE)
 [1] 15674.34051    67.88273    49.75251    68.82027    37.02885    39.61004
 [7]   129.99187    46.10878    70.51809    55.51868    80.60740    79.49548
[13]    40.17061    36.38071    62.82638    77.88743   117.63311    80.51249
[19]    82.22473    68.42337
> colSd(tmp5,na.rm=TRUE)
 [1] 125.197206   8.239098   7.053546   8.295798   6.085134   6.293651
 [7]  11.401398   6.790344   8.397505   7.451086   8.978163   8.916024
[13]   6.338029   6.031642   7.926310   8.825385  10.845880   8.972875
[19]   9.067785   8.271842
> colMax(tmp5,na.rm=TRUE)
 [1] 471.21680  85.19567  77.75382  78.31467  85.12064  78.10716  88.10687
 [8]  86.26996  80.36523  79.06810  78.25372  86.24980  80.82879  79.10587
[15]  84.59538  92.75328  97.23034  94.56147  90.25384  87.67053
> colMin(tmp5,na.rm=TRUE)
 [1] 67.55917 55.79278 57.93827 57.10276 69.38589 57.16538 56.22491 60.38878
 [9] 58.77061 57.61150 56.14030 61.32751 62.56834 61.39447 61.30291 60.65815
[17] 57.07129 60.69595 59.81965 57.29040
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1] 87.77484 70.84495      NaN 71.99393 73.95595 70.68583 71.61747 71.01745
 [9] 72.06666 71.46048
> rowSums(tmp5,na.rm=TRUE)
 [1] 1755.497 1416.899    0.000 1439.879 1479.119 1413.717 1432.349 1420.349
 [9] 1441.333 1429.210
> rowVars(tmp5,na.rm=TRUE)
 [1] 8204.29416   71.92692         NA   61.24675   43.32474  114.22471
 [7]   91.48774   32.19736  118.55335   48.87222
> rowSd(tmp5,na.rm=TRUE)
 [1] 90.577559  8.480974        NA  7.826030  6.582153 10.687596  9.564922
 [8]  5.674272 10.888221  6.990867
> rowMax(tmp5,na.rm=TRUE)
 [1] 471.21680  92.75328        NA  90.25384  88.10687  94.56147  86.24980
 [8]  78.94276  97.23034  83.30470
> rowMin(tmp5,na.rm=TRUE)
 [1] 57.07129 59.95578       NA 56.22491 61.30291 56.14030 57.41060 60.38878
 [9] 55.79278 57.10276
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1] 119.56924  70.81543  68.05080  68.07156  76.50925       NaN  67.81457
 [8]  71.06735  71.24596  68.74533  64.46713  72.53961  68.79685  71.77508
[15]  72.48197  72.58858  75.77888  81.19095  69.79121  71.62482
> colSums(tmp5,na.rm=TRUE)
 [1] 1076.1232  637.3389  612.4572  612.6440  688.5832    0.0000  610.3311
 [8]  639.6062  641.2137  618.7080  580.2041  652.8565  619.1716  645.9757
[15]  652.3377  653.2973  682.0099  730.7186  628.1209  644.6234
> colVars(tmp5,na.rm=TRUE)
 [1] 17418.73183    70.97477    55.41397    72.69571    41.07070          NA
 [7]   145.96042    25.87144    61.82398    48.51275    71.12336    81.19076
[13]    38.59506    32.12262    63.49531    81.30740   118.64120    43.32150
[19]    84.77920    53.86029
> colSd(tmp5,na.rm=TRUE)
 [1] 131.980043   8.424653   7.444056   8.526178   6.408643         NA
 [7]  12.081408   5.086397   7.862822   6.965109   8.433467   9.010592
[13]   6.212493   5.667682   7.968395   9.017062  10.892254   6.581907
[19]   9.207562   7.338957
> colMax(tmp5,na.rm=TRUE)
 [1] 471.21680  85.19567  77.75382  78.31467  85.12064      -Inf  88.10687
 [8]  76.01320  80.36523  79.06810  78.25372  86.24980  80.82879  79.10587
[15]  84.59538  92.75328  97.23034  94.56147  90.25384  87.67053
> colMin(tmp5,na.rm=TRUE)
 [1] 67.55917 55.79278 57.93827 57.10276 69.38589      Inf 56.22491 60.38878
 [9] 60.38205 57.68938 56.14030 61.32751 62.56834 61.39447 61.30291 60.65815
[17] 57.07129 70.75682 59.81965 63.70028
> 
> 
> 
> 
> 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] 321.6436 386.3088 280.9887 111.3166 239.3678 265.7107 181.4839 334.5804
 [9] 362.8090 269.8329
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 321.6436 386.3088 280.9887 111.3166 239.3678 265.7107 181.4839 334.5804
 [9] 362.8090 269.8329
> 
> 
> 
> 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]  1.421085e-13  5.684342e-14  5.684342e-14  8.526513e-14  1.421085e-14
 [6] -5.684342e-14  5.684342e-14 -5.684342e-14  5.684342e-14  5.684342e-14
[11]  1.136868e-13  5.684342e-14  0.000000e+00  0.000000e+00  5.684342e-14
[16]  1.421085e-13 -1.136868e-13  5.684342e-14  0.000000e+00  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)
+ }
8   16 
7   1 
3   13 
5   17 
7   4 
3   1 
1   6 
3   11 
5   10 
6   2 
2   15 
4   5 
9   2 
1   12 
5   18 
1   9 
4   8 
2   5 
7   14 
9   12 
There were 50 or more warnings (use warnings() to see the first 50)
> 
> 
> ### now test 1 by n and n by 1 matrix
> 
> 
> err.tol <- 1e-12
> 
> rm(tmp5)
> 
> dataset1 <- rnorm(100)
> dataset2 <- rnorm(100)
> 
> tmp <- createBufferedMatrix(1,100)
> tmp[1,] <- dataset1
> 
> tmp2 <- createBufferedMatrix(100,1)
> tmp2[,1] <- dataset2
> 
> 
> 
> 
> 
> Max(tmp)
[1] 2.648444
> Min(tmp)
[1] -2.879592
> mean(tmp)
[1] -0.05653903
> Sum(tmp)
[1] -5.653903
> Var(tmp)
[1] 1.110788
> 
> rowMeans(tmp)
[1] -0.05653903
> rowSums(tmp)
[1] -5.653903
> rowVars(tmp)
[1] 1.110788
> rowSd(tmp)
[1] 1.053939
> rowMax(tmp)
[1] 2.648444
> rowMin(tmp)
[1] -2.879592
> 
> colMeans(tmp)
  [1] -0.04009987 -0.68943675 -0.60102765  0.07493972 -0.40652377 -1.17844581
  [7]  1.30075697 -0.62226098  0.94443856  1.27477598  0.75544169 -1.83268163
 [13]  2.10377451  0.07443519 -0.68389623 -1.33817206 -0.17059095 -0.41739820
 [19] -0.65456012 -1.50628666  1.93884130 -1.40279287  0.19994122 -0.53769576
 [25]  0.73231663 -0.23636589  0.03511458  0.77003409  0.64762862  0.43651457
 [31]  0.50443013  0.28167470  0.34809728  0.48256532 -0.97362633 -0.34792827
 [37] -0.25879600  0.38333477  0.68497336 -0.46038284 -1.51303118  0.13082014
 [43] -0.13978337 -2.87959163 -0.91382282  2.55661598 -1.13873075  0.42981585
 [49] -1.44263902 -0.25025335  0.81120780 -0.90219278  1.70003688  0.18564973
 [55] -0.26185693 -0.44251506  0.30969535  1.12662228 -1.02144914 -0.08680809
 [61]  0.12658441  0.55937521 -0.05712588 -1.26237107  0.99288854  2.16004964
 [67] -2.35953412  0.14644134 -0.86709963  1.26132532 -0.75661180 -1.28254514
 [73] -0.36810587 -0.37694527 -0.45068011  1.05274205  0.84252746 -1.07832259
 [79] -2.38833110 -1.31067565 -2.14296797 -0.72656388 -0.54908732 -0.32255687
 [85]  0.86318271 -0.34362653  0.07461739  1.31649545  2.64844353  0.78972703
 [91] -0.73524238  0.42710429 -0.21145576  1.17982471 -0.16206766 -0.24198265
 [97]  0.79742000 -0.49895777 -0.02544022  1.75279495
> colSums(tmp)
  [1] -0.04009987 -0.68943675 -0.60102765  0.07493972 -0.40652377 -1.17844581
  [7]  1.30075697 -0.62226098  0.94443856  1.27477598  0.75544169 -1.83268163
 [13]  2.10377451  0.07443519 -0.68389623 -1.33817206 -0.17059095 -0.41739820
 [19] -0.65456012 -1.50628666  1.93884130 -1.40279287  0.19994122 -0.53769576
 [25]  0.73231663 -0.23636589  0.03511458  0.77003409  0.64762862  0.43651457
 [31]  0.50443013  0.28167470  0.34809728  0.48256532 -0.97362633 -0.34792827
 [37] -0.25879600  0.38333477  0.68497336 -0.46038284 -1.51303118  0.13082014
 [43] -0.13978337 -2.87959163 -0.91382282  2.55661598 -1.13873075  0.42981585
 [49] -1.44263902 -0.25025335  0.81120780 -0.90219278  1.70003688  0.18564973
 [55] -0.26185693 -0.44251506  0.30969535  1.12662228 -1.02144914 -0.08680809
 [61]  0.12658441  0.55937521 -0.05712588 -1.26237107  0.99288854  2.16004964
 [67] -2.35953412  0.14644134 -0.86709963  1.26132532 -0.75661180 -1.28254514
 [73] -0.36810587 -0.37694527 -0.45068011  1.05274205  0.84252746 -1.07832259
 [79] -2.38833110 -1.31067565 -2.14296797 -0.72656388 -0.54908732 -0.32255687
 [85]  0.86318271 -0.34362653  0.07461739  1.31649545  2.64844353  0.78972703
 [91] -0.73524238  0.42710429 -0.21145576  1.17982471 -0.16206766 -0.24198265
 [97]  0.79742000 -0.49895777 -0.02544022  1.75279495
> 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.04009987 -0.68943675 -0.60102765  0.07493972 -0.40652377 -1.17844581
  [7]  1.30075697 -0.62226098  0.94443856  1.27477598  0.75544169 -1.83268163
 [13]  2.10377451  0.07443519 -0.68389623 -1.33817206 -0.17059095 -0.41739820
 [19] -0.65456012 -1.50628666  1.93884130 -1.40279287  0.19994122 -0.53769576
 [25]  0.73231663 -0.23636589  0.03511458  0.77003409  0.64762862  0.43651457
 [31]  0.50443013  0.28167470  0.34809728  0.48256532 -0.97362633 -0.34792827
 [37] -0.25879600  0.38333477  0.68497336 -0.46038284 -1.51303118  0.13082014
 [43] -0.13978337 -2.87959163 -0.91382282  2.55661598 -1.13873075  0.42981585
 [49] -1.44263902 -0.25025335  0.81120780 -0.90219278  1.70003688  0.18564973
 [55] -0.26185693 -0.44251506  0.30969535  1.12662228 -1.02144914 -0.08680809
 [61]  0.12658441  0.55937521 -0.05712588 -1.26237107  0.99288854  2.16004964
 [67] -2.35953412  0.14644134 -0.86709963  1.26132532 -0.75661180 -1.28254514
 [73] -0.36810587 -0.37694527 -0.45068011  1.05274205  0.84252746 -1.07832259
 [79] -2.38833110 -1.31067565 -2.14296797 -0.72656388 -0.54908732 -0.32255687
 [85]  0.86318271 -0.34362653  0.07461739  1.31649545  2.64844353  0.78972703
 [91] -0.73524238  0.42710429 -0.21145576  1.17982471 -0.16206766 -0.24198265
 [97]  0.79742000 -0.49895777 -0.02544022  1.75279495
> colMin(tmp)
  [1] -0.04009987 -0.68943675 -0.60102765  0.07493972 -0.40652377 -1.17844581
  [7]  1.30075697 -0.62226098  0.94443856  1.27477598  0.75544169 -1.83268163
 [13]  2.10377451  0.07443519 -0.68389623 -1.33817206 -0.17059095 -0.41739820
 [19] -0.65456012 -1.50628666  1.93884130 -1.40279287  0.19994122 -0.53769576
 [25]  0.73231663 -0.23636589  0.03511458  0.77003409  0.64762862  0.43651457
 [31]  0.50443013  0.28167470  0.34809728  0.48256532 -0.97362633 -0.34792827
 [37] -0.25879600  0.38333477  0.68497336 -0.46038284 -1.51303118  0.13082014
 [43] -0.13978337 -2.87959163 -0.91382282  2.55661598 -1.13873075  0.42981585
 [49] -1.44263902 -0.25025335  0.81120780 -0.90219278  1.70003688  0.18564973
 [55] -0.26185693 -0.44251506  0.30969535  1.12662228 -1.02144914 -0.08680809
 [61]  0.12658441  0.55937521 -0.05712588 -1.26237107  0.99288854  2.16004964
 [67] -2.35953412  0.14644134 -0.86709963  1.26132532 -0.75661180 -1.28254514
 [73] -0.36810587 -0.37694527 -0.45068011  1.05274205  0.84252746 -1.07832259
 [79] -2.38833110 -1.31067565 -2.14296797 -0.72656388 -0.54908732 -0.32255687
 [85]  0.86318271 -0.34362653  0.07461739  1.31649545  2.64844353  0.78972703
 [91] -0.73524238  0.42710429 -0.21145576  1.17982471 -0.16206766 -0.24198265
 [97]  0.79742000 -0.49895777 -0.02544022  1.75279495
> colMedians(tmp)
  [1] -0.04009987 -0.68943675 -0.60102765  0.07493972 -0.40652377 -1.17844581
  [7]  1.30075697 -0.62226098  0.94443856  1.27477598  0.75544169 -1.83268163
 [13]  2.10377451  0.07443519 -0.68389623 -1.33817206 -0.17059095 -0.41739820
 [19] -0.65456012 -1.50628666  1.93884130 -1.40279287  0.19994122 -0.53769576
 [25]  0.73231663 -0.23636589  0.03511458  0.77003409  0.64762862  0.43651457
 [31]  0.50443013  0.28167470  0.34809728  0.48256532 -0.97362633 -0.34792827
 [37] -0.25879600  0.38333477  0.68497336 -0.46038284 -1.51303118  0.13082014
 [43] -0.13978337 -2.87959163 -0.91382282  2.55661598 -1.13873075  0.42981585
 [49] -1.44263902 -0.25025335  0.81120780 -0.90219278  1.70003688  0.18564973
 [55] -0.26185693 -0.44251506  0.30969535  1.12662228 -1.02144914 -0.08680809
 [61]  0.12658441  0.55937521 -0.05712588 -1.26237107  0.99288854  2.16004964
 [67] -2.35953412  0.14644134 -0.86709963  1.26132532 -0.75661180 -1.28254514
 [73] -0.36810587 -0.37694527 -0.45068011  1.05274205  0.84252746 -1.07832259
 [79] -2.38833110 -1.31067565 -2.14296797 -0.72656388 -0.54908732 -0.32255687
 [85]  0.86318271 -0.34362653  0.07461739  1.31649545  2.64844353  0.78972703
 [91] -0.73524238  0.42710429 -0.21145576  1.17982471 -0.16206766 -0.24198265
 [97]  0.79742000 -0.49895777 -0.02544022  1.75279495
> colRanges(tmp)
            [,1]       [,2]       [,3]       [,4]       [,5]      [,6]     [,7]
[1,] -0.04009987 -0.6894367 -0.6010277 0.07493972 -0.4065238 -1.178446 1.300757
[2,] -0.04009987 -0.6894367 -0.6010277 0.07493972 -0.4065238 -1.178446 1.300757
          [,8]      [,9]    [,10]     [,11]     [,12]    [,13]      [,14]
[1,] -0.622261 0.9444386 1.274776 0.7554417 -1.832682 2.103775 0.07443519
[2,] -0.622261 0.9444386 1.274776 0.7554417 -1.832682 2.103775 0.07443519
          [,15]     [,16]      [,17]      [,18]      [,19]     [,20]    [,21]
[1,] -0.6838962 -1.338172 -0.1705909 -0.4173982 -0.6545601 -1.506287 1.938841
[2,] -0.6838962 -1.338172 -0.1705909 -0.4173982 -0.6545601 -1.506287 1.938841
         [,22]     [,23]      [,24]     [,25]      [,26]      [,27]     [,28]
[1,] -1.402793 0.1999412 -0.5376958 0.7323166 -0.2363659 0.03511458 0.7700341
[2,] -1.402793 0.1999412 -0.5376958 0.7323166 -0.2363659 0.03511458 0.7700341
         [,29]     [,30]     [,31]     [,32]     [,33]     [,34]      [,35]
[1,] 0.6476286 0.4365146 0.5044301 0.2816747 0.3480973 0.4825653 -0.9736263
[2,] 0.6476286 0.4365146 0.5044301 0.2816747 0.3480973 0.4825653 -0.9736263
          [,36]     [,37]     [,38]     [,39]      [,40]     [,41]     [,42]
[1,] -0.3479283 -0.258796 0.3833348 0.6849734 -0.4603828 -1.513031 0.1308201
[2,] -0.3479283 -0.258796 0.3833348 0.6849734 -0.4603828 -1.513031 0.1308201
          [,43]     [,44]      [,45]    [,46]     [,47]     [,48]     [,49]
[1,] -0.1397834 -2.879592 -0.9138228 2.556616 -1.138731 0.4298158 -1.442639
[2,] -0.1397834 -2.879592 -0.9138228 2.556616 -1.138731 0.4298158 -1.442639
          [,50]     [,51]      [,52]    [,53]     [,54]      [,55]      [,56]
[1,] -0.2502534 0.8112078 -0.9021928 1.700037 0.1856497 -0.2618569 -0.4425151
[2,] -0.2502534 0.8112078 -0.9021928 1.700037 0.1856497 -0.2618569 -0.4425151
         [,57]    [,58]     [,59]       [,60]     [,61]     [,62]       [,63]
[1,] 0.3096954 1.126622 -1.021449 -0.08680809 0.1265844 0.5593752 -0.05712588
[2,] 0.3096954 1.126622 -1.021449 -0.08680809 0.1265844 0.5593752 -0.05712588
         [,64]     [,65]   [,66]     [,67]     [,68]      [,69]    [,70]
[1,] -1.262371 0.9928885 2.16005 -2.359534 0.1464413 -0.8670996 1.261325
[2,] -1.262371 0.9928885 2.16005 -2.359534 0.1464413 -0.8670996 1.261325
          [,71]     [,72]      [,73]      [,74]      [,75]    [,76]     [,77]
[1,] -0.7566118 -1.282545 -0.3681059 -0.3769453 -0.4506801 1.052742 0.8425275
[2,] -0.7566118 -1.282545 -0.3681059 -0.3769453 -0.4506801 1.052742 0.8425275
         [,78]     [,79]     [,80]     [,81]      [,82]      [,83]      [,84]
[1,] -1.078323 -2.388331 -1.310676 -2.142968 -0.7265639 -0.5490873 -0.3225569
[2,] -1.078323 -2.388331 -1.310676 -2.142968 -0.7265639 -0.5490873 -0.3225569
         [,85]      [,86]      [,87]    [,88]    [,89]    [,90]      [,91]
[1,] 0.8631827 -0.3436265 0.07461739 1.316495 2.648444 0.789727 -0.7352424
[2,] 0.8631827 -0.3436265 0.07461739 1.316495 2.648444 0.789727 -0.7352424
         [,92]      [,93]    [,94]      [,95]      [,96]   [,97]      [,98]
[1,] 0.4271043 -0.2114558 1.179825 -0.1620677 -0.2419826 0.79742 -0.4989578
[2,] 0.4271043 -0.2114558 1.179825 -0.1620677 -0.2419826 0.79742 -0.4989578
           [,99]   [,100]
[1,] -0.02544022 1.752795
[2,] -0.02544022 1.752795
> 
> 
> Max(tmp2)
[1] 2.206857
> Min(tmp2)
[1] -2.615147
> mean(tmp2)
[1] 0.02101129
> Sum(tmp2)
[1] 2.101129
> Var(tmp2)
[1] 1.039479
> 
> rowMeans(tmp2)
  [1] -0.01022310  1.26610360 -1.47945981 -1.31315802 -0.44355220  0.42662110
  [7] -0.30048898  0.03494274  1.19502267  1.75357250 -0.50578168  0.75617150
 [13] -0.31528155 -1.21199672  1.11432860  0.88666127  0.64267710 -1.83987251
 [19]  0.82399031  0.49078942  0.57442031  0.18128184 -0.41879204  0.38879048
 [25] -1.77594524 -1.58922284  0.03986224 -0.63071160  0.34482561 -0.30415779
 [31] -0.70574609  0.95682399 -0.36761650  1.49026425  0.54562399 -1.74631296
 [37]  0.83634231  0.68951096  0.43386257 -0.42976091  0.28054092  1.13732050
 [43] -0.90948394  1.56798606  0.30067433  0.10755312  0.76004583  1.40934015
 [49]  0.28871591  0.45031675 -1.32004816 -0.05047722  0.84185185 -0.69396881
 [55]  2.20685657  0.70099191 -0.76873918 -0.34911039  1.20995192 -1.56228925
 [61] -0.33141540 -0.05642018 -0.48960698  1.13946114  0.36509672  1.46521312
 [67] -0.48851479  0.20336354 -2.42138781 -1.41946713 -0.13281374  0.19966118
 [73] -0.05450908  1.06234698 -0.58793904  0.24826220 -0.52699637 -2.32717665
 [79]  1.71569579 -1.97518725  0.86822302 -1.01212263  0.60384020 -2.61514703
 [85]  0.83402961 -0.04172977  0.14521953 -0.53676022  0.77573480 -0.14424903
 [91] -0.06127010 -2.38399713  0.26946759  1.41954165  0.67356521  0.55386424
 [97] -0.38770681  0.47422832 -0.18507908  1.17137230
> rowSums(tmp2)
  [1] -0.01022310  1.26610360 -1.47945981 -1.31315802 -0.44355220  0.42662110
  [7] -0.30048898  0.03494274  1.19502267  1.75357250 -0.50578168  0.75617150
 [13] -0.31528155 -1.21199672  1.11432860  0.88666127  0.64267710 -1.83987251
 [19]  0.82399031  0.49078942  0.57442031  0.18128184 -0.41879204  0.38879048
 [25] -1.77594524 -1.58922284  0.03986224 -0.63071160  0.34482561 -0.30415779
 [31] -0.70574609  0.95682399 -0.36761650  1.49026425  0.54562399 -1.74631296
 [37]  0.83634231  0.68951096  0.43386257 -0.42976091  0.28054092  1.13732050
 [43] -0.90948394  1.56798606  0.30067433  0.10755312  0.76004583  1.40934015
 [49]  0.28871591  0.45031675 -1.32004816 -0.05047722  0.84185185 -0.69396881
 [55]  2.20685657  0.70099191 -0.76873918 -0.34911039  1.20995192 -1.56228925
 [61] -0.33141540 -0.05642018 -0.48960698  1.13946114  0.36509672  1.46521312
 [67] -0.48851479  0.20336354 -2.42138781 -1.41946713 -0.13281374  0.19966118
 [73] -0.05450908  1.06234698 -0.58793904  0.24826220 -0.52699637 -2.32717665
 [79]  1.71569579 -1.97518725  0.86822302 -1.01212263  0.60384020 -2.61514703
 [85]  0.83402961 -0.04172977  0.14521953 -0.53676022  0.77573480 -0.14424903
 [91] -0.06127010 -2.38399713  0.26946759  1.41954165  0.67356521  0.55386424
 [97] -0.38770681  0.47422832 -0.18507908  1.17137230
> 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.01022310  1.26610360 -1.47945981 -1.31315802 -0.44355220  0.42662110
  [7] -0.30048898  0.03494274  1.19502267  1.75357250 -0.50578168  0.75617150
 [13] -0.31528155 -1.21199672  1.11432860  0.88666127  0.64267710 -1.83987251
 [19]  0.82399031  0.49078942  0.57442031  0.18128184 -0.41879204  0.38879048
 [25] -1.77594524 -1.58922284  0.03986224 -0.63071160  0.34482561 -0.30415779
 [31] -0.70574609  0.95682399 -0.36761650  1.49026425  0.54562399 -1.74631296
 [37]  0.83634231  0.68951096  0.43386257 -0.42976091  0.28054092  1.13732050
 [43] -0.90948394  1.56798606  0.30067433  0.10755312  0.76004583  1.40934015
 [49]  0.28871591  0.45031675 -1.32004816 -0.05047722  0.84185185 -0.69396881
 [55]  2.20685657  0.70099191 -0.76873918 -0.34911039  1.20995192 -1.56228925
 [61] -0.33141540 -0.05642018 -0.48960698  1.13946114  0.36509672  1.46521312
 [67] -0.48851479  0.20336354 -2.42138781 -1.41946713 -0.13281374  0.19966118
 [73] -0.05450908  1.06234698 -0.58793904  0.24826220 -0.52699637 -2.32717665
 [79]  1.71569579 -1.97518725  0.86822302 -1.01212263  0.60384020 -2.61514703
 [85]  0.83402961 -0.04172977  0.14521953 -0.53676022  0.77573480 -0.14424903
 [91] -0.06127010 -2.38399713  0.26946759  1.41954165  0.67356521  0.55386424
 [97] -0.38770681  0.47422832 -0.18507908  1.17137230
> rowMin(tmp2)
  [1] -0.01022310  1.26610360 -1.47945981 -1.31315802 -0.44355220  0.42662110
  [7] -0.30048898  0.03494274  1.19502267  1.75357250 -0.50578168  0.75617150
 [13] -0.31528155 -1.21199672  1.11432860  0.88666127  0.64267710 -1.83987251
 [19]  0.82399031  0.49078942  0.57442031  0.18128184 -0.41879204  0.38879048
 [25] -1.77594524 -1.58922284  0.03986224 -0.63071160  0.34482561 -0.30415779
 [31] -0.70574609  0.95682399 -0.36761650  1.49026425  0.54562399 -1.74631296
 [37]  0.83634231  0.68951096  0.43386257 -0.42976091  0.28054092  1.13732050
 [43] -0.90948394  1.56798606  0.30067433  0.10755312  0.76004583  1.40934015
 [49]  0.28871591  0.45031675 -1.32004816 -0.05047722  0.84185185 -0.69396881
 [55]  2.20685657  0.70099191 -0.76873918 -0.34911039  1.20995192 -1.56228925
 [61] -0.33141540 -0.05642018 -0.48960698  1.13946114  0.36509672  1.46521312
 [67] -0.48851479  0.20336354 -2.42138781 -1.41946713 -0.13281374  0.19966118
 [73] -0.05450908  1.06234698 -0.58793904  0.24826220 -0.52699637 -2.32717665
 [79]  1.71569579 -1.97518725  0.86822302 -1.01212263  0.60384020 -2.61514703
 [85]  0.83402961 -0.04172977  0.14521953 -0.53676022  0.77573480 -0.14424903
 [91] -0.06127010 -2.38399713  0.26946759  1.41954165  0.67356521  0.55386424
 [97] -0.38770681  0.47422832 -0.18507908  1.17137230
> 
> colMeans(tmp2)
[1] 0.02101129
> colSums(tmp2)
[1] 2.101129
> colVars(tmp2)
[1] 1.039479
> colSd(tmp2)
[1] 1.019548
> colMax(tmp2)
[1] 2.206857
> colMin(tmp2)
[1] -2.615147
> colMedians(tmp2)
[1] 0.1632507
> colRanges(tmp2)
          [,1]
[1,] -2.615147
[2,]  2.206857
> 
> 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.2078589  2.0536185  6.8005071 -4.3553128 -0.9322660 -1.8474596
 [7]  2.1156484 -2.3898956  4.1550239 -2.6652659
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -1.4637658
[2,] -0.7999004
[3,]  0.3273019
[4,]  0.8165543
[5,]  1.1661191
> 
> rowApply(tmp,sum)
 [1] -5.0336843  9.8483373  2.8664785 -3.4927275 -4.1486161  0.3736274
 [7] -0.9936058  2.0256994 -3.0184091  4.7153573
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]   10    5   10   10    9    8    5    1    1     1
 [2,]    3    2    3    7    4    7   10    9    7     6
 [3,]    8    4    6    8   10   10    3    8    2    10
 [4,]    1    3    9    2    5    3    4    3   10     4
 [5,]    9    8    1    1    6    5    7    6    3     3
 [6,]    5    9    4    9    1    1    1    7    4     7
 [7,]    6   10    7    6    7    6    8    2    5     5
 [8,]    4    1    5    5    8    4    6    4    6     2
 [9,]    7    7    2    4    3    9    9   10    9     8
[10,]    2    6    8    3    2    2    2    5    8     9
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1] -0.3255885 -0.8178419 -1.0327301 -3.0583071  2.2904266 -2.2681721
 [7]  1.2128761 -2.5426030 -0.4570467  4.1816229 -1.8703174 -1.7085677
[13] -0.6848687  1.5266017 -0.5848735  0.6198050 -1.8308135  0.2383953
[19] -0.8988167  1.2429390
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -0.8125195
[2,] -0.7198117
[3,]  0.1595753
[4,]  0.2495661
[5,]  0.7976012
> 
> rowApply(tmp,sum)
[1] -5.5179550 -3.1983820 -2.8176918  0.1758136  4.5903349
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]   11   17    7    1   11
[2,]   14    2   10    9   18
[3,]    9    7    4    7   20
[4,]    3    9    6    4   14
[5,]   16   13   19   19    2
> 
> 
> as.matrix(tmp)
           [,1]       [,2]       [,3]       [,4]       [,5]         [,6]
[1,]  0.1595753  0.3719421 -0.1179483 -1.6221845  0.4975119 -1.752177722
[2,]  0.7976012 -1.5185584 -0.9059405 -0.6079725  0.3794879 -1.399322785
[3,] -0.7198117 -0.3106179 -0.8461616 -0.7216339  0.8037473  1.650726992
[4,] -0.8125195 -0.1807406 -0.2917042 -0.7009339  1.1834442 -0.762365840
[5,]  0.2495661  0.8201330  1.1290246  0.5944177 -0.5737647 -0.005032776
            [,7]       [,8]       [,9]       [,10]      [,11]      [,12]
[1,] -1.14856050  0.6955085 -1.5298376  0.39557794 -0.8129185 -1.7311191
[2,]  0.08514882 -1.4121876  0.7736501  3.17521711 -0.7155189 -1.4056409
[3,]  0.73805650 -1.0372818  0.5383114  0.07454112  0.6141724  0.2616766
[4,]  1.37684152 -0.6815951 -0.7362442  0.72892326 -0.6935500  0.5176905
[5,]  0.16138975 -0.1070471  0.4970736 -0.19263654 -0.2625024  0.6488252
            [,13]      [,14]       [,15]      [,16]      [,17]      [,18]
[1,] -1.497289620  0.3348396  0.50175239  0.6145321  0.3360375  1.0471933
[2,]  0.510826853  0.5976827  0.02448745 -0.1069636 -2.0735995 -1.0568051
[3,]  0.198182288 -0.7506188 -0.91659207 -1.1728430  0.2300433 -0.6000747
[4,]  0.105031932  0.6217744 -0.04901102  0.7425472 -0.0253516 -0.2728977
[5,] -0.001620114  0.7229238 -0.14551021  0.5425324 -0.2979432  1.1209794
          [,19]      [,20]
[1,]  0.1405790 -0.4009688
[2,]  0.8100523  0.8499734
[3,] -0.6309605 -0.2205537
[4,] -0.1470034  0.2534777
[5,] -1.0714842  0.7610104
> 
> 
> is.BufferedMatrix(tmp)
[1] TRUE
> 
> as.BufferedMatrix(as.matrix(tmp))
BufferedMatrix object
Matrix size:  5 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  800  bytes.
> 
> 
> 
> subBufferedMatrix(tmp,1:5,1:5)
BufferedMatrix object
Matrix size:  5 5 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  648  bytes.
Disk usage :  200  bytes.
> subBufferedMatrix(tmp,,5:8)
BufferedMatrix object
Matrix size:  5 4 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  562  bytes.
Disk usage :  160  bytes.
> subBufferedMatrix(tmp,1:3,)
BufferedMatrix object
Matrix size:  3 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  480  bytes.
> 
> 
> rm(tmp)
> 
> 
> ###
> ### Testing colnames and rownames
> ###
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> 
> 
> colnames(tmp)
NULL
> rownames(tmp)
NULL
> 
> 
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> colnames(tmp)
 [1] "col1"  "col2"  "col3"  "col4"  "col5"  "col6"  "col7"  "col8"  "col9" 
[10] "col10" "col11" "col12" "col13" "col14" "col15" "col16" "col17" "col18"
[19] "col19" "col20"
> rownames(tmp)
[1] "row1" "row2" "row3" "row4" "row5"
> 
> 
> tmp["row1",]
          col1      col2      col3     col4      col5       col6       col7
row1 -2.365686 0.2691417 0.7800683 0.338067 0.6257509 -0.8872915 -0.1982044
           col8     col9     col10     col11     col12    col13      col14
row1 -0.4691085 1.011228 -1.314819 0.9008923 -0.506821 1.407992 -0.2884159
         col15      col16      col17     col18     col19     col20
row1 0.2422202 0.09279993 -0.5405115 -1.419508 0.9963242 0.2027389
> tmp[,"col10"]
          col10
row1 -1.3148192
row2  0.1552078
row3  0.9912681
row4  0.8668237
row5 -0.3096323
> tmp[c("row1","row5"),]
          col1      col2       col3      col4       col5       col6       col7
row1 -2.365686 0.2691417  0.7800683  0.338067 0.62575087 -0.8872915 -0.1982044
row5 -2.100085 0.6123327 -0.2631436 -1.903289 0.08889803  0.5211006  1.7498930
           col8       col9      col10     col11      col12     col13      col14
row1 -0.4691085  1.0112282 -1.3148192 0.9008923 -0.5068210  1.407992 -0.2884159
row5 -1.4906199 -0.2973667 -0.3096323 0.8921884 -0.1423818 -1.443162  0.6148848
           col15       col16      col17      col18     col19      col20
row1  0.24222023  0.09279993 -0.5405115 -1.4195079 0.9963242  0.2027389
row5 -0.09412707 -0.82449367  0.7505116  0.6804979 2.0197736 -0.5944782
> tmp[,c("col6","col20")]
           col6      col20
row1 -0.8872915  0.2027389
row2  1.5159921  0.6571866
row3  0.2785608  1.3942366
row4  1.5629696 -0.1176988
row5  0.5211006 -0.5944782
> tmp[c("row1","row5"),c("col6","col20")]
           col6      col20
row1 -0.8872915  0.2027389
row5  0.5211006 -0.5944782
> 
> 
> 
> 
> tmp["row1",] <- rnorm(20,mean=10)
> tmp[,"col10"] <- rnorm(5,mean=30)
> tmp[c("row1","row5"),] <- rnorm(40,mean=50)
> tmp[,c("col6","col20")] <- rnorm(10,mean=75)
> tmp[c("row1","row5"),c("col6","col20")]  <- rnorm(4,mean=105)
> 
> tmp["row1",]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 49.08813 47.56305 49.74202 51.39271 50.23475 105.6758 49.23634 49.70709
         col9    col10    col11    col12    col13    col14    col15    col16
row1 50.61384 48.66522 50.12748 49.02083 50.32391 49.21701 48.27327 49.73806
        col17    col18    col19    col20
row1 48.53796 49.77679 49.41328 103.8276
> tmp[,"col10"]
        col10
row1 48.66522
row2 28.91262
row3 30.21734
row4 29.08928
row5 50.10887
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 49.08813 47.56305 49.74202 51.39271 50.23475 105.6758 49.23634 49.70709
row5 50.24395 51.32610 48.69241 51.94575 48.42154 104.9492 48.74952 50.05354
         col9    col10    col11    col12    col13    col14    col15    col16
row1 50.61384 48.66522 50.12748 49.02083 50.32391 49.21701 48.27327 49.73806
row5 51.06769 50.10887 50.03745 51.46968 51.20483 48.28689 51.18177 50.69862
        col17    col18    col19    col20
row1 48.53796 49.77679 49.41328 103.8276
row5 49.49829 50.67098 49.69859 104.5733
> tmp[,c("col6","col20")]
          col6     col20
row1 105.67580 103.82761
row2  75.02685  73.18126
row3  74.56826  74.54908
row4  76.18628  74.89228
row5 104.94918 104.57332
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 105.6758 103.8276
row5 104.9492 104.5733
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 105.6758 103.8276
row5 104.9492 104.5733
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
           col13
[1,]  0.85840929
[2,] -1.23049018
[3,]  0.36933557
[4,] -1.52473034
[5,] -0.05230805
> tmp[,c("col17","col7")]
          col17         col7
[1,] 0.33045950 -0.265563025
[2,] 0.30747524 -2.200669085
[3,] 0.49790781 -0.009795901
[4,] 0.02222497  0.015920721
[5,] 1.98924134  1.541340812
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
            col6      col20
[1,]  1.35107399  0.4845826
[2,]  0.76642566 -1.0121389
[3,]  0.08297385  1.2328201
[4,] -1.29173453  0.8989529
[5,] -0.77450016 -1.8668856
> subBufferedMatrix(tmp,1,c("col6"))[,1]
         col1
[1,] 1.351074
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
          col6
[1,] 1.3510740
[2,] 0.7664257
> 
> 
> 
> 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.1939185 -1.077065 -0.5959391  0.3259884  0.8559003 -0.7963110
row1 -0.8353746  1.043154  0.5400920 -1.7335827 -0.5425364 -0.7291928
           [,7]      [,8]       [,9]     [,10]      [,11]      [,12]      [,13]
row3 0.08018018  1.380588 -1.1987029 -1.539639  0.3598406 -0.1334915 -0.1645036
row1 0.09547424 -1.424377  0.3087725  0.264234 -0.8062518  0.1005812 -1.5678674
           [,14]      [,15]      [,16]     [,17]      [,18]     [,19]
row3 -0.02045681  1.6143717 -0.3355208 -2.260788 -0.5971922 -1.008172
row1  1.38561454 -0.5931422 -1.3564702 -0.472816  2.0008644  1.496696
          [,20]
row3 -0.2216022
row1  0.1637276
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
          [,1]      [,2]      [,3]      [,4]      [,5]      [,6]     [,7]
row2 0.5342819 0.3332895 0.1822961 0.1953903 0.7950475 -1.109975 1.181113
            [,8]      [,9]    [,10]
row2 -0.02045283 0.8874319 0.591714
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
          [,1]      [,2]       [,3]      [,4]      [,5]      [,6]       [,7]
row5 0.7792645 0.9460392 -0.7228367 0.2035518 -1.082489 0.1305648 -0.6321148
         [,8]       [,9]     [,10]     [,11]     [,12]     [,13]     [,14]
row5 1.771139 -0.6988548 0.9998773 0.9078679 0.8746148 0.7524547 -2.009933
         [,15]      [,16]   [,17]     [,18]     [,19]    [,20]
row5 -1.491324 -0.3286114 1.16246 0.4154166 -1.130231 1.245682
> 
> 
> 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: 0x600000ff4120>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BMcb5057e6603f"
 [2] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BMcb5055b8f52e"
 [3] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BMcb5061e8caf9"
 [4] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BMcb507a65d3a6"
 [5] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BMcb50332a7611"
 [6] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BMcb5028ad7055"
 [7] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BMcb5012a9f150"
 [8] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BMcb505321c4c2"
 [9] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BMcb504dfcc731"
[10] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BMcb50e7989f7" 
[11] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BMcb504d50be8d"
[12] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BMcb50700e42a2"
[13] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BMcb503838d327"
[14] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BMcb501aaec247"
[15] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BMcb504754d100"
> 
> 
> ### 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: 0x600000ffc240>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x600000ffc240>
Warning message:
In dir.create(new.directory) :
  '/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x600000ffc240>
> rowMedians(tmp)
  [1] -0.257911207  0.238098673 -0.328736791 -0.221972316 -0.229584010
  [6] -0.161747457 -0.060405469  0.398993190 -0.597865754 -0.005637593
 [11] -0.244986109  0.120423014 -0.204958937 -0.148541134  0.010863434
 [16]  0.120596478 -0.006289236  0.077630640 -0.168351535  0.236362374
 [21] -0.324073880 -0.047292870  0.288773253  0.275478455 -0.895492001
 [26]  0.265227372 -0.217023658  0.035166711 -0.088628258 -0.143029057
 [31] -0.096672878 -0.489482437 -0.115185319  0.126291019 -0.100800608
 [36] -0.357178316  0.108015495 -0.190952387 -0.056692423 -0.321559563
 [41] -0.637872061  0.386214735 -0.190587155 -0.203767409 -0.045991939
 [46]  0.200283113 -0.374331799  0.328007077 -0.166022373  0.403210387
 [51] -0.111395040  0.031746358 -0.112602990 -0.058292491 -0.214280112
 [56]  0.448346740  0.089253097 -0.569629641  0.168567488 -0.154091805
 [61] -0.169844171  0.022098859  0.553854349  0.257759717  0.203238224
 [66] -0.144257605  0.006770177  0.459335718  0.366164037  0.013407342
 [71] -0.374288927 -0.016581503  0.477161324 -0.089335929 -0.119075353
 [76] -0.866317996 -0.138796178 -0.406141451 -0.267216377  0.716123894
 [81]  0.372042969  0.110436115  0.245716361 -0.545888180  0.034733446
 [86]  0.093185038  0.189712102 -0.133100096  0.519894879  0.201102881
 [91] -0.071493272  0.453305038 -0.060841229  0.378053041  0.681919646
 [96] -0.652146588 -0.154464763  0.229420154  0.797087733 -0.142897900
[101] -0.075676983  0.127007108 -0.301624768 -0.569063286 -0.047560155
[106]  0.087412539 -0.089751734  0.047160358 -0.072526382  0.356644669
[111]  0.324321506 -0.309347345 -0.270079037 -0.166981480 -0.492426780
[116]  0.076105170 -0.299726041  0.051349933  0.361836108 -0.103764005
[121] -0.135485681 -0.298916550  0.201708505  0.029039934 -0.511226397
[126]  0.452193955 -0.327121089 -0.817285921 -0.666565828  0.182211980
[131]  0.250803407  0.663000297 -0.007999844 -0.262811632 -0.065276645
[136] -0.155561813 -0.341395927 -0.305477781 -0.220610334  0.495057751
[141]  0.188473004  0.468424153  0.136051863  0.196379046 -0.798014529
[146] -0.013984247 -0.312438734  0.406432145  0.124861901  0.017124516
[151] -0.143084100  0.043761588  0.446538930 -0.057755160  0.357890278
[156]  0.137566656  0.604880663 -0.383379864 -0.129587363 -0.077954941
[161]  0.176946380  0.448472634 -0.439691930  0.427433366  0.010114065
[166]  0.440472710  0.675878181 -0.032575405  0.230317432  0.175121743
[171] -0.155455782 -0.417440164  0.301961026  0.065534330  0.476713776
[176]  0.082281428  0.616416665  0.016125225 -0.331414783  0.253971530
[181] -0.201207769  0.431290356 -0.132612278  0.137054767  0.125585234
[186] -0.391287181 -0.063855850  0.583910736 -0.203871893 -0.023439456
[191]  0.461968266  0.107224796  0.218976341  0.063315412 -0.410639172
[196]  0.222774897 -0.627051306 -0.602482301  0.447034303  0.457303759
[201]  0.384015876 -0.290655415  0.798689175  0.351260541 -0.176632653
[206] -0.091063453 -0.084781804 -0.178445008  0.533835828 -0.141128465
[211]  0.251043967  0.029063322  0.888487102 -0.752008849 -0.106607469
[216] -0.094359368  0.324094219 -0.100255073  0.390345057  0.011568150
[221] -0.144252667  0.707728584  0.066042931 -0.231564709 -0.557611893
[226]  0.295836288 -0.080168195  0.485139382  0.087828028 -0.161258355
> 
> proc.time()
   user  system elapsed 
  0.630   3.433   4.222 

BufferedMatrix.Rcheck/tests/rawCalltesting.Rout


R version 4.5.0 RC (2025-04-04 r88126) -- "How About a Twenty-Six"
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: 0x60000234c000>
> .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: 0x60000234c000>
> .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: 0x60000234c000>
> .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: 0x60000234c000>
> 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: 0x600002348540>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600002348540>
> .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: 0x600002348540>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600002348540>
> .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: 0x600002348540>
> 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: 0x600002350060>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600002350060>
> .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: 0x600002350060>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x600002350060>
> .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: 0x600002350060>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x600002350060>
> .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: 0x600002350060>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x600002350060>
> .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: 0x600002350060>
> 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: 0x600002348780>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x600002348780>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600002348780>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600002348780>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFilece233c2b85f8" "BufferedMatrixFilece23401f22e3"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFilece233c2b85f8" "BufferedMatrixFilece23401f22e3"
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x600002348a20>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600002348a20>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x600002348a20>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x600002348a20>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x600002348a20>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x600002348a20>
> .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: 0x600002348c00>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600002348c00>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x600002348c00>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x600002348c00>
> 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: 0x600002348de0>
> .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: 0x600002348de0>
> rm(P)
> 
> proc.time()
   user  system elapsed 
  0.110   0.042   0.148 

BufferedMatrix.Rcheck/tests/Rcodetesting.Rout


R version 4.5.0 RC (2025-04-04 r88126) -- "How About a Twenty-Six"
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.107   0.028   0.139 

Example timings