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

This page was generated on 2025-12-15 11:35 -0500 (Mon, 15 Dec 2025).

HostnameOSArch (*)R versionInstalled pkgs
nebbiolo1Linux (Ubuntu 24.04.3 LTS)x86_64R Under development (unstable) (2025-10-20 r88955) -- "Unsuffered Consequences" 4875
kjohnson3macOS 13.7.7 Venturaarm64R Under development (unstable) (2025-11-04 r88984) -- "Unsuffered Consequences" 4583
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/2332HostnameOS / ArchINSTALLBUILDCHECKBUILD BIN
BufferedMatrix 1.75.0  (landing page)
Ben Bolstad
Snapshot Date: 2025-12-14 13:40 -0500 (Sun, 14 Dec 2025)
git_url: https://git.bioconductor.org/packages/BufferedMatrix
git_branch: devel
git_last_commit: ecdbf23
git_last_commit_date: 2025-10-29 09:58:55 -0500 (Wed, 29 Oct 2025)
nebbiolo1Linux (Ubuntu 24.04.3 LTS) / x86_64  OK    OK    OK  UNNEEDED, same version is already published
kjohnson3macOS 13.7.7 Ventura / arm64  OK    OK    WARNINGS    OK  UNNEEDED, same version is already published


CHECK results for BufferedMatrix on kjohnson3

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

raw results


Summary

Package: BufferedMatrix
Version: 1.75.0
Command: /Library/Frameworks/R.framework/Resources/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/Library/Frameworks/R.framework/Resources/library --no-vignettes --timings BufferedMatrix_1.75.0.tar.gz
StartedAt: 2025-12-14 18:48:35 -0500 (Sun, 14 Dec 2025)
EndedAt: 2025-12-14 18:48:56 -0500 (Sun, 14 Dec 2025)
EllapsedTime: 21.3 seconds
RetCode: 0
Status:   WARNINGS  
CheckDir: BufferedMatrix.Rcheck
Warnings: 1

Command output

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


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

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


Installation output

BufferedMatrix.Rcheck/00install.out

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


