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

This page was generated on 2025-06-24 12:08 -0400 (Tue, 24 Jun 2025).

HostnameOSArch (*)R versionInstalled pkgs
nebbiolo2Linux (Ubuntu 24.04.2 LTS)x86_644.5.1 (2025-06-13) -- "Great Square Root" 4565
palomino8Windows Server 2022 Datacenterx644.5.1 (2025-06-13 ucrt) -- "Great Square Root" 4506
lconwaymacOS 12.7.1 Montereyx86_644.5.1 (2025-06-13) -- "Great Square Root" 4544
kjohnson3macOS 13.7.1 Venturaarm644.5.1 Patched (2025-06-14 r88325) -- "Great Square Root" 4492
taishanLinux (openEuler 24.03 LTS)aarch644.5.0 (2025-04-11) -- "How About a Twenty-Six" 4497
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 250/2310HostnameOS / ArchINSTALLBUILDCHECKBUILD BIN
BufferedMatrix 1.73.0  (landing page)
Ben Bolstad
Snapshot Date: 2025-06-23 13:25 -0400 (Mon, 23 Jun 2025)
git_url: https://git.bioconductor.org/packages/BufferedMatrix
git_branch: devel
git_last_commit: 0147962
git_last_commit_date: 2025-04-15 09:39:39 -0400 (Tue, 15 Apr 2025)
nebbiolo2Linux (Ubuntu 24.04.2 LTS) / x86_64  OK    OK    OK  UNNEEDED, same version is already published
palomino8Windows Server 2022 Datacenter / x64  OK    OK    OK    OK  UNNEEDED, same version is already published
lconwaymacOS 12.7.1 Monterey / x86_64  OK    OK    WARNINGS    OK  UNNEEDED, same version is already published
kjohnson3macOS 13.7.1 Ventura / arm64  OK    OK    WARNINGS    OK  UNNEEDED, same version is already published
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-06-23 19:21:05 -0400 (Mon, 23 Jun 2025)
EndedAt: 2025-06-23 19:23:00 -0400 (Mon, 23 Jun 2025)
EllapsedTime: 114.6 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.339   0.161   1.119 

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    1056620 56.5         NA   634457 33.9
Vcells 891074  6.8    8388608 64.0      98304  2108777 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] "Mon Jun 23 19:21:33 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] "Mon Jun 23 19:21:34 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: 0x600001d0c000>
> 
> 
> 
> 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] "Mon Jun 23 19:22:04 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] "Mon Jun 23 19:22:16 2025"
> 
> ColMode(tmp2)
<pointer: 0x600001d0c000>
> 
> 
> 
> ### 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,] 100.4552344 -0.04953501 -1.0488798  0.1427822
[2,]   1.0714260 -0.07651039  0.2455268  0.7409911
[3,]  -0.5720933  1.17589344  1.0761147 -0.9700587
[4,]  -0.1363803 -0.71535447 -1.5157942  0.8769185
> 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,] 100.4552344 0.04953501 1.0488798 0.1427822
[2,]   1.0714260 0.07651039 0.2455268 0.7409911
[3,]   0.5720933 1.17589344 1.0761147 0.9700587
[4,]   0.1363803 0.71535447 1.5157942 0.8769185
> 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,] 10.0227359 0.2225646 1.0241483 0.3778654
[2,]  1.0350971 0.2766051 0.4955066 0.8608084
[3,]  0.7563685 1.0843862 1.0373595 0.9849156
[4,]  0.3692970 0.8457863 1.2311759 0.9364393
> 
> 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,] 225.68259 27.27518 36.29036 28.92144
[2,]  36.42240 27.84256 30.20059 34.34908
[3,]  33.13578 37.01976 36.44971 35.81921
[4,]  28.82935 34.17322 38.82755 35.24131
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x600001d40000>
> exp(tmp5)
<pointer: 0x600001d40000>
> log(tmp5,2)
<pointer: 0x600001d40000>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 469.7287
> Min(tmp5)
[1] 54.12446
> mean(tmp5)
[1] 72.82884
> Sum(tmp5)
[1] 14565.77
> Var(tmp5)
[1] 865.0668
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 90.01033 71.55394 72.72575 72.74144 72.30813 68.85553 71.56854 69.77179
 [9] 66.75574 71.99720
> rowSums(tmp5)
 [1] 1800.207 1431.079 1454.515 1454.829 1446.163 1377.111 1431.371 1395.436
 [9] 1335.115 1439.944
> rowVars(tmp5)
 [1] 8049.31901   70.98240   63.41833   56.13681   67.83271  103.24119
 [7]   63.85191   61.60886   67.24012   76.37004
> rowSd(tmp5)
 [1] 89.717997  8.425105  7.963563  7.492450  8.236062 10.160767  7.990739
 [8]  7.849131  8.200007  8.738996
> rowMax(tmp5)
 [1] 469.72875  94.90969  91.67738  88.14647  87.70394  90.46518  88.64994
 [8]  87.70749  85.89369  89.07278
> rowMin(tmp5)
 [1] 56.76972 57.95064 60.06746 60.00452 56.81561 56.43785 58.82205 58.13316
 [9] 54.12446 59.02981
> 
> colMeans(tmp5)
 [1] 110.34369  65.72671  70.73558  68.55611  67.82236  76.34028  71.69981
 [8]  71.48521  67.60095  68.32688  70.34184  77.44995  73.01452  72.91857
[15]  74.02560  70.41138  71.77040  69.71200  69.83855  68.45637
> colSums(tmp5)
 [1] 1103.4369  657.2671  707.3558  685.5611  678.2236  763.4028  716.9981
 [8]  714.8521  676.0095  683.2688  703.4184  774.4995  730.1452  729.1857
[15]  740.2560  704.1138  717.7040  697.1200  698.3855  684.5637
> colVars(tmp5)
 [1] 15979.46346    68.99519    38.80297    33.59710    47.78168   101.05195
 [7]   129.30400    73.90333    41.96524    33.35319    73.43140    72.01929
[13]    68.45516    55.17751    72.00976    47.36601   107.00761    63.63743
[19]    83.63984   111.88239
> colSd(tmp5)
 [1] 126.409903   8.306334   6.229203   5.796301   6.912429  10.052460
 [7]  11.371192   8.596705   6.478058   5.775222   8.569212   8.486418
[13]   8.273763   7.428156   8.485857   6.882297  10.344448   7.977307
[19]   9.145482  10.577447
> colMax(tmp5)
 [1] 469.72875  78.02984  80.81447  74.77022  78.20270  94.90969  88.07941
 [8]  87.70394  80.42061  79.53269  82.63424  88.64994  82.74879  89.07278
[15]  88.14647  85.21414  91.67738  84.37194  84.39101  90.46518
> colMin(tmp5)
 [1] 60.00452 56.76972 62.68001 58.13316 54.48708 60.80194 54.12446 57.36140
 [9] 56.89317 59.25255 56.70386 62.98857 62.35039 64.50017 61.33399 60.86493
[17] 56.43785 60.02341 58.59729 56.33974
> 
> 
> ### setting a random element to NA and then testing with na.rm=TRUE or na.rm=FALSE (The default)
> 
> 
> which.row <- sample(1:10,1,replace=TRUE)
> which.col  <- sample(1:20,1,replace=TRUE)
> 
> tmp5[which.row,which.col] <- NA
> 
> Max(tmp5)
[1] NA
> Min(tmp5)
[1] NA
> mean(tmp5)
[1] NA
> Sum(tmp5)
[1] NA
> Var(tmp5)
[1] NA
> 
> rowMeans(tmp5)
 [1] 90.01033 71.55394 72.72575 72.74144 72.30813 68.85553 71.56854 69.77179
 [9]       NA 71.99720
