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

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

HostnameOSArch (*)R versionInstalled pkgs
nebbiolo1Linux (Ubuntu 24.04.4 LTS)x86_644.6.0 alpha (2026-04-05 r89794) 4919
kjohnson3macOS 13.7.7 Venturaarm644.6.0 alpha (2026-04-08 r89818) 4632
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 259/2390HostnameOS / ArchINSTALLBUILDCHECKBUILD BIN
BufferedMatrix 1.75.0  (landing page)
Ben Bolstad
Snapshot Date: 2026-04-12 13:40 -0400 (Sun, 12 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.4 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-12 18:42:17 -0400 (Sun, 12 Apr 2026)
EndedAt: 2026-04-12 18:42:37 -0400 (Sun, 12 Apr 2026)
EllapsedTime: 20.3 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 version 4.6.0 alpha (2026-04-08 r89818)
* 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-12 22:42:17 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 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/opt/R/arm64/include    -fPIC  -falign-functions=64 -Wall -g -O2  -c RBufferedMatrix.c -o RBufferedMatrix.o
clang -arch arm64 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/opt/R/arm64/include    -fPIC  -falign-functions=64 -Wall -g -O2  -c doubleBufferedMatrix.c -o doubleBufferedMatrix.o
doubleBufferedMatrix.c:1580:7: warning: logical not is only applied to the left hand side of this bitwise operator [-Wlogical-not-parentheses]
 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 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/opt/R/arm64/include    -fPIC  -falign-functions=64 -Wall -g -O2  -c doubleBufferedMatrix_C_tests.c -o doubleBufferedMatrix_C_tests.o
clang -arch arm64 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/opt/R/arm64/include    -fPIC  -falign-functions=64 -Wall -g -O2  -c init_package.c -o init_package.o
clang -arch arm64 -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -L/Library/Frameworks/R.framework/Resources/lib -L/opt/R/arm64/lib -o BufferedMatrix.so RBufferedMatrix.o doubleBufferedMatrix.o doubleBufferedMatrix_C_tests.o init_package.o -F/Library/Frameworks/R.framework/.. -framework R
installing to /Library/Frameworks/R.framework/Versions/4.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 version 4.6.0 alpha (2026-04-08 r89818)
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.121   0.047   0.164 

BufferedMatrix.Rcheck/tests/objectTesting.Rout


R version 4.6.0 alpha (2026-04-08 r89818)
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 484141 25.9    1067250   57         NA   632020 33.8
Vcells 896965  6.9    8388608   64     196608  2112095 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] "Sun Apr 12 18:42:28 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] "Sun Apr 12 18:42:28 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: 0xc9dd78000>
> 
> 
> 
> 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] "Sun Apr 12 18:42:30 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] "Sun Apr 12 18:42:30 2026"
> 
> ColMode(tmp2)
<pointer: 0xc9dd78000>
> 
> 
> 
> ### 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,] 101.957679 0.2978303 0.4992326  0.4190492
[2,]   0.364888 0.9912730 1.3066266 -2.1827509
[3,]   1.873354 0.6392277 1.4726742  0.3620634
[4,]  -1.620116 0.7762525 0.4016415  1.9014396
> 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 :  1.9  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
           [,1]      [,2]      [,3]      [,4]
[1,] 101.957679 0.2978303 0.4992326 0.4190492
[2,]   0.364888 0.9912730 1.3066266 2.1827509
[3,]   1.873354 0.6392277 1.4726742 0.3620634
[4,]   1.620116 0.7762525 0.4016415 1.9014396
> 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 :  1.9  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
           [,1]      [,2]      [,3]      [,4]
[1,] 10.0974095 0.5457383 0.7065639 0.6473401
[2,]  0.6040596 0.9956269 1.1430777 1.4774136
[3,]  1.3687052 0.7995171 1.2135379 0.6017170
[4,]  1.2728377 0.8810520 0.6337520 1.3789270
> 
> 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 :  1.9  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
          [,1]     [,2]     [,3]     [,4]
[1,] 227.93177 30.75521 32.56487 31.89245
[2,]  31.40548 35.94754 37.73740 41.95689
[3,]  40.56041 33.63440 38.60805 31.37923
[4,]  39.34849 34.58677 31.73916 40.69071
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0xc9dd780c0>
> exp(tmp5)
<pointer: 0xc9dd780c0>
> log(tmp5,2)
<pointer: 0xc9dd780c0>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 474.4101
> Min(tmp5)
[1] 54.11813
> mean(tmp5)
[1] 72.67174
> Sum(tmp5)
[1] 14534.35
> Var(tmp5)
[1] 889.4426
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 88.45385 69.30078 73.74790 71.25625 70.84478 70.77589 72.98800 68.69344
 [9] 70.75072 69.90580
> rowSums(tmp5)
 [1] 1769.077 1386.016 1474.958 1425.125 1416.896 1415.518 1459.760 1373.869
 [9] 1415.014 1398.116
> rowVars(tmp5)
 [1] 8313.11817   95.36361   75.36246   82.76703   71.03002   72.92374
 [7]   82.38753  104.45490   78.79767   26.06265
> rowSd(tmp5)
 [1] 91.176303  9.765429  8.681156  9.097639  8.427931  8.539540  9.076758
 [8] 10.220318  8.876805  5.105159
> rowMax(tmp5)
 [1] 474.41013  87.49987  90.84212  84.69238  85.97262  85.27842  91.16523
 [8]  87.14106  88.21507  82.73976
> rowMin(tmp5)
 [1] 57.10173 54.11813 57.35178 54.37042 56.59783 55.58116 59.69890 56.49868
 [9] 56.98406 60.84098
> 
> colMeans(tmp5)
 [1] 108.99286  72.45483  67.00035  70.20948  71.77200  71.78935  67.43788
 [8]  71.18347  74.82047  68.02873  69.84049  67.15603  71.40145  72.84895
[15]  69.41729  74.97688  74.40999  65.12435  73.08981  71.48016
> colSums(tmp5)
 [1] 1089.9286  724.5483  670.0035  702.0948  717.7200  717.8935  674.3788
 [8]  711.8347  748.2047  680.2873  698.4049  671.5603  714.0145  728.4895
[15]  694.1729  749.7688  744.0999  651.2435  730.8981  714.8016
> colVars(tmp5)
 [1] 16560.72506    73.28829    67.79928   111.97650    43.44853    42.20818
 [7]    57.71847   185.42542    28.09315    16.79472    77.15629    56.18892
[13]    72.60156   111.79961   112.80121    73.00653    57.99402    92.89601
[19]    60.53112    61.40346
> colSd(tmp5)
 [1] 128.688481   8.560858   8.234032  10.581895   6.591550   6.496783
 [7]   7.597267  13.617100   5.300297   4.098137   8.783865   7.495927
[13]   8.520655  10.573533  10.620791   8.544386   7.615381   9.638258
[19]   7.780175   7.836036
> colMax(tmp5)
 [1] 474.41013  83.01620  80.35760  87.32776  85.97262  80.02954  80.66494
 [8]  90.01830  81.31754  75.63409  87.49987  77.70211  81.08689  90.84212
[15]  91.16523  85.54764  85.89159  88.21507  83.79856  85.27549
> colMin(tmp5)
 [1] 57.86415 57.31926 55.58116 56.59783 60.74233 64.17055 56.86700 54.11813
 [9] 65.99277 61.26558 60.18368 55.75622 57.10173 57.97734 56.49868 59.84206
[17] 64.20205 54.37042 58.26661 57.35178
> 
> 
> ### 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] 88.45385 69.30078 73.74790 71.25625 70.84478 70.77589       NA 68.69344
 [9] 70.75072 69.90580
> rowSums(tmp5)
 [1] 1769.077 1386.016 1474.958 1425.125 1416.896 1415.518       NA 1373.869
 [9] 1415.014 1398.116
> rowVars(tmp5)
 [1] 8313.11817   95.36361   75.36246   82.76703   71.03002   72.92374
 [7]   81.44092  104.45490   78.79767   26.06265
