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

This page was generated on 2025-09-26 12:05 -0400 (Fri, 26 Sep 2025).

HostnameOSArch (*)R versionInstalled pkgs
nebbiolo2Linux (Ubuntu 24.04.3 LTS)x86_644.5.1 Patched (2025-08-23 r88802) -- "Great Square Root" 4831
lconwaymacOS 12.7.1 Montereyx86_644.5.1 Patched (2025-09-10 r88807) -- "Great Square Root" 4619
kjohnson3macOS 13.7.7 Venturaarm644.5.1 Patched (2025-09-10 r88807) -- "Great Square Root" 4563
taishanLinux (openEuler 24.03 LTS)aarch644.5.0 (2025-04-11) -- "How About a Twenty-Six" 4563
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 253/2334HostnameOS / ArchINSTALLBUILDCHECKBUILD BIN
BufferedMatrix 1.73.0  (landing page)
Ben Bolstad
Snapshot Date: 2025-09-25 13:45 -0400 (Thu, 25 Sep 2025)
git_url: https://git.bioconductor.org/packages/BufferedMatrix
git_branch: devel
git_last_commit: 0147962
git_last_commit_date: 2025-04-15 09:39:39 -0400 (Tue, 15 Apr 2025)
nebbiolo2Linux (Ubuntu 24.04.3 LTS) / x86_64  OK    OK    OK  UNNEEDED, same version is already published
lconwaymacOS 12.7.1 Monterey / x86_64  OK    OK    WARNINGS    OK  UNNEEDED, same version is already published
kjohnson3macOS 13.7.7 Ventura / arm64  OK    OK    WARNINGS    OK  UNNEEDED, same version is already published
taishanLinux (openEuler 24.03 LTS) / aarch64  OK    OK    OK  


CHECK results for BufferedMatrix on kjohnson3

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

raw results


Summary

Package: BufferedMatrix
Version: 1.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-09-25 18:30:33 -0400 (Thu, 25 Sep 2025)
EndedAt: 2025-09-25 18:30:50 -0400 (Thu, 25 Sep 2025)
EllapsedTime: 16.2 seconds
RetCode: 0
Status:   WARNINGS  
CheckDir: BufferedMatrix.Rcheck
Warnings: 1

Command output

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


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

Tests output

BufferedMatrix.Rcheck/tests/c_code_level_tests.Rout


R version 4.5.1 Patched (2025-09-10 r88807) -- "Great Square Root"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: aarch64-apple-darwin20

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

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

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

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

Attaching package: 'BufferedMatrix'

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

    colMeans, colSums, rowMeans, rowSums

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

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

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

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

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

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

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

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

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

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

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

[[1]]
[1] 0

> 
> proc.time()
   user  system elapsed 
  0.118   0.041   0.151 

BufferedMatrix.Rcheck/tests/objectTesting.Rout


R version 4.5.1 Patched (2025-09-10 r88807) -- "Great Square Root"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: aarch64-apple-darwin20

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

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

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

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

Attaching package: 'BufferedMatrix'

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

    colMeans, colSums, rowMeans, rowSums

> 
> 
> ### this is used to control how many repetitions in something below
> ### higher values result in more checks.
> nreps <-100 ##20000
> 
> 
> ## test creation and some simple assignments and subsetting operations
> 
> ## first on single elements
> tmp <- createBufferedMatrix(1000,10)
> 
> tmp[10,5]
[1] 0
> tmp[10,5] <- 10
> tmp[10,5]
[1] 10
> tmp[10,5] <- 12.445
> tmp[10,5]
[1] 12.445
> 
> 
> 
> ## now testing accessing multiple elements
> tmp2 <- createBufferedMatrix(10,20)
> 
> 
> tmp2[3,1] <- 51.34
> tmp2[9,2] <- 9.87654
> tmp2[,1:2]
       [,1]    [,2]
 [1,]  0.00 0.00000
 [2,]  0.00 0.00000
 [3,] 51.34 0.00000
 [4,]  0.00 0.00000
 [5,]  0.00 0.00000
 [6,]  0.00 0.00000
 [7,]  0.00 0.00000
 [8,]  0.00 0.00000
 [9,]  0.00 9.87654
[10,]  0.00 0.00000
> tmp2[,-(3:20)]
       [,1]    [,2]
 [1,]  0.00 0.00000
 [2,]  0.00 0.00000
 [3,] 51.34 0.00000
 [4,]  0.00 0.00000
 [5,]  0.00 0.00000
 [6,]  0.00 0.00000
 [7,]  0.00 0.00000
 [8,]  0.00 0.00000
 [9,]  0.00 9.87654