> rowSums(tmp5)
 [1] 1800.207 1431.079 1454.515 1454.829 1446.163 1377.111 1431.371 1395.436
 [9]       NA 1439.944
> rowVars(tmp5)
 [1] 8049.31901   70.98240   63.41833   56.13681   67.83271  103.24119
 [7]   63.85191   61.60886   70.89423   76.37004
> rowSd(tmp5)
 [1] 89.717997  8.425105  7.963563  7.492450  8.236062 10.160767  7.990739
 [8]  7.849131  8.419871  8.738996
> rowMax(tmp5)
 [1] 469.72875  94.90969  91.67738  88.14647  87.70394  90.46518  88.64994
 [8]  87.70749        NA  89.07278
> rowMin(tmp5)
 [1] 56.76972 57.95064 60.06746 60.00452 56.81561 56.43785 58.82205 58.13316
 [9]       NA 59.02981
> 
> colMeans(tmp5)
 [1] 110.34369  65.72671  70.73558  68.55611  67.82236  76.34028  71.69981
 [8]  71.48521  67.60095  68.32688  70.34184  77.44995  73.01452  72.91857
[15]  74.02560  70.41138  71.77040  69.71200        NA  68.45637
> colSums(tmp5)
 [1] 1103.4369  657.2671  707.3558  685.5611  678.2236  763.4028  716.9981
 [8]  714.8521  676.0095  683.2688  703.4184  774.4995  730.1452  729.1857
[15]  740.2560  704.1138  717.7040  697.1200        NA  684.5637
> colVars(tmp5)
 [1] 15979.46346    68.99519    38.80297    33.59710    47.78168   101.05195
 [7]   129.30400    73.90333    41.96524    33.35319    73.43140    72.01929
[13]    68.45516    55.17751    72.00976    47.36601   107.00761    63.63743
[19]          NA   111.88239
> colSd(tmp5)
 [1] 126.409903   8.306334   6.229203   5.796301   6.912429  10.052460
 [7]  11.371192   8.596705   6.478058   5.775222   8.569212   8.486418
[13]   8.273763   7.428156   8.485857   6.882297  10.344448   7.977307
[19]         NA  10.577447
> colMax(tmp5)
 [1] 469.72875  78.02984  80.81447  74.77022  78.20270  94.90969  88.07941
 [8]  87.70394  80.42061  79.53269  82.63424  88.64994  82.74879  89.07278
[15]  88.14647  85.21414  91.67738  84.37194        NA  90.46518
> colMin(tmp5)
 [1] 60.00452 56.76972 62.68001 58.13316 54.48708 60.80194 54.12446 57.36140
 [9] 56.89317 59.25255 56.70386 62.98857 62.35039 64.50017 61.33399 60.86493
[17] 56.43785 60.02341       NA 56.33974
> 
> Max(tmp5,na.rm=TRUE)
[1] 469.7287
> Min(tmp5,na.rm=TRUE)
[1] 54.12446
> mean(tmp5,na.rm=TRUE)
[1] 72.86529
> Sum(tmp5,na.rm=TRUE)
[1] 14500.19
> Var(tmp5,na.rm=TRUE)
[1] 869.1688
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 90.01033 71.55394 72.72575 72.74144 72.30813 68.85553 71.56854 69.77179
 [9] 66.81785 71.99720
> rowSums(tmp5,na.rm=TRUE)
 [1] 1800.207 1431.079 1454.515 1454.829 1446.163 1377.111 1431.371 1395.436
 [9] 1269.539 1439.944
> rowVars(tmp5,na.rm=TRUE)
 [1] 8049.31901   70.98240   63.41833   56.13681   67.83271  103.24119
 [7]   63.85191   61.60886   70.89423   76.37004
> rowSd(tmp5,na.rm=TRUE)
 [1] 89.717997  8.425105  7.963563  7.492450  8.236062 10.160767  7.990739
 [8]  7.849131  8.419871  8.738996
> rowMax(tmp5,na.rm=TRUE)
 [1] 469.72875  94.90969  91.67738  88.14647  87.70394  90.46518  88.64994
 [8]  87.70749  85.89369  89.07278
> rowMin(tmp5,na.rm=TRUE)
 [1] 56.76972 57.95064 60.06746 60.00452 56.81561 56.43785 58.82205 58.13316
 [9] 54.12446 59.02981
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 110.34369  65.72671  70.73558  68.55611  67.82236  76.34028  71.69981
 [8]  71.48521  67.60095  68.32688  70.34184  77.44995  73.01452  72.91857
[15]  74.02560  70.41138  71.77040  69.71200  70.31221  68.45637
> colSums(tmp5,na.rm=TRUE)
 [1] 1103.4369  657.2671  707.3558  685.5611  678.2236  763.4028  716.9981
 [8]  714.8521  676.0095  683.2688  703.4184  774.4995  730.1452  729.1857
[15]  740.2560  704.1138  717.7040  697.1200  632.8099  684.5637
> colVars(tmp5,na.rm=TRUE)
 [1] 15979.46346    68.99519    38.80297    33.59710    47.78168   101.05195
 [7]   129.30400    73.90333    41.96524    33.35319    73.43140    72.01929
[13]    68.45516    55.17751    72.00976    47.36601   107.00761    63.63743
[19]    91.57084   111.88239
> colSd(tmp5,na.rm=TRUE)
 [1] 126.409903   8.306334   6.229203   5.796301   6.912429  10.052460
 [7]  11.371192   8.596705   6.478058   5.775222   8.569212   8.486418
[13]   8.273763   7.428156   8.485857   6.882297  10.344448   7.977307
[19]   9.569265  10.577447
> colMax(tmp5,na.rm=TRUE)
 [1] 469.72875  78.02984  80.81447  74.77022  78.20270  94.90969  88.07941
 [8]  87.70394  80.42061  79.53269  82.63424  88.64994  82.74879  89.07278
[15]  88.14647  85.21414  91.67738  84.37194  84.39101  90.46518
> colMin(tmp5,na.rm=TRUE)
 [1] 60.00452 56.76972 62.68001 58.13316 54.48708 60.80194 54.12446 57.36140
 [9] 56.89317 59.25255 56.70386 62.98857 62.35039 64.50017 61.33399 60.86493
[17] 56.43785 60.02341 58.59729 56.33974
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1] 90.01033 71.55394 72.72575 72.74144 72.30813 68.85553 71.56854 69.77179
 [9]      NaN 71.99720
> rowSums(tmp5,na.rm=TRUE)
 [1] 1800.207 1431.079 1454.515 1454.829 1446.163 1377.111 1431.371 1395.436
 [9]    0.000 1439.944
> rowVars(tmp5,na.rm=TRUE)
 [1] 8049.31901   70.98240   63.41833   56.13681   67.83271  103.24119
 [7]   63.85191   61.60886         NA   76.37004
> rowSd(tmp5,na.rm=TRUE)
 [1] 89.717997  8.425105  7.963563  7.492450  8.236062 10.160767  7.990739
 [8]  7.849131        NA  8.738996
