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

This page was generated on 2025-08-30 12:05 -0400 (Sat, 30 Aug 2025).

HostnameOSArch (*)R versionInstalled pkgs
nebbiolo2Linux (Ubuntu 24.04.3 LTS)x86_644.5.1 (2025-06-13) -- "Great Square Root" 4824
lconwaymacOS 12.7.1 Montereyx86_644.5.1 (2025-06-13) -- "Great Square Root" 4615
kjohnson3macOS 13.7.7 Venturaarm644.5.1 Patched (2025-06-14 r88325) -- "Great Square Root" 4562
taishanLinux (openEuler 24.03 LTS)aarch644.5.0 (2025-04-11) -- "How About a Twenty-Six" 4541
Click on any hostname to see more info about the system (e.g. compilers)      (*) as reported by 'uname -p', except on Windows and Mac OS X

Package 252/2320HostnameOS / ArchINSTALLBUILDCHECKBUILD BIN
BufferedMatrix 1.73.0  (landing page)
Ben Bolstad
Snapshot Date: 2025-08-29 13:45 -0400 (Fri, 29 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.3 LTS) / x86_64  OK    OK    OK  UNNEEDED, same version is already published
lconwaymacOS 12.7.1 Monterey / x86_64  OK    OK    WARNINGS    OK  UNNEEDED, same version is already published
kjohnson3macOS 13.7.7 Ventura / arm64  OK    OK    WARNINGS    OK  UNNEEDED, same version is already published
taishanLinux (openEuler 24.03 LTS) / aarch64  OK    OK    OK  


