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

This page was generated on 2026-04-08 11:35 -0400 (Wed, 08 Apr 2026).

HostnameOSArch (*)R versionInstalled pkgs
nebbiolo1Linux (Ubuntu 24.04.3 LTS)x86_644.6.0 alpha (2026-04-05 r89794) 4852
kjohnson3macOS 13.7.7 Venturaarm64R Under development (unstable) (2026-03-26 r89717) -- "Unsuffered Consequences" 4543
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 258/2381HostnameOS / ArchINSTALLBUILDCHECKBUILD BIN
BufferedMatrix 1.75.0  (landing page)
Ben Bolstad
Snapshot Date: 2026-04-07 13:40 -0400 (Tue, 07 Apr 2026)
git_url: https://git.bioconductor.org/packages/BufferedMatrix
git_branch: devel
git_last_commit: ecdbf23
git_last_commit_date: 2025-10-29 09:58:55 -0400 (Wed, 29 Oct 2025)
nebbiolo1Linux (Ubuntu 24.04.3 LTS) / x86_64  OK    OK    OK  UNNEEDED, same version is already published
kjohnson3macOS 13.7.7 Ventura / arm64  OK    OK    WARNINGS    OK  UNNEEDED, same version is already published
See other builds for BufferedMatrix in R Universe.


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.75.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.75.0.tar.gz
StartedAt: 2026-04-07 18:41:37 -0400 (Tue, 07 Apr 2026)
EndedAt: 2026-04-07 18:41:57 -0400 (Tue, 07 Apr 2026)
EllapsedTime: 20.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.75.0.tar.gz
###
##############################################################################
##############################################################################


* using log directory ‘/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck’
* using R Under development (unstable) (2026-03-26 r89717)
* using platform: aarch64-apple-darwin23
* R was compiled by
    Apple clang version 17.0.0 (clang-1700.3.19.1)
    GNU Fortran (GCC) 14.2.0
* running under: macOS Tahoe 26.3.1
* using session charset: UTF-8
* current time: 2026-04-07 22:41:37 UTC
* using option ‘--no-vignettes’
* checking for file ‘BufferedMatrix/DESCRIPTION’ ... OK
* this is package ‘BufferedMatrix’ version ‘1.75.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.23-bioc/meat/BufferedMatrix.Rcheck/00install.out’ for details.
* used C compiler: ‘Apple clang version 17.0.0 (clang-1700.6.4.2)’
* used SDK: ‘MacOSX26.2.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 ... INFO
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, 1 NOTE
See
  ‘/Users/biocbuild/bbs-3.23-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.6/Resources/library’