> rowMax(tmp5,na.rm=TRUE)
 [1] 469.72875  94.90969  91.67738  88.14647  87.70394  90.46518  88.64994
 [8]  87.70749        NA  89.07278
> rowMin(tmp5,na.rm=TRUE)
 [1] 56.76972 57.95064 60.06746 60.00452 56.81561 56.43785 58.82205 58.13316
 [9]       NA 59.02981
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1] 113.96960  65.99966  71.20469  68.46611  69.30406  77.20485  73.65262
 [8]  71.96406  67.70893  68.30595  71.20083  76.51176  73.17904  73.77118
[15]  73.11614  71.30520  72.30450  70.78851       NaN  69.80266
> colSums(tmp5,na.rm=TRUE)
 [1] 1025.7264  593.9969  640.8422  616.1950  623.7365  694.8437  662.8736
 [8]  647.6765  609.3803  614.7535  640.8075  688.6058  658.6113  663.9407
[15]  658.0453  641.7468  650.7405  637.0966    0.0000  628.2239
> colVars(tmp5,na.rm=TRUE)
 [1] 17828.99038    76.78148    41.17767    37.70562    29.05582   105.27425
 [7]   102.56524    80.56170    47.07974    37.51741    74.30928    71.11938
[13]    76.70757    53.89642    71.70596    44.29916   117.17440    58.55477
[19]          NA   105.47706
> colSd(tmp5,na.rm=TRUE)
 [1] 133.525242   8.762504   6.416983   6.140490   5.390345  10.260324
 [7]  10.127450   8.975617   6.861468   6.125146   8.620283   8.433231
[13]   8.758286   7.341418   8.467937   6.655761  10.824712   7.652109
[19]         NA  10.270202
> colMax(tmp5,na.rm=TRUE)
 [1] 469.72875  78.02984  80.81447  74.77022  78.20270  94.90969  88.07941
 [8]  87.70394  80.42061  79.53269  82.63424  88.64994  82.74879  89.07278
[15]  88.14647  85.21414  91.67738  84.37194      -Inf  90.46518
> colMin(tmp5,na.rm=TRUE)
 [1] 60.00452 56.76972 62.68001 58.13316 62.02113 60.80194 59.56838 57.36140
 [9] 56.89317 59.25255 56.70386 62.98857 62.35039 64.50017 61.33399 60.86493
[17] 56.43785 60.06746      Inf 56.81561
> 
> 
> 
> 
> 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] 278.7114 299.6066 183.9086 199.7659 281.2994 159.7392 203.3620 222.0385
 [9] 209.4101 222.3733
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 278.7114 299.6066 183.9086 199.7659 281.2994 159.7392 203.3620 222.0385
 [9] 209.4101 222.3733
> 
> 
> 
> copymatrix <- matrix(rnorm(200,150,15),10,20)
> 
> tmp5[1:10,1:20] <- copymatrix
> which.row <- 1
> which.col  <- 3
> cat(which.row," ",which.col,"\n")
1   3 
> tmp5[which.row,which.col] <- NA
> copymatrix[which.row,which.col] <- NA
> 
> colVars(tmp5,na.rm=TRUE)-apply(copymatrix,2,var,na.rm=TRUE)
 [1] -2.842171e-14 -7.105427e-14  2.842171e-13  2.273737e-13 -3.552714e-14
 [6]  1.705303e-13  5.684342e-14  2.842171e-14  5.684342e-14  2.131628e-14
[11] -5.684342e-14  1.136868e-13 -1.705303e-13  0.000000e+00  1.278977e-13
[16] -5.684342e-14  2.842171e-14 -5.684342e-14  2.842171e-14  1.705303e-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)
+ }
6   15 
6   14 
8   10 
4   18 
8   11 
7   20 
1   10 
8   18 
10   20 
5   11 
2   9 
7   4 
2   10 
6   13 
10   8 
8   15 
7   1 
5   2 
4   3 
1   12 
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] 1.751517
> Min(tmp)
[1] -2.67152
> mean(tmp)
[1] -0.120513
> Sum(tmp)
[1] -12.0513
> Var(tmp)
[1] 0.9674154
> 
> rowMeans(tmp)
[1] -0.120513
> rowSums(tmp)
[1] -12.0513
> rowVars(tmp)
[1] 0.9674154
> rowSd(tmp)
[1] 0.9835728
> rowMax(tmp)
[1] 1.751517
> rowMin(tmp)
[1] -2.67152
> 
> colMeans(tmp)
  [1] -0.35043373  0.52568079 -1.16764135 -1.83774634 -0.48519304 -0.89771507
  [7] -0.95458323 -1.25955153  0.96288685 -2.45380188 -0.71624020  0.53342596
 [13] -0.91281918  1.03982398  0.18899342  0.08320925 -0.48745566 -0.30347331
 [19] -0.95022268  0.73845005 -1.50951413  0.25424936 -0.68604857  1.48870252
 [25]  1.19518142  1.19922486  0.22290516  1.24908873  0.14012282  1.14934886
 [31] -0.11493984 -1.59597031 -1.29425022  1.04681745  1.48395299 -1.18912894
 [37]  0.66513779 -0.37251162  0.54985658  0.95772807 -2.67152027  1.51664790
 [43]  0.39221913 -0.12980615  1.61664042 -0.96066388  1.20906116  0.04863015
 [49] -0.27710941 -0.11782010 -0.91572395 -0.48687859  0.34112564 -2.13393674
 [55] -1.17618246 -1.97976839 -1.00289955 -0.34804023  1.04971403  0.03872986
 [61]  1.24734405 -0.87920111  0.13828871 -1.18728501  0.59254525 -0.17229405
 [67]  0.48640851  0.19472282 -0.42923570  0.15016345 -0.81734705  0.70507504
 [73] -0.18443973 -1.02225375 -1.77943713 -1.18173501  0.59853617 -0.28492036
 [79]  0.25791211  0.25041664  1.03786219 -1.23908069  0.98226849  0.39143785
 [85]  0.03932415  0.82360965  0.52712142 -0.55817651 -1.52400739 -0.89511393
 [91] -0.08674030 -0.50775534 -0.25189174 -0.81857175  1.33933375  1.75151653
 [97] -0.64764593  0.13458073 -0.35519049  0.97459383
> colSums(tmp)
  [1] -0.35043373  0.52568079 -1.16764135 -1.83774634 -0.48519304 -0.89771507
  [7] -0.95458323 -1.25955153  0.96288685 -2.45380188 -0.71624020  0.53342596
 [13] -0.91281918  1.03982398  0.18899342  0.08320925 -0.48745566 -0.30347331
 [19] -0.95022268  0.73845005 -1.50951413  0.25424936 -0.68604857  1.48870252
 [25]  1.19518142  1.19922486  0.22290516  1.24908873  0.14012282  1.14934886
 [31] -0.11493984 -1.59597031 -1.29425022  1.04681745  1.48395299 -1.18912894
 [37]  0.66513779 -0.37251162  0.54985658  0.95772807 -2.67152027  1.51664790
 [43]  0.39221913 -0.12980615  1.61664042 -0.96066388  1.20906116  0.04863015
 [49] -0.27710941 -0.11782010 -0.91572395 -0.48687859  0.34112564 -2.13393674
 [55] -1.17618246 -1.97976839 -1.00289955 -0.34804023  1.04971403  0.03872986
 [61]  1.24734405 -0.87920111  0.13828871 -1.18728501  0.59254525 -0.17229405
 [67]  0.48640851  0.19472282 -0.42923570  0.15016345 -0.81734705  0.70507504
 [73] -0.18443973 -1.02225375 -1.77943713 -1.18173501  0.59853617 -0.28492036
 [79]  0.25791211  0.25041664  1.03786219 -1.23908069  0.98226849  0.39143785
 [85]  0.03932415  0.82360965  0.52712142 -0.55817651 -1.52400739 -0.89511393
 [91] -0.08674030 -0.50775534 -0.25189174 -0.81857175  1.33933375  1.75151653
 [97] -0.64764593  0.13458073 -0.35519049  0.97459383
