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

This page was generated on 2025-11-21 11:39 -0500 (Fri, 21 Nov 2025).

HostnameOSArch (*)R versionInstalled pkgs
nebbiolo1Linux (Ubuntu 24.04.3 LTS)x86_64R Under development (unstable) (2025-10-20 r88955) -- "Unsuffered Consequences" 4829
lconwaymacOS 12.7.6 Montereyx86_64R Under development (unstable) (2025-10-21 r88958) -- "Unsuffered Consequences" 4602
kjohnson3macOS 13.7.7 Venturaarm64R Under development (unstable) (2025-11-04 r88984) -- "Unsuffered Consequences" 4566
Click on any hostname to see more info about the system (e.g. compilers)      (*) as reported by 'uname -p', except on Windows and Mac OS X

Package 252/2327HostnameOS / ArchINSTALLBUILDCHECKBUILD BIN
BufferedMatrix 1.75.0  (landing page)
Ben Bolstad
Snapshot Date: 2025-11-20 13:40 -0500 (Thu, 20 Nov 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
lconwaymacOS 12.7.6 Monterey / x86_64  OK    OK    WARNINGS    OK  UNNEEDED, same version is already published
kjohnson3macOS 13.7.7 Ventura / arm64  OK    OK    WARNINGS    OK  UNNEEDED, same version is already published


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-11-20 18:49:48 -0500 (Thu, 20 Nov 2025)
EndedAt: 2025-11-20 18:50:09 -0500 (Thu, 20 Nov 2025)
EllapsedTime: 20.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.145   0.056   0.197 

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] "Thu Nov 20 18:50:00 2025"
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> date()
[1] "Thu Nov 20 18:50:00 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: 0x6000000d80c0>
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   which.col <- sample(1:20,1)
+   if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,5,replace=TRUE)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> date()
[1] "Thu Nov 20 18:50:01 2025"
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col <- sample(1:20,5,replace=TRUE)
+   if (!all(tmp2[which.row,which.col] == test.matrix[which.row,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> date()
[1] "Thu Nov 20 18:50:02 2025"
> 
> ColMode(tmp2)
<pointer: 0x6000000d80c0>
> 
> 
> 
> ### 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,] 101.5149352 -2.6295118  1.5006137 -0.3702499
[2,]   1.1552962 -0.4628999  0.7634099  2.1158279
[3,]   0.3674865 -0.5169299 -0.6371168  0.9104944
[4,]   0.3797454 -1.2106196 -0.3594800  0.8248065
> 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 :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
            [,1]      [,2]      [,3]      [,4]
[1,] 101.5149352 2.6295118 1.5006137 0.3702499
[2,]   1.1552962 0.4628999 0.7634099 2.1158279
[3,]   0.3674865 0.5169299 0.6371168 0.9104944
[4,]   0.3797454 1.2106196 0.3594800 0.8248065
> 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 :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
           [,1]      [,2]      [,3]      [,4]
[1,] 10.0754620 1.6215770 1.2249954 0.6084816
[2,]  1.0748471 0.6803675 0.8737333 1.4545886
[3,]  0.6062067 0.7189784 0.7981960 0.9541983
[4,]  0.6162348 1.1002816 0.5995665 0.9081886
> 
> 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 :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
          [,1]     [,2]     [,3]     [,4]
[1,] 227.26956 43.84528 38.75057 31.45507
[2,]  36.90377 32.26657 34.50074 41.66171
[3,]  31.42955 32.70671 33.61908 35.45248
[4,]  31.54209 37.21344 31.35514 34.90669
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x6000000f8000>
> exp(tmp5)
<pointer: 0x6000000f8000>
> log(tmp5,2)
<pointer: 0x6000000f8000>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 473.0318
> Min(tmp5)
[1] 52.11369
> mean(tmp5)
[1] 73.21999
> Sum(tmp5)
[1] 14644
> Var(tmp5)
[1] 881.4995
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 91.29783 71.33888 73.78516 70.73928 69.02245 68.95031 72.29654 70.94542
 [9] 71.96592 71.85815
> rowSums(tmp5)
 [1] 1825.957 1426.778 1475.703 1414.786 1380.449 1379.006 1445.931 1418.908
 [9] 1439.318 1437.163
> rowVars(tmp5)
 [1] 8163.32824   58.51129   48.43534   89.90536   87.63443   67.25782
 [7]  122.20352   55.22639   66.48370   71.32617
> rowSd(tmp5)
 [1] 90.351139  7.649267  6.959550  9.481844  9.361326  8.201087 11.054570
 [8]  7.431446  8.153754  8.445482
> rowMax(tmp5)
 [1] 473.03180  86.71340  91.25483  86.63287  84.97935  85.79712  95.46568
 [8]  85.60500  85.95604  83.78188
> rowMin(tmp5)
 [1] 54.83838 60.96924 64.97636 52.11369 52.89317 57.19488 55.65000 58.41473
 [9] 55.72162 54.58087
> 
> colMeans(tmp5)
 [1] 111.99960  69.88182  72.64377  73.83917  75.42578  68.04517  70.37275
 [8]  75.92687  70.94059  70.26249  67.78739  68.68913  74.41844  76.01788
[15]  72.06378  69.56969  68.93476  69.07006  66.96844  71.54228
> colSums(tmp5)
 [1] 1119.9960  698.8182  726.4377  738.3917  754.2578  680.4517  703.7275
 [8]  759.2687  709.4059  702.6249  677.8739  686.8913  744.1844  760.1788
[15]  720.6378  695.6969  689.3476  690.7006  669.6844  715.4228
> colVars(tmp5)
 [1] 16179.23588   101.60246    66.61649   115.08151    95.70463    95.42273
 [7]    59.89363   109.31783    84.71978    67.32438    32.50000    66.99724
[13]    54.23438   129.14100    63.01167    51.10516    55.26601    71.58641
[19]    43.51570    28.44905
> colSd(tmp5)
 [1] 127.197625  10.079804   8.161892  10.727605   9.782874   9.768456
 [7]   7.739097  10.455517   9.204335   8.205143   5.700877   8.185184
[13]   7.364400  11.364022   7.937989   7.148787   7.434111   8.460875
[19]   6.596643   5.333765
> colMax(tmp5)
 [1] 473.03180  91.25821  85.60500  95.46568  87.12093  81.22044  82.11787
 [8]  84.32475  84.53878  84.02948  76.82071  81.48268  84.47912  91.25483
[15]  86.63287  83.64103  77.85717  80.94752  81.93242  81.18259
> colMin(tmp5)
 [1] 61.93722 57.67408 58.58500 63.32034 57.19488 52.89317 58.45401 55.72162
 [9] 54.83838 54.58087 60.41830 57.55737 67.90416 52.11369 62.77107 60.96924
[17] 58.19622 58.41473 60.80452 61.50112
> 
> 
> ### setting a random element to NA and then testing with na.rm=TRUE or na.rm=FALSE (The default)
> 
> 
> which.row <- sample(1:10,1,replace=TRUE)
> which.col  <- sample(1:20,1,replace=TRUE)
> 
> tmp5[which.row,which.col] <- NA
> 
> Max(tmp5)
[1] NA
> Min(tmp5)
[1] NA
> mean(tmp5)
[1] NA
> Sum(tmp5)
[1] NA
> Var(tmp5)
[1] NA
> 
> rowMeans(tmp5)
 [1] 91.29783 71.33888 73.78516 70.73928 69.02245       NA 72.29654 70.94542
 [9] 71.96592 71.85815
> rowSums(tmp5)
 [1] 1825.957 1426.778 1475.703 1414.786 1380.449       NA 1445.931 1418.908
 [9] 1439.318 1437.163
> rowVars(tmp5)
 [1] 8163.32824   58.51129   48.43534   89.90536   87.63443   69.85334
 [7]  122.20352   55.22639   66.48370   71.32617
> rowSd(tmp5)
 [1] 90.351139  7.649267  6.959550  9.481844  9.361326  8.357831 11.054570
 [8]  7.431446  8.153754  8.445482
> rowMax(tmp5)
 [1] 473.03180  86.71340  91.25483  86.63287  84.97935        NA  95.46568
 [8]  85.60500  85.95604  83.78188
> rowMin(tmp5)
 [1] 54.83838 60.96924 64.97636 52.11369 52.89317       NA 55.65000 58.41473
 [9] 55.72162 54.58087
> 
> colMeans(tmp5)
 [1] 111.99960  69.88182  72.64377  73.83917  75.42578  68.04517  70.37275
 [8]  75.92687  70.94059  70.26249  67.78739  68.68913  74.41844  76.01788
[15]  72.06378  69.56969  68.93476  69.07006  66.96844        NA
> colSums(tmp5)
 [1] 1119.9960  698.8182  726.4377  738.3917  754.2578  680.4517  703.7275
 [8]  759.2687  709.4059  702.6249  677.8739  686.8913  744.1844  760.1788
[15]  720.6378  695.6969  689.3476  690.7006  669.6844        NA
> colVars(tmp5)
 [1] 16179.23588   101.60246    66.61649   115.08151    95.70463    95.42273
 [7]    59.89363   109.31783    84.71978    67.32438    32.50000    66.99724
[13]    54.23438   129.14100    63.01167    51.10516    55.26601    71.58641
[19]    43.51570          NA
> colSd(tmp5)
 [1] 127.197625  10.079804   8.161892  10.727605   9.782874   9.768456
 [7]   7.739097  10.455517   9.204335   8.205143   5.700877   8.185184
[13]   7.364400  11.364022   7.937989   7.148787   7.434111   8.460875
[19]   6.596643         NA
> colMax(tmp5)
 [1] 473.03180  91.25821  85.60500  95.46568  87.12093  81.22044  82.11787
 [8]  84.32475  84.53878  84.02948  76.82071  81.48268  84.47912  91.25483
[15]  86.63287  83.64103  77.85717  80.94752  81.93242        NA
> colMin(tmp5)
 [1] 61.93722 57.67408 58.58500 63.32034 57.19488 52.89317 58.45401 55.72162
 [9] 54.83838 54.58087 60.41830 57.55737 67.90416 52.11369 62.77107 60.96924
[17] 58.19622 58.41473 60.80452       NA
> 
> Max(tmp5,na.rm=TRUE)
[1] 473.0318
> Min(tmp5,na.rm=TRUE)
[1] 52.11369
> mean(tmp5,na.rm=TRUE)
[1] 73.21925
> Sum(tmp5,na.rm=TRUE)
[1] 14570.63
> Var(tmp5,na.rm=TRUE)
[1] 885.9514
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 91.29783 71.33888 73.78516 70.73928 69.02245 68.71782 72.29654 70.94542
 [9] 71.96592 71.85815
> rowSums(tmp5,na.rm=TRUE)
 [1] 1825.957 1426.778 1475.703 1414.786 1380.449 1305.639 1445.931 1418.908
 [9] 1439.318 1437.163
> rowVars(tmp5,na.rm=TRUE)
 [1] 8163.32824   58.51129   48.43534   89.90536   87.63443   69.85334
 [7]  122.20352   55.22639   66.48370   71.32617
> rowSd(tmp5,na.rm=TRUE)
 [1] 90.351139  7.649267  6.959550  9.481844  9.361326  8.357831 11.054570
 [8]  7.431446  8.153754  8.445482
> rowMax(tmp5,na.rm=TRUE)
 [1] 473.03180  86.71340  91.25483  86.63287  84.97935  85.79712  95.46568
 [8]  85.60500  85.95604  83.78188
> rowMin(tmp5,na.rm=TRUE)
 [1] 54.83838 60.96924 64.97636 52.11369 52.89317 57.19488 55.65000 58.41473
 [9] 55.72162 54.58087
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 111.99960  69.88182  72.64377  73.83917  75.42578  68.04517  70.37275
 [8]  75.92687  70.94059  70.26249  67.78739  68.68913  74.41844  76.01788
[15]  72.06378  69.56969  68.93476  69.07006  66.96844  71.33948
> colSums(tmp5,na.rm=TRUE)
 [1] 1119.9960  698.8182  726.4377  738.3917  754.2578  680.4517  703.7275
 [8]  759.2687  709.4059  702.6249  677.8739  686.8913  744.1844  760.1788
[15]  720.6378  695.6969  689.3476  690.7006  669.6844  642.0553
> colVars(tmp5,na.rm=TRUE)
 [1] 16179.23588   101.60246    66.61649   115.08151    95.70463    95.42273
 [7]    59.89363   109.31783    84.71978    67.32438    32.50000    66.99724
[13]    54.23438   129.14100    63.01167    51.10516    55.26601    71.58641
[19]    43.51570    31.54248
> colSd(tmp5,na.rm=TRUE)
 [1] 127.197625  10.079804   8.161892  10.727605   9.782874   9.768456
 [7]   7.739097  10.455517   9.204335   8.205143   5.700877   8.185184
[13]   7.364400  11.364022   7.937989   7.148787   7.434111   8.460875
[19]   6.596643   5.616270
> colMax(tmp5,na.rm=TRUE)
 [1] 473.03180  91.25821  85.60500  95.46568  87.12093  81.22044  82.11787
 [8]  84.32475  84.53878  84.02948  76.82071  81.48268  84.47912  91.25483
[15]  86.63287  83.64103  77.85717  80.94752  81.93242  81.18259
> colMin(tmp5,na.rm=TRUE)
 [1] 61.93722 57.67408 58.58500 63.32034 57.19488 52.89317 58.45401 55.72162
 [9] 54.83838 54.58087 60.41830 57.55737 67.90416 52.11369 62.77107 60.96924
[17] 58.19622 58.41473 60.80452 61.50112
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1] 91.29783 71.33888 73.78516 70.73928 69.02245      NaN 72.29654 70.94542
 [9] 71.96592 71.85815
> rowSums(tmp5,na.rm=TRUE)
 [1] 1825.957 1426.778 1475.703 1414.786 1380.449    0.000 1445.931 1418.908
 [9] 1439.318 1437.163
> rowVars(tmp5,na.rm=TRUE)
 [1] 8163.32824   58.51129   48.43534   89.90536   87.63443         NA
 [7]  122.20352   55.22639   66.48370   71.32617
> rowSd(tmp5,na.rm=TRUE)
 [1] 90.351139  7.649267  6.959550  9.481844  9.361326        NA 11.054570
 [8]  7.431446  8.153754  8.445482
> rowMax(tmp5,na.rm=TRUE)
 [1] 473.03180  86.71340  91.25483  86.63287  84.97935        NA  95.46568
 [8]  85.60500  85.95604  83.78188
> rowMin(tmp5,na.rm=TRUE)
 [1] 54.83838 60.96924 64.97636 52.11369 52.89317       NA 55.65000 58.41473
 [9] 55.72162 54.58087
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1] 114.91099  68.91797  74.20586  74.77758  77.45143  68.00253  71.69706
 [8]  75.70188  71.03768  70.24448  68.60617  68.72269  74.93247  76.41960
[15]  70.86147  69.81390  69.92770  68.73273  67.58439       NaN
> colSums(tmp5,na.rm=TRUE)
 [1] 1034.1989  620.2617  667.8527  672.9982  697.0629  612.0228  645.2735
 [8]  681.3170  639.3391  632.2003  617.4556  618.5042  674.3922  687.7764
[15]  637.7533  628.3251  629.3493  618.5946  608.2595    0.0000
> colVars(tmp5,na.rm=TRUE)
 [1] 18106.28341   103.85142    47.49227   119.55973    61.50582   107.33011
 [7]    47.65027   122.41308    95.20371    75.73627    29.02035    75.35922
[13]    58.04123   143.46810    54.62581    56.82235    51.08254    79.25452
[19]    44.68699          NA
> colSd(tmp5,na.rm=TRUE)
 [1] 134.559591  10.190752   6.891464  10.934337   7.842565  10.360025
 [7]   6.902918  11.064044   9.757239   8.702659   5.387054   8.680969
[13]   7.618480  11.977817   7.390928   7.538060   7.147205   8.902501
[19]   6.684832         NA
> colMax(tmp5,na.rm=TRUE)
 [1] 473.03180  91.25821  85.60500  95.46568  87.12093  81.22044  82.11787
 [8]  84.32475  84.53878  84.02948  76.82071  81.48268  84.47912  91.25483
[15]  86.63287  83.64103  77.85717  80.94752  81.93242      -Inf
> colMin(tmp5,na.rm=TRUE)
 [1] 61.93722 57.67408 65.26163 63.32034 65.60075 52.89317 62.97123 55.72162
 [9] 54.83838 54.58087 61.41214 57.55737 67.90416 52.11369 62.77107 60.96924
[17] 58.19622 58.41473 60.80452      Inf
> 
> 
> 
> 
> copymatrix <- matrix(rnorm(200,150,15),10,20)
> 
> tmp5[1:10,1:20] <- copymatrix
> which.row <- 3
> which.col  <- 1
> cat(which.row," ",which.col,"\n")
3   1 
> tmp5[which.row,which.col] <- NA
> copymatrix[which.row,which.col] <- NA
> 
> rowVars(tmp5,na.rm=TRUE)
 [1] 185.1189 192.9699 202.6973 267.9465 221.3232 224.8391 307.5763 284.3054
 [9] 220.7933 233.8491
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 185.1189 192.9699 202.6973 267.9465 221.3232 224.8391 307.5763 284.3054
 [9] 220.7933 233.8491
> 
> 
> 
> 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] -1.136868e-13  5.684342e-14 -2.273737e-13 -5.684342e-14  0.000000e+00
 [6]  5.684342e-14 -1.136868e-13  8.526513e-14  5.684342e-14  2.842171e-14