CHECK results for BufferedMatrix on 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-29 19:35:08 -0400 (Fri, 29 Aug 2025)
EndedAt: 2025-08-29 19:35:57 -0400 (Fri, 29 Aug 2025)
EllapsedTime: 49.5 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.332   0.144   0.472 

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] "Fri Aug 29 19:35:31 2025"
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> date()
[1] "Fri Aug 29 19:35:32 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: 0x600000a08000>
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   which.col <- sample(1:20,1)
+   if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,5,replace=TRUE)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> date()
[1] "Fri Aug 29 19:35:36 2025"
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col <- sample(1:20,5,replace=TRUE)
+   if (!all(tmp2[which.row,which.col] == test.matrix[which.row,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> date()
[1] "Fri Aug 29 19:35:38 2025"
> 
> ColMode(tmp2)
<pointer: 0x600000a08000>
> 
> 
> 
> ### 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,] 98.9012609  0.3229283  0.3533640  0.6866212
[2,] -0.6913758  0.9194574  2.1454452 -1.7616756
[3,] -0.4382837 -0.1010353 -2.2523231 -0.5313966
[4,] -1.0917815 -1.1191207  0.1418084 -1.1572052
> 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 :  1.9  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
           [,1]      [,2]      [,3]      [,4]
[1,] 98.9012609 0.3229283 0.3533640 0.6866212
[2,]  0.6913758 0.9194574 2.1454452 1.7616756
[3,]  0.4382837 0.1010353 2.2523231 0.5313966
[4,]  1.0917815 1.1191207 0.1418084 1.1572052
> 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 :  1.9  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
          [,1]      [,2]      [,3]      [,4]
[1,] 9.9449113 0.5682678 0.5944443 0.8286261
[2,] 0.8314901 0.9588834 1.4647338 1.3272813
[3,] 0.6620300 0.3178605 1.5007742 0.7289695
[4,] 1.0448835 1.0578850 0.3765746 1.0757347
> 
> 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 :  1.9  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
          [,1]     [,2]     [,3]     [,4]
[1,] 223.35037 31.00561 31.29781 33.97288
[2,]  34.00628 35.50829 41.79278 40.03449
[3,]  32.05858 28.27964 42.26006 32.82109
[4,]  36.54062 36.69797 28.90755 36.91455
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x600000a74120>
> exp(tmp5)
<pointer: 0x600000a74120>
> log(tmp5,2)
<pointer: 0x600000a74120>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 464.8745
> Min(tmp5)
[1] 53.86056
> mean(tmp5)
[1] 72.76015
> Sum(tmp5)
[1] 14552.03
> Var(tmp5)
[1] 845.9637
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 91.51757 71.42959 71.07248 71.59452 71.78778 69.42486 69.73428 72.48282
 [9] 69.16415 69.39342
> rowSums(tmp5)
 [1] 1830.351 1428.592 1421.450 1431.890 1435.756 1388.497 1394.686 1449.656
 [9] 1383.283 1387.868
> rowVars(tmp5)
 [1] 7787.86784   80.12150   79.33344   63.84355  103.14952   87.57861
 [7]   38.08450   73.79819   59.69953   62.26286
> rowSd(tmp5)
 [1] 88.248897  8.951062  8.906932  7.990216 10.156255  9.358344  6.171264
 [8]  8.590587  7.726547  7.890682
> rowMax(tmp5)
 [1] 464.87454  86.98620  87.95879  88.36749  90.82096  92.59649  81.34034
 [8]  89.83636  83.23877  83.05316
> rowMin(tmp5)
 [1] 59.02383 54.87424 58.86037 54.04213 53.86056 56.13214 57.26452 55.90518
 [9] 54.93731 54.03180
> 
> colMeans(tmp5)
 [1] 109.01763  67.09058  70.57750  69.72795  71.89574  72.94072  73.03790
 [8]  69.63582  70.34306  71.13550  74.31648  72.28655  70.41926  72.14446
[15]  74.12815  67.70393  74.87156  67.97462  65.74226  70.21330
> colSums(tmp5)
 [1] 1090.1763  670.9058  705.7750  697.2795  718.9574  729.4072  730.3790
 [8]  696.3582  703.4306  711.3550  743.1648  722.8655  704.1926  721.4446
[15]  741.2815  677.0393  748.7156  679.7462  657.4226  702.1330
> colVars(tmp5)
 [1] 15723.45854    64.02311   107.66741   134.69774    24.01738    26.96753
 [7]    87.79156   111.21912    90.72126    30.23981    62.50583    43.84243
[13]    49.31585   109.32247    97.89518    59.31743    83.51889    54.95102
[19]    51.51446    26.82722
> colSd(tmp5)
 [1] 125.393216   8.001444  10.376291  11.605936   4.900753   5.193027
 [7]   9.369715  10.546048   9.524771   5.499073   7.906063   6.621362
[13]   7.022524  10.455739   9.894199   7.701781   9.138867   7.412896
[19]   7.177357   5.179500
> colMax(tmp5)
 [1] 464.87454  79.03472  87.95879  89.83636  80.33266  81.29755  85.07278
 [8]  85.19666  92.59649  83.23877  83.24003  80.92623  80.60989  90.73350
[15]  88.36749  83.14058  88.15749  85.37682  78.96279  77.29470
> colMin(tmp5)
 [1] 57.26452 57.70167 54.93731 53.86056 64.45007 65.15124 55.90518 54.04213
 [9] 54.03180 65.28280 63.28980 62.74779 61.02095 58.25259 59.66916 54.87424
[17] 59.12766 60.68253 57.41988 61.52291
> 
> 
> ### 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] 91.51757 71.42959 71.07248 71.59452 71.78778 69.42486 69.73428 72.48282
 [9] 69.16415       NA
> rowSums(tmp5)
 [1] 1830.351 1428.592 1421.450 1431.890 1435.756 1388.497 1394.686 1449.656
 [9] 1383.283       NA
> rowVars(tmp5)
 [1] 7787.86784   80.12150   79.33344   63.84355  103.14952   87.57861
 [7]   38.08450   73.79819   59.69953   65.35114
> rowSd(tmp5)
 [1] 88.248897  8.951062  8.906932  7.990216 10.156255  9.358344  6.171264
 [8]  8.590587  7.726547  8.084005
> rowMax(tmp5)
 [1] 464.87454  86.98620  87.95879  88.36749  90.82096  92.59649  81.34034
 [8]  89.83636  83.23877        NA
> rowMin(tmp5)
 [1] 59.02383 54.87424 58.86037 54.04213 53.86056 56.13214 57.26452 55.90518
 [9] 54.93731       NA
> 
> colMeans(tmp5)
 [1] 109.01763  67.09058  70.57750  69.72795  71.89574  72.94072  73.03790
 [8]  69.63582  70.34306  71.13550  74.31648  72.28655  70.41926  72.14446
[15]  74.12815  67.70393  74.87156  67.97462  65.74226        NA
> colSums(tmp5)
 [1] 1090.1763  670.9058  705.7750  697.2795  718.9574  729.4072  730.3790
 [8]  696.3582  703.4306  711.3550  743.1648  722.8655  704.1926  721.4446
[15]  741.2815  677.0393  748.7156  679.7462  657.4226        NA
> colVars(tmp5)
 [1] 15723.45854    64.02311   107.66741   134.69774    24.01738    26.96753
 [7]    87.79156   111.21912    90.72126    30.23981    62.50583    43.84243
[13]    49.31585   109.32247    97.89518    59.31743    83.51889    54.95102
[19]    51.51446          NA
> colSd(tmp5)
 [1] 125.393216   8.001444  10.376291  11.605936   4.900753   5.193027
 [7]   9.369715  10.546048   9.524771   5.499073   7.906063   6.621362
[13]   7.022524  10.455739   9.894199   7.701781   9.138867   7.412896
[19]   7.177357         NA
> colMax(tmp5)
 [1] 464.87454  79.03472  87.95879  89.83636  80.33266  81.29755  85.07278
 [8]  85.19666  92.59649  83.23877  83.24003  80.92623  80.60989  90.73350
[15]  88.36749  83.14058  88.15749  85.37682  78.96279        NA
> colMin(tmp5)
 [1] 57.26452 57.70167 54.93731 53.86056 64.45007 65.15124 55.90518 54.04213
 [9] 54.03180 65.28280 63.28980 62.74779 61.02095 58.25259 59.66916 54.87424
[17] 59.12766 60.68253 57.41988       NA
> 
> Max(tmp5,na.rm=TRUE)
[1] 464.8745
> Min(tmp5,na.rm=TRUE)
[1] 53.86056
> mean(tmp5,na.rm=TRUE)
[1] 72.78972
> Sum(tmp5,na.rm=TRUE)
[1] 14485.15
> Var(tmp5,na.rm=TRUE)
[1] 850.0605
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 91.51757 71.42959 71.07248 71.59452 71.78778 69.42486 69.73428 72.48282
 [9] 69.16415 69.52594
> rowSums(tmp5,na.rm=TRUE)
 [1] 1830.351 1428.592 1421.450 1431.890 1435.756 1388.497 1394.686 1449.656
 [9] 1383.283 1320.993
> rowVars(tmp5,na.rm=TRUE)
 [1] 7787.86784   80.12150   79.33344   63.84355  103.14952   87.57861
 [7]   38.08450   73.79819   59.69953   65.35114
> rowSd(tmp5,na.rm=TRUE)
 [1] 88.248897  8.951062  8.906932  7.990216 10.156255  9.358344  6.171264
 [8]  8.590587  7.726547  8.084005
> rowMax(tmp5,na.rm=TRUE)
 [1] 464.87454  86.98620  87.95879  88.36749  90.82096  92.59649  81.34034
 [8]  89.83636  83.23877  83.05316
> rowMin(tmp5,na.rm=TRUE)
 [1] 59.02383 54.87424 58.86037 54.04213 53.86056 56.13214 57.26452 55.90518
 [9] 54.93731 54.03180
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 109.01763  67.09058  70.57750  69.72795  71.89574  72.94072  73.03790
 [8]  69.63582  70.34306  71.13550  74.31648  72.28655  70.41926  72.14446
[15]  74.12815  67.70393  74.87156  67.97462  65.74226  70.58417
> colSums(tmp5,na.rm=TRUE)
 [1] 1090.1763  670.9058  705.7750  697.2795  718.9574  729.4072  730.3790
 [8]  696.3582  703.4306  711.3550  743.1648  722.8655  704.1926  721.4446
[15]  741.2815  677.0393  748.7156  679.7462  657.4226  635.2575
> colVars(tmp5,na.rm=TRUE)
 [1] 15723.45854    64.02311   107.66741   134.69774    24.01738    26.96753
 [7]    87.79156   111.21912    90.72126    30.23981    62.50583    43.84243
[13]    49.31585   109.32247    97.89518    59.31743    83.51889    54.95102
[19]    51.51446    28.63324
> colSd(tmp5,na.rm=TRUE)
 [1] 125.393216   8.001444  10.376291  11.605936   4.900753   5.193027
 [7]   9.369715  10.546048   9.524771   5.499073   7.906063   6.621362
[13]   7.022524  10.455739   9.894199   7.701781   9.138867   7.412896
[19]   7.177357   5.351004
> colMax(tmp5,na.rm=TRUE)
 [1] 464.87454  79.03472  87.95879  89.83636  80.33266  81.29755  85.07278
 [8]  85.19666  92.59649  83.23877  83.24003  80.92623  80.60989  90.73350
[15]  88.36749  83.14058  88.15749  85.37682  78.96279  77.29470
> colMin(tmp5,na.rm=TRUE)
 [1] 57.26452 57.70167 54.93731 53.86056 64.45007 65.15124 55.90518 54.04213
 [9] 54.03180 65.28280 63.28980 62.74779 61.02095 58.25259 59.66916 54.87424
[17] 59.12766 60.68253 57.41988 61.52291
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1] 91.51757 71.42959 71.07248 71.59452 71.78778 69.42486 69.73428 72.48282
 [9] 69.16415      NaN
> rowSums(tmp5,na.rm=TRUE)
 [1] 1830.351 1428.592 1421.450 1431.890 1435.756 1388.497 1394.686 1449.656
 [9] 1383.283    0.000
> rowVars(tmp5,na.rm=TRUE)
 [1] 7787.86784   80.12150   79.33344   63.84355  103.14952   87.57861
 [7]   38.08450   73.79819   59.69953         NA
> rowSd(tmp5,na.rm=TRUE)
 [1] 88.248897  8.951062  8.906932  7.990216 10.156255  9.358344  6.171264
 [8]  8.590587  7.726547        NA
> rowMax(tmp5,na.rm=TRUE)
 [1] 464.87454  86.98620  87.95879  88.36749  90.82096  92.59649  81.34034
 [8]  89.83636  83.23877        NA
> rowMin(tmp5,na.rm=TRUE)
 [1] 59.02383 54.87424 58.86037 54.04213 53.86056 56.13214 57.26452 55.90518
 [9] 54.93731       NA
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1] 114.20879  67.56157  70.51446  71.17862  72.30489  72.18348  72.88042
 [8]  70.30111  72.15542  70.60556  75.54166  71.63319  70.18514  71.32450
[15]  75.27284  67.72440  73.96249  67.78019  64.78169       NaN
> colSums(tmp5,na.rm=TRUE)
 [1] 1027.8791  608.0541  634.6302  640.6076  650.7440  649.6513  655.9238
 [8]  632.7100  649.3988  635.4500  679.8750  644.6987  631.6663  641.9205
[15]  677.4555  609.5196  665.6624  610.0217  583.0352    0.0000
> colVars(tmp5,na.rm=TRUE)
 [1] 17385.72353    69.53041   121.08114   127.86007    25.13631    23.88758
 [7]    98.48651   120.14219    65.10907    30.86032    53.43189    44.52033
[13]    54.86368   115.42399    95.39108    66.72740    84.66171    61.39461
[19]    47.57350          NA
> colSd(tmp5,na.rm=TRUE)
 [1] 131.854934   8.338490  11.003687  11.307523   5.013613   4.887492
 [7]   9.924037  10.960939   8.069019   5.555207   7.309712   6.672356
[13]   7.407002  10.743556   9.766836   8.168684   9.201180   7.835471
[19]   6.897355         NA
> colMax(tmp5,na.rm=TRUE)
 [1] 464.87454  79.03472  87.95879  89.83636  80.33266  81.29755  85.07278
 [8]  85.19666  92.59649  83.23877  83.24003  80.92623  80.60989  90.73350
[15]  88.36749  83.14058  88.15749  85.37682  78.96279      -Inf
> colMin(tmp5,na.rm=TRUE)
 [1] 57.26452 57.70167 54.93731 53.86056 64.45007 65.15124 55.90518 54.04213
 [9] 66.35044 65.28280 63.54427 62.74779 61.02095 58.25259 59.66916 54.87424
[17] 59.12766 60.68253 57.41988      Inf
> 
> 
> 
> 
> copymatrix <- matrix(rnorm(200,150,15),10,20)
> 
> tmp5[1:10,1:20] <- copymatrix
> which.row <- 3
> which.col  <- 1
> cat(which.row," ",which.col,"\n")
3   1 
> tmp5[which.row,which.col] <- NA
> copymatrix[which.row,which.col] <- NA
> 
> rowVars(tmp5,na.rm=TRUE)
 [1] 152.20103 176.84434 269.26365 265.80615 275.16985 257.38463 186.45712
 [8]  74.63989 220.62774 174.79045
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 152.20103 176.84434 269.26365 265.80615 275.16985 257.38463 186.45712
 [8]  74.63989 220.62774 174.79045
> 
> 
> 
> 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] -4.263256e-14 -5.684342e-14 -4.263256e-14 -8.526513e-14 -2.842171e-14
 [6] -1.989520e-13 -1.421085e-13  1.421085e-13  0.000000e+00 -2.273737e-13