> colVars(tmp)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> colSd(tmp)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> colMax(tmp)
  [1] -0.35043373  0.52568079 -1.16764135 -1.83774634 -0.48519304 -0.89771507
  [7] -0.95458323 -1.25955153  0.96288685 -2.45380188 -0.71624020  0.53342596
 [13] -0.91281918  1.03982398  0.18899342  0.08320925 -0.48745566 -0.30347331
 [19] -0.95022268  0.73845005 -1.50951413  0.25424936 -0.68604857  1.48870252
 [25]  1.19518142  1.19922486  0.22290516  1.24908873  0.14012282  1.14934886
 [31] -0.11493984 -1.59597031 -1.29425022  1.04681745  1.48395299 -1.18912894
 [37]  0.66513779 -0.37251162  0.54985658  0.95772807 -2.67152027  1.51664790
 [43]  0.39221913 -0.12980615  1.61664042 -0.96066388  1.20906116  0.04863015
 [49] -0.27710941 -0.11782010 -0.91572395 -0.48687859  0.34112564 -2.13393674
 [55] -1.17618246 -1.97976839 -1.00289955 -0.34804023  1.04971403  0.03872986
 [61]  1.24734405 -0.87920111  0.13828871 -1.18728501  0.59254525 -0.17229405
 [67]  0.48640851  0.19472282 -0.42923570  0.15016345 -0.81734705  0.70507504
 [73] -0.18443973 -1.02225375 -1.77943713 -1.18173501  0.59853617 -0.28492036
 [79]  0.25791211  0.25041664  1.03786219 -1.23908069  0.98226849  0.39143785
 [85]  0.03932415  0.82360965  0.52712142 -0.55817651 -1.52400739 -0.89511393
 [91] -0.08674030 -0.50775534 -0.25189174 -0.81857175  1.33933375  1.75151653
 [97] -0.64764593  0.13458073 -0.35519049  0.97459383
> colMin(tmp)
  [1] -0.35043373  0.52568079 -1.16764135 -1.83774634 -0.48519304 -0.89771507
  [7] -0.95458323 -1.25955153  0.96288685 -2.45380188 -0.71624020  0.53342596
 [13] -0.91281918  1.03982398  0.18899342  0.08320925 -0.48745566 -0.30347331
 [19] -0.95022268  0.73845005 -1.50951413  0.25424936 -0.68604857  1.48870252
 [25]  1.19518142  1.19922486  0.22290516  1.24908873  0.14012282  1.14934886
 [31] -0.11493984 -1.59597031 -1.29425022  1.04681745  1.48395299 -1.18912894
 [37]  0.66513779 -0.37251162  0.54985658  0.95772807 -2.67152027  1.51664790
 [43]  0.39221913 -0.12980615  1.61664042 -0.96066388  1.20906116  0.04863015
 [49] -0.27710941 -0.11782010 -0.91572395 -0.48687859  0.34112564 -2.13393674
 [55] -1.17618246 -1.97976839 -1.00289955 -0.34804023  1.04971403  0.03872986
 [61]  1.24734405 -0.87920111  0.13828871 -1.18728501  0.59254525 -0.17229405
 [67]  0.48640851  0.19472282 -0.42923570  0.15016345 -0.81734705  0.70507504
 [73] -0.18443973 -1.02225375 -1.77943713 -1.18173501  0.59853617 -0.28492036
 [79]  0.25791211  0.25041664  1.03786219 -1.23908069  0.98226849  0.39143785
 [85]  0.03932415  0.82360965  0.52712142 -0.55817651 -1.52400739 -0.89511393
 [91] -0.08674030 -0.50775534 -0.25189174 -0.81857175  1.33933375  1.75151653
 [97] -0.64764593  0.13458073 -0.35519049  0.97459383
> colMedians(tmp)
  [1] -0.35043373  0.52568079 -1.16764135 -1.83774634 -0.48519304 -0.89771507
  [7] -0.95458323 -1.25955153  0.96288685 -2.45380188 -0.71624020  0.53342596
 [13] -0.91281918  1.03982398  0.18899342  0.08320925 -0.48745566 -0.30347331
 [19] -0.95022268  0.73845005 -1.50951413  0.25424936 -0.68604857  1.48870252
 [25]  1.19518142  1.19922486  0.22290516  1.24908873  0.14012282  1.14934886
 [31] -0.11493984 -1.59597031 -1.29425022  1.04681745  1.48395299 -1.18912894
 [37]  0.66513779 -0.37251162  0.54985658  0.95772807 -2.67152027  1.51664790
 [43]  0.39221913 -0.12980615  1.61664042 -0.96066388  1.20906116  0.04863015
 [49] -0.27710941 -0.11782010 -0.91572395 -0.48687859  0.34112564 -2.13393674
 [55] -1.17618246 -1.97976839 -1.00289955 -0.34804023  1.04971403  0.03872986
 [61]  1.24734405 -0.87920111  0.13828871 -1.18728501  0.59254525 -0.17229405
 [67]  0.48640851  0.19472282 -0.42923570  0.15016345 -0.81734705  0.70507504
 [73] -0.18443973 -1.02225375 -1.77943713 -1.18173501  0.59853617 -0.28492036
 [79]  0.25791211  0.25041664  1.03786219 -1.23908069  0.98226849  0.39143785
 [85]  0.03932415  0.82360965  0.52712142 -0.55817651 -1.52400739 -0.89511393
 [91] -0.08674030 -0.50775534 -0.25189174 -0.81857175  1.33933375  1.75151653
 [97] -0.64764593  0.13458073 -0.35519049  0.97459383
> colRanges(tmp)
           [,1]      [,2]      [,3]      [,4]      [,5]       [,6]       [,7]
[1,] -0.3504337 0.5256808 -1.167641 -1.837746 -0.485193 -0.8977151 -0.9545832
[2,] -0.3504337 0.5256808 -1.167641 -1.837746 -0.485193 -0.8977151 -0.9545832
          [,8]      [,9]     [,10]      [,11]    [,12]      [,13]    [,14]
[1,] -1.259552 0.9628868 -2.453802 -0.7162402 0.533426 -0.9128192 1.039824
[2,] -1.259552 0.9628868 -2.453802 -0.7162402 0.533426 -0.9128192 1.039824
         [,15]      [,16]      [,17]      [,18]      [,19]   [,20]     [,21]
[1,] 0.1889934 0.08320925 -0.4874557 -0.3034733 -0.9502227 0.73845 -1.509514
[2,] 0.1889934 0.08320925 -0.4874557 -0.3034733 -0.9502227 0.73845 -1.509514
         [,22]      [,23]    [,24]    [,25]    [,26]     [,27]    [,28]
