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

This page was generated on 2025-08-06 13:54 -0400 (Wed, 06 Aug 2025).

HostnameOSArch (*)R versionInstalled pkgs
nebbiolo2Linux (Ubuntu 24.04.2 LTS)x86_644.5.1 (2025-06-13) -- "Great Square Root" 4813
palomino8Windows Server 2022 Datacenterx644.5.1 (2025-06-13 ucrt) -- "Great Square Root" 4550
lconwaymacOS 12.7.1 Montereyx86_644.5.1 (2025-06-13) -- "Great Square Root" 4592
kjohnson3macOS 13.7.1 Venturaarm644.5.1 Patched (2025-06-14 r88325) -- "Great Square Root" 4534
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 251/2315HostnameOS / ArchINSTALLBUILDCHECKBUILD BIN
BufferedMatrix 1.73.0  (landing page)
Ben Bolstad
Snapshot Date: 2025-08-05 13:25 -0400 (Tue, 05 Aug 2025)
git_url: https://git.bioconductor.org/packages/BufferedMatrix
git_branch: devel
git_last_commit: 0147962
git_last_commit_date: 2025-04-15 09:39:39 -0400 (Tue, 15 Apr 2025)
nebbiolo2Linux (Ubuntu 24.04.2 LTS) / x86_64  OK    OK    OK  UNNEEDED, same version is already published
palomino8Windows Server 2022 Datacenter / x64  OK    OK    OK    OK  UNNEEDED, same version is already published
lconwaymacOS 12.7.1 Monterey / x86_64  OK    OK    WARNINGS    OK  UNNEEDED, same version is already published
kjohnson3macOS 13.7.1 Ventura / arm64  OK    OK    WARNINGS    OK  UNNEEDED, same version is already published


CHECK results for BufferedMatrix on lconway

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

raw results


Summary

Package: BufferedMatrix
Version: 1.73.0
Command: /Library/Frameworks/R.framework/Resources/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/Library/Frameworks/R.framework/Resources/library --no-vignettes --timings BufferedMatrix_1.73.0.tar.gz
StartedAt: 2025-08-05 19:41:02 -0400 (Tue, 05 Aug 2025)
EndedAt: 2025-08-05 19:41:54 -0400 (Tue, 05 Aug 2025)
EllapsedTime: 51.8 seconds
RetCode: 0
Status:   WARNINGS  
CheckDir: BufferedMatrix.Rcheck
Warnings: 1

Command output

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


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

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


Installation output

BufferedMatrix.Rcheck/00install.out

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


* installing to library ‘/Library/Frameworks/R.framework/Versions/4.5-x86_64/Resources/library’
* installing *source* package ‘BufferedMatrix’ ...
** this is package ‘BufferedMatrix’ version ‘1.73.0’
** using staged installation
** libs
using C compiler: ‘Apple clang version 14.0.0 (clang-1400.0.29.202)’
using SDK: ‘MacOSX11.3.sdk’
clang -arch x86_64 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/opt/R/x86_64/include    -fPIC  -falign-functions=64 -Wall -g -O2  -c RBufferedMatrix.c -o RBufferedMatrix.o
clang -arch x86_64 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/opt/R/x86_64/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 x86_64 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/opt/R/x86_64/include    -fPIC  -falign-functions=64 -Wall -g -O2  -c doubleBufferedMatrix_C_tests.c -o doubleBufferedMatrix_C_tests.o
clang -arch x86_64 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/opt/R/x86_64/include    -fPIC  -falign-functions=64 -Wall -g -O2  -c init_package.c -o init_package.o
clang -arch x86_64 -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -L/Library/Frameworks/R.framework/Resources/lib -L/opt/R/x86_64/lib -o BufferedMatrix.so RBufferedMatrix.o doubleBufferedMatrix.o doubleBufferedMatrix_C_tests.o init_package.o -F/Library/Frameworks/R.framework/.. -framework R
installing to /Library/Frameworks/R.framework/Versions/4.5-x86_64/Resources/library/00LOCK-BufferedMatrix/00new/BufferedMatrix/libs
** R
** inst
** byte-compile and prepare package for lazy loading
Creating a new generic function for ‘rowMeans’ in package ‘BufferedMatrix’
Creating a new generic function for ‘rowSums’ in package ‘BufferedMatrix’
Creating a new generic function for ‘colMeans’ in package ‘BufferedMatrix’
Creating a new generic function for ‘colSums’ in package ‘BufferedMatrix’
Creating a generic function for ‘ncol’ from package ‘base’ in package ‘BufferedMatrix’
Creating a generic function for ‘nrow’ from package ‘base’ in package ‘BufferedMatrix’
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
** checking absolute paths in shared objects and dynamic libraries
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (BufferedMatrix)

Tests output

BufferedMatrix.Rcheck/tests/c_code_level_tests.Rout


R version 4.5.1 (2025-06-13) -- "Great Square Root"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: x86_64-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.333   0.147   0.474 

BufferedMatrix.Rcheck/tests/objectTesting.Rout


R version 4.5.1 (2025-06-13) -- "Great Square Root"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: x86_64-apple-darwin20

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

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

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

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

Attaching package: 'BufferedMatrix'

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

    colMeans, colSums, rowMeans, rowSums

> 
> 
> ### this is used to control how many repetitions in something below
> ### higher values result in more checks.
> nreps <-100 ##20000
> 
> 
> ## test creation and some simple assignments and subsetting operations
> 
> ## first on single elements
> tmp <- createBufferedMatrix(1000,10)
> 
> tmp[10,5]
[1] 0
> tmp[10,5] <- 10
> tmp[10,5]
[1] 10
> tmp[10,5] <- 12.445
> tmp[10,5]
[1] 12.445
> 
> 
> 
> ## now testing accessing multiple elements
> tmp2 <- createBufferedMatrix(10,20)
> 
> 
> tmp2[3,1] <- 51.34
> tmp2[9,2] <- 9.87654
> tmp2[,1:2]
       [,1]    [,2]
 [1,]  0.00 0.00000
 [2,]  0.00 0.00000
 [3,] 51.34 0.00000
 [4,]  0.00 0.00000
 [5,]  0.00 0.00000
 [6,]  0.00 0.00000
 [7,]  0.00 0.00000
 [8,]  0.00 0.00000
 [9,]  0.00 9.87654
[10,]  0.00 0.00000
> tmp2[,-(3:20)]
       [,1]    [,2]
 [1,]  0.00 0.00000
 [2,]  0.00 0.00000
 [3,] 51.34 0.00000
 [4,]  0.00 0.00000
 [5,]  0.00 0.00000
 [6,]  0.00 0.00000
 [7,]  0.00 0.00000
 [8,]  0.00 0.00000
 [9,]  0.00 9.87654