[11]  1.136868e-13  0.000000e+00  1.136868e-13  1.421085e-14 -5.684342e-14
[16]  1.136868e-13  7.105427e-14 -1.136868e-13 -5.684342e-14 -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)
+ }
6   11 
3   8 
5   10 
10   13 
7   17 
6   2 
3   12 
2   13 
7   12 
2   17 
2   2 
10   9 
2   2 
9   14 
10   10 
3   13 
4   18 
10   8 
7   12 
5   8 
There were 50 or more warnings (use warnings() to see the first 50)
> 
> 
> ### now test 1 by n and n by 1 matrix
> 
> 
> err.tol <- 1e-12
> 
> rm(tmp5)
> 
> dataset1 <- rnorm(100)
> dataset2 <- rnorm(100)
> 
> tmp <- createBufferedMatrix(1,100)
> tmp[1,] <- dataset1
> 
> tmp2 <- createBufferedMatrix(100,1)
> tmp2[,1] <- dataset2
> 
> 
> 
> 
> 
> Max(tmp)
[1] 2.430624
> Min(tmp)
[1] -3.006532
> mean(tmp)
[1] -0.05130284
> Sum(tmp)
[1] -5.130284
> Var(tmp)
[1] 1.116696
> 
> rowMeans(tmp)
[1] -0.05130284
> rowSums(tmp)
[1] -5.130284
> rowVars(tmp)
[1] 1.116696
> rowSd(tmp)
[1] 1.056738
> rowMax(tmp)
[1] 2.430624
> rowMin(tmp)
[1] -3.006532
> 
> colMeans(tmp)
  [1] -0.60808309  1.58288360  0.31651319 -0.21350843 -0.19546823 -0.60622758
  [7]  0.37937745 -0.07566899  1.21141877 -0.65305002 -2.61651583 -0.98391128
 [13]  0.30451568 -0.21785040  0.06276372  0.96214147  0.76904943  0.03966095
 [19] -2.14141581  0.66506922 -0.14672351 -1.09741692  2.35334996 -1.74839194
 [25]  1.27763702 -1.27450376 -1.41403296  0.24533920  0.10906322  1.17821773
 [31] -1.69393843 -0.07448263 -1.53438169  0.40183143  0.86586873  0.63694547
 [37]  0.49609819 -3.00653205 -0.52605273  0.78015172 -1.39724124 -0.55268870
 [43]  1.72774682 -1.94123173  0.05734558  0.88992518  1.96473846 -0.96239653
 [49]  1.07693179 -0.25059831 -0.48995189  0.40447307 -0.67548677 -1.61372120
 [55] -0.82789899 -0.26393724 -0.59760085  1.70847133  1.20960919 -0.27594502
 [61]  0.77310213 -0.36918484  0.55875595 -1.23851478  2.43062429 -0.41875765
 [67]  1.40295654  0.18391039  0.83607118  1.25699530 -0.81563587 -0.36313102
 [73] -0.22106104  0.34162060  0.04051822 -1.23825317 -1.04957601  0.34897637
 [79] -0.30513253 -1.36109970 -0.72948344  0.93752139 -0.84491073 -0.91339490
 [85] -0.30750421 -0.06760174  0.23491167 -0.62327812 -0.47785142  1.92131722
 [91]  0.83055228 -0.22127193 -0.85874488  0.29497297 -0.08312788  1.03833615
 [97]  0.14253502 -0.51743116  1.86342038 -0.54271796