[1,] 0.2542494 -0.6860486 1.488703 1.195181 1.199225 0.2229052 1.249089
[2,] 0.2542494 -0.6860486 1.488703 1.195181 1.199225 0.2229052 1.249089
         [,29]    [,30]      [,31]    [,32]    [,33]    [,34]    [,35]
[1,] 0.1401228 1.149349 -0.1149398 -1.59597 -1.29425 1.046817 1.483953
[2,] 0.1401228 1.149349 -0.1149398 -1.59597 -1.29425 1.046817 1.483953
         [,36]     [,37]      [,38]     [,39]     [,40]    [,41]    [,42]
[1,] -1.189129 0.6651378 -0.3725116 0.5498566 0.9577281 -2.67152 1.516648
[2,] -1.189129 0.6651378 -0.3725116 0.5498566 0.9577281 -2.67152 1.516648
         [,43]      [,44]   [,45]      [,46]    [,47]      [,48]      [,49]
[1,] 0.3922191 -0.1298061 1.61664 -0.9606639 1.209061 0.04863015 -0.2771094
[2,] 0.3922191 -0.1298061 1.61664 -0.9606639 1.209061 0.04863015 -0.2771094
          [,50]     [,51]      [,52]     [,53]     [,54]     [,55]     [,56]
[1,] -0.1178201 -0.915724 -0.4868786 0.3411256 -2.133937 -1.176182 -1.979768
[2,] -0.1178201 -0.915724 -0.4868786 0.3411256 -2.133937 -1.176182 -1.979768
       [,57]      [,58]    [,59]      [,60]    [,61]      [,62]     [,63]
[1,] -1.0029 -0.3480402 1.049714 0.03872986 1.247344 -0.8792011 0.1382887
[2,] -1.0029 -0.3480402 1.049714 0.03872986 1.247344 -0.8792011 0.1382887
         [,64]     [,65]     [,66]     [,67]     [,68]      [,69]     [,70]
[1,] -1.187285 0.5925452 -0.172294 0.4864085 0.1947228 -0.4292357 0.1501635
[2,] -1.187285 0.5925452 -0.172294 0.4864085 0.1947228 -0.4292357 0.1501635
          [,71]    [,72]      [,73]     [,74]     [,75]     [,76]     [,77]
[1,] -0.8173471 0.705075 -0.1844397 -1.022254 -1.779437 -1.181735 0.5985362
[2,] -0.8173471 0.705075 -0.1844397 -1.022254 -1.779437 -1.181735 0.5985362
          [,78]     [,79]     [,80]    [,81]     [,82]     [,83]     [,84]
[1,] -0.2849204 0.2579121 0.2504166 1.037862 -1.239081 0.9822685 0.3914378
[2,] -0.2849204 0.2579121 0.2504166 1.037862 -1.239081 0.9822685 0.3914378
          [,85]     [,86]     [,87]      [,88]     [,89]      [,90]      [,91]
[1,] 0.03932415 0.8236096 0.5271214 -0.5581765 -1.524007 -0.8951139 -0.0867403
[2,] 0.03932415 0.8236096 0.5271214 -0.5581765 -1.524007 -0.8951139 -0.0867403
          [,92]      [,93]      [,94]    [,95]    [,96]      [,97]     [,98]
[1,] -0.5077553 -0.2518917 -0.8185717 1.339334 1.751517 -0.6476459 0.1345807
[2,] -0.5077553 -0.2518917 -0.8185717 1.339334 1.751517 -0.6476459 0.1345807
          [,99]    [,100]
[1,] -0.3551905 0.9745938
[2,] -0.3551905 0.9745938
> 
> 
> Max(tmp2)
[1] 2.471022
> Min(tmp2)
[1] -2.889624
> mean(tmp2)
[1] 0.0233452
> Sum(tmp2)
[1] 2.33452
> Var(tmp2)
[1] 1.171783
> 
> rowMeans(tmp2)
  [1] -1.280444030  0.819221850 -0.046485365 -0.679977503 -0.133946613
  [6]  0.660080414 -0.469711101  1.408767879 -0.036020654 -1.172012493
 [11] -1.001319545 -1.592158879 -0.044051691 -1.474802756 -0.883482357
 [16]  0.046665936  0.171656404  1.380624770  0.378192303  0.634494779
 [21] -0.159768862 -0.526304139  0.701655138  0.125237963 -0.003693129
 [26]  0.359840686 -0.805214627  2.447464749 -0.306614134  0.692561968
 [31]  1.609368964 -0.332288632  1.054586405 -1.053002402 -0.640966539
 [36]  0.386528988 -1.046849050  0.244757230 -0.134786237 -0.877190806
 [41]  1.058591473  0.114524442 -1.225194214  2.016995922  1.176907268
 [46] -1.288145319 -1.176681708  0.908644201  0.498000740 -1.329940430
 [51]  1.441204801  0.751829111 -0.542716027 -2.308340070 -1.989403199
 [56]  1.389243651 -0.318430055  1.188256668 -0.807826227 -2.889623672
 [61]  0.129717106  0.099532475  0.287091277  1.749759649  0.279374823
 [66]  1.840241992 -0.437830404  0.184421574 -1.135889744  0.794544685
 [71]  0.434300805 -0.492853695  1.013126918  1.091264170  2.471021734
 [76] -0.656245019 -0.672239760 -1.129492915 -0.190381039 -0.522729846
 [81] -0.225740585 -2.563194897  2.134980841  1.466070149 -0.002441474
 [86] -0.343876269  0.023906468 -0.620276579  0.829511015  0.349827937
 [91]  0.053211026 -0.667710932  0.687660091  0.413408998 -0.022098922
 [96]  0.421644900  1.700879071  0.972746226 -2.509014467  0.009780414
> rowSums(tmp2)
  [1] -1.280444030  0.819221850 -0.046485365 -0.679977503 -0.133946613
  [6]  0.660080414 -0.469711101  1.408767879 -0.036020654 -1.172012493
 [11] -1.001319545 -1.592158879 -0.044051691 -1.474802756 -0.883482357
 [16]  0.046665936  0.171656404  1.380624770  0.378192303  0.634494779
 [21] -0.159768862 -0.526304139  0.701655138  0.125237963 -0.003693129
 [26]  0.359840686 -0.805214627  2.447464749 -0.306614134  0.692561968
 [31]  1.609368964 -0.332288632  1.054586405 -1.053002402 -0.640966539
 [36]  0.386528988 -1.046849050  0.244757230 -0.134786237 -0.877190806
 [41]  1.058591473  0.114524442 -1.225194214  2.016995922  1.176907268
 [46] -1.288145319 -1.176681708  0.908644201  0.498000740 -1.329940430
 [51]  1.441204801  0.751829111 -0.542716027 -2.308340070 -1.989403199
 [56]  1.389243651 -0.318430055  1.188256668 -0.807826227 -2.889623672
 [61]  0.129717106  0.099532475  0.287091277  1.749759649  0.279374823
 [66]  1.840241992 -0.437830404  0.184421574 -1.135889744  0.794544685
 [71]  0.434300805 -0.492853695  1.013126918  1.091264170  2.471021734
 [76] -0.656245019 -0.672239760 -1.129492915 -0.190381039 -0.522729846
 [81] -0.225740585 -2.563194897  2.134980841  1.466070149 -0.002441474
 [86] -0.343876269  0.023906468 -0.620276579  0.829511015  0.349827937
 [91]  0.053211026 -0.667710932  0.687660091  0.413408998 -0.022098922
 [96]  0.421644900  1.700879071  0.972746226 -2.509014467  0.009780414