[11]  1.136868e-13 -1.421085e-14  0.000000e+00 -8.526513e-14  2.273737e-13
[16]  5.684342e-14  1.136868e-13 -2.842171e-14  1.563194e-13  1.136868e-13
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> ## 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)
+ }
3   14 
2   19 
9   20 
6   14 
9   18 
9   2 
4   6 
4   20 
6   4 
8   16 
6   14 
7   18 
8   16 
7   20 
2   3 
1   18 
2   10 
9   10 
5   8 
2   5 
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.072164
> Min(tmp)
[1] -2.397648
> mean(tmp)
[1] 0.150836
> Sum(tmp)
[1] 15.0836
> Var(tmp)
[1] 0.868942
> 
> rowMeans(tmp)
[1] 0.150836
> rowSums(tmp)
[1] 15.0836
> rowVars(tmp)
[1] 0.868942
> rowSd(tmp)
[1] 0.9321706
> rowMax(tmp)
[1] 2.072164
> rowMin(tmp)
[1] -2.397648
> 
> colMeans(tmp)
  [1] -2.397648095  1.667341765  0.919177934  1.386824364  0.847463311
  [6]  1.092574696 -0.683194135  0.560051961 -1.278053044 -0.531117410
 [11]  0.940218177 -0.716760251  1.291290937  0.998442179 -0.096064794
 [16]  0.437007911 -0.359192472 -1.501155996 -0.851716678  0.464049607
 [21]  1.814686102  0.060698416 -0.387446554 -1.127750929 -0.114869126
 [26]  2.045041807  0.575015884  0.561149275  1.181692377 -1.170879275
 [31] -0.785022997 -1.162356592  0.190141387 -0.098687549 -0.659861835
 [36]  0.106185127  1.425359438 -1.529320385 -1.319513095 -0.368028999
 [41]  0.132850111  0.357339248 -0.130437013  0.935965240  1.790752092
 [46]  1.443206253 -1.784871618  0.466796853  1.301505866  1.153180826
 [51] -0.361633726  1.385226198  0.977582608 -0.259606575  0.200780867
 [56]  1.314933816  0.790428423 -1.251780881 -0.700915934  0.007087368
 [61] -0.999889085 -0.307196464  1.133935790  0.087114379 -0.439678224
 [66] -0.813948193 -0.341621458  0.387053430  0.041071860  0.383222098
 [71]  0.967882192  0.756027137  0.169902085 -0.625734056 -0.666581770
 [76]  0.899755604  0.826152820 -0.953311172  0.936131515 -0.834554106
 [81] -1.191786743  0.392619400 -0.188503164  0.929541285 -0.008723475
 [86] -0.761956622 -0.295664080 -0.718874426 -0.026373827  1.158194494
 [91]  0.368994425  0.378359813  1.142201524  1.110545376 -0.228579536
 [96]  0.400051579  0.955517171 -0.442671449  0.238642853  2.072164079
> colSums(tmp)
  [1] -2.397648095  1.667341765  0.919177934  1.386824364  0.847463311
  [6]  1.092574696 -0.683194135  0.560051961 -1.278053044 -0.531117410
 [11]  0.940218177 -0.716760251  1.291290937  0.998442179 -0.096064794
 [16]  0.437007911 -0.359192472 -1.501155996 -0.851716678  0.464049607
 [21]  1.814686102  0.060698416 -0.387446554 -1.127750929 -0.114869126
 [26]  2.045041807  0.575015884  0.561149275  1.181692377 -1.170879275
 [31] -0.785022997 -1.162356592  0.190141387 -0.098687549 -0.659861835
 [36]  0.106185127  1.425359438 -1.529320385 -1.319513095 -0.368028999
 [41]  0.132850111  0.357339248 -0.130437013  0.935965240  1.790752092
 [46]  1.443206253 -1.784871618  0.466796853  1.301505866  1.153180826
 [51] -0.361633726  1.385226198  0.977582608 -0.259606575  0.200780867
 [56]  1.314933816  0.790428423 -1.251780881 -0.700915934  0.007087368
 [61] -0.999889085 -0.307196464  1.133935790  0.087114379 -0.439678224
 [66] -0.813948193 -0.341621458  0.387053430  0.041071860  0.383222098
 [71]  0.967882192  0.756027137  0.169902085 -0.625734056 -0.666581770
 [76]  0.899755604  0.826152820 -0.953311172  0.936131515 -0.834554106
 [81] -1.191786743  0.392619400 -0.188503164  0.929541285 -0.008723475
 [86] -0.761956622 -0.295664080 -0.718874426 -0.026373827  1.158194494
 [91]  0.368994425  0.378359813  1.142201524  1.110545376 -0.228579536
 [96]  0.400051579  0.955517171 -0.442671449  0.238642853  2.072164079