> colSums(tmp)
  [1] -0.60808309  1.58288360  0.31651319 -0.21350843 -0.19546823 -0.60622758
  [7]  0.37937745 -0.07566899  1.21141877 -0.65305002 -2.61651583 -0.98391128
 [13]  0.30451568 -0.21785040  0.06276372  0.96214147  0.76904943  0.03966095
 [19] -2.14141581  0.66506922 -0.14672351 -1.09741692  2.35334996 -1.74839194
 [25]  1.27763702 -1.27450376 -1.41403296  0.24533920  0.10906322  1.17821773
 [31] -1.69393843 -0.07448263 -1.53438169  0.40183143  0.86586873  0.63694547
 [37]  0.49609819 -3.00653205 -0.52605273  0.78015172 -1.39724124 -0.55268870
 [43]  1.72774682 -1.94123173  0.05734558  0.88992518  1.96473846 -0.96239653
 [49]  1.07693179 -0.25059831 -0.48995189  0.40447307 -0.67548677 -1.61372120
 [55] -0.82789899 -0.26393724 -0.59760085  1.70847133  1.20960919 -0.27594502
 [61]  0.77310213 -0.36918484  0.55875595 -1.23851478  2.43062429 -0.41875765
 [67]  1.40295654  0.18391039  0.83607118  1.25699530 -0.81563587 -0.36313102
 [73] -0.22106104  0.34162060  0.04051822 -1.23825317 -1.04957601  0.34897637
 [79] -0.30513253 -1.36109970 -0.72948344  0.93752139 -0.84491073 -0.91339490
 [85] -0.30750421 -0.06760174  0.23491167 -0.62327812 -0.47785142  1.92131722
 [91]  0.83055228 -0.22127193 -0.85874488  0.29497297 -0.08312788  1.03833615
 [97]  0.14253502 -0.51743116  1.86342038 -0.54271796