* installing *source* package ‘BufferedMatrix’ ...
** this is package ‘BufferedMatrix’ version ‘1.75.0’
** using staged installation
** libs
using C compiler: ‘Apple clang version 17.0.0 (clang-1700.6.4.2)’
using SDK: ‘MacOSX26.2.sdk’
clang -arch arm64 -std=gnu23 -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=gnu23 -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]
 1580 |   if (!(Matrix->readonly) & setting){
      |       ^                   ~
doubleBufferedMatrix.c:1580:7: note: add parentheses after the '!' to evaluate the bitwise operator first
 1580 |   if (!(Matrix->readonly) & setting){
      |       ^                            
      |        (                           )
doubleBufferedMatrix.c:1580:7: note: add parentheses around left hand side expression to silence this warning
 1580 |   if (!(Matrix->readonly) & setting){
      |       ^
      |       (                  )
doubleBufferedMatrix.c:3327:12: warning: unused function 'sort_double' [-Wunused-function]
 3327 | static int sort_double(const double *a1,const double *a2){
      |            ^~~~~~~~~~~
2 warnings generated.
clang -arch arm64 -std=gnu23 -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=gnu23 -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=gnu23 -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.6/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 Under development (unstable) (2026-03-26 r89717) -- "Unsuffered Consequences"
Copyright (C) 2026 The R Foundation for Statistical Computing
Platform: aarch64-apple-darwin23

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.119   0.046   0.160 

BufferedMatrix.Rcheck/tests/objectTesting.Rout


R Under development (unstable) (2026-03-26 r89717) -- "Unsuffered Consequences"
Copyright (C) 2026 The R Foundation for Statistical Computing
Platform: aarch64-apple-darwin23

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.23-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 484129 25.9    1067215   57         NA   632020 33.8
Vcells 896948  6.9    8388608   64     196608  2112090 16.2
> 
> 
> 
> 
> ##
> ## checking reads
> ##
> 
> tmp2 <- createBufferedMatrix(10,20)
> 
> test.sample <- rnorm(10*20)
> 
> tmp2[1:10,1:20] <- test.sample
> 
> test.matrix <- matrix(test.sample,10,20)
> 
> ## testing reads
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   which.col <- sample(1:20,1)
+   if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> date()
[1] "Tue Apr  7 18:41:47 2026"
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> date()
[1] "Tue Apr  7 18:41:48 2026"
> 
> 
> 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: 0x10380f9a0>
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   which.col <- sample(1:20,1)
+   if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,5,replace=TRUE)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> date()
[1] "Tue Apr  7 18:41:49 2026"
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col <- sample(1:20,5,replace=TRUE)
+   if (!all(tmp2[which.row,which.col] == test.matrix[which.row,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> date()
[1] "Tue Apr  7 18:41:49 2026"
> 
> ColMode(tmp2)
<pointer: 0x10380f9a0>
> 
> 
> 
> ### Now testing assignments
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+ 
+   new.data <- rnorm(20)
+   tmp2[which.row,] <- new.data
+   test.matrix[which.row,] <- new.data
+   if (rep > 1){
+     if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+   
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   new.data <- rnorm(10)
+   tmp2[,which.col] <- new.data
+   test.matrix[,which.col]<- new.data
+ 
+   if (rep > 1){
+     if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.col <- which.col
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,5,replace=TRUE)
+   new.data <- matrix(rnorm(50),5,10)
+   tmp2[,which.col] <- new.data
+   test.matrix[,which.col]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.col <- which.col
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   new.data <- matrix(rnorm(50),5,10)
+   tmp2[which.row,] <- new.data
+   test.matrix[which.row,]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col  <- sample(1:20,5,replace=TRUE)
+   new.data <- matrix(rnorm(25),5,5)
+   tmp2[which.row,which.col] <- new.data
+   test.matrix[which.row,which.col]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[prev.row,prev.col] == test.matrix[prev.row,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+   prev.col <- which.col
+ }
> 
> 
> 
> 
> ###
> ###
> ### testing some more functions
> ###
> 
> 
> 
> ## duplication function
> tmp5 <- duplicate(tmp2)
> 
> # making sure really did copy everything.
> tmp5[1,1] <- tmp5[1,1] +100.00
> 
> if (tmp5[1,1] == tmp2[1,1]){
+   stop("Problem with duplication")
+ }
> 
> 
> 
> 
> ### testing elementwise applying of functions
> 
> tmp5[1:4,1:4]
            [,1]       [,2]       [,3]       [,4]
[1,] 99.68756167 -0.7872243  0.5706813 -2.1096992
[2,] -1.19754733  1.7816989  0.4304648  0.7951622
[3,]  0.02238946  0.2518693 -0.4997537 -0.3594433
[4,] -0.14512066  1.4194972 -0.1120404 -0.3148488
> ewApply(tmp5,abs)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.23-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,] 99.68756167 0.7872243 0.5706813 2.1096992
[2,]  1.19754733 1.7816989 0.4304648 0.7951622
[3,]  0.02238946 0.2518693 0.4997537 0.3594433
[4,]  0.14512066 1.4194972 0.1120404 0.3148488
> ewApply(tmp5,sqrt)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.23-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,] 9.9843659 0.8872566 0.7554345 1.4524804
[2,] 1.0943251 1.3348029 0.6560981 0.8917187
[3,] 0.1496311 0.5018659 0.7069326 0.5995359
[4,] 0.3809471 1.1914265 0.3347243 0.5611139
> 
> 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.23-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,] 224.53122 34.65979 33.12503 41.63450
[2,]  37.14080 40.12973 31.99145 34.71235
[3,]  26.51870 30.27053 32.56908 31.35480
[4,]  28.95459 38.33376 28.45928 30.92599
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0xaef5f8000>
> exp(tmp5)
<pointer: 0xaef5f8000>
> log(tmp5,2)
<pointer: 0xaef5f8000>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 467.3323
> Min(tmp5)
[1] 52.58314
> mean(tmp5)
[1] 73.05701
> Sum(tmp5)
[1] 14611.4
> Var(tmp5)
[1] 855.0762
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 88.74845 71.76334 72.37119 71.96588 75.05785 69.75809 70.25144 67.69820
 [9] 68.50138 74.45428
> rowSums(tmp5)
 [1] 1774.969 1435.267 1447.424 1439.318 1501.157 1395.162 1405.029 1353.964
 [9] 1370.028 1489.086
> rowVars(tmp5)
 [1] 8000.13528   53.00931   67.39082   87.23640   60.48581   33.45609
 [7]  108.24945   91.24707   78.62682   35.18561
> rowSd(tmp5)
 [1] 89.443475  7.280749  8.209191  9.340043  7.777262  5.784124 10.404300
 [8]  9.552333  8.867177  5.931746
> rowMax(tmp5)
 [1] 467.33232  87.96036  85.96900  86.72452  98.50582  78.23404  94.69416
 [8]  86.72538  85.30797  83.50276
> rowMin(tmp5)
 [1] 56.03473 61.12498 55.19520 55.80191 64.94703 57.10088 54.05723 53.02639
 [9] 52.58314 58.73086
> 
> colMeans(tmp5)
 [1] 104.83440  71.97127  68.02282  70.34981  72.04601  72.33923  72.06652
 [8]  70.24638  74.29220  71.96214  71.29672  72.34146  70.18488  72.04985
[15]  71.79517  71.31301  70.90908  71.38616  72.34960  69.38346
> colSums(tmp5)
 [1] 1048.3440  719.7127  680.2282  703.4981  720.4601  723.3923  720.6652
 [8]  702.4638  742.9220  719.6214  712.9672  723.4146  701.8488  720.4985
[15]  717.9517  713.1301  709.0908  713.8616  723.4960  693.8346
> colVars(tmp5)
 [1] 16287.36782    54.71459    72.51762    51.38842    79.06214   116.40937
 [7]    51.33658    81.04074    56.47577    40.10038    70.84632    79.63519
[13]   137.22285    23.11837   101.95056   100.43703    52.73268    87.70148
[19]    99.80298    45.37415
> colSd(tmp5)
 [1] 127.621972   7.396931   8.515728   7.168572   8.891689  10.789317
 [7]   7.164955   9.002263   7.515036   6.332486   8.417026   8.923855
[13]  11.714216   4.808157  10.097057  10.021828   7.261727   9.364907
[19]   9.990144   6.736033
> colMax(tmp5)
 [1] 467.33232  83.52477  85.30797  86.65676  86.72538  98.50582  85.21647
 [8]  83.50276  86.72452  82.29170  83.34520  87.96036  94.69416  76.43812
[15]  81.85952  85.96900  79.50111  84.41015  86.20203  81.25779
> colMin(tmp5)
 [1] 52.58314 60.95431 54.05723 60.59442 57.58462 56.84285 57.19002 57.10088
 [9] 64.95704 60.57050 57.84404 55.51382 57.67616 61.52560 53.02639 56.95173
[17] 58.73086 55.11940 59.79841 55.80191
> 
> 
> ### 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]       NA 71.76334 72.37119 71.96588 75.05785 69.75809 70.25144 67.69820
 [9] 68.50138 74.45428
> rowSums(tmp5)
 [1]       NA 1435.267 1447.424 1439.318 1501.157 1395.162 1405.029 1353.964
 [9] 1370.028 1489.086
> rowVars(tmp5)
 [1] 8423.98300   53.00931   67.39082   87.23640   60.48581   33.45609
 [7]  108.24945   91.24707   78.62682   35.18561
> rowSd(tmp5)
 [1] 91.782259  7.280749  8.209191  9.340043  7.777262  5.784124 10.404300
 [8]  9.552333  8.867177  5.931746
> rowMax(tmp5)
 [1]       NA 87.96036 85.96900 86.72452 98.50582 78.23404 94.69416 86.72538
 [9] 85.30797 83.50276
> rowMin(tmp5)
 [1]       NA 61.12498 55.19520 55.80191 64.94703 57.10088 54.05723 53.02639
 [9] 52.58314 58.73086
> 
> colMeans(tmp5)
 [1] 104.83440  71.97127  68.02282  70.34981  72.04601  72.33923  72.06652
 [8]        NA  74.29220  71.96214  71.29672  72.34146  70.18488  72.04985
[15]  71.79517  71.31301  70.90908  71.38616  72.34960  69.38346
> colSums(tmp5)
 [1] 1048.3440  719.7127  680.2282  703.4981  720.4601  723.3923  720.6652
 [8]        NA  742.9220  719.6214  712.9672  723.4146  701.8488  720.4985
[15]  717.9517  713.1301  709.0908  713.8616  723.4960  693.8346
> colVars(tmp5)
 [1] 16287.36782    54.71459    72.51762    51.38842    79.06214   116.40937
 [7]    51.33658          NA    56.47577    40.10038    70.84632    79.63519
[13]   137.22285    23.11837   101.95056   100.43703    52.73268    87.70148
[19]    99.80298    45.37415
> colSd(tmp5)
 [1] 127.621972   7.396931   8.515728   7.168572   8.891689  10.789317
 [7]   7.164955         NA   7.515036   6.332486   8.417026   8.923855
[13]  11.714216   4.808157  10.097057  10.021828   7.261727   9.364907
[19]   9.990144   6.736033
> colMax(tmp5)
 [1] 467.33232  83.52477  85.30797  86.65676  86.72538  98.50582  85.21647
 [8]        NA  86.72452  82.29170  83.34520  87.96036  94.69416  76.43812
[15]  81.85952  85.96900  79.50111  84.41015  86.20203  81.25779
> colMin(tmp5)
 [1] 52.58314 60.95431 54.05723 60.59442 57.58462 56.84285 57.19002       NA
 [9] 64.95704 60.57050 57.84404 55.51382 57.67616 61.52560 53.02639 56.95173
[17] 58.73086 55.11940 59.79841 55.80191
> 
> Max(tmp5,na.rm=TRUE)
[1] 467.3323
> Min(tmp5,na.rm=TRUE)
[1] 52.58314
> mean(tmp5,na.rm=TRUE)
[1] 73.07248
> Sum(tmp5,na.rm=TRUE)
[1] 14541.42
> Var(tmp5,na.rm=TRUE)
[1] 859.3466
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 89.73637 71.76334 72.37119 71.96588 75.05785 69.75809 70.25144 67.69820
 [9] 68.50138 74.45428
> rowSums(tmp5,na.rm=TRUE)
 [1] 1704.991 1435.267 1447.424 1439.318 1501.157 1395.162 1405.029 1353.964
 [9] 1370.028 1489.086
> rowVars(tmp5,na.rm=TRUE)
 [1] 8423.98300   53.00931   67.39082   87.23640   60.48581   33.45609
 [7]  108.24945   91.24707   78.62682   35.18561
> rowSd(tmp5,na.rm=TRUE)
 [1] 91.782259  7.280749  8.209191  9.340043  7.777262  5.784124 10.404300
 [8]  9.552333  8.867177  5.931746
> rowMax(tmp5,na.rm=TRUE)
 [1] 467.33232  87.96036  85.96900  86.72452  98.50582  78.23404  94.69416
 [8]  86.72538  85.30797  83.50276
> rowMin(tmp5,na.rm=TRUE)
 [1] 56.03473 61.12498 55.19520 55.80191 64.94703 57.10088 54.05723 53.02639
 [9] 52.58314 58.73086
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 104.83440  71.97127  68.02282  70.34981  72.04601  72.33923  72.06652
 [8]  70.27620  74.29220  71.96214  71.29672  72.34146  70.18488  72.04985
[15]  71.79517  71.31301  70.90908  71.38616  72.34960  69.38346
> colSums(tmp5,na.rm=TRUE)
 [1] 1048.3440  719.7127  680.2282  703.4981  720.4601  723.3923  720.6652
 [8]  632.4858  742.9220  719.6214  712.9672  723.4146  701.8488  720.4985
[15]  717.9517  713.1301  709.0908  713.8616  723.4960  693.8346
> colVars(tmp5,na.rm=TRUE)
 [1] 16287.36782    54.71459    72.51762    51.38842    79.06214   116.40937
 [7]    51.33658    91.16082    56.47577    40.10038    70.84632    79.63519
[13]   137.22285    23.11837   101.95056   100.43703    52.73268    87.70148
[19]    99.80298    45.37415
> colSd(tmp5,na.rm=TRUE)
 [1] 127.621972   7.396931   8.515728   7.168572   8.891689  10.789317
 [7]   7.164955   9.547818   7.515036   6.332486   8.417026   8.923855
[13]  11.714216   4.808157  10.097057  10.021828   7.261727   9.364907
[19]   9.990144   6.736033
> colMax(tmp5,na.rm=TRUE)
 [1] 467.33232  83.52477  85.30797  86.65676  86.72538  98.50582  85.21647
 [8]  83.50276  86.72452  82.29170  83.34520  87.96036  94.69416  76.43812
[15]  81.85952  85.96900  79.50111  84.41015  86.20203  81.25779
> colMin(tmp5,na.rm=TRUE)
 [1] 52.58314 60.95431 54.05723 60.59442 57.58462 56.84285 57.19002 57.10088
 [9] 64.95704 60.57050 57.84404 55.51382 57.67616 61.52560 53.02639 56.95173
[17] 58.73086 55.11940 59.79841 55.80191
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1]      NaN 71.76334 72.37119 71.96588 75.05785 69.75809 70.25144 67.69820
 [9] 68.50138 74.45428
> rowSums(tmp5,na.rm=TRUE)
 [1]    0.000 1435.267 1447.424 1439.318 1501.157 1395.162 1405.029 1353.964
 [9] 1370.028 1489.086
> rowVars(tmp5,na.rm=TRUE)
 [1]        NA  53.00931  67.39082  87.23640  60.48581  33.45609 108.24945
 [8]  91.24707  78.62682  35.18561
> rowSd(tmp5,na.rm=TRUE)
 [1]        NA  7.280749  8.209191  9.340043  7.777262  5.784124 10.404300
 [8]  9.552333  8.867177  5.931746
> rowMax(tmp5,na.rm=TRUE)
 [1]       NA 87.96036 85.96900 86.72452 98.50582 78.23404 94.69416 86.72538
 [9] 85.30797 83.50276
> rowMin(tmp5,na.rm=TRUE)
 [1]       NA 61.12498 55.19520 55.80191 64.94703 57.10088 54.05723 53.02639
 [9] 52.58314 58.73086
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1] 64.55685 71.95254 67.92032 68.53793 73.18924 72.43780 71.91819      NaN
 [9] 75.32944 72.04038 72.79146 72.85334 71.57474 71.56226 73.54634 72.90871
[17] 70.40673 71.20507 72.26844 68.99433
> colSums(tmp5,na.rm=TRUE)
 [1] 581.0116 647.5729 611.2828 616.8414 658.7032 651.9402 647.2637   0.0000
 [9] 677.9650 648.3634 655.1231 655.6800 644.1727 644.0604 661.9170 656.1784
[17] 633.6606 640.8456 650.4159 620.9489
> colVars(tmp5,na.rm=TRUE)
 [1]  72.62999  61.54997  81.46411  20.87911  74.24151 130.85123  57.50614
 [8]        NA  51.43174  45.04405  54.56675  86.64192 132.64401  23.33360
[15]  80.19552  84.34633  56.48523  98.29524 112.20424  49.34239
> colSd(tmp5,na.rm=TRUE)
 [1]  8.522323  7.845379  9.025747  4.569366  8.616351 11.439022  7.583280
 [8]        NA  7.171592  6.711486  7.386931  9.308164 11.517118  4.830487
[15]  8.955195  9.184026  7.515666  9.914396 10.592650  7.024414
> colMax(tmp5,na.rm=TRUE)
 [1] 77.30370 83.52477 85.30797 74.28637 86.72538 98.50582 85.21647     -Inf
 [9] 86.72452 82.29170 83.34520 87.96036 94.69416 76.42286 81.85952 85.96900
[17] 79.50111 84.41015 86.20203 81.25779
> colMin(tmp5,na.rm=TRUE)
 [1] 52.58314 60.95431 54.05723 60.59442 57.58462 56.84285 57.19002      Inf
 [9] 65.53231 60.57050 60.68764 55.51382 60.84648 61.52560 53.02639 58.42603
[17] 58.73086 55.11940 59.79841 55.80191
> 
> 
> 
> 
> 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] 216.3285 186.8437 235.8411 115.8274 191.2737 484.8815 203.0623 137.5311
 [9] 245.3497 215.6739
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 216.3285 186.8437 235.8411 115.8274 191.2737 484.8815 203.0623 137.5311
 [9] 245.3497 215.6739
> 
> 
> 
> 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] -8.526513e-14  4.263256e-14 -2.842171e-14 -5.684342e-14 -2.842171e-14
 [6]  1.136868e-13 -8.526513e-14  0.000000e+00  1.421085e-13  2.842171e-14