> rowVars(tmp2)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowSd(tmp2)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowMax(tmp2)
  [1] -1.280444030  0.819221850 -0.046485365 -0.679977503 -0.133946613
  [6]  0.660080414 -0.469711101  1.408767879 -0.036020654 -1.172012493
 [11] -1.001319545 -1.592158879 -0.044051691 -1.474802756 -0.883482357
 [16]  0.046665936  0.171656404  1.380624770  0.378192303  0.634494779
 [21] -0.159768862 -0.526304139  0.701655138  0.125237963 -0.003693129
 [26]  0.359840686 -0.805214627  2.447464749 -0.306614134  0.692561968
 [31]  1.609368964 -0.332288632  1.054586405 -1.053002402 -0.640966539
 [36]  0.386528988 -1.046849050  0.244757230 -0.134786237 -0.877190806
 [41]  1.058591473  0.114524442 -1.225194214  2.016995922  1.176907268
 [46] -1.288145319 -1.176681708  0.908644201  0.498000740 -1.329940430
 [51]  1.441204801  0.751829111 -0.542716027 -2.308340070 -1.989403199
 [56]  1.389243651 -0.318430055  1.188256668 -0.807826227 -2.889623672
 [61]  0.129717106  0.099532475  0.287091277  1.749759649  0.279374823
 [66]  1.840241992 -0.437830404  0.184421574 -1.135889744  0.794544685
 [71]  0.434300805 -0.492853695  1.013126918  1.091264170  2.471021734
 [76] -0.656245019 -0.672239760 -1.129492915 -0.190381039 -0.522729846
 [81] -0.225740585 -2.563194897  2.134980841  1.466070149 -0.002441474
 [86] -0.343876269  0.023906468 -0.620276579  0.829511015  0.349827937
 [91]  0.053211026 -0.667710932  0.687660091  0.413408998 -0.022098922
 [96]  0.421644900  1.700879071  0.972746226 -2.509014467  0.009780414
> rowMin(tmp2)
  [1] -1.280444030  0.819221850 -0.046485365 -0.679977503 -0.133946613
  [6]  0.660080414 -0.469711101  1.408767879 -0.036020654 -1.172012493
 [11] -1.001319545 -1.592158879 -0.044051691 -1.474802756 -0.883482357
 [16]  0.046665936  0.171656404  1.380624770  0.378192303  0.634494779
 [21] -0.159768862 -0.526304139  0.701655138  0.125237963 -0.003693129
 [26]  0.359840686 -0.805214627  2.447464749 -0.306614134  0.692561968
 [31]  1.609368964 -0.332288632  1.054586405 -1.053002402 -0.640966539
 [36]  0.386528988 -1.046849050  0.244757230 -0.134786237 -0.877190806
 [41]  1.058591473  0.114524442 -1.225194214  2.016995922  1.176907268
 [46] -1.288145319 -1.176681708  0.908644201  0.498000740 -1.329940430
 [51]  1.441204801  0.751829111 -0.542716027 -2.308340070 -1.989403199
 [56]  1.389243651 -0.318430055  1.188256668 -0.807826227 -2.889623672
 [61]  0.129717106  0.099532475  0.287091277  1.749759649  0.279374823
 [66]  1.840241992 -0.437830404  0.184421574 -1.135889744  0.794544685
 [71]  0.434300805 -0.492853695  1.013126918  1.091264170  2.471021734
 [76] -0.656245019 -0.672239760 -1.129492915 -0.190381039 -0.522729846
 [81] -0.225740585 -2.563194897  2.134980841  1.466070149 -0.002441474
 [86] -0.343876269  0.023906468 -0.620276579  0.829511015  0.349827937
 [91]  0.053211026 -0.667710932  0.687660091  0.413408998 -0.022098922
 [96]  0.421644900  1.700879071  0.972746226 -2.509014467  0.009780414
> 
> colMeans(tmp2)
[1] 0.0233452
> colSums(tmp2)
[1] 2.33452
> colVars(tmp2)
[1] 1.171783
> colSd(tmp2)
[1] 1.082489
> colMax(tmp2)
[1] 2.471022
> colMin(tmp2)
[1] -2.889624
> colMedians(tmp2)
[1] 0.01684344
> colRanges(tmp2)
          [,1]
[1,] -2.889624
[2,]  2.471022
> 
> dataset1 <- matrix(dataset1,1,100)
> 
> agree.checks(tmp,dataset1)
> 
> dataset2 <- matrix(dataset2,100,1)
> agree.checks(tmp2,dataset2)
>   
> 
> tmp <- createBufferedMatrix(10,10)
> 
> tmp[1:10,1:10] <- rnorm(100)
> colApply(tmp,sum)
 [1] -2.76030783  1.85387447 -0.73600967  3.73665475  2.61023513 -0.52906915
 [7] -3.88177653 -2.00098979 -0.46242219  0.07007581
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -2.6183332
[2,] -0.9191822
[3,] -0.3178854
[4,]  0.5664576
[5,]  1.3663793
> 
> rowApply(tmp,sum)
 [1] -6.8789805  0.9230215  0.6960309  1.3247280 -5.9844772  2.5123945
 [7] -0.3819283  0.3778165  4.8070936  0.5045660
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    1    8    8    2    7    2    8    1    2    10
 [2,]    5    9    6    1    8   10    7   10    3     7
 [3,]    2    3   10   10    4    3    1    5    5     3
 [4,]    9    6    9    8    5    6    6    4    8     5
 [5,]    8    7    4    3   10    4   10    6    7     4
 [6,]    6    2    3    4    6    5    9    9    4     1
 [7,]   10    4    5    5    1    1    2    8    6     6
 [8,]    3    5    1    6    9    9    5    7   10     2
 [9,]    7   10    7    7    2    8    4    3    1     9
[10,]    4    1    2    9    3    7    3    2    9     8
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1]  4.9888404 -1.3823473  5.7196820  1.4932903 -1.8050747 -3.4923410
 [7]  1.3483006 -1.2214338  0.9016658 -0.5652086 -3.2208256  6.9070959
[13]  0.2086798 -1.0488994 -0.8206585  1.6659175  0.5156931 -3.3274206
[19]  0.1694588  2.3823543
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -0.6845238
[2,]  0.9973330
[3,]  1.1896813
[4,]  1.5860346
[5,]  1.9003152
> 
> rowApply(tmp,sum)
[1]  3.3040152  9.2944595 -1.2816330 -0.1876534 -1.7124194
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]    5   16   19   20   18
[2,]    7   14    2   13    8
[3,]   17   19   13   19   15
[4,]   20    6   16    9    7
[5,]    2    4    5   14   17
> 
> 
> as.matrix(tmp)
           [,1]        [,2]       [,3]       [,4]       [,5]       [,6]
[1,] -0.6845238 -0.52099852 1.36382338  2.1198352 -1.4339087 -0.6715987
[2,]  0.9973330  0.92334024 1.93076683 -0.2451073 -0.4956898  0.3137501
[3,]  1.5860346 -1.26809679 0.01057649  0.6231579 -1.0813786 -1.8915583
[4,]  1.9003152  0.05145372 1.79272081 -0.3815219  0.2582977 -1.9069310
[5,]  1.1896813 -0.56804597 0.62179449 -0.6230737  0.9476047  0.6639969
            [,7]       [,8]       [,9]       [,10]       [,11]     [,12]