> colVars(tmp)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> colSd(tmp)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> colMax(tmp)
  [1] -0.60808309  1.58288360  0.31651319 -0.21350843 -0.19546823 -0.60622758
  [7]  0.37937745 -0.07566899  1.21141877 -0.65305002 -2.61651583 -0.98391128
 [13]  0.30451568 -0.21785040  0.06276372  0.96214147  0.76904943  0.03966095
 [19] -2.14141581  0.66506922 -0.14672351 -1.09741692  2.35334996 -1.74839194
 [25]  1.27763702 -1.27450376 -1.41403296  0.24533920  0.10906322  1.17821773
 [31] -1.69393843 -0.07448263 -1.53438169  0.40183143  0.86586873  0.63694547
 [37]  0.49609819 -3.00653205 -0.52605273  0.78015172 -1.39724124 -0.55268870
 [43]  1.72774682 -1.94123173  0.05734558  0.88992518  1.96473846 -0.96239653
 [49]  1.07693179 -0.25059831 -0.48995189  0.40447307 -0.67548677 -1.61372120
 [55] -0.82789899 -0.26393724 -0.59760085  1.70847133  1.20960919 -0.27594502
 [61]  0.77310213 -0.36918484  0.55875595 -1.23851478  2.43062429 -0.41875765
 [67]  1.40295654  0.18391039  0.83607118  1.25699530 -0.81563587 -0.36313102
 [73] -0.22106104  0.34162060  0.04051822 -1.23825317 -1.04957601  0.34897637
 [79] -0.30513253 -1.36109970 -0.72948344  0.93752139 -0.84491073 -0.91339490
 [85] -0.30750421 -0.06760174  0.23491167 -0.62327812 -0.47785142  1.92131722
 [91]  0.83055228 -0.22127193 -0.85874488  0.29497297 -0.08312788  1.03833615
 [97]  0.14253502 -0.51743116  1.86342038 -0.54271796
> colMin(tmp)
  [1] -0.60808309  1.58288360  0.31651319 -0.21350843 -0.19546823 -0.60622758
  [7]  0.37937745 -0.07566899  1.21141877 -0.65305002 -2.61651583 -0.98391128
 [13]  0.30451568 -0.21785040  0.06276372  0.96214147  0.76904943  0.03966095
 [19] -2.14141581  0.66506922 -0.14672351 -1.09741692  2.35334996 -1.74839194
 [25]  1.27763702 -1.27450376 -1.41403296  0.24533920  0.10906322  1.17821773
 [31] -1.69393843 -0.07448263 -1.53438169  0.40183143  0.86586873  0.63694547
 [37]  0.49609819 -3.00653205 -0.52605273  0.78015172 -1.39724124 -0.55268870
 [43]  1.72774682 -1.94123173  0.05734558  0.88992518  1.96473846 -0.96239653
 [49]  1.07693179 -0.25059831 -0.48995189  0.40447307 -0.67548677 -1.61372120
 [55] -0.82789899 -0.26393724 -0.59760085  1.70847133  1.20960919 -0.27594502
 [61]  0.77310213 -0.36918484  0.55875595 -1.23851478  2.43062429 -0.41875765
 [67]  1.40295654  0.18391039  0.83607118  1.25699530 -0.81563587 -0.36313102
 [73] -0.22106104  0.34162060  0.04051822 -1.23825317 -1.04957601  0.34897637
 [79] -0.30513253 -1.36109970 -0.72948344  0.93752139 -0.84491073 -0.91339490
 [85] -0.30750421 -0.06760174  0.23491167 -0.62327812 -0.47785142  1.92131722
 [91]  0.83055228 -0.22127193 -0.85874488  0.29497297 -0.08312788  1.03833615
 [97]  0.14253502 -0.51743116  1.86342038 -0.54271796
> colMedians(tmp)
  [1] -0.60808309  1.58288360  0.31651319 -0.21350843 -0.19546823 -0.60622758
  [7]  0.37937745 -0.07566899  1.21141877 -0.65305002 -2.61651583 -0.98391128
 [13]  0.30451568 -0.21785040  0.06276372  0.96214147  0.76904943  0.03966095
 [19] -2.14141581  0.66506922 -0.14672351 -1.09741692  2.35334996 -1.74839194
 [25]  1.27763702 -1.27450376 -1.41403296  0.24533920  0.10906322  1.17821773
 [31] -1.69393843 -0.07448263 -1.53438169  0.40183143  0.86586873  0.63694547
 [37]  0.49609819 -3.00653205 -0.52605273  0.78015172 -1.39724124 -0.55268870
 [43]  1.72774682 -1.94123173  0.05734558  0.88992518  1.96473846 -0.96239653
 [49]  1.07693179 -0.25059831 -0.48995189  0.40447307 -0.67548677 -1.61372120
 [55] -0.82789899 -0.26393724 -0.59760085  1.70847133  1.20960919 -0.27594502
 [61]  0.77310213 -0.36918484  0.55875595 -1.23851478  2.43062429 -0.41875765
 [67]  1.40295654  0.18391039  0.83607118  1.25699530 -0.81563587 -0.36313102
 [73] -0.22106104  0.34162060  0.04051822 -1.23825317 -1.04957601  0.34897637
 [79] -0.30513253 -1.36109970 -0.72948344  0.93752139 -0.84491073 -0.91339490
 [85] -0.30750421 -0.06760174  0.23491167 -0.62327812 -0.47785142  1.92131722
 [91]  0.83055228 -0.22127193 -0.85874488  0.29497297 -0.08312788  1.03833615
 [97]  0.14253502 -0.51743116  1.86342038 -0.54271796
> colRanges(tmp)
           [,1]     [,2]      [,3]       [,4]       [,5]       [,6]      [,7]
[1,] -0.6080831 1.582884 0.3165132 -0.2135084 -0.1954682 -0.6062276 0.3793774
[2,] -0.6080831 1.582884 0.3165132 -0.2135084 -0.1954682 -0.6062276 0.3793774
            [,8]     [,9]    [,10]     [,11]      [,12]     [,13]      [,14]
