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

This page was generated on 2025-11-22 11:39 -0500 (Sat, 22 Nov 2025).

HostnameOSArch (*)R versionInstalled pkgs
nebbiolo1Linux (Ubuntu 24.04.3 LTS)x86_64R Under development (unstable) (2025-10-20 r88955) -- "Unsuffered Consequences" 4829
lconwaymacOS 12.7.6 Montereyx86_64R Under development (unstable) (2025-10-21 r88958) -- "Unsuffered Consequences" 4603
kjohnson3macOS 13.7.7 Venturaarm64R Under development (unstable) (2025-11-04 r88984) -- "Unsuffered Consequences" 4567
Click on any hostname to see more info about the system (e.g. compilers)      (*) as reported by 'uname -p', except on Windows and Mac OS X

Package 252/2327HostnameOS / ArchINSTALLBUILDCHECKBUILD BIN
BufferedMatrix 1.75.0  (landing page)
Ben Bolstad
Snapshot Date: 2025-11-21 13:40 -0500 (Fri, 21 Nov 2025)
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 -0500 (Wed, 29 Oct 2025)
nebbiolo1Linux (Ubuntu 24.04.3 LTS) / x86_64  OK    OK    OK  UNNEEDED, same version is already published
lconwaymacOS 12.7.6 Monterey / x86_64  OK    OK    WARNINGS    OK  UNNEEDED, same version is already published
kjohnson3macOS 13.7.7 Ventura / arm64  OK    OK    WARNINGS    OK  UNNEEDED, same version is already published


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: 2025-11-21 18:47:54 -0500 (Fri, 21 Nov 2025)
EndedAt: 2025-11-21 18:48:15 -0500 (Fri, 21 Nov 2025)
EllapsedTime: 21.2 seconds
RetCode: 0
Status:   WARNINGS  
CheckDir: BufferedMatrix.Rcheck
Warnings: 1

Command output

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


* using log directory ‘/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck’
* using R Under development (unstable) (2025-11-04 r88984)
* using platform: aarch64-apple-darwin20
* R was compiled by
    Apple clang version 16.0.0 (clang-1600.0.26.6)
    GNU Fortran (GCC) 14.2.0
* running under: macOS Ventura 13.7.8
* using session charset: UTF-8
* 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 15.0.0 (clang-1500.1.0.2.5)’
* used SDK: ‘MacOSX11.3.1.sdk’
* checking installed package size ... OK
* checking package directory ... OK
* checking ‘build’ directory ... OK
* checking DESCRIPTION meta-information ... OK
* checking top-level files ... OK
* checking for left-over files ... OK
* checking index information ... OK
* checking package subdirectories ... OK
* checking code files for non-ASCII characters ... OK
* checking R files for syntax errors ... OK
* checking whether the package can be loaded ... OK
* checking whether the package can be loaded with stated dependencies ... OK
* checking whether the package can be unloaded cleanly ... OK
* checking whether the namespace can be loaded with stated dependencies ... OK
* checking whether the namespace can be unloaded cleanly ... OK
* checking dependencies in R code ... OK
* checking S3 generic/method consistency ... OK
* checking replacement functions ... OK
* checking foreign function calls ... OK
* checking R code for possible problems ... OK
* checking Rd files ... NOTE
checkRd: (-1) BufferedMatrix-class.Rd:209: Lost braces; missing escapes or markup?
   209 |     $x^{power}$ elementwise of the matrix
       |        ^