[1,] -0.36976574  0.4829851  0.5647714  0.53286064 -0.77997591 0.2718572
[2,]  2.30537702  0.6459259  0.9697421  0.02824829 -0.61976999 1.9139025
[3,] -0.56009754 -0.3600118 -1.0713748  0.53571317 -0.07934573 2.1102007
[4,] -0.09625782 -0.7035575 -0.8909427  0.44254198 -0.61153758 1.1397789
[5,]  0.06904468 -1.2867756  1.3294697 -2.10457273 -1.13019643 1.4713567
           [,13]       [,14]      [,15]      [,16]      [,17]       [,18]
[1,]  1.76283552 -1.73325376  1.3906558  0.4956562  0.4597431 -0.78540152
[2,] -0.07467869  0.58896234 -1.1062050  1.1239298 -0.2638663 -0.74198243
[3,] -0.04816217  1.41733613 -1.0931402 -1.1673943  0.2259110 -0.23133341
[4,] -0.48808003 -0.02969943 -0.5146252  1.3164834 -0.5100423  0.02505338
[5,] -0.94323479 -1.29224468  0.5026561 -0.1027575  0.6039477 -1.59375662
          [,19]      [,20]
[1,]  0.7826302 0.05578803
[2,]  0.8638508 0.23663019
[3,] -0.4101659 1.47149660
[4,] -1.5760348 0.59493165
[5,]  0.5091785 0.02350785
> 
> 
> 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 :  649  bytes.
Disk usage :  200  bytes.
> subBufferedMatrix(tmp,,5:8)
BufferedMatrix object
Matrix size:  5 4 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  563  bytes.
Disk usage :  160  bytes.
> subBufferedMatrix(tmp,1:3,)
BufferedMatrix object
Matrix size:  3 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.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.1934751 1.390332 -0.6245899 1.774442 -1.403148 0.6437919 -0.3354652
           col8     col9      col10     col11    col12     col13      col14
row1 -0.1400864 1.061113 -0.7509705 -1.063901 1.413365 -1.599693 -0.1960182
         col15      col16     col17     col18     col19     col20
row1 0.3411939 -0.5463749 -1.293938 0.5278799 -0.242992 0.1842607
> tmp[,"col10"]
            col10
row1 -0.750970536
row2 -0.009259163
row3 -0.360167535
row4 -2.110184575
row5 -0.490877102
> tmp[c("row1","row5"),]
           col1      col2       col3     col4       col5       col6       col7
row1 -0.1934751 1.3903316 -0.6245899 1.774442 -1.4031483  0.6437919 -0.3354652
row5  0.3393170 0.5005943  0.2155613 2.071402 -0.1298506 -0.4192224 -0.1926035
           col8      col9      col10       col11      col12     col13
row1 -0.1400864 1.0611130 -0.7509705 -1.06390078 1.41336513 -1.599693
row5 -0.1823079 0.1773905 -0.4908771 -0.08997703 0.01650737 -0.359911
          col14     col15      col16      col17      col18      col19     col20
row1 -0.1960182 0.3411939 -0.5463749 -1.2939385  0.5278799 -0.2429920 0.1842607
row5  0.7518109 1.0510360  0.5108146  0.2710688 -1.5109564 -0.6672977 0.4835405
> tmp[,c("col6","col20")]
           col6      col20
row1  0.6437919  0.1842607
row2  1.4526485  0.6236176
row3 -0.3818453  0.5515134
row4  1.5846815 -0.3578084
row5 -0.4192224  0.4835405
> tmp[c("row1","row5"),c("col6","col20")]
           col6     col20
row1  0.6437919 0.1842607
row5 -0.4192224 0.4835405
> 
> 
> 
> 
> tmp["row1",] <- rnorm(20,mean=10)
> tmp[,"col10"] <- rnorm(5,mean=30)
> tmp[c("row1","row5"),] <- rnorm(40,mean=50)
> tmp[,c("col6","col20")] <- rnorm(10,mean=75)
> tmp[c("row1","row5"),c("col6","col20")]  <- rnorm(4,mean=105)
> 
> tmp["row1",]
        col1     col2     col3     col4     col5     col6     col7     col8
row1 48.1609 49.97035 49.39337 52.47213 50.68065 104.8153 51.21843 49.43453
         col9    col10   col11    col12    col13   col14   col15    col16
row1 48.14371 48.29816 50.1564 50.38376 50.62588 48.9022 49.9185 49.12568
        col17    col18    col19    col20
row1 50.75212 49.43568 47.67167 105.2121
> tmp[,"col10"]
        col10
row1 48.29816
row2 29.21584
row3 29.08324
row4 28.88618
row5 50.07045
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 48.16090 49.97035 49.39337 52.47213 50.68065 104.8153 51.21843 49.43453
row5 47.38464 51.12914 49.74793 49.17820 49.09129 103.4160 50.04344 50.28694
         col9    col10    col11    col12    col13    col14   col15    col16
row1 48.14371 48.29816 50.15640 50.38376 50.62588 48.90220 49.9185 49.12568
row5 49.70414 50.07045 48.23751 48.46671 48.93777 50.61809 51.4888 49.86845
        col17    col18    col19    col20
row1 50.75212 49.43568 47.67167 105.2121
row5 49.80843 50.53601 51.32582 105.5957
> tmp[,c("col6","col20")]
          col6     col20
row1 104.81530 105.21212
row2  74.11445  74.73592
row3  75.33264  75.03060
row4  74.64170  75.27619
row5 103.41602 105.59567
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 104.8153 105.2121
row5 103.4160 105.5957
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 104.8153 105.2121
row5 103.4160 105.5957
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
          col13
[1,] -0.1695858
[2,]  0.3711315
[3,] -0.8506665
[4,]  1.6435079
[5,]  2.2241375
> tmp[,c("col17","col7")]
           col17       col7
[1,] -0.01840163 -0.5108183
[2,]  0.45331726  0.5124735
[3,]  0.75973855  0.8776009
[4,] -0.10963137  0.4473261
[5,]  0.99061168  0.2465651
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
           col6      col20
[1,] -0.4724669 -1.1171922
[2,]  0.9586907 -0.7505321
[3,] -0.2390857 -0.5501943
[4,]  1.3956359  1.2285308
[5,] -0.1345147  0.5139646
> subBufferedMatrix(tmp,1,c("col6"))[,1]
           col1
[1,] -0.4724669
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
           col6
[1,] -0.4724669
[2,]  0.9586907
> 
> 
> 
> 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]
row3 -0.4063193  0.7992088 -0.93698028 -0.3385527 -1.8062309 -1.5205982
row1  0.9059050 -0.6819158  0.07088597  1.8477675 -0.3690454 -0.2419491
           [,7]       [,8]       [,9]     [,10]      [,11]     [,12]     [,13]
row3  0.6180941 -0.2899308 -0.9737575 -0.197625  0.3663301 0.5630790 0.4188058
row1 -1.1916514 -2.7517198 -0.3684207  1.232114 -0.7490245 0.0153192 0.9244464
          [,14]      [,15]      [,16]       [,17]      [,18]      [,19]