[1,] -0.07566899 1.211419 -0.65305 -2.616516 -0.9839113 0.3045157 -0.2178504
[2,] -0.07566899 1.211419 -0.65305 -2.616516 -0.9839113 0.3045157 -0.2178504
          [,15]     [,16]     [,17]      [,18]     [,19]     [,20]      [,21]
[1,] 0.06276372 0.9621415 0.7690494 0.03966095 -2.141416 0.6650692 -0.1467235
[2,] 0.06276372 0.9621415 0.7690494 0.03966095 -2.141416 0.6650692 -0.1467235
         [,22]   [,23]     [,24]    [,25]     [,26]     [,27]     [,28]
[1,] -1.097417 2.35335 -1.748392 1.277637 -1.274504 -1.414033 0.2453392
[2,] -1.097417 2.35335 -1.748392 1.277637 -1.274504 -1.414033 0.2453392
         [,29]    [,30]     [,31]       [,32]     [,33]     [,34]     [,35]
[1,] 0.1090632 1.178218 -1.693938 -0.07448263 -1.534382 0.4018314 0.8658687
[2,] 0.1090632 1.178218 -1.693938 -0.07448263 -1.534382 0.4018314 0.8658687
         [,36]     [,37]     [,38]      [,39]     [,40]     [,41]      [,42]
[1,] 0.6369455 0.4960982 -3.006532 -0.5260527 0.7801517 -1.397241 -0.5526887
[2,] 0.6369455 0.4960982 -3.006532 -0.5260527 0.7801517 -1.397241 -0.5526887
        [,43]     [,44]      [,45]     [,46]    [,47]      [,48]    [,49]
[1,] 1.727747 -1.941232 0.05734558 0.8899252 1.964738 -0.9623965 1.076932
[2,] 1.727747 -1.941232 0.05734558 0.8899252 1.964738 -0.9623965 1.076932
          [,50]      [,51]     [,52]      [,53]     [,54]     [,55]      [,56]
[1,] -0.2505983 -0.4899519 0.4044731 -0.6754868 -1.613721 -0.827899 -0.2639372
[2,] -0.2505983 -0.4899519 0.4044731 -0.6754868 -1.613721 -0.827899 -0.2639372
          [,57]    [,58]    [,59]     [,60]     [,61]      [,62]    [,63]
[1,] -0.5976009 1.708471 1.209609 -0.275945 0.7731021 -0.3691848 0.558756
[2,] -0.5976009 1.708471 1.209609 -0.275945 0.7731021 -0.3691848 0.558756
         [,64]    [,65]      [,66]    [,67]     [,68]     [,69]    [,70]
[1,] -1.238515 2.430624 -0.4187577 1.402957 0.1839104 0.8360712 1.256995
[2,] -1.238515 2.430624 -0.4187577 1.402957 0.1839104 0.8360712 1.256995
          [,71]     [,72]     [,73]     [,74]      [,75]     [,76]     [,77]
[1,] -0.8156359 -0.363131 -0.221061 0.3416206 0.04051822 -1.238253 -1.049576
[2,] -0.8156359 -0.363131 -0.221061 0.3416206 0.04051822 -1.238253 -1.049576
         [,78]      [,79]   [,80]      [,81]     [,82]      [,83]      [,84]
[1,] 0.3489764 -0.3051325 -1.3611 -0.7294834 0.9375214 -0.8449107 -0.9133949
[2,] 0.3489764 -0.3051325 -1.3611 -0.7294834 0.9375214 -0.8449107 -0.9133949
          [,85]       [,86]     [,87]      [,88]      [,89]    [,90]     [,91]
[1,] -0.3075042 -0.06760174 0.2349117 -0.6232781 -0.4778514 1.921317 0.8305523
[2,] -0.3075042 -0.06760174 0.2349117 -0.6232781 -0.4778514 1.921317 0.8305523
          [,92]      [,93]    [,94]       [,95]    [,96]    [,97]      [,98]
[1,] -0.2212719 -0.8587449 0.294973 -0.08312788 1.038336 0.142535 -0.5174312
[2,] -0.2212719 -0.8587449 0.294973 -0.08312788 1.038336 0.142535 -0.5174312
       [,99]    [,100]
[1,] 1.86342 -0.542718
[2,] 1.86342 -0.542718
> 
> 
> Max(tmp2)
[1] 2.649489
> Min(tmp2)
[1] -2.188321
> mean(tmp2)
[1] -0.04094756
> Sum(tmp2)
[1] -4.094756
> Var(tmp2)
[1] 0.962896
> 
> rowMeans(tmp2)
  [1] -0.38804718  0.63755340  1.24217871 -0.12764972  2.19192880  0.54020094
  [7] -1.08212771  0.65573784  0.29661885 -0.75126420  1.08537909 -0.45443064
 [13] -1.41041103 -1.04419373 -0.68941750 -0.32087463 -0.84707038  2.64948936
 [19]  0.61037555 -0.21415764  2.16160844  0.58229184 -0.36350820 -0.57647170
 [25] -1.29682389 -0.79990742 -0.12720781  1.10917212 -1.16109719 -1.18597162
 [31]  2.04677461 -0.76518328  0.62699006  0.22345038  0.50235667 -0.46661063
 [37]  0.69403217 -0.16520012 -0.71601839 -0.26158587  1.33119918 -0.47930048
 [43] -0.94776481 -2.04683713 -0.32002821 -0.33239046 -1.04976704  1.32398341
 [49] -1.47076073 -1.14920297  0.25743844 -0.28062017 -1.23841401 -1.29231020
 [55]  0.30746282 -1.25683235 -0.94098062  1.65934725  1.02140703  0.00669940
 [61]  0.31235021  1.43427683 -0.71091763  0.79646036  0.17397555  0.45575234
 [67]  1.13441832 -0.09212644 -0.98045005  1.22923696 -1.03771539 -0.55447263
 [73] -1.06134268 -0.57112095 -0.71234073 -0.04908166 -1.23712375  0.10076032
 [79]  0.67872001  0.76436949 -1.03376427 -0.04494487  1.38133585  0.53080492
 [85]  1.24791892  0.58648918  0.16861563 -0.29153601  1.08787337 -0.85388756
 [91] -0.06359805 -0.68930507  0.39487417  0.96115206 -0.61883868 -2.18832142
 [97] -1.40949664  0.33430459 -0.56712936  1.15583230
> rowSums(tmp2)
  [1] -0.38804718  0.63755340  1.24217871 -0.12764972  2.19192880  0.54020094
  [7] -1.08212771  0.65573784  0.29661885 -0.75126420  1.08537909 -0.45443064
 [13] -1.41041103 -1.04419373 -0.68941750 -0.32087463 -0.84707038  2.64948936
 [19]  0.61037555 -0.21415764  2.16160844  0.58229184 -0.36350820 -0.57647170
 [25] -1.29682389 -0.79990742 -0.12720781  1.10917212 -1.16109719 -1.18597162
 [31]  2.04677461 -0.76518328  0.62699006  0.22345038  0.50235667 -0.46661063
 [37]  0.69403217 -0.16520012 -0.71601839 -0.26158587  1.33119918 -0.47930048
 [43] -0.94776481 -2.04683713 -0.32002821 -0.33239046 -1.04976704  1.32398341
 [49] -1.47076073 -1.14920297  0.25743844 -0.28062017 -1.23841401 -1.29231020
 [55]  0.30746282 -1.25683235 -0.94098062  1.65934725  1.02140703  0.00669940
 [61]  0.31235021  1.43427683 -0.71091763  0.79646036  0.17397555  0.45575234
 [67]  1.13441832 -0.09212644 -0.98045005  1.22923696 -1.03771539 -0.55447263
 [73] -1.06134268 -0.57112095 -0.71234073 -0.04908166 -1.23712375  0.10076032
 [79]  0.67872001  0.76436949 -1.03376427 -0.04494487  1.38133585  0.53080492
 [85]  1.24791892  0.58648918  0.16861563 -0.29153601  1.08787337 -0.85388756
 [91] -0.06359805 -0.68930507  0.39487417  0.96115206 -0.61883868 -2.18832142
 [97] -1.40949664  0.33430459 -0.56712936  1.15583230