[11] -2.842171e-14  1.136868e-13  0.000000e+00  2.842171e-14  8.526513e-14
[16]  8.526513e-14 -1.421085e-14  0.000000e+00 -3.979039e-13  0.000000e+00
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> ## making sure these things agree
> ##
> ## first when there is no NA
> 
> 
> 
> agree.checks <- function(buff.matrix,r.matrix,err.tol=1e-10){
+ 
+   if (Max(buff.matrix,na.rm=TRUE) != max(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Max")
+   }
+   
+ 
+   if (Min(buff.matrix,na.rm=TRUE) != min(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Min")
+   }
+ 
+ 
+   if (abs(Sum(buff.matrix,na.rm=TRUE)- sum(r.matrix,na.rm=TRUE)) > err.tol){
+ 
+     cat(Sum(buff.matrix,na.rm=TRUE),"\n")
+     cat(sum(r.matrix,na.rm=TRUE),"\n")
+     cat(Sum(buff.matrix,na.rm=TRUE) - sum(r.matrix,na.rm=TRUE),"\n")
+     
+     stop("No agreement in Sum")
+   }
+   
+   if (abs(mean(buff.matrix,na.rm=TRUE) - mean(r.matrix,na.rm=TRUE)) > err.tol){
+     stop("No agreement in mean")
+   }
+   
+   
+   if(abs(Var(buff.matrix,na.rm=TRUE) - var(as.vector(r.matrix),na.rm=TRUE)) > err.tol){
+     stop("No agreement in Var")
+   }
+   
+   
+ 
+   if(any(abs(rowMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,mean,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowMeans")
+   }
+   
+   
+   if(any(abs(colMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,mean,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colMeans")
+   }
+   
+   
+   if(any(abs(rowSums(buff.matrix,na.rm=TRUE)  -  apply(r.matrix,1,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in rowSums")
+   }
+   
+   
+   if(any(abs(colSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colSums")
+   }
+   
+   ### this is to get around the fact that R doesn't like to compute NA on an entire vector of NA when 
+   ### computing variance
+   my.Var <- function(x,na.rm=FALSE){
+    if (all(is.na(x))){
+      return(NA)
+    } else {
+      var(x,na.rm=na.rm)
+    }
+ 
+   }
+   
+   if(any(abs(rowVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+   
+   
+   if(any(abs(colVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+ 
+ 
+   if(any(abs(rowMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+ 
+   if(any(abs(colMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+   
+   
+   if(any(abs(rowMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+   
+ 
+   if(any(abs(colMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+ 
+   if(any(abs(colMedians(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,median,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMedian")
+   }
+ 
+   if(any(abs(colRanges(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,range,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colRanges")
+   }
+ 
+ 
+   
+ }
> 
> 
> 
> 
> 
> 
> 
> 
> 
> for (rep in 1:20){
+   copymatrix <- matrix(rnorm(200,150,15),10,20)
+   
+   tmp5[1:10,1:20] <- copymatrix
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ## now lets assign some NA values and check agreement
+ 
+   which.row <- sample(1:10,1,replace=TRUE)
+   which.col  <- sample(1:20,1,replace=TRUE)
+   
+   cat(which.row," ",which.col,"\n")
+   
+   tmp5[which.row,which.col] <- NA
+   copymatrix[which.row,which.col] <- NA
+   
+   agree.checks(tmp5,copymatrix)
+ 
+   ## make an entire row NA
+   tmp5[which.row,] <- NA
+   copymatrix[which.row,] <- NA
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ### also make an entire col NA
+   tmp5[,which.col] <- NA
+   copymatrix[,which.col] <- NA
+ 
+   agree.checks(tmp5,copymatrix)
+ 
+   ### now make 1 element non NA with NA in the rest of row and column
+ 
+   tmp5[which.row,which.col] <- rnorm(1,150,15)
+   copymatrix[which.row,which.col] <- tmp5[which.row,which.col]
+ 
+   agree.checks(tmp5,copymatrix)
+ }
1   15 
10   17 
1   14 
4   10 
9   17 
7   5 
2   20 
3   7 
7   18 
5   17 
10   13 
6   5 
9   16 
6   8 
5   20 
2   6 
6   15 
2   2 
5   20 
2   14 
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.511719
> Min(tmp)
[1] -2.676771
> mean(tmp)
[1] 0.04523221
> Sum(tmp)
[1] 4.523221
> Var(tmp)
[1] 1.148328
> 
> rowMeans(tmp)
[1] 0.04523221
> rowSums(tmp)
[1] 4.523221
> rowVars(tmp)
[1] 1.148328
> rowSd(tmp)
[1] 1.071601
> rowMax(tmp)
[1] 2.511719
> rowMin(tmp)
[1] -2.676771
> 
> colMeans(tmp)
  [1] -1.470652606  0.748901596 -1.467313072  1.123664282  0.647051560
  [6]  0.981614570  0.589401203 -0.912944609 -0.897829902  1.467679662
 [11]  0.222205601 -1.760776155  0.484295387 -0.501790933  0.428272538
 [16]  1.214977470 -1.996926986 -0.094467091 -0.967998020  0.537529309
 [21] -0.747041315  1.833502599  1.226649217 -1.328980321 -1.943871546
 [26]  1.255354700  0.542715339  0.390943781  2.299044147 -1.041739561
 [31]  0.559780803  0.592089611 -1.037324999 -0.232154944 -0.365714802
 [36] -0.080314384 -0.289168760  0.279343400  0.153815358  0.678504295
 [41]  0.713310503 -0.674064364 -0.290945826 -0.361898669  1.723112633
 [46] -2.676770519 -0.616180092  0.401425933  1.135623270 -0.727281322
 [51] -0.006776941  0.125135552  0.086948316 -1.405513430  0.826469487
 [56]  1.803451775  1.393581062 -1.477279084 -0.172411175  2.511719404
 [61] -0.663606871 -0.772538194  2.318554039  1.297366540  0.072255312
 [66] -0.208931350 -0.248844974 -0.753331034  0.196597818 -0.061992977
 [71]  0.400405110 -1.694064028 -1.331823739  0.861922808  1.464606618
 [76]  0.923463571  2.147868690 -1.054410662 -0.300348486 -0.100265901
 [81]  1.840616545  0.096202312 -1.128231696  0.117471581 -0.203475114
 [86] -0.716969399  0.627397869 -0.851103329  0.975332787 -0.315363426
 [91]  0.548062074 -0.507728137  0.074897112  0.265690598 -0.536863182
 [96]  0.783401007 -1.340251829  1.492726273 -1.533703073 -1.089753590
> colSums(tmp)
  [1] -1.470652606  0.748901596 -1.467313072  1.123664282  0.647051560
  [6]  0.981614570  0.589401203 -0.912944609 -0.897829902  1.467679662
 [11]  0.222205601 -1.760776155  0.484295387 -0.501790933  0.428272538
 [16]  1.214977470 -1.996926986 -0.094467091 -0.967998020  0.537529309
 [21] -0.747041315  1.833502599  1.226649217 -1.328980321 -1.943871546
 [26]  1.255354700  0.542715339  0.390943781  2.299044147 -1.041739561
 [31]  0.559780803  0.592089611 -1.037324999 -0.232154944 -0.365714802
 [36] -0.080314384 -0.289168760  0.279343400  0.153815358  0.678504295
 [41]  0.713310503 -0.674064364 -0.290945826 -0.361898669  1.723112633
 [46] -2.676770519 -0.616180092  0.401425933  1.135623270 -0.727281322
 [51] -0.006776941  0.125135552  0.086948316 -1.405513430  0.826469487
 [56]  1.803451775  1.393581062 -1.477279084 -0.172411175  2.511719404
 [61] -0.663606871 -0.772538194  2.318554039  1.297366540  0.072255312
 [66] -0.208931350 -0.248844974 -0.753331034  0.196597818 -0.061992977
 [71]  0.400405110 -1.694064028 -1.331823739  0.861922808  1.464606618
 [76]  0.923463571  2.147868690 -1.054410662 -0.300348486 -0.100265901
 [81]  1.840616545  0.096202312 -1.128231696  0.117471581 -0.203475114
 [86] -0.716969399  0.627397869 -0.851103329  0.975332787 -0.315363426
 [91]  0.548062074 -0.507728137  0.074897112  0.265690598 -0.536863182
 [96]  0.783401007 -1.340251829  1.492726273 -1.533703073 -1.089753590
> 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.470652606  0.748901596 -1.467313072  1.123664282  0.647051560
  [6]  0.981614570  0.589401203 -0.912944609 -0.897829902  1.467679662
 [11]  0.222205601 -1.760776155  0.484295387 -0.501790933  0.428272538
 [16]  1.214977470 -1.996926986 -0.094467091 -0.967998020  0.537529309
 [21] -0.747041315  1.833502599  1.226649217 -1.328980321 -1.943871546
 [26]  1.255354700  0.542715339  0.390943781  2.299044147 -1.041739561
 [31]  0.559780803  0.592089611 -1.037324999 -0.232154944 -0.365714802
 [36] -0.080314384 -0.289168760  0.279343400  0.153815358  0.678504295
 [41]  0.713310503 -0.674064364 -0.290945826 -0.361898669  1.723112633
 [46] -2.676770519 -0.616180092  0.401425933  1.135623270 -0.727281322
 [51] -0.006776941  0.125135552  0.086948316 -1.405513430  0.826469487
 [56]  1.803451775  1.393581062 -1.477279084 -0.172411175  2.511719404
 [61] -0.663606871 -0.772538194  2.318554039  1.297366540  0.072255312
 [66] -0.208931350 -0.248844974 -0.753331034  0.196597818 -0.061992977
 [71]  0.400405110 -1.694064028 -1.331823739  0.861922808  1.464606618
 [76]  0.923463571  2.147868690 -1.054410662 -0.300348486 -0.100265901
 [81]  1.840616545  0.096202312 -1.128231696  0.117471581 -0.203475114
 [86] -0.716969399  0.627397869 -0.851103329  0.975332787 -0.315363426
 [91]  0.548062074 -0.507728137  0.074897112  0.265690598 -0.536863182
 [96]  0.783401007 -1.340251829  1.492726273 -1.533703073 -1.089753590
> colMin(tmp)
  [1] -1.470652606  0.748901596 -1.467313072  1.123664282  0.647051560
  [6]  0.981614570  0.589401203 -0.912944609 -0.897829902  1.467679662
 [11]  0.222205601 -1.760776155  0.484295387 -0.501790933  0.428272538
 [16]  1.214977470 -1.996926986 -0.094467091 -0.967998020  0.537529309
 [21] -0.747041315  1.833502599  1.226649217 -1.328980321 -1.943871546
 [26]  1.255354700  0.542715339  0.390943781  2.299044147 -1.041739561
 [31]  0.559780803  0.592089611 -1.037324999 -0.232154944 -0.365714802
 [36] -0.080314384 -0.289168760  0.279343400  0.153815358  0.678504295
 [41]  0.713310503 -0.674064364 -0.290945826 -0.361898669  1.723112633
 [46] -2.676770519 -0.616180092  0.401425933  1.135623270 -0.727281322
 [51] -0.006776941  0.125135552  0.086948316 -1.405513430  0.826469487
 [56]  1.803451775  1.393581062 -1.477279084 -0.172411175  2.511719404
 [61] -0.663606871 -0.772538194  2.318554039  1.297366540  0.072255312
 [66] -0.208931350 -0.248844974 -0.753331034  0.196597818 -0.061992977
 [71]  0.400405110 -1.694064028 -1.331823739  0.861922808  1.464606618
 [76]  0.923463571  2.147868690 -1.054410662 -0.300348486 -0.100265901
 [81]  1.840616545  0.096202312 -1.128231696  0.117471581 -0.203475114
 [86] -0.716969399  0.627397869 -0.851103329  0.975332787 -0.315363426
 [91]  0.548062074 -0.507728137  0.074897112  0.265690598 -0.536863182
 [96]  0.783401007 -1.340251829  1.492726273 -1.533703073 -1.089753590
> colMedians(tmp)
  [1] -1.470652606  0.748901596 -1.467313072  1.123664282  0.647051560
  [6]  0.981614570  0.589401203 -0.912944609 -0.897829902  1.467679662
 [11]  0.222205601 -1.760776155  0.484295387 -0.501790933  0.428272538
 [16]  1.214977470 -1.996926986 -0.094467091 -0.967998020  0.537529309
 [21] -0.747041315  1.833502599  1.226649217 -1.328980321 -1.943871546
 [26]  1.255354700  0.542715339  0.390943781  2.299044147 -1.041739561
 [31]  0.559780803  0.592089611 -1.037324999 -0.232154944 -0.365714802
 [36] -0.080314384 -0.289168760  0.279343400  0.153815358  0.678504295
 [41]  0.713310503 -0.674064364 -0.290945826 -0.361898669  1.723112633
 [46] -2.676770519 -0.616180092  0.401425933  1.135623270 -0.727281322
 [51] -0.006776941  0.125135552  0.086948316 -1.405513430  0.826469487
 [56]  1.803451775  1.393581062 -1.477279084 -0.172411175  2.511719404
 [61] -0.663606871 -0.772538194  2.318554039  1.297366540  0.072255312
 [66] -0.208931350 -0.248844974 -0.753331034  0.196597818 -0.061992977
 [71]  0.400405110 -1.694064028 -1.331823739  0.861922808  1.464606618
 [76]  0.923463571  2.147868690 -1.054410662 -0.300348486 -0.100265901
 [81]  1.840616545  0.096202312 -1.128231696  0.117471581 -0.203475114
 [86] -0.716969399  0.627397869 -0.851103329  0.975332787 -0.315363426
 [91]  0.548062074 -0.507728137  0.074897112  0.265690598 -0.536863182
 [96]  0.783401007 -1.340251829  1.492726273 -1.533703073 -1.089753590
> colRanges(tmp)
          [,1]      [,2]      [,3]     [,4]      [,5]      [,6]      [,7]
[1,] -1.470653 0.7489016 -1.467313 1.123664 0.6470516 0.9816146 0.5894012
[2,] -1.470653 0.7489016 -1.467313 1.123664 0.6470516 0.9816146 0.5894012
           [,8]       [,9]   [,10]     [,11]     [,12]     [,13]      [,14]
[1,] -0.9129446 -0.8978299 1.46768 0.2222056 -1.760776 0.4842954 -0.5017909
[2,] -0.9129446 -0.8978299 1.46768 0.2222056 -1.760776 0.4842954 -0.5017909
         [,15]    [,16]     [,17]       [,18]     [,19]     [,20]      [,21]
[1,] 0.4282725 1.214977 -1.996927 -0.09446709 -0.967998 0.5375293 -0.7470413
[2,] 0.4282725 1.214977 -1.996927 -0.09446709 -0.967998 0.5375293 -0.7470413
        [,22]    [,23]    [,24]     [,25]    [,26]     [,27]     [,28]    [,29]
[1,] 1.833503 1.226649 -1.32898 -1.943872 1.255355 0.5427153 0.3909438 2.299044
[2,] 1.833503 1.226649 -1.32898 -1.943872 1.255355 0.5427153 0.3909438 2.299044
        [,30]     [,31]     [,32]     [,33]      [,34]      [,35]       [,36]
[1,] -1.04174 0.5597808 0.5920896 -1.037325 -0.2321549 -0.3657148 -0.08031438
[2,] -1.04174 0.5597808 0.5920896 -1.037325 -0.2321549 -0.3657148 -0.08031438
          [,37]     [,38]     [,39]     [,40]     [,41]      [,42]      [,43]
[1,] -0.2891688 0.2793434 0.1538154 0.6785043 0.7133105 -0.6740644 -0.2909458
[2,] -0.2891688 0.2793434 0.1538154 0.6785043 0.7133105 -0.6740644 -0.2909458
          [,44]    [,45]     [,46]      [,47]     [,48]    [,49]      [,50]
[1,] -0.3618987 1.723113 -2.676771 -0.6161801 0.4014259 1.135623 -0.7272813
[2,] -0.3618987 1.723113 -2.676771 -0.6161801 0.4014259 1.135623 -0.7272813
            [,51]     [,52]      [,53]     [,54]     [,55]    [,56]    [,57]
[1,] -0.006776941 0.1251356 0.08694832 -1.405513 0.8264695 1.803452 1.393581
[2,] -0.006776941 0.1251356 0.08694832 -1.405513 0.8264695 1.803452 1.393581
         [,58]      [,59]    [,60]      [,61]      [,62]    [,63]    [,64]
[1,] -1.477279 -0.1724112 2.511719 -0.6636069 -0.7725382 2.318554 1.297367
[2,] -1.477279 -0.1724112 2.511719 -0.6636069 -0.7725382 2.318554 1.297367
          [,65]      [,66]     [,67]     [,68]     [,69]       [,70]     [,71]
[1,] 0.07225531 -0.2089314 -0.248845 -0.753331 0.1965978 -0.06199298 0.4004051
[2,] 0.07225531 -0.2089314 -0.248845 -0.753331 0.1965978 -0.06199298 0.4004051
         [,72]     [,73]     [,74]    [,75]     [,76]    [,77]     [,78]
[1,] -1.694064 -1.331824 0.8619228 1.464607 0.9234636 2.147869 -1.054411
[2,] -1.694064 -1.331824 0.8619228 1.464607 0.9234636 2.147869 -1.054411
          [,79]      [,80]    [,81]      [,82]     [,83]     [,84]      [,85]
[1,] -0.3003485 -0.1002659 1.840617 0.09620231 -1.128232 0.1174716 -0.2034751
[2,] -0.3003485 -0.1002659 1.840617 0.09620231 -1.128232 0.1174716 -0.2034751
          [,86]     [,87]      [,88]     [,89]      [,90]     [,91]      [,92]
[1,] -0.7169694 0.6273979 -0.8511033 0.9753328 -0.3153634 0.5480621 -0.5077281
[2,] -0.7169694 0.6273979 -0.8511033 0.9753328 -0.3153634 0.5480621 -0.5077281
          [,93]     [,94]      [,95]    [,96]     [,97]    [,98]     [,99]
[1,] 0.07489711 0.2656906 -0.5368632 0.783401 -1.340252 1.492726 -1.533703
[2,] 0.07489711 0.2656906 -0.5368632 0.783401 -1.340252 1.492726 -1.533703
        [,100]
[1,] -1.089754
[2,] -1.089754
> 
> 
> Max(tmp2)
[1] 2.899228
> Min(tmp2)
[1] -2.553509
> mean(tmp2)
[1] 0.2207063
> Sum(tmp2)
[1] 22.07063
> Var(tmp2)
[1] 0.948362
> 
> rowMeans(tmp2)
  [1] -0.30342985  1.20511739 -0.31889244 -0.07031120  0.48356229 -1.57729385
  [7]  0.35939686 -1.08216372 -2.55350947  0.88894253  1.15223168  0.90295906
 [13]  0.87585926  2.50257587 -0.46654123  2.89922763 -0.16298237 -0.33117510
 [19]  1.04511809 -1.21194417  0.65436093 -0.85717235  0.17638958 -0.54298667
 [25]  1.87795481  2.20663833 -0.60587684  0.31509608  0.35378538 -0.74353722
 [31] -1.09879018 -0.35914884  0.07382972  0.32555077 -0.44657288 -1.15168713
 [37] -0.93404095  0.29730112 -0.62479860  2.33460487  0.77220235  0.26612259
 [43]  2.44949802  1.05405642 -1.03915809  0.36534874 -0.06423207 -0.28026014
 [49]  0.08844575 -0.13996220  0.76395235 -0.31080040  2.18346342 -0.66973596
 [55]  0.03057788  0.73871392 -0.29093232  0.90766257 -0.47307376 -0.74143931
 [61]  1.58194805  1.13147585 -0.50617121  1.74345146  0.38653898  0.18291498
 [67]  0.28417712 -0.03324829 -0.77953427 -0.87824625  0.26024447  0.22056757
 [73]  0.48797417 -0.68357130 -0.29756704 -0.51959064  2.20754899 -0.41536624
 [79] -0.02594145 -0.11729265  1.56981766  1.19049222  0.93912827 -0.28715526
 [85] -0.50357944  1.23821485  0.64063042 -0.16007702  0.09793933 -0.84264785
 [91]  0.49347835  0.64612792 -0.30503837  0.30931888 -0.34036629  0.10049933
 [97]  0.15486209  1.14399189  1.32220256 -0.66561683
> rowSums(tmp2)
  [1] -0.30342985  1.20511739 -0.31889244 -0.07031120  0.48356229 -1.57729385
  [7]  0.35939686 -1.08216372 -2.55350947  0.88894253  1.15223168  0.90295906
 [13]  0.87585926  2.50257587 -0.46654123  2.89922763 -0.16298237 -0.33117510
 [19]  1.04511809 -1.21194417  0.65436093 -0.85717235  0.17638958 -0.54298667
 [25]  1.87795481  2.20663833 -0.60587684  0.31509608  0.35378538 -0.74353722
 [31] -1.09879018 -0.35914884  0.07382972  0.32555077 -0.44657288 -1.15168713
 [37] -0.93404095  0.29730112 -0.62479860  2.33460487  0.77220235  0.26612259
 [43]  2.44949802  1.05405642 -1.03915809  0.36534874 -0.06423207 -0.28026014
 [49]  0.08844575 -0.13996220  0.76395235 -0.31080040  2.18346342 -0.66973596
 [55]  0.03057788  0.73871392 -0.29093232  0.90766257 -0.47307376 -0.74143931
 [61]  1.58194805  1.13147585 -0.50617121  1.74345146  0.38653898  0.18291498
 [67]  0.28417712 -0.03324829 -0.77953427 -0.87824625  0.26024447  0.22056757
 [73]  0.48797417 -0.68357130 -0.29756704 -0.51959064  2.20754899 -0.41536624
 [79] -0.02594145 -0.11729265  1.56981766  1.19049222  0.93912827 -0.28715526
 [85] -0.50357944  1.23821485  0.64063042 -0.16007702  0.09793933 -0.84264785
 [91]  0.49347835  0.64612792 -0.30503837  0.30931888 -0.34036629  0.10049933
 [97]  0.15486209  1.14399189  1.32220256 -0.66561683
> rowVars(tmp2)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowSd(tmp2)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowMax(tmp2)
  [1] -0.30342985  1.20511739 -0.31889244 -0.07031120  0.48356229 -1.57729385
  [7]  0.35939686 -1.08216372 -2.55350947  0.88894253  1.15223168  0.90295906
 [13]  0.87585926  2.50257587 -0.46654123  2.89922763 -0.16298237 -0.33117510
 [19]  1.04511809 -1.21194417  0.65436093 -0.85717235  0.17638958 -0.54298667
 [25]  1.87795481  2.20663833 -0.60587684  0.31509608  0.35378538 -0.74353722
 [31] -1.09879018 -0.35914884  0.07382972  0.32555077 -0.44657288 -1.15168713
 [37] -0.93404095  0.29730112 -0.62479860  2.33460487  0.77220235  0.26612259
 [43]  2.44949802  1.05405642 -1.03915809  0.36534874 -0.06423207 -0.28026014
 [49]  0.08844575 -0.13996220  0.76395235 -0.31080040  2.18346342 -0.66973596
 [55]  0.03057788  0.73871392 -0.29093232  0.90766257 -0.47307376 -0.74143931
 [61]  1.58194805  1.13147585 -0.50617121  1.74345146  0.38653898  0.18291498
 [67]  0.28417712 -0.03324829 -0.77953427 -0.87824625  0.26024447  0.22056757
 [73]  0.48797417 -0.68357130 -0.29756704 -0.51959064  2.20754899 -0.41536624
 [79] -0.02594145 -0.11729265  1.56981766  1.19049222  0.93912827 -0.28715526
 [85] -0.50357944  1.23821485  0.64063042 -0.16007702  0.09793933 -0.84264785
 [91]  0.49347835  0.64612792 -0.30503837  0.30931888 -0.34036629  0.10049933
 [97]  0.15486209  1.14399189  1.32220256 -0.66561683
> rowMin(tmp2)
  [1] -0.30342985  1.20511739 -0.31889244 -0.07031120  0.48356229 -1.57729385
  [7]  0.35939686 -1.08216372 -2.55350947  0.88894253  1.15223168  0.90295906
 [13]  0.87585926  2.50257587 -0.46654123  2.89922763 -0.16298237 -0.33117510
 [19]  1.04511809 -1.21194417  0.65436093 -0.85717235  0.17638958 -0.54298667
 [25]  1.87795481  2.20663833 -0.60587684  0.31509608  0.35378538 -0.74353722
 [31] -1.09879018 -0.35914884  0.07382972  0.32555077 -0.44657288 -1.15168713
 [37] -0.93404095  0.29730112 -0.62479860  2.33460487  0.77220235  0.26612259
 [43]  2.44949802  1.05405642 -1.03915809  0.36534874 -0.06423207 -0.28026014
 [49]  0.08844575 -0.13996220  0.76395235 -0.31080040  2.18346342 -0.66973596
 [55]  0.03057788  0.73871392 -0.29093232  0.90766257 -0.47307376 -0.74143931
 [61]  1.58194805  1.13147585 -0.50617121  1.74345146  0.38653898  0.18291498
 [67]  0.28417712 -0.03324829 -0.77953427 -0.87824625  0.26024447  0.22056757
 [73]  0.48797417 -0.68357130 -0.29756704 -0.51959064  2.20754899 -0.41536624
 [79] -0.02594145 -0.11729265  1.56981766  1.19049222  0.93912827 -0.28715526
 [85] -0.50357944  1.23821485  0.64063042 -0.16007702  0.09793933 -0.84264785
 [91]  0.49347835  0.64612792 -0.30503837  0.30931888 -0.34036629  0.10049933
 [97]  0.15486209  1.14399189  1.32220256 -0.66561683
> 
> colMeans(tmp2)
[1] 0.2207063
> colSums(tmp2)
[1] 22.07063
> colVars(tmp2)
[1] 0.948362
> colSd(tmp2)
[1] 0.9738388
> colMax(tmp2)
[1] 2.899228
> colMin(tmp2)
[1] -2.553509
> colMedians(tmp2)
[1] 0.09921933
> colRanges(tmp2)
          [,1]
[1,] -2.553509
[2,]  2.899228
> 
> 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]  2.8543088  3.4413959  5.4944362 -1.6853769 -0.1167639  0.5985259
 [7]  4.1289922 -2.7374765 -0.4023328 -4.0263382
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -2.2980845
[2,] -0.1595877
[3,]  0.3808967
[4,]  1.3202857
[5,]  2.7849062
> 
> rowApply(tmp,sum)
 [1]  6.544455458  5.064759031 -2.085724226 -1.979816784 10.239743480
 [6]  3.161267309 -0.799361384 -8.937549436  0.003894065 -3.662296689
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    7    3    1   10    1   10   10    9    9     1
 [2,]    9    4    8    9    6    1    7    6    4     8
 [3,]    4    7    7    6    8    3    6    7    7    10
 [4,]   10    6    5    7    7    7    5    1    2     4
 [5,]    5   10    2    4    9    6    9    4    3     2
 [6,]    1    9    3    8    3    9    1   10    1     9
 [7,]    6    1    9    3   10    2    4    5   10     7
 [8,]    3    2   10    5    4    8    3    2    6     3
 [9,]    8    8    6    1    5    5    2    8    5     6
[10,]    2    5    4    2    2    4    8    3    8     5
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1]  0.25894052 -0.55140044 -0.07083612 -1.93510329  1.72520743 -0.01823947
 [7]  1.75418299  0.87163456  2.80578344  1.95054675 -3.43282217 -2.55536150
[13] -0.47562735  2.33823475  2.87643956  3.34537018  1.98549791  0.41559209
[19] -2.19885829  2.78785438
> colApply(tmp,quantile)[,1]
            [,1]
[1,] -0.54948728
[2,] -0.20474978
[3,] -0.02693428
[4,]  0.50432784
[5,]  0.53578402
> 
> rowApply(tmp,sum)
[1]  2.296335 -3.942188  6.096281  1.371102  6.055505
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]   13    7   10   10   11
[2,]   11   11   11    1   16
[3,]    2    4   20    3   17
[4,]   10    3    2   16    6
[5,]   15   16    3    5   19
> 
> 
> as.matrix(tmp)
            [,1]       [,2]       [,3]       [,4]       [,5]       [,6]
[1,]  0.50432784 -0.1798923 -1.7123515 -0.2149704  1.0178435 -1.0543258
[2,] -0.54948728 -0.1553034 -1.1286958 -1.2228692  0.4159465 -0.1131471
[3,] -0.02693428  0.1884031  2.2138453 -0.7506661 -0.6834807  0.7833444
[4,] -0.20474978 -1.7607327 -0.8617118  0.5569592 -0.5116289 -1.0812424
[5,]  0.53578402  1.3561248  1.4180777 -0.3035568  1.4865271  1.4471315
           [,7]       [,8]       [,9]      [,10]      [,11]       [,12]
[1,]  1.0915503 -0.8127883  1.3305393  0.2798244 -0.7952143 -0.55253320
[2,]  0.1175017  1.6767426  0.4700089  0.3769130 -1.0616250 -1.24255738
[3,]  0.9884850 -0.3470402  2.0949284 -0.1127358 -0.5695377 -0.53022708
[4,] -0.4293943  1.2257485 -0.6525463  0.5568730  0.2162913 -0.26497086
[5,] -0.0139597 -0.8710281 -0.4371469  0.8496721 -1.2227364  0.03492701
          [,13]      [,14]      [,15]      [,16]       [,17]      [,18]
[1,]  1.9276145 -0.2434537  1.8623414  0.9266919 -0.33893217 -0.7624306
[2,] -0.2510770  0.8203778 -1.9618493  1.4443650 -0.39548105  0.2266938
[3,] -2.3109659  1.7341460  1.0898957 -0.6725770  1.70599543 -0.1744676
[4,] -0.4049541  0.6777245  0.1116225  0.2983512  1.06519294  0.4428758
[5,]  0.5637551 -0.6505599  1.7744293  1.3485391 -0.05127724  0.6829207
          [,19]      [,20]
[1,] -1.8962777  1.9187722
[2,] -0.4593425 -0.9493019
[3,]  0.7009046  0.7749655
[4,] -0.3411617  2.7325558
[5,] -0.2029810 -1.6891372
> 
> 
> 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.23-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.23-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  654  bytes.
Disk usage :  200  bytes.
> subBufferedMatrix(tmp,,5:8)
BufferedMatrix object
Matrix size:  5 4 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  565  bytes.
Disk usage :  160  bytes.
> subBufferedMatrix(tmp,1:3,)
BufferedMatrix object
Matrix size:  3 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.23-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.5109541 -0.401081 -0.7047867 -0.08081906 -2.645606 0.2410396 -0.9326924
         col8        col9     col10      col11     col12     col13     col14
row1 1.135003 -0.09948297 0.5805592 -0.1731769 0.3495757 -1.577452 0.4276259
         col15      col16     col17     col18     col19       col20
row1 -1.244632 -0.3671059 0.6983841 -1.050622 0.5542225 -0.05218787
> tmp[,"col10"]
          col10
row1  0.5805592
row2 -0.1077531
row3 -1.1938965
row4  0.7472893
row5  2.5339823
> tmp[c("row1","row5"),]
           col1      col2       col3        col4       col5      col6
row1 -0.5109541 -0.401081 -0.7047867 -0.08081906 -2.6456059 0.2410396
row5 -0.4154109 -1.152724 -1.2494043  0.14722896 -0.3700491 1.1825213
           col7      col8        col9     col10      col11     col12     col13
row1 -0.9326924  1.135003 -0.09948297 0.5805592 -0.1731769 0.3495757 -1.577452
row5  0.1150817 -1.165814 -2.51981143 2.5339823 -0.3580848 0.6153566  1.421726
         col14     col15      col16     col17      col18      col19       col20
row1 0.4276259 -1.244632 -0.3671059 0.6983841 -1.0506216  0.5542225 -0.05218787
row5 0.1471062  2.245112 -1.0554062 1.2501501 -0.7947449 -2.3004250 -0.03390206
> tmp[,c("col6","col20")]
           col6       col20
row1  0.2410396 -0.05218787
row2  1.6533337 -1.03714831
row3 -0.2019087  1.84663851
row4  0.5193321  0.41485933
row5  1.1825213 -0.03390206
> tmp[c("row1","row5"),c("col6","col20")]
          col6       col20
row1 0.2410396 -0.05218787
row5 1.1825213 -0.03390206
> 
> 
> 
> 
> tmp["row1",] <- rnorm(20,mean=10)
> tmp[,"col10"] <- rnorm(5,mean=30)
> tmp[c("row1","row5"),] <- rnorm(40,mean=50)
> tmp[,c("col6","col20")] <- rnorm(10,mean=75)
> tmp[c("row1","row5"),c("col6","col20")]  <- rnorm(4,mean=105)
> 
> tmp["row1",]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 49.05123 50.79484 50.04026 49.92607 48.22407 103.4443 48.26163 48.76844
         col9    col10    col11    col12    col13    col14    col15   col16
row1 47.88227 50.48764 50.06156 49.83507 51.23002 48.80637 49.70391 51.2542
        col17    col18   col19    col20
row1 47.53476 50.91286 47.7918 105.1993
> tmp[,"col10"]
        col10
row1 50.48764
row2 31.30077
row3 31.10207
row4 27.90235
row5 51.64534
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 49.05123 50.79484 50.04026 49.92607 48.22407 103.4443 48.26163 48.76844
row5 48.15866 49.25889 49.79804 48.74258 50.28717 106.9713 49.99866 50.35207
         col9    col10    col11    col12    col13    col14    col15    col16
row1 47.88227 50.48764 50.06156 49.83507 51.23002 48.80637 49.70391 51.25420
row5 48.96703 51.64534 48.27654 50.77392 51.05144 48.69582 49.08382 49.79076
        col17    col18    col19    col20
row1 47.53476 50.91286 47.79180 105.1993
row5 50.17473 51.92610 48.91967 104.8023
> tmp[,c("col6","col20")]
          col6     col20
row1 103.44430 105.19933
row2  75.09812  75.89138
row3  74.91766  73.20543
row4  74.22821  74.00046
row5 106.97130 104.80232
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 103.4443 105.1993
row5 106.9713 104.8023
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 103.4443 105.1993
row5 106.9713 104.8023
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
            col13
[1,]  1.825453555
[2,]  0.009305629
[3,] -2.561557171
[4,]  2.024438086
[5,]  0.102184936
> tmp[,c("col17","col7")]
            col17        col7
[1,]  0.877920568 -0.03409137
[2,] -1.084227681  0.22494899
[3,]  1.112775444  1.06788749
[4,] -0.009693832  2.01304872
[5,] -1.507755941 -0.21975364
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
            col6       col20
[1,] -2.12006483  1.83924387
[2,]  0.70962785  0.88503299
[3,]  0.07697977 -1.34910262
[4,] -0.66425553  0.06934683
[5,] -1.17866061 -0.68902850
> subBufferedMatrix(tmp,1,c("col6"))[,1]
          col1
[1,] -2.120065
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
           col6
[1,] -2.1200648
[2,]  0.7096278
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> 
> 
> 
> subBufferedMatrix(tmp,c("row3","row1"),)[,1:20]
          [,1]      [,2]      [,3]       [,4]       [,5]      [,6]       [,7]
row3  1.726734 -1.577853 0.8606389  0.3432893 0.04225027 0.0466755  1.4287161
row1 -1.174554  1.647969 0.4595776 -0.1921723 0.83607277 0.2809372 -0.4082846
          [,8]       [,9]     [,10]      [,11]      [,12]     [,13]     [,14]
row3 -1.602753 -0.6147356 -1.535880 -0.3014102 -0.7722730 -0.529383 -1.613150
row1  1.167511 -0.4496937  1.505101 -1.5165393  0.1180444  1.735980 -1.634736
         [,15]       [,16]      [,17]      [,18]      [,19]     [,20]
row3 0.5718961 -0.62390526 -0.7885907 0.05339162  1.1960745 0.5032424
row1 0.2815793  0.02265255  0.9796285 0.37550923 -0.7956086 1.5999500
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
          [,1]      [,2]     [,3]     [,4]      [,5]      [,6]      [,7]
row2 0.9156444 -1.678601 1.396276 1.114419 0.1963391 -2.554468 -1.483525
          [,8]      [,9]    [,10]
row2 0.4876581 0.3440218 1.318648
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
         [,1]       [,2]      [,3]      [,4]        [,5]       [,6]       [,7]
row5 1.568683 -0.8658095 -1.702944 0.6414482 -0.05177192 -0.8123568 -0.8580386
           [,8]      [,9]    [,10]   [,11]    [,12]      [,13]     [,14]
row5 -0.2316194 0.7540342 1.127216 0.22109 1.269658 0.07027593 0.5302811
         [,15]         [,16]     [,17]      [,18]     [,19]    [,20]
row5 0.9900175 -0.0004206766 0.1483963 -0.2802663 -1.119825 0.555481
> 
> 
> 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: 0xaef5f8660>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM14b1061bc1faf"
 [2] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM14b105c44c4a" 
 [3] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM14b101a6c913b"
 [4] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM14b104db2c60a"
 [5] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM14b1013e7e260"
 [6] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM14b105cbf16d5"
 [7] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM14b105742985" 
 [8] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM14b10d51dd8f" 
 [9] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM14b1079a8de1d"
[10] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM14b103d8e8051"
[11] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM14b10568a6569"
[12] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM14b101807fce2"
[13] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM14b10346b65c1"
[14] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM14b1076e57cc9"
[15] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM14b105463ad1a"
> 
> 
> ### 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: 0xaef5f92c0>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0xaef5f92c0>
Warning message:
In dir.create(new.directory) :
  '/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0xaef5f92c0>
> rowMedians(tmp)
  [1] -0.1186935172 -0.2394766962  0.3642575141  0.1284665656  0.4623946593
  [6] -0.3905828612  0.2720946457  0.2125756375 -0.0108042652 -0.6013257477
 [11]  0.1757792112  0.1433360318  0.1153737873 -0.3161789815 -0.2211197963
 [16] -0.4953256734  0.0428568687 -0.0011534175  0.4229224065  0.4342616625
 [21]  0.5680199692 -0.0005185596 -0.1459507496 -0.1029878424  0.0555680765
 [26] -0.0760637826 -0.1543230683 -0.0004849308 -0.2578991373 -0.4224061434
 [31] -0.5011315343  0.0658412462  0.4265843745  0.0684147683 -0.1693446390
 [36] -0.2542185949  0.5512491572 -0.0969637463  0.1900252554  0.0781171699
 [41]  0.2391354598 -0.1868052310 -0.3982543821 -0.0053667905  0.2871538118
 [46] -0.0199135319  0.1418992368 -0.0619655091 -0.3066637660 -0.0037970979
 [51] -0.3934003079  0.0998766460  0.8543840496  0.2427501310 -0.0200295807
 [56]  0.0064287101  0.6003240589  0.4750992877  0.3582411899 -0.2665076903
 [61] -0.2213476974 -0.1889709323  0.0946826371 -0.1920542111  0.2178228121
 [66] -0.3111814590  0.2750355485 -0.0624824928  0.0412211855 -0.3236160367
 [71] -0.0576360186  0.0341475031 -0.0952188790  0.1829759405 -0.0220342439
 [76]  0.0956296887  0.4578356093  0.0922666110 -0.2747711913  0.2780028807
 [81] -0.0185085865 -0.1718294557 -0.5477970707 -0.0464679710 -0.2711595085
 [86] -0.1741496058  0.4945612759 -0.0257373424  0.5914283907  0.0327048196
 [91] -0.2175727856  0.2729703805  0.0641297016  0.1184292096  0.0736149936
 [96] -0.2934983373  0.7519499410 -0.2164806367  0.2822066050 -0.1922808242
[101] -0.3216536372 -0.3635660324 -0.6757135608 -0.0073252894  0.1815264365
[106] -0.1103721506  0.3614890845 -0.3889410029  0.0212639495 -0.3036604722
[111] -0.0224724093 -0.3592732813  0.1099959180  0.1162441051 -0.0503450084
[116] -0.7448117881 -0.1342677530 -0.4861870959  0.0765771442 -0.1560599846
[121]  0.4577000467 -0.5518271128 -0.0009819572  0.6577181690  0.5637262126
[126] -0.2576713619 -0.3289456563  0.3673115820  0.4857776492 -0.3587284319
[131] -0.5075340277 -0.1181234490  0.0065751889 -0.2569852515 -0.4983714991
[136] -0.1451209657 -0.1122560709  0.2377376996  0.2719175744  0.0126253540
[141]  0.4314777068 -0.7533835006  0.6871714126 -0.1914650957 -0.1822670556
[146] -0.0637436716  0.1591318785 -0.2110403526  0.0508791654  0.1925134228
[151]  0.0179052204  0.0128552545 -0.4681943674 -0.0682439509 -0.0872853149
[156] -0.0063414344 -0.5322602133  0.6385508423 -0.3052357468  0.1152802324
[161] -0.2203501953  0.4704197841  0.3084523268 -0.2067949165 -0.1548393697
[166] -0.3869783150 -0.1911466055  0.2548605262 -0.2349692855 -0.2408133852
[171] -0.0322447878  0.1857890180 -0.1030661308 -0.0455895888  0.3588559694
[176] -0.4759651920  0.1040102979 -0.5649280171 -0.5178082478 -0.2953138351
[181]  0.6934771483 -0.0140580066 -0.0226239580  0.6488773501  0.4701325930
[186]  0.4899909665 -0.0882206934 -0.4276063246  0.0414043265 -0.2668066179
[191]  0.1589791690 -0.2523738855 -0.3331956478  0.4917043250 -0.1192009464
[196] -0.3601871921  0.3313834182  0.7588802799 -0.1340710107  0.3409359185
[201] -0.3061636550 -0.2158888634  0.0773013739  0.3902688554  0.4850496557
[206]  0.1114472903 -0.4044018082  0.5000194207 -0.0148223410  0.0728186980
[211]  0.0553997807  0.3920283091 -0.1898142891  0.1269940575 -0.4407761812
[216]  0.0474364647 -0.1045044549  0.1982931432  0.0433641559 -0.1538461120
[221] -0.4155084397  0.5837339285  0.3836059635 -0.3328414906  0.1097518386
[226]  0.0352156107  0.3558893228  0.1135026253  0.3283911968 -0.1974785000
> 
> proc.time()
   user  system elapsed 
  0.814   5.068   6.010 

BufferedMatrix.Rcheck/tests/rawCalltesting.Rout


R Under development (unstable) (2026-03-26 r89717) -- "Unsuffered Consequences"
Copyright (C) 2026 The R Foundation for Statistical Computing
Platform: aarch64-apple-darwin23

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: 0x9c54002a0>
> .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: 0x9c54002a0>
> .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: 0x9c54002a0>
> .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: 0x9c54002a0>
> 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: 0x9c5400300>
> .Call("R_bm_AddColumn",P)
<pointer: 0x9c5400300>
> .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: 0x9c5400300>
> .Call("R_bm_AddColumn",P)
<pointer: 0x9c5400300>
> .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: 0x9c5400300>
> 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: 0x9c5400720>
> .Call("R_bm_AddColumn",P)
<pointer: 0x9c5400720>
> .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: 0x9c5400720>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x9c5400720>
> .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: 0x9c5400720>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x9c5400720>
> .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: 0x9c5400720>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x9c5400720>
> .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: 0x9c5400720>
> 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: 0x9c5400840>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x9c5400840>
> .Call("R_bm_AddColumn",P)
<pointer: 0x9c5400840>
> .Call("R_bm_AddColumn",P)
<pointer: 0x9c5400840>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile14dc830b931ab" "BufferedMatrixFile14dc8e714e05" 
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile14dc830b931ab" "BufferedMatrixFile14dc8e714e05" 
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x9c5400960>
> .Call("R_bm_AddColumn",P)
<pointer: 0x9c5400960>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x9c5400960>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x9c5400960>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x9c5400960>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x9c5400960>
> .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: 0x9c5400ae0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x9c5400ae0>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x9c5400ae0>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x9c5400ae0>
> 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: 0x9c5400c00>
> .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: 0x9c5400c00>
> rm(P)
> 
> proc.time()
   user  system elapsed 
  0.124   0.054   0.172 

BufferedMatrix.Rcheck/tests/Rcodetesting.Rout


R Under development (unstable) (2026-03-26 r89717) -- "Unsuffered Consequences"
Copyright (C) 2026 The R Foundation for Statistical Computing
Platform: aarch64-apple-darwin23

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.128   0.032   0.157 

Example timings