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

This page was generated on 2025-09-27 12:05 -0400 (Sat, 27 Sep 2025).

HostnameOSArch (*)R versionInstalled pkgs
nebbiolo2Linux (Ubuntu 24.04.3 LTS)x86_644.5.1 Patched (2025-08-23 r88802) -- "Great Square Root" 4832
lconwaymacOS 12.7.1 Montereyx86_644.5.1 Patched (2025-09-10 r88807) -- "Great Square Root" 4620
kjohnson3macOS 13.7.7 Venturaarm644.5.1 Patched (2025-09-10 r88807) -- "Great Square Root" 4565
taishanLinux (openEuler 24.03 LTS)aarch644.5.0 (2025-04-11) -- "How About a Twenty-Six" 4563
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 253/2334HostnameOS / ArchINSTALLBUILDCHECKBUILD BIN
BufferedMatrix 1.73.0  (landing page)
Ben Bolstad
Snapshot Date: 2025-09-26 13:45 -0400 (Fri, 26 Sep 2025)
git_url: https://git.bioconductor.org/packages/BufferedMatrix
git_branch: devel
git_last_commit: 0147962
git_last_commit_date: 2025-04-15 09:39:39 -0400 (Tue, 15 Apr 2025)
nebbiolo2Linux (Ubuntu 24.04.3 LTS) / x86_64  OK    OK    OK  UNNEEDED, same version is already published
lconwaymacOS 12.7.1 Monterey / x86_64  OK    OK    WARNINGS    OK  UNNEEDED, same version is already published
kjohnson3macOS 13.7.7 Ventura / arm64  OK    OK    WARNINGS    OK  UNNEEDED, same version is already published
taishanLinux (openEuler 24.03 LTS) / aarch64  OK    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.73.0
Command: /Library/Frameworks/R.framework/Resources/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/Library/Frameworks/R.framework/Resources/library --no-vignettes --timings BufferedMatrix_1.73.0.tar.gz
StartedAt: 2025-09-26 18:28:36 -0400 (Fri, 26 Sep 2025)
EndedAt: 2025-09-26 18:28:54 -0400 (Fri, 26 Sep 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.73.0.tar.gz
###
##############################################################################
##############################################################################


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

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


Installation output

BufferedMatrix.Rcheck/00install.out

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


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

Tests output

BufferedMatrix.Rcheck/tests/c_code_level_tests.Rout


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

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

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

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

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

Attaching package: 'BufferedMatrix'

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

    colMeans, colSums, rowMeans, rowSums

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

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

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

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

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

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

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

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

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

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

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

[[1]]
[1] 0

> 
> proc.time()
   user  system elapsed 
  0.114   0.045   0.155 

BufferedMatrix.Rcheck/tests/objectTesting.Rout


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

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

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

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

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

Attaching package: 'BufferedMatrix'

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

    colMeans, colSums, rowMeans, rowSums

> 
> 
> ### this is used to control how many repetitions in something below
> ### higher values result in more checks.
> nreps <-100 ##20000
> 
> 
> ## test creation and some simple assignments and subsetting operations
> 
> ## first on single elements
> tmp <- createBufferedMatrix(1000,10)
> 
> tmp[10,5]
[1] 0
> tmp[10,5] <- 10
> tmp[10,5]
[1] 10
> tmp[10,5] <- 12.445
> tmp[10,5]
[1] 12.445
> 
> 
> 
> ## now testing accessing multiple elements
> tmp2 <- createBufferedMatrix(10,20)
> 
> 
> tmp2[3,1] <- 51.34
> tmp2[9,2] <- 9.87654
> tmp2[,1:2]
       [,1]    [,2]
 [1,]  0.00 0.00000
 [2,]  0.00 0.00000
 [3,] 51.34 0.00000
 [4,]  0.00 0.00000
 [5,]  0.00 0.00000
 [6,]  0.00 0.00000
 [7,]  0.00 0.00000
 [8,]  0.00 0.00000
 [9,]  0.00 9.87654
[10,]  0.00 0.00000
> tmp2[,-(3:20)]
       [,1]    [,2]
 [1,]  0.00 0.00000
 [2,]  0.00 0.00000
 [3,] 51.34 0.00000
 [4,]  0.00 0.00000
 [5,]  0.00 0.00000
 [6,]  0.00 0.00000
 [7,]  0.00 0.00000
 [8,]  0.00 0.00000
 [9,]  0.00 9.87654
[10,]  0.00 0.00000
> tmp2[3,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
[1,] 51.34    0    0    0    0    0    0    0    0     0     0     0     0
     [,14] [,15] [,16] [,17] [,18] [,19] [,20]
[1,]     0     0     0     0     0     0     0
> tmp2[-3,]
      [,1]    [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [2,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [3,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [4,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [5,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [6,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [7,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [8,]    0 9.87654    0    0    0    0    0    0    0     0     0     0     0
 [9,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
      [,14] [,15] [,16] [,17] [,18] [,19] [,20]
 [1,]     0     0     0     0     0     0     0
 [2,]     0     0     0     0     0     0     0
 [3,]     0     0     0     0     0     0     0
 [4,]     0     0     0     0     0     0     0
 [5,]     0     0     0     0     0     0     0
 [6,]     0     0     0     0     0     0     0
 [7,]     0     0     0     0     0     0     0
 [8,]     0     0     0     0     0     0     0
 [9,]     0     0     0     0     0     0     0
> tmp2[2,1:3]
     [,1] [,2] [,3]
[1,]    0    0    0
> tmp2[3:9,1:3]
      [,1]    [,2] [,3]
[1,] 51.34 0.00000    0
[2,]  0.00 0.00000    0
[3,]  0.00 0.00000    0
[4,]  0.00 0.00000    0
[5,]  0.00 0.00000    0
[6,]  0.00 0.00000    0
[7,]  0.00 9.87654    0
> tmp2[-4,-4]
       [,1]    [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [2,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [3,] 51.34 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [4,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [5,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [6,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [7,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [8,]  0.00 9.87654    0    0    0    0    0    0    0     0     0     0     0
 [9,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
      [,14] [,15] [,16] [,17] [,18] [,19]
 [1,]     0     0     0     0     0     0
 [2,]     0     0     0     0     0     0
 [3,]     0     0     0     0     0     0
 [4,]     0     0     0     0     0     0
 [5,]     0     0     0     0     0     0
 [6,]     0     0     0     0     0     0
 [7,]     0     0     0     0     0     0
 [8,]     0     0     0     0     0     0
 [9,]     0     0     0     0     0     0
> 
> ## now testing accessing/assigning multiple elements
> tmp3 <- createBufferedMatrix(10,10)
> 
> for (i in 1:10){
+   for (j in 1:10){
+     tmp3[i,j] <- (j-1)*10 + i
+   }
+ }
> 
> tmp3[2:4,2:4]
     [,1] [,2] [,3]
[1,]   12   22   32
[2,]   13   23   33
[3,]   14   24   34
> tmp3[c(-10),c(2:4,2:4,10,1,2,1:10,10:1)]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]   11   21   31   11   21   31   91    1   11     1    11    21    31
 [2,]   12   22   32   12   22   32   92    2   12     2    12    22    32
 [3,]   13   23   33   13   23   33   93    3   13     3    13    23    33
 [4,]   14   24   34   14   24   34   94    4   14     4    14    24    34
 [5,]   15   25   35   15   25   35   95    5   15     5    15    25    35
 [6,]   16   26   36   16   26   36   96    6   16     6    16    26    36
 [7,]   17   27   37   17   27   37   97    7   17     7    17    27    37
 [8,]   18   28   38   18   28   38   98    8   18     8    18    28    38
 [9,]   19   29   39   19   29   39   99    9   19     9    19    29    39
      [,14] [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24] [,25]
 [1,]    41    51    61    71    81    91    91    81    71    61    51    41
 [2,]    42    52    62    72    82    92    92    82    72    62    52    42
 [3,]    43    53    63    73    83    93    93    83    73    63    53    43
 [4,]    44    54    64    74    84    94    94    84    74    64    54    44
 [5,]    45    55    65    75    85    95    95    85    75    65    55    45
 [6,]    46    56    66    76    86    96    96    86    76    66    56    46
 [7,]    47    57    67    77    87    97    97    87    77    67    57    47
 [8,]    48    58    68    78    88    98    98    88    78    68    58    48
 [9,]    49    59    69    79    89    99    99    89    79    69    59    49
      [,26] [,27] [,28] [,29]
 [1,]    31    21    11     1
 [2,]    32    22    12     2
 [3,]    33    23    13     3
 [4,]    34    24    14     4
 [5,]    35    25    15     5
 [6,]    36    26    16     6
 [7,]    37    27    17     7
 [8,]    38    28    18     8
 [9,]    39    29    19     9
> tmp3[-c(1:5),-c(6:10)]
     [,1] [,2] [,3] [,4] [,5]
[1,]    6   16   26   36   46
[2,]    7   17   27   37   47
[3,]    8   18   28   38   48
[4,]    9   19   29   39   49
[5,]   10   20   30   40   50
> 
> ## assignment of whole columns
> tmp3[,1] <- c(1:10*100.0)
> tmp3[,1:2] <- tmp3[,1:2]*100
> tmp3[,1:2] <- tmp3[,2:1]
> tmp3[,1:2]
      [,1]  [,2]
 [1,] 1100 1e+04
 [2,] 1200 2e+04
 [3,] 1300 3e+04
 [4,] 1400 4e+04
 [5,] 1500 5e+04
 [6,] 1600 6e+04
 [7,] 1700 7e+04
 [8,] 1800 8e+04
 [9,] 1900 9e+04
[10,] 2000 1e+05
> 
> 
> tmp3[,-1] <- tmp3[,1:9]
> tmp3[,1:10]
      [,1] [,2]  [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,] 1100 1100 1e+04   21   31   41   51   61   71    81
 [2,] 1200 1200 2e+04   22   32   42   52   62   72    82
 [3,] 1300 1300 3e+04   23   33   43   53   63   73    83
 [4,] 1400 1400 4e+04   24   34   44   54   64   74    84
 [5,] 1500 1500 5e+04   25   35   45   55   65   75    85
 [6,] 1600 1600 6e+04   26   36   46   56   66   76    86
 [7,] 1700 1700 7e+04   27   37   47   57   67   77    87
 [8,] 1800 1800 8e+04   28   38   48   58   68   78    88
 [9,] 1900 1900 9e+04   29   39   49   59   69   79    89
[10,] 2000 2000 1e+05   30   40   50   60   70   80    90
> 
> tmp3[,1:2] <- rep(1,10)
> tmp3[,1:2] <- rep(1,20)
> tmp3[,1:2] <- matrix(c(1:5),1,5)
> 
> tmp3[,-c(1:8)] <- matrix(c(1:5),1,5)
> 
> tmp3[1,] <- 1:10
> tmp3[1,]
     [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,]    1    2    3    4    5    6    7    8    9    10
> tmp3[-1,] <- c(1,2)
> tmp3[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    1    2    3    4    5    6    7    8    9    10
 [2,]    1    2    1    2    1    2    1    2    1     2
 [3,]    2    1    2    1    2    1    2    1    2     1
 [4,]    1    2    1    2    1    2    1    2    1     2
 [5,]    2    1    2    1    2    1    2    1    2     1
 [6,]    1    2    1    2    1    2    1    2    1     2
 [7,]    2    1    2    1    2    1    2    1    2     1
 [8,]    1    2    1    2    1    2    1    2    1     2
 [9,]    2    1    2    1    2    1    2    1    2     1
[10,]    1    2    1    2    1    2    1    2    1     2
> tmp3[-c(1:8),] <- matrix(c(1:5),1,5)
> tmp3[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    1    2    3    4    5    6    7    8    9    10
 [2,]    1    2    1    2    1    2    1    2    1     2
 [3,]    2    1    2    1    2    1    2    1    2     1
 [4,]    1    2    1    2    1    2    1    2    1     2
 [5,]    2    1    2    1    2    1    2    1    2     1
 [6,]    1    2    1    2    1    2    1    2    1     2
 [7,]    2    1    2    1    2    1    2    1    2     1
 [8,]    1    2    1    2    1    2    1    2    1     2
 [9,]    1    3    5    2    4    1    3    5    2     4
[10,]    2    4    1    3    5    2    4    1    3     5
> 
> 
> tmp3[1:2,1:2] <- 5555.04
> tmp3[-(1:2),1:2] <- 1234.56789
> 
> 
> 
> ## testing accessors for the directory and prefix
> directory(tmp3)
[1] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests"
> prefix(tmp3)
[1] "BM"
> 
> ## testing if we can remove these objects
> rm(tmp, tmp2, tmp3)
> gc()
         used (Mb) gc trigger (Mb) limit (Mb) max used (Mb)
Ncells 480828 25.7    1056624 56.5         NA   634340 33.9
Vcells 891019  6.8    8388608 64.0     196608  2109889 16.1
> 
> 
> 
> 
> ##
> ## checking reads
> ##
> 
> tmp2 <- createBufferedMatrix(10,20)
> 
> test.sample <- rnorm(10*20)
> 
> tmp2[1:10,1:20] <- test.sample
> 
> test.matrix <- matrix(test.sample,10,20)
> 
> ## testing reads
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   which.col <- sample(1:20,1)
+   if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> date()
[1] "Fri Sep 26 18:28:45 2025"
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> date()
[1] "Fri Sep 26 18:28:45 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: 0x60000048c000>
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   which.col <- sample(1:20,1)
+   if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,5,replace=TRUE)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> date()
[1] "Fri Sep 26 18:28:46 2025"
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col <- sample(1:20,5,replace=TRUE)
+   if (!all(tmp2[which.row,which.col] == test.matrix[which.row,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> date()
[1] "Fri Sep 26 18:28:47 2025"
> 
> ColMode(tmp2)
<pointer: 0x60000048c000>
> 
> 
> 
> ### 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.59923027  0.4973803  0.1656609  0.7763171
[2,]  -0.03321657  1.4839279 -0.8105086  0.2962588
[3,]  -0.67700613 -0.5704877 -0.8350913 -0.0234799
[4,]  -0.04625997 -0.5943769 -0.1147039  0.1828965
> ewApply(tmp5,abs)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
             [,1]      [,2]      [,3]      [,4]
[1,] 100.59923027 0.4973803 0.1656609 0.7763171
[2,]   0.03321657 1.4839279 0.8105086 0.2962588
[3,]   0.67700613 0.5704877 0.8350913 0.0234799
[4,]   0.04625997 0.5943769 0.1147039 0.1828965
> ewApply(tmp5,sqrt)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
           [,1]      [,2]      [,3]      [,4]
[1,] 10.0299168 0.7052520 0.4070146 0.8810886
[2,]  0.1822541 1.2181658 0.9002825 0.5442966
[3,]  0.8228038 0.7553063 0.9138333 0.1532315
[4,]  0.2150813 0.7709584 0.3386796 0.4276640
> 
> my.function <- function(x,power){
+   (x+5)^power
+ }
> 
> ewApply(tmp5,my.function,power=2)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
          [,1]     [,2]     [,3]     [,4]
[1,] 225.89840 32.54990 29.23581 34.58720
[2,]  26.85576 38.66559 34.81333 30.73922
[3,]  33.90504 33.12355 34.97342 26.55580
[4,]  27.19707 33.30396 28.50150 29.45954
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x600000480000>
> exp(tmp5)
<pointer: 0x600000480000>
> log(tmp5,2)
<pointer: 0x600000480000>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 470.1779
> Min(tmp5)
[1] 53.0432
> mean(tmp5)
[1] 72.2855
> Sum(tmp5)
[1] 14457.1
> Var(tmp5)
[1] 873.1841
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 90.82334 70.07762 68.42449 68.68681 72.42838 71.36904 69.72777 70.22477
 [9] 70.55975 70.53307
> rowSums(tmp5)
 [1] 1816.467 1401.552 1368.490 1373.736 1448.568 1427.381 1394.555 1404.495
 [9] 1411.195 1410.661
> rowVars(tmp5)
 [1] 8024.61205   71.99201   79.86087   69.16916   80.88602   81.27473
 [7]  100.67927   61.54208   69.55111   91.06421
> rowSd(tmp5)
 [1] 89.580199  8.484810  8.936491  8.316800  8.993666  9.015250 10.033906
 [8]  7.844876  8.339731  9.542757
> rowMax(tmp5)
 [1] 470.17792  80.47735  85.81365  86.24468  88.63035  84.65160  87.52602
 [8]  91.56372  82.87647  85.78998
> rowMin(tmp5)
 [1] 56.61960 55.35750 53.58444 56.60714 54.44791 53.04320 53.39706 57.43337
 [9] 56.33327 54.56758
> 
> colMeans(tmp5)
 [1] 108.66674  73.64580  68.62904  67.90757  71.54550  70.70513  68.81472
 [8]  68.96367  71.51574  71.45575  67.92834  74.58892  67.03001  76.53757
[15]  68.03791  69.87761  67.86743  73.95487  71.87703  66.16076
> colSums(tmp5)
 [1] 1086.6674  736.4580  686.2904  679.0757  715.4550  707.0513  688.1472
 [8]  689.6367  715.1574  714.5575  679.2834  745.8892  670.3001  765.3757
[15]  680.3791  698.7761  678.6743  739.5487  718.7703  661.6076
> colVars(tmp5)
 [1] 16210.89373    67.10834    46.54482    50.47219    59.79958    89.05708
 [7]    57.24809    99.22349   111.03440   111.52912   133.10528   105.88223
[13]    57.88779    38.10562    41.81883    41.43028    66.80429    65.97121
[19]    58.52003    84.40777
> colSd(tmp5)
 [1] 127.322008   8.191968   6.822377   7.104378   7.733019   9.437006
 [7]   7.566247   9.961099  10.537286  10.560735  11.537126  10.289909
[13]   7.608403   6.172975   6.466748   6.436636   8.173389   8.122267
[19]   7.649838   9.187370
> colMax(tmp5)
 [1] 470.17792  84.32848  78.79930  78.56898  78.46193  81.67012  77.02329
 [8]  82.87647  88.18962  88.63035  91.56372  87.52602  80.39919  86.24468
[15]  79.16793  79.35155  80.69981  86.65628  82.22058  84.63557
> colMin(tmp5)
 [1] 55.89674 60.42521 59.32214 55.27241 53.58444 54.56758 55.35750 56.38474
 [9] 59.02506 57.08774 54.44791 60.24355 56.33327 67.83391 56.61960 59.31573
[17] 53.04320 60.36000 53.39706 56.74597
> 
> 
> ### setting a random element to NA and then testing with na.rm=TRUE or na.rm=FALSE (The default)
> 
> 
> which.row <- sample(1:10,1,replace=TRUE)
> which.col  <- sample(1:20,1,replace=TRUE)
> 
> tmp5[which.row,which.col] <- NA
> 
> Max(tmp5)
[1] NA
> Min(tmp5)
[1] NA
> mean(tmp5)
[1] NA
> Sum(tmp5)
[1] NA
> Var(tmp5)
[1] NA
> 
> rowMeans(tmp5)
 [1] 90.82334 70.07762 68.42449 68.68681 72.42838 71.36904 69.72777       NA
 [9] 70.55975 70.53307
> rowSums(tmp5)
 [1] 1816.467 1401.552 1368.490 1373.736 1448.568 1427.381 1394.555       NA
 [9] 1411.195 1410.661
> rowVars(tmp5)
 [1] 8024.61205   71.99201   79.86087   69.16916   80.88602   81.27473
 [7]  100.67927   55.39266   69.55111   91.06421
> rowSd(tmp5)
 [1] 89.580199  8.484810  8.936491  8.316800  8.993666  9.015250 10.033906
 [8]  7.442625  8.339731  9.542757
> rowMax(tmp5)
 [1] 470.17792  80.47735  85.81365  86.24468  88.63035  84.65160  87.52602
 [8]        NA  82.87647  85.78998
> rowMin(tmp5)
 [1] 56.61960 55.35750 53.58444 56.60714 54.44791 53.04320 53.39706       NA
 [9] 56.33327 54.56758
> 
> colMeans(tmp5)
 [1] 108.66674  73.64580  68.62904  67.90757  71.54550  70.70513  68.81472
 [8]  68.96367  71.51574  71.45575  67.92834  74.58892  67.03001  76.53757
[15]  68.03791  69.87761  67.86743  73.95487  71.87703        NA
> colSums(tmp5)
 [1] 1086.6674  736.4580  686.2904  679.0757  715.4550  707.0513  688.1472
 [8]  689.6367  715.1574  714.5575  679.2834  745.8892  670.3001  765.3757
[15]  680.3791  698.7761  678.6743  739.5487  718.7703        NA
> colVars(tmp5)
 [1] 16210.89373    67.10834    46.54482    50.47219    59.79958    89.05708
 [7]    57.24809    99.22349   111.03440   111.52912   133.10528   105.88223
[13]    57.88779    38.10562    41.81883    41.43028    66.80429    65.97121
[19]    58.52003          NA
> colSd(tmp5)
 [1] 127.322008   8.191968   6.822377   7.104378   7.733019   9.437006
 [7]   7.566247   9.961099  10.537286  10.560735  11.537126  10.289909
[13]   7.608403   6.172975   6.466748   6.436636   8.173389   8.122267
[19]   7.649838         NA
> colMax(tmp5)
 [1] 470.17792  84.32848  78.79930  78.56898  78.46193  81.67012  77.02329
 [8]  82.87647  88.18962  88.63035  91.56372  87.52602  80.39919  86.24468
[15]  79.16793  79.35155  80.69981  86.65628  82.22058        NA
> colMin(tmp5)
 [1] 55.89674 60.42521 59.32214 55.27241 53.58444 54.56758 55.35750 56.38474
 [9] 59.02506 57.08774 54.44791 60.24355 56.33327 67.83391 56.61960 59.31573
[17] 53.04320 60.36000 53.39706       NA
> 
> Max(tmp5,na.rm=TRUE)
[1] 470.1779
> Min(tmp5,na.rm=TRUE)
[1] 53.0432
> mean(tmp5,na.rm=TRUE)
[1] 72.36014
> Sum(tmp5,na.rm=TRUE)
[1] 14399.67
> Var(tmp5,na.rm=TRUE)
[1] 876.4745
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 90.82334 70.07762 68.42449 68.68681 72.42838 71.36904 69.72777 70.89800
 [9] 70.55975 70.53307
> rowSums(tmp5,na.rm=TRUE)
 [1] 1816.467 1401.552 1368.490 1373.736 1448.568 1427.381 1394.555 1347.062
 [9] 1411.195 1410.661
> rowVars(tmp5,na.rm=TRUE)
 [1] 8024.61205   71.99201   79.86087   69.16916   80.88602   81.27473
 [7]  100.67927   55.39266   69.55111   91.06421
> rowSd(tmp5,na.rm=TRUE)
 [1] 89.580199  8.484810  8.936491  8.316800  8.993666  9.015250 10.033906
 [8]  7.442625  8.339731  9.542757
> rowMax(tmp5,na.rm=TRUE)
 [1] 470.17792  80.47735  85.81365  86.24468  88.63035  84.65160  87.52602
 [8]  91.56372  82.87647  85.78998
> rowMin(tmp5,na.rm=TRUE)
 [1] 56.61960 55.35750 53.58444 56.60714 54.44791 53.04320 53.39706 59.02506
 [9] 56.33327 54.56758
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 108.66674  73.64580  68.62904  67.90757  71.54550  70.70513  68.81472
 [8]  68.96367  71.51574  71.45575  67.92834  74.58892  67.03001  76.53757
[15]  68.03791  69.87761  67.86743  73.95487  71.87703  67.13047
> colSums(tmp5,na.rm=TRUE)
 [1] 1086.6674  736.4580  686.2904  679.0757  715.4550  707.0513  688.1472
 [8]  689.6367  715.1574  714.5575  679.2834  745.8892  670.3001  765.3757
[15]  680.3791  698.7761  678.6743  739.5487  718.7703  604.1743
> colVars(tmp5,na.rm=TRUE)
 [1] 16210.89373    67.10834    46.54482    50.47219    59.79958    89.05708
 [7]    57.24809    99.22349   111.03440   111.52912   133.10528   105.88223
[13]    57.88779    38.10562    41.81883    41.43028    66.80429    65.97121
[19]    58.52003    84.37992
> colSd(tmp5,na.rm=TRUE)
 [1] 127.322008   8.191968   6.822377   7.104378   7.733019   9.437006
 [7]   7.566247   9.961099  10.537286  10.560735  11.537126  10.289909
[13]   7.608403   6.172975   6.466748   6.436636   8.173389   8.122267
[19]   7.649838   9.185855
> colMax(tmp5,na.rm=TRUE)
 [1] 470.17792  84.32848  78.79930  78.56898  78.46193  81.67012  77.02329
 [8]  82.87647  88.18962  88.63035  91.56372  87.52602  80.39919  86.24468
[15]  79.16793  79.35155  80.69981  86.65628  82.22058  84.63557
> colMin(tmp5,na.rm=TRUE)
 [1] 55.89674 60.42521 59.32214 55.27241 53.58444 54.56758 55.35750 56.38474
 [9] 59.02506 57.08774 54.44791 60.24355 56.33327 67.83391 56.61960 59.31573
[17] 53.04320 60.36000 53.39706 56.74597
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1] 90.82334 70.07762 68.42449 68.68681 72.42838 71.36904 69.72777      NaN
 [9] 70.55975 70.53307
> rowSums(tmp5,na.rm=TRUE)
 [1] 1816.467 1401.552 1368.490 1373.736 1448.568 1427.381 1394.555    0.000
 [9] 1411.195 1410.661
> rowVars(tmp5,na.rm=TRUE)
 [1] 8024.61205   71.99201   79.86087   69.16916   80.88602   81.27473
 [7]  100.67927         NA   69.55111   91.06421
> rowSd(tmp5,na.rm=TRUE)
 [1] 89.580199  8.484810  8.936491  8.316800  8.993666  9.015250 10.033906
 [8]        NA  8.339731  9.542757
> rowMax(tmp5,na.rm=TRUE)
 [1] 470.17792  80.47735  85.81365  86.24468  88.63035  84.65160  87.52602
 [8]        NA  82.87647  85.78998
> rowMin(tmp5,na.rm=TRUE)
 [1] 56.61960 55.35750 53.58444 56.60714 54.44791 53.04320 53.39706       NA
 [9] 56.33327 54.56758
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1] 113.22203  74.58032  68.94327  68.15167  71.04435  70.01136  68.55361
 [8]  67.54886  72.90359  71.08110  65.30218  75.64678  67.12380  77.06405
[15]  68.23683  69.80869  68.05080  73.65773  72.22801       NaN
> colSums(tmp5,na.rm=TRUE)
 [1] 1018.9983  671.2229  620.4894  613.3650  639.3991  630.1022  616.9825
 [8]  607.9397  656.1323  639.7299  587.7197  680.8210  604.1142  693.5764
[15]  614.1315  628.2782  612.4572  662.9196  650.0521    0.0000
> colVars(tmp5,na.rm=TRUE)
 [1] 18003.81056    65.67184    51.25209    56.11087    64.44899    94.77433
 [7]    63.63714    89.10759   103.24468   123.89116    72.15578   106.52806
[13]    65.02481    39.75061    46.60101    46.55563    74.77652    73.22438
[19]    64.44918          NA
> colSd(tmp5,na.rm=TRUE)
 [1] 134.178279   8.103816   7.159057   7.490719   8.028013   9.735211
 [7]   7.977289   9.439682  10.160939  11.130640   8.494456  10.321243
[13]   8.063796   6.304809   6.826493   6.823169   8.647342   8.557124
[19]   8.028025         NA
> colMax(tmp5,na.rm=TRUE)
 [1] 470.17792  84.32848  78.79930  78.56898  78.46193  81.67012  77.02329
 [8]  82.87647  88.18962  88.63035  79.83593  87.52602  80.39919  86.24468
[15]  79.16793  79.35155  80.69981  86.65628  82.22058      -Inf
> colMin(tmp5,na.rm=TRUE)
 [1] 55.89674 60.42521 59.32214 55.27241 53.58444 54.56758 55.35750 56.38474
 [9] 61.96535 57.08774 54.44791 60.24355 56.33327 67.83391 56.61960 59.31573
[17] 53.04320 60.36000 53.39706      Inf
> 
> 
> 
> 
> 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] 409.6817 134.1953 279.5009 411.7872 132.3454 240.6492 442.1429 131.3547
 [9] 291.3382 121.0262
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 409.6817 134.1953 279.5009 411.7872 132.3454 240.6492 442.1429 131.3547
 [9] 291.3382 121.0262
> 
> 
> 
> 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] -2.842171e-14  5.684342e-14 -8.526513e-14  0.000000e+00 -2.842171e-13
 [6] -1.278977e-13 -2.842171e-14  0.000000e+00 -5.684342e-14  1.421085e-14
[11] -5.684342e-14 -5.684342e-14 -2.842171e-14 -1.705303e-13  5.684342e-14
[16]  4.263256e-14  0.000000e+00  2.273737e-13  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)
+ }
4   1 
4   11 
1   8 
10   19 
8   3 
4   17 
5   5 
4   9 
1   8 
3   15 
6   15 
3   20 
8   2 
9   13 
10   16 
7   19 
7   14 
1   17 
6   11 
7   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.372599
> Min(tmp)
[1] -1.791987
> mean(tmp)
[1] 0.02801552
> Sum(tmp)
[1] 2.801552
> Var(tmp)
[1] 0.8279257
> 
> rowMeans(tmp)
[1] 0.02801552
> rowSums(tmp)
[1] 2.801552
> rowVars(tmp)
[1] 0.8279257
> rowSd(tmp)
[1] 0.9099042
> rowMax(tmp)
[1] 2.372599
> rowMin(tmp)
[1] -1.791987
> 
> colMeans(tmp)
  [1] -1.69318251  0.63366457  1.19332418  1.94498956 -0.88330686 -0.42870941
  [7]  1.22018607  0.43744382 -0.51757857 -0.22131686 -1.17308537 -0.23979549
 [13]  1.62108637  0.69650488 -0.22380953  0.62144670 -1.46486145  0.15689194
 [19]  0.06867894 -0.75316603 -0.51849987 -1.48017181  1.89985935 -0.16870039
 [25]  0.31385315  0.72210848 -1.02989598 -0.48194438  2.08744821 -0.44300675
 [31]  0.17418931 -0.32445273  0.06282487 -0.73993885  0.24978704 -0.31351289
 [37]  0.19048378  0.54203424 -0.74108886 -0.43858207  0.12058012  1.59497887
 [43]  0.54579848 -0.25341939 -0.74917593  0.80697076 -0.84865200 -0.57885683
 [49] -1.50954003 -0.78690910 -0.55079155  0.64639827  1.57478878  0.19869832
 [55] -0.11629073  0.88453071  0.45304862  0.03523322  2.37259901  1.07876878
 [61] -0.07046420  2.00944329 -0.18902130 -0.93463213  0.65107857  0.19534333
 [67] -0.02300911 -1.18032838  1.26989411  1.54352490  0.68274643  1.14363170
 [73]  1.58445995  0.10741367 -1.27322425 -0.10639006  0.32280411 -0.17143606
 [79] -1.30380820 -0.41705973  0.49996305  0.30863043  0.26444208 -0.47462991
 [85] -0.18806844 -0.17258956  0.10562253 -0.99250115 -0.56080438 -0.19242987
 [91] -0.47163236  0.32975864 -0.77036386 -0.52022637 -0.68985993 -1.79198696
 [97] -1.29991317  1.12892451 -0.74593244 -0.28277421
> colSums(tmp)
  [1] -1.69318251  0.63366457  1.19332418  1.94498956 -0.88330686 -0.42870941
  [7]  1.22018607  0.43744382 -0.51757857 -0.22131686 -1.17308537 -0.23979549
 [13]  1.62108637  0.69650488 -0.22380953  0.62144670 -1.46486145  0.15689194
 [19]  0.06867894 -0.75316603 -0.51849987 -1.48017181  1.89985935 -0.16870039
 [25]  0.31385315  0.72210848 -1.02989598 -0.48194438  2.08744821 -0.44300675
 [31]  0.17418931 -0.32445273  0.06282487 -0.73993885  0.24978704 -0.31351289
 [37]  0.19048378  0.54203424 -0.74108886 -0.43858207  0.12058012  1.59497887
 [43]  0.54579848 -0.25341939 -0.74917593  0.80697076 -0.84865200 -0.57885683
 [49] -1.50954003 -0.78690910 -0.55079155  0.64639827  1.57478878  0.19869832
 [55] -0.11629073  0.88453071  0.45304862  0.03523322  2.37259901  1.07876878
 [61] -0.07046420  2.00944329 -0.18902130 -0.93463213  0.65107857  0.19534333
 [67] -0.02300911 -1.18032838  1.26989411  1.54352490  0.68274643  1.14363170
 [73]  1.58445995  0.10741367 -1.27322425 -0.10639006  0.32280411 -0.17143606
 [79] -1.30380820 -0.41705973  0.49996305  0.30863043  0.26444208 -0.47462991
 [85] -0.18806844 -0.17258956  0.10562253 -0.99250115 -0.56080438 -0.19242987
 [91] -0.47163236  0.32975864 -0.77036386 -0.52022637 -0.68985993 -1.79198696
 [97] -1.29991317  1.12892451 -0.74593244 -0.28277421
> 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] -1.69318251  0.63366457  1.19332418  1.94498956 -0.88330686 -0.42870941
  [7]  1.22018607  0.43744382 -0.51757857 -0.22131686 -1.17308537 -0.23979549
 [13]  1.62108637  0.69650488 -0.22380953  0.62144670 -1.46486145  0.15689194
 [19]  0.06867894 -0.75316603 -0.51849987 -1.48017181  1.89985935 -0.16870039
 [25]  0.31385315  0.72210848 -1.02989598 -0.48194438  2.08744821 -0.44300675
 [31]  0.17418931 -0.32445273  0.06282487 -0.73993885  0.24978704 -0.31351289
 [37]  0.19048378  0.54203424 -0.74108886 -0.43858207  0.12058012  1.59497887
 [43]  0.54579848 -0.25341939 -0.74917593  0.80697076 -0.84865200 -0.57885683
 [49] -1.50954003 -0.78690910 -0.55079155  0.64639827  1.57478878  0.19869832
 [55] -0.11629073  0.88453071  0.45304862  0.03523322  2.37259901  1.07876878
 [61] -0.07046420  2.00944329 -0.18902130 -0.93463213  0.65107857  0.19534333
 [67] -0.02300911 -1.18032838  1.26989411  1.54352490  0.68274643  1.14363170
 [73]  1.58445995  0.10741367 -1.27322425 -0.10639006  0.32280411 -0.17143606
 [79] -1.30380820 -0.41705973  0.49996305  0.30863043  0.26444208 -0.47462991
 [85] -0.18806844 -0.17258956  0.10562253 -0.99250115 -0.56080438 -0.19242987
 [91] -0.47163236  0.32975864 -0.77036386 -0.52022637 -0.68985993 -1.79198696
 [97] -1.29991317  1.12892451 -0.74593244 -0.28277421
> colMin(tmp)
  [1] -1.69318251  0.63366457  1.19332418  1.94498956 -0.88330686 -0.42870941
  [7]  1.22018607  0.43744382 -0.51757857 -0.22131686 -1.17308537 -0.23979549
 [13]  1.62108637  0.69650488 -0.22380953  0.62144670 -1.46486145  0.15689194
 [19]  0.06867894 -0.75316603 -0.51849987 -1.48017181  1.89985935 -0.16870039
 [25]  0.31385315  0.72210848 -1.02989598 -0.48194438  2.08744821 -0.44300675
 [31]  0.17418931 -0.32445273  0.06282487 -0.73993885  0.24978704 -0.31351289
 [37]  0.19048378  0.54203424 -0.74108886 -0.43858207  0.12058012  1.59497887
 [43]  0.54579848 -0.25341939 -0.74917593  0.80697076 -0.84865200 -0.57885683
 [49] -1.50954003 -0.78690910 -0.55079155  0.64639827  1.57478878  0.19869832
 [55] -0.11629073  0.88453071  0.45304862  0.03523322  2.37259901  1.07876878
 [61] -0.07046420  2.00944329 -0.18902130 -0.93463213  0.65107857  0.19534333
 [67] -0.02300911 -1.18032838  1.26989411  1.54352490  0.68274643  1.14363170
 [73]  1.58445995  0.10741367 -1.27322425 -0.10639006  0.32280411 -0.17143606
 [79] -1.30380820 -0.41705973  0.49996305  0.30863043  0.26444208 -0.47462991
 [85] -0.18806844 -0.17258956  0.10562253 -0.99250115 -0.56080438 -0.19242987
 [91] -0.47163236  0.32975864 -0.77036386 -0.52022637 -0.68985993 -1.79198696
 [97] -1.29991317  1.12892451 -0.74593244 -0.28277421
> colMedians(tmp)
  [1] -1.69318251  0.63366457  1.19332418  1.94498956 -0.88330686 -0.42870941
  [7]  1.22018607  0.43744382 -0.51757857 -0.22131686 -1.17308537 -0.23979549
 [13]  1.62108637  0.69650488 -0.22380953  0.62144670 -1.46486145  0.15689194
 [19]  0.06867894 -0.75316603 -0.51849987 -1.48017181  1.89985935 -0.16870039
 [25]  0.31385315  0.72210848 -1.02989598 -0.48194438  2.08744821 -0.44300675
 [31]  0.17418931 -0.32445273  0.06282487 -0.73993885  0.24978704 -0.31351289
 [37]  0.19048378  0.54203424 -0.74108886 -0.43858207  0.12058012  1.59497887
 [43]  0.54579848 -0.25341939 -0.74917593  0.80697076 -0.84865200 -0.57885683
 [49] -1.50954003 -0.78690910 -0.55079155  0.64639827  1.57478878  0.19869832
 [55] -0.11629073  0.88453071  0.45304862  0.03523322  2.37259901  1.07876878
 [61] -0.07046420  2.00944329 -0.18902130 -0.93463213  0.65107857  0.19534333
 [67] -0.02300911 -1.18032838  1.26989411  1.54352490  0.68274643  1.14363170
 [73]  1.58445995  0.10741367 -1.27322425 -0.10639006  0.32280411 -0.17143606
 [79] -1.30380820 -0.41705973  0.49996305  0.30863043  0.26444208 -0.47462991
 [85] -0.18806844 -0.17258956  0.10562253 -0.99250115 -0.56080438 -0.19242987
 [91] -0.47163236  0.32975864 -0.77036386 -0.52022637 -0.68985993 -1.79198696
 [97] -1.29991317  1.12892451 -0.74593244 -0.28277421
> colRanges(tmp)
          [,1]      [,2]     [,3]    [,4]       [,5]       [,6]     [,7]
[1,] -1.693183 0.6336646 1.193324 1.94499 -0.8833069 -0.4287094 1.220186
[2,] -1.693183 0.6336646 1.193324 1.94499 -0.8833069 -0.4287094 1.220186
          [,8]       [,9]      [,10]     [,11]      [,12]    [,13]     [,14]
[1,] 0.4374438 -0.5175786 -0.2213169 -1.173085 -0.2397955 1.621086 0.6965049
[2,] 0.4374438 -0.5175786 -0.2213169 -1.173085 -0.2397955 1.621086 0.6965049
          [,15]     [,16]     [,17]     [,18]      [,19]     [,20]      [,21]
[1,] -0.2238095 0.6214467 -1.464861 0.1568919 0.06867894 -0.753166 -0.5184999
[2,] -0.2238095 0.6214467 -1.464861 0.1568919 0.06867894 -0.753166 -0.5184999
         [,22]    [,23]      [,24]     [,25]     [,26]     [,27]      [,28]
[1,] -1.480172 1.899859 -0.1687004 0.3138532 0.7221085 -1.029896 -0.4819444
[2,] -1.480172 1.899859 -0.1687004 0.3138532 0.7221085 -1.029896 -0.4819444
        [,29]      [,30]     [,31]      [,32]      [,33]      [,34]    [,35]
[1,] 2.087448 -0.4430067 0.1741893 -0.3244527 0.06282487 -0.7399389 0.249787
[2,] 2.087448 -0.4430067 0.1741893 -0.3244527 0.06282487 -0.7399389 0.249787
          [,36]     [,37]     [,38]      [,39]      [,40]     [,41]    [,42]
[1,] -0.3135129 0.1904838 0.5420342 -0.7410889 -0.4385821 0.1205801 1.594979
[2,] -0.3135129 0.1904838 0.5420342 -0.7410889 -0.4385821 0.1205801 1.594979
         [,43]      [,44]      [,45]     [,46]     [,47]      [,48]    [,49]
[1,] 0.5457985 -0.2534194 -0.7491759 0.8069708 -0.848652 -0.5788568 -1.50954
[2,] 0.5457985 -0.2534194 -0.7491759 0.8069708 -0.848652 -0.5788568 -1.50954
          [,50]      [,51]     [,52]    [,53]     [,54]      [,55]     [,56]
[1,] -0.7869091 -0.5507916 0.6463983 1.574789 0.1986983 -0.1162907 0.8845307
[2,] -0.7869091 -0.5507916 0.6463983 1.574789 0.1986983 -0.1162907 0.8845307
         [,57]      [,58]    [,59]    [,60]      [,61]    [,62]      [,63]
[1,] 0.4530486 0.03523322 2.372599 1.078769 -0.0704642 2.009443 -0.1890213
[2,] 0.4530486 0.03523322 2.372599 1.078769 -0.0704642 2.009443 -0.1890213
          [,64]     [,65]     [,66]       [,67]     [,68]    [,69]    [,70]
[1,] -0.9346321 0.6510786 0.1953433 -0.02300911 -1.180328 1.269894 1.543525
[2,] -0.9346321 0.6510786 0.1953433 -0.02300911 -1.180328 1.269894 1.543525
         [,71]    [,72]   [,73]     [,74]     [,75]      [,76]     [,77]
[1,] 0.6827464 1.143632 1.58446 0.1074137 -1.273224 -0.1063901 0.3228041
[2,] 0.6827464 1.143632 1.58446 0.1074137 -1.273224 -0.1063901 0.3228041
          [,78]     [,79]      [,80]     [,81]     [,82]     [,83]      [,84]
[1,] -0.1714361 -1.303808 -0.4170597 0.4999631 0.3086304 0.2644421 -0.4746299
[2,] -0.1714361 -1.303808 -0.4170597 0.4999631 0.3086304 0.2644421 -0.4746299
          [,85]      [,86]     [,87]      [,88]      [,89]      [,90]
[1,] -0.1880684 -0.1725896 0.1056225 -0.9925012 -0.5608044 -0.1924299
[2,] -0.1880684 -0.1725896 0.1056225 -0.9925012 -0.5608044 -0.1924299
          [,91]     [,92]      [,93]      [,94]      [,95]     [,96]     [,97]
[1,] -0.4716324 0.3297586 -0.7703639 -0.5202264 -0.6898599 -1.791987 -1.299913
[2,] -0.4716324 0.3297586 -0.7703639 -0.5202264 -0.6898599 -1.791987 -1.299913
        [,98]      [,99]     [,100]
[1,] 1.128925 -0.7459324 -0.2827742
[2,] 1.128925 -0.7459324 -0.2827742
> 
> 
> Max(tmp2)
[1] 2.135728
> Min(tmp2)
[1] -2.602343
> mean(tmp2)
[1] -0.1333854
> Sum(tmp2)
[1] -13.33854
> Var(tmp2)
[1] 1.10391
> 
> rowMeans(tmp2)
  [1] -1.28950047  1.46208415 -0.32618004 -0.88897557  1.57204690  1.98508162
  [7]  0.55742786  0.96795965  0.49193848  0.42107831 -0.99181985  1.70498452
 [13] -0.50186130  0.66547929 -0.42273749  0.93279800 -0.70365284  0.59349377
 [19] -0.99801501  0.66380263  0.10579871  2.13572784  0.16115791 -2.12753041
 [25] -1.64323669  0.20988708 -0.32991860 -0.33849137  1.14904976 -0.60149286
 [31]  0.50904630  1.59763922 -1.13664378  0.85106627 -0.98019619  0.05029064
 [37] -0.07199384  1.94844585  0.29640290  0.34158871 -2.09998048 -0.40758303
 [43]  1.04415651  0.42657988 -2.14748605 -1.62108742  0.13781713 -0.19306905
 [49] -1.56028482 -0.48846727 -0.55073130 -1.93285927 -1.05936548 -0.15930456
 [55] -0.97091736  1.03523387  0.61341566  1.93080583  0.55339580 -0.82483925
 [61]  0.15983492 -0.65111784 -1.01757992 -1.26318665  0.44947958  0.92528425
 [67] -0.66255468 -1.31211594 -0.49771638 -1.65581301  1.31269350  0.08386882
 [73]  1.44865677  1.07365460 -0.18334554 -0.09376984 -0.87473493  0.22833906
 [79] -1.05959298  0.26755229 -0.68950867 -0.94615501  0.16484942 -0.07222169
 [85]  1.08041069 -0.82671964 -0.31632655 -0.39459675 -0.24931369 -1.56231662
 [91]  1.69625733 -1.42370966 -0.72361212 -2.60234315 -0.90049592  0.83604856
 [97] -0.95847559 -0.41935415 -1.22248629 -0.23376982
> rowSums(tmp2)
  [1] -1.28950047  1.46208415 -0.32618004 -0.88897557  1.57204690  1.98508162
  [7]  0.55742786  0.96795965  0.49193848  0.42107831 -0.99181985  1.70498452
 [13] -0.50186130  0.66547929 -0.42273749  0.93279800 -0.70365284  0.59349377
 [19] -0.99801501  0.66380263  0.10579871  2.13572784  0.16115791 -2.12753041
 [25] -1.64323669  0.20988708 -0.32991860 -0.33849137  1.14904976 -0.60149286
 [31]  0.50904630  1.59763922 -1.13664378  0.85106627 -0.98019619  0.05029064
 [37] -0.07199384  1.94844585  0.29640290  0.34158871 -2.09998048 -0.40758303
 [43]  1.04415651  0.42657988 -2.14748605 -1.62108742  0.13781713 -0.19306905
 [49] -1.56028482 -0.48846727 -0.55073130 -1.93285927 -1.05936548 -0.15930456
 [55] -0.97091736  1.03523387  0.61341566  1.93080583  0.55339580 -0.82483925
 [61]  0.15983492 -0.65111784 -1.01757992 -1.26318665  0.44947958  0.92528425
 [67] -0.66255468 -1.31211594 -0.49771638 -1.65581301  1.31269350  0.08386882
 [73]  1.44865677  1.07365460 -0.18334554 -0.09376984 -0.87473493  0.22833906
 [79] -1.05959298  0.26755229 -0.68950867 -0.94615501  0.16484942 -0.07222169
 [85]  1.08041069 -0.82671964 -0.31632655 -0.39459675 -0.24931369 -1.56231662
 [91]  1.69625733 -1.42370966 -0.72361212 -2.60234315 -0.90049592  0.83604856
 [97] -0.95847559 -0.41935415 -1.22248629 -0.23376982
> 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] -1.28950047  1.46208415 -0.32618004 -0.88897557  1.57204690  1.98508162
  [7]  0.55742786  0.96795965  0.49193848  0.42107831 -0.99181985  1.70498452
 [13] -0.50186130  0.66547929 -0.42273749  0.93279800 -0.70365284  0.59349377
 [19] -0.99801501  0.66380263  0.10579871  2.13572784  0.16115791 -2.12753041
 [25] -1.64323669  0.20988708 -0.32991860 -0.33849137  1.14904976 -0.60149286
 [31]  0.50904630  1.59763922 -1.13664378  0.85106627 -0.98019619  0.05029064
 [37] -0.07199384  1.94844585  0.29640290  0.34158871 -2.09998048 -0.40758303
 [43]  1.04415651  0.42657988 -2.14748605 -1.62108742  0.13781713 -0.19306905
 [49] -1.56028482 -0.48846727 -0.55073130 -1.93285927 -1.05936548 -0.15930456
 [55] -0.97091736  1.03523387  0.61341566  1.93080583  0.55339580 -0.82483925
 [61]  0.15983492 -0.65111784 -1.01757992 -1.26318665  0.44947958  0.92528425
 [67] -0.66255468 -1.31211594 -0.49771638 -1.65581301  1.31269350  0.08386882
 [73]  1.44865677  1.07365460 -0.18334554 -0.09376984 -0.87473493  0.22833906
 [79] -1.05959298  0.26755229 -0.68950867 -0.94615501  0.16484942 -0.07222169
 [85]  1.08041069 -0.82671964 -0.31632655 -0.39459675 -0.24931369 -1.56231662
 [91]  1.69625733 -1.42370966 -0.72361212 -2.60234315 -0.90049592  0.83604856
 [97] -0.95847559 -0.41935415 -1.22248629 -0.23376982
> rowMin(tmp2)
  [1] -1.28950047  1.46208415 -0.32618004 -0.88897557  1.57204690  1.98508162
  [7]  0.55742786  0.96795965  0.49193848  0.42107831 -0.99181985  1.70498452
 [13] -0.50186130  0.66547929 -0.42273749  0.93279800 -0.70365284  0.59349377
 [19] -0.99801501  0.66380263  0.10579871  2.13572784  0.16115791 -2.12753041
 [25] -1.64323669  0.20988708 -0.32991860 -0.33849137  1.14904976 -0.60149286
 [31]  0.50904630  1.59763922 -1.13664378  0.85106627 -0.98019619  0.05029064
 [37] -0.07199384  1.94844585  0.29640290  0.34158871 -2.09998048 -0.40758303
 [43]  1.04415651  0.42657988 -2.14748605 -1.62108742  0.13781713 -0.19306905
 [49] -1.56028482 -0.48846727 -0.55073130 -1.93285927 -1.05936548 -0.15930456
 [55] -0.97091736  1.03523387  0.61341566  1.93080583  0.55339580 -0.82483925
 [61]  0.15983492 -0.65111784 -1.01757992 -1.26318665  0.44947958  0.92528425
 [67] -0.66255468 -1.31211594 -0.49771638 -1.65581301  1.31269350  0.08386882
 [73]  1.44865677  1.07365460 -0.18334554 -0.09376984 -0.87473493  0.22833906
 [79] -1.05959298  0.26755229 -0.68950867 -0.94615501  0.16484942 -0.07222169
 [85]  1.08041069 -0.82671964 -0.31632655 -0.39459675 -0.24931369 -1.56231662
 [91]  1.69625733 -1.42370966 -0.72361212 -2.60234315 -0.90049592  0.83604856
 [97] -0.95847559 -0.41935415 -1.22248629 -0.23376982
> 
> colMeans(tmp2)
[1] -0.1333854
> colSums(tmp2)
[1] -13.33854
> colVars(tmp2)
[1] 1.10391
> colSd(tmp2)
[1] 1.050671
> colMax(tmp2)
[1] 2.135728
> colMin(tmp2)
[1] -2.602343
> colMedians(tmp2)
[1] -0.2134194
> colRanges(tmp2)
          [,1]
[1,] -2.602343
[2,]  2.135728
> 
> 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]  5.2086195  0.1233954  2.1444779 -0.3577572 -1.1879531  2.2425230
 [7]  4.3690613 -1.1082750  3.6650895 -2.3656322
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -0.7990474
[2,] -0.1003805
[3,]  0.1910851
[4,]  0.8941573
[5,]  3.3199573
> 
> rowApply(tmp,sum)
 [1]  3.4103278  3.7354575 -3.4269892  0.4805160  0.1595597  0.5386671
 [7]  1.6695202  0.2324969  2.5917090  3.3422840
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]   10    6    6    7    9    6    4    7    1     5
 [2,]    6    1    7    9    4    7    6    8    2     3
 [3,]    1    4    5    4    7    4    7   10   10     1
 [4,]    9    3    8    1   10    1    1    3    9    10
 [5,]    5    8    9    8    3    2    2    4    5     2
 [6,]    3    7    1    5    1    9    8    9    6     8
 [7,]    2   10   10    6    2    3   10    6    4     9
 [8,]    4    2    2    3    8    8    9    2    8     4
 [9,]    8    9    3   10    6   10    5    5    3     6
[10,]    7    5    4    2    5    5    3    1    7     7
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1] -0.8508667  0.6134547  0.7115320  0.6198001  1.7322754  0.7628097
 [7]  4.2147550  1.6610630  3.7022433 -2.9347980 -3.0439751 -2.0510979
[13] -1.2344186 -2.6031812 -3.7179080 -1.4758413  1.2777073 -1.7631019
[19]  6.1671615  0.8768963
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -0.7149761
[2,] -0.3575600
[3,] -0.1461032
[4,]  0.1270536
[5,]  0.2407191
> 
> rowApply(tmp,sum)
[1] -6.8448654  2.0418849  0.6694487 -3.4935005 10.2915419
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]   15   10    7   14    2
[2,]    1   19   17   18   13
[3,]   13    3    8   17   16
[4,]    8    7    5   13   20
[5,]    9    8   19   16    7
> 
> 
> as.matrix(tmp)
           [,1]       [,2]        [,3]       [,4]         [,5]        [,6]
[1,] -0.1461032 -2.9992627 -0.31270509 -0.6154074 -0.604457344  1.45573156
[2,]  0.1270536  1.0395885 -0.91516094 -0.1137945 -0.006331851  0.02476823
[3,] -0.3575600  0.9679679 -0.04727495 -0.8877579  1.459688559 -0.91962537
[4,]  0.2407191  0.9844112  0.85037068  0.1424116  0.638039697 -0.90241737
[5,] -0.7149761  0.6207498  1.13630236  2.0943482  0.245336385  1.10435266
          [,7]       [,8]       [,9]      [,10]      [,11]      [,12]
[1,] 1.6295378 -0.4356938 1.31106179 -1.1159130 -0.5975014 -1.9026928
[2,] 0.9497405  0.2840379 0.90332753  0.1845423 -0.5914591  0.5039221
[3,] 0.9002775  0.2438767 0.11365361  0.4896146  0.4855361  0.3349341
[4,] 0.4817050  1.1511597 0.08499874 -3.0268122 -1.4883953 -0.7930753
[5,] 0.2534942  0.4176824 1.28920162  0.5337703 -0.8521554 -0.1941861
          [,13]      [,14]       [,15]       [,16]       [,17]        [,18]
[1,]  0.8818013 -1.2659745 -0.73480055 -0.72359110 -1.27752713  1.236089152
[2,]  0.7791987  0.8600556 -1.81774247 -0.98150023  1.39576844 -0.568450341
[3,] -1.7487315 -0.8688538 -1.76227198  0.95170968  0.72899266 -2.290129874
[4,] -1.7729941 -1.0465249  0.07690791 -0.79597580  0.05984147 -0.139257078
[5,]  0.6263070 -0.2818836  0.51999909  0.07351615  0.37063183 -0.001353754
          [,19]      [,20]
[1,] -0.1883536 -0.4391034
[2,]  0.7126527 -0.7283317
[3,]  1.6455612  1.2298413
[4,]  2.6006956 -0.8393092
[5,]  1.3966056  1.6537993
> 
> 
> is.BufferedMatrix(tmp)
[1] TRUE
> 
> as.BufferedMatrix(as.matrix(tmp))
BufferedMatrix object
Matrix size:  5 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  800  bytes.
> 
> 
> 
> subBufferedMatrix(tmp,1:5,1:5)
BufferedMatrix object
Matrix size:  5 5 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  655  bytes.
Disk usage :  200  bytes.
> subBufferedMatrix(tmp,,5:8)
BufferedMatrix object
Matrix size:  5 4 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  567  bytes.
Disk usage :  160  bytes.
> subBufferedMatrix(tmp,1:3,)
BufferedMatrix object
Matrix size:  3 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  480  bytes.
> 
> 
> rm(tmp)
> 
> 
> ###
> ### Testing colnames and rownames
> ###
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> 
> 
> colnames(tmp)
NULL
> rownames(tmp)
NULL
> 
> 
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> colnames(tmp)
 [1] "col1"  "col2"  "col3"  "col4"  "col5"  "col6"  "col7"  "col8"  "col9" 
[10] "col10" "col11" "col12" "col13" "col14" "col15" "col16" "col17" "col18"
[19] "col19" "col20"
> rownames(tmp)
[1] "row1" "row2" "row3" "row4" "row5"
> 
> 
> tmp["row1",]
          col1     col2      col3      col4       col5     col6       col7
row1 0.9507352 1.386511 -1.001736 0.9173754 -0.8106044 2.352788 -0.2934578
           col8       col9      col10     col11     col12    col13     col14
row1 -0.1709964 -0.5046047 -0.4200156 -1.457057 0.9842446 1.357992 0.7014387
          col15      col16    col17     col18      col19      col20
row1 -0.2008602 -0.6315457 -1.10563 0.1346235 -0.5549282 -0.5416043
> tmp[,"col10"]
          col10
row1 -0.4200156
row2  0.2830103
row3 -0.5432206
row4  1.7912821
row5  1.9520202
> tmp[c("row1","row5"),]
           col1       col2      col3      col4       col5     col6       col7
row1  0.9507352  1.3865112 -1.001736 0.9173754 -0.8106044 2.352788 -0.2934578
row5 -0.5148042 -0.1221256 -1.304552 1.1697084 -2.6017205 0.158355  0.9195873
           col8       col9      col10     col11     col12       col13
row1 -0.1709964 -0.5046047 -0.4200156 -1.457057 0.9842446  1.35799183
row5  2.0458068 -0.9682317  1.9520202  1.390221 0.3574368 -0.01783671
          col14      col15       col16     col17      col18       col19
row1  0.7014387 -0.2008602 -0.63154567 -1.105630  0.1346235 -0.55492816
row5 -0.8974877  1.5227938 -0.03080705  1.443021 -0.2346659 -0.02981248
          col20
row1 -0.5416043
row5 -0.4707721
> tmp[,c("col6","col20")]
           col6      col20
row1  2.3527881 -0.5416043
row2 -0.8597225 -0.8316347
row3  0.7386570 -1.0168695
row4  1.0507199  2.0098423
row5  0.1583550 -0.4707721
> tmp[c("row1","row5"),c("col6","col20")]
         col6      col20
row1 2.352788 -0.5416043
row5 0.158355 -0.4707721
> 
> 
> 
> 
> tmp["row1",] <- rnorm(20,mean=10)
> tmp[,"col10"] <- rnorm(5,mean=30)
> tmp[c("row1","row5"),] <- rnorm(40,mean=50)
> tmp[,c("col6","col20")] <- rnorm(10,mean=75)
> tmp[c("row1","row5"),c("col6","col20")]  <- rnorm(4,mean=105)
> 
> tmp["row1",]
         col1    col2     col3     col4     col5     col6     col7     col8
row1 50.29626 50.3749 49.64636 49.62063 49.79786 104.5072 50.00159 49.57053
         col9    col10   col11    col12    col13   col14    col15   col16
row1 50.61071 49.43131 51.0465 50.15503 50.77819 48.3258 49.06234 49.8581
        col17    col18    col19    col20
row1 51.19797 49.23453 50.33191 105.0613
> tmp[,"col10"]
        col10
row1 49.43131
row2 30.57336
row3 29.93357
row4 30.67325
row5 50.39218
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 50.29626 50.37490 49.64636 49.62063 49.79786 104.5072 50.00159 49.57053
row5 50.47457 48.29755 50.32919 50.04245 49.35619 103.6364 50.21686 49.68123
         col9    col10    col11    col12    col13    col14    col15    col16
row1 50.61071 49.43131 51.04650 50.15503 50.77819 48.32580 49.06234 49.85810
row5 49.95907 50.39218 49.39059 50.48317 50.39393 50.02355 49.62589 50.69554
        col17    col18    col19    col20
row1 51.19797 49.23453 50.33191 105.0613
row5 49.33362 47.88391 49.67871 105.9829
> tmp[,c("col6","col20")]
          col6     col20
row1 104.50719 105.06130
row2  74.77810  74.90371
row3  74.37624  74.35247
row4  72.03919  76.01651
row5 103.63635 105.98294
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 104.5072 105.0613
row5 103.6364 105.9829
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 104.5072 105.0613
row5 103.6364 105.9829
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
          col13
[1,] -0.4491687
[2,] -0.7132112
[3,] -0.1309632
[4,]  0.2603560
[5,]  1.3817597
> tmp[,c("col17","col7")]
            col17       col7
[1,]  0.197011152  0.6315947
[2,]  1.022942396  0.6482327
[3,] -0.758927453  1.8504448
[4,]  0.921019242 -1.4391705
[5,]  0.007520158  0.7145922
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
           col6       col20
[1,] -1.5708709  0.41683756
[2,]  0.2958344  0.04346097
[3,] -1.7138605  0.84606562
[4,]  0.8882867  0.23598608
[5,] -0.2869831 -0.14886048
> subBufferedMatrix(tmp,1,c("col6"))[,1]
          col1
[1,] -1.570871
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
           col6
[1,] -1.5708709
[2,]  0.2958344
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> 
> 
> 
> subBufferedMatrix(tmp,c("row3","row1"),)[,1:20]
           [,1]        [,2]       [,3]        [,4]       [,5]        [,6]
row3 -1.7773452 -0.03230344 -0.2125116  0.07780616  0.1192804 0.008912024
row1 -0.9330395 -0.25120889 -0.7796091 -2.51216132 -0.1920759 1.847502467
           [,7]       [,8]       [,9]     [,10]     [,11]      [,12]     [,13]
row3 -0.1609941  0.3599991 -0.3911584 0.7659962  1.272779  0.1655737  1.239078
row1 -0.3076629 -2.0760098  0.5108368 0.5798692 -0.689367 -0.4196384 -1.104770
         [,14]      [,15]     [,16]       [,17]       [,18]     [,19]
row3 0.2882244 -0.9780907 0.7296131  0.02380583 -1.38462432 1.9846982
row1 1.1281815 -0.0841039 0.1882590 -1.11530816 -0.06892719 0.5194192
          [,20]
row3 -1.7080264
row1  0.6411115
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
           [,1]      [,2]      [,3]       [,4]      [,5]     [,6]      [,7]
row2 -0.8487953 0.6418153 0.6478828 -0.1433803 -1.148977 0.692201 -0.103259
           [,8]       [,9]       [,10]
row2 -0.6157237 -0.2045247 -0.06958103
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
          [,1]       [,2]      [,3]     [,4]      [,5]     [,6]       [,7]
row5 -1.421555 -0.4573241 0.7725091 -1.71834 0.8277206 1.557399 -0.4651406
           [,8]       [,9]     [,10]    [,11]     [,12]     [,13]     [,14]
row5 -0.9159873 0.03080285 0.7188937 2.166913 0.6751662 -1.110979 0.3004943
         [,15]     [,16]     [,17]     [,18]    [,19]     [,20]
row5 -0.400898 -1.388381 0.9793416 0.3368133 1.381036 0.2053646
> 
> 
> 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: 0x6000004b0480>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM11c377d2e6c03"
 [2] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM11c3772b57929"
 [3] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM11c376825ad94"
 [4] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM11c371a704f7" 
 [5] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM11c377c36f4f9"
 [6] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM11c377c0d4724"
 [7] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM11c374bb9cc1c"
 [8] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM11c371307691b"
 [9] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM11c374b85755f"
[10] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM11c3726dcd6b5"
[11] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM11c376c941901"
[12] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM11c376ef5c857"
[13] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM11c374a3400aa"
[14] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM11c371c17bef5"
[15] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM11c375af9d53b"
> 
> 
> ### 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: 0x6000004bc000>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x6000004bc000>
Warning message:
In dir.create(new.directory) :
  '/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x6000004bc000>
> rowMedians(tmp)
  [1] -0.555432705 -0.351213331 -0.099585994 -0.086944881  0.404572800
  [6] -0.310142103  0.176007190  0.232702602  0.251457471 -0.282035114
 [11] -0.279408574  0.043234228 -0.285920138  0.292242505 -0.088345230
 [16]  0.058270068  0.333319554 -0.717664021 -0.078309795 -0.324681791
 [21]  0.120151293 -0.167892419 -0.255844506 -0.428541388  0.151639767
 [26] -0.034778629 -0.100718762  0.603489719 -0.084268321  0.464882632
 [31] -0.041761232  0.209310673  0.055095878  0.393283338 -0.573134840
 [36] -0.177073250 -0.203169767  0.596996345 -0.722119796 -0.233761453
 [41] -0.235078852  0.016008409 -0.536324069  0.196689136 -0.302416016
 [46] -0.046073563 -0.036658472 -0.008328290  0.077947104  0.167202561
 [51] -0.008413989 -0.474363266  0.041547901 -0.029058434  0.370974152
 [56] -0.401202504 -0.366303525  0.508985835 -0.814133277 -0.407630699
 [61] -0.087959709 -0.019274900  0.115777131  0.390355622  0.022734169
 [66] -0.347239004 -0.164273738 -0.039906674  0.074909158 -0.369063714
 [71] -0.765889943 -0.058420376  0.113343380  0.012614149  0.164697370
 [76]  0.073124495  0.103641726  0.222760063  0.086276800  0.448328850
 [81] -0.581327176 -0.111128872 -0.283930488 -0.142697362  0.153694838
 [86] -0.256089172 -0.125473413 -0.328725937 -0.402900155 -0.148268041
 [91] -0.255138102  0.096617586  0.087007973  0.115770037 -0.360461610
 [96]  0.255705275 -0.034867681  0.323179098 -0.121510339 -0.029636666
[101]  0.037094502  0.201296390 -0.404643947  0.157276964 -0.219216481
[106]  0.024669126 -0.205208478  0.059301765 -0.267314378 -0.513032781
[111] -0.013610208  0.028959707 -0.017884182  0.079940114 -0.054129697
[116] -0.038935825  0.325960329  0.558921040 -0.086033312 -0.121654800
[121] -0.401890701 -0.390617930  0.126950788 -0.468845196 -0.315769778
[126]  0.484151666 -0.089318362 -0.442522458  0.538855544  0.544200436
[131]  0.212916727 -0.348750150 -0.008717494  0.006709040 -0.656315833
[136]  0.562704348 -0.147347884  0.168056149  0.061815978 -0.100801410
[141]  0.178869110  0.093986652  0.901862514 -0.036619392 -0.261619726
[146]  0.140294045 -0.523008602 -0.007640090  0.187027580 -0.437386875
[151]  0.054201793 -0.107848460 -0.355717331  0.189827198  0.150397915
[156] -0.174729326 -0.203114493 -0.187140657 -0.099332150  0.323698749
[161]  0.363899147  0.309150365  0.172364357  0.216382618  0.329838260
[166]  0.321527183  0.476757531  0.017469919 -0.064727946 -0.248453775
[171] -0.169521528 -0.085265378 -0.171684792  0.324701304 -0.569169336
[176] -0.919677842 -0.284527040  0.338320693 -0.089246217 -0.391242914
[181]  0.071533487  0.142116767  0.260886894  0.084256402  0.135563932
[186]  0.005365919 -0.056639303  0.180505394  0.368030646  0.303500727
[191] -0.489336028 -0.225730940 -0.465441398 -0.640853659  0.056811370
[196]  0.149566599 -0.052970555  0.226035518  0.474141940  0.079825679
[201] -0.044040441  0.132724262 -0.205637005 -0.537375422  0.419573024
[206]  0.073331143 -0.257514954  0.737489378  0.109959150 -0.043459678
[211] -0.394534840  0.149011240 -0.218063300  0.292480534 -0.445320326
[216] -0.031308242  0.172631166  0.565581551 -0.145333847 -0.172098474
[221]  0.386479811 -0.246974589 -0.108885573 -0.862267264 -0.558077717
[226]  1.146126227 -0.091339065  0.013074860 -0.720084269 -0.028994897
> 
> proc.time()
   user  system elapsed 
  0.642   3.231   4.261 

BufferedMatrix.Rcheck/tests/rawCalltesting.Rout


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

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

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

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

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

Attaching package: 'BufferedMatrix'

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

    colMeans, colSums, rowMeans, rowSums

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

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

<pointer: 0x6000010f8240>
> .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: 0x6000010f8240>
> .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: 0x6000010f8240>
> .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: 0x6000010f8240>
> 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: 0x6000010f42a0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000010f42a0>
> .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: 0x6000010f42a0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000010f42a0>
> .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: 0x6000010f42a0>
> 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: 0x6000010f4420>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000010f4420>
> .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: 0x6000010f4420>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x6000010f4420>
> .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: 0x6000010f4420>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x6000010f4420>
> .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: 0x6000010f4420>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x6000010f4420>
> .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: 0x6000010f4420>
> 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: 0x6000010f4600>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x6000010f4600>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000010f4600>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000010f4600>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile11ee72fa5d2e"  "BufferedMatrixFile11ee7545e6bd8"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile11ee72fa5d2e"  "BufferedMatrixFile11ee7545e6bd8"
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000010f48a0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000010f48a0>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x6000010f48a0>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x6000010f48a0>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x6000010f48a0>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x6000010f48a0>
> .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: 0x6000010f4a80>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000010f4a80>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x6000010f4a80>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x6000010f4a80>
> 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: 0x6000010f4c60>
> .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: 0x6000010f4c60>
> rm(P)
> 
> proc.time()
   user  system elapsed 
  0.112   0.039   0.151 

BufferedMatrix.Rcheck/tests/Rcodetesting.Rout


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

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

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

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

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

Attaching package: 'BufferedMatrix'

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

    colMeans, colSums, rowMeans, rowSums

> 
> Temp <- createBufferedMatrix(100)
> dim(Temp)
[1] 100   0
> buffer.dim(Temp)
[1] 1 1
> 
> 
> proc.time()
   user  system elapsed 
  0.117   0.027   0.143 

Example timings