> 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.38804718  0.63755340  1.24217871 -0.12764972  2.19192880  0.54020094
  [7] -1.08212771  0.65573784  0.29661885 -0.75126420  1.08537909 -0.45443064
 [13] -1.41041103 -1.04419373 -0.68941750 -0.32087463 -0.84707038  2.64948936
 [19]  0.61037555 -0.21415764  2.16160844  0.58229184 -0.36350820 -0.57647170
 [25] -1.29682389 -0.79990742 -0.12720781  1.10917212 -1.16109719 -1.18597162
 [31]  2.04677461 -0.76518328  0.62699006  0.22345038  0.50235667 -0.46661063
 [37]  0.69403217 -0.16520012 -0.71601839 -0.26158587  1.33119918 -0.47930048
 [43] -0.94776481 -2.04683713 -0.32002821 -0.33239046 -1.04976704  1.32398341
 [49] -1.47076073 -1.14920297  0.25743844 -0.28062017 -1.23841401 -1.29231020
 [55]  0.30746282 -1.25683235 -0.94098062  1.65934725  1.02140703  0.00669940
 [61]  0.31235021  1.43427683 -0.71091763  0.79646036  0.17397555  0.45575234
 [67]  1.13441832 -0.09212644 -0.98045005  1.22923696 -1.03771539 -0.55447263
 [73] -1.06134268 -0.57112095 -0.71234073 -0.04908166 -1.23712375  0.10076032
 [79]  0.67872001  0.76436949 -1.03376427 -0.04494487  1.38133585  0.53080492
 [85]  1.24791892  0.58648918  0.16861563 -0.29153601  1.08787337 -0.85388756
 [91] -0.06359805 -0.68930507  0.39487417  0.96115206 -0.61883868 -2.18832142
 [97] -1.40949664  0.33430459 -0.56712936  1.15583230
> rowMin(tmp2)
  [1] -0.38804718  0.63755340  1.24217871 -0.12764972  2.19192880  0.54020094
  [7] -1.08212771  0.65573784  0.29661885 -0.75126420  1.08537909 -0.45443064
 [13] -1.41041103 -1.04419373 -0.68941750 -0.32087463 -0.84707038  2.64948936
 [19]  0.61037555 -0.21415764  2.16160844  0.58229184 -0.36350820 -0.57647170
 [25] -1.29682389 -0.79990742 -0.12720781  1.10917212 -1.16109719 -1.18597162
 [31]  2.04677461 -0.76518328  0.62699006  0.22345038  0.50235667 -0.46661063
 [37]  0.69403217 -0.16520012 -0.71601839 -0.26158587  1.33119918 -0.47930048
 [43] -0.94776481 -2.04683713 -0.32002821 -0.33239046 -1.04976704  1.32398341
 [49] -1.47076073 -1.14920297  0.25743844 -0.28062017 -1.23841401 -1.29231020
 [55]  0.30746282 -1.25683235 -0.94098062  1.65934725  1.02140703  0.00669940
 [61]  0.31235021  1.43427683 -0.71091763  0.79646036  0.17397555  0.45575234
 [67]  1.13441832 -0.09212644 -0.98045005  1.22923696 -1.03771539 -0.55447263
 [73] -1.06134268 -0.57112095 -0.71234073 -0.04908166 -1.23712375  0.10076032
 [79]  0.67872001  0.76436949 -1.03376427 -0.04494487  1.38133585  0.53080492
 [85]  1.24791892  0.58648918  0.16861563 -0.29153601  1.08787337 -0.85388756
 [91] -0.06359805 -0.68930507  0.39487417  0.96115206 -0.61883868 -2.18832142
 [97] -1.40949664  0.33430459 -0.56712936  1.15583230
> 
> colMeans(tmp2)
[1] -0.04094756
> colSums(tmp2)
[1] -4.094756
> colVars(tmp2)
[1] 0.962896
> colSd(tmp2)
[1] 0.9812726
> colMax(tmp2)
[1] 2.649489
> colMin(tmp2)
[1] -2.188321
> colMedians(tmp2)
[1] -0.1464249
> colRanges(tmp2)
          [,1]
[1,] -2.188321
[2,]  2.649489
> 
> 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]  3.6944396  0.4396764  1.9343316 -1.4032246 -4.0332631  0.3266682
 [7]  6.9095987 -2.9875141  1.1804545  2.7805546
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -1.9244390
[2,]  0.2945980
[3,]  0.4413997
[4,]  0.6454268
[5,]  2.3166944
> 
> rowApply(tmp,sum)
 [1]  4.2604660 -0.5967319 -2.9696625 -1.7039200  7.8533845 -3.1097461
 [7]  0.2114282  5.8969780 -0.5502283 -0.4502461
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    6    8    9    8    1    1    7    9    9    10
 [2,]    3    6    7    6    8    5    2    8    4     3
 [3,]    8    2    8    3    9    9    9    2    7     8
 [4,]    2   10    3    1    6    2    4    3    6     9
 [5,]    4    5    2    5    7    7    1    7    3     1
 [6,]    9    4    1    7    2    8   10    5    5     6
 [7,]   10    1   10    9    4    4    6   10    2     7
 [8,]    7    3    6    2    5    3    3    1    8     4
 [9,]    1    7    4    4   10    6    5    4   10     5
[10,]    5    9    5   10    3   10    8    6    1     2
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1] -1.6834681  0.6227677 -1.1674208 -3.4850077  3.3598479  1.9435905
 [7]  5.4137387 -0.8150924  3.0847240  2.0083572 -0.3368082 -2.8191088
[13]  0.2031243  0.2214400  0.6039256 -0.4230837  1.2904394  4.6301482
[19] -2.5924544  0.6900565
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -0.9628297
[2,] -0.8911096
[3,] -0.6145614
[4,]  0.2523566
[5,]  0.5326760
> 
> rowApply(tmp,sum)
[1] 4.4156281 0.1105616 2.9383190 2.2739802 1.0112272
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]   13    5    3    9    4
[2,]    5    4    8   18   18
[3,]    8   10   10    3    8
[4,]   15    3    1   13    1
[5,]   18    6   18   14   16
> 
> 
> as.matrix(tmp)
           [,1]       [,2]        [,3]       [,4]       [,5]        [,6]