> 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] -2.397648095  1.667341765  0.919177934  1.386824364  0.847463311
  [6]  1.092574696 -0.683194135  0.560051961 -1.278053044 -0.531117410
 [11]  0.940218177 -0.716760251  1.291290937  0.998442179 -0.096064794
 [16]  0.437007911 -0.359192472 -1.501155996 -0.851716678  0.464049607
 [21]  1.814686102  0.060698416 -0.387446554 -1.127750929 -0.114869126
 [26]  2.045041807  0.575015884  0.561149275  1.181692377 -1.170879275
 [31] -0.785022997 -1.162356592  0.190141387 -0.098687549 -0.659861835
 [36]  0.106185127  1.425359438 -1.529320385 -1.319513095 -0.368028999
 [41]  0.132850111  0.357339248 -0.130437013  0.935965240  1.790752092
 [46]  1.443206253 -1.784871618  0.466796853  1.301505866  1.153180826
 [51] -0.361633726  1.385226198  0.977582608 -0.259606575  0.200780867
 [56]  1.314933816  0.790428423 -1.251780881 -0.700915934  0.007087368
 [61] -0.999889085 -0.307196464  1.133935790  0.087114379 -0.439678224
 [66] -0.813948193 -0.341621458  0.387053430  0.041071860  0.383222098
 [71]  0.967882192  0.756027137  0.169902085 -0.625734056 -0.666581770
 [76]  0.899755604  0.826152820 -0.953311172  0.936131515 -0.834554106
 [81] -1.191786743  0.392619400 -0.188503164  0.929541285 -0.008723475
 [86] -0.761956622 -0.295664080 -0.718874426 -0.026373827  1.158194494
 [91]  0.368994425  0.378359813  1.142201524  1.110545376 -0.228579536
 [96]  0.400051579  0.955517171 -0.442671449  0.238642853  2.072164079
> colMin(tmp)
  [1] -2.397648095  1.667341765  0.919177934  1.386824364  0.847463311
  [6]  1.092574696 -0.683194135  0.560051961 -1.278053044 -0.531117410
 [11]  0.940218177 -0.716760251  1.291290937  0.998442179 -0.096064794
 [16]  0.437007911 -0.359192472 -1.501155996 -0.851716678  0.464049607
 [21]  1.814686102  0.060698416 -0.387446554 -1.127750929 -0.114869126
 [26]  2.045041807  0.575015884  0.561149275  1.181692377 -1.170879275
 [31] -0.785022997 -1.162356592  0.190141387 -0.098687549 -0.659861835
 [36]  0.106185127  1.425359438 -1.529320385 -1.319513095 -0.368028999
 [41]  0.132850111  0.357339248 -0.130437013  0.935965240  1.790752092
 [46]  1.443206253 -1.784871618  0.466796853  1.301505866  1.153180826
 [51] -0.361633726  1.385226198  0.977582608 -0.259606575  0.200780867
 [56]  1.314933816  0.790428423 -1.251780881 -0.700915934  0.007087368
 [61] -0.999889085 -0.307196464  1.133935790  0.087114379 -0.439678224
 [66] -0.813948193 -0.341621458  0.387053430  0.041071860  0.383222098
 [71]  0.967882192  0.756027137  0.169902085 -0.625734056 -0.666581770
 [76]  0.899755604  0.826152820 -0.953311172  0.936131515 -0.834554106
 [81] -1.191786743  0.392619400 -0.188503164  0.929541285 -0.008723475
 [86] -0.761956622 -0.295664080 -0.718874426 -0.026373827  1.158194494
 [91]  0.368994425  0.378359813  1.142201524  1.110545376 -0.228579536
 [96]  0.400051579  0.955517171 -0.442671449  0.238642853  2.072164079
> colMedians(tmp)
  [1] -2.397648095  1.667341765  0.919177934  1.386824364  0.847463311
  [6]  1.092574696 -0.683194135  0.560051961 -1.278053044 -0.531117410
 [11]  0.940218177 -0.716760251  1.291290937  0.998442179 -0.096064794
 [16]  0.437007911 -0.359192472 -1.501155996 -0.851716678  0.464049607
 [21]  1.814686102  0.060698416 -0.387446554 -1.127750929 -0.114869126
 [26]  2.045041807  0.575015884  0.561149275  1.181692377 -1.170879275
 [31] -0.785022997 -1.162356592  0.190141387 -0.098687549 -0.659861835
 [36]  0.106185127  1.425359438 -1.529320385 -1.319513095 -0.368028999
 [41]  0.132850111  0.357339248 -0.130437013  0.935965240  1.790752092
 [46]  1.443206253 -1.784871618  0.466796853  1.301505866  1.153180826
 [51] -0.361633726  1.385226198  0.977582608 -0.259606575  0.200780867
 [56]  1.314933816  0.790428423 -1.251780881 -0.700915934  0.007087368
 [61] -0.999889085 -0.307196464  1.133935790  0.087114379 -0.439678224
 [66] -0.813948193 -0.341621458  0.387053430  0.041071860  0.383222098
 [71]  0.967882192  0.756027137  0.169902085 -0.625734056 -0.666581770
 [76]  0.899755604  0.826152820 -0.953311172  0.936131515 -0.834554106
 [81] -1.191786743  0.392619400 -0.188503164  0.929541285 -0.008723475
 [86] -0.761956622 -0.295664080 -0.718874426 -0.026373827  1.158194494
 [91]  0.368994425  0.378359813  1.142201524  1.110545376 -0.228579536
 [96]  0.400051579  0.955517171 -0.442671449  0.238642853  2.072164079
> colRanges(tmp)
          [,1]     [,2]      [,3]     [,4]      [,5]     [,6]       [,7]
[1,] -2.397648 1.667342 0.9191779 1.386824 0.8474633 1.092575 -0.6831941
[2,] -2.397648 1.667342 0.9191779 1.386824 0.8474633 1.092575 -0.6831941
         [,8]      [,9]      [,10]     [,11]      [,12]    [,13]     [,14]
[1,] 0.560052 -1.278053 -0.5311174 0.9402182 -0.7167603 1.291291 0.9984422
[2,] 0.560052 -1.278053 -0.5311174 0.9402182 -0.7167603 1.291291 0.9984422
           [,15]     [,16]      [,17]     [,18]      [,19]     [,20]    [,21]