row3 -0.6675871 -0.5223952 -0.3883847 -1.57635436 -0.4337013 -0.3683053
row1  0.1194561 -0.1165421 -0.6067877 -0.07417176  0.1526776  1.3004173
          [,20]
row3  0.9002980
row1 -0.4886884
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
           [,1]       [,2]      [,3]     [,4]     [,5]      [,6]    [,7]
row2 -0.2926573 0.06861602 0.5552556 1.563884 1.879156 0.9439802 1.47774
           [,8]      [,9]    [,10]
row2 -0.8565675 0.8399576 1.492665
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
           [,1]       [,2]      [,3]     [,4]        [,5]      [,6]     [,7]
row5 -0.5475095 -0.5254279 0.9251613 1.587361 -0.05043592 0.5614599 -1.60448
           [,8]       [,9]     [,10]     [,11]    [,12]    [,13]     [,14]
row5 -0.6129035 -0.3703102 -0.760789 -0.644066 1.721319 2.001515 0.3138998
          [,15]      [,16]      [,17]     [,18]     [,19]      [,20]
row5 -0.2552079 -0.3895617 -0.2036389 0.5123627 0.4004575 0.09761244
> 
> 
> 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: 0x600001d34060>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM3cdb3d8bea30"
 [2] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM3cdb2cbc14e1"
 [3] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM3cdb6ffed6b8"
 [4] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM3cdb43c30379"
 [5] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM3cdb38191fb0"
 [6] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM3cdb796f7895"
 [7] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM3cdb555bc7c" 
 [8] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM3cdb3fc973a0"
 [9] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM3cdb42c62e17"
[10] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM3cdb60fc0a40"
[11] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM3cdb4305217e"
[12] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM3cdb5d9f992" 
[13] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM3cdb298fe33e"
[14] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM3cdb259010c3"
[15] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM3cdb153c8579"
> 
> 
> ### 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: 0x600001d60420>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x600001d60420>
Warning message:
In dir.create(new.directory) :
  '/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x600001d60420>
> rowMedians(tmp)
  [1]  0.181901907  0.089841551 -0.538835866  0.010408441  0.105003236
  [6] -0.175124913  0.103409832  0.088264590 -0.312591277  0.080989441
 [11] -0.114360072  0.290808572  0.192468850 -0.073096374 -0.057173344
 [16] -0.207709177 -0.089338675 -0.498074708  0.058694551  0.371375975
 [21] -0.135558590  0.387626140  0.155314075 -0.134632389 -0.538104840
 [26]  0.679621922  0.436952893  0.205971147  0.151639571  0.350884937
 [31] -0.366588351 -0.395139514  0.820320018  0.630662340  0.116683098
 [36] -0.617807524 -0.111922956  0.157057871  0.369122418  0.358704002
 [41] -0.018828083  0.048398869 -0.314260825  0.515442932  0.151299504
 [46] -0.115852767 -0.208474393  0.223502817 -0.015989536 -0.236060515
 [51]  0.070407620  0.164424054  0.052123557 -0.360138061 -0.001574299
 [56] -0.411656219  0.060918441  0.219414029  0.001614645 -0.381777837
 [61] -0.097011773  0.118190957 -0.032004070 -0.112643173 -0.024253338
 [66]  0.068722834 -0.097546117  0.023699350 -0.286453777 -0.496548427
 [71] -0.058533388 -0.365813809  0.333292484  0.080590615  0.238846125
 [76]  0.039567149 -0.396967686  0.214119805 -0.045256570  0.343338807
 [81]  0.151130494  0.057610734  0.078367615  0.245636619 -0.152071464
 [86]  0.086710885  0.248296842  0.031612678  0.107062402 -0.110160559
 [91] -0.418426423 -0.300551560 -0.394331971  0.114894305  0.374626671
 [96]  0.031192647  0.483437855 -0.146471588  0.353859184  0.374472036
[101]  0.150804734 -0.088972500 -0.076793755  0.114553998  0.175130763
[106] -0.290786385 -0.155823601 -0.631354690  0.718315388  0.471174411
[111]  0.723894789  0.146283100  0.549192019 -0.333800387 -0.271168057
[116]  0.044369006 -0.349392744  0.181353604  0.170066895 -0.019670169
[121]  0.272367240 -0.176899012 -0.347306181 -0.282855618  0.047459923
[126] -0.299128617  0.062768519  0.294009079  0.284237060 -0.420122629
[131] -0.403313129  0.233879315 -0.481915211 -0.134304800  0.576328731
[136]  0.262382930 -0.220316322 -0.045302960  0.498143881 -0.012032846
[141] -0.194349414 -0.213508663  0.020011931 -0.829104498  0.235945587
[146] -0.399369369  0.272506100 -0.484032937  0.459834639 -0.284856749
[151] -0.572355851 -0.385124288 -0.247995353  0.188512150 -0.053262965
[156] -0.164913444 -0.062205640  0.214276090  0.262102354 -0.276502580
[161]  0.022051232 -0.037163874  0.208870335 -0.235289785 -0.714848917
[166] -0.116283098 -0.311226159  0.522350160  0.256152693  0.145592044
[171]  0.110396501 -0.018808796 -0.040681613  0.147253689 -0.455686969
[176]  0.192501757 -0.339812305  0.005553184  0.165859317  0.368367594
[181] -0.130714879 -0.073331567 -0.370307505  0.276002025  0.011915289
[186]  0.093100087  0.396401348  0.279743578  0.234580428 -0.699609056
[191]  0.321873847  0.026876243  0.421142907  0.265530830  0.598273191
[196] -0.327621629 -0.041216098 -0.449349391  0.060133598  0.435539552
[201]  0.079672880  0.348864150 -0.403953127 -0.277264336 -0.068687635
[206]  0.105125651 -0.161788485  0.242877566 -0.385777931 -0.678181012
[211]  0.049299458  0.163528001  0.144758847 -0.309937777  0.057672901
[216] -0.201420841 -0.195488365 -0.163777906  0.076531770 -0.457934577
[221]  0.251305464 -0.278253585  0.184223254 -0.216175727 -0.262923405
[226]  0.056933031  0.576805235  0.050923978  0.358697818 -0.525916632
> 
> proc.time()
   user  system elapsed 
  2.747  15.837  82.244 

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: 0x60000133c000>
> .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: 0x60000133c000>
> .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: 0x60000133c000>
> .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: 0x60000133c000>
> 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: 0x600001330000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600001330000>
> .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: 0x600001330000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600001330000>
> .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: 0x600001330000>
> 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: 0x600001334000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600001334000>
> .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: 0x600001334000>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x600001334000>
> .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: 0x600001334000>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x600001334000>
> .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: 0x600001334000>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x600001334000>
> .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: 0x600001334000>
> 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: 0x600001304120>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x600001304120>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600001304120>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600001304120>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile4ecf5daef4a1" "BufferedMatrixFile4ecf93ea614" 
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile4ecf5daef4a1" "BufferedMatrixFile4ecf93ea614" 
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x600001338120>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600001338120>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x600001338120>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x600001338120>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x600001338120>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x600001338120>
> .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: 0x600001348000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600001348000>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x600001348000>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x600001348000>
> 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: 0x600001348180>
> .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: 0x600001348180>
> rm(P)
> 
> proc.time()
   user  system elapsed 
  0.336   0.134   0.464 

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.343   0.091   0.431 

Example timings