[1,]  0.5326760 -0.5199995  0.22700243  0.5825887  1.1493793  0.43932337
[2,] -0.8911096 -1.0682182 -0.11049155 -1.1125749 -0.6984782  1.04352927
[3,] -0.9628297 -0.3118903  0.02149791 -1.3526721  1.3548260  0.63795150
[4,]  0.2523566  1.4129012 -1.28092149  0.5244722  0.5732988 -0.19366443
[5,] -0.6145614  1.1099746 -0.02450807 -2.1268216  0.9808219  0.01645082
          [,7]        [,8]       [,9]      [,10]      [,11]      [,12]
[1,] 0.3034494  0.37255893  1.5736443  0.5369939  0.6751901 -1.8115859
[2,] 1.5447993 -2.70847085  1.1610280 -0.3652391  0.8346370 -0.2140432
[3,] 2.7113943 -0.06434567  1.0911219  0.2896376 -1.2701161 -0.6261035
[4,] 0.4800234  1.29489197 -0.8417095  0.5147980 -0.2759721  0.3053448
[5,] 0.3740723  0.29027319  0.1006393  1.0321668 -0.3005471 -0.4727210
           [,13]      [,14]       [,15]      [,16]      [,17]      [,18]
[1,] -1.00735133  0.7248578 -1.12997698 -0.4998465  0.5129567  2.9145242
[2,]  0.01298288 -0.2976016 -0.08288299 -1.2337876  0.4522924  1.8034195
[3,]  1.03573014 -0.4749850 -0.95026218  0.3949791  0.2613731  0.2979492
[4,] -1.42432737 -0.3578011  2.53551749  0.7128115  0.6513636  1.4648966
[5,]  1.58608998  0.6269699  0.23153030  0.2027599 -0.5875463 -1.8506412
           [,19]     [,20]
[1,] -0.18082478 -0.979932
[2,] -0.04582518  2.086596
[3,] -0.57550588  1.430569
[4,] -1.10859433 -2.965706
[5,] -0.68170425  1.118529
> 
> 
> 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 :  654  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 :  567  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 -0.4641797 -0.3749045 -2.727155 -1.921556 -0.4914134 -1.645264 0.5378793
             col8      col9      col10     col11     col12    col13      col14
row1 0.0004000483 -1.383256 -0.5271481 0.1589976 0.5349682 1.443979 -0.2557581
         col15      col16    col17     col18     col19     col20
row1 0.7814928 -0.6016542 1.843868 -1.522915 -1.433663 -1.414495
> tmp[,"col10"]
           col10
row1 -0.52714810
row2  0.79183739
row3  0.01667388
row4 -0.54782830
row5  1.61155387
> tmp[c("row1","row5"),]
           col1       col2       col3      col4       col5       col6
row1 -0.4641797 -0.3749045 -2.7271553 -1.921556 -0.4914134 -1.6452641
row5 -0.8881393  0.2319484  0.9854295 -1.265934 -0.4040361 -0.1008964
           col7         col8       col9      col10     col11     col12
row1  0.5378793 0.0004000483 -1.3832563 -0.5271481 0.1589976 0.5349682
row5 -0.1342101 1.7919301104  0.2179723  1.6115539 1.5810087 1.0819932
          col13      col14      col15      col16     col17      col18     col19
row1  1.4439792 -0.2557581  0.7814928 -0.6016542  1.843868 -1.5229147 -1.433663
row5 -0.1412586 -1.4413355 -0.4978069  0.1000466 -2.462847  0.6356422 -0.480640
           col20
row1 -1.41449507
row5  0.03789402
> tmp[,c("col6","col20")]
             col6       col20
row1 -1.645264137 -1.41449507
row2 -0.003374685  0.02908367
row3 -0.434985738 -0.13268252
row4 -0.116053265  0.05671610
row5 -0.100896389  0.03789402
> tmp[c("row1","row5"),c("col6","col20")]
           col6       col20
row1 -1.6452641 -1.41449507
row5 -0.1008964  0.03789402
> 
> 
> 
> 
> tmp["row1",] <- rnorm(20,mean=10)
> tmp[,"col10"] <- rnorm(5,mean=30)
> tmp[c("row1","row5"),] <- rnorm(40,mean=50)
> tmp[,c("col6","col20")] <- rnorm(10,mean=75)
> tmp[c("row1","row5"),c("col6","col20")]  <- rnorm(4,mean=105)
> 
> tmp["row1",]
       col1     col2     col3     col4     col5     col6    col7     col8
row1 49.289 49.60503 50.75297 50.71513 50.66478 105.1668 50.7259 49.76296
         col9    col10    col11    col12    col13    col14    col15    col16
row1 48.87132 48.55814 50.12072 49.80237 49.47834 50.38573 51.03761 50.48809
        col17    col18    col19    col20
row1 50.46335 49.53667 51.48053 104.8051
> tmp[,"col10"]
        col10
row1 48.55814
row2 29.42298
row3 30.44239
row4 30.22388
row5 50.94356
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 49.28900 49.60503 50.75297 50.71513 50.66478 105.1668 50.72590 49.76296
row5 51.39481 49.14262 50.83303 48.80966 50.40629 103.0270 49.16848 49.08402
         col9    col10    col11    col12    col13    col14    col15    col16
row1 48.87132 48.55814 50.12072 49.80237 49.47834 50.38573 51.03761 50.48809
row5 48.57638 50.94356 51.02075 49.31934 49.44647 51.45227 50.78076 48.48998
        col17    col18    col19    col20
row1 50.46335 49.53667 51.48053 104.8051
row5 50.31533 49.20754 49.80526 105.0243
> tmp[,c("col6","col20")]
          col6     col20
row1 105.16684 104.80511
row2  73.30295  76.61220
row3  73.95250  76.08512
row4  74.13980  76.78878
row5 103.02704 105.02428
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 105.1668 104.8051
row5 103.0270 105.0243
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 105.1668 104.8051
row5 103.0270 105.0243
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
          col13
[1,] -0.9020359
[2,] -0.6034027
[3,]  0.0887717
[4,] -0.1237519
[5,] -0.4527369
> tmp[,c("col17","col7")]
          col17       col7
[1,]  0.6588846  1.4224518
[2,]  0.6386416 -2.0648687
[3,] -0.1746332 -2.2134106
[4,]  0.2459622  1.1494402
[5,] -1.1549301  0.2132931
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
            col6       col20
[1,] -0.48410283  0.24162404
[2,]  1.97454558  0.05730689
[3,] -0.08848195 -0.60653640
[4,] -1.23463173 -1.77664328
[5,]  1.72943893  1.19541167
> subBufferedMatrix(tmp,1,c("col6"))[,1]
           col1
[1,] -0.4841028
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
           col6
[1,] -0.4841028
[2,]  1.9745456
> 
> 
> 
> 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.83973107 -1.328203 -0.6730144 -1.1459664  0.2038635  1.15246708
row1 -0.02571818  2.265384  1.2336268 -0.8792458 -2.0740688 -0.03324405
           [,7]       [,8]        [,9]     [,10]     [,11]     [,12]
row3 -0.8031111 -2.2515655 -0.50290933 0.9821144 1.2114859  1.188639
row1  0.5347843 -0.1611023  0.06530994 1.0262905 0.3788274 -1.415294
           [,13]     [,14]     [,15]      [,16]      [,17]      [,18]
row3 -0.09744651 -1.255194 2.1568249 -1.0286501  0.2953497  0.3963842
row1 -0.48127329 -2.260789 0.5243553 -0.8437029 -0.7475894 -1.7426352
          [,19]       [,20]