> rowSd(tmp5)
 [1] 91.176303  9.765429  8.681156  9.097639  8.427931  8.539540  9.024462
 [8] 10.220318  8.876805  5.105159
> rowMax(tmp5)
 [1] 474.41013  87.49987  90.84212  84.69238  85.97262  85.27842        NA
 [8]  87.14106  88.21507  82.73976
> rowMin(tmp5)
 [1] 57.10173 54.11813 57.35178 54.37042 56.59783 55.58116       NA 56.49868
 [9] 56.98406 60.84098
> 
> colMeans(tmp5)
 [1]       NA 72.45483 67.00035 70.20948 71.77200 71.78935 67.43788 71.18347
 [9] 74.82047 68.02873 69.84049 67.15603 71.40145 72.84895 69.41729 74.97688
[17] 74.40999 65.12435 73.08981 71.48016
> colSums(tmp5)
 [1]       NA 724.5483 670.0035 702.0948 717.7200 717.8935 674.3788 711.8347
 [9] 748.2047 680.2873 698.4049 671.5603 714.0145 728.4895 694.1729 749.7688
[17] 744.0999 651.2435 730.8981 714.8016
> colVars(tmp5)
 [1]        NA  73.28829  67.79928 111.97650  43.44853  42.20818  57.71847
 [8] 185.42542  28.09315  16.79472  77.15629  56.18892  72.60156 111.79961
[15] 112.80121  73.00653  57.99402  92.89601  60.53112  61.40346
> colSd(tmp5)
 [1]        NA  8.560858  8.234032 10.581895  6.591550  6.496783  7.597267
 [8] 13.617100  5.300297  4.098137  8.783865  7.495927  8.520655 10.573533
[15] 10.620791  8.544386  7.615381  9.638258  7.780175  7.836036
> colMax(tmp5)
 [1]       NA 83.01620 80.35760 87.32776 85.97262 80.02954 80.66494 90.01830
 [9] 81.31754 75.63409 87.49987 77.70211 81.08689 90.84212 91.16523 85.54764
[17] 85.89159 88.21507 83.79856 85.27549
> colMin(tmp5)
 [1]       NA 57.31926 55.58116 56.59783 60.74233 64.17055 56.86700 54.11813
 [9] 65.99277 61.26558 60.18368 55.75622 57.10173 57.97734 56.49868 59.84206
[17] 64.20205 54.37042 58.26661 57.35178
> 
> Max(tmp5,na.rm=TRUE)
[1] 474.4101
> Min(tmp5,na.rm=TRUE)
[1] 54.11813
> mean(tmp5,na.rm=TRUE)
[1] 72.71899
> Sum(tmp5,na.rm=TRUE)
[1] 14471.08
> Var(tmp5,na.rm=TRUE)
[1] 893.486
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 88.45385 69.30078 73.74790 71.25625 70.84478 70.77589 73.49952 68.69344
 [9] 70.75072 69.90580
> rowSums(tmp5,na.rm=TRUE)
 [1] 1769.077 1386.016 1474.958 1425.125 1416.896 1415.518 1396.491 1373.869
 [9] 1415.014 1398.116
> rowVars(tmp5,na.rm=TRUE)
 [1] 8313.11817   95.36361   75.36246   82.76703   71.03002   72.92374
 [7]   81.44092  104.45490   78.79767   26.06265
> rowSd(tmp5,na.rm=TRUE)
 [1] 91.176303  9.765429  8.681156  9.097639  8.427931  8.539540  9.024462
 [8] 10.220318  8.876805  5.105159
> rowMax(tmp5,na.rm=TRUE)
 [1] 474.41013  87.49987  90.84212  84.69238  85.97262  85.27842  91.16523
 [8]  87.14106  88.21507  82.73976
> rowMin(tmp5,na.rm=TRUE)
 [1] 57.10173 54.11813 57.35178 54.37042 56.59783 55.58116 59.69890 56.49868
 [9] 56.98406 60.84098
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 114.07326  72.45483  67.00035  70.20948  71.77200  71.78935  67.43788
 [8]  71.18347  74.82047  68.02873  69.84049  67.15603  71.40145  72.84895
[15]  69.41729  74.97688  74.40999  65.12435  73.08981  71.48016
> colSums(tmp5,na.rm=TRUE)
 [1] 1026.6594  724.5483  670.0035  702.0948  717.7200  717.8935  674.3788
 [8]  711.8347  748.2047  680.2873  698.4049  671.5603  714.0145  728.4895
[15]  694.1729  749.7688  744.0999  651.2435  730.8981  714.8016
> colVars(tmp5,na.rm=TRUE)
 [1] 18340.44723    73.28829    67.79928   111.97650    43.44853    42.20818
 [7]    57.71847   185.42542    28.09315    16.79472    77.15629    56.18892
[13]    72.60156   111.79961   112.80121    73.00653    57.99402    92.89601
[19]    60.53112    61.40346
> colSd(tmp5,na.rm=TRUE)
 [1] 135.426907   8.560858   8.234032  10.581895   6.591550   6.496783
 [7]   7.597267  13.617100   5.300297   4.098137   8.783865   7.495927
[13]   8.520655  10.573533  10.620791   8.544386   7.615381   9.638258
[19]   7.780175   7.836036
> colMax(tmp5,na.rm=TRUE)
 [1] 474.41013  83.01620  80.35760  87.32776  85.97262  80.02954  80.66494
 [8]  90.01830  81.31754  75.63409  87.49987  77.70211  81.08689  90.84212
[15]  91.16523  85.54764  85.89159  88.21507  83.79856  85.27549
> colMin(tmp5,na.rm=TRUE)
 [1] 57.86415 57.31926 55.58116 56.59783 60.74233 64.17055 56.86700 54.11813
 [9] 65.99277 61.26558 60.18368 55.75622 57.10173 57.97734 56.49868 59.84206
[17] 64.20205 54.37042 58.26661 57.35178
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1] 88.45385 69.30078 73.74790 71.25625 70.84478 70.77589      NaN 68.69344
 [9] 70.75072 69.90580
> rowSums(tmp5,na.rm=TRUE)
 [1] 1769.077 1386.016 1474.958 1425.125 1416.896 1415.518    0.000 1373.869
 [9] 1415.014 1398.116
> rowVars(tmp5,na.rm=TRUE)
 [1] 8313.11817   95.36361   75.36246   82.76703   71.03002   72.92374
 [7]         NA  104.45490   78.79767   26.06265
> rowSd(tmp5,na.rm=TRUE)
 [1] 91.176303  9.765429  8.681156  9.097639  8.427931  8.539540        NA
 [8] 10.220318  8.876805  5.105159
> rowMax(tmp5,na.rm=TRUE)
 [1] 474.41013  87.49987  90.84212  84.69238  85.97262  85.27842        NA
 [8]  87.14106  88.21507  82.73976
> rowMin(tmp5,na.rm=TRUE)
 [1] 57.10173 54.11813 57.35178 54.37042 56.59783 55.58116       NA 56.49868
 [9] 56.98406 60.84098
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1]      NaN 71.31126 67.81162 70.78107 71.97709 70.87377 67.42565 70.14573
 [9] 74.29754 68.28778 69.05202 65.98424 70.35972 73.86601 67.00085 74.53496
[17] 75.38576 65.62960 71.97692 71.95716
> colSums(tmp5,na.rm=TRUE)
 [1]   0.0000 641.8013 610.3046 637.0296 647.7938 637.8640 606.8308 631.3116
 [9] 668.6779 614.5900 621.4682 593.8582 633.2375 664.7941 603.0077 670.8147
[17] 678.4718 590.6664 647.7923 647.6144
> colVars(tmp5,na.rm=TRUE)
 [1]        NA  67.73711  68.86985 122.29805  48.40640  38.05355  64.93159
 [8] 196.48848  28.52841  18.13911  79.80691  47.76531  69.46828 114.13748