[10,]  0.00 0.00000
> tmp2[3,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
[1,] 51.34    0    0    0    0    0    0    0    0     0     0     0     0
     [,14] [,15] [,16] [,17] [,18] [,19] [,20]
[1,]     0     0     0     0     0     0     0
> tmp2[-3,]
      [,1]    [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [2,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [3,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [4,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [5,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [6,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [7,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [8,]    0 9.87654    0    0    0    0    0    0    0     0     0     0     0
 [9,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
      [,14] [,15] [,16] [,17] [,18] [,19] [,20]
 [1,]     0     0     0     0     0     0     0
 [2,]     0     0     0     0     0     0     0
 [3,]     0     0     0     0     0     0     0
 [4,]     0     0     0     0     0     0     0
 [5,]     0     0     0     0     0     0     0
 [6,]     0     0     0     0     0     0     0
 [7,]     0     0     0     0     0     0     0
 [8,]     0     0     0     0     0     0     0
 [9,]     0     0     0     0     0     0     0
> tmp2[2,1:3]
     [,1] [,2] [,3]
[1,]    0    0    0
> tmp2[3:9,1:3]
      [,1]    [,2] [,3]
[1,] 51.34 0.00000    0
[2,]  0.00 0.00000    0
[3,]  0.00 0.00000    0
[4,]  0.00 0.00000    0
[5,]  0.00 0.00000    0
[6,]  0.00 0.00000    0
[7,]  0.00 9.87654    0
> tmp2[-4,-4]
       [,1]    [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [2,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [3,] 51.34 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [4,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [5,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [6,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [7,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [8,]  0.00 9.87654    0    0    0    0    0    0    0     0     0     0     0
 [9,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
      [,14] [,15] [,16] [,17] [,18] [,19]
 [1,]     0     0     0     0     0     0
 [2,]     0     0     0     0     0     0
 [3,]     0     0     0     0     0     0
 [4,]     0     0     0     0     0     0
 [5,]     0     0     0     0     0     0
 [6,]     0     0     0     0     0     0
 [7,]     0     0     0     0     0     0
 [8,]     0     0     0     0     0     0
 [9,]     0     0     0     0     0     0
> 
> ## now testing accessing/assigning multiple elements
> tmp3 <- createBufferedMatrix(10,10)
> 
> for (i in 1:10){
+   for (j in 1:10){
+     tmp3[i,j] <- (j-1)*10 + i
+   }
+ }
> 
> tmp3[2:4,2:4]
     [,1] [,2] [,3]
[1,]   12   22   32
[2,]   13   23   33
[3,]   14   24   34
> tmp3[c(-10),c(2:4,2:4,10,1,2,1:10,10:1)]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]   11   21   31   11   21   31   91    1   11     1    11    21    31
 [2,]   12   22   32   12   22   32   92    2   12     2    12    22    32
 [3,]   13   23   33   13   23   33   93    3   13     3    13    23    33
 [4,]   14   24   34   14   24   34   94    4   14     4    14    24    34
 [5,]   15   25   35   15   25   35   95    5   15     5    15    25    35
 [6,]   16   26   36   16   26   36   96    6   16     6    16    26    36
 [7,]   17   27   37   17   27   37   97    7   17     7    17    27    37
 [8,]   18   28   38   18   28   38   98    8   18     8    18    28    38
 [9,]   19   29   39   19   29   39   99    9   19     9    19    29    39
      [,14] [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24] [,25]
 [1,]    41    51    61    71    81    91    91    81    71    61    51    41
 [2,]    42    52    62    72    82    92    92    82    72    62    52    42
 [3,]    43    53    63    73    83    93    93    83    73    63    53    43
 [4,]    44    54    64    74    84    94    94    84    74    64    54    44
 [5,]    45    55    65    75    85    95    95    85    75    65    55    45
 [6,]    46    56    66    76    86    96    96    86    76    66    56    46
 [7,]    47    57    67    77    87    97    97    87    77    67    57    47
 [8,]    48    58    68    78    88    98    98    88    78    68    58    48
 [9,]    49    59    69    79    89    99    99    89    79    69    59    49
      [,26] [,27] [,28] [,29]
 [1,]    31    21    11     1
 [2,]    32    22    12     2
 [3,]    33    23    13     3
 [4,]    34    24    14     4
 [5,]    35    25    15     5
 [6,]    36    26    16     6
 [7,]    37    27    17     7
 [8,]    38    28    18     8
 [9,]    39    29    19     9
> tmp3[-c(1:5),-c(6:10)]
     [,1] [,2] [,3] [,4] [,5]
[1,]    6   16   26   36   46
[2,]    7   17   27   37   47
[3,]    8   18   28   38   48
[4,]    9   19   29   39   49
[5,]   10   20   30   40   50
> 
> ## assignment of whole columns
> tmp3[,1] <- c(1:10*100.0)
> tmp3[,1:2] <- tmp3[,1:2]*100
> tmp3[,1:2] <- tmp3[,2:1]
> tmp3[,1:2]
      [,1]  [,2]
 [1,] 1100 1e+04
 [2,] 1200 2e+04
 [3,] 1300 3e+04
 [4,] 1400 4e+04
 [5,] 1500 5e+04
 [6,] 1600 6e+04
 [7,] 1700 7e+04
 [8,] 1800 8e+04
 [9,] 1900 9e+04
[10,] 2000 1e+05
> 
> 
> tmp3[,-1] <- tmp3[,1:9]
> tmp3[,1:10]
      [,1] [,2]  [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,] 1100 1100 1e+04   21   31   41   51   61   71    81
 [2,] 1200 1200 2e+04   22   32   42   52   62   72    82
 [3,] 1300 1300 3e+04   23   33   43   53   63   73    83
 [4,] 1400 1400 4e+04   24   34   44   54   64   74    84
 [5,] 1500 1500 5e+04   25   35   45   55   65   75    85
 [6,] 1600 1600 6e+04   26   36   46   56   66   76    86
 [7,] 1700 1700 7e+04   27   37   47   57   67   77    87
 [8,] 1800 1800 8e+04   28   38   48   58   68   78    88
 [9,] 1900 1900 9e+04   29   39   49   59   69   79    89
[10,] 2000 2000 1e+05   30   40   50   60   70   80    90
> 
> tmp3[,1:2] <- rep(1,10)
> tmp3[,1:2] <- rep(1,20)
> tmp3[,1:2] <- matrix(c(1:5),1,5)
> 
> tmp3[,-c(1:8)] <- matrix(c(1:5),1,5)
> 
> tmp3[1,] <- 1:10
> tmp3[1,]
     [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,]    1    2    3    4    5    6    7    8    9    10
> tmp3[-1,] <- c(1,2)
> tmp3[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    1    2    3    4    5    6    7    8    9    10
 [2,]    1    2    1    2    1    2    1    2    1     2
 [3,]    2    1    2    1    2    1    2    1    2     1
 [4,]    1    2    1    2    1    2    1    2    1     2
 [5,]    2    1    2    1    2    1    2    1    2     1
 [6,]    1    2    1    2    1    2    1    2    1     2
 [7,]    2    1    2    1    2    1    2    1    2     1
 [8,]    1    2    1    2    1    2    1    2    1     2
 [9,]    2    1    2    1    2    1    2    1    2     1
[10,]    1    2    1    2    1    2    1    2    1     2
> tmp3[-c(1:8),] <- matrix(c(1:5),1,5)
> tmp3[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    1    2    3    4    5    6    7    8    9    10
 [2,]    1    2    1    2    1    2    1    2    1     2
 [3,]    2    1    2    1    2    1    2    1    2     1
 [4,]    1    2    1    2    1    2    1    2    1     2
 [5,]    2    1    2    1    2    1    2    1    2     1
 [6,]    1    2    1    2    1    2    1    2    1     2
 [7,]    2    1    2    1    2    1    2    1    2     1
 [8,]    1    2    1    2    1    2    1    2    1     2
 [9,]    1    3    5    2    4    1    3    5    2     4
[10,]    2    4    1    3    5    2    4    1    3     5
> 
> 
> tmp3[1:2,1:2] <- 5555.04
> tmp3[-(1:2),1:2] <- 1234.56789
> 
> 
> 
> ## testing accessors for the directory and prefix
> directory(tmp3)
[1] "/Users/biocbuild/bbs-3.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 480828 25.7    1056624 56.5         NA   634340 33.9
Vcells 891019  6.8    8388608 64.0     196608  2109889 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] "Thu Sep 25 18:30:42 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] "Thu Sep 25 18:30:42 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: 0x600003834000>
> 
> 
> 
> 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] "Thu Sep 25 18:30:43 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] "Thu Sep 25 18:30:44 2025"
> 
> ColMode(tmp2)
<pointer: 0x600003834000>
> 
> 
> 
> ### 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.0617910 -0.2953550  0.4998150 -2.3199345
[2,]   2.2186682 -0.3646605 -0.2665948  1.0098755
[3,]  -0.3893817 -0.1311281  1.4221167 -0.8487052
[4,]  -0.9443724 -0.5983828  0.2225003 -0.6895484
> 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.0617910 0.2953550 0.4998150 2.3199345
[2,]   2.2186682 0.3646605 0.2665948 1.0098755
[3,]   0.3893817 0.1311281 1.4221167 0.8487052
[4,]   0.9443724 0.5983828 0.2225003 0.6895484
> 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.0030891 0.5434657 0.7069759 1.5231331
[2,]  1.4895194 0.6038713 0.5163282 1.0049256
[3,]  0.6240046 0.3621161 1.1925254 0.9212519
[4,]  0.9717883 0.7735521 0.4716993 0.8303905
> 
> 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.09268 30.73001 32.56957 42.55127
[2,]  42.11386 31.40337 30.42988 36.05913
[3,]  31.62943 28.75229 38.34737 35.06122
[4,]  35.66225 33.33390 29.93949 33.99345
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x600003838000>
> exp(tmp5)
<pointer: 0x600003838000>
> log(tmp5,2)
<pointer: 0x600003838000>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 468.5009
> Min(tmp5)
[1] 52.74109
> mean(tmp5)
[1] 73.80755
> Sum(tmp5)
[1] 14761.51
> Var(tmp5)
[1] 863.4094
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 92.89536 70.70754 71.43816 70.19301 71.59492 74.02101 70.49762 75.50683
 [9] 70.99793 70.22308
> rowSums(tmp5)
 [1] 1857.907 1414.151 1428.763 1403.860 1431.898 1480.420 1409.952 1510.137
 [9] 1419.959 1404.462
> rowVars(tmp5)
 [1] 7915.25480   71.37397   49.36287   46.97047  104.59465   50.82745
 [7]  104.41937  121.24291   51.88991   72.23511
> rowSd(tmp5)
 [1] 88.967718  8.448312  7.025871  6.853501 10.227153  7.129337 10.218580
 [8] 11.011036  7.203465  8.499124
> rowMax(tmp5)
 [1] 468.50093  87.65449  80.89598  84.49944  88.48817  87.44036  97.05966
 [8]  99.89707  81.43824  89.31180
> rowMin(tmp5)
 [1] 57.61074 52.74109 59.84412 60.68370 55.20915 61.20069 56.70836 59.38893
 [9] 56.05977 55.05292
> 
> colMeans(tmp5)
 [1] 112.49748  66.01333  73.73151  71.69078  74.15045  69.05102  75.98587
 [8]  67.06543  76.33512  72.10907  73.33837  74.55334  74.52721  67.52116
[15]  71.94648  68.83545  71.43079  72.82915  70.60310  71.93582
> colSums(tmp5)
 [1] 1124.9748  660.1333  737.3151  716.9078  741.5045  690.5102  759.8587
 [8]  670.6543  763.3512  721.0907  733.3837  745.5334  745.2721  675.2116
[15]  719.4648  688.3545  714.3079  728.2915  706.0310  719.3582
> colVars(tmp5)
 [1] 15724.91512    56.06325   126.73900    80.48713    47.28537    64.71289
 [7]    46.76690    75.23416    63.37428   164.45139    87.39813    81.83750
[13]    61.41546    75.06361    90.47221    60.23911    27.23464    85.66516
[19]    47.50546    97.70169
> colSd(tmp5)
 [1] 125.399024   7.487539  11.257842   8.971462   6.876436   8.044432
 [7]   6.838633   8.673763   7.960797  12.823860   9.348697   9.046408
[13]   7.836802   8.663926   9.511688   7.761386   5.218682   9.255548
[19]   6.892420   9.884416
> colMax(tmp5)
 [1] 468.50093  80.48293  97.05966  88.56488  84.73594  81.43824  86.92110
 [8]  83.71187  88.48817  99.89707  89.69748  90.25816  92.59210  79.86431
[15]  89.35620  78.95006  78.33905  87.44036  81.49174  84.49944
> colMin(tmp5)
 [1] 59.05514 55.20915 60.41731 55.64013 59.38893 57.61074 64.37326 55.24221
 [9] 61.93172 60.68370 61.68674 56.70836 66.40504 55.05292 59.99252 52.74109
[17] 65.08772 56.05977 60.80424 55.81531
> 
> 
> ### 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] 92.89536 70.70754 71.43816 70.19301 71.59492 74.02101 70.49762 75.50683
 [9] 70.99793       NA
> rowSums(tmp5)
 [1] 1857.907 1414.151 1428.763 1403.860 1431.898 1480.420 1409.952 1510.137
 [9] 1419.959       NA
> rowVars(tmp5)
 [1] 7915.25480   71.37397   49.36287   46.97047  104.59465   50.82745
 [7]  104.41937  121.24291   51.88991   75.32865
> rowSd(tmp5)
 [1] 88.967718  8.448312  7.025871  6.853501 10.227153  7.129337 10.218580
 [8] 11.011036  7.203465  8.679208
> rowMax(tmp5)
 [1] 468.50093  87.65449  80.89598  84.49944  88.48817  87.44036  97.05966
 [8]  99.89707  81.43824        NA
> rowMin(tmp5)
 [1] 57.61074 52.74109 59.84412 60.68370 55.20915 61.20069 56.70836 59.38893
 [9] 56.05977       NA
> 
> colMeans(tmp5)
 [1] 112.49748  66.01333  73.73151  71.69078  74.15045  69.05102  75.98587
 [8]  67.06543  76.33512  72.10907  73.33837  74.55334  74.52721  67.52116
[15]  71.94648  68.83545  71.43079        NA  70.60310  71.93582
> colSums(tmp5)
 [1] 1124.9748  660.1333  737.3151  716.9078  741.5045  690.5102  759.8587
 [8]  670.6543  763.3512  721.0907  733.3837  745.5334  745.2721  675.2116
[15]  719.4648  688.3545  714.3079        NA  706.0310  719.3582
> colVars(tmp5)
 [1] 15724.91512    56.06325   126.73900    80.48713    47.28537    64.71289
 [7]    46.76690    75.23416    63.37428   164.45139    87.39813    81.83750
[13]    61.41546    75.06361    90.47221    60.23911    27.23464          NA
[19]    47.50546    97.70169
> colSd(tmp5)
 [1] 125.399024   7.487539  11.257842   8.971462   6.876436   8.044432
 [7]   6.838633   8.673763   7.960797  12.823860   9.348697   9.046408
[13]   7.836802   8.663926   9.511688   7.761386   5.218682         NA
[19]   6.892420   9.884416
> colMax(tmp5)
 [1] 468.50093  80.48293  97.05966  88.56488  84.73594  81.43824  86.92110
 [8]  83.71187  88.48817  99.89707  89.69748  90.25816  92.59210  79.86431
[15]  89.35620  78.95006  78.33905        NA  81.49174  84.49944
> colMin(tmp5)
 [1] 59.05514 55.20915 60.41731 55.64013 59.38893 57.61074 64.37326 55.24221
 [9] 61.93172 60.68370 61.68674 56.70836 66.40504 55.05292 59.99252 52.74109
[17] 65.08772       NA 60.80424 55.81531
> 
> Max(tmp5,na.rm=TRUE)
[1] 468.5009
> Min(tmp5,na.rm=TRUE)
[1] 52.74109
> mean(tmp5,na.rm=TRUE)
[1] 73.80563
> Sum(tmp5,na.rm=TRUE)
[1] 14687.32
> Var(tmp5,na.rm=TRUE)
[1] 867.7693
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 92.89536 70.70754 71.43816 70.19301 71.59492 74.02101 70.49762 75.50683
 [9] 70.99793 70.01438
> rowSums(tmp5,na.rm=TRUE)
 [1] 1857.907 1414.151 1428.763 1403.860 1431.898 1480.420 1409.952 1510.137
 [9] 1419.959 1330.273
> rowVars(tmp5,na.rm=TRUE)
 [1] 7915.25480   71.37397   49.36287   46.97047  104.59465   50.82745
 [7]  104.41937  121.24291   51.88991   75.32865
> rowSd(tmp5,na.rm=TRUE)
 [1] 88.967718  8.448312  7.025871  6.853501 10.227153  7.129337 10.218580
 [8] 11.011036  7.203465  8.679208
> rowMax(tmp5,na.rm=TRUE)
 [1] 468.50093  87.65449  80.89598  84.49944  88.48817  87.44036  97.05966
 [8]  99.89707  81.43824  89.31180
> rowMin(tmp5,na.rm=TRUE)
 [1] 57.61074 52.74109 59.84412 60.68370 55.20915 61.20069 56.70836 59.38893
 [9] 56.05977 55.05292
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 112.49748  66.01333  73.73151  71.69078  74.15045  69.05102  75.98587
 [8]  67.06543  76.33512  72.10907  73.33837  74.55334  74.52721  67.52116
[15]  71.94648  68.83545  71.43079  72.67813  70.60310  71.93582
> colSums(tmp5,na.rm=TRUE)
 [1] 1124.9748  660.1333  737.3151  716.9078  741.5045  690.5102  759.8587
 [8]  670.6543  763.3512  721.0907  733.3837  745.5334  745.2721  675.2116
[15]  719.4648  688.3545  714.3079  654.1031  706.0310  719.3582
> colVars(tmp5,na.rm=TRUE)
 [1] 15724.91512    56.06325   126.73900    80.48713    47.28537    64.71289
 [7]    46.76690    75.23416    63.37428   164.45139    87.39813    81.83750
[13]    61.41546    75.06361    90.47221    60.23911    27.23464    96.11671
[19]    47.50546    97.70169
> colSd(tmp5,na.rm=TRUE)
 [1] 125.399024   7.487539  11.257842   8.971462   6.876436   8.044432
 [7]   6.838633   8.673763   7.960797  12.823860   9.348697   9.046408
[13]   7.836802   8.663926   9.511688   7.761386   5.218682   9.803913
[19]   6.892420   9.884416
> colMax(tmp5,na.rm=TRUE)
 [1] 468.50093  80.48293  97.05966  88.56488  84.73594  81.43824  86.92110
 [8]  83.71187  88.48817  99.89707  89.69748  90.25816  92.59210  79.86431
[15]  89.35620  78.95006  78.33905  87.44036  81.49174  84.49944
> colMin(tmp5,na.rm=TRUE)
 [1] 59.05514 55.20915 60.41731 55.64013 59.38893 57.61074 64.37326 55.24221
 [9] 61.93172 60.68370 61.68674 56.70836 66.40504 55.05292 59.99252 52.74109
[17] 65.08772 56.05977 60.80424 55.81531
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1] 92.89536 70.70754 71.43816 70.19301 71.59492 74.02101 70.49762 75.50683
 [9] 70.99793      NaN
> rowSums(tmp5,na.rm=TRUE)
 [1] 1857.907 1414.151 1428.763 1403.860 1431.898 1480.420 1409.952 1510.137
 [9] 1419.959    0.000
> rowVars(tmp5,na.rm=TRUE)
 [1] 7915.25480   71.37397   49.36287   46.97047  104.59465   50.82745
 [7]  104.41937  121.24291   51.88991         NA
> rowSd(tmp5,na.rm=TRUE)
 [1] 88.967718  8.448312  7.025871  6.853501 10.227153  7.129337 10.218580
 [8] 11.011036  7.203465        NA
> rowMax(tmp5,na.rm=TRUE)
 [1] 468.50093  87.65449  80.89598  84.49944  88.48817  87.44036  97.05966
 [8]  99.89707  81.43824        NA
> rowMin(tmp5,na.rm=TRUE)
 [1] 57.61074 52.74109 59.84412 60.68370 55.20915 61.20069 56.70836 59.38893
 [9] 56.05977       NA
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1] 116.88658  65.72543  74.10093  71.34804  74.57899  68.22200  75.62966
 [8]  68.37912  77.93550  70.19765  73.39733  74.40026  74.24205  68.90652
[15]  72.17389  68.74082  72.09335       NaN  70.75319  73.72699
> colSums(tmp5,na.rm=TRUE)
 [1] 1051.9792  591.5288  666.9084  642.1324  671.2109  613.9980  680.6669
 [8]  615.4121  701.4195  631.7789  660.5760  669.6023  668.1784  620.1587
[15]  649.5650  618.6674  648.8401    0.0000  636.7787  663.5429
> colVars(tmp5,na.rm=TRUE)
 [1] 17473.80755    62.13863   141.04606    89.22649    51.13002    65.07017
 [7]    51.18527    65.22335    42.48248   143.90585    98.28379    91.80356
[13]    68.17759    62.85531   101.19945    67.66825    25.70038          NA
[19]    53.19021    73.82122
> colSd(tmp5,na.rm=TRUE)
 [1] 132.188530   7.882806  11.876282   9.445977   7.150526   8.066608
 [7]   7.154388   8.076097   6.517859  11.996077   9.913818   9.581417
[13]   8.256972   7.928134  10.059794   8.226071   5.069554         NA
[19]   7.293162   8.591928
> colMax(tmp5,na.rm=TRUE)
 [1] 468.50093  80.48293  97.05966  88.56488  84.73594  81.43824  86.92110
 [8]  83.71187  88.48817  99.89707  89.69748  90.25816  92.59210  79.86431
[15]  89.35620  78.95006  78.33905      -Inf  81.49174  84.49944
> colMin(tmp5,na.rm=TRUE)
 [1] 59.05514 55.20915 60.41731 55.64013 59.38893 57.61074 64.37326 59.97544
 [9] 67.85041 60.68370 61.68674 56.70836 66.40504 61.58017 59.99252 52.74109
[17] 65.08772      Inf 60.80424 60.62579
> 
> 
> 
> 
> copymatrix <- matrix(rnorm(200,150,15),10,20)
> 
> tmp5[1:10,1:20] <- copymatrix
> which.row <- 3
> which.col  <- 1
> cat(which.row," ",which.col,"\n")
3   1 
> tmp5[which.row,which.col] <- NA
> copymatrix[which.row,which.col] <- NA
> 
> rowVars(tmp5,na.rm=TRUE)
 [1] 152.7432 226.8790 247.9143 289.4254 202.2226 326.0759 216.1514 215.9299
 [9] 252.2250 237.3723
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 152.7432 226.8790 247.9143 289.4254 202.2226 326.0759 216.1514 215.9299
 [9] 252.2250 237.3723
> 
> 
> 
> 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]  5.684342e-14 -1.136868e-13  2.842171e-14  0.000000e+00  5.684342e-14
 [6]  0.000000e+00  0.000000e+00  0.000000e+00 -8.526513e-14  5.684342e-14
[11]  1.136868e-13 -1.421085e-14  1.421085e-14 -1.278977e-13 -1.136868e-13
[16]  0.000000e+00 -5.684342e-14 -5.684342e-14 -2.842171e-14  0.000000e+00
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> ## making sure these things agree
> ##
> ## first when there is no NA
> 
> 
> 
> agree.checks <- function(buff.matrix,r.matrix,err.tol=1e-10){
+ 
+   if (Max(buff.matrix,na.rm=TRUE) != max(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Max")
+   }
+   
+ 
+   if (Min(buff.matrix,na.rm=TRUE) != min(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Min")
+   }
+ 
+ 
+   if (abs(Sum(buff.matrix,na.rm=TRUE)- sum(r.matrix,na.rm=TRUE)) > err.tol){
+ 
+     cat(Sum(buff.matrix,na.rm=TRUE),"\n")
+     cat(sum(r.matrix,na.rm=TRUE),"\n")
+     cat(Sum(buff.matrix,na.rm=TRUE) - sum(r.matrix,na.rm=TRUE),"\n")
+     
+     stop("No agreement in Sum")
+   }
+   
+   if (abs(mean(buff.matrix,na.rm=TRUE) - mean(r.matrix,na.rm=TRUE)) > err.tol){
+     stop("No agreement in mean")
+   }
+   
+   
+   if(abs(Var(buff.matrix,na.rm=TRUE) - var(as.vector(r.matrix),na.rm=TRUE)) > err.tol){
+     stop("No agreement in Var")
+   }
+   
+   
+ 
+   if(any(abs(rowMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,mean,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowMeans")
+   }
+   
+   
+   if(any(abs(colMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,mean,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colMeans")
+   }
+   
+   
+   if(any(abs(rowSums(buff.matrix,na.rm=TRUE)  -  apply(r.matrix,1,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in rowSums")
+   }
+   
+   
+   if(any(abs(colSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colSums")
+   }
+   
+   ### this is to get around the fact that R doesn't like to compute NA on an entire vector of NA when 
+   ### computing variance
+   my.Var <- function(x,na.rm=FALSE){
+    if (all(is.na(x))){
+      return(NA)
+    } else {
+      var(x,na.rm=na.rm)
+    }
+ 
+   }
+   
+   if(any(abs(rowVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+   
+   
+   if(any(abs(colVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+ 
+ 
+   if(any(abs(rowMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+ 
+   if(any(abs(colMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+   
+   
+   if(any(abs(rowMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+   
+ 
+   if(any(abs(colMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+ 
+   if(any(abs(colMedians(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,median,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMedian")
+   }
+ 
+   if(any(abs(colRanges(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,range,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colRanges")
+   }
+ 
+ 
+   
+ }
> 
> 
> 
> 
> 
> 
> 
> 
> 
> for (rep in 1:20){
+   copymatrix <- matrix(rnorm(200,150,15),10,20)
+   
+   tmp5[1:10,1:20] <- copymatrix
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ## now lets assign some NA values and check agreement
+ 
+   which.row <- sample(1:10,1,replace=TRUE)
+   which.col  <- sample(1:20,1,replace=TRUE)
+   
+   cat(which.row," ",which.col,"\n")
+   
+   tmp5[which.row,which.col] <- NA
+   copymatrix[which.row,which.col] <- NA
+   
+   agree.checks(tmp5,copymatrix)
+ 
+   ## make an entire row NA
+   tmp5[which.row,] <- NA
+   copymatrix[which.row,] <- NA
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ### also make an entire col NA
+   tmp5[,which.col] <- NA
+   copymatrix[,which.col] <- NA
+ 
+   agree.checks(tmp5,copymatrix)
+ 
+   ### now make 1 element non NA with NA in the rest of row and column
+ 
+   tmp5[which.row,which.col] <- rnorm(1,150,15)
+   copymatrix[which.row,which.col] <- tmp5[which.row,which.col]
+ 
+   agree.checks(tmp5,copymatrix)
+ }
3   18 
1   13 
1   4 
6   10 
10   7 
5   4 
6   9 
4   4 
8   19 
6   20 
2   9 
7   6 
8   19 
4   14 
10   15 
9   13 
6   4 
9   16 
7   16 
8   18 
There were 50 or more warnings (use warnings() to see the first 50)
> 
> 
> ### now test 1 by n and n by 1 matrix
> 
> 
> err.tol <- 1e-12
> 
> rm(tmp5)
> 
> dataset1 <- rnorm(100)
> dataset2 <- rnorm(100)
> 
> tmp <- createBufferedMatrix(1,100)
> tmp[1,] <- dataset1
> 
> tmp2 <- createBufferedMatrix(100,1)
> tmp2[,1] <- dataset2
> 
> 
> 
> 
> 
> Max(tmp)
[1] 2.786058
> Min(tmp)
[1] -2.131211
> mean(tmp)
[1] 0.19039
> Sum(tmp)
[1] 19.039
> Var(tmp)
[1] 0.9573654
> 
> rowMeans(tmp)
[1] 0.19039
> rowSums(tmp)
[1] 19.039
> rowVars(tmp)
[1] 0.9573654
> rowSd(tmp)
[1] 0.9784505
> rowMax(tmp)
[1] 2.786058
> rowMin(tmp)
[1] -2.131211
> 
> colMeans(tmp)
  [1] -1.665751126 -0.316366260 -0.532861132 -0.303276184  0.371497608
  [6]  1.214231159  0.825315975  0.357026122 -0.442626599  0.447311342
 [11] -0.499286148 -0.916596244 -1.143654983  0.827363718  0.007419401
 [16] -0.081528769  1.379412700  1.168347834  0.147162764 -0.081023213
 [21]  0.685578027  1.784654037  1.244884780 -0.087355257  0.447419828
 [26]  0.186656907 -1.132297893  1.355469478  0.106478880  0.260433944
 [31]  2.384199744 -0.050577865 -1.253973789  0.131590844 -0.646930134
 [36]  0.010261690 -0.581145644  1.376713695 -1.075950051 -1.675905305
 [41]  1.213939835  0.899532074  0.066966742  0.910188594 -0.069988037
 [46]  1.542504140  0.731986194 -0.581646432  0.760790385  1.416467148
 [51]  1.216341841 -0.358113863  0.095170960  0.055085180 -1.363912723
 [56] -1.118488291  2.786057692  0.271297586 -0.132249572  0.575096954
 [61] -0.817009376  0.676570381 -1.133593343 -0.234045214 -0.692374858
 [66]  0.212930406 -0.543928339 -0.238591410 -0.082789424  1.785512394
 [71]  1.003290008 -0.133465007  0.309956990  0.721685159  0.194437119
 [76]  1.571590278  0.108714499  1.665929984  2.075271605 -0.978150084
 [81] -0.070614593 -1.056272441  0.354287639  0.901341512  0.025218926
 [86]  2.081457691 -1.082090581 -0.873596965  1.312398202 -0.510352292
 [91] -0.497161250 -0.236600390  0.220595594 -1.115329283  1.341510678
 [96]  1.168658352  0.299370084  1.379371779 -1.093278793 -2.131210902
> colSums(tmp)
  [1] -1.665751126 -0.316366260 -0.532861132 -0.303276184  0.371497608
  [6]  1.214231159  0.825315975  0.357026122 -0.442626599  0.447311342
 [11] -0.499286148 -0.916596244 -1.143654983  0.827363718  0.007419401
 [16] -0.081528769  1.379412700  1.168347834  0.147162764 -0.081023213
 [21]  0.685578027  1.784654037  1.244884780 -0.087355257  0.447419828
 [26]  0.186656907 -1.132297893  1.355469478  0.106478880  0.260433944
 [31]  2.384199744 -0.050577865 -1.253973789  0.131590844 -0.646930134
 [36]  0.010261690 -0.581145644  1.376713695 -1.075950051 -1.675905305
 [41]  1.213939835  0.899532074  0.066966742  0.910188594 -0.069988037
 [46]  1.542504140  0.731986194 -0.581646432  0.760790385  1.416467148
 [51]  1.216341841 -0.358113863  0.095170960  0.055085180 -1.363912723
 [56] -1.118488291  2.786057692  0.271297586 -0.132249572  0.575096954
 [61] -0.817009376  0.676570381 -1.133593343 -0.234045214 -0.692374858
 [66]  0.212930406 -0.543928339 -0.238591410 -0.082789424  1.785512394
 [71]  1.003290008 -0.133465007  0.309956990  0.721685159  0.194437119
 [76]  1.571590278  0.108714499  1.665929984  2.075271605 -0.978150084
 [81] -0.070614593 -1.056272441  0.354287639  0.901341512  0.025218926
 [86]  2.081457691 -1.082090581 -0.873596965  1.312398202 -0.510352292
 [91] -0.497161250 -0.236600390  0.220595594 -1.115329283  1.341510678
 [96]  1.168658352  0.299370084  1.379371779 -1.093278793 -2.131210902
> colVars(tmp)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> colSd(tmp)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> colMax(tmp)
  [1] -1.665751126 -0.316366260 -0.532861132 -0.303276184  0.371497608
  [6]  1.214231159  0.825315975  0.357026122 -0.442626599  0.447311342
 [11] -0.499286148 -0.916596244 -1.143654983  0.827363718  0.007419401
 [16] -0.081528769  1.379412700  1.168347834  0.147162764 -0.081023213
 [21]  0.685578027  1.784654037  1.244884780 -0.087355257  0.447419828
 [26]  0.186656907 -1.132297893  1.355469478  0.106478880  0.260433944
 [31]  2.384199744 -0.050577865 -1.253973789  0.131590844 -0.646930134
 [36]  0.010261690 -0.581145644  1.376713695 -1.075950051 -1.675905305
 [41]  1.213939835  0.899532074  0.066966742  0.910188594 -0.069988037
 [46]  1.542504140  0.731986194 -0.581646432  0.760790385  1.416467148
 [51]  1.216341841 -0.358113863  0.095170960  0.055085180 -1.363912723
 [56] -1.118488291  2.786057692  0.271297586 -0.132249572  0.575096954
 [61] -0.817009376  0.676570381 -1.133593343 -0.234045214 -0.692374858
 [66]  0.212930406 -0.543928339 -0.238591410 -0.082789424  1.785512394
 [71]  1.003290008 -0.133465007  0.309956990  0.721685159  0.194437119
 [76]  1.571590278  0.108714499  1.665929984  2.075271605 -0.978150084
 [81] -0.070614593 -1.056272441  0.354287639  0.901341512  0.025218926
 [86]  2.081457691 -1.082090581 -0.873596965  1.312398202 -0.510352292
 [91] -0.497161250 -0.236600390  0.220595594 -1.115329283  1.341510678
 [96]  1.168658352  0.299370084  1.379371779 -1.093278793 -2.131210902
> colMin(tmp)
  [1] -1.665751126 -0.316366260 -0.532861132 -0.303276184  0.371497608
  [6]  1.214231159  0.825315975  0.357026122 -0.442626599  0.447311342
 [11] -0.499286148 -0.916596244 -1.143654983  0.827363718  0.007419401
 [16] -0.081528769  1.379412700  1.168347834  0.147162764 -0.081023213
 [21]  0.685578027  1.784654037  1.244884780 -0.087355257  0.447419828
 [26]  0.186656907 -1.132297893  1.355469478  0.106478880  0.260433944
 [31]  2.384199744 -0.050577865 -1.253973789  0.131590844 -0.646930134
 [36]  0.010261690 -0.581145644  1.376713695 -1.075950051 -1.675905305
 [41]  1.213939835  0.899532074  0.066966742  0.910188594 -0.069988037
 [46]  1.542504140  0.731986194 -0.581646432  0.760790385  1.416467148
 [51]  1.216341841 -0.358113863  0.095170960  0.055085180 -1.363912723
 [56] -1.118488291  2.786057692  0.271297586 -0.132249572  0.575096954
 [61] -0.817009376  0.676570381 -1.133593343 -0.234045214 -0.692374858
 [66]  0.212930406 -0.543928339 -0.238591410 -0.082789424  1.785512394
 [71]  1.003290008 -0.133465007  0.309956990  0.721685159  0.194437119
 [76]  1.571590278  0.108714499  1.665929984  2.075271605 -0.978150084
 [81] -0.070614593 -1.056272441  0.354287639  0.901341512  0.025218926
 [86]  2.081457691 -1.082090581 -0.873596965  1.312398202 -0.510352292
 [91] -0.497161250 -0.236600390  0.220595594 -1.115329283  1.341510678
 [96]  1.168658352  0.299370084  1.379371779 -1.093278793 -2.131210902
> colMedians(tmp)
  [1] -1.665751126 -0.316366260 -0.532861132 -0.303276184  0.371497608
  [6]  1.214231159  0.825315975  0.357026122 -0.442626599  0.447311342
 [11] -0.499286148 -0.916596244 -1.143654983  0.827363718  0.007419401
 [16] -0.081528769  1.379412700  1.168347834  0.147162764 -0.081023213
 [21]  0.685578027  1.784654037  1.244884780 -0.087355257  0.447419828
 [26]  0.186656907 -1.132297893  1.355469478  0.106478880  0.260433944
 [31]  2.384199744 -0.050577865 -1.253973789  0.131590844 -0.646930134
 [36]  0.010261690 -0.581145644  1.376713695 -1.075950051 -1.675905305
 [41]  1.213939835  0.899532074  0.066966742  0.910188594 -0.069988037
 [46]  1.542504140  0.731986194 -0.581646432  0.760790385  1.416467148
 [51]  1.216341841 -0.358113863  0.095170960  0.055085180 -1.363912723
 [56] -1.118488291  2.786057692  0.271297586 -0.132249572  0.575096954
 [61] -0.817009376  0.676570381 -1.133593343 -0.234045214 -0.692374858
 [66]  0.212930406 -0.543928339 -0.238591410 -0.082789424  1.785512394
 [71]  1.003290008 -0.133465007  0.309956990  0.721685159  0.194437119
 [76]  1.571590278  0.108714499  1.665929984  2.075271605 -0.978150084
 [81] -0.070614593 -1.056272441  0.354287639  0.901341512  0.025218926
 [86]  2.081457691 -1.082090581 -0.873596965  1.312398202 -0.510352292
 [91] -0.497161250 -0.236600390  0.220595594 -1.115329283  1.341510678
 [96]  1.168658352  0.299370084  1.379371779 -1.093278793 -2.131210902
> colRanges(tmp)
          [,1]       [,2]       [,3]       [,4]      [,5]     [,6]     [,7]
[1,] -1.665751 -0.3163663 -0.5328611 -0.3032762 0.3714976 1.214231 0.825316
[2,] -1.665751 -0.3163663 -0.5328611 -0.3032762 0.3714976 1.214231 0.825316
          [,8]       [,9]     [,10]      [,11]      [,12]     [,13]     [,14]
[1,] 0.3570261 -0.4426266 0.4473113 -0.4992861 -0.9165962 -1.143655 0.8273637
[2,] 0.3570261 -0.4426266 0.4473113 -0.4992861 -0.9165962 -1.143655 0.8273637
           [,15]       [,16]    [,17]    [,18]     [,19]       [,20]    [,21]
[1,] 0.007419401 -0.08152877 1.379413 1.168348 0.1471628 -0.08102321 0.685578
[2,] 0.007419401 -0.08152877 1.379413 1.168348 0.1471628 -0.08102321 0.685578
        [,22]    [,23]       [,24]     [,25]     [,26]     [,27]    [,28]
[1,] 1.784654 1.244885 -0.08735526 0.4474198 0.1866569 -1.132298 1.355469
[2,] 1.784654 1.244885 -0.08735526 0.4474198 0.1866569 -1.132298 1.355469
         [,29]     [,30]  [,31]       [,32]     [,33]     [,34]      [,35]
[1,] 0.1064789 0.2604339 2.3842 -0.05057787 -1.253974 0.1315908 -0.6469301
[2,] 0.1064789 0.2604339 2.3842 -0.05057787 -1.253974 0.1315908 -0.6469301
          [,36]      [,37]    [,38]    [,39]     [,40]   [,41]     [,42]
[1,] 0.01026169 -0.5811456 1.376714 -1.07595 -1.675905 1.21394 0.8995321
[2,] 0.01026169 -0.5811456 1.376714 -1.07595 -1.675905 1.21394 0.8995321
          [,43]     [,44]       [,45]    [,46]     [,47]      [,48]     [,49]
[1,] 0.06696674 0.9101886 -0.06998804 1.542504 0.7319862 -0.5816464 0.7607904
[2,] 0.06696674 0.9101886 -0.06998804 1.542504 0.7319862 -0.5816464 0.7607904
        [,50]    [,51]      [,52]      [,53]      [,54]     [,55]     [,56]
[1,] 1.416467 1.216342 -0.3581139 0.09517096 0.05508518 -1.363913 -1.118488
[2,] 1.416467 1.216342 -0.3581139 0.09517096 0.05508518 -1.363913 -1.118488
        [,57]     [,58]      [,59]    [,60]      [,61]     [,62]     [,63]
[1,] 2.786058 0.2712976 -0.1322496 0.575097 -0.8170094 0.6765704 -1.133593
[2,] 2.786058 0.2712976 -0.1322496 0.575097 -0.8170094 0.6765704 -1.133593
          [,64]      [,65]     [,66]      [,67]      [,68]       [,69]    [,70]
[1,] -0.2340452 -0.6923749 0.2129304 -0.5439283 -0.2385914 -0.08278942 1.785512
[2,] -0.2340452 -0.6923749 0.2129304 -0.5439283 -0.2385914 -0.08278942 1.785512
       [,71]     [,72]    [,73]     [,74]     [,75]   [,76]     [,77]   [,78]
[1,] 1.00329 -0.133465 0.309957 0.7216852 0.1944371 1.57159 0.1087145 1.66593
[2,] 1.00329 -0.133465 0.309957 0.7216852 0.1944371 1.57159 0.1087145 1.66593
        [,79]      [,80]       [,81]     [,82]     [,83]     [,84]      [,85]
[1,] 2.075272 -0.9781501 -0.07061459 -1.056272 0.3542876 0.9013415 0.02521893
[2,] 2.075272 -0.9781501 -0.07061459 -1.056272 0.3542876 0.9013415 0.02521893
        [,86]     [,87]     [,88]    [,89]      [,90]      [,91]      [,92]
[1,] 2.081458 -1.082091 -0.873597 1.312398 -0.5103523 -0.4971612 -0.2366004
[2,] 2.081458 -1.082091 -0.873597 1.312398 -0.5103523 -0.4971612 -0.2366004
         [,93]     [,94]    [,95]    [,96]     [,97]    [,98]     [,99]
[1,] 0.2205956 -1.115329 1.341511 1.168658 0.2993701 1.379372 -1.093279
[2,] 0.2205956 -1.115329 1.341511 1.168658 0.2993701 1.379372 -1.093279
        [,100]
[1,] -2.131211
[2,] -2.131211
> 
> 
> Max(tmp2)
[1] 2.193075
> Min(tmp2)
[1] -2.294856
> mean(tmp2)
[1] 0.03309967
> Sum(tmp2)
[1] 3.309967
> Var(tmp2)
[1] 0.8281239
> 
> rowMeans(tmp2)
  [1]  1.05062981 -0.75705607 -0.38902601 -1.41972468 -1.36767441  1.34266964
  [7]  0.22239855  1.29569093  0.79528941  0.19534597  0.11706012  0.06051512
 [13] -0.29452581 -0.06004195  0.73941604 -0.09731694 -0.33695152 -0.60712012
 [19]  0.75602522  0.85907756 -0.25642598 -0.82453378 -1.00524388  0.45537176
 [25] -1.35616780  1.47334400  1.43440243  0.13669116  0.30130794  0.63884079
 [31]  0.43095118 -0.18138933 -0.99939201 -0.41355090  1.02043609 -0.43130528
 [37] -1.23994633  1.08323349 -0.34657584 -2.29485598 -0.88171170  0.22254318
 [43] -0.53241389 -1.62313467  0.29655979  0.29562882  0.37912411  0.20410998
 [49]  0.11206205 -0.60511536  0.15362088 -0.03510996  0.18946689  1.03492019
 [55] -0.25709257 -0.07955511  1.44452045 -0.56626096  0.24365438 -1.40960858
 [61]  0.30701933  0.40377875  1.72394952  1.40917682 -1.14850895  0.79030215
 [67]  0.73465239  0.33425649 -0.57815385  0.12423566 -0.12453304  0.18132071
 [73] -1.73380728  0.32411022  0.22706242  0.71398616  1.38182004 -0.64177535
 [79]  0.38560468 -2.27710909  0.88392746 -0.91403775  0.87100201  2.19307501
 [85] -0.16857415 -1.62987910  0.90797075 -1.41075930 -0.49922243  0.23806515
 [91]  0.75456360  0.39388424 -1.40117584  0.56950292 -0.03357976 -1.09183278
 [97]  1.34291208  0.98672450  0.82428796 -0.36035550
> rowSums(tmp2)
  [1]  1.05062981 -0.75705607 -0.38902601 -1.41972468 -1.36767441  1.34266964
  [7]  0.22239855  1.29569093  0.79528941  0.19534597  0.11706012  0.06051512
 [13] -0.29452581 -0.06004195  0.73941604 -0.09731694 -0.33695152 -0.60712012
 [19]  0.75602522  0.85907756 -0.25642598 -0.82453378 -1.00524388  0.45537176
 [25] -1.35616780  1.47334400  1.43440243  0.13669116  0.30130794  0.63884079
 [31]  0.43095118 -0.18138933 -0.99939201 -0.41355090  1.02043609 -0.43130528
 [37] -1.23994633  1.08323349 -0.34657584 -2.29485598 -0.88171170  0.22254318
 [43] -0.53241389 -1.62313467  0.29655979  0.29562882  0.37912411  0.20410998
 [49]  0.11206205 -0.60511536  0.15362088 -0.03510996  0.18946689  1.03492019
 [55] -0.25709257 -0.07955511  1.44452045 -0.56626096  0.24365438 -1.40960858
 [61]  0.30701933  0.40377875  1.72394952  1.40917682 -1.14850895  0.79030215
 [67]  0.73465239  0.33425649 -0.57815385  0.12423566 -0.12453304  0.18132071
 [73] -1.73380728  0.32411022  0.22706242  0.71398616  1.38182004 -0.64177535
 [79]  0.38560468 -2.27710909  0.88392746 -0.91403775  0.87100201  2.19307501
 [85] -0.16857415 -1.62987910  0.90797075 -1.41075930 -0.49922243  0.23806515
 [91]  0.75456360  0.39388424 -1.40117584  0.56950292 -0.03357976 -1.09183278
 [97]  1.34291208  0.98672450  0.82428796 -0.36035550
> 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.05062981 -0.75705607 -0.38902601 -1.41972468 -1.36767441  1.34266964
  [7]  0.22239855  1.29569093  0.79528941  0.19534597  0.11706012  0.06051512
 [13] -0.29452581 -0.06004195  0.73941604 -0.09731694 -0.33695152 -0.60712012
 [19]  0.75602522  0.85907756 -0.25642598 -0.82453378 -1.00524388  0.45537176
 [25] -1.35616780  1.47334400  1.43440243  0.13669116  0.30130794  0.63884079
 [31]  0.43095118 -0.18138933 -0.99939201 -0.41355090  1.02043609 -0.43130528
 [37] -1.23994633  1.08323349 -0.34657584 -2.29485598 -0.88171170  0.22254318
 [43] -0.53241389 -1.62313467  0.29655979  0.29562882  0.37912411  0.20410998
 [49]  0.11206205 -0.60511536  0.15362088 -0.03510996  0.18946689  1.03492019
 [55] -0.25709257 -0.07955511  1.44452045 -0.56626096  0.24365438 -1.40960858
 [61]  0.30701933  0.40377875  1.72394952  1.40917682 -1.14850895  0.79030215
 [67]  0.73465239  0.33425649 -0.57815385  0.12423566 -0.12453304  0.18132071
 [73] -1.73380728  0.32411022  0.22706242  0.71398616  1.38182004 -0.64177535
 [79]  0.38560468 -2.27710909  0.88392746 -0.91403775  0.87100201  2.19307501
 [85] -0.16857415 -1.62987910  0.90797075 -1.41075930 -0.49922243  0.23806515
 [91]  0.75456360  0.39388424 -1.40117584  0.56950292 -0.03357976 -1.09183278
 [97]  1.34291208  0.98672450  0.82428796 -0.36035550
> rowMin(tmp2)
  [1]  1.05062981 -0.75705607 -0.38902601 -1.41972468 -1.36767441  1.34266964
  [7]  0.22239855  1.29569093  0.79528941  0.19534597  0.11706012  0.06051512
 [13] -0.29452581 -0.06004195  0.73941604 -0.09731694 -0.33695152 -0.60712012
 [19]  0.75602522  0.85907756 -0.25642598 -0.82453378 -1.00524388  0.45537176
 [25] -1.35616780  1.47334400  1.43440243  0.13669116  0.30130794  0.63884079
 [31]  0.43095118 -0.18138933 -0.99939201 -0.41355090  1.02043609 -0.43130528
 [37] -1.23994633  1.08323349 -0.34657584 -2.29485598 -0.88171170  0.22254318
 [43] -0.53241389 -1.62313467  0.29655979  0.29562882  0.37912411  0.20410998
 [49]  0.11206205 -0.60511536  0.15362088 -0.03510996  0.18946689  1.03492019
 [55] -0.25709257 -0.07955511  1.44452045 -0.56626096  0.24365438 -1.40960858
 [61]  0.30701933  0.40377875  1.72394952  1.40917682 -1.14850895  0.79030215
 [67]  0.73465239  0.33425649 -0.57815385  0.12423566 -0.12453304  0.18132071
 [73] -1.73380728  0.32411022  0.22706242  0.71398616  1.38182004 -0.64177535
 [79]  0.38560468 -2.27710909  0.88392746 -0.91403775  0.87100201  2.19307501
 [85] -0.16857415 -1.62987910  0.90797075 -1.41075930 -0.49922243  0.23806515
 [91]  0.75456360  0.39388424 -1.40117584  0.56950292 -0.03357976 -1.09183278
 [97]  1.34291208  0.98672450  0.82428796 -0.36035550
> 
> colMeans(tmp2)
[1] 0.03309967
> colSums(tmp2)
[1] 3.309967
> colVars(tmp2)
[1] 0.8281239
> colSd(tmp2)
[1] 0.9100131
> colMax(tmp2)
[1] 2.193075
> colMin(tmp2)
[1] -2.294856
> colMedians(tmp2)
[1] 0.1674708
> colRanges(tmp2)
          [,1]
[1,] -2.294856
[2,]  2.193075
> 
> 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.7494514 -0.5074337  0.9246587 -1.8615182  5.3682539  3.1163402
 [7]  2.4167356 -2.4338849 -5.6592029 -3.3308786
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -2.5264772
[2,] -1.1851468
[3,] -0.3307842
[4,]  0.5145495
[5,]  1.8597992
> 
> rowApply(tmp,sum)
 [1] -2.6201610 -0.2454046  2.7661779 -0.6778690  2.0981669 -1.7720206
 [7]  1.7914490  1.8961935 -3.5052535 -4.4476599
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    3    6    8    1   10    3    7    5    1     1
 [2,]    2    1   10   10    4    5    5    3    8     8
 [3,]    9    5    9    9    2   10   10    2    4     2
 [4,]    8    4    4    4    3    6    1    4   10     4
 [5,]   10    8    6    5    5    7    9    9    9     7
 [6,]    5    9    5    7    9    9    3    6    5     6
 [7,]    7   10    3    6    7    8    6    1    2    10
 [8,]    6    7    2    3    8    2    2    8    7     3
 [9,]    1    3    1    2    6    4    8   10    3     5
[10,]    4    2    7    8    1    1    4    7    6     9
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1]  0.1396398  1.5980238  1.9536108  0.1800655  1.0447793  2.0266253
 [7] -1.9051051  1.8564237 -1.3523331 -0.0022580 -0.2094852  6.3844397
[13] -1.6807282  2.0070405  2.4337182 -2.6280589 -2.4707081 -1.9806908
[19]  0.6434567 -1.4662714
> colApply(tmp,quantile)[,1]
             [,1]
[1,] -0.421306764
[2,] -0.405894270
[3,] -0.006638158
[4,]  0.108562785
[5,]  0.864916203
> 
> rowApply(tmp,sum)
[1]  4.539337  3.265085 -2.158536 -2.742727  3.669026
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]    6   16   11   15    5
[2,]   16   15    3   10   19
[3,]   11   19   13    6   17
[4,]   17   17    7    3    9
[5,]   13   12   18    5    7
> 
> 
> as.matrix(tmp)
             [,1]       [,2]       [,3]       [,4]       [,5]        [,6]
[1,] -0.421306764  1.1774976  0.1437103  1.3172023  0.1952122  1.93735601
[2,]  0.864916203  0.7642621  0.9877959  0.9594994  0.2959160  0.49748273
[3,] -0.006638158 -1.6659446  0.2179943 -0.8845470  1.5049692  1.00066142
[4,]  0.108562785 -0.2514806 -0.6683101 -1.0244621 -0.6728653  0.08482099
[5,] -0.405894270  1.5736892  1.2724203 -0.1876272 -0.2784529 -1.49369589
           [,7]        [,8]       [,9]       [,10]      [,11]     [,12]
[1,] -0.2767591  1.67129313  1.3281613  0.66719397 -0.6003024 0.1582781
[2,] -0.5942042 -0.55730844 -0.3981014  0.02425878 -0.2612344 0.9834344
[3,] -2.1031884  0.07818733 -0.8935514 -1.40414567 -0.9441087 2.0034518
[4,] -0.1124026  0.91332923 -0.7654545 -0.21792110  1.3871421 1.8847484
[5,]  1.1814493 -0.24907752 -0.6233871  0.92835602  0.2090181 1.3545271
          [,13]      [,14]      [,15]      [,16]       [,17]      [,18]
[1,] -0.7052955 -0.3285376 -0.5218161 -0.5906389  0.04438316 -0.6648744
[2,] -0.3055162  2.4743605  0.1202575 -1.0987956 -1.09758800  0.6991599
[3,] -0.4317321  1.1438844  1.7120299 -2.1604650  0.68223880 -0.3131826
[4,] -0.4095589  0.4729030  0.5717747 -0.4976479 -1.77666389 -0.5168852
[5,]  0.1713744 -1.7555698  0.5514722  1.7194884 -0.32307815 -1.1849086
          [,19]       [,20]
[1,]  0.3997225 -0.39114325
[2,] -0.4087503 -0.68475958
[3,]  0.9153807 -0.60983067
[4,] -1.2567485  0.00439249
[5,]  0.9938522  0.21506960
> 
> 
> 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 :  650  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 :  561  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.7305871 -1.133739 0.8381012 0.4776564 -1.140253 0.02587937 1.342781
         col8       col9     col10     col11     col12    col13     col14
row1 1.442921 -0.0991257 0.5337573 0.9216769 -2.001503 0.450531 -1.926376
         col15     col16   col17    col18    col19    col20
row1 -1.266944 0.3479862 1.15489 1.823455 1.795977 1.676872
> tmp[,"col10"]
            col10
row1  0.533757329
row2  0.800007822
row3  0.009457158
row4 -0.183244957
row5  0.225832490
> tmp[c("row1","row5"),]
           col1       col2      col3      col4      col5        col6      col7
row1 -0.7305871 -1.1337388 0.8381012 0.4776564 -1.140253  0.02587937  1.342781
row5 -0.3562083 -0.3046496 1.2869835 2.0240950 -0.595356 -0.53862569 -1.069192
          col8       col9     col10     col11     col12    col13      col14
row1  1.442921 -0.0991257 0.5337573 0.9216769 -2.001503 0.450531 -1.9263760
row5 -1.211863  1.3914112 0.2258325 0.2590534 -1.680972 1.635482  0.5369686
           col15     col16     col17     col18     col19     col20
row1 -1.26694449 0.3479862  1.154890  1.823455 1.7959769 1.6768718
row5  0.07943372 1.4258890 -1.766127 -1.097782 0.9407669 0.1587697
> tmp[,c("col6","col20")]
            col6        col20
row1  0.02587937  1.676871847
row2 -0.32553144 -0.047314683
row3 -0.40439433  0.003474013
row4 -0.87776501  0.876906677
row5 -0.53862569  0.158769696
> tmp[c("row1","row5"),c("col6","col20")]
            col6     col20
row1  0.02587937 1.6768718
row5 -0.53862569 0.1587697
> 
> 
> 
> 
> 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 50.03332 51.03614 49.84647 51.1379 46.47379 105.8671 51.78617 49.19452
         col9    col10    col11    col12    col13    col14    col15    col16
row1 49.00979 51.62311 49.64056 49.36755 49.59383 51.39866 49.47807 50.35933
        col17   col18    col19    col20
row1 51.32323 48.6714 50.04917 103.7112
> tmp[,"col10"]
        col10
row1 51.62311
row2 29.77495
row3 30.22647
row4 29.30525
row5 49.65645
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 50.03332 51.03614 49.84647 51.13790 46.47379 105.8671 51.78617 49.19452
row5 49.79806 50.07634 50.63370 51.58884 51.22926 105.4526 48.12366 49.55633
         col9    col10    col11    col12    col13    col14    col15    col16
row1 49.00979 51.62311 49.64056 49.36755 49.59383 51.39866 49.47807 50.35933
row5 50.23350 49.65645 50.45532 49.06411 48.37830 49.41679 49.92903 49.83861
        col17    col18    col19    col20
row1 51.32323 48.67140 50.04917 103.7112
row5 49.87093 50.83335 50.21361 105.9656
> tmp[,c("col6","col20")]
          col6     col20
row1 105.86711 103.71120
row2  73.85302  75.51104
row3  74.18388  74.94830
row4  77.62951  75.57826
row5 105.45263 105.96563
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 105.8671 103.7112
row5 105.4526 105.9656
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 105.8671 103.7112
row5 105.4526 105.9656
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
          col13
[1,]  1.7664127
[2,] -0.3568304
[3,]  0.7169406
[4,]  1.0623900
[5,] -0.2022248
> tmp[,c("col17","col7")]
           col17       col7
[1,]  0.63983260  1.7153582
[2,]  0.02994788 -0.2128302
[3,]  0.25075063 -0.3456599
[4,] -0.84296425  1.0788063
[5,]  0.22871220  1.2987774
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
           col6      col20
[1,] -0.6974234 -0.9217526
[2,] -0.3041210 -0.1931115
[3,] -1.7781215 -0.2154177
[4,] -1.5958936  1.3030485
[5,] -1.2047546  1.4407210
> subBufferedMatrix(tmp,1,c("col6"))[,1]
           col1
[1,] -0.6974234
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
           col6
[1,] -0.6974234
[2,] -0.3041210
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> 
> 
> 
> subBufferedMatrix(tmp,c("row3","row1"),)[,1:20]
           [,1]      [,2]      [,3]        [,4]       [,5]       [,6]      [,7]
row3 -0.6254004 1.5001476 0.2937852 -0.96721692 0.42140315 -0.2741778 0.3958753
row1 -0.8463722 0.3903559 0.3409082  0.01069969 0.02030983 -2.7768864 1.7788589
          [,8]       [,9]      [,10]      [,11]      [,12]      [,13]     [,14]
row3 0.9093839 -0.3092619 -0.9099867 -0.9187331  0.1991411 -0.9878255 0.2050122
row1 0.4393949 -0.4424246 -0.9003627 -1.0467130 -0.8563167  1.8838151 0.0706446
          [,15]      [,16]      [,17]      [,18]      [,19]     [,20]
row3 -0.0349667  0.2979213 -0.6297206 -0.8051079 -0.4736107 1.7675925
row1 -0.2817848 -2.0883609  0.4647875 -0.6438557 -0.8992788 0.3643654
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
          [,1]     [,2]      [,3]      [,4]      [,5]       [,6]      [,7]
row2 0.2510011 1.344941 0.9755418 0.3033405 -1.170637 -0.7369468 0.1296475
           [,8]      [,9]       [,10]
row2 -0.8924913 -2.013354 -0.05975556
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
          [,1]      [,2]      [,3]      [,4]       [,5]      [,6]      [,7]
row5 -1.025051 0.5431675 0.3443776 0.5314778 -0.4399437 0.9822149 -1.279432
          [,8]     [,9]     [,10]     [,11]     [,12]      [,13]   [,14]
row5 0.2378992 1.165922 -1.241601 0.3989996 0.7417434 -0.7305232 1.07544
         [,15]      [,16]     [,17]    [,18]     [,19]     [,20]
row5 -1.121418 -0.6171087 0.5169655 1.118943 0.9391841 0.2037958
> 
> 
> 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: 0x600003820300>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMa2b325065c8c"
 [2] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMa2b344a5fe51"
 [3] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMa2b36ddb9b0c"
 [4] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMa2b36ca0692c"
 [5] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMa2b31758ff6b"
 [6] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMa2b353e8d5c6"
 [7] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMa2b35b2ae533"
 [8] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMa2b35d2da607"
 [9] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMa2b35fef455b"
[10] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMa2b355b28a91"
[11] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMa2b33ca7618b"
[12] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMa2b310f50bc9"
[13] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMa2b347d8c1d1"
[14] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMa2b3679ca530"
[15] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMa2b35d212774"
> 
> 
> ### 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: 0x60000381c420>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x60000381c420>
Warning message:
In dir.create(new.directory) :
  '/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x60000381c420>
> rowMedians(tmp)
  [1] -0.307794284 -0.414521755 -0.361391799 -0.007365284  0.123586506
  [6]  0.020551759 -0.120226430  0.576772097  0.155591241  0.174059512
 [11] -0.628463368 -0.108495289 -0.694879895  0.139507649 -0.069373254
 [16]  0.220236073  0.188179396  0.142540285  0.172677019 -0.009490285
 [21] -0.136475296  0.609096069 -0.492998643  0.356424889 -0.600407225
 [26]  0.223163526 -0.118602840  0.347909864 -0.180466055 -0.018199591
 [31]  0.116084184 -0.174086584  0.643311483 -0.395044803 -0.048367304
 [36]  0.005608576 -0.201033205  0.290471692  0.278367792 -0.025502274
 [41] -0.223357504 -0.491055064 -0.153641617 -0.246761696  0.109296726
 [46]  0.417050605  0.109180292  0.038761992  0.050069492 -0.923230575
 [51] -0.256997470  0.255152852 -0.059332688  0.159995384 -0.353973788
 [56]  0.015297755  0.344976157 -0.318448419  0.005354500  0.693126690
 [61] -0.175878180 -0.342260171  0.356315387 -0.075038064  0.191690883
 [66]  0.227878896 -0.348087825 -0.400689270 -0.176925608 -0.087269206
 [71] -0.263522294  0.329626849  0.279012341  0.357028854  0.069742599
 [76]  0.139186551  0.278074724  0.526471636  0.664492185  0.254272856
 [81] -0.147726640 -0.838044004  0.303130279  0.446602357  0.156730718
 [86] -0.556225210 -0.153465684 -0.545047046 -0.167682962 -0.162591230
 [91]  0.044264775  0.351592613  0.132848409  0.522500540  0.220071662
 [96]  0.151233346  0.105074207 -0.396763495 -0.210102221  0.124585223
[101] -0.307125574  0.159906338  0.679755715 -0.194928660 -0.450029526
[106] -0.216910932  0.212858090 -0.347170654 -0.182772647 -0.005714869
[111]  0.262530995 -0.065060818  0.710129480  0.399127374 -0.200780954
[116] -0.281458162  0.330611269 -0.159497433  0.175705541 -0.302373492
[121]  0.529845133  0.455976379 -0.468211629  0.038934156 -0.139911589
[126] -0.230121063  0.141168767 -0.105994136 -0.166774050 -0.362103178
[131] -0.242298633  0.528845204  0.207077222  0.858834040  0.110625720
[136]  0.361877944  0.275325259  0.320411895 -0.015715960  0.189051647
[141] -0.188140927  0.189840583  0.387664289 -0.395371694  0.167850147
[146]  0.034684422  0.549343144  0.264130251 -0.050034944  0.383233319
[151] -0.468155887 -0.071598279  0.166033051  0.107959116 -0.077014114
[156] -0.490350969 -0.322479651 -0.018513764 -0.274006084 -0.036484511
[161] -0.700032519 -0.180635519  0.298144870 -0.664933377 -0.214103983
[166] -0.025401161  0.240321177  0.531709462  0.347436701 -0.474192485
[171]  0.598976648 -0.182261870 -0.553185008 -0.481239962 -0.146513266
[176] -0.095675339 -0.001998717  0.359942526  0.052792691  0.226830615
[181]  0.191862787 -0.284925550 -0.114231575 -0.280329103 -0.338456803
[186]  0.176960258  0.064765224  0.388291934  0.247075755  0.045085210
[191]  0.002096194  0.092697852  0.294685132  0.031899968  0.019059126
[196]  0.460574151  0.345589456  0.147498876 -0.011294799 -0.117918456
[201] -0.054989402 -0.436485936 -0.499806417  0.043137897 -0.250065721
[206] -0.280189467 -0.108623353  0.045693402 -0.213906786 -0.454152160
[211]  0.249271160  0.072936006  0.266636136 -0.361927478  0.310249735
[216] -0.101056003  0.148617450  0.211959664  0.080578204 -0.669886697
[221]  0.406635307  0.013538167 -0.402183023 -0.169246673 -0.201743178
[226]  0.069711045  0.703501872  0.183197803  0.166750862  0.397428864
> 
> proc.time()
   user  system elapsed 
  0.650   3.213   4.067 

BufferedMatrix.Rcheck/tests/rawCalltesting.Rout


R version 4.5.1 Patched (2025-09-10 r88807) -- "Great Square Root"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: aarch64-apple-darwin20

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

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

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

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

Attaching package: 'BufferedMatrix'

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

    colMeans, colSums, rowMeans, rowSums

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

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

<pointer: 0x600003a7d020>
> .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: 0x600003a7d020>
> .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: 0x600003a7d020>
> .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: 0x600003a7d020>
> 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: 0x600003a74660>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600003a74660>
> .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: 0x600003a74660>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600003a74660>
> .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: 0x600003a74660>
> 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: 0x600003a74840>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600003a74840>
> .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: 0x600003a74840>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x600003a74840>
> .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: 0x600003a74840>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x600003a74840>
> .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: 0x600003a74840>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x600003a74840>
> .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: 0x600003a74840>
> 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: 0x600003a70000>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x600003a70000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600003a70000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600003a70000>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFilea7043dbfd82"  "BufferedMatrixFilea7045fe063c8"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFilea7043dbfd82"  "BufferedMatrixFilea7045fe063c8"
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x600003a70240>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600003a70240>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x600003a70240>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x600003a70240>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x600003a70240>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x600003a70240>
> .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: 0x600003a70420>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600003a70420>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x600003a70420>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x600003a70420>
> 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: 0x600003a70600>
> .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: 0x600003a70600>
> rm(P)
> 
> proc.time()
   user  system elapsed 
  0.109   0.036   0.141 

BufferedMatrix.Rcheck/tests/Rcodetesting.Rout


R version 4.5.1 Patched (2025-09-10 r88807) -- "Great Square Root"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: aarch64-apple-darwin20

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

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

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

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

Attaching package: 'BufferedMatrix'

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

    colMeans, colSums, rowMeans, rowSums

> 
> Temp <- createBufferedMatrix(100)
> dim(Temp)
[1] 100   0
> buffer.dim(Temp)
[1] 1 1
> 
> 
> proc.time()
   user  system elapsed 
  0.114   0.028   0.138 

Example timings