row3 -0.3142375  0.07562971
row1  0.1682933 -0.85228424
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
         [,1]       [,2]      [,3]      [,4]      [,5]     [,6]     [,7]
row2 0.330032 -0.6570939 0.9631918 0.7696798 -1.702161 1.068214 1.897187
           [,8]     [,9]     [,10]
row2 -0.6373193 1.426955 0.4618455
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
           [,1]       [,2]        [,3]      [,4]        [,5]    [,6]      [,7]
row5 -0.1456171 -0.3085268 -0.04137557 -1.155914 -0.01884021 1.44579 0.1948713
         [,8]     [,9]    [,10]      [,11]     [,12]      [,13]    [,14]
row5 1.414922 1.067378 1.507333 -0.2488716 0.2231354 -0.6133474 -0.85482
         [,15]      [,16]      [,17]      [,18]     [,19]    [,20]
row5 -1.334681 -0.1099442 -0.4263173 -0.0210242 0.7257769 1.218547
> 
> 
> 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: 0x6000000f0000>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM112b410b12b07"
 [2] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM112b45f7fe120"
 [3] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM112b444952cdb"
 [4] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM112b41db4010a"
 [5] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM112b414b046c2"
 [6] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM112b440f5752a"
 [7] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM112b432df39b7"
 [8] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM112b45d463778"
 [9] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM112b42ce3d71f"
[10] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM112b422404b3f"
[11] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM112b42b0c26aa"
[12] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM112b42abe78fa"
[13] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM112b43ef87b02"
[14] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM112b42b53e09a"
[15] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM112b4fbeb4af" 
> 
> 
> ### 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: 0x6000000c8420>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x6000000c8420>
Warning message:
In dir.create(new.directory) :
  '/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x6000000c8420>
> rowMedians(tmp)
  [1] -0.533639986  0.148192834 -0.102313191  0.411433250  0.605273526
  [6] -0.180596628  0.688471438  0.066900084 -0.254330385 -0.319688196
 [11] -0.083967239 -0.944904112  0.061771564 -0.207133893  0.100851536
 [16] -0.078162465 -0.150844015 -0.021135376 -0.212919229  0.097632850
 [21]  0.029266892  0.173465260  0.432440134  0.128074326 -0.327867380
 [26]  0.083777951 -0.083911606  0.201906731 -0.127703812 -0.345563734
 [31] -0.341609093  0.056352157 -0.295036768  0.434752170 -0.190510170
 [36] -0.287245278  0.014393044 -0.295476342  0.025627554 -0.522302674
 [41]  0.070160704  0.195179911 -0.166867280 -0.158359185 -0.232881632
 [46] -0.504018657 -0.638659528 -0.058784676  0.267696959 -0.320258740
 [51] -0.287175046  0.278825693 -0.230449027  0.330441875 -0.445847448
 [56] -0.365683297 -0.095127662 -0.363733915 -0.083056853 -0.238641518
 [61]  0.309036897 -0.122531596  0.132687647 -0.401781620 -0.191719161
 [66]  0.435215619  0.303984431 -0.066923615 -0.121809463  0.008746772
 [71]  0.489490331  0.423668084 -0.326025125  0.018264141  0.041217667
 [76]  0.040589008 -0.131477497  0.332942212  0.080108708 -0.294412923
 [81] -0.195049582  0.111719600 -0.478595223  0.265535325  0.129265163
 [86] -0.343102106  0.743206629  0.088265718  0.027314486 -0.848987773
 [91] -0.262591870  0.010619709  0.078965279 -0.146359496 -0.624076614
 [96]  0.253598151  0.218903820  0.248865273 -0.671149250  0.228767002
[101]  0.028994340 -0.421217113  0.094365562  0.123278037 -0.145532375
[106]  0.161912619 -0.265001383  0.040216932 -0.017197289  0.384149435
[111] -0.605985474  0.133961970  0.171549494  0.280265496  0.005133942
[116] -0.081123581  0.058578815  0.363916263 -0.325324588  0.258517395
[121]  0.357668586 -0.013807115 -0.106655882  0.005201207  0.077535950
[126] -0.064343830  0.572654111  0.462541441 -0.003128453 -0.068403479
[131] -0.249388698  0.013650684  0.369772368  0.161473877 -0.122638175
[136] -0.640397545 -0.033441546  0.285963818  0.195714703  0.290278259
[141]  0.134254830 -0.317558376  0.260787597 -0.310271998  0.525350123
[146]  0.267478449 -0.650274726 -0.209376665 -0.344759182 -0.583680880
[151]  0.403313201 -0.403624590 -0.087217467 -0.175249313 -0.437228497
[156] -0.104485798 -0.131494510 -0.215177635  0.210579402  0.050884325
[161] -0.482911670 -0.196465478  0.285626506 -0.095791705 -0.260097824
[166] -0.440223598  0.515730785 -0.670168683 -0.537719203 -0.496814784
[171] -0.850793871 -0.209411892 -0.245423118 -0.111186946  0.045323012
[176] -0.130366564  0.061918393 -0.674963732 -0.222430907  0.288800051
[181] -0.343984384  0.391474029 -0.297486304  0.290411198 -0.253285138
[186] -0.308123001  0.467041583 -0.292198920 -0.076023062 -0.376414941
[191]  0.463565432  0.194969239  0.263026540 -0.261632941 -0.784364651
[196] -0.264757623 -0.359986257  0.122144095 -0.037615028  0.661196695
[201]  0.791993516  0.407340762 -0.035553040 -0.622800332 -0.249520332
[206]  0.662789130  0.194612457 -0.535998499 -0.206652980 -0.181952035
[211]  0.208292423 -0.072202876 -0.045400018 -0.139745211 -0.303645314
[216] -0.110436558  0.050048401 -0.246493863 -0.182048181 -0.204517867
[221]  0.497113609  0.113925323  0.216140614 -0.228232556  0.008176261
[226]  0.066298148 -0.199735409  0.018605739  0.142215010  0.049176497
> 
> proc.time()
   user  system elapsed 
  0.746   3.698   5.083 

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: 0x60000246c660>
> .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: 0x60000246c660>
> .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: 0x60000246c660>
> .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: 0x60000246c660>
> 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: 0x600002450060>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600002450060>
> .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: 0x600002450060>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600002450060>
> .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: 0x600002450060>
> 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: 0x60000245c1e0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x60000245c1e0>
> .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: 0x60000245c1e0>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x60000245c1e0>
> .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: 0x60000245c1e0>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x60000245c1e0>
> .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: 0x60000245c1e0>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x60000245c1e0>
> .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: 0x60000245c1e0>
> 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: 0x600002458000>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x600002458000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600002458000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600002458000>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile1174a254853f6" "BufferedMatrixFile1174a2f804e99"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile1174a254853f6" "BufferedMatrixFile1174a2f804e99"
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x600002464180>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600002464180>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x600002464180>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x600002464180>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x600002464180>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x600002464180>
> .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: 0x6000024580c0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000024580c0>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x6000024580c0>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x6000024580c0>
> 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: 0x600002450240>
> .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: 0x600002450240>
> rm(P)
> 
> proc.time()
   user  system elapsed 
  0.123   0.066   0.212 

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.127   0.039   0.180 

Example timings