[10,]  0.00 0.00000
> tmp2[3,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
[1,] 51.34    0    0    0    0    0    0    0    0     0     0     0     0
     [,14] [,15] [,16] [,17] [,18] [,19] [,20]
[1,]     0     0     0     0     0     0     0
> tmp2[-3,]
      [,1]    [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [2,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [3,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [4,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [5,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [6,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [7,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [8,]    0 9.87654    0    0    0    0    0    0    0     0     0     0     0
 [9,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
      [,14] [,15] [,16] [,17] [,18] [,19] [,20]
 [1,]     0     0     0     0     0     0     0
 [2,]     0     0     0     0     0     0     0
 [3,]     0     0     0     0     0     0     0
 [4,]     0     0     0     0     0     0     0
 [5,]     0     0     0     0     0     0     0
 [6,]     0     0     0     0     0     0     0
 [7,]     0     0     0     0     0     0     0
 [8,]     0     0     0     0     0     0     0
 [9,]     0     0     0     0     0     0     0
> tmp2[2,1:3]
     [,1] [,2] [,3]
[1,]    0    0    0
> tmp2[3:9,1:3]
      [,1]    [,2] [,3]
[1,] 51.34 0.00000    0
[2,]  0.00 0.00000    0
[3,]  0.00 0.00000    0
[4,]  0.00 0.00000    0
[5,]  0.00 0.00000    0
[6,]  0.00 0.00000    0
[7,]  0.00 9.87654    0
> tmp2[-4,-4]
       [,1]    [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [2,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [3,] 51.34 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [4,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [5,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [6,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [7,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [8,]  0.00 9.87654    0    0    0    0    0    0    0     0     0     0     0
 [9,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
      [,14] [,15] [,16] [,17] [,18] [,19]
 [1,]     0     0     0     0     0     0
 [2,]     0     0     0     0     0     0
 [3,]     0     0     0     0     0     0
 [4,]     0     0     0     0     0     0
 [5,]     0     0     0     0     0     0
 [6,]     0     0     0     0     0     0
 [7,]     0     0     0     0     0     0
 [8,]     0     0     0     0     0     0
 [9,]     0     0     0     0     0     0
> 
> ## now testing accessing/assigning multiple elements
> tmp3 <- createBufferedMatrix(10,10)
> 
> for (i in 1:10){
+   for (j in 1:10){
+     tmp3[i,j] <- (j-1)*10 + i
+   }
+ }
> 
> tmp3[2:4,2:4]
     [,1] [,2] [,3]
[1,]   12   22   32
[2,]   13   23   33
[3,]   14   24   34
> tmp3[c(-10),c(2:4,2:4,10,1,2,1:10,10:1)]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]   11   21   31   11   21   31   91    1   11     1    11    21    31
 [2,]   12   22   32   12   22   32   92    2   12     2    12    22    32
 [3,]   13   23   33   13   23   33   93    3   13     3    13    23    33
 [4,]   14   24   34   14   24   34   94    4   14     4    14    24    34
 [5,]   15   25   35   15   25   35   95    5   15     5    15    25    35
 [6,]   16   26   36   16   26   36   96    6   16     6    16    26    36
 [7,]   17   27   37   17   27   37   97    7   17     7    17    27    37
 [8,]   18   28   38   18   28   38   98    8   18     8    18    28    38
 [9,]   19   29   39   19   29   39   99    9   19     9    19    29    39
      [,14] [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24] [,25]
 [1,]    41    51    61    71    81    91    91    81    71    61    51    41
 [2,]    42    52    62    72    82    92    92    82    72    62    52    42
 [3,]    43    53    63    73    83    93    93    83    73    63    53    43
 [4,]    44    54    64    74    84    94    94    84    74    64    54    44
 [5,]    45    55    65    75    85    95    95    85    75    65    55    45
 [6,]    46    56    66    76    86    96    96    86    76    66    56    46
 [7,]    47    57    67    77    87    97    97    87    77    67    57    47
 [8,]    48    58    68    78    88    98    98    88    78    68    58    48
 [9,]    49    59    69    79    89    99    99    89    79    69    59    49
      [,26] [,27] [,28] [,29]
 [1,]    31    21    11     1
 [2,]    32    22    12     2
 [3,]    33    23    13     3
 [4,]    34    24    14     4
 [5,]    35    25    15     5
 [6,]    36    26    16     6
 [7,]    37    27    17     7
 [8,]    38    28    18     8
 [9,]    39    29    19     9
> tmp3[-c(1:5),-c(6:10)]
     [,1] [,2] [,3] [,4] [,5]
[1,]    6   16   26   36   46
[2,]    7   17   27   37   47
[3,]    8   18   28   38   48
[4,]    9   19   29   39   49
[5,]   10   20   30   40   50
> 
> ## assignment of whole columns
> tmp3[,1] <- c(1:10*100.0)
> tmp3[,1:2] <- tmp3[,1:2]*100
> tmp3[,1:2] <- tmp3[,2:1]
> tmp3[,1:2]
      [,1]  [,2]
 [1,] 1100 1e+04
 [2,] 1200 2e+04
 [3,] 1300 3e+04
 [4,] 1400 4e+04
 [5,] 1500 5e+04
 [6,] 1600 6e+04
 [7,] 1700 7e+04
 [8,] 1800 8e+04
 [9,] 1900 9e+04
[10,] 2000 1e+05
> 
> 
> tmp3[,-1] <- tmp3[,1:9]
> tmp3[,1:10]
      [,1] [,2]  [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,] 1100 1100 1e+04   21   31   41   51   61   71    81
 [2,] 1200 1200 2e+04   22   32   42   52   62   72    82
 [3,] 1300 1300 3e+04   23   33   43   53   63   73    83
 [4,] 1400 1400 4e+04   24   34   44   54   64   74    84
 [5,] 1500 1500 5e+04   25   35   45   55   65   75    85
 [6,] 1600 1600 6e+04   26   36   46   56   66   76    86
 [7,] 1700 1700 7e+04   27   37   47   57   67   77    87
 [8,] 1800 1800 8e+04   28   38   48   58   68   78    88
 [9,] 1900 1900 9e+04   29   39   49   59   69   79    89
[10,] 2000 2000 1e+05   30   40   50   60   70   80    90
> 
> tmp3[,1:2] <- rep(1,10)
> tmp3[,1:2] <- rep(1,20)
> tmp3[,1:2] <- matrix(c(1:5),1,5)
> 
> tmp3[,-c(1:8)] <- matrix(c(1:5),1,5)
> 
> tmp3[1,] <- 1:10
> tmp3[1,]
     [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,]    1    2    3    4    5    6    7    8    9    10
> tmp3[-1,] <- c(1,2)
> tmp3[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    1    2    3    4    5    6    7    8    9    10
 [2,]    1    2    1    2    1    2    1    2    1     2
 [3,]    2    1    2    1    2    1    2    1    2     1
 [4,]    1    2    1    2    1    2    1    2    1     2
 [5,]    2    1    2    1    2    1    2    1    2     1
 [6,]    1    2    1    2    1    2    1    2    1     2
 [7,]    2    1    2    1    2    1    2    1    2     1
 [8,]    1    2    1    2    1    2    1    2    1     2
 [9,]    2    1    2    1    2    1    2    1    2     1
[10,]    1    2    1    2    1    2    1    2    1     2
> tmp3[-c(1:8),] <- matrix(c(1:5),1,5)
> tmp3[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    1    2    3    4    5    6    7    8    9    10
 [2,]    1    2    1    2    1    2    1    2    1     2
 [3,]    2    1    2    1    2    1    2    1    2     1
 [4,]    1    2    1    2    1    2    1    2    1     2
 [5,]    2    1    2    1    2    1    2    1    2     1
 [6,]    1    2    1    2    1    2    1    2    1     2
 [7,]    2    1    2    1    2    1    2    1    2     1
 [8,]    1    2    1    2    1    2    1    2    1     2
 [9,]    1    3    5    2    4    1    3    5    2     4
[10,]    2    4    1    3    5    2    4    1    3     5
> 
> 
> tmp3[1:2,1:2] <- 5555.04
> tmp3[-(1:2),1:2] <- 1234.56789
> 
> 
> 
> ## testing accessors for the directory and prefix
> directory(tmp3)
[1] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests"
> prefix(tmp3)
[1] "BM"
> 
> ## testing if we can remove these objects
> rm(tmp, tmp2, tmp3)
> gc()
         used (Mb) gc trigger (Mb) limit (Mb) max used (Mb)
Ncells 480847 25.7    1056617 56.5         NA   634462 33.9
Vcells 891074  6.8    8388608 64.0      98304  2108713 16.1
> 
> 
> 
> 
> ##
> ## checking reads
> ##
> 
> tmp2 <- createBufferedMatrix(10,20)
> 
> test.sample <- rnorm(10*20)
> 
> tmp2[1:10,1:20] <- test.sample
> 
> test.matrix <- matrix(test.sample,10,20)
> 
> ## testing reads
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   which.col <- sample(1:20,1)
+   if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> date()
[1] "Tue Aug  5 19:41:27 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] "Tue Aug  5 19:41:27 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: 0x6000015780c0>
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   which.col <- sample(1:20,1)
+   if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,5,replace=TRUE)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> date()
[1] "Tue Aug  5 19:41:32 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] "Tue Aug  5 19:41:34 2025"
> 
> ColMode(tmp2)
<pointer: 0x6000015780c0>
> 
> 
> 
> ### 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.9144272  2.97370167  0.12993571  0.5928001
[2,] -0.8295515  0.11175507 -0.13964970 -1.1284262
[3,] -0.4388359 -0.03511014  0.04257068  0.3085506
[4,] -0.3508326  1.89575137  0.50317417  0.6290080
> ewApply(tmp5,abs)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
           [,1]       [,2]       [,3]      [,4]
[1,] 99.9144272 2.97370167 0.12993571 0.5928001
[2,]  0.8295515 0.11175507 0.13964970 1.1284262
[3,]  0.4388359 0.03511014 0.04257068 0.3085506
[4,]  0.3508326 1.89575137 0.50317417 0.6290080
> ewApply(tmp5,sqrt)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
          [,1]      [,2]      [,3]      [,4]
[1,] 9.9957204 1.7244424 0.3604660 0.7699351
[2,] 0.9107972 0.3342979 0.3736973 1.0622741
[3,] 0.6624469 0.1873770 0.2063266 0.5554733
[4,] 0.5923112 1.3768629 0.7093477 0.7931002
> 
> my.function <- function(x,power){
+   (x+5)^power
+ }
> 
> ewApply(tmp5,my.function,power=2)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
          [,1]     [,2]     [,3]     [,4]
[1,] 224.87163 45.21813 28.73460 33.29215
[2,]  34.93752 28.45473 28.87662 36.75117
[3,]  32.06331 26.90888 27.10584 30.86328
[4,]  31.27394 40.66438 32.59665 33.56001
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x600001528000>
> exp(tmp5)
<pointer: 0x600001528000>
> log(tmp5,2)
<pointer: 0x600001528000>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 468.0408
> Min(tmp5)
[1] 54.57691
> mean(tmp5)
[1] 72.43032
> Sum(tmp5)
[1] 14486.06
> Var(tmp5)
[1] 872.1176
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 90.98288 70.18734 67.62636 72.66762 70.14486 74.02493 67.11399 72.43409
 [9] 68.08801 71.03311
> rowSums(tmp5)
 [1] 1819.658 1403.747 1352.527 1453.352 1402.897 1480.499 1342.280 1448.682
 [9] 1361.760 1420.662
> rowVars(tmp5)
 [1] 7972.43805   88.53248   72.97334  128.15633   57.74624   56.27405
 [7]   65.68719   93.10970   62.70310   84.87391
> rowSd(tmp5)
 [1] 89.288510  9.409170  8.542443 11.320615  7.599095  7.501603  8.104764
 [8]  9.649337  7.918529  9.212704
> rowMax(tmp5)
 [1] 468.04084  89.61651  88.46767  91.47147  83.04589  90.70386  82.81508
 [8]  97.45718  88.39077  93.14851
> rowMin(tmp5)
 [1] 57.74744 55.43299 56.00731 54.57691 55.72571 60.98382 56.06104 57.08486
 [9] 54.87577 55.37180
> 
> colMeans(tmp5)
 [1] 110.54263  68.65307  67.22928  69.61325  71.11680  73.39730  73.21453
 [8]  73.48540  72.35928  70.26195  71.35938  68.64181  68.51919  65.91198
[15]  72.02715  73.10082  70.24903  67.29763  68.62059  73.00530
> colSums(tmp5)
 [1] 1105.4263  686.5307  672.2928  696.1325  711.1680  733.9730  732.1453
 [8]  734.8540  723.5928  702.6195  713.5938  686.4181  685.1919  659.1198
[15]  720.2715  731.0082  702.4903  672.9763  686.2059  730.0530
> colVars(tmp5)
 [1] 15814.92701   143.59599    43.19018    35.56625    68.35014    99.29729
 [7]    75.72582    81.53945    64.51033    74.43658    78.39601    58.70082
[13]    82.65044    47.01928    95.97419    60.23262   175.55204    50.29604
[19]   183.70381   137.88760
> colSd(tmp5)
 [1] 125.757413  11.983155   6.571923   5.963744   8.267414   9.964803
 [7]   8.702059   9.029920   8.031832   8.627664   8.854152   7.661646
[13]   9.091229   6.857061   9.796642   7.760968  13.249605   7.091970
[19]  13.553738  11.742555
> colMax(tmp5)
 [1] 468.04084  94.11560  75.52200  77.77541  88.66018  83.80869  84.63130
 [8]  87.63845  83.89190  81.94448  85.10274  79.61881  88.39077  75.15374
[15]  93.14851  87.98547  97.45718  81.46651  90.70386  91.47147
> colMin(tmp5)
 [1] 64.32375 56.00731 56.41725 58.26277 60.52253 54.87577 57.08486 60.22826
 [9] 58.01706 57.74028 61.07388 56.06104 58.19298 55.37180 60.98040 59.58326
[17] 54.57691 57.74744 56.44278 55.72571
> 
> 
> ### setting a random element to NA and then testing with na.rm=TRUE or na.rm=FALSE (The default)
> 
> 
> which.row <- sample(1:10,1,replace=TRUE)
> which.col  <- sample(1:20,1,replace=TRUE)
> 
> tmp5[which.row,which.col] <- NA
> 
> Max(tmp5)
[1] NA
> Min(tmp5)
[1] NA
> mean(tmp5)
[1] NA
> Sum(tmp5)
[1] NA
> Var(tmp5)
[1] NA
> 
> rowMeans(tmp5)
 [1] 90.98288 70.18734 67.62636 72.66762 70.14486 74.02493 67.11399       NA
 [9] 68.08801 71.03311
> rowSums(tmp5)
 [1] 1819.658 1403.747 1352.527 1453.352 1402.897 1480.499 1342.280       NA
 [9] 1361.760 1420.662
> rowVars(tmp5)
 [1] 7972.43805   88.53248   72.97334  128.15633   57.74624   56.27405
 [7]   65.68719   61.66520   62.70310   84.87391
> rowSd(tmp5)
 [1] 89.288510  9.409170  8.542443 11.320615  7.599095  7.501603  8.104764
 [8]  7.852720  7.918529  9.212704
> rowMax(tmp5)
 [1] 468.04084  89.61651  88.46767  91.47147  83.04589  90.70386  82.81508
 [8]        NA  88.39077  93.14851
> rowMin(tmp5)
 [1] 57.74744 55.43299 56.00731 54.57691 55.72571 60.98382 56.06104       NA
 [9] 54.87577 55.37180
> 
> colMeans(tmp5)
 [1] 110.54263  68.65307  67.22928  69.61325  71.11680  73.39730  73.21453
 [8]  73.48540  72.35928  70.26195  71.35938  68.64181  68.51919  65.91198
[15]  72.02715  73.10082        NA  67.29763  68.62059  73.00530
> colSums(tmp5)
 [1] 1105.4263  686.5307  672.2928  696.1325  711.1680  733.9730  732.1453
 [8]  734.8540  723.5928  702.6195  713.5938  686.4181  685.1919  659.1198
[15]  720.2715  731.0082        NA  672.9763  686.2059  730.0530
> colVars(tmp5)
 [1] 15814.92701   143.59599    43.19018    35.56625    68.35014    99.29729
 [7]    75.72582    81.53945    64.51033    74.43658    78.39601    58.70082
[13]    82.65044    47.01928    95.97419    60.23262          NA    50.29604
[19]   183.70381   137.88760
> colSd(tmp5)
 [1] 125.757413  11.983155   6.571923   5.963744   8.267414   9.964803
 [7]   8.702059   9.029920   8.031832   8.627664   8.854152   7.661646
[13]   9.091229   6.857061   9.796642   7.760968         NA   7.091970
[19]  13.553738  11.742555
> colMax(tmp5)
 [1] 468.04084  94.11560  75.52200  77.77541  88.66018  83.80869  84.63130
 [8]  87.63845  83.89190  81.94448  85.10274  79.61881  88.39077  75.15374
[15]  93.14851  87.98547        NA  81.46651  90.70386  91.47147
> colMin(tmp5)
 [1] 64.32375 56.00731 56.41725 58.26277 60.52253 54.87577 57.08486 60.22826
 [9] 58.01706 57.74028 61.07388 56.06104 58.19298 55.37180 60.98040 59.58326
[17]       NA 57.74744 56.44278 55.72571
> 
> Max(tmp5,na.rm=TRUE)
[1] 468.0408
> Min(tmp5,na.rm=TRUE)
[1] 54.57691
> mean(tmp5,na.rm=TRUE)
[1] 72.30456
> Sum(tmp5,na.rm=TRUE)
[1] 14388.61
> Var(tmp5,na.rm=TRUE)
[1] 873.3429
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 90.98288 70.18734 67.62636 72.66762 70.14486 74.02493 67.11399 71.11709
 [9] 68.08801 71.03311
> rowSums(tmp5,na.rm=TRUE)
 [1] 1819.658 1403.747 1352.527 1453.352 1402.897 1480.499 1342.280 1351.225
 [9] 1361.760 1420.662
> rowVars(tmp5,na.rm=TRUE)
 [1] 7972.43805   88.53248   72.97334  128.15633   57.74624   56.27405
 [7]   65.68719   61.66520   62.70310   84.87391
> rowSd(tmp5,na.rm=TRUE)
 [1] 89.288510  9.409170  8.542443 11.320615  7.599095  7.501603  8.104764
 [8]  7.852720  7.918529  9.212704
> rowMax(tmp5,na.rm=TRUE)
 [1] 468.04084  89.61651  88.46767  91.47147  83.04589  90.70386  82.81508
 [8]  83.80869  88.39077  93.14851
> rowMin(tmp5,na.rm=TRUE)
 [1] 57.74744 55.43299 56.00731 54.57691 55.72571 60.98382 56.06104 57.08486
 [9] 54.87577 55.37180
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 110.54263  68.65307  67.22928  69.61325  71.11680  73.39730  73.21453
 [8]  73.48540  72.35928  70.26195  71.35938  68.64181  68.51919  65.91198
[15]  72.02715  73.10082  67.22590  67.29763  68.62059  73.00530
> colSums(tmp5,na.rm=TRUE)
 [1] 1105.4263  686.5307  672.2928  696.1325  711.1680  733.9730  732.1453
 [8]  734.8540  723.5928  702.6195  713.5938  686.4181  685.1919  659.1198
[15]  720.2715  731.0082  605.0331  672.9763  686.2059  730.0530
> colVars(tmp5,na.rm=TRUE)
 [1] 15814.92701   143.59599    43.19018    35.56625    68.35014    99.29729
 [7]    75.72582    81.53945    64.51033    74.43658    78.39601    58.70082
[13]    82.65044    47.01928    95.97419    60.23262    94.67888    50.29604
[19]   183.70381   137.88760
> colSd(tmp5,na.rm=TRUE)
 [1] 125.757413  11.983155   6.571923   5.963744   8.267414   9.964803
 [7]   8.702059   9.029920   8.031832   8.627664   8.854152   7.661646
[13]   9.091229   6.857061   9.796642   7.760968   9.730307   7.091970
[19]  13.553738  11.742555
> colMax(tmp5,na.rm=TRUE)
 [1] 468.04084  94.11560  75.52200  77.77541  88.66018  83.80869  84.63130
 [8]  87.63845  83.89190  81.94448  85.10274  79.61881  88.39077  75.15374
[15]  93.14851  87.98547  81.04634  81.46651  90.70386  91.47147
> colMin(tmp5,na.rm=TRUE)
 [1] 64.32375 56.00731 56.41725 58.26277 60.52253 54.87577 57.08486 60.22826
 [9] 58.01706 57.74028 61.07388 56.06104 58.19298 55.37180 60.98040 59.58326
[17] 54.57691 57.74744 56.44278 55.72571
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1] 90.98288 70.18734 67.62636 72.66762 70.14486 74.02493 67.11399      NaN
 [9] 68.08801 71.03311
> rowSums(tmp5,na.rm=TRUE)
 [1] 1819.658 1403.747 1352.527 1453.352 1402.897 1480.499 1342.280    0.000
 [9] 1361.760 1420.662
> rowVars(tmp5,na.rm=TRUE)
 [1] 7972.43805   88.53248   72.97334  128.15633   57.74624   56.27405
 [7]   65.68719         NA   62.70310   84.87391
> rowSd(tmp5,na.rm=TRUE)
 [1] 89.288510  9.409170  8.542443 11.320615  7.599095  7.501603  8.104764
 [8]        NA  7.918529  9.212704
> rowMax(tmp5,na.rm=TRUE)
 [1] 468.04084  89.61651  88.46767  91.47147  83.04589  90.70386  82.81508
 [8]        NA  88.39077  93.14851
> rowMin(tmp5,na.rm=TRUE)
 [1] 57.74744 55.43299 56.00731 54.57691 55.72571 60.98382 56.06104       NA
 [9] 54.87577 55.37180
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1] 115.52376  69.63606  66.30787  69.37256  71.65566  72.24048  75.00672
 [8]  74.34798  72.70704  69.25268  70.22550  67.85073  68.85938  64.88512
[15]  72.76753  72.80059       NaN  66.80877  69.26177  71.86188
> colSums(tmp5,na.rm=TRUE)
 [1] 1039.7139  626.7245  596.7708  624.3531  644.9010  650.1643  675.0605
 [8]  669.1318  654.3633  623.2741  632.0295  610.6565  619.7344  583.9661
[15]  654.9078  655.2053    0.0000  601.2790  623.3559  646.7570
> colVars(tmp5,na.rm=TRUE)
 [1] 17512.66165   150.67505    39.03767    39.36031    73.62715    96.65430
 [7]    49.05732    83.36136    71.21357    72.28152    73.73149    58.99795
[13]    91.67978    41.03417   101.80409    66.74766          NA    53.89454
[19]   202.04179   140.41542
> colSd(tmp5,na.rm=TRUE)
 [1] 132.335413  12.274976   6.248014   6.273780   8.580626   9.831292
 [7]   7.004093   9.130244   8.438813   8.501854   8.586704   7.681012
[13]   9.574956   6.405792  10.089801   8.169924         NA   7.341290
[19]  14.214141  11.849701
> colMax(tmp5,na.rm=TRUE)
 [1] 468.04084  94.11560  75.49533  77.77541  88.66018  83.04589  84.63130
 [8]  87.63845  83.89190  81.94448  85.10274  79.61881  88.39077  73.49789
[15]  93.14851  87.98547      -Inf  81.46651  90.70386  91.47147
> colMin(tmp5,na.rm=TRUE)
 [1] 64.32375 56.00731 56.41725 58.26277 60.52253 54.87577 65.03755 60.22826
 [9] 58.01706 57.74028 61.07388 56.06104 58.19298 55.37180 60.98040 59.58326
[17]      Inf 57.74744 56.44278 55.72571
> 
> 
> 
> 
> 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] 248.07830 219.72102 240.52222 271.05609 167.75070 356.16504  75.66499
 [8] 210.74685 260.44206 208.21122
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 248.07830 219.72102 240.52222 271.05609 167.75070 356.16504  75.66499
 [8] 210.74685 260.44206 208.21122
> 
> 
> 
> copymatrix <- matrix(rnorm(200,150,15),10,20)
> 
> tmp5[1:10,1:20] <- copymatrix
> which.row <- 1
> which.col  <- 3
> cat(which.row," ",which.col,"\n")
1   3 
> tmp5[which.row,which.col] <- NA
> copymatrix[which.row,which.col] <- NA
> 
> colVars(tmp5,na.rm=TRUE)-apply(copymatrix,2,var,na.rm=TRUE)
 [1]  8.526513e-14  0.000000e+00  0.000000e+00  0.000000e+00 -1.421085e-13
 [6]  1.705303e-13  1.705303e-13  5.684342e-14  8.526513e-14  2.842171e-14
[11]  2.842171e-14  8.526513e-14 -2.842171e-14 -1.705303e-13 -1.705303e-13
[16]  0.000000e+00 -2.273737e-13 -8.526513e-14 -3.410605e-13 -5.684342e-14
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> ## making sure these things agree
> ##
> ## first when there is no NA
> 
> 
> 
> agree.checks <- function(buff.matrix,r.matrix,err.tol=1e-10){
+ 
+   if (Max(buff.matrix,na.rm=TRUE) != max(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Max")
+   }
+   
+ 
+   if (Min(buff.matrix,na.rm=TRUE) != min(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Min")
+   }
+ 
+ 
+   if (abs(Sum(buff.matrix,na.rm=TRUE)- sum(r.matrix,na.rm=TRUE)) > err.tol){
+ 
+     cat(Sum(buff.matrix,na.rm=TRUE),"\n")
+     cat(sum(r.matrix,na.rm=TRUE),"\n")
+     cat(Sum(buff.matrix,na.rm=TRUE) - sum(r.matrix,na.rm=TRUE),"\n")
+     
+     stop("No agreement in Sum")
+   }
+   
+   if (abs(mean(buff.matrix,na.rm=TRUE) - mean(r.matrix,na.rm=TRUE)) > err.tol){
+     stop("No agreement in mean")
+   }
+   
+   
+   if(abs(Var(buff.matrix,na.rm=TRUE) - var(as.vector(r.matrix),na.rm=TRUE)) > err.tol){
+     stop("No agreement in Var")
+   }
+   
+   
+ 
+   if(any(abs(rowMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,mean,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowMeans")
+   }
+   
+   
+   if(any(abs(colMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,mean,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colMeans")
+   }
+   
+   
+   if(any(abs(rowSums(buff.matrix,na.rm=TRUE)  -  apply(r.matrix,1,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in rowSums")
+   }
+   
+   
+   if(any(abs(colSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colSums")
+   }
+   
+   ### this is to get around the fact that R doesn't like to compute NA on an entire vector of NA when 
+   ### computing variance
+   my.Var <- function(x,na.rm=FALSE){
+    if (all(is.na(x))){
+      return(NA)
+    } else {
+      var(x,na.rm=na.rm)
+    }
+ 
+   }
+   
+   if(any(abs(rowVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+   
+   
+   if(any(abs(colVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+ 
+ 
+   if(any(abs(rowMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+ 
+   if(any(abs(colMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+   
+   
+   if(any(abs(rowMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+   
+ 
+   if(any(abs(colMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+ 
+   if(any(abs(colMedians(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,median,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMedian")
+   }
+ 
+   if(any(abs(colRanges(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,range,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colRanges")
+   }
+ 
+ 
+   
+ }
> 
> 
> 
> 
> 
> 
> 
> 
> 
> for (rep in 1:20){
+   copymatrix <- matrix(rnorm(200,150,15),10,20)
+   
+   tmp5[1:10,1:20] <- copymatrix
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ## now lets assign some NA values and check agreement
+ 
+   which.row <- sample(1:10,1,replace=TRUE)
+   which.col  <- sample(1:20,1,replace=TRUE)
+   
+   cat(which.row," ",which.col,"\n")
+   
+   tmp5[which.row,which.col] <- NA
+   copymatrix[which.row,which.col] <- NA
+   
+   agree.checks(tmp5,copymatrix)
+ 
+   ## make an entire row NA
+   tmp5[which.row,] <- NA
+   copymatrix[which.row,] <- NA
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ### also make an entire col NA
+   tmp5[,which.col] <- NA
+   copymatrix[,which.col] <- NA
+ 
+   agree.checks(tmp5,copymatrix)
+ 
+   ### now make 1 element non NA with NA in the rest of row and column
+ 
+   tmp5[which.row,which.col] <- rnorm(1,150,15)
+   copymatrix[which.row,which.col] <- tmp5[which.row,which.col]
+ 
+   agree.checks(tmp5,copymatrix)
+ }
8   2 
8   15 
2   16 
2   16 
3   2 
1   12 
9   14 
7   19 
8   17 
2   13 
2   13 
8   6 
2   12 
5   7 
3   4 
7   15 
5   9 
5   19 
5   3 
5   7 
There were 50 or more warnings (use warnings() to see the first 50)
> 
> 
> ### now test 1 by n and n by 1 matrix
> 
> 
> err.tol <- 1e-12
> 
> rm(tmp5)
> 
> dataset1 <- rnorm(100)
> dataset2 <- rnorm(100)
> 
> tmp <- createBufferedMatrix(1,100)
> tmp[1,] <- dataset1
> 
> tmp2 <- createBufferedMatrix(100,1)
> tmp2[,1] <- dataset2
> 
> 
> 
> 
> 
> Max(tmp)
[1] 2.522093
> Min(tmp)
[1] -2.998527
> mean(tmp)
[1] -0.07499009
> Sum(tmp)
[1] -7.499009
> Var(tmp)
[1] 0.8943067
> 
> rowMeans(tmp)
[1] -0.07499009
> rowSums(tmp)
[1] -7.499009
> rowVars(tmp)
[1] 0.8943067
> rowSd(tmp)
[1] 0.9456779
> rowMax(tmp)
[1] 2.522093
> rowMin(tmp)
[1] -2.998527
> 
> colMeans(tmp)
  [1] -1.379165344  0.831930365 -1.373318791  1.569138589 -0.397638100
  [6]  0.552090592  0.638576619  0.402428080 -0.216695331 -0.947721052
 [11] -0.794004115  0.541496295  0.952858311 -0.355170622 -0.025114636
 [16] -0.555915039 -0.032881809  1.631917345  0.269857795  0.278004561
 [21] -0.486190923 -0.603948986 -1.479899395 -1.522826627  2.522092932
 [26] -1.345557866  1.323712424  0.184621987  2.314817457  1.395957907
 [31] -0.232681662  0.274543285 -0.126759116  1.113739718  0.545958926
 [36] -0.614497769  0.855605113 -0.846913706 -0.456514892 -0.583707814
 [41] -0.753802769 -0.014473769 -0.852562371 -0.629360637 -0.275884928
 [46] -0.525825180  0.555680338  0.866122006 -0.126187478 -0.180945157
 [51]  0.488635544 -1.403890851  0.189906839  1.562164562  1.270654170
 [56] -0.768984741 -0.928209487 -0.136960797 -1.788312674  1.137331808
 [61] -0.775926225  0.002650085 -0.756205622  0.948221584 -0.749872900
 [66] -0.025377637  0.125582152 -0.778046560  1.157160780 -1.312699396
 [71] -1.463679608 -1.227497764 -0.164240314  0.211019932 -0.459452628
 [76]  0.239977358 -0.161527512  1.550071574 -0.882164570  0.451986075
 [81] -0.397625903 -1.417040502 -0.316666417 -0.855621008  1.329942467
 [86] -0.451480821  0.653598880  0.590179881 -0.011278833  0.231692201
 [91] -1.092210974 -0.690685604 -0.383595521 -0.288544715 -0.202884344
 [96] -0.326561344  0.018692141  1.638563632 -2.998527373  0.033747237
> colSums(tmp)
  [1] -1.379165344  0.831930365 -1.373318791  1.569138589 -0.397638100
  [6]  0.552090592  0.638576619  0.402428080 -0.216695331 -0.947721052
 [11] -0.794004115  0.541496295  0.952858311 -0.355170622 -0.025114636
 [16] -0.555915039 -0.032881809  1.631917345  0.269857795  0.278004561
 [21] -0.486190923 -0.603948986 -1.479899395 -1.522826627  2.522092932
 [26] -1.345557866  1.323712424  0.184621987  2.314817457  1.395957907
 [31] -0.232681662  0.274543285 -0.126759116  1.113739718  0.545958926
 [36] -0.614497769  0.855605113 -0.846913706 -0.456514892 -0.583707814
 [41] -0.753802769 -0.014473769 -0.852562371 -0.629360637 -0.275884928
 [46] -0.525825180  0.555680338  0.866122006 -0.126187478 -0.180945157
 [51]  0.488635544 -1.403890851  0.189906839  1.562164562  1.270654170
 [56] -0.768984741 -0.928209487 -0.136960797 -1.788312674  1.137331808
 [61] -0.775926225  0.002650085 -0.756205622  0.948221584 -0.749872900
 [66] -0.025377637  0.125582152 -0.778046560  1.157160780 -1.312699396
 [71] -1.463679608 -1.227497764 -0.164240314  0.211019932 -0.459452628
 [76]  0.239977358 -0.161527512  1.550071574 -0.882164570  0.451986075
 [81] -0.397625903 -1.417040502 -0.316666417 -0.855621008  1.329942467
 [86] -0.451480821  0.653598880  0.590179881 -0.011278833  0.231692201
 [91] -1.092210974 -0.690685604 -0.383595521 -0.288544715 -0.202884344
 [96] -0.326561344  0.018692141  1.638563632 -2.998527373  0.033747237
> 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.379165344  0.831930365 -1.373318791  1.569138589 -0.397638100
  [6]  0.552090592  0.638576619  0.402428080 -0.216695331 -0.947721052
 [11] -0.794004115  0.541496295  0.952858311 -0.355170622 -0.025114636
 [16] -0.555915039 -0.032881809  1.631917345  0.269857795  0.278004561
 [21] -0.486190923 -0.603948986 -1.479899395 -1.522826627  2.522092932
 [26] -1.345557866  1.323712424  0.184621987  2.314817457  1.395957907
 [31] -0.232681662  0.274543285 -0.126759116  1.113739718  0.545958926
 [36] -0.614497769  0.855605113 -0.846913706 -0.456514892 -0.583707814
 [41] -0.753802769 -0.014473769 -0.852562371 -0.629360637 -0.275884928
 [46] -0.525825180  0.555680338  0.866122006 -0.126187478 -0.180945157
 [51]  0.488635544 -1.403890851  0.189906839  1.562164562  1.270654170
 [56] -0.768984741 -0.928209487 -0.136960797 -1.788312674  1.137331808
 [61] -0.775926225  0.002650085 -0.756205622  0.948221584 -0.749872900
 [66] -0.025377637  0.125582152 -0.778046560  1.157160780 -1.312699396
 [71] -1.463679608 -1.227497764 -0.164240314  0.211019932 -0.459452628
 [76]  0.239977358 -0.161527512  1.550071574 -0.882164570  0.451986075
 [81] -0.397625903 -1.417040502 -0.316666417 -0.855621008  1.329942467
 [86] -0.451480821  0.653598880  0.590179881 -0.011278833  0.231692201
 [91] -1.092210974 -0.690685604 -0.383595521 -0.288544715 -0.202884344
 [96] -0.326561344  0.018692141  1.638563632 -2.998527373  0.033747237
> colMin(tmp)
  [1] -1.379165344  0.831930365 -1.373318791  1.569138589 -0.397638100
  [6]  0.552090592  0.638576619  0.402428080 -0.216695331 -0.947721052
 [11] -0.794004115  0.541496295  0.952858311 -0.355170622 -0.025114636
 [16] -0.555915039 -0.032881809  1.631917345  0.269857795  0.278004561
 [21] -0.486190923 -0.603948986 -1.479899395 -1.522826627  2.522092932
 [26] -1.345557866  1.323712424  0.184621987  2.314817457  1.395957907
 [31] -0.232681662  0.274543285 -0.126759116  1.113739718  0.545958926
 [36] -0.614497769  0.855605113 -0.846913706 -0.456514892 -0.583707814
 [41] -0.753802769 -0.014473769 -0.852562371 -0.629360637 -0.275884928
 [46] -0.525825180  0.555680338  0.866122006 -0.126187478 -0.180945157
 [51]  0.488635544 -1.403890851  0.189906839  1.562164562  1.270654170
 [56] -0.768984741 -0.928209487 -0.136960797 -1.788312674  1.137331808
 [61] -0.775926225  0.002650085 -0.756205622  0.948221584 -0.749872900
 [66] -0.025377637  0.125582152 -0.778046560  1.157160780 -1.312699396
 [71] -1.463679608 -1.227497764 -0.164240314  0.211019932 -0.459452628
 [76]  0.239977358 -0.161527512  1.550071574 -0.882164570  0.451986075
 [81] -0.397625903 -1.417040502 -0.316666417 -0.855621008  1.329942467
 [86] -0.451480821  0.653598880  0.590179881 -0.011278833  0.231692201
 [91] -1.092210974 -0.690685604 -0.383595521 -0.288544715 -0.202884344
 [96] -0.326561344  0.018692141  1.638563632 -2.998527373  0.033747237
> colMedians(tmp)
  [1] -1.379165344  0.831930365 -1.373318791  1.569138589 -0.397638100
  [6]  0.552090592  0.638576619  0.402428080 -0.216695331 -0.947721052
 [11] -0.794004115  0.541496295  0.952858311 -0.355170622 -0.025114636
 [16] -0.555915039 -0.032881809  1.631917345  0.269857795  0.278004561
 [21] -0.486190923 -0.603948986 -1.479899395 -1.522826627  2.522092932
 [26] -1.345557866  1.323712424  0.184621987  2.314817457  1.395957907
 [31] -0.232681662  0.274543285 -0.126759116  1.113739718  0.545958926
 [36] -0.614497769  0.855605113 -0.846913706 -0.456514892 -0.583707814
 [41] -0.753802769 -0.014473769 -0.852562371 -0.629360637 -0.275884928
 [46] -0.525825180  0.555680338  0.866122006 -0.126187478 -0.180945157
 [51]  0.488635544 -1.403890851  0.189906839  1.562164562  1.270654170
 [56] -0.768984741 -0.928209487 -0.136960797 -1.788312674  1.137331808
 [61] -0.775926225  0.002650085 -0.756205622  0.948221584 -0.749872900
 [66] -0.025377637  0.125582152 -0.778046560  1.157160780 -1.312699396
 [71] -1.463679608 -1.227497764 -0.164240314  0.211019932 -0.459452628
 [76]  0.239977358 -0.161527512  1.550071574 -0.882164570  0.451986075
 [81] -0.397625903 -1.417040502 -0.316666417 -0.855621008  1.329942467
 [86] -0.451480821  0.653598880  0.590179881 -0.011278833  0.231692201
 [91] -1.092210974 -0.690685604 -0.383595521 -0.288544715 -0.202884344
 [96] -0.326561344  0.018692141  1.638563632 -2.998527373  0.033747237
> colRanges(tmp)
          [,1]      [,2]      [,3]     [,4]       [,5]      [,6]      [,7]
[1,] -1.379165 0.8319304 -1.373319 1.569139 -0.3976381 0.5520906 0.6385766
[2,] -1.379165 0.8319304 -1.373319 1.569139 -0.3976381 0.5520906 0.6385766
          [,8]       [,9]      [,10]      [,11]     [,12]     [,13]      [,14]
[1,] 0.4024281 -0.2166953 -0.9477211 -0.7940041 0.5414963 0.9528583 -0.3551706
[2,] 0.4024281 -0.2166953 -0.9477211 -0.7940041 0.5414963 0.9528583 -0.3551706
           [,15]     [,16]       [,17]    [,18]     [,19]     [,20]      [,21]
[1,] -0.02511464 -0.555915 -0.03288181 1.631917 0.2698578 0.2780046 -0.4861909
[2,] -0.02511464 -0.555915 -0.03288181 1.631917 0.2698578 0.2780046 -0.4861909
         [,22]     [,23]     [,24]    [,25]     [,26]    [,27]    [,28]
[1,] -0.603949 -1.479899 -1.522827 2.522093 -1.345558 1.323712 0.184622
[2,] -0.603949 -1.479899 -1.522827 2.522093 -1.345558 1.323712 0.184622
        [,29]    [,30]      [,31]     [,32]      [,33]   [,34]     [,35]
[1,] 2.314817 1.395958 -0.2326817 0.2745433 -0.1267591 1.11374 0.5459589
[2,] 2.314817 1.395958 -0.2326817 0.2745433 -0.1267591 1.11374 0.5459589
          [,36]     [,37]      [,38]      [,39]      [,40]      [,41]
[1,] -0.6144978 0.8556051 -0.8469137 -0.4565149 -0.5837078 -0.7538028
[2,] -0.6144978 0.8556051 -0.8469137 -0.4565149 -0.5837078 -0.7538028
           [,42]      [,43]      [,44]      [,45]      [,46]     [,47]    [,48]
[1,] -0.01447377 -0.8525624 -0.6293606 -0.2758849 -0.5258252 0.5556803 0.866122
[2,] -0.01447377 -0.8525624 -0.6293606 -0.2758849 -0.5258252 0.5556803 0.866122
          [,49]      [,50]     [,51]     [,52]     [,53]    [,54]    [,55]
[1,] -0.1261875 -0.1809452 0.4886355 -1.403891 0.1899068 1.562165 1.270654
[2,] -0.1261875 -0.1809452 0.4886355 -1.403891 0.1899068 1.562165 1.270654
          [,56]      [,57]      [,58]     [,59]    [,60]      [,61]       [,62]
[1,] -0.7689847 -0.9282095 -0.1369608 -1.788313 1.137332 -0.7759262 0.002650085
[2,] -0.7689847 -0.9282095 -0.1369608 -1.788313 1.137332 -0.7759262 0.002650085
          [,63]     [,64]      [,65]       [,66]     [,67]      [,68]    [,69]
[1,] -0.7562056 0.9482216 -0.7498729 -0.02537764 0.1255822 -0.7780466 1.157161
[2,] -0.7562056 0.9482216 -0.7498729 -0.02537764 0.1255822 -0.7780466 1.157161
         [,70]    [,71]     [,72]      [,73]     [,74]      [,75]     [,76]
[1,] -1.312699 -1.46368 -1.227498 -0.1642403 0.2110199 -0.4594526 0.2399774
[2,] -1.312699 -1.46368 -1.227498 -0.1642403 0.2110199 -0.4594526 0.2399774
          [,77]    [,78]      [,79]     [,80]      [,81]     [,82]      [,83]
[1,] -0.1615275 1.550072 -0.8821646 0.4519861 -0.3976259 -1.417041 -0.3166664
[2,] -0.1615275 1.550072 -0.8821646 0.4519861 -0.3976259 -1.417041 -0.3166664
         [,84]    [,85]      [,86]     [,87]     [,88]       [,89]     [,90]
[1,] -0.855621 1.329942 -0.4514808 0.6535989 0.5901799 -0.01127883 0.2316922
[2,] -0.855621 1.329942 -0.4514808 0.6535989 0.5901799 -0.01127883 0.2316922
         [,91]      [,92]      [,93]      [,94]      [,95]      [,96]
[1,] -1.092211 -0.6906856 -0.3835955 -0.2885447 -0.2028843 -0.3265613
[2,] -1.092211 -0.6906856 -0.3835955 -0.2885447 -0.2028843 -0.3265613
          [,97]    [,98]     [,99]     [,100]
[1,] 0.01869214 1.638564 -2.998527 0.03374724
[2,] 0.01869214 1.638564 -2.998527 0.03374724
> 
> 
> Max(tmp2)
[1] 2.689872
> Min(tmp2)
[1] -2.127452
> mean(tmp2)
[1] 0.07573553
> Sum(tmp2)
[1] 7.573553
> Var(tmp2)
[1] 0.9141068
> 
> rowMeans(tmp2)
  [1]  0.43144617  0.07267570  1.94781753  0.50699312 -0.10828706 -0.14138606
  [7]  1.00920157 -0.49281731  0.71166607 -0.56801196 -0.37985114 -0.95085608
 [13] -0.40588049 -0.88507581  0.87848096 -0.59441396  0.35362779 -1.42548704
 [19]  2.68987241 -0.42782886  1.33742409  0.13923033 -0.37379845 -0.85785581
 [25] -0.18964107  0.44952457  0.29585072  0.30100583 -1.22659486  0.68883897
 [31]  1.32950993 -0.92897446  1.26229081 -1.41460335  0.35883385 -0.34790949
 [37]  0.48397615 -1.27635380 -0.75133807  0.81041168 -0.24879045  0.94425896
 [43] -0.04840039  0.62029660  0.01481747 -1.29431823 -0.65394365 -0.29208734
 [49]  2.06055593 -0.70614923 -1.09112222  0.12048411  0.13010488  0.71421464
 [55]  0.45695597 -0.74828232  0.05781745 -0.03183159  0.04692298 -1.43712040
 [61]  0.20763999  0.93939151 -0.46854704 -0.13523699 -2.12745249  0.68641749
 [67] -0.52623329  0.29325069 -0.89948437  0.47129730  0.01792887  0.36137907
 [73]  0.22962232 -1.90594650  1.01252980  1.01620687  1.11980714 -0.04336408
 [79]  0.06995942  0.90678925 -1.05411589  0.75099192  2.25779676  0.87144510
 [85] -0.79651564 -1.49872009  0.11098040  1.38651383  0.29497651  2.61010243
 [91] -0.07489782 -0.62242340 -1.27485979 -1.13171359  1.35213939  1.43560263
 [97]  0.70567343 -0.11862236 -0.90155219  1.11870059
> rowSums(tmp2)
  [1]  0.43144617  0.07267570  1.94781753  0.50699312 -0.10828706 -0.14138606
  [7]  1.00920157 -0.49281731  0.71166607 -0.56801196 -0.37985114 -0.95085608
 [13] -0.40588049 -0.88507581  0.87848096 -0.59441396  0.35362779 -1.42548704
 [19]  2.68987241 -0.42782886  1.33742409  0.13923033 -0.37379845 -0.85785581
 [25] -0.18964107  0.44952457  0.29585072  0.30100583 -1.22659486  0.68883897
 [31]  1.32950993 -0.92897446  1.26229081 -1.41460335  0.35883385 -0.34790949
 [37]  0.48397615 -1.27635380 -0.75133807  0.81041168 -0.24879045  0.94425896
 [43] -0.04840039  0.62029660  0.01481747 -1.29431823 -0.65394365 -0.29208734
 [49]  2.06055593 -0.70614923 -1.09112222  0.12048411  0.13010488  0.71421464
 [55]  0.45695597 -0.74828232  0.05781745 -0.03183159  0.04692298 -1.43712040
 [61]  0.20763999  0.93939151 -0.46854704 -0.13523699 -2.12745249  0.68641749
 [67] -0.52623329  0.29325069 -0.89948437  0.47129730  0.01792887  0.36137907
 [73]  0.22962232 -1.90594650  1.01252980  1.01620687  1.11980714 -0.04336408
 [79]  0.06995942  0.90678925 -1.05411589  0.75099192  2.25779676  0.87144510
 [85] -0.79651564 -1.49872009  0.11098040  1.38651383  0.29497651  2.61010243
 [91] -0.07489782 -0.62242340 -1.27485979 -1.13171359  1.35213939  1.43560263
 [97]  0.70567343 -0.11862236 -0.90155219  1.11870059
> 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.43144617  0.07267570  1.94781753  0.50699312 -0.10828706 -0.14138606
  [7]  1.00920157 -0.49281731  0.71166607 -0.56801196 -0.37985114 -0.95085608
 [13] -0.40588049 -0.88507581  0.87848096 -0.59441396  0.35362779 -1.42548704
 [19]  2.68987241 -0.42782886  1.33742409  0.13923033 -0.37379845 -0.85785581
 [25] -0.18964107  0.44952457  0.29585072  0.30100583 -1.22659486  0.68883897
 [31]  1.32950993 -0.92897446  1.26229081 -1.41460335  0.35883385 -0.34790949
 [37]  0.48397615 -1.27635380 -0.75133807  0.81041168 -0.24879045  0.94425896
 [43] -0.04840039  0.62029660  0.01481747 -1.29431823 -0.65394365 -0.29208734
 [49]  2.06055593 -0.70614923 -1.09112222  0.12048411  0.13010488  0.71421464
 [55]  0.45695597 -0.74828232  0.05781745 -0.03183159  0.04692298 -1.43712040
 [61]  0.20763999  0.93939151 -0.46854704 -0.13523699 -2.12745249  0.68641749
 [67] -0.52623329  0.29325069 -0.89948437  0.47129730  0.01792887  0.36137907
 [73]  0.22962232 -1.90594650  1.01252980  1.01620687  1.11980714 -0.04336408
 [79]  0.06995942  0.90678925 -1.05411589  0.75099192  2.25779676  0.87144510
 [85] -0.79651564 -1.49872009  0.11098040  1.38651383  0.29497651  2.61010243
 [91] -0.07489782 -0.62242340 -1.27485979 -1.13171359  1.35213939  1.43560263
 [97]  0.70567343 -0.11862236 -0.90155219  1.11870059
> rowMin(tmp2)
  [1]  0.43144617  0.07267570  1.94781753  0.50699312 -0.10828706 -0.14138606
  [7]  1.00920157 -0.49281731  0.71166607 -0.56801196 -0.37985114 -0.95085608
 [13] -0.40588049 -0.88507581  0.87848096 -0.59441396  0.35362779 -1.42548704
 [19]  2.68987241 -0.42782886  1.33742409  0.13923033 -0.37379845 -0.85785581
 [25] -0.18964107  0.44952457  0.29585072  0.30100583 -1.22659486  0.68883897
 [31]  1.32950993 -0.92897446  1.26229081 -1.41460335  0.35883385 -0.34790949
 [37]  0.48397615 -1.27635380 -0.75133807  0.81041168 -0.24879045  0.94425896
 [43] -0.04840039  0.62029660  0.01481747 -1.29431823 -0.65394365 -0.29208734
 [49]  2.06055593 -0.70614923 -1.09112222  0.12048411  0.13010488  0.71421464
 [55]  0.45695597 -0.74828232  0.05781745 -0.03183159  0.04692298 -1.43712040
 [61]  0.20763999  0.93939151 -0.46854704 -0.13523699 -2.12745249  0.68641749
 [67] -0.52623329  0.29325069 -0.89948437  0.47129730  0.01792887  0.36137907
 [73]  0.22962232 -1.90594650  1.01252980  1.01620687  1.11980714 -0.04336408
 [79]  0.06995942  0.90678925 -1.05411589  0.75099192  2.25779676  0.87144510
 [85] -0.79651564 -1.49872009  0.11098040  1.38651383  0.29497651  2.61010243
 [91] -0.07489782 -0.62242340 -1.27485979 -1.13171359  1.35213939  1.43560263
 [97]  0.70567343 -0.11862236 -0.90155219  1.11870059
> 
> colMeans(tmp2)
[1] 0.07573553
> colSums(tmp2)
[1] 7.573553
> colVars(tmp2)
[1] 0.9141068
> colSd(tmp2)
[1] 0.9560893
> colMax(tmp2)
[1] 2.689872
> colMin(tmp2)
[1] -2.127452
> colMedians(tmp2)
[1] 0.06388844
> colRanges(tmp2)
          [,1]
[1,] -2.127452
[2,]  2.689872
> 
> dataset1 <- matrix(dataset1,1,100)
> 
> agree.checks(tmp,dataset1)
> 
> dataset2 <- matrix(dataset2,100,1)
> agree.checks(tmp2,dataset2)
>   
> 
> tmp <- createBufferedMatrix(10,10)
> 
> tmp[1:10,1:10] <- rnorm(100)
> colApply(tmp,sum)
 [1]  0.01735534  0.06585036  2.99445137 -4.03738446  1.39188612 -3.09990568
 [7] -4.12968678 -3.81906654 -0.06501803  0.93059467
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -1.4872224
[2,] -0.4072328
[3,]  0.3183746
[4,]  0.5133523
[5,]  0.9580157
> 
> rowApply(tmp,sum)
 [1] -8.3895677  2.2376640  0.1765017 -3.6538508  0.9203668 -1.2063333
 [7]  0.5941830 -1.0956596  2.4865270 -1.8207546
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]   10    7    6   10    3    1    8   10    2     6
 [2,]    4    6    8    7    2    2    7    1    7    10
 [3,]    1    8   10    8   10    4    9    5    3     9
 [4,]    2    3    1    3    9    5   10    4    6     1
 [5,]    9    2    2    5    4   10    6    7   10     8
 [6,]    7    4    4    2    7    7    5    8    1     4
 [7,]    6    5    3    1    6    6    3    6    4     7
 [8,]    8    1    5    9    8    3    4    2    5     3
 [9,]    3   10    7    4    1    9    1    9    9     5
[10,]    5    9    9    6    5    8    2    3    8     2
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1]  3.5823769 -2.3740524  1.6715648  2.5216934  2.7671637  1.4830332
 [7]  1.2455641 -2.1684888 -5.5157608  0.8987463 -0.5631230 -1.2401053
[13]  2.8116616 -3.7939037 -0.2195383  2.2074426 -1.0545123 -0.7306974
[19]  1.4888191  2.4890148
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -0.3435550
[2,]  0.8237207
[3,]  0.8524749
[4,]  1.1095269
[5,]  1.1402095
> 
> rowApply(tmp,sum)
[1]  1.71174974  0.06363364  3.24564869  0.69777165 -0.21190519
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]   16    6   16   16   17
[2,]    4   17    6    2   11
[3,]   17   20   15    3    7
[4,]   18   19   17   10    3
[5,]    9   13   18   19   10
> 
> 
> as.matrix(tmp)
           [,1]        [,2]       [,3]        [,4]        [,5]       [,6]
[1,]  0.8524749 -0.68688820  0.9140877  1.30286677 -0.20483956  1.3122559
[2,] -0.3435550  0.73702178  1.7969725  1.51354528  0.04173067 -0.2018026
[3,]  1.1402095 -0.44042743  0.8981309  1.21072501  1.23769819  1.4398592
[4,]  0.8237207 -1.91324064 -1.6697907  0.08174265  1.81501025 -0.3724949
[5,]  1.1095269 -0.07051792 -0.2678356 -1.58718634 -0.12243585 -0.6947844
           [,7]        [,8]       [,9]       [,10]      [,11]      [,12]
[1,] -0.6226567 -0.37455549  0.3054922 -0.04952635 -1.9784822 -0.2393451
[2,] -1.3543518  0.17963530 -0.2901167 -0.01530868 -0.6250058 -0.5141265
[3,]  0.1080494 -0.96596282 -1.1616369  0.30109959 -0.9475464  0.7885060
[4,]  1.1340721 -0.09933259 -1.9887925  0.60213446  2.7310735 -1.3668740
[5,]  1.9804511 -0.90827316 -2.3807070  0.06034733  0.2568380  0.0917343
           [,13]       [,14]      [,15]      [,16]      [,17]      [,18]
[1,] -1.12917301 -0.42984116  0.4859449  0.6031052 -0.1283487 -0.7764710
[2,]  1.00653565 -1.96158509 -0.2548868  0.2081099  0.6132349 -0.3624900
[3,]  1.44344254  0.34676250 -0.8686890  0.1463908 -1.9738127  0.4035699
[4,]  0.08432368 -0.06631654  0.6742442 -0.4857270  0.5656936  0.2871123
[5,]  1.40653278 -1.68292342 -0.2561515  1.7355637 -0.1312793 -0.2824186
           [,19]        [,20]
[1,]  2.07086127  0.484788532
[2,]  0.02735857 -0.137282018
[3,]  0.13913166  0.000148744
[4,] -1.27698614  1.138199195
[5,]  0.52845373  1.003160347
> 
> 
> is.BufferedMatrix(tmp)
[1] TRUE
> 
> as.BufferedMatrix(as.matrix(tmp))
BufferedMatrix object
Matrix size:  5 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  800  bytes.
> 
> 
> 
> subBufferedMatrix(tmp,1:5,1:5)
BufferedMatrix object
Matrix size:  5 5 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  653  bytes.
Disk usage :  200  bytes.
> subBufferedMatrix(tmp,,5:8)
BufferedMatrix object
Matrix size:  5 4 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  565  bytes.
Disk usage :  160  bytes.
> subBufferedMatrix(tmp,1:3,)
BufferedMatrix object
Matrix size:  3 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  480  bytes.
> 
> 
> rm(tmp)
> 
> 
> ###
> ### Testing colnames and rownames
> ###
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> 
> 
> colnames(tmp)
NULL
> rownames(tmp)
NULL
> 
> 
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> colnames(tmp)
 [1] "col1"  "col2"  "col3"  "col4"  "col5"  "col6"  "col7"  "col8"  "col9" 
[10] "col10" "col11" "col12" "col13" "col14" "col15" "col16" "col17" "col18"
[19] "col19" "col20"
> rownames(tmp)
[1] "row1" "row2" "row3" "row4" "row5"
> 
> 
> tmp["row1",]
          col1       col2      col3      col4      col5    col6       col7
row1 0.8415723 -0.4991497 0.2528496 0.8057274 0.2570561 1.06783 -0.2410271
           col8      col9    col10    col11    col12    col13     col14
row1 0.04240166 -1.058744 2.016265 1.611267 1.352358 1.129347 -1.080392
        col15    col16     col17     col18     col19      col20
row1 2.340832 1.304275 -1.020169 0.3933088 -1.908232 -0.9678327
> tmp[,"col10"]
           col10
row1  2.01626542
row2 -0.72205940
row3 -0.05474211
row4  0.39491726
row5 -0.66622798
> tmp[c("row1","row5"),]
          col1        col2       col3      col4       col5     col6       col7
row1 0.8415723 -0.49914971  0.2528496 0.8057274  0.2570561 1.067830 -0.2410271
row5 0.4370302 -0.08112031 -0.5712818 0.4382687 -0.5571600 1.203201 -0.9904122
            col8       col9     col10      col11     col12     col13     col14
row1  0.04240166 -1.0587443  2.016265  1.6112671  1.352358 1.1293466 -1.080392
row5 -0.18424276  0.1161626 -0.666228 -0.3905292 -2.003549 0.9232708  1.643304
        col15     col16     col17      col18     col19      col20
row1 2.340832 1.3042749 -1.020169  0.3933088 -1.908232 -0.9678327
row5 1.031638 0.3586446  1.483515 -0.4742870 -0.656236  1.2857559
> tmp[,c("col6","col20")]
           col6      col20
row1  1.0678302 -0.9678327
row2 -1.4658940 -2.1229002
row3  0.2068473  0.1938951
row4  0.3877930 -0.5982847
row5  1.2032014  1.2857559
> tmp[c("row1","row5"),c("col6","col20")]
         col6      col20
row1 1.067830 -0.9678327
row5 1.203201  1.2857559
> 
> 
> 
> 
> 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 47.41181 50.9067 50.98749 47.66885 49.32254 103.8021 49.62884 50.07822
         col9    col10    col11    col12    col13    col14    col15   col16
row1 49.47312 48.20737 50.30735 52.15305 49.25204 50.37502 51.53209 50.2783
        col17    col18    col19    col20
row1 50.15387 50.89773 50.10975 103.7906
> tmp[,"col10"]
        col10
row1 48.20737
row2 29.84891
row3 30.17374
row4 29.99514
row5 50.03097
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 47.41181 50.90670 50.98749 47.66885 49.32254 103.8021 49.62884 50.07822
row5 49.59234 48.95565 47.02644 49.36440 50.30248 105.4475 50.34207 48.31339
         col9    col10    col11    col12    col13    col14    col15    col16
row1 49.47312 48.20737 50.30735 52.15305 49.25204 50.37502 51.53209 50.27830
row5 50.01845 50.03097 51.17655 48.41604 49.42068 51.20238 49.88210 51.29539
        col17    col18    col19    col20
row1 50.15387 50.89773 50.10975 103.7906
row5 49.56681 49.83847 51.01797 103.3863
> tmp[,c("col6","col20")]
          col6     col20
row1 103.80206 103.79062
row2  75.68449  74.07266
row3  75.08375  74.12960
row4  75.36143  74.74249
row5 105.44747 103.38629
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 103.8021 103.7906
row5 105.4475 103.3863
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 103.8021 103.7906
row5 105.4475 103.3863
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
           col13
[1,]  0.66028480
[2,] -1.03437272
[3,]  0.04960473
[4,] -0.32143391
[5,] -0.63482167
> tmp[,c("col17","col7")]
            col17        col7
[1,] -0.302985405 -1.67999284
[2,]  1.750846127  0.08119830
[3,]  1.320458789 -1.02282508
[4,] -0.008184181  0.12076766
[5,]  1.076464745 -0.08268343
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
           col6       col20
[1,]  1.7937962 -0.79715659
[2,]  0.6292411  0.07236893
[3,]  0.7199981 -0.30459330
[4,] -2.2340847  1.05420165
[5,]  1.0577709 -0.20321452
> subBufferedMatrix(tmp,1,c("col6"))[,1]
         col1
[1,] 1.793796
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
          col6
[1,] 1.7937962
[2,] 0.6292411
> 
> 
> 
> 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.816304 -2.801957 1.69213  1.6395543 0.888347451 -1.9024898 -0.3726371
row1 1.222034  0.459533 1.09097 -0.6982408 0.009067748 -0.5225836  1.8881993
           [,8]       [,9]      [,10]      [,11]      [,12]      [,13]
row3 -0.5141696 -1.4023694 -0.5929874  2.4097173 -0.7425844 -0.0170325
row1  1.4953292 -0.9234606 -0.1722807 -0.6323433  0.4151549  1.3831724
         [,14]        [,15]     [,16]      [,17]      [,18]    [,19]     [,20]
row3 0.1569336 -0.007413777  1.004979 -0.1910161 0.48428189 1.453281 0.9232217
row1 0.7034837 -1.182769530 -0.478716 -0.4216599 0.07492065 1.543196 1.1173221
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
           [,1]     [,2]        [,3]     [,4]    [,5]      [,6]       [,7]
row2 -0.7428975 1.126671 -0.05062042 1.208912 2.81157 0.5129749 0.05862669
         [,8]      [,9]      [,10]
row2 1.616663 0.6154174 -0.4640197
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
           [,1]       [,2]     [,3]      [,4]     [,5]       [,6]      [,7]
row5 -0.4719692 -0.1114195 1.205147 0.4003967 1.195784 -0.1633122 0.9196893
           [,8]      [,9]    [,10]     [,11]    [,12]     [,13]      [,14]
row5 -0.8300942 0.9097538 1.464136 0.7954834 1.016654 0.9481907 -0.2004323
           [,15]    [,16]     [,17]      [,18]       [,19]     [,20]
row5 -0.06779259 1.049439 0.2201955 -0.4500866 -0.09675158 0.2693978
> 
> 
> 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: 0x60000152c000>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM10fd446fe96d7"
 [2] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM10fd4746121aa"
 [3] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM10fd414e95b97"
 [4] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM10fd4647c213a"
 [5] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM10fd411699a60"
 [6] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM10fd42c161d8e"
 [7] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM10fd45fee6c3e"
 [8] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM10fd41e048ba6"
 [9] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM10fd43c6c4eaf"
[10] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM10fd46aa1e226"
[11] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM10fd42a06637b"
[12] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM10fd496d35cb" 
[13] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM10fd460e6a742"
[14] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM10fd446ef0fc1"
[15] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM10fd478f36c48"
> 
> 
> ### 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: 0x6000015fc000>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x6000015fc000>
Warning message:
In dir.create(new.directory) :
  '/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x6000015fc000>
> rowMedians(tmp)
  [1] -0.783328326 -0.477297650  0.573160715 -0.200964996 -0.140262481
  [6]  0.022801753  0.191955397 -0.032218161 -0.022245085 -0.170889067
 [11] -0.649606131  0.001017300  0.259964986 -0.079114404  0.051072323
 [16] -0.008626351 -0.237172766 -0.127693843 -0.144470532  0.240912208
 [21] -0.169155049 -0.294486661 -0.012145514  0.097016398 -0.010290934
 [26] -0.037221475 -0.114481986 -0.034345607 -1.094185041 -0.007356902
 [31] -0.447963966  0.367826665 -0.114897860  0.091591829 -0.327449429
 [36] -0.096724435 -0.618157741  0.278142986 -0.504219258 -0.240207502
 [41] -0.092763762 -0.138025899  0.260537638 -0.314423295  0.115705872
 [46]  0.169751079 -0.079691507 -0.065427586 -0.039525423 -0.414359295
 [51] -0.013317238  0.125312887  0.349154790 -0.104952205  0.096891574
 [56]  0.421119876 -0.097776047  0.579240383 -0.342858243 -0.029869755
 [61]  0.024888288 -0.084508813  0.265871017  0.309124597  0.220504748
 [66] -0.252836048  0.162602893  0.255289209 -0.424072941  0.024337627
 [71]  0.073794366  0.379466896  0.108452511  0.018145359 -0.007602386
 [76] -0.035967101 -0.063448534 -0.216580827  0.091826736  0.633813442
 [81]  0.072645357 -0.040966665 -0.107058975  0.349984057 -0.190291228
 [86] -0.340390256 -0.221188300  0.037791246  0.015600857 -0.198348567
 [91]  0.313739122  0.197484070 -0.175965521 -0.539454571  0.563744385
 [96]  0.298274676 -0.118868445  0.205160671  0.007290186  0.167685122
[101]  0.731426528  0.199711673  0.235196685 -0.484009727  0.114972875
[106] -0.358725726 -0.143901817  0.048243045 -0.114324401  0.087438068
[111] -0.129925211 -0.483110986 -0.315754553 -0.155969510  0.155203795
[116]  0.085682334  0.031268121 -0.204345345  0.086392586  0.006924686
[121]  0.376727791  0.388033011  0.146383486  0.018066040 -0.481272200
[126]  0.314323068 -0.036308142 -0.445637794  0.395224774  0.062544349
[131] -0.010035794  0.008850213  0.164004326 -0.100150133 -0.519574185
[136]  0.061113330  0.404100820 -0.125514584 -0.192523697 -0.438411972
[141]  0.070609503  0.503805185  0.352258497  0.125435669  0.138722995
[146] -0.018873795 -0.212321054  0.116714479 -0.194895982  0.453778126
[151]  0.125644879  0.227754807  0.102215188 -0.136563155  0.331330027
[156] -0.046656787 -0.206739787  0.153625762 -0.277855034  0.183762491
[161]  0.094575750  0.345367918 -0.185670592  0.332008673  0.153450793
[166]  0.389560717  0.306978135  0.319350168 -0.115575194 -0.331378343
[171]  0.014676760 -0.358770099  0.331187609 -0.578043127  0.637228150
[176] -0.160663783 -0.304992328  0.365937351  0.077052119 -0.408575650
[181] -0.324158927  0.521695250 -0.083392161 -0.109400973 -0.101221949
[186] -0.605400031 -0.459566061  0.054118166 -0.619395031 -0.160699620
[191] -0.036149254  0.233927744 -0.104228363 -0.172138570  0.584349795
[196]  0.068710362 -0.160236606 -0.301790390  0.307626558 -0.129390037
[201] -0.003785800 -0.165173717 -0.251034291  0.023175169  0.640082382
[206]  0.054087560  0.427130744 -0.052635923  0.308588319 -0.384168818
[211] -0.085382428 -0.355114494  1.059769555  0.650167133  0.002987807
[216]  0.402901194  0.060528720  0.119267698  0.450527290 -0.279135437
[221]  0.383956034  0.596435869 -0.165755323 -0.184651716 -0.073118507
[226] -0.384952963 -0.050928114  0.201784006  0.040989347  0.437794813
> 
> proc.time()
   user  system elapsed 
  2.661  15.317  18.669 

BufferedMatrix.Rcheck/tests/rawCalltesting.Rout


R version 4.5.1 (2025-06-13) -- "Great Square Root"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: x86_64-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: 0x600002f30000>
> .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: 0x600002f30000>
> .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: 0x600002f30000>
> .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: 0x600002f30000>
> 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: 0x600002f40000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600002f40000>
> .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: 0x600002f40000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600002f40000>
> .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: 0x600002f40000>
> 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: 0x600002f40180>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600002f40180>
> .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: 0x600002f40180>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x600002f40180>
> .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: 0x600002f40180>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x600002f40180>
> .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: 0x600002f40180>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x600002f40180>
> .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: 0x600002f40180>
> 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: 0x600002f40360>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x600002f40360>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600002f40360>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600002f40360>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile115b010d7738c" "BufferedMatrixFile115b0606b0028"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile115b010d7738c" "BufferedMatrixFile115b0606b0028"
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x600002f44120>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600002f44120>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x600002f44120>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x600002f44120>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x600002f44120>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x600002f44120>
> .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: 0x600002f58000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600002f58000>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x600002f58000>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x600002f58000>
> 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: 0x600002f58180>
> .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: 0x600002f58180>
> rm(P)
> 
> proc.time()
   user  system elapsed 
  0.327   0.145   0.467 

BufferedMatrix.Rcheck/tests/Rcodetesting.Rout


R version 4.5.1 (2025-06-13) -- "Great Square Root"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: x86_64-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.340   0.099   0.416 

Example timings