* installing to library ‘/Library/Frameworks/R.framework/Versions/4.6-arm64/Resources/library’
* installing *source* package ‘BufferedMatrix’ ...
** this is package ‘BufferedMatrix’ version ‘1.75.0’
** using staged installation
** libs
using C compiler: ‘Apple clang version 15.0.0 (clang-1500.1.0.2.5)’
using SDK: ‘MacOSX11.3.1.sdk’
clang -arch arm64 -std=gnu2x -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/opt/R/arm64/include    -fPIC  -falign-functions=64 -Wall -g -O2  -c RBufferedMatrix.c -o RBufferedMatrix.o
clang -arch arm64 -std=gnu2x -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/opt/R/arm64/include    -fPIC  -falign-functions=64 -Wall -g -O2  -c doubleBufferedMatrix.c -o doubleBufferedMatrix.o
doubleBufferedMatrix.c:1580:7: warning: logical not is only applied to the left hand side of this bitwise operator [-Wlogical-not-parentheses]
  if (!(Matrix->readonly) & setting){
      ^                   ~
doubleBufferedMatrix.c:1580:7: note: add parentheses after the '!' to evaluate the bitwise operator first
  if (!(Matrix->readonly) & setting){
      ^
       (                           )
doubleBufferedMatrix.c:1580:7: note: add parentheses around left hand side expression to silence this warning
  if (!(Matrix->readonly) & setting){
      ^
      (                  )
doubleBufferedMatrix.c:3327:12: warning: unused function 'sort_double' [-Wunused-function]
static int sort_double(const double *a1,const double *a2){
           ^
2 warnings generated.
clang -arch arm64 -std=gnu2x -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/opt/R/arm64/include    -fPIC  -falign-functions=64 -Wall -g -O2  -c doubleBufferedMatrix_C_tests.c -o doubleBufferedMatrix_C_tests.o
clang -arch arm64 -std=gnu2x -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/opt/R/arm64/include    -fPIC  -falign-functions=64 -Wall -g -O2  -c init_package.c -o init_package.o
clang -arch arm64 -std=gnu2x -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -L/Library/Frameworks/R.framework/Resources/lib -L/opt/R/arm64/lib -o BufferedMatrix.so RBufferedMatrix.o doubleBufferedMatrix.o doubleBufferedMatrix_C_tests.o init_package.o -F/Library/Frameworks/R.framework/.. -framework R
installing to /Library/Frameworks/R.framework/Versions/4.6-arm64/Resources/library/00LOCK-BufferedMatrix/00new/BufferedMatrix/libs
** R
** inst
** byte-compile and prepare package for lazy loading
Creating a new generic function for ‘rowMeans’ in package ‘BufferedMatrix’
Creating a new generic function for ‘rowSums’ in package ‘BufferedMatrix’
Creating a new generic function for ‘colMeans’ in package ‘BufferedMatrix’
Creating a new generic function for ‘colSums’ in package ‘BufferedMatrix’
Creating a generic function for ‘ncol’ from package ‘base’ in package ‘BufferedMatrix’
Creating a generic function for ‘nrow’ from package ‘base’ in package ‘BufferedMatrix’
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
** checking absolute paths in shared objects and dynamic libraries
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (BufferedMatrix)

Tests output

BufferedMatrix.Rcheck/tests/c_code_level_tests.Rout


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

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

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

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

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

Attaching package: 'BufferedMatrix'

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

    colMeans, colSums, rowMeans, rowSums

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

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

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

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

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

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

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

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

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

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

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

[[1]]
[1] 0

> 
> proc.time()
   user  system elapsed 
  0.146   0.061   0.205 

BufferedMatrix.Rcheck/tests/objectTesting.Rout


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

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

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

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

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

Attaching package: 'BufferedMatrix'

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

    colMeans, colSums, rowMeans, rowSums

> 
> 
> ### this is used to control how many repetitions in something below
> ### higher values result in more checks.
> nreps <-100 ##20000
> 
> 
> ## test creation and some simple assignments and subsetting operations
> 
> ## first on single elements
> tmp <- createBufferedMatrix(1000,10)
> 
> tmp[10,5]
[1] 0
> tmp[10,5] <- 10
> tmp[10,5]
[1] 10
> tmp[10,5] <- 12.445
> tmp[10,5]
[1] 12.445
> 
> 
> 
> ## now testing accessing multiple elements
> tmp2 <- createBufferedMatrix(10,20)
> 
> 
> tmp2[3,1] <- 51.34
> tmp2[9,2] <- 9.87654
> tmp2[,1:2]
       [,1]    [,2]
 [1,]  0.00 0.00000
 [2,]  0.00 0.00000
 [3,] 51.34 0.00000
 [4,]  0.00 0.00000
 [5,]  0.00 0.00000
 [6,]  0.00 0.00000
 [7,]  0.00 0.00000
 [8,]  0.00 0.00000
 [9,]  0.00 9.87654
[10,]  0.00 0.00000
> tmp2[,-(3:20)]
       [,1]    [,2]
 [1,]  0.00 0.00000
 [2,]  0.00 0.00000
 [3,] 51.34 0.00000
 [4,]  0.00 0.00000
 [5,]  0.00 0.00000
 [6,]  0.00 0.00000
 [7,]  0.00 0.00000
 [8,]  0.00 0.00000
 [9,]  0.00 9.87654
[10,]  0.00 0.00000
> tmp2[3,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
[1,] 51.34    0    0    0    0    0    0    0    0     0     0     0     0
     [,14] [,15] [,16] [,17] [,18] [,19] [,20]
[1,]     0     0     0     0     0     0     0
> tmp2[-3,]
      [,1]    [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [2,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [3,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [4,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [5,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [6,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [7,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [8,]    0 9.87654    0    0    0    0    0    0    0     0     0     0     0
 [9,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
      [,14] [,15] [,16] [,17] [,18] [,19] [,20]
 [1,]     0     0     0     0     0     0     0
 [2,]     0     0     0     0     0     0     0
 [3,]     0     0     0     0     0     0     0
 [4,]     0     0     0     0     0     0     0
 [5,]     0     0     0     0     0     0     0
 [6,]     0     0     0     0     0     0     0
 [7,]     0     0     0     0     0     0     0
 [8,]     0     0     0     0     0     0     0
 [9,]     0     0     0     0     0     0     0
> tmp2[2,1:3]
     [,1] [,2] [,3]
[1,]    0    0    0
> tmp2[3:9,1:3]
      [,1]    [,2] [,3]
[1,] 51.34 0.00000    0
[2,]  0.00 0.00000    0
[3,]  0.00 0.00000    0
[4,]  0.00 0.00000    0
[5,]  0.00 0.00000    0
[6,]  0.00 0.00000    0
[7,]  0.00 9.87654    0
> tmp2[-4,-4]
       [,1]    [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [2,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [3,] 51.34 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [4,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [5,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [6,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [7,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [8,]  0.00 9.87654    0    0    0    0    0    0    0     0     0     0     0
 [9,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
      [,14] [,15] [,16] [,17] [,18] [,19]
 [1,]     0     0     0     0     0     0
 [2,]     0     0     0     0     0     0
 [3,]     0     0     0     0     0     0
 [4,]     0     0     0     0     0     0
 [5,]     0     0     0     0     0     0
 [6,]     0     0     0     0     0     0
 [7,]     0     0     0     0     0     0
 [8,]     0     0     0     0     0     0
 [9,]     0     0     0     0     0     0
> 
> ## now testing accessing/assigning multiple elements
> tmp3 <- createBufferedMatrix(10,10)
> 
> for (i in 1:10){
+   for (j in 1:10){
+     tmp3[i,j] <- (j-1)*10 + i
+   }
+ }
> 
> tmp3[2:4,2:4]
     [,1] [,2] [,3]
[1,]   12   22   32
[2,]   13   23   33
[3,]   14   24   34
> tmp3[c(-10),c(2:4,2:4,10,1,2,1:10,10:1)]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]   11   21   31   11   21   31   91    1   11     1    11    21    31
 [2,]   12   22   32   12   22   32   92    2   12     2    12    22    32
 [3,]   13   23   33   13   23   33   93    3   13     3    13    23    33
 [4,]   14   24   34   14   24   34   94    4   14     4    14    24    34
 [5,]   15   25   35   15   25   35   95    5   15     5    15    25    35
 [6,]   16   26   36   16   26   36   96    6   16     6    16    26    36
 [7,]   17   27   37   17   27   37   97    7   17     7    17    27    37
 [8,]   18   28   38   18   28   38   98    8   18     8    18    28    38
 [9,]   19   29   39   19   29   39   99    9   19     9    19    29    39
      [,14] [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24] [,25]
 [1,]    41    51    61    71    81    91    91    81    71    61    51    41
 [2,]    42    52    62    72    82    92    92    82    72    62    52    42
 [3,]    43    53    63    73    83    93    93    83    73    63    53    43
 [4,]    44    54    64    74    84    94    94    84    74    64    54    44
 [5,]    45    55    65    75    85    95    95    85    75    65    55    45
 [6,]    46    56    66    76    86    96    96    86    76    66    56    46
 [7,]    47    57    67    77    87    97    97    87    77    67    57    47
 [8,]    48    58    68    78    88    98    98    88    78    68    58    48
 [9,]    49    59    69    79    89    99    99    89    79    69    59    49
      [,26] [,27] [,28] [,29]
 [1,]    31    21    11     1
 [2,]    32    22    12     2
 [3,]    33    23    13     3
 [4,]    34    24    14     4
 [5,]    35    25    15     5
 [6,]    36    26    16     6
 [7,]    37    27    17     7
 [8,]    38    28    18     8
 [9,]    39    29    19     9
> tmp3[-c(1:5),-c(6:10)]
     [,1] [,2] [,3] [,4] [,5]
[1,]    6   16   26   36   46
[2,]    7   17   27   37   47
[3,]    8   18   28   38   48
[4,]    9   19   29   39   49
[5,]   10   20   30   40   50
> 
> ## assignment of whole columns
> tmp3[,1] <- c(1:10*100.0)
> tmp3[,1:2] <- tmp3[,1:2]*100
> tmp3[,1:2] <- tmp3[,2:1]
> tmp3[,1:2]
      [,1]  [,2]
 [1,] 1100 1e+04
 [2,] 1200 2e+04
 [3,] 1300 3e+04
 [4,] 1400 4e+04
 [5,] 1500 5e+04
 [6,] 1600 6e+04
 [7,] 1700 7e+04
 [8,] 1800 8e+04
 [9,] 1900 9e+04
[10,] 2000 1e+05
> 
> 
> tmp3[,-1] <- tmp3[,1:9]
> tmp3[,1:10]
      [,1] [,2]  [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,] 1100 1100 1e+04   21   31   41   51   61   71    81
 [2,] 1200 1200 2e+04   22   32   42   52   62   72    82
 [3,] 1300 1300 3e+04   23   33   43   53   63   73    83
 [4,] 1400 1400 4e+04   24   34   44   54   64   74    84
 [5,] 1500 1500 5e+04   25   35   45   55   65   75    85
 [6,] 1600 1600 6e+04   26   36   46   56   66   76    86
 [7,] 1700 1700 7e+04   27   37   47   57   67   77    87
 [8,] 1800 1800 8e+04   28   38   48   58   68   78    88
 [9,] 1900 1900 9e+04   29   39   49   59   69   79    89
[10,] 2000 2000 1e+05   30   40   50   60   70   80    90
> 
> tmp3[,1:2] <- rep(1,10)
> tmp3[,1:2] <- rep(1,20)
> tmp3[,1:2] <- matrix(c(1:5),1,5)
> 
> tmp3[,-c(1:8)] <- matrix(c(1:5),1,5)
> 
> tmp3[1,] <- 1:10
> tmp3[1,]
     [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,]    1    2    3    4    5    6    7    8    9    10
> tmp3[-1,] <- c(1,2)
> tmp3[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    1    2    3    4    5    6    7    8    9    10
 [2,]    1    2    1    2    1    2    1    2    1     2
 [3,]    2    1    2    1    2    1    2    1    2     1
 [4,]    1    2    1    2    1    2    1    2    1     2
 [5,]    2    1    2    1    2    1    2    1    2     1
 [6,]    1    2    1    2    1    2    1    2    1     2
 [7,]    2    1    2    1    2    1    2    1    2     1
 [8,]    1    2    1    2    1    2    1    2    1     2
 [9,]    2    1    2    1    2    1    2    1    2     1
[10,]    1    2    1    2    1    2    1    2    1     2
> tmp3[-c(1:8),] <- matrix(c(1:5),1,5)
> tmp3[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    1    2    3    4    5    6    7    8    9    10
 [2,]    1    2    1    2    1    2    1    2    1     2
 [3,]    2    1    2    1    2    1    2    1    2     1
 [4,]    1    2    1    2    1    2    1    2    1     2
 [5,]    2    1    2    1    2    1    2    1    2     1
 [6,]    1    2    1    2    1    2    1    2    1     2
 [7,]    2    1    2    1    2    1    2    1    2     1
 [8,]    1    2    1    2    1    2    1    2    1     2
 [9,]    1    3    5    2    4    1    3    5    2     4
[10,]    2    4    1    3    5    2    4    1    3     5
> 
> 
> tmp3[1:2,1:2] <- 5555.04
> tmp3[-(1:2),1:2] <- 1234.56789
> 
> 
> 
> ## testing accessors for the directory and prefix
> directory(tmp3)
[1] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests"
> prefix(tmp3)
[1] "BM"
> 
> ## testing if we can remove these objects
> rm(tmp, tmp2, tmp3)
> gc()
         used (Mb) gc trigger (Mb) limit (Mb) max used (Mb)
Ncells 481248 25.8    1058085 56.6         NA   633817 33.9
Vcells 891449  6.9    8388608 64.0     196608  2110969 16.2
> 
> 
> 
> 
> ##
> ## checking reads
> ##
> 
> tmp2 <- createBufferedMatrix(10,20)
> 
> test.sample <- rnorm(10*20)
> 
> tmp2[1:10,1:20] <- test.sample
> 
> test.matrix <- matrix(test.sample,10,20)
> 
> ## testing reads
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   which.col <- sample(1:20,1)
+   if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> date()
[1] "Sun Dec 14 18:48:48 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] "Sun Dec 14 18:48:48 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: 0x6000007a0420>
> 
> 
> 
> 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] "Sun Dec 14 18:48:49 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] "Sun Dec 14 18:48:49 2025"
> 
> ColMode(tmp2)
<pointer: 0x6000007a0420>
> 
> 
> 
> ### 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.8110011  1.481255 -1.0630620  1.57234569
[2,]  -1.1336129 -2.529999 -0.5223571 -1.18441750
[3,]   0.7319146 -1.478885  0.5579713  0.30515096
[4,]   1.1347226 -1.992240  0.9712324  0.05911967
> ewApply(tmp5,abs)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
            [,1]     [,2]      [,3]       [,4]
[1,] 100.8110011 1.481255 1.0630620 1.57234569
[2,]   1.1336129 2.529999 0.5223571 1.18441750
[3,]   0.7319146 1.478885 0.5579713 0.30515096
[4,]   1.1347226 1.992240 0.9712324 0.05911967
> ewApply(tmp5,sqrt)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
           [,1]     [,2]      [,3]      [,4]
[1,] 10.0404682 1.217068 1.0310490 1.2539321
[2,]  1.0647126 1.590597 0.7227428 1.0883095
[3,]  0.8555201 1.216094 0.7469747 0.5524047
[4,]  1.0652336 1.411467 0.9855112 0.2431454
> 
> my.function <- function(x,power){
+   (x+5)^power
+ }
> 
> ewApply(tmp5,my.function,power=2)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
          [,1]     [,2]     [,3]     [,4]
[1,] 226.21568 38.65194 36.37355 39.11167
[2,]  36.78074 43.43597 32.74978 37.06751
[3,]  34.28712 38.63983 33.02772 30.82920
[4,]  36.78706 41.10691 35.82634 27.49057
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x6000007ac0c0>
> exp(tmp5)
<pointer: 0x6000007ac0c0>
> log(tmp5,2)
<pointer: 0x6000007ac0c0>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 470.8383
> Min(tmp5)
[1] 53.32119
> mean(tmp5)
[1] 72.04856
> Sum(tmp5)
[1] 14409.71
> Var(tmp5)
[1] 869.6787
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 89.11029 71.11314 68.77098 72.15005 67.22567 71.32849 69.47870 68.92359
 [9] 71.64750 70.73713
> rowSums(tmp5)
 [1] 1782.206 1422.263 1375.420 1443.001 1344.513 1426.570 1389.574 1378.472
 [9] 1432.950 1414.743
> rowVars(tmp5)
 [1] 8126.16556   48.15541   29.64930  103.79992  100.32631   79.22607
 [7]   59.52198   58.98310   87.05031   52.95798
> rowSd(tmp5)
 [1] 90.145247  6.939410  5.445117 10.188225 10.016302  8.900903  7.715049
 [8]  7.680046  9.330076  7.277223
> rowMax(tmp5)
 [1] 470.83831  90.40628  80.42373  93.58132  97.66826  88.39189  88.06198
 [8]  80.46705  91.08301  84.82987
> rowMin(tmp5)
 [1] 56.47071 62.19584 59.77529 56.24559 53.43320 57.83484 59.78242 53.32119
 [9] 57.49851 56.87248
> 
> colMeans(tmp5)
 [1] 114.98440  75.43083  69.78895  69.16217  70.80115  66.21044  69.06137
 [8]  69.73201  69.79265  70.39375  70.80061  66.46960  73.06975  70.83593
[15]  65.76716  68.13961  69.54913  68.44885  70.49077  72.04196
> colSums(tmp5)
 [1] 1149.8440  754.3083  697.8895  691.6217  708.0115  662.1044  690.6137
 [8]  697.3201  697.9265  703.9375  708.0061  664.6960  730.6975  708.3593
[15]  657.6716  681.3961  695.4913  684.4885  704.9077  720.4196
> colVars(tmp5)
 [1] 15659.31923   148.70177    37.98681    91.42872    44.83337    21.63915
 [7]    75.62146    32.45985    72.71355    73.36703   124.35685    18.94190
[13]    90.48095    38.35982   106.15629    21.74065   134.95505    70.20528
[19]    84.42103    17.78234
> colSd(tmp5)
 [1] 125.137202  12.194333   6.163344   9.561837   6.695772   4.651790
 [7]   8.696060   5.697354   8.527224   8.565456  11.151540   4.352229
[13]   9.512147   6.193531  10.303217   4.662687  11.617015   8.378859
[19]   9.188092   4.216912
> colMax(tmp5)
 [1] 470.83831  91.08301  77.61867  81.40581  86.26681  73.77275  87.50029
 [8]  78.83647  83.19174  82.36891  97.66826  72.42582  93.58132  78.40245
[15]  88.06198  76.66932  87.37258  81.45738  88.39189  77.84074
> colMin(tmp5)
 [1] 66.43281 56.87248 58.49916 57.21803 62.63563 59.78242 60.16637 61.94089
 [9] 56.47071 56.24559 59.82306 59.77529 63.99787 58.33075 53.32119 61.59182
[17] 55.82740 57.51016 57.49851 63.56858
> 
> 
> ### 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]       NA 71.11314 68.77098 72.15005 67.22567 71.32849 69.47870 68.92359
 [9] 71.64750 70.73713
> rowSums(tmp5)
 [1]       NA 1422.263 1375.420 1443.001 1344.513 1426.570 1389.574 1378.472
 [9] 1432.950 1414.743
> rowVars(tmp5)
 [1] 8565.99768   48.15541   29.64930  103.79992  100.32631   79.22607
 [7]   59.52198   58.98310   87.05031   52.95798
> rowSd(tmp5)
 [1] 92.552675  6.939410  5.445117 10.188225 10.016302  8.900903  7.715049
 [8]  7.680046  9.330076  7.277223
> rowMax(tmp5)
 [1]       NA 90.40628 80.42373 93.58132 97.66826 88.39189 88.06198 80.46705
 [9] 91.08301 84.82987
> rowMin(tmp5)
 [1]       NA 62.19584 59.77529 56.24559 53.43320 57.83484 59.78242 53.32119
 [9] 57.49851 56.87248
> 
> colMeans(tmp5)
 [1] 114.98440  75.43083  69.78895  69.16217  70.80115  66.21044  69.06137
 [8]  69.73201  69.79265  70.39375  70.80061  66.46960  73.06975  70.83593
[15]  65.76716  68.13961  69.54913  68.44885        NA  72.04196
> colSums(tmp5)
 [1] 1149.8440  754.3083  697.8895  691.6217  708.0115  662.1044  690.6137
 [8]  697.3201  697.9265  703.9375  708.0061  664.6960  730.6975  708.3593
[15]  657.6716  681.3961  695.4913  684.4885        NA  720.4196
> colVars(tmp5)
 [1] 15659.31923   148.70177    37.98681    91.42872    44.83337    21.63915
 [7]    75.62146    32.45985    72.71355    73.36703   124.35685    18.94190
[13]    90.48095    38.35982   106.15629    21.74065   134.95505    70.20528
[19]          NA    17.78234
> colSd(tmp5)
 [1] 125.137202  12.194333   6.163344   9.561837   6.695772   4.651790
 [7]   8.696060   5.697354   8.527224   8.565456  11.151540   4.352229
[13]   9.512147   6.193531  10.303217   4.662687  11.617015   8.378859
[19]         NA   4.216912
> colMax(tmp5)
 [1] 470.83831  91.08301  77.61867  81.40581  86.26681  73.77275  87.50029
 [8]  78.83647  83.19174  82.36891  97.66826  72.42582  93.58132  78.40245
[15]  88.06198  76.66932  87.37258  81.45738        NA  77.84074
> colMin(tmp5)
 [1] 66.43281 56.87248 58.49916 57.21803 62.63563 59.78242 60.16637 61.94089
 [9] 56.47071 56.24559 59.82306 59.77529 63.99787 58.33075 53.32119 61.59182
[17] 55.82740 57.51016       NA 63.56858
> 
> Max(tmp5,na.rm=TRUE)
[1] 470.8383
> Min(tmp5,na.rm=TRUE)
[1] 53.32119
> mean(tmp5,na.rm=TRUE)
[1] 72.03366
> Sum(tmp5,na.rm=TRUE)
[1] 14334.7
> Var(tmp5,na.rm=TRUE)
[1] 874.0264
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 89.85224 71.11314 68.77098 72.15005 67.22567 71.32849 69.47870 68.92359
 [9] 71.64750 70.73713
> rowSums(tmp5,na.rm=TRUE)
 [1] 1707.193 1422.263 1375.420 1443.001 1344.513 1426.570 1389.574 1378.472
 [9] 1432.950 1414.743
> rowVars(tmp5,na.rm=TRUE)
 [1] 8565.99768   48.15541   29.64930  103.79992  100.32631   79.22607
 [7]   59.52198   58.98310   87.05031   52.95798
> rowSd(tmp5,na.rm=TRUE)
 [1] 92.552675  6.939410  5.445117 10.188225 10.016302  8.900903  7.715049
 [8]  7.680046  9.330076  7.277223
> rowMax(tmp5,na.rm=TRUE)
 [1] 470.83831  90.40628  80.42373  93.58132  97.66826  88.39189  88.06198
 [8]  80.46705  91.08301  84.82987
> rowMin(tmp5,na.rm=TRUE)
 [1] 56.47071 62.19584 59.77529 56.24559 53.43320 57.83484 59.78242 53.32119
 [9] 57.49851 56.87248
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 114.98440  75.43083  69.78895  69.16217  70.80115  66.21044  69.06137
 [8]  69.73201  69.79265  70.39375  70.80061  66.46960  73.06975  70.83593
[15]  65.76716  68.13961  69.54913  68.44885  69.98828  72.04196
> colSums(tmp5,na.rm=TRUE)
 [1] 1149.8440  754.3083  697.8895  691.6217  708.0115  662.1044  690.6137
 [8]  697.3201  697.9265  703.9375  708.0061  664.6960  730.6975  708.3593
[15]  657.6716  681.3961  695.4913  684.4885  629.8945  720.4196
> colVars(tmp5,na.rm=TRUE)
 [1] 15659.31923   148.70177    37.98681    91.42872    44.83337    21.63915
 [7]    75.62146    32.45985    72.71355    73.36703   124.35685    18.94190
[13]    90.48095    38.35982   106.15629    21.74065   134.95505    70.20528
[19]    92.13306    17.78234
> colSd(tmp5,na.rm=TRUE)
 [1] 125.137202  12.194333   6.163344   9.561837   6.695772   4.651790
 [7]   8.696060   5.697354   8.527224   8.565456  11.151540   4.352229
[13]   9.512147   6.193531  10.303217   4.662687  11.617015   8.378859
[19]   9.598597   4.216912
> colMax(tmp5,na.rm=TRUE)
 [1] 470.83831  91.08301  77.61867  81.40581  86.26681  73.77275  87.50029
 [8]  78.83647  83.19174  82.36891  97.66826  72.42582  93.58132  78.40245
[15]  88.06198  76.66932  87.37258  81.45738  88.39189  77.84074
> colMin(tmp5,na.rm=TRUE)
 [1] 66.43281 56.87248 58.49916 57.21803 62.63563 59.78242 60.16637 61.94089
 [9] 56.47071 56.24559 59.82306 59.77529 63.99787 58.33075 53.32119 61.59182
[17] 55.82740 57.51016 57.49851 63.56858
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1]      NaN 71.11314 68.77098 72.15005 67.22567 71.32849 69.47870 68.92359
 [9] 71.64750 70.73713
> rowSums(tmp5,na.rm=TRUE)
 [1]    0.000 1422.263 1375.420 1443.001 1344.513 1426.570 1389.574 1378.472
 [9] 1432.950 1414.743
> rowVars(tmp5,na.rm=TRUE)
 [1]        NA  48.15541  29.64930 103.79992 100.32631  79.22607  59.52198
 [8]  58.98310  87.05031  52.95798
> rowSd(tmp5,na.rm=TRUE)
 [1]        NA  6.939410  5.445117 10.188225 10.016302  8.900903  7.715049
 [8]  7.680046  9.330076  7.277223
> rowMax(tmp5,na.rm=TRUE)
 [1]       NA 90.40628 80.42373 93.58132 97.66826 88.39189 88.06198 80.46705
 [9] 91.08301 84.82987
> rowMin(tmp5,na.rm=TRUE)
 [1]       NA 62.19584 59.77529 56.24559 53.43320 57.83484 59.78242 53.32119
 [9] 57.49851 56.87248
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1] 75.44507 74.87326 69.13142 67.80177 70.94102 66.30701 69.72823 70.59769
 [9] 71.27286 69.91718 72.02034 65.80780 73.38343 70.97303 65.18313 68.86714
[17] 69.68966 69.66426      NaN 71.46357
> colSums(tmp5,na.rm=TRUE)
 [1] 679.0057 673.8593 622.1827 610.2159 638.4692 596.7631 627.5541 635.3792
 [9] 641.4558 629.2546 648.1831 592.2702 660.4509 638.7573 586.6482 619.8043
[17] 627.2069 626.9783   0.0000 643.1721
> colVars(tmp5,na.rm=TRUE)
 [1]  28.95585 163.79206  37.87117  82.03695  50.21746  24.23912  80.07121
 [8]  28.08655  57.15356  79.98277 123.16441  16.38235 100.68416  42.94336
[15] 115.58855  18.50358 151.60227  62.36220        NA  16.24161
> colSd(tmp5,na.rm=TRUE)
 [1]  5.381064 12.798127  6.153956  9.057425  7.086428  4.923324  8.948252
 [8]  5.299675  7.559997  8.943308 11.097946  4.047511 10.034150  6.553118
[15] 10.751211  4.301578 12.312687  7.896974        NA  4.030087
> colMax(tmp5,na.rm=TRUE)
 [1] 85.53253 91.08301 77.61867 80.48722 86.26681 73.77275 87.50029 78.83647
 [9] 83.19174 82.36891 97.66826 70.80718 93.58132 78.40245 88.06198 76.66932
[17] 87.37258 81.45738     -Inf 77.84074
> colMin(tmp5,na.rm=TRUE)
 [1] 66.43281 56.87248 58.49916 57.21803 62.63563 59.78242 60.16637 63.24188
 [9] 60.61103 56.24559 62.29315 59.77529 63.99787 58.33075 53.32119 62.90103
[17] 55.82740 58.78996      Inf 63.56858
> 
> 
> 
> 
> 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] 308.5910 210.2275 157.3528 167.7677 298.9676 259.0139 247.7140 179.5021
 [9] 215.5148 180.3668
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 308.5910 210.2275 157.3528 167.7677 298.9676 259.0139 247.7140 179.5021
 [9] 215.5148 180.3668
> 
> 
> 
> copymatrix <- matrix(rnorm(200,150,15),10,20)
> 
> tmp5[1:10,1:20] <- copymatrix
> which.row <- 1
> which.col  <- 3
> cat(which.row," ",which.col,"\n")
1   3 
> tmp5[which.row,which.col] <- NA
> copymatrix[which.row,which.col] <- NA
> 
> colVars(tmp5,na.rm=TRUE)-apply(copymatrix,2,var,na.rm=TRUE)
 [1]  2.842171e-14  1.136868e-13  0.000000e+00  0.000000e+00  5.684342e-14
 [6]  1.136868e-13 -5.684342e-14 -1.989520e-13 -2.842171e-14  5.684342e-14
[11]  0.000000e+00 -5.684342e-14  5.684342e-14  1.705303e-13  0.000000e+00
[16]  0.000000e+00 -1.136868e-13 -1.989520e-13  2.557954e-13  2.842171e-14
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> ## making sure these things agree
> ##
> ## first when there is no NA
> 
> 
> 
> agree.checks <- function(buff.matrix,r.matrix,err.tol=1e-10){
+ 
+   if (Max(buff.matrix,na.rm=TRUE) != max(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Max")
+   }
+   
+ 
+   if (Min(buff.matrix,na.rm=TRUE) != min(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Min")
+   }
+ 
+ 
+   if (abs(Sum(buff.matrix,na.rm=TRUE)- sum(r.matrix,na.rm=TRUE)) > err.tol){
+ 
+     cat(Sum(buff.matrix,na.rm=TRUE),"\n")
+     cat(sum(r.matrix,na.rm=TRUE),"\n")
+     cat(Sum(buff.matrix,na.rm=TRUE) - sum(r.matrix,na.rm=TRUE),"\n")
+     
+     stop("No agreement in Sum")
+   }
+   
+   if (abs(mean(buff.matrix,na.rm=TRUE) - mean(r.matrix,na.rm=TRUE)) > err.tol){
+     stop("No agreement in mean")
+   }
+   
+   
+   if(abs(Var(buff.matrix,na.rm=TRUE) - var(as.vector(r.matrix),na.rm=TRUE)) > err.tol){
+     stop("No agreement in Var")
+   }
+   
+   
+ 
+   if(any(abs(rowMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,mean,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowMeans")
+   }
+   
+   
+   if(any(abs(colMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,mean,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colMeans")
+   }
+   
+   
+   if(any(abs(rowSums(buff.matrix,na.rm=TRUE)  -  apply(r.matrix,1,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in rowSums")
+   }
+   
+   
+   if(any(abs(colSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colSums")
+   }
+   
+   ### this is to get around the fact that R doesn't like to compute NA on an entire vector of NA when 
+   ### computing variance
+   my.Var <- function(x,na.rm=FALSE){
+    if (all(is.na(x))){
+      return(NA)
+    } else {
+      var(x,na.rm=na.rm)
+    }
+ 
+   }
+   
+   if(any(abs(rowVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+   
+   
+   if(any(abs(colVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+ 
+ 
+   if(any(abs(rowMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+ 
+   if(any(abs(colMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+   
+   
+   if(any(abs(rowMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+   
+ 
+   if(any(abs(colMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+ 
+   if(any(abs(colMedians(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,median,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMedian")
+   }
+ 
+   if(any(abs(colRanges(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,range,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colRanges")
+   }
+ 
+ 
+   
+ }
> 
> 
> 
> 
> 
> 
> 
> 
> 
> for (rep in 1:20){
+   copymatrix <- matrix(rnorm(200,150,15),10,20)
+   
+   tmp5[1:10,1:20] <- copymatrix
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ## now lets assign some NA values and check agreement
+ 
+   which.row <- sample(1:10,1,replace=TRUE)
+   which.col  <- sample(1:20,1,replace=TRUE)
+   
+   cat(which.row," ",which.col,"\n")
+   
+   tmp5[which.row,which.col] <- NA
+   copymatrix[which.row,which.col] <- NA
+   
+   agree.checks(tmp5,copymatrix)
+ 
+   ## make an entire row NA
+   tmp5[which.row,] <- NA
+   copymatrix[which.row,] <- NA
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ### also make an entire col NA
+   tmp5[,which.col] <- NA
+   copymatrix[,which.col] <- NA
+ 
+   agree.checks(tmp5,copymatrix)
+ 
+   ### now make 1 element non NA with NA in the rest of row and column
+ 
+   tmp5[which.row,which.col] <- rnorm(1,150,15)
+   copymatrix[which.row,which.col] <- tmp5[which.row,which.col]
+ 
+   agree.checks(tmp5,copymatrix)
+ }
4   15 
1   4 
6   7 
5   16 
2   13 
6   2 
7   17 
6   4 
9   11 
5   15 
4   19 
9   12 
6   9 
5   12 
7   20 
10   4 
3   17 
4   11 
5   20 
1   20 
There were 50 or more warnings (use warnings() to see the first 50)
> 
> 
> ### now test 1 by n and n by 1 matrix
> 
> 
> err.tol <- 1e-12
> 
> rm(tmp5)
> 
> dataset1 <- rnorm(100)
> dataset2 <- rnorm(100)
> 
> tmp <- createBufferedMatrix(1,100)
> tmp[1,] <- dataset1
> 
> tmp2 <- createBufferedMatrix(100,1)
> tmp2[,1] <- dataset2
> 
> 
> 
> 
> 
> Max(tmp)
[1] 3.156405
> Min(tmp)
[1] -1.896114
> mean(tmp)
[1] -0.0931147
> Sum(tmp)
[1] -9.31147
> Var(tmp)
[1] 1.024881
> 
> rowMeans(tmp)
[1] -0.0931147
> rowSums(tmp)
[1] -9.31147
> rowVars(tmp)
[1] 1.024881
> rowSd(tmp)
[1] 1.012364
> rowMax(tmp)
[1] 3.156405
> rowMin(tmp)
[1] -1.896114
> 
> colMeans(tmp)
  [1]  1.342186071  0.405476290  0.143423631 -0.428192758 -1.198507530
  [6] -0.671285263 -0.591225655 -1.240711471  1.451828887  1.893710789
 [11] -0.874588599 -0.516782151  1.035513541 -1.896114031  0.163446642
 [16] -1.356069159 -0.253496715  0.144070348  1.077437629 -0.630622400
 [21]  0.678939400 -0.479561395 -0.756501512 -0.997142235 -0.184925351
 [26] -0.025596298 -1.189825378  1.254692398  0.261064766 -0.365016295
 [31] -1.078765258  0.713831505  0.962757584 -0.957813646  0.248019051
 [36] -1.159799220  0.188590545 -1.509893067 -0.381099274  0.728201930
 [41] -0.035145259  1.231859260  0.464337852 -0.473693281 -0.496704936
 [46] -1.071423170 -1.579018492  0.612677002  0.874966540 -1.104611502
 [51] -1.390690896 -0.578023426 -1.513807621 -1.051852374 -0.373451859
 [56] -0.035739866 -0.056600763 -1.064829678  0.767941282  1.199334945
 [61]  0.558857979 -0.084890846 -0.192267326  0.822602788 -0.084530733
 [66]  1.325080556 -1.334641559 -1.153032354 -0.332711891 -0.891193564
 [71] -0.370029591 -0.919839633 -1.028558576 -0.009733944 -0.299643814
 [76]  0.915545067 -0.732803312  2.316032198 -0.203097034 -1.260982567
 [81] -0.330209916  0.876544180  1.386560681  0.281441037 -0.830886034
 [86]  0.458462630  1.252193558 -0.656102701 -1.557706225 -0.896642253
 [91] -0.421324243 -0.144120513  3.156404999 -1.052954376  1.591355001
 [96]  2.441406655 -1.076923781 -1.179765754  1.275725206  0.799730341
> colSums(tmp)
  [1]  1.342186071  0.405476290  0.143423631 -0.428192758 -1.198507530
  [6] -0.671285263 -0.591225655 -1.240711471  1.451828887  1.893710789
 [11] -0.874588599 -0.516782151  1.035513541 -1.896114031  0.163446642
 [16] -1.356069159 -0.253496715  0.144070348  1.077437629 -0.630622400
 [21]  0.678939400 -0.479561395 -0.756501512 -0.997142235 -0.184925351
 [26] -0.025596298 -1.189825378  1.254692398  0.261064766 -0.365016295
 [31] -1.078765258  0.713831505  0.962757584 -0.957813646  0.248019051
 [36] -1.159799220  0.188590545 -1.509893067 -0.381099274  0.728201930
 [41] -0.035145259  1.231859260  0.464337852 -0.473693281 -0.496704936
 [46] -1.071423170 -1.579018492  0.612677002  0.874966540 -1.104611502
 [51] -1.390690896 -0.578023426 -1.513807621 -1.051852374 -0.373451859
 [56] -0.035739866 -0.056600763 -1.064829678  0.767941282  1.199334945
 [61]  0.558857979 -0.084890846 -0.192267326  0.822602788 -0.084530733
 [66]  1.325080556 -1.334641559 -1.153032354 -0.332711891 -0.891193564
 [71] -0.370029591 -0.919839633 -1.028558576 -0.009733944 -0.299643814
 [76]  0.915545067 -0.732803312  2.316032198 -0.203097034 -1.260982567
 [81] -0.330209916  0.876544180  1.386560681  0.281441037 -0.830886034
 [86]  0.458462630  1.252193558 -0.656102701 -1.557706225 -0.896642253
 [91] -0.421324243 -0.144120513  3.156404999 -1.052954376  1.591355001
 [96]  2.441406655 -1.076923781 -1.179765754  1.275725206  0.799730341
> 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.342186071  0.405476290  0.143423631 -0.428192758 -1.198507530
  [6] -0.671285263 -0.591225655 -1.240711471  1.451828887  1.893710789
 [11] -0.874588599 -0.516782151  1.035513541 -1.896114031  0.163446642
 [16] -1.356069159 -0.253496715  0.144070348  1.077437629 -0.630622400
 [21]  0.678939400 -0.479561395 -0.756501512 -0.997142235 -0.184925351
 [26] -0.025596298 -1.189825378  1.254692398  0.261064766 -0.365016295
 [31] -1.078765258  0.713831505  0.962757584 -0.957813646  0.248019051
 [36] -1.159799220  0.188590545 -1.509893067 -0.381099274  0.728201930
 [41] -0.035145259  1.231859260  0.464337852 -0.473693281 -0.496704936
 [46] -1.071423170 -1.579018492  0.612677002  0.874966540 -1.104611502
 [51] -1.390690896 -0.578023426 -1.513807621 -1.051852374 -0.373451859
 [56] -0.035739866 -0.056600763 -1.064829678  0.767941282  1.199334945
 [61]  0.558857979 -0.084890846 -0.192267326  0.822602788 -0.084530733
 [66]  1.325080556 -1.334641559 -1.153032354 -0.332711891 -0.891193564
 [71] -0.370029591 -0.919839633 -1.028558576 -0.009733944 -0.299643814
 [76]  0.915545067 -0.732803312  2.316032198 -0.203097034 -1.260982567
 [81] -0.330209916  0.876544180  1.386560681  0.281441037 -0.830886034
 [86]  0.458462630  1.252193558 -0.656102701 -1.557706225 -0.896642253
 [91] -0.421324243 -0.144120513  3.156404999 -1.052954376  1.591355001
 [96]  2.441406655 -1.076923781 -1.179765754  1.275725206  0.799730341
> colMin(tmp)
  [1]  1.342186071  0.405476290  0.143423631 -0.428192758 -1.198507530
  [6] -0.671285263 -0.591225655 -1.240711471  1.451828887  1.893710789
 [11] -0.874588599 -0.516782151  1.035513541 -1.896114031  0.163446642
 [16] -1.356069159 -0.253496715  0.144070348  1.077437629 -0.630622400
 [21]  0.678939400 -0.479561395 -0.756501512 -0.997142235 -0.184925351
 [26] -0.025596298 -1.189825378  1.254692398  0.261064766 -0.365016295
 [31] -1.078765258  0.713831505  0.962757584 -0.957813646  0.248019051
 [36] -1.159799220  0.188590545 -1.509893067 -0.381099274  0.728201930
 [41] -0.035145259  1.231859260  0.464337852 -0.473693281 -0.496704936
 [46] -1.071423170 -1.579018492  0.612677002  0.874966540 -1.104611502
 [51] -1.390690896 -0.578023426 -1.513807621 -1.051852374 -0.373451859
 [56] -0.035739866 -0.056600763 -1.064829678  0.767941282  1.199334945
 [61]  0.558857979 -0.084890846 -0.192267326  0.822602788 -0.084530733
 [66]  1.325080556 -1.334641559 -1.153032354 -0.332711891 -0.891193564
 [71] -0.370029591 -0.919839633 -1.028558576 -0.009733944 -0.299643814
 [76]  0.915545067 -0.732803312  2.316032198 -0.203097034 -1.260982567
 [81] -0.330209916  0.876544180  1.386560681  0.281441037 -0.830886034
 [86]  0.458462630  1.252193558 -0.656102701 -1.557706225 -0.896642253
 [91] -0.421324243 -0.144120513  3.156404999 -1.052954376  1.591355001
 [96]  2.441406655 -1.076923781 -1.179765754  1.275725206  0.799730341
> colMedians(tmp)
  [1]  1.342186071  0.405476290  0.143423631 -0.428192758 -1.198507530
  [6] -0.671285263 -0.591225655 -1.240711471  1.451828887  1.893710789
 [11] -0.874588599 -0.516782151  1.035513541 -1.896114031  0.163446642
 [16] -1.356069159 -0.253496715  0.144070348  1.077437629 -0.630622400
 [21]  0.678939400 -0.479561395 -0.756501512 -0.997142235 -0.184925351
 [26] -0.025596298 -1.189825378  1.254692398  0.261064766 -0.365016295
 [31] -1.078765258  0.713831505  0.962757584 -0.957813646  0.248019051
 [36] -1.159799220  0.188590545 -1.509893067 -0.381099274  0.728201930
 [41] -0.035145259  1.231859260  0.464337852 -0.473693281 -0.496704936
 [46] -1.071423170 -1.579018492  0.612677002  0.874966540 -1.104611502
 [51] -1.390690896 -0.578023426 -1.513807621 -1.051852374 -0.373451859
 [56] -0.035739866 -0.056600763 -1.064829678  0.767941282  1.199334945
 [61]  0.558857979 -0.084890846 -0.192267326  0.822602788 -0.084530733
 [66]  1.325080556 -1.334641559 -1.153032354 -0.332711891 -0.891193564
 [71] -0.370029591 -0.919839633 -1.028558576 -0.009733944 -0.299643814
 [76]  0.915545067 -0.732803312  2.316032198 -0.203097034 -1.260982567
 [81] -0.330209916  0.876544180  1.386560681  0.281441037 -0.830886034
 [86]  0.458462630  1.252193558 -0.656102701 -1.557706225 -0.896642253
 [91] -0.421324243 -0.144120513  3.156404999 -1.052954376  1.591355001
 [96]  2.441406655 -1.076923781 -1.179765754  1.275725206  0.799730341
> colRanges(tmp)
         [,1]      [,2]      [,3]       [,4]      [,5]       [,6]       [,7]
[1,] 1.342186 0.4054763 0.1434236 -0.4281928 -1.198508 -0.6712853 -0.5912257
[2,] 1.342186 0.4054763 0.1434236 -0.4281928 -1.198508 -0.6712853 -0.5912257
          [,8]     [,9]    [,10]      [,11]      [,12]    [,13]     [,14]
[1,] -1.240711 1.451829 1.893711 -0.8745886 -0.5167822 1.035514 -1.896114
[2,] -1.240711 1.451829 1.893711 -0.8745886 -0.5167822 1.035514 -1.896114
         [,15]     [,16]      [,17]     [,18]    [,19]      [,20]     [,21]
[1,] 0.1634466 -1.356069 -0.2534967 0.1440703 1.077438 -0.6306224 0.6789394
[2,] 0.1634466 -1.356069 -0.2534967 0.1440703 1.077438 -0.6306224 0.6789394
          [,22]      [,23]      [,24]      [,25]      [,26]     [,27]    [,28]
[1,] -0.4795614 -0.7565015 -0.9971422 -0.1849254 -0.0255963 -1.189825 1.254692
[2,] -0.4795614 -0.7565015 -0.9971422 -0.1849254 -0.0255963 -1.189825 1.254692
         [,29]      [,30]     [,31]     [,32]     [,33]      [,34]     [,35]
[1,] 0.2610648 -0.3650163 -1.078765 0.7138315 0.9627576 -0.9578136 0.2480191
[2,] 0.2610648 -0.3650163 -1.078765 0.7138315 0.9627576 -0.9578136 0.2480191
         [,36]     [,37]     [,38]      [,39]     [,40]       [,41]    [,42]
[1,] -1.159799 0.1885905 -1.509893 -0.3810993 0.7282019 -0.03514526 1.231859
[2,] -1.159799 0.1885905 -1.509893 -0.3810993 0.7282019 -0.03514526 1.231859
         [,43]      [,44]      [,45]     [,46]     [,47]    [,48]     [,49]
[1,] 0.4643379 -0.4736933 -0.4967049 -1.071423 -1.579018 0.612677 0.8749665
[2,] 0.4643379 -0.4736933 -0.4967049 -1.071423 -1.579018 0.612677 0.8749665
         [,50]     [,51]      [,52]     [,53]     [,54]      [,55]       [,56]
[1,] -1.104612 -1.390691 -0.5780234 -1.513808 -1.051852 -0.3734519 -0.03573987
[2,] -1.104612 -1.390691 -0.5780234 -1.513808 -1.051852 -0.3734519 -0.03573987
           [,57]    [,58]     [,59]    [,60]    [,61]       [,62]      [,63]
[1,] -0.05660076 -1.06483 0.7679413 1.199335 0.558858 -0.08489085 -0.1922673
[2,] -0.05660076 -1.06483 0.7679413 1.199335 0.558858 -0.08489085 -0.1922673
         [,64]       [,65]    [,66]     [,67]     [,68]      [,69]      [,70]
[1,] 0.8226028 -0.08453073 1.325081 -1.334642 -1.153032 -0.3327119 -0.8911936
[2,] 0.8226028 -0.08453073 1.325081 -1.334642 -1.153032 -0.3327119 -0.8911936
          [,71]      [,72]     [,73]        [,74]      [,75]     [,76]
[1,] -0.3700296 -0.9198396 -1.028559 -0.009733944 -0.2996438 0.9155451
[2,] -0.3700296 -0.9198396 -1.028559 -0.009733944 -0.2996438 0.9155451
          [,77]    [,78]     [,79]     [,80]      [,81]     [,82]    [,83]
[1,] -0.7328033 2.316032 -0.203097 -1.260983 -0.3302099 0.8765442 1.386561
[2,] -0.7328033 2.316032 -0.203097 -1.260983 -0.3302099 0.8765442 1.386561
        [,84]     [,85]     [,86]    [,87]      [,88]     [,89]      [,90]
[1,] 0.281441 -0.830886 0.4584626 1.252194 -0.6561027 -1.557706 -0.8966423
[2,] 0.281441 -0.830886 0.4584626 1.252194 -0.6561027 -1.557706 -0.8966423
          [,91]      [,92]    [,93]     [,94]    [,95]    [,96]     [,97]
[1,] -0.4213242 -0.1441205 3.156405 -1.052954 1.591355 2.441407 -1.076924
[2,] -0.4213242 -0.1441205 3.156405 -1.052954 1.591355 2.441407 -1.076924
         [,98]    [,99]    [,100]
[1,] -1.179766 1.275725 0.7997303
[2,] -1.179766 1.275725 0.7997303
> 
> 
> Max(tmp2)
[1] 2.614981
> Min(tmp2)
[1] -2.137145
> mean(tmp2)
[1] 0.01069387
> Sum(tmp2)
[1] 1.069387
> Var(tmp2)
[1] 0.7594051
> 
> rowMeans(tmp2)
  [1] -0.13002443 -0.25814740  0.47354531 -0.26194947 -0.91270887  0.15990690
  [7]  0.09012328 -0.22423922 -0.13113738  0.55106054  0.91826042  1.87405340
 [13] -0.02252850 -0.34083228  0.33273975  0.29545588  0.74044667 -0.84452942
 [19]  0.19815508 -0.90489049  0.61336678  0.55300563 -0.09551172 -1.68509379
 [25]  1.22131331  0.07216297  0.51336844  0.05647291 -1.23662047  1.45754807
 [31] -1.87102955 -0.93382329  1.04242673 -1.67901262 -0.72815716 -0.89077773
 [37]  0.49288142  0.40672527  0.15262280 -0.40662654  0.91942759 -0.34680989
 [43]  2.00848072 -1.27086803 -0.41137592  0.43267158 -0.31905534  0.97542870
 [49] -0.24227801 -0.53494700 -0.10584613 -0.79813476 -0.79830509 -0.22951864
 [55] -0.34106835 -1.14653803 -0.21343390 -0.31220541 -1.19295102  0.32067242
 [61]  0.24056237  0.06785225  2.61498074  0.48703321 -0.08270527  0.03390582
 [67] -1.12548804  0.89028124 -2.13714533 -0.95867846  0.07768064 -1.37212171
 [73]  0.55897186 -0.31167682  0.90691054 -0.86689852  1.52412871 -0.34254322
 [79] -0.18138014 -0.66711651 -0.27547686  0.07480019 -0.12336662  0.25431115
 [85]  0.72206374  0.34319532 -0.26893069  0.78147242  0.27734149 -0.61910276
 [91]  2.28834163  2.10900177 -0.09590038  0.74121952  0.25442614  0.15749183
 [97] -0.79080500  0.65317199  0.02633120  0.15190113
> rowSums(tmp2)
  [1] -0.13002443 -0.25814740  0.47354531 -0.26194947 -0.91270887  0.15990690
  [7]  0.09012328 -0.22423922 -0.13113738  0.55106054  0.91826042  1.87405340
 [13] -0.02252850 -0.34083228  0.33273975  0.29545588  0.74044667 -0.84452942
 [19]  0.19815508 -0.90489049  0.61336678  0.55300563 -0.09551172 -1.68509379
 [25]  1.22131331  0.07216297  0.51336844  0.05647291 -1.23662047  1.45754807
 [31] -1.87102955 -0.93382329  1.04242673 -1.67901262 -0.72815716 -0.89077773
 [37]  0.49288142  0.40672527  0.15262280 -0.40662654  0.91942759 -0.34680989
 [43]  2.00848072 -1.27086803 -0.41137592  0.43267158 -0.31905534  0.97542870
 [49] -0.24227801 -0.53494700 -0.10584613 -0.79813476 -0.79830509 -0.22951864
 [55] -0.34106835 -1.14653803 -0.21343390 -0.31220541 -1.19295102  0.32067242
 [61]  0.24056237  0.06785225  2.61498074  0.48703321 -0.08270527  0.03390582
 [67] -1.12548804  0.89028124 -2.13714533 -0.95867846  0.07768064 -1.37212171
 [73]  0.55897186 -0.31167682  0.90691054 -0.86689852  1.52412871 -0.34254322
 [79] -0.18138014 -0.66711651 -0.27547686  0.07480019 -0.12336662  0.25431115
 [85]  0.72206374  0.34319532 -0.26893069  0.78147242  0.27734149 -0.61910276
 [91]  2.28834163  2.10900177 -0.09590038  0.74121952  0.25442614  0.15749183
 [97] -0.79080500  0.65317199  0.02633120  0.15190113
> rowVars(tmp2)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowSd(tmp2)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowMax(tmp2)
  [1] -0.13002443 -0.25814740  0.47354531 -0.26194947 -0.91270887  0.15990690
  [7]  0.09012328 -0.22423922 -0.13113738  0.55106054  0.91826042  1.87405340
 [13] -0.02252850 -0.34083228  0.33273975  0.29545588  0.74044667 -0.84452942
 [19]  0.19815508 -0.90489049  0.61336678  0.55300563 -0.09551172 -1.68509379
 [25]  1.22131331  0.07216297  0.51336844  0.05647291 -1.23662047  1.45754807
 [31] -1.87102955 -0.93382329  1.04242673 -1.67901262 -0.72815716 -0.89077773
 [37]  0.49288142  0.40672527  0.15262280 -0.40662654  0.91942759 -0.34680989
 [43]  2.00848072 -1.27086803 -0.41137592  0.43267158 -0.31905534  0.97542870
 [49] -0.24227801 -0.53494700 -0.10584613 -0.79813476 -0.79830509 -0.22951864
 [55] -0.34106835 -1.14653803 -0.21343390 -0.31220541 -1.19295102  0.32067242
 [61]  0.24056237  0.06785225  2.61498074  0.48703321 -0.08270527  0.03390582
 [67] -1.12548804  0.89028124 -2.13714533 -0.95867846  0.07768064 -1.37212171
 [73]  0.55897186 -0.31167682  0.90691054 -0.86689852  1.52412871 -0.34254322
 [79] -0.18138014 -0.66711651 -0.27547686  0.07480019 -0.12336662  0.25431115
 [85]  0.72206374  0.34319532 -0.26893069  0.78147242  0.27734149 -0.61910276
 [91]  2.28834163  2.10900177 -0.09590038  0.74121952  0.25442614  0.15749183
 [97] -0.79080500  0.65317199  0.02633120  0.15190113
> rowMin(tmp2)
  [1] -0.13002443 -0.25814740  0.47354531 -0.26194947 -0.91270887  0.15990690
  [7]  0.09012328 -0.22423922 -0.13113738  0.55106054  0.91826042  1.87405340
 [13] -0.02252850 -0.34083228  0.33273975  0.29545588  0.74044667 -0.84452942
 [19]  0.19815508 -0.90489049  0.61336678  0.55300563 -0.09551172 -1.68509379
 [25]  1.22131331  0.07216297  0.51336844  0.05647291 -1.23662047  1.45754807
 [31] -1.87102955 -0.93382329  1.04242673 -1.67901262 -0.72815716 -0.89077773
 [37]  0.49288142  0.40672527  0.15262280 -0.40662654  0.91942759 -0.34680989
 [43]  2.00848072 -1.27086803 -0.41137592  0.43267158 -0.31905534  0.97542870
 [49] -0.24227801 -0.53494700 -0.10584613 -0.79813476 -0.79830509 -0.22951864
 [55] -0.34106835 -1.14653803 -0.21343390 -0.31220541 -1.19295102  0.32067242
 [61]  0.24056237  0.06785225  2.61498074  0.48703321 -0.08270527  0.03390582
 [67] -1.12548804  0.89028124 -2.13714533 -0.95867846  0.07768064 -1.37212171
 [73]  0.55897186 -0.31167682  0.90691054 -0.86689852  1.52412871 -0.34254322
 [79] -0.18138014 -0.66711651 -0.27547686  0.07480019 -0.12336662  0.25431115
 [85]  0.72206374  0.34319532 -0.26893069  0.78147242  0.27734149 -0.61910276
 [91]  2.28834163  2.10900177 -0.09590038  0.74121952  0.25442614  0.15749183
 [97] -0.79080500  0.65317199  0.02633120  0.15190113
> 
> colMeans(tmp2)
[1] 0.01069387
> colSums(tmp2)
[1] 1.069387
> colVars(tmp2)
[1] 0.7594051
> colSd(tmp2)
[1] 0.8714385
> colMax(tmp2)
[1] 2.614981
> colMin(tmp2)
[1] -2.137145
> colMedians(tmp2)
[1] 0.001901348
> colRanges(tmp2)
          [,1]
[1,] -2.137145
[2,]  2.614981
> 
> dataset1 <- matrix(dataset1,1,100)
> 
> agree.checks(tmp,dataset1)
> 
> dataset2 <- matrix(dataset2,100,1)
> agree.checks(tmp2,dataset2)
>   
> 
> tmp <- createBufferedMatrix(10,10)
> 
> tmp[1:10,1:10] <- rnorm(100)
> colApply(tmp,sum)
 [1] -0.8152502  4.7082813  1.7287692 -3.3266602  2.1335096  0.7206044
 [7] -3.8494696  2.3468110  3.8707600 -1.8162136
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -1.1888914
[2,] -0.4126422
[3,] -0.1530904
[4,]  0.2516697
[5,]  1.1195723
> 
> rowApply(tmp,sum)
 [1]  6.4930067  2.7715804  3.7535116 -2.0968814 -3.1178205  3.5308230
 [7] -0.9548240 -0.6415183 -0.5369104 -3.4998251
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    7    2    3    9    7    6    5    7    1     3
 [2,]    3   10    9    6    3    4    9    6    2     7
 [3,]    4    7   10    1    4    5   10    2    5     8
 [4,]    5    3    6    2    1    8    7    8    3     5
 [5,]    8    4    8   10    2    3    4    9    7    10
 [6,]    9    5    2    3    9    7    8    1    4     6
 [7,]    1    1    5    4   10    2    1   10    9     1
 [8,]    6    6    7    8    5   10    3    4    6     2
 [9,]   10    8    4    5    6    9    2    3   10     9
[10,]    2    9    1    7    8    1    6    5    8     4
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1] -2.41539362 -2.19448382 -1.27210451 -0.35535019  2.56834307 -2.98447503
 [7]  0.07784473 -5.77158669 -2.69543768 -2.72458939  1.69782884  0.78904782
[13] -1.96722383  2.66949609  3.64035475 -2.94922501 -4.08737179  0.19650196
[19]  1.70274695 -0.06737703
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -2.2604277
[2,] -1.1340189
[3,] -0.1755192
[4,]  0.2261302
[5,]  0.9284420
> 
> rowApply(tmp,sum)
[1] -12.1139761  -0.4015511   0.1295677   0.2113549  -3.9678498
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]   14    4   10   14    1
[2,]    8   14    2   12   11
[3,]    3   13   12   20    3
[4,]   19    9    4    4   18
[5,]    6   16    7   19   17
> 
> 
> as.matrix(tmp)
           [,1]       [,2]       [,3]       [,4]       [,5]       [,6]
[1,] -0.1755192 -0.7932540 -1.7851274  0.6093828 -1.1825196 -0.8990787
[2,] -1.1340189  0.3485424  0.1756472 -0.3407186  0.7258731  0.6281967
[3,]  0.2261302 -1.7494036  0.3245267 -1.0180380 -0.2292904 -2.4110125
[4,]  0.9284420  0.1922683  1.7990489 -1.3078280  1.6867958  1.0404469
[5,] -2.2604277 -0.1926370 -1.7861999  1.7018516  1.5674842 -1.3430274
           [,7]       [,8]        [,9]      [,10]      [,11]      [,12]
[1,] -0.3667918 -0.5484237 -2.44720005 -0.6905046 -0.5351389 -0.4216299
[2,] -1.1998716 -1.4925068 -0.23582437 -0.6933370  1.1638051 -0.4149211
[3,]  1.2272470 -0.5432812  0.52120328  0.4629890 -0.4383188  0.3057002
[4,]  1.3887925 -1.8567551 -0.58114825 -0.6471412  0.5581203 -0.5399838
[5,] -0.9715314 -1.3306199  0.04753172 -1.1565956  0.9493610  1.8598825
          [,13]      [,14]      [,15]       [,16]       [,17]      [,18]
[1,]  0.2244148  0.3001414  0.6491275 -1.39219476 -1.80730124  0.5045073
[2,] -1.3547508  2.0197467 -0.8708172 -0.63552006  0.05378536  0.1647884
[3,]  0.7374330  0.6379179  0.3919468  0.10152355  1.08596781 -1.0342521
[4,] -1.3604273 -0.8231540  1.3266833 -0.97559034 -1.58991262  1.3799917
[5,] -0.2138934  0.5348441  2.1434143 -0.04744341 -1.82991109 -0.8185334
            [,19]      [,20]
[1,]  0.007690469 -1.3645565
[2,]  1.349235556  1.3411148
[3,]  1.338634234  0.1919445
[4,] -0.284885483 -0.1224087
[5,] -0.707927820 -0.1134711
> 
> 
> is.BufferedMatrix(tmp)
[1] TRUE
> 
> as.BufferedMatrix(as.matrix(tmp))
BufferedMatrix object
Matrix size:  5 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  800  bytes.
> 
> 
> 
> subBufferedMatrix(tmp,1:5,1:5)
BufferedMatrix object
Matrix size:  5 5 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  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.23-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  563  bytes.
Disk usage :  160  bytes.
> subBufferedMatrix(tmp,1:3,)
BufferedMatrix object
Matrix size:  3 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  480  bytes.
> 
> 
> rm(tmp)
> 
> 
> ###
> ### Testing colnames and rownames
> ###
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> 
> 
> colnames(tmp)
NULL
> rownames(tmp)
NULL
> 
> 
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> colnames(tmp)
 [1] "col1"  "col2"  "col3"  "col4"  "col5"  "col6"  "col7"  "col8"  "col9" 
[10] "col10" "col11" "col12" "col13" "col14" "col15" "col16" "col17" "col18"
[19] "col19" "col20"
> rownames(tmp)
[1] "row1" "row2" "row3" "row4" "row5"
> 
> 
> tmp["row1",]
         col1      col2       col3      col4      col5     col6       col7
row1 2.171059 -2.413856 -0.9235876 0.6196686 0.1275446 1.038135 -0.8095386
          col8      col9       col10      col11    col12    col13     col14
row1 0.9801068 -1.024938 -0.03707671 -0.3228543 1.408282 1.661765 0.4571003
          col15     col16     col17     col18     col19      col20
row1 -0.8267638 -2.570602 0.7988902 0.6563176 -0.851568 0.06341582
> tmp[,"col10"]
           col10
row1 -0.03707671
row2 -0.49263872
row3  1.29556201
row4 -1.41815466
row5 -1.21396436
> tmp[c("row1","row5"),]
         col1       col2        col3         col4      col5       col6
row1 2.171059 -2.4138560 -0.92358762  0.619668636 0.1275446  1.0381346
row5 1.963940 -0.5588693  0.02230326 -0.006004083 0.7790919 -0.1077628
           col7      col8       col9       col10      col11     col12     col13
row1 -0.8095386 0.9801068 -1.0249381 -0.03707671 -0.3228543 1.4082821 1.6617648
row5  0.3404395 0.3393409  0.6907754 -1.21396436  1.1350557 0.6837736 0.1833921
         col14      col15     col16      col17     col18     col19       col20
row1 0.4571003 -0.8267638 -2.570602  0.7988902 0.6563176 -0.851568  0.06341582
row5 0.6757700  0.2417631 -1.286259 -0.8928982 1.1826362  1.243497 -1.55124161
> tmp[,c("col6","col20")]
            col6       col20
row1  1.03813459  0.06341582
row2  0.03115066 -0.38868707
row3  0.94698575  0.16551075
row4  0.31827011 -0.80172073
row5 -0.10776283 -1.55124161
> tmp[c("row1","row5"),c("col6","col20")]
           col6       col20
row1  1.0381346  0.06341582
row5 -0.1077628 -1.55124161
> 
> 
> 
> 
> 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.23933 51.08978 49.06182 49.80412 51.24361 103.7719 50.61719 50.97961
         col9    col10    col11    col12    col13    col14    col15    col16
row1 51.76202 51.49776 50.74337 50.91162 50.01894 50.17812 48.94738 50.35515
        col17    col18    col19    col20
row1 50.36903 47.24925 50.06849 103.4344
> tmp[,"col10"]
        col10
row1 51.49776
row2 30.97341
row3 30.73427
row4 29.87367
row5 50.30139
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 50.23933 51.08978 49.06182 49.80412 51.24361 103.7719 50.61719 50.97961
row5 51.44909 49.81278 50.27656 50.92459 50.96366 102.7600 50.41635 48.96374
         col9    col10    col11    col12    col13    col14    col15    col16
row1 51.76202 51.49776 50.74337 50.91162 50.01894 50.17812 48.94738 50.35515
row5 48.86582 50.30139 49.65961 49.18575 50.67488 50.15293 49.92158 48.82224
        col17    col18    col19    col20
row1 50.36903 47.24925 50.06849 103.4344
row5 50.26546 49.92092 50.20098 104.8622
> tmp[,c("col6","col20")]
          col6     col20
row1 103.77188 103.43437
row2  74.77467  74.38765
row3  75.57184  75.58832
row4  74.00705  75.40541
row5 102.75995 104.86221
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 103.7719 103.4344
row5 102.7600 104.8622
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 103.7719 103.4344
row5 102.7600 104.8622
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
          col13
[1,]  0.7011745
[2,]  0.9255115
[3,] -0.8490669
[4,] -2.5370561
[5,] -0.4425829
> tmp[,c("col17","col7")]
           col17        col7
[1,]  0.32005322  0.66265695
[2,] -0.54526413 -1.72138082
[3,]  2.35532829  0.62318859
[4,]  0.04041298 -0.55979262
[5,]  0.65757379 -0.04612161
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
           col6      col20
[1,] -0.8967309  1.8367309
[2,] -1.0477250 -0.8567533
[3,]  1.0534434 -1.3325481
[4,]  0.2119678  2.3319693
[5,]  1.6751792  0.5696110
> subBufferedMatrix(tmp,1,c("col6"))[,1]
           col1
[1,] -0.8967309
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
           col6
[1,] -0.8967309
[2,] -1.0477250
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> 
> 
> 
> subBufferedMatrix(tmp,c("row3","row1"),)[,1:20]
           [,1]       [,2]       [,3]       [,4]       [,5]       [,6]
row3 -0.6142798 -1.4732863 0.56191950  0.7997741 -0.1622376 -0.4877832
row1 -2.4149039 -0.5770603 0.07179334 -1.1755786 -0.4281657  0.2942033
          [,7]     [,8]       [,9]      [,10]       [,11]       [,12]    [,13]
row3 0.1212236 1.255964  1.3738945  1.6419834  0.06367854  0.08553279 1.200565
row1 0.4215175 1.571407 -0.7122881 -0.3628237 -0.09151942 -1.18998584 1.510799
           [,14]       [,15]     [,16]     [,17]      [,18]     [,19]
row3 -0.06181995 -0.18160644 -1.588009  0.128168  0.2896022 0.5879082
row1 -1.69402237 -0.06817295 -1.252819 -0.736782 -0.3341686 0.5968263
          [,20]
row3  0.1302014
row1 -0.6179223
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
          [,1]      [,2]      [,3]      [,4]      [,5]    [,6]       [,7]
row2 0.3248256 0.1894585 0.2618598 0.1856213 -1.398823 1.39981 -0.2249799
          [,8]     [,9]     [,10]
row2 0.4877474 0.305588 0.4150744
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
           [,1]       [,2]       [,3]     [,4]      [,5]        [,6]       [,7]
row5 -0.2606892 -0.2946451 0.06188595 -1.44609 0.4010695 -0.09234726 -0.7361287
          [,8]      [,9]     [,10]     [,11]      [,12]     [,13]      [,14]
row5 0.9263684 -1.747332 0.4895562 0.6443372 -0.1080067 0.8819117 -0.0694434
            [,15]     [,16]      [,17]     [,18]    [,19]     [,20]
row5 -0.007278831 0.1672184 -0.5034705 0.7452215 1.181952 -1.498671
> 
> 
> 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: 0x6000007a0660>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM33f159f7b703"
 [2] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM33f11610541a"
 [3] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM33f1a018247" 
 [4] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM33f169100872"
 [5] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM33f11b9aaa41"
 [6] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM33f1471f9f8f"
 [7] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM33f16d2489c3"
 [8] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM33f179d0992f"
 [9] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM33f16df91b23"
[10] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM33f17d64cf3c"
[11] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM33f16561ac74"
[12] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM33f16f8127ab"
[13] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM33f185384be" 
[14] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM33f1232fda37"
[15] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM33f11a9f62ed"
> 
> 
> ### 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: 0x6000007a8240>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x6000007a8240>
Warning message:
In dir.create(new.directory) :
  '/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x6000007a8240>
> rowMedians(tmp)
  [1] -0.320720823  0.009843841  0.363779331  0.566097339 -0.079381372
  [6]  0.465412783  0.110292491 -0.194465974 -0.030050490 -0.028105446
 [11]  0.133399847 -0.380060084  0.172020431  0.084816908 -0.710613953
 [16] -0.283268168  0.426381281  0.101504830  0.454853598 -0.222052452
 [21] -0.461216020 -0.022438151  0.342979011  0.101745206  0.458010241
 [26]  0.065339381  0.140638310 -0.591966010  0.262107935  0.558343916
 [31]  0.027773417  0.352322679  0.751900976  0.070618134  0.211596896
 [36] -0.076730683 -0.567065122 -0.537139618  0.549901142  0.294336519
 [41]  0.184433369 -0.250002467 -0.383709443 -0.136736935  0.436115991
 [46]  0.303168175 -0.173088620 -0.008196378  0.030937495  0.022592869
 [51]  0.171584619  0.169295649  0.134116385 -0.233003274  0.284759454
 [56]  0.622714099 -0.315384038 -0.447846278 -0.258901210 -0.556786046
 [61] -0.063234946 -0.206808638 -0.379798958 -0.204497169  0.300321096
 [66] -0.176729160 -0.073800881 -0.526003506  0.062566534 -0.104062300
 [71]  0.681990816 -0.117226299  0.227636568  0.101930076 -0.040995407
 [76] -0.294098579 -0.020524403 -0.538477164 -0.129813940 -0.090439125
 [81]  0.138577172 -0.560812110 -0.319296868 -0.070902275  0.383998632
 [86]  0.166523475 -0.101310358  0.017449723  0.055087349 -0.391809233
 [91] -0.334691720  0.286598384  0.260654158 -0.049227018 -0.110581154
 [96]  0.071963481 -0.126350503  0.677341907  0.408551590 -0.407644065
[101]  0.110478100 -0.446369983 -0.203345981  0.095111268 -0.295151879
[106] -0.234779212  0.488400323 -0.460025468 -0.273175856  0.101510350
[111]  0.184606454 -0.095659864 -0.215685374 -0.083096635 -0.185398294
[116] -0.227665209  0.064566995 -0.497718101 -0.304001897  0.007667961
[121]  0.504239567  0.040381232  0.035038057 -0.153079330  0.593313124
[126] -0.214691783  0.390540535  0.153811474 -0.148113861  0.159170273
[131]  0.477875738 -0.580106869 -0.482817396  0.133867401 -0.562396982
[136] -0.184218498 -0.130353815  0.068513837 -0.514450189  0.285896202
[141]  0.129935936 -0.206186715  0.237075579 -0.380644367  0.202115950
[146]  0.595042652  0.330253979  0.276179384 -0.178839625  0.115585547
[151] -0.254024176 -0.876414809  0.045797428  0.437319623 -0.136119863
[156] -0.545589356 -0.069658644  0.098342782  0.020958493  0.036661373
[161] -0.232186215  0.182244686 -0.235364026  0.217803462 -0.449150803
[166]  0.285509565  0.116511275  0.114177166  0.354810300  0.317192294
[171] -0.318318835 -0.267349099  0.103976523 -0.354483847 -0.269111924
[176]  0.283131715  0.217701326  0.612900875  0.034351611  0.026542691
[181]  0.649137194 -0.427735641  0.273877596  0.125601326 -0.109600597
[186]  0.017344020  0.310250741 -0.286643245  0.229727179  0.383550295
[191]  0.137311966  0.359289492 -0.182673304  0.012423916  0.460259623
[196] -0.247302278  0.281289743 -0.358124954  0.030077342  0.484944289
[201] -0.257611716 -0.555600243  0.293392742 -0.470876202  0.024471642
[206] -0.010625174 -0.178402643 -0.456548325  0.091899307  0.033759038
[211]  0.850079086 -0.077668909  0.084699148  0.553518382  0.105299660
[216]  0.408519825 -0.162020520 -0.071139681  0.080596525  0.618101423
[221] -0.315975186  0.277218669  0.215257731 -0.039726851  0.095428785
[226]  0.317695541 -0.490397470 -0.207863385 -0.074188789 -0.490248458
> 
> proc.time()
   user  system elapsed 
  0.732   3.689   4.987 

BufferedMatrix.Rcheck/tests/rawCalltesting.Rout


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

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

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

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

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

Attaching package: 'BufferedMatrix'

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

    colMeans, colSums, rowMeans, rowSums

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

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

<pointer: 0x6000031c0660>
> .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: 0x6000031c0660>
> .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: 0x6000031c0660>
> .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: 0x6000031c0660>
> 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: 0x6000031d8000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000031d8000>
> .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: 0x6000031d8000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000031d8000>
> .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: 0x6000031d8000>
> 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: 0x6000031d8180>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000031d8180>
> .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: 0x6000031d8180>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x6000031d8180>
> .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: 0x6000031d8180>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x6000031d8180>
> .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: 0x6000031d8180>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x6000031d8180>
> .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: 0x6000031d8180>
> 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: 0x6000031d8360>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x6000031d8360>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000031d8360>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000031d8360>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile36e43926238f" "BufferedMatrixFile36e476e89e98"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile36e43926238f" "BufferedMatrixFile36e476e89e98"
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000031d8600>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000031d8600>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x6000031d8600>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x6000031d8600>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x6000031d8600>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x6000031d8600>
> .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: 0x6000031d87e0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000031d87e0>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x6000031d87e0>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x6000031d87e0>
> 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: 0x6000031d89c0>
> .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: 0x6000031d89c0>
> rm(P)
> 
> proc.time()
   user  system elapsed 
  0.115   0.052   0.168 

BufferedMatrix.Rcheck/tests/Rcodetesting.Rout


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

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

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

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

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

Attaching package: 'BufferedMatrix'

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

    colMeans, colSums, rowMeans, rowSums

> 
> Temp <- createBufferedMatrix(100)
> dim(Temp)
[1] 100   0
> buffer.dim(Temp)
[1] 1 1
> 
> 
> proc.time()
   user  system elapsed 
  0.145   0.044   0.188 

Example timings