[1,] -0.09606479 0.4370079 -0.3591925 -1.501156 -0.8517167 0.4640496 1.814686
[2,] -0.09606479 0.4370079 -0.3591925 -1.501156 -0.8517167 0.4640496 1.814686
          [,22]      [,23]     [,24]      [,25]    [,26]     [,27]     [,28]
[1,] 0.06069842 -0.3874466 -1.127751 -0.1148691 2.045042 0.5750159 0.5611493
[2,] 0.06069842 -0.3874466 -1.127751 -0.1148691 2.045042 0.5750159 0.5611493
        [,29]     [,30]     [,31]     [,32]     [,33]       [,34]      [,35]
[1,] 1.181692 -1.170879 -0.785023 -1.162357 0.1901414 -0.09868755 -0.6598618
[2,] 1.181692 -1.170879 -0.785023 -1.162357 0.1901414 -0.09868755 -0.6598618
         [,36]    [,37]    [,38]     [,39]     [,40]     [,41]     [,42]
[1,] 0.1061851 1.425359 -1.52932 -1.319513 -0.368029 0.1328501 0.3573392
[2,] 0.1061851 1.425359 -1.52932 -1.319513 -0.368029 0.1328501 0.3573392
         [,43]     [,44]    [,45]    [,46]     [,47]     [,48]    [,49]
[1,] -0.130437 0.9359652 1.790752 1.443206 -1.784872 0.4667969 1.301506
[2,] -0.130437 0.9359652 1.790752 1.443206 -1.784872 0.4667969 1.301506
        [,50]      [,51]    [,52]     [,53]      [,54]     [,55]    [,56]
[1,] 1.153181 -0.3616337 1.385226 0.9775826 -0.2596066 0.2007809 1.314934
[2,] 1.153181 -0.3616337 1.385226 0.9775826 -0.2596066 0.2007809 1.314934
         [,57]     [,58]      [,59]       [,60]      [,61]      [,62]    [,63]
[1,] 0.7904284 -1.251781 -0.7009159 0.007087368 -0.9998891 -0.3071965 1.133936
[2,] 0.7904284 -1.251781 -0.7009159 0.007087368 -0.9998891 -0.3071965 1.133936
          [,64]      [,65]      [,66]      [,67]     [,68]      [,69]     [,70]
[1,] 0.08711438 -0.4396782 -0.8139482 -0.3416215 0.3870534 0.04107186 0.3832221
[2,] 0.08711438 -0.4396782 -0.8139482 -0.3416215 0.3870534 0.04107186 0.3832221
         [,71]     [,72]     [,73]      [,74]      [,75]     [,76]     [,77]
[1,] 0.9678822 0.7560271 0.1699021 -0.6257341 -0.6665818 0.8997556 0.8261528
[2,] 0.9678822 0.7560271 0.1699021 -0.6257341 -0.6665818 0.8997556 0.8261528
          [,78]     [,79]      [,80]     [,81]     [,82]      [,83]     [,84]
[1,] -0.9533112 0.9361315 -0.8345541 -1.191787 0.3926194 -0.1885032 0.9295413
[2,] -0.9533112 0.9361315 -0.8345541 -1.191787 0.3926194 -0.1885032 0.9295413
            [,85]      [,86]      [,87]      [,88]       [,89]    [,90]
[1,] -0.008723475 -0.7619566 -0.2956641 -0.7188744 -0.02637383 1.158194
[2,] -0.008723475 -0.7619566 -0.2956641 -0.7188744 -0.02637383 1.158194
         [,91]     [,92]    [,93]    [,94]      [,95]     [,96]     [,97]
[1,] 0.3689944 0.3783598 1.142202 1.110545 -0.2285795 0.4000516 0.9555172
[2,] 0.3689944 0.3783598 1.142202 1.110545 -0.2285795 0.4000516 0.9555172
          [,98]     [,99]   [,100]
[1,] -0.4426714 0.2386429 2.072164
[2,] -0.4426714 0.2386429 2.072164
> 
> 
> Max(tmp2)
[1] 2.608338
> Min(tmp2)
[1] -2.465185
> mean(tmp2)
[1] 0.004122611
> Sum(tmp2)
[1] 0.4122611
> Var(tmp2)
[1] 1.180803
> 
> rowMeans(tmp2)
  [1]  0.21998249  0.73742004 -0.90742095  2.60833762 -0.74059985 -0.83239462
  [7] -0.13791163 -0.63607696  0.46563382 -0.61065697 -1.51036232  1.28522853
 [13] -0.47117715  0.25481597 -0.38762867  1.21604159  2.17525186  1.00438766
 [19] -0.61234475  0.07149378 -0.05216658  1.52123125  0.40295113  0.74115126
 [25] -0.14229666  1.72928337 -0.64293297  1.51906472 -0.29575966  0.02243001
 [31] -2.05478938  0.39728109 -0.69209783  0.13601705 -1.11290075 -1.54252633
 [37]  1.76818883  0.87590389  2.59264955 -0.80484976 -1.25538797  0.56261529
 [43]  0.85108131 -0.33628377 -0.14836520  0.29893787 -2.37490692  0.07908658
 [49] -0.22888412 -1.00305607 -0.29459665 -0.42744585  1.31081425  0.33005578
 [55] -1.80441559 -0.49569876  1.43259291 -0.42256020  0.44428157 -0.41695405
 [61] -0.01450602 -0.60922747 -0.58017634  0.73176874  0.80113079 -2.26067385
 [67]  0.58050613 -0.46621033  0.59443970  0.23873940 -0.03396839 -0.10137285
 [73] -0.67339194  1.01355233  1.07063270 -0.40691153  0.05253176 -1.52817663
 [79]  0.12753932  0.55998102  1.73961303 -1.67623310  1.17720205 -2.46518501
 [85] -0.73842471 -1.18529693  1.55085281  0.53648328  1.12235808  2.36581103
 [91]  0.65086205 -1.10056746 -0.72499551 -0.53903428 -0.21156294 -1.53673679
 [97] -1.77566596 -0.77911277  1.11241364  0.13451194
> rowSums(tmp2)
  [1]  0.21998249  0.73742004 -0.90742095  2.60833762 -0.74059985 -0.83239462
  [7] -0.13791163 -0.63607696  0.46563382 -0.61065697 -1.51036232  1.28522853
 [13] -0.47117715  0.25481597 -0.38762867  1.21604159  2.17525186  1.00438766
 [19] -0.61234475  0.07149378 -0.05216658  1.52123125  0.40295113  0.74115126
 [25] -0.14229666  1.72928337 -0.64293297  1.51906472 -0.29575966  0.02243001
 [31] -2.05478938  0.39728109 -0.69209783  0.13601705 -1.11290075 -1.54252633
 [37]  1.76818883  0.87590389  2.59264955 -0.80484976 -1.25538797  0.56261529
 [43]  0.85108131 -0.33628377 -0.14836520  0.29893787 -2.37490692  0.07908658
 [49] -0.22888412 -1.00305607 -0.29459665 -0.42744585  1.31081425  0.33005578
 [55] -1.80441559 -0.49569876  1.43259291 -0.42256020  0.44428157 -0.41695405
 [61] -0.01450602 -0.60922747 -0.58017634  0.73176874  0.80113079 -2.26067385
 [67]  0.58050613 -0.46621033  0.59443970  0.23873940 -0.03396839 -0.10137285
 [73] -0.67339194  1.01355233  1.07063270 -0.40691153  0.05253176 -1.52817663
 [79]  0.12753932  0.55998102  1.73961303 -1.67623310  1.17720205 -2.46518501
 [85] -0.73842471 -1.18529693  1.55085281  0.53648328  1.12235808  2.36581103
 [91]  0.65086205 -1.10056746 -0.72499551 -0.53903428 -0.21156294 -1.53673679
 [97] -1.77566596 -0.77911277  1.11241364  0.13451194