[15]  61.21070  79.93531  54.53191 101.63620  54.16414  66.51920
> colSd(tmp5,na.rm=TRUE)
 [1]        NA  8.230256  8.298786 11.058845  6.957471  6.168756  8.058014
 [8] 14.017435  5.341199  4.259004  8.933471  6.911245  8.334764 10.683515
[15]  7.823727  8.940655  7.384573 10.081478  7.359629  8.155930
> colMax(tmp5,na.rm=TRUE)
 [1]     -Inf 83.01620 80.35760 87.32776 85.97262 80.00531 80.66494 90.01830
 [9] 81.31754 75.63409 87.49987 76.76670 81.08689 90.84212 80.23620 85.54764
[17] 85.89159 88.21507 83.79856 85.27549
> colMin(tmp5,na.rm=TRUE)
 [1]      Inf 57.31926 55.58116 56.59783 60.74233 64.17055 56.86700 54.11813
 [9] 65.99277 61.26558 60.18368 55.75622 57.10173 57.97734 56.49868 59.84206
[17] 64.20205 54.37042 58.26661 57.35178
> 
> 
> 
> 
> 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] 199.0901 246.9150 164.1214 295.5654 253.5277 275.1509 224.4637 186.2546
 [9] 173.7295 104.7634
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 199.0901 246.9150 164.1214 295.5654 253.5277 275.1509 224.4637 186.2546
 [9] 173.7295 104.7634
> 
> 
> 
> 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  5.684342e-14  0.000000e+00 -2.842171e-14 -5.684342e-14
 [6] -2.557954e-13 -1.989520e-13 -1.989520e-13  5.684342e-14 -5.684342e-14