prepare_Rd: createBufferedMatrix.Rd:26: Dropping empty section \keyword
prepare_Rd: createBufferedMatrix.Rd:17-18: Dropping empty section \details
prepare_Rd: createBufferedMatrix.Rd:15-16: Dropping empty section \value
prepare_Rd: createBufferedMatrix.Rd:19-20: Dropping empty section \references
prepare_Rd: createBufferedMatrix.Rd:21-22: Dropping empty section \seealso
prepare_Rd: createBufferedMatrix.Rd:23-24: Dropping empty section \examples
* checking Rd metadata ... OK
* checking Rd cross-references ... OK
* checking for missing documentation entries ... OK
* checking for code/documentation mismatches ... OK
* checking Rd \usage sections ... OK
* checking Rd contents ... OK
* checking for unstated dependencies in examples ... OK
* checking line endings in C/C++/Fortran sources/headers ... OK
* checking compiled code ... 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-arm64/Resources/library’
* installing *source* package ‘BufferedMatrix’ ...
** this is package ‘BufferedMatrix’ version ‘1.75.0’
** using staged installation
** libs
using C compiler: ‘Apple clang version 15.0.0 (clang-1500.1.0.2.5)’
using SDK: ‘MacOSX11.3.1.sdk’
clang -arch arm64 -std=gnu2x -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/opt/R/arm64/include    -fPIC  -falign-functions=64 -Wall -g -O2  -c RBufferedMatrix.c -o RBufferedMatrix.o
clang -arch arm64 -std=gnu2x -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/opt/R/arm64/include    -fPIC  -falign-functions=64 -Wall -g -O2  -c doubleBufferedMatrix.c -o doubleBufferedMatrix.o
doubleBufferedMatrix.c:1580:7: warning: logical not is only applied to the left hand side of this bitwise operator [-Wlogical-not-parentheses]
  if (!(Matrix->readonly) & setting){
      ^                   ~
doubleBufferedMatrix.c:1580:7: note: add parentheses after the '!' to evaluate the bitwise operator first
  if (!(Matrix->readonly) & setting){
      ^
       (                           )
doubleBufferedMatrix.c:1580:7: note: add parentheses around left hand side expression to silence this warning
  if (!(Matrix->readonly) & setting){
      ^
      (                  )
doubleBufferedMatrix.c:3327:12: warning: unused function 'sort_double' [-Wunused-function]
static int sort_double(const double *a1,const double *a2){
           ^
2 warnings generated.
clang -arch arm64 -std=gnu2x -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/opt/R/arm64/include    -fPIC  -falign-functions=64 -Wall -g -O2  -c doubleBufferedMatrix_C_tests.c -o doubleBufferedMatrix_C_tests.o
clang -arch arm64 -std=gnu2x -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/opt/R/arm64/include    -fPIC  -falign-functions=64 -Wall -g -O2  -c init_package.c -o init_package.o
clang -arch arm64 -std=gnu2x -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -L/Library/Frameworks/R.framework/Resources/lib -L/opt/R/arm64/lib -o BufferedMatrix.so RBufferedMatrix.o doubleBufferedMatrix.o doubleBufferedMatrix_C_tests.o init_package.o -F/Library/Frameworks/R.framework/.. -framework R
installing to /Library/Frameworks/R.framework/Versions/4.6-arm64/Resources/library/00LOCK-BufferedMatrix/00new/BufferedMatrix/libs
** R
** inst
** byte-compile and prepare package for lazy loading
Creating a new generic function for ‘rowMeans’ in package ‘BufferedMatrix’
Creating a new generic function for ‘rowSums’ in package ‘BufferedMatrix’
Creating a new generic function for ‘colMeans’ in package ‘BufferedMatrix’
Creating a new generic function for ‘colSums’ in package ‘BufferedMatrix’
Creating a generic function for ‘ncol’ from package ‘base’ in package ‘BufferedMatrix’
Creating a generic function for ‘nrow’ from package ‘base’ in package ‘BufferedMatrix’
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
** checking absolute paths in shared objects and dynamic libraries
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (BufferedMatrix)

Tests output

BufferedMatrix.Rcheck/tests/c_code_level_tests.Rout


R Under development (unstable) (2025-11-04 r88984) -- "Unsuffered Consequences"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: aarch64-apple-darwin20

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

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

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

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

Attaching package: 'BufferedMatrix'

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

    colMeans, colSums, rowMeans, rowSums

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

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

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

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

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

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

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

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

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

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

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

[[1]]
[1] 0

> 
> proc.time()
   user  system elapsed 
  0.117   0.045   0.187 

BufferedMatrix.Rcheck/tests/objectTesting.Rout


R Under development (unstable) (2025-11-04 r88984) -- "Unsuffered Consequences"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: aarch64-apple-darwin20

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

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

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

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

Attaching package: 'BufferedMatrix'

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

    colMeans, colSums, rowMeans, rowSums

> 
> 
> ### this is used to control how many repetitions in something below
> ### higher values result in more checks.
> nreps <-100 ##20000
> 
> 
> ## test creation and some simple assignments and subsetting operations
> 
> ## first on single elements
> tmp <- createBufferedMatrix(1000,10)
> 
> tmp[10,5]
[1] 0
> tmp[10,5] <- 10
> tmp[10,5]
[1] 10
> tmp[10,5] <- 12.445
> tmp[10,5]
[1] 12.445
> 
> 
> 
> ## now testing accessing multiple elements
> tmp2 <- createBufferedMatrix(10,20)
> 
> 
> tmp2[3,1] <- 51.34
> tmp2[9,2] <- 9.87654
> tmp2[,1:2]
       [,1]    [,2]
 [1,]  0.00 0.00000
 [2,]  0.00 0.00000
 [3,] 51.34 0.00000
 [4,]  0.00 0.00000
 [5,]  0.00 0.00000
 [6,]  0.00 0.00000
 [7,]  0.00 0.00000
 [8,]  0.00 0.00000
 [9,]  0.00 9.87654
[10,]  0.00 0.00000
> tmp2[,-(3:20)]
       [,1]    [,2]
 [1,]  0.00 0.00000
 [2,]  0.00 0.00000
 [3,] 51.34 0.00000
 [4,]  0.00 0.00000
 [5,]  0.00 0.00000
 [6,]  0.00 0.00000
 [7,]  0.00 0.00000
 [8,]  0.00 0.00000
 [9,]  0.00 9.87654
[10,]  0.00 0.00000
> tmp2[3,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
[1,] 51.34    0    0    0    0    0    0    0    0     0     0     0     0
     [,14] [,15] [,16] [,17] [,18] [,19] [,20]
[1,]     0     0     0     0     0     0     0
> tmp2[-3,]
      [,1]    [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [2,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [3,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [4,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [5,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [6,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [7,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [8,]    0 9.87654    0    0    0    0    0    0    0     0     0     0     0
 [9,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
      [,14] [,15] [,16] [,17] [,18] [,19] [,20]
 [1,]     0     0     0     0     0     0     0
 [2,]     0     0     0     0     0     0     0
 [3,]     0     0     0     0     0     0     0
 [4,]     0     0     0     0     0     0     0
 [5,]     0     0     0     0     0     0     0
 [6,]     0     0     0     0     0     0     0
 [7,]     0     0     0     0     0     0     0
 [8,]     0     0     0     0     0     0     0
 [9,]     0     0     0     0     0     0     0
> tmp2[2,1:3]
     [,1] [,2] [,3]
[1,]    0    0    0
> tmp2[3:9,1:3]
      [,1]    [,2] [,3]
[1,] 51.34 0.00000    0
[2,]  0.00 0.00000    0
[3,]  0.00 0.00000    0
[4,]  0.00 0.00000    0
[5,]  0.00 0.00000    0
[6,]  0.00 0.00000    0
[7,]  0.00 9.87654    0
> tmp2[-4,-4]
       [,1]    [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [2,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [3,] 51.34 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [4,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [5,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [6,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [7,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [8,]  0.00 9.87654    0    0    0    0    0    0    0     0     0     0     0
 [9,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
      [,14] [,15] [,16] [,17] [,18] [,19]
 [1,]     0     0     0     0     0     0
 [2,]     0     0     0     0     0     0
 [3,]     0     0     0     0     0     0
 [4,]     0     0     0     0     0     0
 [5,]     0     0     0     0     0     0
 [6,]     0     0     0     0     0     0
 [7,]     0     0     0     0     0     0
 [8,]     0     0     0     0     0     0
 [9,]     0     0     0     0     0     0
> 
> ## now testing accessing/assigning multiple elements
> tmp3 <- createBufferedMatrix(10,10)
> 
> for (i in 1:10){
+   for (j in 1:10){
+     tmp3[i,j] <- (j-1)*10 + i
+   }
+ }
> 
> tmp3[2:4,2:4]
     [,1] [,2] [,3]
[1,]   12   22   32
[2,]   13   23   33
[3,]   14   24   34
> tmp3[c(-10),c(2:4,2:4,10,1,2,1:10,10:1)]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]   11   21   31   11   21   31   91    1   11     1    11    21    31
 [2,]   12   22   32   12   22   32   92    2   12     2    12    22    32
 [3,]   13   23   33   13   23   33   93    3   13     3    13    23    33
 [4,]   14   24   34   14   24   34   94    4   14     4    14    24    34
 [5,]   15   25   35   15   25   35   95    5   15     5    15    25    35
 [6,]   16   26   36   16   26   36   96    6   16     6    16    26    36
 [7,]   17   27   37   17   27   37   97    7   17     7    17    27    37
 [8,]   18   28   38   18   28   38   98    8   18     8    18    28    38
 [9,]   19   29   39   19   29   39   99    9   19     9    19    29    39
      [,14] [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24] [,25]
 [1,]    41    51    61    71    81    91    91    81    71    61    51    41
 [2,]    42    52    62    72    82    92    92    82    72    62    52    42
 [3,]    43    53    63    73    83    93    93    83    73    63    53    43
 [4,]    44    54    64    74    84    94    94    84    74    64    54    44
 [5,]    45    55    65    75    85    95    95    85    75    65    55    45
 [6,]    46    56    66    76    86    96    96    86    76    66    56    46
 [7,]    47    57    67    77    87    97    97    87    77    67    57    47
 [8,]    48    58    68    78    88    98    98    88    78    68    58    48
 [9,]    49    59    69    79    89    99    99    89    79    69    59    49
      [,26] [,27] [,28] [,29]
 [1,]    31    21    11     1
 [2,]    32    22    12     2
 [3,]    33    23    13     3
 [4,]    34    24    14     4
 [5,]    35    25    15     5
 [6,]    36    26    16     6
 [7,]    37    27    17     7
 [8,]    38    28    18     8
 [9,]    39    29    19     9
> tmp3[-c(1:5),-c(6:10)]
     [,1] [,2] [,3] [,4] [,5]
[1,]    6   16   26   36   46
[2,]    7   17   27   37   47
[3,]    8   18   28   38   48
[4,]    9   19   29   39   49
[5,]   10   20   30   40   50
> 
> ## assignment of whole columns
> tmp3[,1] <- c(1:10*100.0)
> tmp3[,1:2] <- tmp3[,1:2]*100
> tmp3[,1:2] <- tmp3[,2:1]
> tmp3[,1:2]
      [,1]  [,2]
 [1,] 1100 1e+04
 [2,] 1200 2e+04
 [3,] 1300 3e+04
 [4,] 1400 4e+04
 [5,] 1500 5e+04
 [6,] 1600 6e+04
 [7,] 1700 7e+04
 [8,] 1800 8e+04
 [9,] 1900 9e+04
[10,] 2000 1e+05
> 
> 
> tmp3[,-1] <- tmp3[,1:9]
> tmp3[,1:10]
      [,1] [,2]  [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,] 1100 1100 1e+04   21   31   41   51   61   71    81
 [2,] 1200 1200 2e+04   22   32   42   52   62   72    82
 [3,] 1300 1300 3e+04   23   33   43   53   63   73    83
 [4,] 1400 1400 4e+04   24   34   44   54   64   74    84
 [5,] 1500 1500 5e+04   25   35   45   55   65   75    85
 [6,] 1600 1600 6e+04   26   36   46   56   66   76    86
 [7,] 1700 1700 7e+04   27   37   47   57   67   77    87
 [8,] 1800 1800 8e+04   28   38   48   58   68   78    88
 [9,] 1900 1900 9e+04   29   39   49   59   69   79    89
[10,] 2000 2000 1e+05   30   40   50   60   70   80    90
> 
> tmp3[,1:2] <- rep(1,10)
> tmp3[,1:2] <- rep(1,20)
> tmp3[,1:2] <- matrix(c(1:5),1,5)
> 
> tmp3[,-c(1:8)] <- matrix(c(1:5),1,5)
> 
> tmp3[1,] <- 1:10
> tmp3[1,]
     [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,]    1    2    3    4    5    6    7    8    9    10
> tmp3[-1,] <- c(1,2)
> tmp3[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    1    2    3    4    5    6    7    8    9    10
 [2,]    1    2    1    2    1    2    1    2    1     2
 [3,]    2    1    2    1    2    1    2    1    2     1
 [4,]    1    2    1    2    1    2    1    2    1     2
 [5,]    2    1    2    1    2    1    2    1    2     1
 [6,]    1    2    1    2    1    2    1    2    1     2
 [7,]    2    1    2    1    2    1    2    1    2     1
 [8,]    1    2    1    2    1    2    1    2    1     2
 [9,]    2    1    2    1    2    1    2    1    2     1
[10,]    1    2    1    2    1    2    1    2    1     2
> tmp3[-c(1:8),] <- matrix(c(1:5),1,5)
> tmp3[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    1    2    3    4    5    6    7    8    9    10
 [2,]    1    2    1    2    1    2    1    2    1     2
 [3,]    2    1    2    1    2    1    2    1    2     1
 [4,]    1    2    1    2    1    2    1    2    1     2
 [5,]    2    1    2    1    2    1    2    1    2     1
 [6,]    1    2    1    2    1    2    1    2    1     2
 [7,]    2    1    2    1    2    1    2    1    2     1
 [8,]    1    2    1    2    1    2    1    2    1     2
 [9,]    1    3    5    2    4    1    3    5    2     4
[10,]    2    4    1    3    5    2    4    1    3     5
> 
> 
> tmp3[1:2,1:2] <- 5555.04
> tmp3[-(1:2),1:2] <- 1234.56789
> 
> 
> 
> ## testing accessors for the directory and prefix
> directory(tmp3)
[1] "/Users/biocbuild/bbs-3.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 481248 25.8    1058085 56.6         NA   633817 33.9
Vcells 891449  6.9    8388608 64.0     196608  2110969 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] "Fri Nov 21 18:48:06 2025"
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> date()
[1] "Fri Nov 21 18:48:06 2025"
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,which.col] == test.matrix[which.row,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> 
> 
> RowMode(tmp2)
<pointer: 0x600002f10060>
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   which.col <- sample(1:20,1)
+   if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,5,replace=TRUE)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> date()
[1] "Fri Nov 21 18:48:07 2025"
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col <- sample(1:20,5,replace=TRUE)
+   if (!all(tmp2[which.row,which.col] == test.matrix[which.row,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> date()
[1] "Fri Nov 21 18:48:08 2025"
> 
> ColMode(tmp2)
<pointer: 0x600002f10060>
> 
> 
> 
> ### Now testing assignments
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+ 
+   new.data <- rnorm(20)
+   tmp2[which.row,] <- new.data
+   test.matrix[which.row,] <- new.data
+   if (rep > 1){
+     if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+   
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   new.data <- rnorm(10)
+   tmp2[,which.col] <- new.data
+   test.matrix[,which.col]<- new.data
+ 
+   if (rep > 1){
+     if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.col <- which.col
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,5,replace=TRUE)
+   new.data <- matrix(rnorm(50),5,10)
+   tmp2[,which.col] <- new.data
+   test.matrix[,which.col]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.col <- which.col
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   new.data <- matrix(rnorm(50),5,10)
+   tmp2[which.row,] <- new.data
+   test.matrix[which.row,]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col  <- sample(1:20,5,replace=TRUE)
+   new.data <- matrix(rnorm(25),5,5)
+   tmp2[which.row,which.col] <- new.data
+   test.matrix[which.row,which.col]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[prev.row,prev.col] == test.matrix[prev.row,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+   prev.col <- which.col
+ }
> 
> 
> 
> 
> ###
> ###
> ### testing some more functions
> ###
> 
> 
> 
> ## duplication function
> tmp5 <- duplicate(tmp2)
> 
> # making sure really did copy everything.
> tmp5[1,1] <- tmp5[1,1] +100.00
> 
> if (tmp5[1,1] == tmp2[1,1]){
+   stop("Problem with duplication")
+ }
> 
> 
> 
> 
> ### testing elementwise applying of functions
> 
> tmp5[1:4,1:4]
            [,1]        [,2]       [,3]       [,4]
[1,] 99.59988262  0.64011320  1.2422656 -1.2409613
[2,]  0.28329177 -0.08356476  0.1098194  0.4346209
[3,]  0.73653531  0.42752891  1.2631419 -0.5212862
[4,]  0.04594001 -1.59874409 -0.4121492  0.4758044
> 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,] 99.59988262 0.64011320 1.2422656 1.2409613
[2,]  0.28329177 0.08356476 0.1098194 0.4346209
[3,]  0.73653531 0.42752891 1.2631419 0.5212862
[4,]  0.04594001 1.59874409 0.4121492 0.4758044
> 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,] 9.9799741 0.8000707 1.1145697 1.1139844
[2,] 0.5322516 0.2890757 0.3313901 0.6592578
[3,] 0.8582164 0.6538569 1.1238959 0.7220015
[4,] 0.2143362 1.2644145 0.6419885 0.6897858
> 
> 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,] 224.39962 33.64082 37.38796 37.38081
[2,]  30.60581 27.97432 28.42372 32.02720
[3,]  34.31870 31.96610 37.50210 32.74130
[4,]  27.18930 39.24289 31.83203 32.37366
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x600002f2c000>
> exp(tmp5)
<pointer: 0x600002f2c000>
> log(tmp5,2)
<pointer: 0x600002f2c000>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 467.0584
> Min(tmp5)
[1] 53.06863
> mean(tmp5)
[1] 72.90127
> Sum(tmp5)
[1] 14580.25
> Var(tmp5)
[1] 860.0851
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 89.89476 66.16648 69.79431 71.30081 69.70639 71.91394 72.36997 74.15161
 [9] 71.53782 72.17661
> rowSums(tmp5)
 [1] 1797.895 1323.330 1395.886 1426.016 1394.128 1438.279 1447.399 1483.032
 [9] 1430.756 1443.532
> rowVars(tmp5)
 [1] 7953.03478   43.81921   72.04197   81.49526   49.41584   65.23881
 [7]   84.14739   52.69908   98.52823  127.03597
> rowSd(tmp5)
 [1] 89.179789  6.619608  8.487754  9.027473  7.029640  8.077054  9.173189
 [8]  7.259413  9.926139 11.271024
> rowMax(tmp5)
 [1] 467.05842  77.04879  80.77823  89.28298  79.44679  87.81618  93.14296
 [8]  84.77745 101.19437  89.59321
> rowMin(tmp5)
 [1] 57.56814 57.02443 54.14181 55.66458 53.06863 54.10333 57.41398 58.77549
 [9] 60.18935 54.07888
> 
> colMeans(tmp5)
 [1] 109.97986  71.52208  70.26195  71.40641  66.24230  68.66953  68.06567
 [8]  69.51849  78.65039  71.17514  72.07320  72.79928  68.40959  74.55787
[15]  70.31510  71.93233  68.92124  73.49856  70.98233  69.04408
> colSums(tmp5)
 [1] 1099.7986  715.2208  702.6195  714.0641  662.4230  686.6953  680.6567
 [8]  695.1849  786.5039  711.7514  720.7320  727.9928  684.0959  745.5787
[15]  703.1510  719.3233  689.2124  734.9856  709.8233  690.4408
> colVars(tmp5)
 [1] 15791.81409    68.07923    42.88815    56.38012    59.85438    57.84944
 [7]   112.74914   191.80844    85.69469    52.03883   127.31228    53.07028
[13]    74.77391    72.00922    42.52310    63.72988    49.31290    51.48571
[19]   109.02251    93.89236
> colSd(tmp5)
 [1] 125.665485   8.251014   6.548905   7.508669   7.736561   7.605882
 [7]  10.618340  13.849492   9.257143   7.213795  11.283274   7.284935
[13]   8.647191   8.485825   6.520974   7.983100   7.022314   7.175354
[19]  10.441385   9.689807
> colMax(tmp5)
 [1] 467.05842  81.72214  79.17652  85.23394  80.21260  78.87288  86.40319
 [8] 101.19437  93.14296  81.34614  88.15926  80.67893  80.69434  86.28734
[15]  79.42847  80.18977  84.08860  82.06023  84.03251  89.28298
> colMin(tmp5)
 [1] 56.59097 58.22489 59.16025 63.08613 59.61135 57.56814 54.44037 54.07888
 [9] 61.31659 58.79995 54.14181 58.75205 53.06863 57.41398 58.77549 58.78127
[17] 63.10103 63.40214 55.66458 55.40097
> 
> 
> ### 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] 89.89476 66.16648 69.79431 71.30081 69.70639 71.91394       NA 74.15161
 [9] 71.53782 72.17661
> rowSums(tmp5)
 [1] 1797.895 1323.330 1395.886 1426.016 1394.128 1438.279       NA 1483.032
 [9] 1430.756 1443.532
> rowVars(tmp5)
 [1] 7953.03478   43.81921   72.04197   81.49526   49.41584   65.23881
 [7]   85.24627   52.69908   98.52823  127.03597
> rowSd(tmp5)
 [1] 89.179789  6.619608  8.487754  9.027473  7.029640  8.077054  9.232890
 [8]  7.259413  9.926139 11.271024
> rowMax(tmp5)
 [1] 467.05842  77.04879  80.77823  89.28298  79.44679  87.81618        NA
 [8]  84.77745 101.19437  89.59321
> rowMin(tmp5)
 [1] 57.56814 57.02443 54.14181 55.66458 53.06863 54.10333       NA 58.77549
 [9] 60.18935 54.07888
> 
> colMeans(tmp5)
 [1] 109.97986  71.52208  70.26195  71.40641  66.24230  68.66953  68.06567
 [8]  69.51849  78.65039  71.17514  72.07320  72.79928  68.40959  74.55787
[15]  70.31510        NA  68.92124  73.49856  70.98233  69.04408
> colSums(tmp5)
 [1] 1099.7986  715.2208  702.6195  714.0641  662.4230  686.6953  680.6567
 [8]  695.1849  786.5039  711.7514  720.7320  727.9928  684.0959  745.5787
[15]  703.1510        NA  689.2124  734.9856  709.8233  690.4408
> colVars(tmp5)
 [1] 15791.81409    68.07923    42.88815    56.38012    59.85438    57.84944
 [7]   112.74914   191.80844    85.69469    52.03883   127.31228    53.07028
[13]    74.77391    72.00922    42.52310          NA    49.31290    51.48571
[19]   109.02251    93.89236
> colSd(tmp5)
 [1] 125.665485   8.251014   6.548905   7.508669   7.736561   7.605882
 [7]  10.618340  13.849492   9.257143   7.213795  11.283274   7.284935
[13]   8.647191   8.485825   6.520974         NA   7.022314   7.175354
[19]  10.441385   9.689807
> colMax(tmp5)
 [1] 467.05842  81.72214  79.17652  85.23394  80.21260  78.87288  86.40319
 [8] 101.19437  93.14296  81.34614  88.15926  80.67893  80.69434  86.28734
[15]  79.42847        NA  84.08860  82.06023  84.03251  89.28298
> colMin(tmp5)
 [1] 56.59097 58.22489 59.16025 63.08613 59.61135 57.56814 54.44037 54.07888
 [9] 61.31659 58.79995 54.14181 58.75205 53.06863 57.41398 58.77549       NA
[17] 63.10103 63.40214 55.66458 55.40097
> 
> Max(tmp5,na.rm=TRUE)
[1] 467.0584
> Min(tmp5,na.rm=TRUE)
[1] 53.06863
> mean(tmp5,na.rm=TRUE)
[1] 72.86464
> Sum(tmp5,na.rm=TRUE)
[1] 14500.06
> Var(tmp5,na.rm=TRUE)
[1] 864.1593
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 89.89476 66.16648 69.79431 71.30081 69.70639 71.91394 71.95840 74.15161
 [9] 71.53782 72.17661
> rowSums(tmp5,na.rm=TRUE)
 [1] 1797.895 1323.330 1395.886 1426.016 1394.128 1438.279 1367.210 1483.032
 [9] 1430.756 1443.532
> rowVars(tmp5,na.rm=TRUE)
 [1] 7953.03478   43.81921   72.04197   81.49526   49.41584   65.23881
 [7]   85.24627   52.69908   98.52823  127.03597
> rowSd(tmp5,na.rm=TRUE)
 [1] 89.179789  6.619608  8.487754  9.027473  7.029640  8.077054  9.232890
 [8]  7.259413  9.926139 11.271024
> rowMax(tmp5,na.rm=TRUE)
 [1] 467.05842  77.04879  80.77823  89.28298  79.44679  87.81618  93.14296
 [8]  84.77745 101.19437  89.59321
> rowMin(tmp5,na.rm=TRUE)
 [1] 57.56814 57.02443 54.14181 55.66458 53.06863 54.10333 57.41398 58.77549
 [9] 60.18935 54.07888
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 109.97986  71.52208  70.26195  71.40641  66.24230  68.66953  68.06567
 [8]  69.51849  78.65039  71.17514  72.07320  72.79928  68.40959  74.55787
[15]  70.31510  71.01484  68.92124  73.49856  70.98233  69.04408
> colSums(tmp5,na.rm=TRUE)
 [1] 1099.7986  715.2208  702.6195  714.0641  662.4230  686.6953  680.6567
 [8]  695.1849  786.5039  711.7514  720.7320  727.9928  684.0959  745.5787
[15]  703.1510  639.1335  689.2124  734.9856  709.8233  690.4408
> colVars(tmp5,na.rm=TRUE)
 [1] 15791.81409    68.07923    42.88815    56.38012    59.85438    57.84944
 [7]   112.74914   191.80844    85.69469    52.03883   127.31228    53.07028
[13]    74.77391    72.00922    42.52310    62.22594    49.31290    51.48571
[19]   109.02251    93.89236
> colSd(tmp5,na.rm=TRUE)
 [1] 125.665485   8.251014   6.548905   7.508669   7.736561   7.605882
 [7]  10.618340  13.849492   9.257143   7.213795  11.283274   7.284935
[13]   8.647191   8.485825   6.520974   7.888342   7.022314   7.175354
[19]  10.441385   9.689807
> colMax(tmp5,na.rm=TRUE)
 [1] 467.05842  81.72214  79.17652  85.23394  80.21260  78.87288  86.40319
 [8] 101.19437  93.14296  81.34614  88.15926  80.67893  80.69434  86.28734
[15]  79.42847  79.44679  84.08860  82.06023  84.03251  89.28298
> colMin(tmp5,na.rm=TRUE)
 [1] 56.59097 58.22489 59.16025 63.08613 59.61135 57.56814 54.44037 54.07888
 [9] 61.31659 58.79995 54.14181 58.75205 53.06863 57.41398 58.77549 58.78127
[17] 63.10103 63.40214 55.66458 55.40097
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1] 89.89476 66.16648 69.79431 71.30081 69.70639 71.91394      NaN 74.15161
 [9] 71.53782 72.17661
> rowSums(tmp5,na.rm=TRUE)
 [1] 1797.895 1323.330 1395.886 1426.016 1394.128 1438.279    0.000 1483.032
 [9] 1430.756 1443.532
> rowVars(tmp5,na.rm=TRUE)
 [1] 7953.03478   43.81921   72.04197   81.49526   49.41584   65.23881
 [7]         NA   52.69908   98.52823  127.03597
> rowSd(tmp5,na.rm=TRUE)
 [1] 89.179789  6.619608  8.487754  9.027473  7.029640  8.077054        NA
 [8]  7.259413  9.926139 11.271024
> rowMax(tmp5,na.rm=TRUE)
 [1] 467.05842  77.04879  80.77823  89.28298  79.44679  87.81618        NA
 [8]  84.77745 101.19437  89.59321
> rowMin(tmp5,na.rm=TRUE)
 [1] 57.56814 57.02443 54.14181 55.66458 53.06863 54.10333       NA 58.77549
 [9] 60.18935 54.07888
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1] 114.67545  70.38874  70.76195  70.26284  66.70934  69.67759  68.56168
 [8]  68.34488  77.04011  70.67403  72.82914  71.92376  68.48468  76.46275
[15]  70.20254       NaN  69.15632  72.85301  70.63581  68.54663
> colSums(tmp5,na.rm=TRUE)
 [1] 1032.0790  633.4987  636.8575  632.3655  600.3840  627.0983  617.0551
 [8]  615.1039  693.3610  636.0663  655.4623  647.3139  616.3622  688.1647
[15]  631.8229    0.0000  622.4068  655.6771  635.7223  616.9197
> colVars(tmp5,na.rm=TRUE)
 [1] 17517.74523    62.13897    45.43667    48.71523    64.88227    53.64842
 [7]   124.07504   200.28917    67.23507    55.71872   136.79748    51.08062
[13]    84.05721    40.18912    47.69595          NA    54.85534    53.23314
[19]   121.29950   102.84503
> colSd(tmp5,na.rm=TRUE)
 [1] 132.354619   7.882827   6.740673   6.979629   8.054953   7.324508
 [7]  11.138898  14.152356   8.199699   7.464497  11.696045   7.147071
[13]   9.168272   6.339489   6.906225         NA   7.406439   7.296104
[19]  11.013605  10.141254
> colMax(tmp5,na.rm=TRUE)
 [1] 467.05842  81.67893  79.17652  85.23394  80.21260  78.87288  86.40319
 [8] 101.19437  89.59321  81.34614  88.15926  79.53841  80.69434  86.28734
[15]  79.42847      -Inf  84.08860  82.06023  84.03251  89.28298
> colMin(tmp5,na.rm=TRUE)
 [1] 56.59097 58.22489 59.16025 63.08613 59.61135 57.56814 54.44037 54.07888
 [9] 61.31659 58.79995 54.14181 58.75205 53.06863 64.30275 58.77549      Inf
[17] 63.10103 63.40214 55.66458 55.40097
> 
> 
> 
> 
> 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] 138.7820 223.6776 302.4201 122.8138 265.1761 262.2337 470.4329 190.3688
 [9] 182.8756 164.0837
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 138.7820 223.6776 302.4201 122.8138 265.1761 262.2337 470.4329 190.3688
 [9] 182.8756 164.0837
> 
> 
> 
> copymatrix <- matrix(rnorm(200,150,15),10,20)
> 
> tmp5[1:10,1:20] <- copymatrix
> which.row <- 1
> which.col  <- 3
> cat(which.row," ",which.col,"\n")
1   3 
> tmp5[which.row,which.col] <- NA
> copymatrix[which.row,which.col] <- NA
> 
> colVars(tmp5,na.rm=TRUE)-apply(copymatrix,2,var,na.rm=TRUE)
 [1]  2.842171e-14 -2.842171e-14  1.421085e-14  1.421085e-14  5.684342e-14
 [6]  1.421085e-13  5.684342e-14  7.105427e-14 -1.847411e-13  1.136868e-13
[11] -9.947598e-14  0.000000e+00 -2.842171e-14  2.842171e-14  7.105427e-14
[16]  5.115908e-13 -1.136868e-13  0.000000e+00  0.000000e+00  0.000000e+00
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> ## making sure these things agree
> ##
> ## first when there is no NA
> 
> 
> 
> agree.checks <- function(buff.matrix,r.matrix,err.tol=1e-10){
+ 
+   if (Max(buff.matrix,na.rm=TRUE) != max(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Max")
+   }
+   
+ 
+   if (Min(buff.matrix,na.rm=TRUE) != min(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Min")
+   }
+ 
+ 
+   if (abs(Sum(buff.matrix,na.rm=TRUE)- sum(r.matrix,na.rm=TRUE)) > err.tol){
+ 
+     cat(Sum(buff.matrix,na.rm=TRUE),"\n")
+     cat(sum(r.matrix,na.rm=TRUE),"\n")
+     cat(Sum(buff.matrix,na.rm=TRUE) - sum(r.matrix,na.rm=TRUE),"\n")
+     
+     stop("No agreement in Sum")
+   }
+   
+   if (abs(mean(buff.matrix,na.rm=TRUE) - mean(r.matrix,na.rm=TRUE)) > err.tol){
+     stop("No agreement in mean")
+   }
+   
+   
+   if(abs(Var(buff.matrix,na.rm=TRUE) - var(as.vector(r.matrix),na.rm=TRUE)) > err.tol){
+     stop("No agreement in Var")
+   }
+   
+   
+ 
+   if(any(abs(rowMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,mean,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowMeans")
+   }
+   
+   
+   if(any(abs(colMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,mean,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colMeans")
+   }
+   
+   
+   if(any(abs(rowSums(buff.matrix,na.rm=TRUE)  -  apply(r.matrix,1,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in rowSums")
+   }
+   
+   
+   if(any(abs(colSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colSums")
+   }
+   
+   ### this is to get around the fact that R doesn't like to compute NA on an entire vector of NA when 
+   ### computing variance
+   my.Var <- function(x,na.rm=FALSE){
+    if (all(is.na(x))){
+      return(NA)
+    } else {
+      var(x,na.rm=na.rm)
+    }
+ 
+   }
+   
+   if(any(abs(rowVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+   
+   
+   if(any(abs(colVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+ 
+ 
+   if(any(abs(rowMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+ 
+   if(any(abs(colMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+   
+   
+   if(any(abs(rowMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+   
+ 
+   if(any(abs(colMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+ 
+   if(any(abs(colMedians(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,median,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMedian")
+   }
+ 
+   if(any(abs(colRanges(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,range,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colRanges")
+   }
+ 
+ 
+   
+ }
> 
> 
> 
> 
> 
> 
> 
> 
> 
> for (rep in 1:20){
+   copymatrix <- matrix(rnorm(200,150,15),10,20)
+   
+   tmp5[1:10,1:20] <- copymatrix
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ## now lets assign some NA values and check agreement
+ 
+   which.row <- sample(1:10,1,replace=TRUE)
+   which.col  <- sample(1:20,1,replace=TRUE)
+   
+   cat(which.row," ",which.col,"\n")
+   
+   tmp5[which.row,which.col] <- NA
+   copymatrix[which.row,which.col] <- NA
+   
+   agree.checks(tmp5,copymatrix)
+ 
+   ## make an entire row NA
+   tmp5[which.row,] <- NA
+   copymatrix[which.row,] <- NA
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ### also make an entire col NA
+   tmp5[,which.col] <- NA
+   copymatrix[,which.col] <- NA
+ 
+   agree.checks(tmp5,copymatrix)
+ 
+   ### now make 1 element non NA with NA in the rest of row and column
+ 
+   tmp5[which.row,which.col] <- rnorm(1,150,15)
+   copymatrix[which.row,which.col] <- tmp5[which.row,which.col]
+ 
+   agree.checks(tmp5,copymatrix)
+ }
4   18 
5   4 
10   12 
6   8 
9   6 
6   5 
9   13 
7   6 
5   5 
2   8 
2   11 
6   15 
8   18 
3   3 
9   2 
2   16 
8   2 
2   1 
6   7 
8   1 
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.000294
> Min(tmp)
[1] -2.509954
> mean(tmp)
[1] 0.01643013
> Sum(tmp)
[1] 1.643013
> Var(tmp)
[1] 0.9284526
> 
> rowMeans(tmp)
[1] 0.01643013
> rowSums(tmp)
[1] 1.643013
> rowVars(tmp)
[1] 0.9284526
> rowSd(tmp)
[1] 0.9635625
> rowMax(tmp)
[1] 3.000294
> rowMin(tmp)
[1] -2.509954
> 
> colMeans(tmp)
  [1] -1.278727805  0.381574889 -1.055807478  0.459458116 -0.057979802
  [6]  0.602458127 -1.192007418 -0.032860750 -0.627298594  1.079860560
 [11] -1.691780230  0.134527672  0.000124484  1.611647090  1.244193422
 [16]  0.710890287 -1.353727366  1.598308279  0.378377202 -0.785414091
 [21] -0.715790244  1.535718155  1.464595387  1.874706051  0.353570328
 [26]  0.404615642  0.472365134  0.375941730 -0.670159378 -0.932639325
 [31]  0.507796637 -1.526511409 -1.007497204 -0.783364344 -0.469695128
 [36] -0.414515081  0.665375224 -1.235049760  1.291724442  0.101624974
 [41] -0.296129195 -0.241113043 -0.610398934  0.228086031  0.308536848
 [46] -0.324526679  0.498380409 -0.169548594 -0.459281825 -0.370421022
 [51]  0.223948952 -0.045246475 -0.304653136  0.497727978 -0.363362689
 [56]  0.631417796 -1.174866095 -1.519281072 -0.482992799 -2.509954013
 [61]  1.090783979 -1.187135597  1.061005211 -0.103468640 -1.271050198
 [66]  1.797871668 -0.634820221 -1.689661462 -1.317365866 -1.438298732
 [71]  0.450698960  0.101690384 -0.185431376 -0.837037339  0.731302184
 [76] -0.366302289  0.433831513 -0.941197317  0.212311964  0.209600027
 [81]  1.242302773  0.793283843  0.925812406 -0.466710467  1.350162083
 [86] -0.318819840  0.861079380 -1.017971818 -0.182112916  0.301125754
 [91]  1.313969273  0.176784458  0.078528493  0.290298086 -0.063919427
 [96]  2.237928064  0.211536784  0.145326519 -0.288162321  3.000294479
> colSums(tmp)
  [1] -1.278727805  0.381574889 -1.055807478  0.459458116 -0.057979802
  [6]  0.602458127 -1.192007418 -0.032860750 -0.627298594  1.079860560
 [11] -1.691780230  0.134527672  0.000124484  1.611647090  1.244193422
 [16]  0.710890287 -1.353727366  1.598308279  0.378377202 -0.785414091
 [21] -0.715790244  1.535718155  1.464595387  1.874706051  0.353570328
 [26]  0.404615642  0.472365134  0.375941730 -0.670159378 -0.932639325
 [31]  0.507796637 -1.526511409 -1.007497204 -0.783364344 -0.469695128
 [36] -0.414515081  0.665375224 -1.235049760  1.291724442  0.101624974
 [41] -0.296129195 -0.241113043 -0.610398934  0.228086031  0.308536848
 [46] -0.324526679  0.498380409 -0.169548594 -0.459281825 -0.370421022
 [51]  0.223948952 -0.045246475 -0.304653136  0.497727978 -0.363362689
 [56]  0.631417796 -1.174866095 -1.519281072 -0.482992799 -2.509954013
 [61]  1.090783979 -1.187135597  1.061005211 -0.103468640 -1.271050198
 [66]  1.797871668 -0.634820221 -1.689661462 -1.317365866 -1.438298732
 [71]  0.450698960  0.101690384 -0.185431376 -0.837037339  0.731302184
 [76] -0.366302289  0.433831513 -0.941197317  0.212311964  0.209600027
 [81]  1.242302773  0.793283843  0.925812406 -0.466710467  1.350162083
 [86] -0.318819840  0.861079380 -1.017971818 -0.182112916  0.301125754
 [91]  1.313969273  0.176784458  0.078528493  0.290298086 -0.063919427
 [96]  2.237928064  0.211536784  0.145326519 -0.288162321  3.000294479
> colVars(tmp)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> colSd(tmp)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> colMax(tmp)
  [1] -1.278727805  0.381574889 -1.055807478  0.459458116 -0.057979802
  [6]  0.602458127 -1.192007418 -0.032860750 -0.627298594  1.079860560
 [11] -1.691780230  0.134527672  0.000124484  1.611647090  1.244193422
 [16]  0.710890287 -1.353727366  1.598308279  0.378377202 -0.785414091
 [21] -0.715790244  1.535718155  1.464595387  1.874706051  0.353570328
 [26]  0.404615642  0.472365134  0.375941730 -0.670159378 -0.932639325
 [31]  0.507796637 -1.526511409 -1.007497204 -0.783364344 -0.469695128
 [36] -0.414515081  0.665375224 -1.235049760  1.291724442  0.101624974
 [41] -0.296129195 -0.241113043 -0.610398934  0.228086031  0.308536848
 [46] -0.324526679  0.498380409 -0.169548594 -0.459281825 -0.370421022
 [51]  0.223948952 -0.045246475 -0.304653136  0.497727978 -0.363362689
 [56]  0.631417796 -1.174866095 -1.519281072 -0.482992799 -2.509954013
 [61]  1.090783979 -1.187135597  1.061005211 -0.103468640 -1.271050198
 [66]  1.797871668 -0.634820221 -1.689661462 -1.317365866 -1.438298732
 [71]  0.450698960  0.101690384 -0.185431376 -0.837037339  0.731302184
 [76] -0.366302289  0.433831513 -0.941197317  0.212311964  0.209600027
 [81]  1.242302773  0.793283843  0.925812406 -0.466710467  1.350162083
 [86] -0.318819840  0.861079380 -1.017971818 -0.182112916  0.301125754
 [91]  1.313969273  0.176784458  0.078528493  0.290298086 -0.063919427
 [96]  2.237928064  0.211536784  0.145326519 -0.288162321  3.000294479
> colMin(tmp)
  [1] -1.278727805  0.381574889 -1.055807478  0.459458116 -0.057979802
  [6]  0.602458127 -1.192007418 -0.032860750 -0.627298594  1.079860560
 [11] -1.691780230  0.134527672  0.000124484  1.611647090  1.244193422
 [16]  0.710890287 -1.353727366  1.598308279  0.378377202 -0.785414091
 [21] -0.715790244  1.535718155  1.464595387  1.874706051  0.353570328
 [26]  0.404615642  0.472365134  0.375941730 -0.670159378 -0.932639325
 [31]  0.507796637 -1.526511409 -1.007497204 -0.783364344 -0.469695128
 [36] -0.414515081  0.665375224 -1.235049760  1.291724442  0.101624974
 [41] -0.296129195 -0.241113043 -0.610398934  0.228086031  0.308536848
 [46] -0.324526679  0.498380409 -0.169548594 -0.459281825 -0.370421022
 [51]  0.223948952 -0.045246475 -0.304653136  0.497727978 -0.363362689
 [56]  0.631417796 -1.174866095 -1.519281072 -0.482992799 -2.509954013
 [61]  1.090783979 -1.187135597  1.061005211 -0.103468640 -1.271050198
 [66]  1.797871668 -0.634820221 -1.689661462 -1.317365866 -1.438298732
 [71]  0.450698960  0.101690384 -0.185431376 -0.837037339  0.731302184
 [76] -0.366302289  0.433831513 -0.941197317  0.212311964  0.209600027
 [81]  1.242302773  0.793283843  0.925812406 -0.466710467  1.350162083
 [86] -0.318819840  0.861079380 -1.017971818 -0.182112916  0.301125754
 [91]  1.313969273  0.176784458  0.078528493  0.290298086 -0.063919427
 [96]  2.237928064  0.211536784  0.145326519 -0.288162321  3.000294479
> colMedians(tmp)
  [1] -1.278727805  0.381574889 -1.055807478  0.459458116 -0.057979802
  [6]  0.602458127 -1.192007418 -0.032860750 -0.627298594  1.079860560
 [11] -1.691780230  0.134527672  0.000124484  1.611647090  1.244193422
 [16]  0.710890287 -1.353727366  1.598308279  0.378377202 -0.785414091
 [21] -0.715790244  1.535718155  1.464595387  1.874706051  0.353570328
 [26]  0.404615642  0.472365134  0.375941730 -0.670159378 -0.932639325
 [31]  0.507796637 -1.526511409 -1.007497204 -0.783364344 -0.469695128
 [36] -0.414515081  0.665375224 -1.235049760  1.291724442  0.101624974
 [41] -0.296129195 -0.241113043 -0.610398934  0.228086031  0.308536848
 [46] -0.324526679  0.498380409 -0.169548594 -0.459281825 -0.370421022
 [51]  0.223948952 -0.045246475 -0.304653136  0.497727978 -0.363362689
 [56]  0.631417796 -1.174866095 -1.519281072 -0.482992799 -2.509954013
 [61]  1.090783979 -1.187135597  1.061005211 -0.103468640 -1.271050198
 [66]  1.797871668 -0.634820221 -1.689661462 -1.317365866 -1.438298732
 [71]  0.450698960  0.101690384 -0.185431376 -0.837037339  0.731302184
 [76] -0.366302289  0.433831513 -0.941197317  0.212311964  0.209600027
 [81]  1.242302773  0.793283843  0.925812406 -0.466710467  1.350162083
 [86] -0.318819840  0.861079380 -1.017971818 -0.182112916  0.301125754
 [91]  1.313969273  0.176784458  0.078528493  0.290298086 -0.063919427
 [96]  2.237928064  0.211536784  0.145326519 -0.288162321  3.000294479
> colRanges(tmp)
          [,1]      [,2]      [,3]      [,4]       [,5]      [,6]      [,7]
[1,] -1.278728 0.3815749 -1.055807 0.4594581 -0.0579798 0.6024581 -1.192007
[2,] -1.278728 0.3815749 -1.055807 0.4594581 -0.0579798 0.6024581 -1.192007
            [,8]       [,9]    [,10]    [,11]     [,12]       [,13]    [,14]
[1,] -0.03286075 -0.6272986 1.079861 -1.69178 0.1345277 0.000124484 1.611647
[2,] -0.03286075 -0.6272986 1.079861 -1.69178 0.1345277 0.000124484 1.611647
        [,15]     [,16]     [,17]    [,18]     [,19]      [,20]      [,21]
[1,] 1.244193 0.7108903 -1.353727 1.598308 0.3783772 -0.7854141 -0.7157902
[2,] 1.244193 0.7108903 -1.353727 1.598308 0.3783772 -0.7854141 -0.7157902
        [,22]    [,23]    [,24]     [,25]     [,26]     [,27]     [,28]
[1,] 1.535718 1.464595 1.874706 0.3535703 0.4046156 0.4723651 0.3759417
[2,] 1.535718 1.464595 1.874706 0.3535703 0.4046156 0.4723651 0.3759417
          [,29]      [,30]     [,31]     [,32]     [,33]      [,34]      [,35]
[1,] -0.6701594 -0.9326393 0.5077966 -1.526511 -1.007497 -0.7833643 -0.4696951
[2,] -0.6701594 -0.9326393 0.5077966 -1.526511 -1.007497 -0.7833643 -0.4696951
          [,36]     [,37]    [,38]    [,39]    [,40]      [,41]     [,42]
[1,] -0.4145151 0.6653752 -1.23505 1.291724 0.101625 -0.2961292 -0.241113
[2,] -0.4145151 0.6653752 -1.23505 1.291724 0.101625 -0.2961292 -0.241113
          [,43]    [,44]     [,45]      [,46]     [,47]      [,48]      [,49]
[1,] -0.6103989 0.228086 0.3085368 -0.3245267 0.4983804 -0.1695486 -0.4592818
[2,] -0.6103989 0.228086 0.3085368 -0.3245267 0.4983804 -0.1695486 -0.4592818
         [,50]    [,51]       [,52]      [,53]    [,54]      [,55]     [,56]
[1,] -0.370421 0.223949 -0.04524648 -0.3046531 0.497728 -0.3633627 0.6314178
[2,] -0.370421 0.223949 -0.04524648 -0.3046531 0.497728 -0.3633627 0.6314178
         [,57]     [,58]      [,59]     [,60]    [,61]     [,62]    [,63]
[1,] -1.174866 -1.519281 -0.4829928 -2.509954 1.090784 -1.187136 1.061005
[2,] -1.174866 -1.519281 -0.4829928 -2.509954 1.090784 -1.187136 1.061005
          [,64]    [,65]    [,66]      [,67]     [,68]     [,69]     [,70]
[1,] -0.1034686 -1.27105 1.797872 -0.6348202 -1.689661 -1.317366 -1.438299
[2,] -0.1034686 -1.27105 1.797872 -0.6348202 -1.689661 -1.317366 -1.438299
        [,71]     [,72]      [,73]      [,74]     [,75]      [,76]     [,77]
[1,] 0.450699 0.1016904 -0.1854314 -0.8370373 0.7313022 -0.3663023 0.4338315
[2,] 0.450699 0.1016904 -0.1854314 -0.8370373 0.7313022 -0.3663023 0.4338315
          [,78]    [,79]  [,80]    [,81]     [,82]     [,83]      [,84]
[1,] -0.9411973 0.212312 0.2096 1.242303 0.7932838 0.9258124 -0.4667105
[2,] -0.9411973 0.212312 0.2096 1.242303 0.7932838 0.9258124 -0.4667105
        [,85]      [,86]     [,87]     [,88]      [,89]     [,90]    [,91]
[1,] 1.350162 -0.3188198 0.8610794 -1.017972 -0.1821129 0.3011258 1.313969
[2,] 1.350162 -0.3188198 0.8610794 -1.017972 -0.1821129 0.3011258 1.313969
         [,92]      [,93]     [,94]       [,95]    [,96]     [,97]     [,98]
[1,] 0.1767845 0.07852849 0.2902981 -0.06391943 2.237928 0.2115368 0.1453265
[2,] 0.1767845 0.07852849 0.2902981 -0.06391943 2.237928 0.2115368 0.1453265
          [,99]   [,100]
[1,] -0.2881623 3.000294
[2,] -0.2881623 3.000294
> 
> 
> Max(tmp2)
[1] 1.952026
> Min(tmp2)
[1] -1.445943
> mean(tmp2)
[1] 0.09480391
> Sum(tmp2)
[1] 9.480391
> Var(tmp2)
[1] 0.6629205
> 
> rowMeans(tmp2)
  [1]  0.426027682 -1.231518568 -0.512796087 -0.170148906  0.984045977
  [6]  0.374277805  0.380240412 -0.296205469  0.418071301  1.231525439
 [11]  1.503353960  0.230433602 -0.008187005  0.004387731  0.541318613
 [16] -0.193193644 -0.654111218  0.643039703 -0.235392340 -0.772234775
 [21] -0.041564249 -0.008516580 -0.258931123 -1.445943345  1.669690802
 [26]  0.122723520  0.677151151  0.235292553  1.202602770  0.396148926
 [31] -0.182174424 -0.906007673  0.851931965  1.281282199 -0.403673296
 [36]  1.636735514  0.343412151 -0.390832121  0.226489246 -0.369938563
 [41]  1.010157923  1.174967873  0.136104372 -0.307035020 -0.343077659
 [46]  0.804720847  0.226749723 -1.049548307  0.982991561 -0.192555124
 [51]  0.601394770  1.375653673  1.375450569  0.997900227  0.120720904
 [56] -0.514343427 -1.025124888  0.679114001 -0.541273809  0.398613544
 [61]  0.041708296 -0.398176036 -0.304015133 -0.339817277 -0.234362081
 [66] -1.184535603  1.952025857 -0.537697355  0.113219317 -1.021645536
 [71] -0.775056531 -0.490990979 -0.038235172 -0.074860681 -0.787553976
 [76] -1.242764618 -0.987834972 -0.287695561 -0.614491080 -0.182730193
 [81]  0.990446878  0.311547989 -1.024066757 -0.320553604 -0.083438722
 [86]  0.962498694  1.488632775  0.500986169  1.527580527 -1.282988011
 [91] -0.214882705 -1.300345950 -0.864429849  0.408901454  0.806925735
 [96]  1.749550603  1.158084208 -1.280919889  0.574821156 -0.442845343
> rowSums(tmp2)
  [1]  0.426027682 -1.231518568 -0.512796087 -0.170148906  0.984045977
  [6]  0.374277805  0.380240412 -0.296205469  0.418071301  1.231525439
 [11]  1.503353960  0.230433602 -0.008187005  0.004387731  0.541318613
 [16] -0.193193644 -0.654111218  0.643039703 -0.235392340 -0.772234775
 [21] -0.041564249 -0.008516580 -0.258931123 -1.445943345  1.669690802
 [26]  0.122723520  0.677151151  0.235292553  1.202602770  0.396148926
 [31] -0.182174424 -0.906007673  0.851931965  1.281282199 -0.403673296
 [36]  1.636735514  0.343412151 -0.390832121  0.226489246 -0.369938563
 [41]  1.010157923  1.174967873  0.136104372 -0.307035020 -0.343077659
 [46]  0.804720847  0.226749723 -1.049548307  0.982991561 -0.192555124
 [51]  0.601394770  1.375653673  1.375450569  0.997900227  0.120720904
 [56] -0.514343427 -1.025124888  0.679114001 -0.541273809  0.398613544
 [61]  0.041708296 -0.398176036 -0.304015133 -0.339817277 -0.234362081
 [66] -1.184535603  1.952025857 -0.537697355  0.113219317 -1.021645536
 [71] -0.775056531 -0.490990979 -0.038235172 -0.074860681 -0.787553976
 [76] -1.242764618 -0.987834972 -0.287695561 -0.614491080 -0.182730193
 [81]  0.990446878  0.311547989 -1.024066757 -0.320553604 -0.083438722
 [86]  0.962498694  1.488632775  0.500986169  1.527580527 -1.282988011
 [91] -0.214882705 -1.300345950 -0.864429849  0.408901454  0.806925735
 [96]  1.749550603  1.158084208 -1.280919889  0.574821156 -0.442845343
> rowVars(tmp2)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowSd(tmp2)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowMax(tmp2)
  [1]  0.426027682 -1.231518568 -0.512796087 -0.170148906  0.984045977
  [6]  0.374277805  0.380240412 -0.296205469  0.418071301  1.231525439
 [11]  1.503353960  0.230433602 -0.008187005  0.004387731  0.541318613
 [16] -0.193193644 -0.654111218  0.643039703 -0.235392340 -0.772234775
 [21] -0.041564249 -0.008516580 -0.258931123 -1.445943345  1.669690802
 [26]  0.122723520  0.677151151  0.235292553  1.202602770  0.396148926
 [31] -0.182174424 -0.906007673  0.851931965  1.281282199 -0.403673296
 [36]  1.636735514  0.343412151 -0.390832121  0.226489246 -0.369938563
 [41]  1.010157923  1.174967873  0.136104372 -0.307035020 -0.343077659
 [46]  0.804720847  0.226749723 -1.049548307  0.982991561 -0.192555124
 [51]  0.601394770  1.375653673  1.375450569  0.997900227  0.120720904
 [56] -0.514343427 -1.025124888  0.679114001 -0.541273809  0.398613544
 [61]  0.041708296 -0.398176036 -0.304015133 -0.339817277 -0.234362081
 [66] -1.184535603  1.952025857 -0.537697355  0.113219317 -1.021645536
 [71] -0.775056531 -0.490990979 -0.038235172 -0.074860681 -0.787553976
 [76] -1.242764618 -0.987834972 -0.287695561 -0.614491080 -0.182730193
 [81]  0.990446878  0.311547989 -1.024066757 -0.320553604 -0.083438722
 [86]  0.962498694  1.488632775  0.500986169  1.527580527 -1.282988011
 [91] -0.214882705 -1.300345950 -0.864429849  0.408901454  0.806925735
 [96]  1.749550603  1.158084208 -1.280919889  0.574821156 -0.442845343
> rowMin(tmp2)
  [1]  0.426027682 -1.231518568 -0.512796087 -0.170148906  0.984045977
  [6]  0.374277805  0.380240412 -0.296205469  0.418071301  1.231525439
 [11]  1.503353960  0.230433602 -0.008187005  0.004387731  0.541318613
 [16] -0.193193644 -0.654111218  0.643039703 -0.235392340 -0.772234775
 [21] -0.041564249 -0.008516580 -0.258931123 -1.445943345  1.669690802
 [26]  0.122723520  0.677151151  0.235292553  1.202602770  0.396148926
 [31] -0.182174424 -0.906007673  0.851931965  1.281282199 -0.403673296
 [36]  1.636735514  0.343412151 -0.390832121  0.226489246 -0.369938563
 [41]  1.010157923  1.174967873  0.136104372 -0.307035020 -0.343077659
 [46]  0.804720847  0.226749723 -1.049548307  0.982991561 -0.192555124
 [51]  0.601394770  1.375653673  1.375450569  0.997900227  0.120720904
 [56] -0.514343427 -1.025124888  0.679114001 -0.541273809  0.398613544
 [61]  0.041708296 -0.398176036 -0.304015133 -0.339817277 -0.234362081
 [66] -1.184535603  1.952025857 -0.537697355  0.113219317 -1.021645536
 [71] -0.775056531 -0.490990979 -0.038235172 -0.074860681 -0.787553976
 [76] -1.242764618 -0.987834972 -0.287695561 -0.614491080 -0.182730193
 [81]  0.990446878  0.311547989 -1.024066757 -0.320553604 -0.083438722
 [86]  0.962498694  1.488632775  0.500986169  1.527580527 -1.282988011
 [91] -0.214882705 -1.300345950 -0.864429849  0.408901454  0.806925735
 [96]  1.749550603  1.158084208 -1.280919889  0.574821156 -0.442845343
> 
> colMeans(tmp2)
[1] 0.09480391
> colSums(tmp2)
[1] 9.480391
> colVars(tmp2)
[1] 0.6629205
> colSd(tmp2)
[1] 0.8141993
> colMax(tmp2)
[1] 1.952026
> colMin(tmp2)
[1] -1.445943
> colMedians(tmp2)
[1] -0.008351792
> colRanges(tmp2)
          [,1]
[1,] -1.445943
[2,]  1.952026
> 
> 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]  1.2247504 -0.4684122 -1.9353726 -1.2060200 -0.1422859 -0.5468189
 [7] -0.3172755  5.3397350 -2.9114884  0.8075646
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -0.5230388
[2,] -0.2133369
[3,]  0.1612683
[4,]  0.5167376
[5,]  0.6288305
> 
> rowApply(tmp,sum)
 [1]  1.3544468  1.7413314  2.4288362  3.0800225  1.2377851 -2.4451495
 [7] -3.3016639  0.9368359 -1.4873278 -3.7007402
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    6    6    7    3    4   10    8    2    7     7
 [2,]    2    8    6    7    1    3    6    8    9     5
 [3,]    8    7    5    8    3    1    4    7    3     9
 [4,]    3   10    1    2    8    2    3    3   10     2
 [5,]    4    2   10    1    7    6    7   10    4     1
 [6,]    5    1    9    5    9    8    1    5    6     8
 [7,]    7    5    2    9   10    7    5    1    2     3
 [8,]   10    9    8    4    5    9    2    9    8    10
 [9,]    1    3    3   10    6    4    9    6    1     4
[10,]    9    4    4    6    2    5   10    4    5     6
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1]  1.4609471  2.0900853  1.8783408  2.5440492  1.9511097  1.5840235
 [7] -3.3353707 -0.8708678  0.9286090  0.5602109  2.4140561 -0.3381583
[13]  0.7715878 -0.2529029  0.5589055  1.9892569  1.6110021 -0.7741776
[19]  0.2324523  0.2053542
> colApply(tmp,quantile)[,1]
            [,1]
[1,] -0.51228851
[2,]  0.07558748
[3,]  0.36577068
[4,]  0.64819831
[5,]  0.88367912
> 
> rowApply(tmp,sum)
[1]  2.074774  7.058670  3.328000  3.980509 -1.233440
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]   14   16    8   16    9
[2,]   17    8    7    4   20
[3,]   12   13    1   18   17
[4,]   11   18   14   19    6
[5,]   15    9   17   17   12
> 
> 
> as.matrix(tmp)
            [,1]         [,2]       [,3]       [,4]       [,5]       [,6]
[1,]  0.36577068  0.699554146  0.2804704  0.1437136 0.41370726  0.6862859
[2,]  0.88367912  0.004567128  0.7130459  1.1766865 0.06976444  1.5192625
[3,]  0.07558748  0.021343368 -1.2839306  0.3032131 0.72424868  0.8918657
[4,]  0.64819831 -0.174829888  0.9362913  1.6682856 0.67700610  0.1544662
[5,] -0.51228851  1.539450518  1.2324639 -0.7478497 0.06638319 -1.6678567
           [,7]       [,8]       [,9]       [,10]       [,11]      [,12]
[1,] -0.3245199 -0.5683751 -0.2489397 -0.06674129  1.50659650 -0.3181488
[2,] -0.5424083 -0.5883977  0.8235664 -0.64141067  0.35187822 -0.3308454
[3,]  0.1040611  0.4046760 -0.5988698  0.82357659  0.27681970  0.2583343
[4,] -1.5098190  0.5742950  0.2870562  0.13963015 -0.08352054 -1.4126658
[5,] -1.0626845 -0.6930659  0.6657960  0.30515613  0.36228224  1.4651673
           [,13]      [,14]       [,15]       [,16]      [,17]       [,18]
[1,]  1.00660451 -1.2628574 -0.35378090  0.35808143 -0.3898882 -1.53808622
[2,]  0.82304436 -1.2716987 -0.27754789  2.97883739  0.4473561 -0.41887678
[3,] -0.08900403  0.6572412 -0.49732913 -0.78355088  0.2796000  1.52600694
[4,]  0.43601439  0.2904492  1.67381470 -0.03674292  0.5760793  0.02940973
[5,] -1.40507141  1.3339627  0.01374869 -0.52736815  0.6978549 -0.37263132
            [,19]       [,20]
[1,]  1.671879086  0.01344769
[2,]  0.417297186  0.92087039
[3,]  0.005280274  0.22883014
[4,] -0.860226658 -0.03268195
[5,] -1.001777597 -0.92511205
> 
> 
> 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 :  563  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 1.497785 -0.260268 0.209035 -2.063093 0.296552 0.3542374 -1.346915
          col8     col9     col10     col11     col12      col13     col14
row1 -1.036554 1.227905 0.2588599 -1.962154 0.8638872 -0.7123287 0.6444892
        col15      col16        col17     col18      col19    col20
row1 1.638329 -0.5065461 -0.002100234 -1.121641 -0.7566546 0.538398
> tmp[,"col10"]
          col10
row1  0.2588599
row2  0.8967749
row3 -2.2855421
row4  0.6124503
row5 -0.6964733
> tmp[c("row1","row5"),]
          col1       col2       col3       col4     col5      col6      col7
row1  1.497785 -0.2602680  0.2090350 -2.0630930 0.296552 0.3542374 -1.346915
row5 -1.842081 -0.8148449 -0.6306638 -0.3386689 0.654677 0.8190467  1.436330
           col8     col9      col10      col11      col12      col13     col14
row1 -1.0365540 1.227905  0.2588599 -1.9621540  0.8638872 -0.7123287 0.6444892
row5 -0.8408481 1.384689 -0.6964733  0.1306111 -0.6015233 -2.0906030 0.5023484
         col15      col16        col17       col18      col19      col20
row1 1.6383293 -0.5065461 -0.002100234 -1.12164079 -0.7566546  0.5383980
row5 0.5368721  1.3086510 -0.953773617  0.08150637  0.2082528 -0.1823897
> tmp[,c("col6","col20")]
           col6      col20
row1  0.3542374  0.5383980
row2  0.8720587 -1.9988170
row3  0.4984077 -0.9582173
row4 -0.5638768 -0.9014156
row5  0.8190467 -0.1823897
> tmp[c("row1","row5"),c("col6","col20")]
          col6      col20
row1 0.3542374  0.5383980
row5 0.8190467 -0.1823897
> 
> 
> 
> 
> 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 48.87765 49.59027 49.45159 47.87427 49.69803 104.9857 51.5394 49.73709
         col9    col10    col11    col12   col13    col14   col15    col16
row1 51.36997 49.58359 50.92625 49.61375 49.9786 49.38109 50.6172 49.05537
       col17    col18    col19    col20
row1 49.3508 50.34895 48.10701 105.7108
> tmp[,"col10"]
        col10
row1 49.58359
row2 30.89589
row3 31.53848
row4 32.05078
row5 50.08552
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 48.87765 49.59027 49.45159 47.87427 49.69803 104.9857 51.53940 49.73709
row5 49.17351 50.22228 49.06867 49.04621 49.90595 104.7112 49.99624 50.12358
         col9    col10    col11    col12    col13    col14    col15    col16
row1 51.36997 49.58359 50.92625 49.61375 49.97860 49.38109 50.61720 49.05537
row5 51.22329 50.08552 49.89281 48.83346 50.33499 49.60332 50.34966 50.98003
        col17    col18    col19    col20
row1 49.35080 50.34895 48.10701 105.7108
row5 50.03351 49.92063 49.78807 103.9913
> tmp[,c("col6","col20")]
          col6     col20
row1 104.98573 105.71084
row2  76.29924  74.11366
row3  73.70343  73.31974
row4  76.71710  75.31926
row5 104.71115 103.99133
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 104.9857 105.7108
row5 104.7112 103.9913
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 104.9857 105.7108
row5 104.7112 103.9913
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
          col13
[1,] -1.2438244
[2,]  1.4094919
[3,] -1.1633689
[4,]  0.6547423
[5,] -1.8481138
> tmp[,c("col17","col7")]
           col17       col7
[1,]  0.39365477 -2.2053340
[2,]  0.20876627  0.5991568
[3,]  0.02467748  1.3027774
[4,] -0.98243817 -0.7641678
[5,]  1.28384354 -1.2287159
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
           col6      col20
[1,]  0.1878245  0.7503665
[2,] -0.2299283  1.4929685
[3,]  1.1695041 -0.3048740
[4,] -0.8985394 -0.8573164
[5,]  0.2316163 -1.4329274
> subBufferedMatrix(tmp,1,c("col6"))[,1]
          col1
[1,] 0.1878245
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
           col6
[1,]  0.1878245
[2,] -0.2299283
> 
> 
> 
> 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.5144754  0.8453392 1.19512986 -0.4410073 -0.9982536 0.441365 -1.3285714
row1  1.0778555 -0.2203428 0.08075863  0.1780158  0.3572649 3.068789  0.3710858
          [,8]       [,9]      [,10]      [,11]     [,12]      [,13]      [,14]
row3 0.3855733  0.1570134 -2.1332811 -0.1702422 0.1081601 -0.2591279 -0.4707967
row1 1.6793192 -0.4636507  0.1265014  0.6578205 0.8607659 -1.2501522 -0.6813456
          [,15]     [,16]     [,17]      [,18]      [,19]     [,20]
row3 -0.7794626 -1.637848 -1.206980  1.5295373 -0.9337346 -1.355982
row1 -1.2961354  1.760763 -1.013143 -0.4470922 -0.2089651  1.581388
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
          [,1]      [,2]       [,3]     [,4]       [,5]      [,6]      [,7]
row2 0.2991503 0.6835481 -0.6204178 2.071624 -0.1333576 -0.564111 -1.758972
        [,8]       [,9]     [,10]
row2 2.45559 0.04220502 0.1513031
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
          [,1]      [,2]   [,3]        [,4]      [,5]       [,6]       [,7]
row5 -0.187911 -2.160738 2.0559 0.001478202 -1.454824 -0.5107032 -0.8650509
           [,8]       [,9]    [,10]      [,11]    [,12]     [,13]      [,14]
row5 -0.7557072 -0.3128687 1.400879 -0.6992655 1.128652 0.5203186 -0.1705088
        [,15]    [,16]      [,17]      [,18]    [,19]    [,20]
row5 1.655648 -2.04687 -0.4535548 -0.6459032 -1.04636 1.009758
> 
> 
> 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: 0x600002f54000>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM55a532916b28"
 [2] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM55a569122907"
 [3] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM55a52743c075"
 [4] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM55a551105576"
 [5] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM55a575adf8e" 
 [6] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM55a55f0ae767"
 [7] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM55a544de4bf0"
 [8] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM55a55e4b9ce2"
 [9] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM55a53628e9cb"
[10] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM55a5380d2a34"
[11] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM55a5684dd8ab"
[12] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM55a54ecbf80c"
[13] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM55a5310a043e"
[14] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM55a589c9b99" 
[15] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM55a561ab5e39"
> 
> 
> ### 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: 0x600002f282a0>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x600002f282a0>
Warning message:
In dir.create(new.directory) :
  '/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x600002f282a0>
> rowMedians(tmp)
  [1]  0.129872278 -0.409458792  0.087453224 -0.313044756  0.022070248
  [6] -0.152829866  0.033062517 -0.293750621 -0.165866358 -0.883146217
 [11]  0.335235840  0.009759447 -0.469624378  0.349833891  0.057207010
 [16] -0.473716041  0.258572452 -0.314607243 -0.486333109 -0.092189713
 [21]  0.434932778  0.342887870 -0.722192503  0.301535604 -0.057517779
 [26] -0.898425495 -0.357957349 -0.627672444 -0.401346224  0.205125513
 [31]  0.634066876  0.437401984 -0.134814194  0.579971614 -0.424393022
 [36]  0.204383641 -0.157112665  0.101981774  0.126595369 -0.093530530
 [41] -0.113350881  0.076536224  0.185000950 -0.135733787  0.198200459
 [46] -0.461042223 -0.155795803  0.497107475 -0.752682788 -0.223862248
 [51]  0.273916096  0.453643864 -0.455710390  0.603160096  0.271837817
 [56] -0.096204651  0.064216971 -0.114000422 -0.184734367 -0.448162595
 [61]  0.278803112  0.624128571  0.089537212  0.015556501 -0.116222016
 [66]  0.133653463 -0.352344891 -0.391214554 -0.001039363  0.326653123
 [71] -0.545480783 -0.954851729 -0.393126455  0.133692874 -0.304892902
 [76]  0.359567197 -0.266063680 -0.368401794 -0.017765507 -0.274762096
 [81]  0.399221817  0.084138255  0.244805933  0.493634685 -0.248708482
 [86]  0.552502922 -0.057990965  0.316241843 -0.211558744 -0.045762272
 [91] -0.820951120 -0.175596487  0.019848031 -0.024516333 -0.130817319
 [96] -0.274964365  0.246180736  0.043038769 -0.268858534 -0.345164593
[101]  0.057350222  0.136966803 -0.457100518  0.351617094  0.461659192
[106]  0.384189700 -0.106321549  0.436250930 -0.400553607 -0.236308329
[111]  0.132138883 -0.094145158  0.459274085 -0.269267339 -0.083266948
[116]  0.265499838  0.553100022  0.302725415  0.150022435  0.120396473
[121]  0.115741697  0.176630286 -0.114343909  0.210563660  0.590992442
[126]  0.238797874 -0.406004810 -0.286668652 -0.264177775  0.399088911
[131] -0.443960582  0.109112507 -0.691307310  0.323862253  0.476782251
[136]  0.407444743  0.445380059 -0.534893374  0.257463807  0.059129559
[141] -0.134239953  0.687167355 -0.155710480 -0.037302166 -0.037262533
[146]  0.371185150  0.542743647  0.404800235  0.396285495  0.496216337
[151] -0.502192768  0.442287587 -0.095198545 -0.385566603  0.567474602
[156]  0.048206554  0.300747599  0.118528018  0.483269852  0.211130673
[161]  0.015770054  0.334245383  0.300739254 -0.180217800  0.040181432
[166] -0.381623807 -0.283735493  0.134482889  0.536939281 -0.124807117
[171] -0.078601817  0.104496825 -0.075595525 -0.420037673  0.259202201
[176] -0.675158698  0.380369307 -0.443438687  0.166798479  0.084407583
[181] -0.258492372 -0.453908214 -0.196131998 -0.366193010 -0.027552314
[186]  0.339803324  0.450797085  0.057802929  0.079724122  1.005288607
[191] -0.211361322 -0.568921956 -0.187743777  0.130394347 -0.188293160
[196]  0.268796980  0.323712057 -0.030177039  0.283363122  0.313893508
[201]  0.492774555 -0.514839587 -0.215032920 -0.395289396  0.181597952
[206]  0.220143111  0.241878658  0.217924698 -0.248269861 -0.083293215
[211]  0.102786344 -0.301364461  0.284385336  0.095428596 -0.319056169
[216]  0.507021378  0.233120128  0.061156934 -0.015974212  0.259990341
[221]  0.091185248 -0.773085724  0.232189222  0.380419812  0.259659165
[226] -0.304396933  0.268257417 -0.091740876 -0.427533526  0.079650552
> 
> proc.time()
   user  system elapsed 
  0.732   3.781   5.114 

BufferedMatrix.Rcheck/tests/rawCalltesting.Rout


R Under development (unstable) (2025-11-04 r88984) -- "Unsuffered Consequences"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: aarch64-apple-darwin20

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

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

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

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

Attaching package: 'BufferedMatrix'

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

    colMeans, colSums, rowMeans, rowSums

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

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

<pointer: 0x60000154c000>
> .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: 0x60000154c000>
> .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: 0x60000154c000>
> .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: 0x60000154c000>
> 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: 0x6000015682a0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000015682a0>
> .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: 0x6000015682a0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000015682a0>
> .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: 0x6000015682a0>
> 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: 0x600001568420>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600001568420>
> .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: 0x600001568420>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x600001568420>
> .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: 0x600001568420>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x600001568420>
> .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: 0x600001568420>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x600001568420>
> .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: 0x600001568420>
> 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: 0x60000155c000>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x60000155c000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x60000155c000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x60000155c000>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile5a0818b50f9f" "BufferedMatrixFile5a08498c47aa"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile5a0818b50f9f" "BufferedMatrixFile5a08498c47aa"
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000015441e0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000015441e0>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x6000015441e0>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x6000015441e0>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x6000015441e0>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x6000015441e0>
> .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: 0x60000154c3c0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x60000154c3c0>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x60000154c3c0>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x60000154c3c0>
> 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: 0x60000154c5a0>
> .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: 0x60000154c5a0>
> rm(P)
> 
> proc.time()
   user  system elapsed 
  0.136   0.059   0.191 

BufferedMatrix.Rcheck/tests/Rcodetesting.Rout


R Under development (unstable) (2025-11-04 r88984) -- "Unsuffered Consequences"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: aarch64-apple-darwin20

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

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

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

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

Attaching package: 'BufferedMatrix'

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

    colMeans, colSums, rowMeans, rowSums

> 
> Temp <- createBufferedMatrix(100)
> dim(Temp)
[1] 100   0
> buffer.dim(Temp)
[1] 1 1
> 
> 
> proc.time()
   user  system elapsed 
  0.118   0.036   0.181 

Example timings