> 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.21998249  0.73742004 -0.90742095  2.60833762 -0.74059985 -0.83239462
  [7] -0.13791163 -0.63607696  0.46563382 -0.61065697 -1.51036232  1.28522853
 [13] -0.47117715  0.25481597 -0.38762867  1.21604159  2.17525186  1.00438766
 [19] -0.61234475  0.07149378 -0.05216658  1.52123125  0.40295113  0.74115126
 [25] -0.14229666  1.72928337 -0.64293297  1.51906472 -0.29575966  0.02243001
 [31] -2.05478938  0.39728109 -0.69209783  0.13601705 -1.11290075 -1.54252633
 [37]  1.76818883  0.87590389  2.59264955 -0.80484976 -1.25538797  0.56261529
 [43]  0.85108131 -0.33628377 -0.14836520  0.29893787 -2.37490692  0.07908658
 [49] -0.22888412 -1.00305607 -0.29459665 -0.42744585  1.31081425  0.33005578
 [55] -1.80441559 -0.49569876  1.43259291 -0.42256020  0.44428157 -0.41695405
 [61] -0.01450602 -0.60922747 -0.58017634  0.73176874  0.80113079 -2.26067385
 [67]  0.58050613 -0.46621033  0.59443970  0.23873940 -0.03396839 -0.10137285
 [73] -0.67339194  1.01355233  1.07063270 -0.40691153  0.05253176 -1.52817663
 [79]  0.12753932  0.55998102  1.73961303 -1.67623310  1.17720205 -2.46518501
 [85] -0.73842471 -1.18529693  1.55085281  0.53648328  1.12235808  2.36581103
 [91]  0.65086205 -1.10056746 -0.72499551 -0.53903428 -0.21156294 -1.53673679
 [97] -1.77566596 -0.77911277  1.11241364  0.13451194
> rowMin(tmp2)
  [1]  0.21998249  0.73742004 -0.90742095  2.60833762 -0.74059985 -0.83239462
  [7] -0.13791163 -0.63607696  0.46563382 -0.61065697 -1.51036232  1.28522853
 [13] -0.47117715  0.25481597 -0.38762867  1.21604159  2.17525186  1.00438766
 [19] -0.61234475  0.07149378 -0.05216658  1.52123125  0.40295113  0.74115126
 [25] -0.14229666  1.72928337 -0.64293297  1.51906472 -0.29575966  0.02243001
 [31] -2.05478938  0.39728109 -0.69209783  0.13601705 -1.11290075 -1.54252633
 [37]  1.76818883  0.87590389  2.59264955 -0.80484976 -1.25538797  0.56261529
 [43]  0.85108131 -0.33628377 -0.14836520  0.29893787 -2.37490692  0.07908658
 [49] -0.22888412 -1.00305607 -0.29459665 -0.42744585  1.31081425  0.33005578
 [55] -1.80441559 -0.49569876  1.43259291 -0.42256020  0.44428157 -0.41695405
 [61] -0.01450602 -0.60922747 -0.58017634  0.73176874  0.80113079 -2.26067385
 [67]  0.58050613 -0.46621033  0.59443970  0.23873940 -0.03396839 -0.10137285
 [73] -0.67339194  1.01355233  1.07063270 -0.40691153  0.05253176 -1.52817663
 [79]  0.12753932  0.55998102  1.73961303 -1.67623310  1.17720205 -2.46518501
 [85] -0.73842471 -1.18529693  1.55085281  0.53648328  1.12235808  2.36581103
 [91]  0.65086205 -1.10056746 -0.72499551 -0.53903428 -0.21156294 -1.53673679
 [97] -1.77566596 -0.77911277  1.11241364  0.13451194
> 
> colMeans(tmp2)
[1] 0.004122611
> colSums(tmp2)
[1] 0.4122611
> colVars(tmp2)
[1] 1.180803
> colSd(tmp2)
[1] 1.086647
> colMax(tmp2)
[1] 2.608338
> colMin(tmp2)
[1] -2.465185
> colMedians(tmp2)
[1] -0.04306748
> colRanges(tmp2)
          [,1]
[1,] -2.465185
[2,]  2.608338
> 
> 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.3213227  0.3868357  1.2779092  0.8664308 -3.3491304 -0.6578284
 [7] -2.4818866 -2.5994655  0.2522165 -3.8362416
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -1.0752336
[2,] -0.7634528
[3,]  0.2252054
[4,]  0.5855312
[5,]  1.2128886
> 
> rowApply(tmp,sum)
 [1]  0.7812284  1.0021252 -0.5546874 -3.5861084 -4.9057705  0.2537449
 [7]  1.7355900 -0.1243307  0.1083398 -4.5299689
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    9    2    4   10    4    5    7    7    9     2
 [2,]   10    1    7    6    7    7   10    3    1     8
 [3,]    6   10    9    7    9    9    2    5    3     1
 [4,]    7    4   10    2    6    1    9    4   10     4
 [5,]    5    8    1    3    3    3    8   10    2     9
 [6,]    8    3    8    9    1    8    4    8    6     5
 [7,]    3    9    5    8    8    6    1    1    4     7
 [8,]    2    7    2    4    5    2    3    9    5    10
 [9,]    1    5    6    5   10   10    6    2    8     3
[10,]    4    6    3    1    2    4    5    6    7     6
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1] -1.72992272 -2.95117329 -1.53685438 -0.75857989 -2.38457471  1.70700587
 [7]  1.01060810  3.54067538  0.95484516 -2.50317100  2.86906203  1.52985403
[13]  0.53840006  0.90882081  0.68852068 -4.11749061 -0.75856089 -1.28436951
[19] -0.01906418  1.08418595
> colApply(tmp,quantile)[,1]
            [,1]
[1,] -2.79377073
[2,] -0.26091504
[3,] -0.16623963
[4,]  0.06214817
[5,]  1.42885451
> 
> rowApply(tmp,sum)
[1]  3.8003969 -2.0741190  1.0633324 -0.6545485 -5.3468448
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]    1   10    8   12   20
[2,]    3    5   13   13    2
[3,]   14    1   14    3   17
[4,]    4   17    4    7   18
[5,]   10   11    2   11    3
> 
> 
> as.matrix(tmp)
            [,1]        [,2]       [,3]       [,4]       [,5]        [,6]
[1,] -2.79377073 -0.94241593  0.8050599 -0.7922172  0.4802823  0.98873849
[2,]  0.06214817 -0.95800352 -2.4193396  0.7381760  0.1585118  0.56811215
[3,] -0.26091504  0.39646024  0.4987462 -0.7472448 -1.5798364 -0.08219328
[4,] -0.16623963 -0.02889367 -0.8878373 -0.4701676 -0.1835971  0.53543366
[5,]  1.42885451 -1.41832041  0.4665165  0.5128736 -1.2599354 -0.30308514
           [,7]       [,8]       [,9]      [,10]      [,11]       [,12]