[11]  2.842171e-14  0.000000e+00 -1.421085e-13  5.684342e-14 -2.842171e-14
[16]  5.684342e-14 -5.684342e-14  0.000000e+00  2.842171e-14 -7.105427e-14
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> ## making sure these things agree
> ##
> ## first when there is no NA
> 
> 
> 
> agree.checks <- function(buff.matrix,r.matrix,err.tol=1e-10){
+ 
+   if (Max(buff.matrix,na.rm=TRUE) != max(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Max")
+   }
+   
+ 
+   if (Min(buff.matrix,na.rm=TRUE) != min(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Min")
+   }
+ 
+ 
+   if (abs(Sum(buff.matrix,na.rm=TRUE)- sum(r.matrix,na.rm=TRUE)) > err.tol){
+ 
+     cat(Sum(buff.matrix,na.rm=TRUE),"\n")
+     cat(sum(r.matrix,na.rm=TRUE),"\n")
+     cat(Sum(buff.matrix,na.rm=TRUE) - sum(r.matrix,na.rm=TRUE),"\n")
+     
+     stop("No agreement in Sum")
+   }
+   
+   if (abs(mean(buff.matrix,na.rm=TRUE) - mean(r.matrix,na.rm=TRUE)) > err.tol){
+     stop("No agreement in mean")
+   }
+   
+   
+   if(abs(Var(buff.matrix,na.rm=TRUE) - var(as.vector(r.matrix),na.rm=TRUE)) > err.tol){
+     stop("No agreement in Var")
+   }
+   
+   
+ 
+   if(any(abs(rowMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,mean,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowMeans")
+   }
+   
+   
+   if(any(abs(colMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,mean,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colMeans")
+   }
+   
+   
+   if(any(abs(rowSums(buff.matrix,na.rm=TRUE)  -  apply(r.matrix,1,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in rowSums")
+   }
+   
+   
+   if(any(abs(colSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colSums")
+   }
+   
+   ### this is to get around the fact that R doesn't like to compute NA on an entire vector of NA when 
+   ### computing variance
+   my.Var <- function(x,na.rm=FALSE){
+    if (all(is.na(x))){
+      return(NA)
+    } else {
+      var(x,na.rm=na.rm)
+    }
+ 
+   }
+   
+   if(any(abs(rowVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+   
+   
+   if(any(abs(colVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+ 
+ 
+   if(any(abs(rowMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+ 
+   if(any(abs(colMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+   
+   
+   if(any(abs(rowMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+   
+ 
+   if(any(abs(colMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+ 
+   if(any(abs(colMedians(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,median,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMedian")
+   }
+ 
+   if(any(abs(colRanges(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,range,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colRanges")
+   }
+ 
+ 
+   
+ }
> 
> 
> 
> 
> 
> 
> 
> 
> 
> for (rep in 1:20){
+   copymatrix <- matrix(rnorm(200,150,15),10,20)
+   
+   tmp5[1:10,1:20] <- copymatrix
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ## now lets assign some NA values and check agreement
+ 
+   which.row <- sample(1:10,1,replace=TRUE)
+   which.col  <- sample(1:20,1,replace=TRUE)
+   
+   cat(which.row," ",which.col,"\n")
+   
+   tmp5[which.row,which.col] <- NA
+   copymatrix[which.row,which.col] <- NA
+   
+   agree.checks(tmp5,copymatrix)
+ 
+   ## make an entire row NA
+   tmp5[which.row,] <- NA
+   copymatrix[which.row,] <- NA
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ### also make an entire col NA
+   tmp5[,which.col] <- NA
+   copymatrix[,which.col] <- NA
+ 
+   agree.checks(tmp5,copymatrix)
+ 
+   ### now make 1 element non NA with NA in the rest of row and column
+ 
+   tmp5[which.row,which.col] <- rnorm(1,150,15)
+   copymatrix[which.row,which.col] <- tmp5[which.row,which.col]
+ 
+   agree.checks(tmp5,copymatrix)
+ }
9   10 
3   8 
8   11 
8   20 
1   10 
2   19 
4   10 
1   20 
6   2 
7   1 
9   6 
3   11 
3   18 
5   4 
2   5 
4   13 
2   15 
8   4 
6   8 
10   15 
There were 50 or more warnings (use warnings() to see the first 50)
> 
> 
> ### now test 1 by n and n by 1 matrix
> 
> 
> err.tol <- 1e-12
> 
> rm(tmp5)
> 
> dataset1 <- rnorm(100)
> dataset2 <- rnorm(100)
> 
> tmp <- createBufferedMatrix(1,100)
> tmp[1,] <- dataset1
> 
> tmp2 <- createBufferedMatrix(100,1)
> tmp2[,1] <- dataset2
> 
> 
> 
> 
> 
> Max(tmp)
[1] 3.094928
> Min(tmp)
[1] -2.364937
> mean(tmp)
[1] 0.05226091
> Sum(tmp)
[1] 5.226091
> Var(tmp)
[1] 1.083935
> 
> rowMeans(tmp)
[1] 0.05226091
> rowSums(tmp)
[1] 5.226091
> rowVars(tmp)
[1] 1.083935
> rowSd(tmp)
[1] 1.041122
> rowMax(tmp)
[1] 3.094928
> rowMin(tmp)
[1] -2.364937
> 
> colMeans(tmp)
  [1] -0.04764571  0.42369991  1.21366898 -1.66518071 -1.62787577  0.69847342
  [7]  0.32388550 -1.99977070 -1.06047699  0.69479107 -0.19532168 -0.48400326
 [13] -0.09488060  0.29223023  0.23153379  0.50043390  0.19590072  0.19107194
 [19] -0.86754982 -1.91206373  1.57917630  1.11883713 -0.89400424 -0.28718493
 [25] -0.98897922  1.55262898  0.98053551  0.02016811  0.52954351  0.08922870
 [31]  2.08673070  0.08490351  1.23597268  1.43997381 -0.37043120  0.36847147
 [37]  0.64232676 -0.14143705 -0.67553335  0.48743755 -1.24261831  0.33190692
 [43]  0.05830338 -1.42265806  1.34714220 -0.71175918  0.34540791 -0.81316254
 [49] -0.53502929 -0.69744354 -1.43657165  3.09492764  0.63751763  1.88338619
 [55]  0.46702717  0.47185877  0.18578224  0.32354559 -1.10768832  0.18481690
 [61] -0.86919961 -0.49297725 -0.58681317 -0.27730039  0.93753535  0.42145860
 [67] -0.05529485  0.26416509 -1.03036573  0.36598562 -0.51458713  1.20774857
 [73] -1.63838017 -0.00703014 -1.99560859 -0.22213649  0.15348650  0.07330461
 [79] -0.47619157  1.26786270  1.09931814  0.92840668 -0.15945611 -0.48329825
 [85] -1.84661974  1.37793958  0.89887947  2.05246481  1.09777845  0.23401319
 [91] -0.33083486 -0.17228271 -0.36056516  1.07416009  1.08611743 -1.53482045
 [97] -2.36493721  0.93207706 -1.68222906  1.82034083
> colSums(tmp)
  [1] -0.04764571  0.42369991  1.21366898 -1.66518071 -1.62787577  0.69847342
  [7]  0.32388550 -1.99977070 -1.06047699  0.69479107 -0.19532168 -0.48400326
 [13] -0.09488060  0.29223023  0.23153379  0.50043390  0.19590072  0.19107194
 [19] -0.86754982 -1.91206373  1.57917630  1.11883713 -0.89400424 -0.28718493
 [25] -0.98897922  1.55262898  0.98053551  0.02016811  0.52954351  0.08922870
 [31]  2.08673070  0.08490351  1.23597268  1.43997381 -0.37043120  0.36847147
 [37]  0.64232676 -0.14143705 -0.67553335  0.48743755 -1.24261831  0.33190692
 [43]  0.05830338 -1.42265806  1.34714220 -0.71175918  0.34540791 -0.81316254
 [49] -0.53502929 -0.69744354 -1.43657165  3.09492764  0.63751763  1.88338619
 [55]  0.46702717  0.47185877  0.18578224  0.32354559 -1.10768832  0.18481690
 [61] -0.86919961 -0.49297725 -0.58681317 -0.27730039  0.93753535  0.42145860
 [67] -0.05529485  0.26416509 -1.03036573  0.36598562 -0.51458713  1.20774857
 [73] -1.63838017 -0.00703014 -1.99560859 -0.22213649  0.15348650  0.07330461
 [79] -0.47619157  1.26786270  1.09931814  0.92840668 -0.15945611 -0.48329825
 [85] -1.84661974  1.37793958  0.89887947  2.05246481  1.09777845  0.23401319
 [91] -0.33083486 -0.17228271 -0.36056516  1.07416009  1.08611743 -1.53482045
 [97] -2.36493721  0.93207706 -1.68222906  1.82034083
> colVars(tmp)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> colSd(tmp)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> colMax(tmp)
  [1] -0.04764571  0.42369991  1.21366898 -1.66518071 -1.62787577  0.69847342
  [7]  0.32388550 -1.99977070 -1.06047699  0.69479107 -0.19532168 -0.48400326
 [13] -0.09488060  0.29223023  0.23153379  0.50043390  0.19590072  0.19107194
 [19] -0.86754982 -1.91206373  1.57917630  1.11883713 -0.89400424 -0.28718493
 [25] -0.98897922  1.55262898  0.98053551  0.02016811  0.52954351  0.08922870
 [31]  2.08673070  0.08490351  1.23597268  1.43997381 -0.37043120  0.36847147
 [37]  0.64232676 -0.14143705 -0.67553335  0.48743755 -1.24261831  0.33190692
 [43]  0.05830338 -1.42265806  1.34714220 -0.71175918  0.34540791 -0.81316254
 [49] -0.53502929 -0.69744354 -1.43657165  3.09492764  0.63751763  1.88338619
 [55]  0.46702717  0.47185877  0.18578224  0.32354559 -1.10768832  0.18481690
 [61] -0.86919961 -0.49297725 -0.58681317 -0.27730039  0.93753535  0.42145860
 [67] -0.05529485  0.26416509 -1.03036573  0.36598562 -0.51458713  1.20774857
 [73] -1.63838017 -0.00703014 -1.99560859 -0.22213649  0.15348650  0.07330461
 [79] -0.47619157  1.26786270  1.09931814  0.92840668 -0.15945611 -0.48329825
 [85] -1.84661974  1.37793958  0.89887947  2.05246481  1.09777845  0.23401319
 [91] -0.33083486 -0.17228271 -0.36056516  1.07416009  1.08611743 -1.53482045
 [97] -2.36493721  0.93207706 -1.68222906  1.82034083
> colMin(tmp)
  [1] -0.04764571  0.42369991  1.21366898 -1.66518071 -1.62787577  0.69847342
  [7]  0.32388550 -1.99977070 -1.06047699  0.69479107 -0.19532168 -0.48400326
 [13] -0.09488060  0.29223023  0.23153379  0.50043390  0.19590072  0.19107194
 [19] -0.86754982 -1.91206373  1.57917630  1.11883713 -0.89400424 -0.28718493
 [25] -0.98897922  1.55262898  0.98053551  0.02016811  0.52954351  0.08922870
 [31]  2.08673070  0.08490351  1.23597268  1.43997381 -0.37043120  0.36847147
 [37]  0.64232676 -0.14143705 -0.67553335  0.48743755 -1.24261831  0.33190692
 [43]  0.05830338 -1.42265806  1.34714220 -0.71175918  0.34540791 -0.81316254
 [49] -0.53502929 -0.69744354 -1.43657165  3.09492764  0.63751763  1.88338619
 [55]  0.46702717  0.47185877  0.18578224  0.32354559 -1.10768832  0.18481690
 [61] -0.86919961 -0.49297725 -0.58681317 -0.27730039  0.93753535  0.42145860
 [67] -0.05529485  0.26416509 -1.03036573  0.36598562 -0.51458713  1.20774857
 [73] -1.63838017 -0.00703014 -1.99560859 -0.22213649  0.15348650  0.07330461
 [79] -0.47619157  1.26786270  1.09931814  0.92840668 -0.15945611 -0.48329825
 [85] -1.84661974  1.37793958  0.89887947  2.05246481  1.09777845  0.23401319
 [91] -0.33083486 -0.17228271 -0.36056516  1.07416009  1.08611743 -1.53482045
 [97] -2.36493721  0.93207706 -1.68222906  1.82034083
> colMedians(tmp)
  [1] -0.04764571  0.42369991  1.21366898 -1.66518071 -1.62787577  0.69847342
  [7]  0.32388550 -1.99977070 -1.06047699  0.69479107 -0.19532168 -0.48400326
 [13] -0.09488060  0.29223023  0.23153379  0.50043390  0.19590072  0.19107194
 [19] -0.86754982 -1.91206373  1.57917630  1.11883713 -0.89400424 -0.28718493
 [25] -0.98897922  1.55262898  0.98053551  0.02016811  0.52954351  0.08922870
 [31]  2.08673070  0.08490351  1.23597268  1.43997381 -0.37043120  0.36847147
 [37]  0.64232676 -0.14143705 -0.67553335  0.48743755 -1.24261831  0.33190692
 [43]  0.05830338 -1.42265806  1.34714220 -0.71175918  0.34540791 -0.81316254
 [49] -0.53502929 -0.69744354 -1.43657165  3.09492764  0.63751763  1.88338619
 [55]  0.46702717  0.47185877  0.18578224  0.32354559 -1.10768832  0.18481690
 [61] -0.86919961 -0.49297725 -0.58681317 -0.27730039  0.93753535  0.42145860
 [67] -0.05529485  0.26416509 -1.03036573  0.36598562 -0.51458713  1.20774857
 [73] -1.63838017 -0.00703014 -1.99560859 -0.22213649  0.15348650  0.07330461
 [79] -0.47619157  1.26786270  1.09931814  0.92840668 -0.15945611 -0.48329825
 [85] -1.84661974  1.37793958  0.89887947  2.05246481  1.09777845  0.23401319
 [91] -0.33083486 -0.17228271 -0.36056516  1.07416009  1.08611743 -1.53482045
 [97] -2.36493721  0.93207706 -1.68222906  1.82034083
> colRanges(tmp)
            [,1]      [,2]     [,3]      [,4]      [,5]      [,6]      [,7]
[1,] -0.04764571 0.4236999 1.213669 -1.665181 -1.627876 0.6984734 0.3238855
[2,] -0.04764571 0.4236999 1.213669 -1.665181 -1.627876 0.6984734 0.3238855
          [,8]      [,9]     [,10]      [,11]      [,12]      [,13]     [,14]
[1,] -1.999771 -1.060477 0.6947911 -0.1953217 -0.4840033 -0.0948806 0.2922302
[2,] -1.999771 -1.060477 0.6947911 -0.1953217 -0.4840033 -0.0948806 0.2922302
         [,15]     [,16]     [,17]     [,18]      [,19]     [,20]    [,21]
[1,] 0.2315338 0.5004339 0.1959007 0.1910719 -0.8675498 -1.912064 1.579176
[2,] 0.2315338 0.5004339 0.1959007 0.1910719 -0.8675498 -1.912064 1.579176
        [,22]      [,23]      [,24]      [,25]    [,26]     [,27]      [,28]
[1,] 1.118837 -0.8940042 -0.2871849 -0.9889792 1.552629 0.9805355 0.02016811
[2,] 1.118837 -0.8940042 -0.2871849 -0.9889792 1.552629 0.9805355 0.02016811
         [,29]     [,30]    [,31]      [,32]    [,33]    [,34]      [,35]
[1,] 0.5295435 0.0892287 2.086731 0.08490351 1.235973 1.439974 -0.3704312
[2,] 0.5295435 0.0892287 2.086731 0.08490351 1.235973 1.439974 -0.3704312
         [,36]     [,37]     [,38]      [,39]     [,40]     [,41]     [,42]
[1,] 0.3684715 0.6423268 -0.141437 -0.6755334 0.4874375 -1.242618 0.3319069
[2,] 0.3684715 0.6423268 -0.141437 -0.6755334 0.4874375 -1.242618 0.3319069
          [,43]     [,44]    [,45]      [,46]     [,47]      [,48]      [,49]
[1,] 0.05830338 -1.422658 1.347142 -0.7117592 0.3454079 -0.8131625 -0.5350293
[2,] 0.05830338 -1.422658 1.347142 -0.7117592 0.3454079 -0.8131625 -0.5350293
          [,50]     [,51]    [,52]     [,53]    [,54]     [,55]     [,56]
[1,] -0.6974435 -1.436572 3.094928 0.6375176 1.883386 0.4670272 0.4718588
[2,] -0.6974435 -1.436572 3.094928 0.6375176 1.883386 0.4670272 0.4718588
         [,57]     [,58]     [,59]     [,60]      [,61]      [,62]      [,63]
[1,] 0.1857822 0.3235456 -1.107688 0.1848169 -0.8691996 -0.4929772 -0.5868132
[2,] 0.1857822 0.3235456 -1.107688 0.1848169 -0.8691996 -0.4929772 -0.5868132
          [,64]     [,65]     [,66]       [,67]     [,68]     [,69]     [,70]
[1,] -0.2773004 0.9375353 0.4214586 -0.05529485 0.2641651 -1.030366 0.3659856
[2,] -0.2773004 0.9375353 0.4214586 -0.05529485 0.2641651 -1.030366 0.3659856
          [,71]    [,72]    [,73]       [,74]     [,75]      [,76]     [,77]
[1,] -0.5145871 1.207749 -1.63838 -0.00703014 -1.995609 -0.2221365 0.1534865
[2,] -0.5145871 1.207749 -1.63838 -0.00703014 -1.995609 -0.2221365 0.1534865
          [,78]      [,79]    [,80]    [,81]     [,82]      [,83]      [,84]
[1,] 0.07330461 -0.4761916 1.267863 1.099318 0.9284067 -0.1594561 -0.4832982
[2,] 0.07330461 -0.4761916 1.267863 1.099318 0.9284067 -0.1594561 -0.4832982
        [,85]   [,86]     [,87]    [,88]    [,89]     [,90]      [,91]
[1,] -1.84662 1.37794 0.8988795 2.052465 1.097778 0.2340132 -0.3308349
[2,] -1.84662 1.37794 0.8988795 2.052465 1.097778 0.2340132 -0.3308349
          [,92]      [,93]   [,94]    [,95]    [,96]     [,97]     [,98]
[1,] -0.1722827 -0.3605652 1.07416 1.086117 -1.53482 -2.364937 0.9320771
[2,] -0.1722827 -0.3605652 1.07416 1.086117 -1.53482 -2.364937 0.9320771
         [,99]   [,100]
[1,] -1.682229 1.820341
[2,] -1.682229 1.820341
> 
> 
> Max(tmp2)
[1] 1.86159
> Min(tmp2)
[1] -1.849252
> mean(tmp2)
[1] -0.04543387
> Sum(tmp2)
[1] -4.543387
> Var(tmp2)
[1] 0.7137603
> 
> rowMeans(tmp2)
  [1]  1.3553215869  0.5165942912  0.4933780300 -0.4288942730 -1.3275325428
  [6]  1.0102690065  0.6704068240 -1.4768391984 -0.0357733694 -0.1491428668
 [11] -0.6261669075 -0.8177415470 -0.4377280389 -0.8592072501 -0.8400311874
 [16]  0.4376424152  0.7859940972 -0.1324732259 -0.2312337070 -0.7792035013
 [21] -1.4867777282 -1.0714441363  0.7016955017 -0.6235126975 -0.2791327570
 [26]  1.0441354188 -0.6895971316  0.4275700920 -0.7257593253 -0.0822191816
 [31] -1.0461669279  0.5914295825  0.8323999197  0.0217841756  0.2328719617
 [36] -0.5090058699  1.2119402580  0.9972199246  0.3570501165 -0.6493198293
 [41] -0.1613807808  1.5613191429 -1.0192846522  0.5979846843  1.0224328453
 [46]  0.5709403436  0.5528472163 -0.0468597748 -0.5146629924  0.6654996737
 [51]  0.0008815718  0.1938498269  0.4231342264  0.2246394433  1.0935372234
 [56]  0.2754529125  1.0436051422 -0.4142529423 -1.0679337452 -0.0307097775
 [61] -0.4276623653  0.1047945144  0.9267415032 -0.8799488661 -0.8066413232
 [66] -0.3847122438  1.5594758673 -0.0945754731 -0.3533683841  0.9804855227
 [71] -0.2898093323  1.7444604467  0.3427328616 -0.1024969529 -1.3161404798
 [76] -1.4974152984 -1.4453274556 -0.7456323574  1.0998174901 -0.0972207469
 [81] -0.4964196104 -0.5605643682 -1.3946575635 -0.6543056651 -0.8140252649
 [86]  0.1497263408 -0.0477739739  1.8615898748  0.4014980011  1.7874782609
 [91]  0.3161226632 -0.1647050633  1.0339559781 -0.6587475472 -1.6815590121
 [96] -1.8492517376 -0.5306251435 -0.7143064995 -0.3081724728  0.1099590758
> rowSums(tmp2)
  [1]  1.3553215869  0.5165942912  0.4933780300 -0.4288942730 -1.3275325428
  [6]  1.0102690065  0.6704068240 -1.4768391984 -0.0357733694 -0.1491428668
 [11] -0.6261669075 -0.8177415470 -0.4377280389 -0.8592072501 -0.8400311874
 [16]  0.4376424152  0.7859940972 -0.1324732259 -0.2312337070 -0.7792035013
 [21] -1.4867777282 -1.0714441363  0.7016955017 -0.6235126975 -0.2791327570
 [26]  1.0441354188 -0.6895971316  0.4275700920 -0.7257593253 -0.0822191816
 [31] -1.0461669279  0.5914295825  0.8323999197  0.0217841756  0.2328719617
 [36] -0.5090058699  1.2119402580  0.9972199246  0.3570501165 -0.6493198293
 [41] -0.1613807808  1.5613191429 -1.0192846522  0.5979846843  1.0224328453
 [46]  0.5709403436  0.5528472163 -0.0468597748 -0.5146629924  0.6654996737
 [51]  0.0008815718  0.1938498269  0.4231342264  0.2246394433  1.0935372234
 [56]  0.2754529125  1.0436051422 -0.4142529423 -1.0679337452 -0.0307097775
 [61] -0.4276623653  0.1047945144  0.9267415032 -0.8799488661 -0.8066413232
 [66] -0.3847122438  1.5594758673 -0.0945754731 -0.3533683841  0.9804855227
 [71] -0.2898093323  1.7444604467  0.3427328616 -0.1024969529 -1.3161404798
 [76] -1.4974152984 -1.4453274556 -0.7456323574  1.0998174901 -0.0972207469
 [81] -0.4964196104 -0.5605643682 -1.3946575635 -0.6543056651 -0.8140252649
 [86]  0.1497263408 -0.0477739739  1.8615898748  0.4014980011  1.7874782609
 [91]  0.3161226632 -0.1647050633  1.0339559781 -0.6587475472 -1.6815590121
 [96] -1.8492517376 -0.5306251435 -0.7143064995 -0.3081724728  0.1099590758
> rowVars(tmp2)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowSd(tmp2)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowMax(tmp2)
  [1]  1.3553215869  0.5165942912  0.4933780300 -0.4288942730 -1.3275325428
  [6]  1.0102690065  0.6704068240 -1.4768391984 -0.0357733694 -0.1491428668
 [11] -0.6261669075 -0.8177415470 -0.4377280389 -0.8592072501 -0.8400311874
 [16]  0.4376424152  0.7859940972 -0.1324732259 -0.2312337070 -0.7792035013
 [21] -1.4867777282 -1.0714441363  0.7016955017 -0.6235126975 -0.2791327570
 [26]  1.0441354188 -0.6895971316  0.4275700920 -0.7257593253 -0.0822191816
 [31] -1.0461669279  0.5914295825  0.8323999197  0.0217841756  0.2328719617
 [36] -0.5090058699  1.2119402580  0.9972199246  0.3570501165 -0.6493198293
 [41] -0.1613807808  1.5613191429 -1.0192846522  0.5979846843  1.0224328453
 [46]  0.5709403436  0.5528472163 -0.0468597748 -0.5146629924  0.6654996737
 [51]  0.0008815718  0.1938498269  0.4231342264  0.2246394433  1.0935372234
 [56]  0.2754529125  1.0436051422 -0.4142529423 -1.0679337452 -0.0307097775
 [61] -0.4276623653  0.1047945144  0.9267415032 -0.8799488661 -0.8066413232
 [66] -0.3847122438  1.5594758673 -0.0945754731 -0.3533683841  0.9804855227
 [71] -0.2898093323  1.7444604467  0.3427328616 -0.1024969529 -1.3161404798
 [76] -1.4974152984 -1.4453274556 -0.7456323574  1.0998174901 -0.0972207469
 [81] -0.4964196104 -0.5605643682 -1.3946575635 -0.6543056651 -0.8140252649
 [86]  0.1497263408 -0.0477739739  1.8615898748  0.4014980011  1.7874782609
 [91]  0.3161226632 -0.1647050633  1.0339559781 -0.6587475472 -1.6815590121
 [96] -1.8492517376 -0.5306251435 -0.7143064995 -0.3081724728  0.1099590758
> rowMin(tmp2)
  [1]  1.3553215869  0.5165942912  0.4933780300 -0.4288942730 -1.3275325428
  [6]  1.0102690065  0.6704068240 -1.4768391984 -0.0357733694 -0.1491428668
 [11] -0.6261669075 -0.8177415470 -0.4377280389 -0.8592072501 -0.8400311874
 [16]  0.4376424152  0.7859940972 -0.1324732259 -0.2312337070 -0.7792035013
 [21] -1.4867777282 -1.0714441363  0.7016955017 -0.6235126975 -0.2791327570
 [26]  1.0441354188 -0.6895971316  0.4275700920 -0.7257593253 -0.0822191816
 [31] -1.0461669279  0.5914295825  0.8323999197  0.0217841756  0.2328719617
 [36] -0.5090058699  1.2119402580  0.9972199246  0.3570501165 -0.6493198293
 [41] -0.1613807808  1.5613191429 -1.0192846522  0.5979846843  1.0224328453
 [46]  0.5709403436  0.5528472163 -0.0468597748 -0.5146629924  0.6654996737
 [51]  0.0008815718  0.1938498269  0.4231342264  0.2246394433  1.0935372234
 [56]  0.2754529125  1.0436051422 -0.4142529423 -1.0679337452 -0.0307097775
 [61] -0.4276623653  0.1047945144  0.9267415032 -0.8799488661 -0.8066413232
 [66] -0.3847122438  1.5594758673 -0.0945754731 -0.3533683841  0.9804855227
 [71] -0.2898093323  1.7444604467  0.3427328616 -0.1024969529 -1.3161404798
 [76] -1.4974152984 -1.4453274556 -0.7456323574  1.0998174901 -0.0972207469
 [81] -0.4964196104 -0.5605643682 -1.3946575635 -0.6543056651 -0.8140252649
 [86]  0.1497263408 -0.0477739739  1.8615898748  0.4014980011  1.7874782609
 [91]  0.3161226632 -0.1647050633  1.0339559781 -0.6587475472 -1.6815590121
 [96] -1.8492517376 -0.5306251435 -0.7143064995 -0.3081724728  0.1099590758
> 
> colMeans(tmp2)
[1] -0.04543387
> colSums(tmp2)
[1] -4.543387
> colVars(tmp2)
[1] 0.7137603
> colSd(tmp2)
[1] 0.8448433
> colMax(tmp2)
[1] 1.86159
> colMin(tmp2)
[1] -1.849252
> colMedians(tmp2)
[1] -0.09589811
> colRanges(tmp2)
          [,1]
[1,] -1.849252
[2,]  1.861590
> 
> dataset1 <- matrix(dataset1,1,100)
> 
> agree.checks(tmp,dataset1)
> 
> dataset2 <- matrix(dataset2,100,1)
> agree.checks(tmp2,dataset2)
>   
> 
> tmp <- createBufferedMatrix(10,10)
> 
> tmp[1:10,1:10] <- rnorm(100)
> colApply(tmp,sum)
 [1]  0.8410623 -2.9915744 -0.9758651  0.8505082  0.6217855  0.5502328
 [7] -0.5723942  2.1694380  4.8480636 -2.1717648
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -1.5336714
[2,] -0.5158610
[3,] -0.3403378
[4,]  0.9648380
[5,]  1.8101380
> 
> rowApply(tmp,sum)
 [1]  1.18848994 -3.37321711  3.53517451 -1.96710961  2.77698674 -1.00116283
 [7] -0.01265218  1.08788258  0.70224866  0.23285126
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    9    4    5   10    9    3    2    4    5     2
 [2,]   10    2    9    5    2    7    5    6    1     1
 [3,]    2    3    7    3    4    2    8    3    7     4
 [4,]    5    6    8    7   10    6    3    8    3     8
 [5,]    6   10    6    9    3    8    7    5    4     5
 [6,]    7    9    2    8    7    4    1    9    2    10
 [7,]    3    1    3    1    8   10    6    1    9     3
 [8,]    4    7    4    6    5    1   10   10    6     6
 [9,]    8    5    1    2    6    9    9    7   10     9
[10,]    1    8   10    4    1    5    4    2    8     7
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1] -0.2433403  1.6167624  1.2902952 -0.1617286  5.1529367 -0.4545207
 [7]  2.0909262 -2.6051265 -0.8903206  1.0948163 -0.4160645  2.5979256
[13] -2.7106449 -2.7754178  1.8350931  1.2284905 -0.3014075  2.5854042
[19]  1.5722766  3.9234574
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -1.0271896
[2,] -0.7939910
[3,] -0.5494153
[4,]  0.6509934
[5,]  1.4762622
> 
> rowApply(tmp,sum)
[1]  5.385987  7.788901  3.060699  3.508965 -5.314738
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]   13    3    6   17    4
[2,]   11   11   18    2   15
[3,]   16   10    4    5   19
[4,]   14    7    7   12    7
[5,]    5   18   11   20   20
> 
> 
> as.matrix(tmp)
           [,1]       [,2]       [,3]       [,4]       [,5]       [,6]
[1,]  0.6509934  0.2952786  1.1493449  0.6739745 -0.4329897 -0.5476622
[2,] -0.7939910  0.3977886  0.3964099  0.1372806  1.2779508  0.8904971
[3,] -0.5494153  1.5615060 -0.9465873 -0.3682573  0.2342893 -1.4412285
[4,]  1.4762622 -1.0507526 -0.5955685  0.1051105  2.5714197 -0.4929743
[5,] -1.0271896  0.4129418  1.2866961 -0.7098369  1.5022666  1.1368473
            [,7]       [,8]       [,9]      [,10]       [,11]       [,12]
[1,]  0.07555772 -1.7683617  0.2546979  0.3761531  1.32044470 -0.48022339
[2,]  1.63566461  0.5386587  0.4288513 -0.2114270 -0.13057095  1.24881259
[3,]  2.23016590  1.1327616  0.3514466  0.0751897 -0.76176669  2.24625524
[4,]  0.37209078 -0.5293134 -0.7353329  1.6958665 -0.83369783 -0.02779518
[5,] -2.22255283 -1.9788717 -1.1899835 -0.8409661 -0.01047375 -0.38912368
          [,13]        [,14]      [,15]      [,16]      [,17]      [,18]
[1,] -2.3715147  0.007271716  1.2356238  0.2371778 -0.2987448  2.3778584
[2,]  0.3302294 -1.304913009  1.2733967  1.8268247  0.3002784  0.5700834
[3,]  0.2563808  1.172148851 -2.0153071 -0.1257112 -1.0961057  0.2691873
[4,] -0.4744132 -1.906579677  0.9268771 -0.2271472  0.9579250 -0.0990776
[5,] -0.4513272 -0.743345680  0.4145026 -0.4826536 -0.1647604 -0.5326474
          [,19]       [,20]
[1,]  0.8663882  1.76471828
[2,] -1.1031178  0.08019398
[3,]  0.7040027  0.13174344
[4,]  0.3218547  2.05421062
[5,]  0.7831488 -0.10740890
> 
> 
> 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 :  649  bytes.
Disk usage :  200  bytes.
> subBufferedMatrix(tmp,,5:8)
BufferedMatrix object
Matrix size:  5 4 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  562  bytes.
Disk usage :  160  bytes.
> subBufferedMatrix(tmp,1:3,)
BufferedMatrix object
Matrix size:  3 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.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.7401616 -0.5874095 -0.1438969 -1.06994 -0.8715083 -0.9254001 0.4272944
          col8     col9     col10      col11     col12     col13      col14
row1 0.0244524 2.154605 0.4141418 -0.7289562 0.2294296 0.3819205 -0.5944203
        col15     col16   col17     col18     col19      col20
row1 0.253426 -0.701349 1.21457 -2.560244 0.8434416 -0.8462005
> tmp[,"col10"]
          col10
row1  0.4141418
row2  0.6604377
row3 -0.8371744
row4 -0.5436415
row5 -0.4100300
> tmp[c("row1","row5"),]
           col1       col2       col3       col4       col5       col6
row1 -0.7401616 -0.5874095 -0.1438969 -1.0699399 -0.8715083 -0.9254001
row5  1.6409686  1.2683068  0.6641412 -0.5796682  1.4467724 -0.7069563
           col7      col8       col9      col10      col11     col12     col13
row1  0.4272944 0.0244524  2.1546047  0.4141418 -0.7289562 0.2294296 0.3819205
row5 -0.3276793 0.8888086 -0.9515867 -0.4100300 -1.7429764 0.0256444 0.7325767
          col14     col15     col16      col17      col18      col19      col20
row1 -0.5944203 0.2534260 -0.701349 1.21457021 -2.5602435  0.8434416 -0.8462005
row5 -0.5335327 0.4235039  1.899293 0.09026396 -0.8749482 -2.1661669  1.0294120
> tmp[,c("col6","col20")]
           col6      col20
row1 -0.9254001 -0.8462005
row2 -0.6890943  2.5980301
row3  0.2131983  1.8747287
row4  0.5651600 -0.6207736
row5 -0.7069563  1.0294120
> tmp[c("row1","row5"),c("col6","col20")]
           col6      col20
row1 -0.9254001 -0.8462005
row5 -0.7069563  1.0294120
> 
> 
> 
> 
> 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.57473 49.54615 49.64705 50.43388 50.98757 103.9326 48.82927 49.52994
         col9    col10    col11    col12    col13    col14    col15    col16
row1 49.26642 48.36573 51.76759 50.30139 49.56621 49.84843 51.39449 49.77583
        col17    col18    col19    col20
row1 50.23878 49.57823 49.16568 101.8904
> tmp[,"col10"]
        col10
row1 48.36573
row2 31.13415
row3 32.29492
row4 30.33303
row5 50.29288
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 49.57473 49.54615 49.64705 50.43388 50.98757 103.9326 48.82927 49.52994
row5 50.67734 48.29103 50.50547 50.56011 50.89606 104.1095 49.23392 50.74667
         col9    col10    col11    col12    col13    col14    col15    col16
row1 49.26642 48.36573 51.76759 50.30139 49.56621 49.84843 51.39449 49.77583
row5 48.97644 50.29288 49.94650 49.19401 49.51162 50.02394 48.95789 50.63880
        col17    col18    col19    col20
row1 50.23878 49.57823 49.16568 101.8904
row5 49.97162 49.99593 49.97864 104.8237
> tmp[,c("col6","col20")]
          col6     col20
row1 103.93263 101.89035
row2  75.31604  76.64545
row3  75.39096  75.93981
row4  74.27764  74.92286
row5 104.10946 104.82374
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 103.9326 101.8904
row5 104.1095 104.8237
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 103.9326 101.8904
row5 104.1095 104.8237
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
          col13
[1,]  0.7433850
[2,] -0.1902363
[3,] -1.3816473
[4,] -0.2670351
[5,]  0.7891613
> tmp[,c("col17","col7")]
            col17       col7
[1,]  0.726932406  0.5635134
[2,] -1.231683787  1.4316758
[3,] -0.483798186  0.7130561
[4,] -0.933828771  1.5762865
[5,]  0.004428764 -1.5973958
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
           col6      col20
[1,]  0.2920597 -1.1119522
[2,] -1.4017867 -0.3639717
[3,]  0.6961889  0.3314851
[4,] -1.1066367  0.9147008
[5,] -0.4152902  1.1618630
> subBufferedMatrix(tmp,1,c("col6"))[,1]
          col1
[1,] 0.2920597
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
           col6
[1,]  0.2920597
[2,] -1.4017867
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> 
> 
> 
> subBufferedMatrix(tmp,c("row3","row1"),)[,1:20]
         [,1]       [,2]       [,3]      [,4]      [,5]       [,6]       [,7]
row3 0.597746 -1.1631222 -0.7868561 0.7768415 -2.125649  0.4657129  0.8455369
row1 2.030242  0.5218745 -1.1624411 0.2933306  1.251656 -0.1118006 -0.6164078
           [,8]       [,9]      [,10]      [,11]     [,12]    [,13]      [,14]
row3  0.4645391  1.3382248 0.10601032 -0.2617539 -2.351351 1.094008  0.1440177
row1 -2.8636706 -0.5398261 0.06241422  2.0618644 -2.095297 1.647240 -0.3408358
          [,15]      [,16]     [,17]      [,18]     [,19]      [,20]
row3 -1.1508330  0.4176617 0.2483707 -0.9586383 2.6988618 -0.7443758
row1 -0.7002277 -0.4408351 0.0649593  0.2191479 0.3519081  0.4999523
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
           [,1]        [,2]      [,3]    [,4]      [,5]     [,6]      [,7]
row2 -0.7599736 -0.05420045 0.8584207 0.27014 0.5188521 1.961042 0.1139909
           [,8]       [,9]      [,10]
row2 -0.6066908 -0.6934539 -0.5900433
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
          [,1]     [,2]     [,3]       [,4]     [,5]       [,6]      [,7]
row5 0.4802051 1.949861 1.907583 -0.2711089 0.374061 0.03550773 -1.191956
         [,8]     [,9]      [,10]      [,11]      [,12]      [,13]    [,14]
row5 1.772662 1.686802 0.00361559 -0.3316702 0.04551935 -0.9193993 1.630391
         [,15]    [,16]     [,17]    [,18]     [,19]    [,20]
row5 0.4234438 1.580103 0.8727558 1.030376 -2.181484 1.716032
> 
> 
> 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: 0xc9dd786c0>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM42545166cc72"
 [2] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM425433f87a1e"
 [3] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM42547e196239"
 [4] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM4254347fccdc"
 [5] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM425432629a71"
 [6] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM425467898a8e"
 [7] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM425476e7a5bc"
 [8] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM4254623216a0"
 [9] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM4254466b94bd"
[10] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM425440f22869"
[11] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM42545a3b26ce"
[12] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM42546170cca9"
[13] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM4254348c9d39"
[14] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM42547ba62422"
[15] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM4254588e7399"
> 
> 
> ### 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: 0xc9dd79260>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0xc9dd79260>
Warning message:
In dir.create(new.directory) :
  '/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0xc9dd79260>
> rowMedians(tmp)
  [1]  0.562914800 -0.523635770 -0.271990087 -0.496941754  0.099412984
  [6]  0.257678141 -0.186631407  0.341572782  0.456883973  0.207866486
 [11] -0.092267806 -0.037505261 -0.004541341 -0.782712962 -0.173602255
 [16]  0.177394934  0.335087577  0.700349142  0.129584070  0.430268390
 [21] -0.126226609  0.455726341 -0.222446429 -0.315364873 -0.449976742
 [26]  0.149739108  0.074740558  0.312959529 -0.231307317  0.230017697
 [31]  0.143433233  0.084302482  0.212069348 -0.191558141 -0.206887755
 [36] -0.111776914  0.581573319 -0.367168631  0.167257381  0.102498502
 [41] -0.142564601  0.285094345 -0.123998134  0.261597310  0.598386896
 [46]  0.184094876  0.133903781 -0.144011803 -0.124319736  0.056488670
 [51] -0.097976412  0.673357109 -0.141212615  0.463576305  0.162695752
 [56] -0.200743544 -0.022198975 -0.488023681 -0.140167622 -0.141085918
 [61] -0.627627208  0.405468262  0.432335075  0.197446468  0.686827370
 [66] -0.214868930 -0.615416008 -0.651831935 -0.540044118 -0.435708491
 [71]  0.470700304 -0.426654095  0.434311324  0.138830318 -0.061510190
 [76]  0.747865014  0.645183725 -0.375565445  0.046190436 -0.133998267
 [81] -0.017169665 -0.306096646  0.084253790 -0.000267398  0.358964265
 [86]  0.495919812  0.701622420 -0.035341074  0.157787982 -0.138934643
 [91]  0.265661761 -0.225436903  0.292539078  0.113369944 -0.046811052
 [96]  0.036946207 -0.183755368  0.688327505 -0.338458890  0.172711164
[101]  0.119800950  0.314421490  0.125373933 -0.144418753  0.064795486
[106] -0.123834659 -0.512077513 -0.309230527 -0.524411942 -0.391978874
[111]  0.328315623  0.230847110  0.466015761  0.103560035  0.046963368
[116] -0.229589823  0.507063105  0.096237842 -0.187748332 -0.354196134
[121] -0.160161801  0.195830787  0.083097330 -0.173955845 -0.614093131
[126] -0.054702302 -0.302934449 -0.125755029  0.267778193 -0.349132632
[131]  0.029518516  0.683283964 -0.169275713  0.303748688  0.304162295
[136]  0.094189357  0.101099843 -0.148398440 -0.523340996 -0.176594225
[141] -0.570155411  0.785239178 -0.062467608  0.107062680  0.060568845
[146] -0.248378973 -0.237605215 -0.562167956  0.091540453  0.169209349
[151] -0.079656703  0.089754759 -0.060928837 -0.439472192 -0.252381110
[156] -0.011380045 -0.082469870  0.016781743  0.188437539  0.086531219
[161] -0.202845377 -0.138877135  0.699616176  0.064046918  0.442888488
[166]  0.267054386  0.134475473  0.256099072  0.068600641  0.014768851
[171] -0.088928780  0.084238904  0.481913164  0.339633788 -0.287041015
[176]  0.010065862 -0.298434101 -0.175145757 -0.082578522  0.126564363
[181] -0.104526455  0.225453141 -0.190956663  0.172110575  0.175535839
[186] -0.226375046 -0.469830601  0.337390013  0.234137777  0.238655500
[191]  0.420871002  0.046490803 -0.299125861  0.158828420  0.344540631
[196] -0.271440412  0.379499628 -0.458751911 -0.311197878  0.063170248
[201] -0.065384108  0.143506632  0.049558001 -0.391902862 -0.440337875
[206]  0.285632192 -0.328262959 -0.594283280  0.911329411  0.286229296
[211]  0.736814089  0.098536630 -0.033931638 -0.896960210  0.114157335
[216]  0.277407990 -0.125080963  0.213132781  0.195153301  0.385835133
[221]  0.431666768 -0.121005963 -0.062968232 -0.233335505  0.379006203
[226] -0.717300626 -0.237796023 -0.612611546 -0.272747959  0.111396428
> 
> proc.time()
   user  system elapsed 
  0.763   5.081   5.960 

BufferedMatrix.Rcheck/tests/rawCalltesting.Rout


R version 4.6.0 alpha (2026-04-08 r89818)
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: 0x101a90510>
> .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: 0x101a90510>
> .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: 0x101a90510>
> .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: 0x101a90510>
> 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: 0xace4a4000>
> .Call("R_bm_AddColumn",P)
<pointer: 0xace4a4000>
> .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: 0xace4a4000>
> .Call("R_bm_AddColumn",P)
<pointer: 0xace4a4000>
> .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: 0xace4a4000>
> 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: 0xace4a4060>
> .Call("R_bm_AddColumn",P)
<pointer: 0xace4a4060>
> .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: 0xace4a4060>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0xace4a4060>
> .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: 0xace4a4060>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0xace4a4060>
> .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: 0xace4a4060>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0xace4a4060>
> .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: 0xace4a4060>
> 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: 0xace4a4180>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0xace4a4180>
> .Call("R_bm_AddColumn",P)
<pointer: 0xace4a4180>
> .Call("R_bm_AddColumn",P)
<pointer: 0xace4a4180>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile44f0494c1c15" "BufferedMatrixFile44f057e822e9"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile44f0494c1c15" "BufferedMatrixFile44f057e822e9"
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0xace4a42a0>
> .Call("R_bm_AddColumn",P)
<pointer: 0xace4a42a0>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0xace4a42a0>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0xace4a42a0>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0xace4a42a0>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0xace4a42a0>
> .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: 0xace4a4420>
> .Call("R_bm_AddColumn",P)
<pointer: 0xace4a4420>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0xace4a4420>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0xace4a4420>
> 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: 0xace4a4540>
> .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: 0xace4a4540>
> rm(P)
> 
> proc.time()
   user  system elapsed 
  0.133   0.054   0.184 

BufferedMatrix.Rcheck/tests/Rcodetesting.Rout


R version 4.6.0 alpha (2026-04-08 r89818)
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.127   0.033   0.154 

Example timings