[1,]  0.2859889  0.9261259  0.5465613 -0.3792666  1.8821712  0.02366394
[2,] -1.3535273  2.4985667  0.4199767  1.0014964  0.9322958  0.30024047
[3,]  2.1192703  0.5236784  0.3437353 -0.3300575 -1.6398198 -0.32641195
[4,]  1.0547167 -0.2696426 -1.5581736 -1.8093940  2.0271430  1.58413553
[5,] -1.0958406 -0.1380531  1.2027454 -0.9859493 -0.3327282 -0.05177395
           [,13]      [,14]       [,15]      [,16]      [,17]       [,18]
[1,]  0.54820294 -1.2475376  0.98687126  0.3167873  0.5636931  0.97329470
[2,] -0.01186428  0.2260890 -0.03276263 -0.9326379 -0.2983235 -1.51281764
[3,]  0.68726074  0.5961344  0.50314328 -0.9564224 -0.3922052 -0.24628267
[4,]  0.13430028  1.6047017 -0.38953737 -0.8163931 -0.2057923 -0.52248377
[5,] -0.81949962 -0.2705667 -0.37919385 -1.7288246 -0.4259331  0.02391987
           [,19]      [,20]
[1,] -0.75212219  1.3802858
[2,]  0.28465333 -1.7451094
[3,] -0.17105414  2.1273465
[4,]  0.56346158 -0.8502889
[5,]  0.05599723  0.1719520
> 
> 
> 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 :  644  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 :  556  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.7823243 -0.5999689 -0.522424 0.7687585 0.4699105 -1.440675 -0.4053736
          col8      col9    col10      col11      col12    col13     col14
row1 0.1452641 0.1694871 -1.32907 -0.5293588 -0.5442725 1.554908 -1.415303
          col15    col16      col17      col18     col19      col20
row1 -0.6970573 2.912119 -0.2264634 -0.4972127 -1.625768 0.08928376
> tmp[,"col10"]
          col10
row1 -1.3290699
row2  0.6972587
row3 -1.8526737
row4 -0.3849293
row5  0.6076621
> tmp[c("row1","row5"),]
          col1       col2       col3      col4      col5       col6       col7
row1 0.7823243 -0.5999689 -0.5224240 0.7687585 0.4699105 -1.4406751 -0.4053736
row5 0.9011763 -1.7985688 -0.5584761 1.5216376 0.5073319  0.1754081  0.5576708
           col8      col9      col10      col11      col12     col13      col14
row1  0.1452641 0.1694871 -1.3290699 -0.5293588 -0.5442725  1.554908 -1.4153034
row5 -0.2192473 1.9651388  0.6076621  0.4010803 -0.4350116 -1.717312 -0.4796524
           col15     col16      col17      col18     col19      col20
row1 -0.69705733  2.912119 -0.2264634 -0.4972127 -1.625768 0.08928376
row5 -0.07514172 -0.387249 -0.4856856 -0.4733769  1.376502 0.11060705
> tmp[,c("col6","col20")]
           col6       col20
row1 -1.4406751  0.08928376
row2 -1.3884844 -1.20896513
row3 -0.9301901  0.90634764
row4 -1.9408121  0.19280479
row5  0.1754081  0.11060705
> tmp[c("row1","row5"),c("col6","col20")]
           col6      col20
row1 -1.4406751 0.08928376
row5  0.1754081 0.11060705
> 
> 
> 
> 
> tmp["row1",] <- rnorm(20,mean=10)
> tmp[,"col10"] <- rnorm(5,mean=30)
> tmp[c("row1","row5"),] <- rnorm(40,mean=50)
> tmp[,c("col6","col20")] <- rnorm(10,mean=75)
> tmp[c("row1","row5"),c("col6","col20")]  <- rnorm(4,mean=105)
> 
> tmp["row1",]
         col1     col2     col3     col4    col5     col6     col7     col8
row1 49.65674 48.61304 48.59018 49.57976 49.4571 104.2064 50.27784 48.70859
        col9    col10    col11   col12    col13   col14    col15    col16
row1 51.2052 49.18804 50.89138 51.4345 50.21268 49.4424 50.70548 50.94123
        col17    col18    col19    col20
row1 49.77514 50.27813 50.70121 103.8974
> tmp[,"col10"]
        col10
row1 49.18804
row2 29.32622
row3 29.37179
row4 29.79223
row5 50.61927
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 49.65674 48.61304 48.59018 49.57976 49.45710 104.2064 50.27784 48.70859
row5 48.63241 48.94811 49.13537 47.87382 48.93924 105.3279 48.65172 51.91891
         col9    col10    col11    col12    col13    col14    col15    col16
row1 51.20520 49.18804 50.89138 51.43450 50.21268 49.44240 50.70548 50.94123
row5 48.92886 50.61927 50.62374 50.70908 49.23275 49.12193 49.03211 49.97642
        col17    col18    col19    col20
row1 49.77514 50.27813 50.70121 103.8974
row5 50.16798 49.98131 51.17318 105.0372
> tmp[,c("col6","col20")]
          col6     col20
row1 104.20639 103.89740
row2  74.28152  74.39357
row3  73.09265  75.18690
row4  75.22998  76.02326
row5 105.32787 105.03719
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 104.2064 103.8974
row5 105.3279 105.0372
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 104.2064 103.8974
row5 105.3279 105.0372
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
          col13
[1,]  0.1665763
[2,] -0.2620268
[3,] -0.3205177
[4,] -2.4732230
[5,]  0.2409634
> tmp[,c("col17","col7")]
          col17       col7
[1,] -0.8298125  1.1836093
[2,] -1.3233083 -3.0594937
[3,] -0.3081236 -0.9262406
[4,] -1.6991001 -0.7673751
[5,] -0.6474762 -0.4817350
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
           col6       col20
[1,] -0.8699828 -0.17752681
[2,] -1.1565655 -0.03045373
[3,]  1.6586485 -0.47386109
[4,] -0.5032076  1.71294734
[5,]  0.1198893  0.57560378
> subBufferedMatrix(tmp,1,c("col6"))[,1]
           col1
[1,] -0.8699828
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
           col6
[1,] -0.8699828
[2,] -1.1565655
> 
> 
> 
> 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.9712189 -0.6604757 1.3531361 -0.6821176 -0.5619025 -0.1451744 -0.5456581
row1 0.8946576  0.2554685 0.9881539  1.0994075  2.0488159  0.7811587 -0.1867541
           [,8]       [,9]       [,10]       [,11]      [,12]     [,13]
row3  0.1001231  0.2729343 -0.36453084 -0.59190579  0.9630447 -2.023717
row1 -0.9373749 -0.5274288 -0.09303204 -0.07164223 -0.4059884 -1.345186
         [,14]      [,15]      [,16]      [,17]       [,18]      [,19]
row3 0.1723529 -0.3194013  0.3000650 -0.3182349  0.09733915 -0.1298455
row1 1.1832933  0.3662213 -0.1500942 -1.1324365 -1.94466051 -1.6808607
         [,20]
row3 1.1064527
row1 0.7377241
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
         [,1]       [,2]      [,3]    [,4]       [,5]      [,6]        [,7]
row2 1.647457 -0.8734328 0.2654784 0.43817 0.05170153 -1.215628 -0.09366088
         [,8]     [,9]     [,10]
row2 1.476911 1.729918 0.1738449
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
           [,1]     [,2]     [,3]    [,4]     [,5]     [,6]       [,7]
row5 -0.3886869 1.831039 1.068947 2.61893 -1.39765 1.491705 -0.5151875
           [,8]      [,9]      [,10]      [,11]     [,12]    [,13]     [,14]
row5 0.03351159 0.4646096 -0.6929198 -0.7187361 -1.723729 2.029429 -1.288786
          [,15]    [,16]      [,17]      [,18]     [,19]     [,20]
row5 -0.3548996 1.624585 -0.1469508 -0.5369261 0.4368507 0.2480388
> 
> 
> 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: 0x600000a64120>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMc0225779770"
 [2] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMc024e774d47"
 [3] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMc027a72988f"
 [4] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMc02797e1316"
 [5] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMc02441747aa"
 [6] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMc0254620cd2"
 [7] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMc027137da45"
 [8] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMc029db2215" 
 [9] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMc02119a95c1"
[10] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMc023bddbaee"
[11] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMc025a1b7df6"
[12] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMc0242eacfb1"
[13] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMc0245e98fc9"
[14] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMc0268def8fa"
[15] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMc026ac1ae0" 
> 
> 
> ### 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: 0x600000a00000>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x600000a00000>
Warning message:
In dir.create(new.directory) :
  '/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x600000a00000>
> rowMedians(tmp)
  [1] -0.359840297  0.215111651 -0.068410664  0.396318865 -0.151622502
  [6]  0.485952601  0.728178504 -0.198103483  0.370325292  0.363355792
 [11]  0.338209396  0.333500742 -0.451028524 -0.055450838 -0.470374452
 [16] -0.213848784 -0.020132775 -0.341352595  0.322226857 -0.284369627
 [21] -0.145301790  0.216662772  0.129510921  0.392465530 -0.024268810
 [26] -0.359091234 -0.533292141 -0.455309763  0.201321523  0.030834977
 [31]  0.586529869  0.168179741 -0.831836375 -0.155695126 -0.490153199
 [36] -0.172846032 -0.110662914 -0.040047564  0.271526244  0.038721041
 [41] -0.307440071 -0.329212739 -0.331800959 -0.122169223  0.202986861
 [46]  0.515464663 -0.243562467  0.171751206  0.124583269  0.289347905
 [51]  0.101098952  0.191561677 -0.389118888  0.053449984  0.109555839
 [56]  0.081917795 -0.532817243 -0.201005782  0.294573804  0.253326465
 [61] -0.060991043 -0.135139190 -0.057779249  0.107860557  0.069536465
 [66]  0.534589727  0.026110609  0.141792266  0.255072408 -0.016028205
 [71] -0.320516026 -0.100364026  0.048878563  0.117717197 -0.043534343
 [76] -0.252671248 -0.168900324 -0.189202197 -0.177906475 -0.273341309
 [81] -0.578080673  0.518064482 -0.323860673 -0.217399401  0.017829967
 [86] -0.181846516 -0.112102887  0.006410850 -0.437652560 -0.554217563
 [91]  0.189436900  0.173356443  0.359963905 -0.574452156 -0.150050813
 [96] -0.137195482 -0.340690266  0.137458446 -0.041580481 -0.220089706
[101]  0.492623899  0.384561189  0.537075104 -0.311354624  0.028627144
[106] -0.303701259  0.124976214 -0.118966891  0.201614512  0.058597656
[111]  0.207512487  0.315695783  0.504442306  0.007166902  0.157174442
[116]  0.160259103  0.530152210 -0.030604256 -0.714782615  0.011179605
[121]  0.368428358  0.457068796  0.220757700 -0.240458622  0.289637419
[126] -0.875671622  0.042342894 -0.134727796 -0.230875900 -0.384080739
[131] -0.147675401 -0.141085488 -0.335177252  0.285634688 -0.148171946
[136]  0.472719176  0.566088508 -0.249840403  0.477927817  0.300676663
[141]  0.143337891 -0.338964502 -0.092895421 -0.272664406  0.115462708
[146]  0.106003730 -0.496555109  0.270615832  0.306750092  0.401171751
[151]  0.297800443 -0.282187827 -0.059685026 -0.263919211 -0.078679637
[156] -0.362650866  0.183372497 -0.026363774  0.153458289  0.047627220
[161]  0.255371587  0.441748952  0.181331488 -0.504409251  0.474367096
[166]  0.329990488  0.161262405  0.044547338  0.026344685 -0.596933423
[171]  0.251706565  0.126300450 -0.823907246 -0.113350684 -0.259527069
[176]  0.044543972 -0.126298695  0.266882609  0.350490047 -0.307908104
[181]  0.048016102 -0.052783035 -0.199727652  0.098992843  0.191596399
[186]  0.364253071  0.137197522 -0.007618802 -0.443595627  0.223914272
[191] -0.213016711 -0.096778547 -0.032091308 -0.428021705 -0.377865723
[196]  0.194168329  0.637401264  0.105295847  0.169849076 -0.302577099
[201] -0.287586803 -0.185654277  0.235025640 -0.251034070 -0.209787777
[206] -0.517785048 -0.641932005 -0.307766471 -0.211293881 -0.256141185
[211]  0.080700631  0.242432471 -0.091045308  0.118303584 -0.093693312
[216] -0.328816169  0.146252793  0.408571397  0.119209100 -1.068101023
[221] -0.367884001 -0.258315224 -0.089578625  0.224904185  0.331090758
[226] -0.008836332 -0.429832192  0.598264662  0.463678166 -0.570964363
> 
> proc.time()
   user  system elapsed 
  2.603  14.824  17.889 

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: 0x600000898000>
> .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: 0x600000898000>
> .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: 0x600000898000>
> .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: 0x600000898000>
> 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: 0x6000008801e0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000008801e0>
> .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: 0x6000008801e0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000008801e0>
> .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: 0x6000008801e0>
> 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: 0x600000880360>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600000880360>
> .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: 0x600000880360>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x600000880360>
> .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: 0x600000880360>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x600000880360>
> .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: 0x600000880360>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x600000880360>
> .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: 0x600000880360>
> 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: 0x6000008a8000>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x6000008a8000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000008a8000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000008a8000>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile1305262bdf90" "BufferedMatrixFile130549da78b9"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile1305262bdf90" "BufferedMatrixFile130549da78b9"
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000008ec120>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000008ec120>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x6000008ec120>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x6000008ec120>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x6000008ec120>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x6000008ec120>
> .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: 0x6000008a8180>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000008a8180>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x6000008a8180>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x6000008a8180>
> 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: 0x6000008f4000>
> .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: 0x6000008f4000>
> rm(P)
> 
> proc.time()
   user  system elapsed 
  0.325   0.144   0.466 

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.318   0.087   0.419 

Example timings