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

This page was generated on 2026-03-27 11:33 -0400 (Fri, 27 Mar 2026).

HostnameOSArch (*)R versionInstalled pkgs
nebbiolo1Linux (Ubuntu 24.04.3 LTS)x86_64R Under development (unstable) (2026-03-05 r89546) -- "Unsuffered Consequences" 4880
kjohnson3macOS 13.7.7 Venturaarm64R Under development (unstable) (2026-03-20 r89666) -- "Unsuffered Consequences" 4577
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 258/2372HostnameOS / ArchINSTALLBUILDCHECKBUILD BIN
BufferedMatrix 1.75.0  (landing page)
Ben Bolstad
Snapshot Date: 2026-03-26 13:40 -0400 (Thu, 26 Mar 2026)
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 -0400 (Wed, 29 Oct 2025)
nebbiolo1Linux (Ubuntu 24.04.3 LTS) / x86_64  OK    OK    OK  UNNEEDED, same version is already published
kjohnson3macOS 13.7.7 Ventura / arm64  OK    OK    WARNINGS    ERROR  
See other builds for BufferedMatrix in R Universe.


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: 2026-03-26 18:32:04 -0400 (Thu, 26 Mar 2026)
EndedAt: 2026-03-26 18:32:24 -0400 (Thu, 26 Mar 2026)
EllapsedTime: 20.2 seconds
RetCode: 0
Status:   WARNINGS  
CheckDir: BufferedMatrix.Rcheck
Warnings: 1

Command output

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


* using log directory ‘/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck’
* using R Under development (unstable) (2026-03-20 r89666)
* using platform: aarch64-apple-darwin23
* R was compiled by
    Apple clang version 17.0.0 (clang-1700.3.19.1)
    GNU Fortran (GCC) 14.2.0
* running under: macOS Tahoe 26.3.1
* using session charset: UTF-8
* current time: 2026-03-26 22:32:04 UTC
* 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 17.0.0 (clang-1700.6.4.2)’
* used SDK: ‘MacOSX26.2.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/Resources/library’
* installing *source* package ‘BufferedMatrix’ ...
** this is package ‘BufferedMatrix’ version ‘1.75.0’
** using staged installation
** libs
using C compiler: ‘Apple clang version 17.0.0 (clang-1700.6.4.2)’
using SDK: ‘MacOSX26.2.sdk’
clang -arch arm64 -std=gnu23 -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=gnu23 -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]
 1580 |   if (!(Matrix->readonly) & setting){
      |       ^                   ~
doubleBufferedMatrix.c:1580:7: note: add parentheses after the '!' to evaluate the bitwise operator first
 1580 |   if (!(Matrix->readonly) & setting){
      |       ^                            
      |        (                           )
doubleBufferedMatrix.c:1580:7: note: add parentheses around left hand side expression to silence this warning
 1580 |   if (!(Matrix->readonly) & setting){
      |       ^
      |       (                  )
doubleBufferedMatrix.c:3327:12: warning: unused function 'sort_double' [-Wunused-function]
 3327 | static int sort_double(const double *a1,const double *a2){
      |            ^~~~~~~~~~~
2 warnings generated.
clang -arch arm64 -std=gnu23 -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=gnu23 -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=gnu23 -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/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) (2026-03-20 r89666) -- "Unsuffered Consequences"
Copyright (C) 2026 The R Foundation for Statistical Computing
Platform: aarch64-apple-darwin23

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.147   0.058   0.206 

BufferedMatrix.Rcheck/tests/objectTesting.Rout


R Under development (unstable) (2026-03-20 r89666) -- "Unsuffered Consequences"
Copyright (C) 2026 The R Foundation for Statistical Computing
Platform: aarch64-apple-darwin23

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 484118 25.9    1067182   57         NA   632022 33.8
Vcells 896941  6.9    8388608   64     196608  2112082 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 Mar 26 18:32:14 2026"
> 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 Mar 26 18:32:14 2026"
> 
> 
> 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: 0x73c688000>
> 
> 
> 
> 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 Mar 26 18:32:16 2026"
> 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 Mar 26 18:32:16 2026"
> 
> ColMode(tmp2)
<pointer: 0x73c688000>
> 
> 
> 
> ### 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.2806049  0.07778239 -0.02188613  0.30483546
[2,]   0.7097335 -0.41450763  0.59674154  0.04347912
[3,]  -0.7164600  1.39866245 -0.59776231  0.70225486
[4,]  -1.7343594 -0.64425334  1.01062261 -0.53476676
> ewApply(tmp5,abs)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
            [,1]       [,2]       [,3]       [,4]
[1,] 101.2806049 0.07778239 0.02188613 0.30483546
[2,]   0.7097335 0.41450763 0.59674154 0.04347912
[3,]   0.7164600 1.39866245 0.59776231 0.70225486
[4,]   1.7343594 0.64425334 1.01062261 0.53476676
> ewApply(tmp5,sqrt)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
           [,1]      [,2]      [,3]      [,4]
[1,] 10.0638266 0.2788950 0.1479396 0.5521191
[2,]  0.8424568 0.6438227 0.7724905 0.2085165
[3,]  0.8464396 1.1826506 0.7731509 0.8380065
[4,]  1.3169508 0.8026539 1.0052973 0.7312775
> 
> my.function <- function(x,power){
+   (x+5)^power
+ }
> 
> ewApply(tmp5,my.function,power=2)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
          [,1]     [,2]     [,3]     [,4]
[1,] 226.91887 27.86673 26.50128 30.82603
[2,]  34.13430 31.85273 33.32165 27.12864
[3,]  34.18086 38.22517 33.32927 34.08232
[4,]  39.90387 33.67079 36.06360 32.84754
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x73c6880c0>
> exp(tmp5)
<pointer: 0x73c6880c0>
> log(tmp5,2)
<pointer: 0x73c6880c0>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 472.3019
> Min(tmp5)
[1] 53.40831
> mean(tmp5)
[1] 73.35721
> Sum(tmp5)
[1] 14671.44
> Var(tmp5)
[1] 874.7635
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 89.15612 67.16384 73.17479 71.12445 70.17676 72.11762 68.46089 73.90862
 [9] 73.07804 75.21099
> rowSums(tmp5)
 [1] 1783.122 1343.277 1463.496 1422.489 1403.535 1442.352 1369.218 1478.172
 [9] 1461.561 1504.220
> rowVars(tmp5)
 [1] 8210.71320   41.84494   58.50234   63.23257   64.22811   43.96586
 [7]   57.33718  104.70816   80.65091   86.89152
> rowSd(tmp5)
 [1] 90.612986  6.468766  7.648682  7.951891  8.014244  6.630675  7.572132
 [8] 10.232701  8.980585  9.321562
> rowMax(tmp5)
 [1] 472.30190  77.30393  85.33355  83.05467  81.76007  85.79099  81.41463
 [8]  92.74917  95.60583  90.32253
> rowMin(tmp5)
 [1] 55.15895 56.46472 57.41185 53.41290 54.14685 63.86262 53.40831 54.01368
 [9] 53.85847 55.37148
> 
> colMeans(tmp5)
 [1] 112.06301  67.76967  69.26615  66.33402  72.79915  72.27509  67.36278
 [8]  71.41448  66.22708  75.60342  68.33603  73.88530  75.68695  72.19632
[15]  70.86777  75.87649  73.59365  70.78245  69.87908  74.92531
> colSums(tmp5)
 [1] 1120.6301  677.6967  692.6615  663.3402  727.9915  722.7509  673.6278
 [8]  714.1448  662.2708  756.0342  683.3603  738.8530  756.8695  721.9632
[15]  708.6777  758.7649  735.9365  707.8245  698.7908  749.2531
> colVars(tmp5)
 [1] 16073.68792    53.84263   153.15555    30.09911    75.87020   108.99958
 [7]    70.56043    78.15966    84.34269    62.12932    70.57833    35.03471
[13]    64.15765    55.79055    61.72167    60.45076    61.79404    70.24069
[19]    80.17252    37.26357
> colSd(tmp5)
 [1] 126.782049   7.337754  12.375603   5.486265   8.710350  10.440287
 [7]   8.400026   8.840795   9.183828   7.882216   8.401091   5.919012
[13]   8.009847   7.469307   7.856314   7.775008   7.860918   8.380972
[19]   8.953911   6.104389
> colMax(tmp5)
 [1] 472.30190  79.56068  95.60583  75.17225  85.33355  85.79099  80.30402
 [8]  85.12625  80.48394  90.32253  78.53745  81.76007  87.84639  84.06712
[15]  81.55017  92.74917  82.91806  85.48575  81.41463  83.34537
> colMin(tmp5)
 [1] 61.42307 56.34987 53.40831 56.46472 59.93417 58.85346 54.01368 58.20086
 [9] 53.85847 59.94983 54.14685 64.61415 64.09979 60.70457 53.41290 62.78856
[17] 60.53099 59.83903 55.37148 63.56076
> 
> 
> ### 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] 89.15612       NA 73.17479 71.12445 70.17676 72.11762 68.46089 73.90862
 [9] 73.07804 75.21099
> rowSums(tmp5)
 [1] 1783.122       NA 1463.496 1422.489 1403.535 1442.352 1369.218 1478.172
 [9] 1461.561 1504.220
> rowVars(tmp5)
 [1] 8210.71320   44.12574   58.50234   63.23257   64.22811   43.96586
 [7]   57.33718  104.70816   80.65091   86.89152
> rowSd(tmp5)
 [1] 90.612986  6.642721  7.648682  7.951891  8.014244  6.630675  7.572132
 [8] 10.232701  8.980585  9.321562
> rowMax(tmp5)
 [1] 472.30190        NA  85.33355  83.05467  81.76007  85.79099  81.41463
 [8]  92.74917  95.60583  90.32253
> rowMin(tmp5)
 [1] 55.15895       NA 57.41185 53.41290 54.14685 63.86262 53.40831 54.01368
 [9] 53.85847 55.37148
> 
> colMeans(tmp5)
 [1] 112.06301        NA  69.26615  66.33402  72.79915  72.27509  67.36278
 [8]  71.41448  66.22708  75.60342  68.33603  73.88530  75.68695  72.19632
[15]  70.86777  75.87649  73.59365  70.78245  69.87908  74.92531
> colSums(tmp5)
 [1] 1120.6301        NA  692.6615  663.3402  727.9915  722.7509  673.6278
 [8]  714.1448  662.2708  756.0342  683.3603  738.8530  756.8695  721.9632
[15]  708.6777  758.7649  735.9365  707.8245  698.7908  749.2531
> colVars(tmp5)
 [1] 16073.68792          NA   153.15555    30.09911    75.87020   108.99958
 [7]    70.56043    78.15966    84.34269    62.12932    70.57833    35.03471
[13]    64.15765    55.79055    61.72167    60.45076    61.79404    70.24069
[19]    80.17252    37.26357
> colSd(tmp5)
 [1] 126.782049         NA  12.375603   5.486265   8.710350  10.440287
 [7]   8.400026   8.840795   9.183828   7.882216   8.401091   5.919012
[13]   8.009847   7.469307   7.856314   7.775008   7.860918   8.380972
[19]   8.953911   6.104389
> colMax(tmp5)
 [1] 472.30190        NA  95.60583  75.17225  85.33355  85.79099  80.30402
 [8]  85.12625  80.48394  90.32253  78.53745  81.76007  87.84639  84.06712
[15]  81.55017  92.74917  82.91806  85.48575  81.41463  83.34537
> colMin(tmp5)
 [1] 61.42307       NA 53.40831 56.46472 59.93417 58.85346 54.01368 58.20086
 [9] 53.85847 59.94983 54.14685 64.61415 64.09979 60.70457 53.41290 62.78856
[17] 60.53099 59.83903 55.37148 63.56076
> 
> Max(tmp5,na.rm=TRUE)
[1] 472.3019
> Min(tmp5,na.rm=TRUE)
[1] 53.40831
> mean(tmp5,na.rm=TRUE)
[1] 73.39269
> Sum(tmp5,na.rm=TRUE)
[1] 14605.14
> Var(tmp5,na.rm=TRUE)
[1] 878.9285
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 89.15612 67.20944 73.17479 71.12445 70.17676 72.11762 68.46089 73.90862
 [9] 73.07804 75.21099
> rowSums(tmp5,na.rm=TRUE)
 [1] 1783.122 1276.979 1463.496 1422.489 1403.535 1442.352 1369.218 1478.172
 [9] 1461.561 1504.220
> rowVars(tmp5,na.rm=TRUE)
 [1] 8210.71320   44.12574   58.50234   63.23257   64.22811   43.96586
 [7]   57.33718  104.70816   80.65091   86.89152
> rowSd(tmp5,na.rm=TRUE)
 [1] 90.612986  6.642721  7.648682  7.951891  8.014244  6.630675  7.572132
 [8] 10.232701  8.980585  9.321562
> rowMax(tmp5,na.rm=TRUE)
 [1] 472.30190  77.30393  85.33355  83.05467  81.76007  85.79099  81.41463
 [8]  92.74917  95.60583  90.32253
> rowMin(tmp5,na.rm=TRUE)
 [1] 55.15895 56.46472 57.41185 53.41290 54.14685 63.86262 53.40831 54.01368
 [9] 53.85847 55.37148
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 112.06301  67.93326  69.26615  66.33402  72.79915  72.27509  67.36278
 [8]  71.41448  66.22708  75.60342  68.33603  73.88530  75.68695  72.19632
[15]  70.86777  75.87649  73.59365  70.78245  69.87908  74.92531
> colSums(tmp5,na.rm=TRUE)
 [1] 1120.6301  611.3994  692.6615  663.3402  727.9915  722.7509  673.6278
 [8]  714.1448  662.2708  756.0342  683.3603  738.8530  756.8695  721.9632
[15]  708.6777  758.7649  735.9365  707.8245  698.7908  749.2531
> colVars(tmp5,na.rm=TRUE)
 [1] 16073.68792    60.27186   153.15555    30.09911    75.87020   108.99958
 [7]    70.56043    78.15966    84.34269    62.12932    70.57833    35.03471
[13]    64.15765    55.79055    61.72167    60.45076    61.79404    70.24069
[19]    80.17252    37.26357
> colSd(tmp5,na.rm=TRUE)
 [1] 126.782049   7.763495  12.375603   5.486265   8.710350  10.440287
 [7]   8.400026   8.840795   9.183828   7.882216   8.401091   5.919012
[13]   8.009847   7.469307   7.856314   7.775008   7.860918   8.380972
[19]   8.953911   6.104389
> colMax(tmp5,na.rm=TRUE)
 [1] 472.30190  79.56068  95.60583  75.17225  85.33355  85.79099  80.30402
 [8]  85.12625  80.48394  90.32253  78.53745  81.76007  87.84639  84.06712
[15]  81.55017  92.74917  82.91806  85.48575  81.41463  83.34537
> colMin(tmp5,na.rm=TRUE)
 [1] 61.42307 56.34987 53.40831 56.46472 59.93417 58.85346 54.01368 58.20086
 [9] 53.85847 59.94983 54.14685 64.61415 64.09979 60.70457 53.41290 62.78856
[17] 60.53099 59.83903 55.37148 63.56076
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1] 89.15612      NaN 73.17479 71.12445 70.17676 72.11762 68.46089 73.90862
 [9] 73.07804 75.21099
> rowSums(tmp5,na.rm=TRUE)
 [1] 1783.122    0.000 1463.496 1422.489 1403.535 1442.352 1369.218 1478.172
 [9] 1461.561 1504.220
> rowVars(tmp5,na.rm=TRUE)
 [1] 8210.71320         NA   58.50234   63.23257   64.22811   43.96586
 [7]   57.33718  104.70816   80.65091   86.89152
> rowSd(tmp5,na.rm=TRUE)
 [1] 90.612986        NA  7.648682  7.951891  8.014244  6.630675  7.572132
 [8] 10.232701  8.980585  9.321562
> rowMax(tmp5,na.rm=TRUE)
 [1] 472.30190        NA  85.33355  83.05467  81.76007  85.79099  81.41463
 [8]  92.74917  95.60583  90.32253
> rowMin(tmp5,na.rm=TRUE)
 [1] 55.15895       NA 57.41185 53.41290 54.14685 63.86262 53.40831 54.01368
 [9] 53.85847 55.37148
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1] 116.62045       NaN  69.25632  67.43061  74.12687  72.51988  68.17491
 [8]  71.86025  65.70750  75.41448  67.72845  73.75742  76.97441  73.20680
[15]  71.36750  75.83963  73.47331  71.99838  71.32878  76.18804
> colSums(tmp5,na.rm=TRUE)
 [1] 1049.5840    0.0000  623.3069  606.8755  667.1418  652.6789  613.5742
 [8]  646.7423  591.3675  678.7303  609.5561  663.8167  692.7697  658.8612
[15]  642.3075  682.5567  661.2598  647.9854  641.9591  685.6923
> colVars(tmp5,na.rm=TRUE)
 [1] 17849.23376          NA   172.29891    20.33328    65.52211   121.95041
 [7]    71.96047    85.69414    91.84850    69.49386    75.24765    39.23007
[13]    53.52980    51.27735    66.62735    67.99182    69.35537    62.38768
[19]    66.55076    23.98359
> colSd(tmp5,na.rm=TRUE)
 [1] 133.601025         NA  13.126268   4.509243   8.094573  11.043116
 [7]   8.482952   9.257113   9.583762   8.336298   8.674540   6.263392
[13]   7.316407   7.160820   8.162558   8.245715   8.327987   7.898587
[19]   8.157865   4.897304
> colMax(tmp5,na.rm=TRUE)
 [1] 472.30190      -Inf  95.60583  75.17225  85.33355  85.79099  80.30402
 [8]  85.12625  80.48394  90.32253  78.53745  81.76007  87.84639  84.06712
[15]  81.55017  92.74917  82.91806  85.48575  81.41463  83.34537
> colMin(tmp5,na.rm=TRUE)
 [1] 61.42307      Inf 53.40831 61.50698 59.93417 58.85346 54.01368 58.20086
 [9] 53.85847 59.94983 54.14685 64.61415 66.40189 60.70457 53.41290 62.78856
[17] 60.53099 61.17377 55.37148 69.00184
> 
> 
> 
> 
> 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] 222.3025 170.8665 213.4771 182.9969 245.1824 300.3475 169.8427 145.0702
 [9] 347.2708 190.9888
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 222.3025 170.8665 213.4771 182.9969 245.1824 300.3475 169.8427 145.0702
 [9] 347.2708 190.9888
> 
> 
> 
> 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.421085e-14  0.000000e+00 -1.136868e-13 -8.526513e-14 -2.842171e-13
 [6] -1.421085e-13  1.136868e-13  0.000000e+00  1.136868e-13 -8.526513e-14
[11]  5.684342e-14  1.705303e-13  5.684342e-14  5.684342e-14 -1.136868e-13
[16]  0.000000e+00  0.000000e+00  0.000000e+00 -5.684342e-14 -5.684342e-14
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> ## making sure these things agree
> ##
> ## first when there is no NA
> 
> 
> 
> agree.checks <- function(buff.matrix,r.matrix,err.tol=1e-10){
+ 
+   if (Max(buff.matrix,na.rm=TRUE) != max(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Max")
+   }
+   
+ 
+   if (Min(buff.matrix,na.rm=TRUE) != min(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Min")
+   }
+ 
+ 
+   if (abs(Sum(buff.matrix,na.rm=TRUE)- sum(r.matrix,na.rm=TRUE)) > err.tol){
+ 
+     cat(Sum(buff.matrix,na.rm=TRUE),"\n")
+     cat(sum(r.matrix,na.rm=TRUE),"\n")
+     cat(Sum(buff.matrix,na.rm=TRUE) - sum(r.matrix,na.rm=TRUE),"\n")
+     
+     stop("No agreement in Sum")
+   }
+   
+   if (abs(mean(buff.matrix,na.rm=TRUE) - mean(r.matrix,na.rm=TRUE)) > err.tol){
+     stop("No agreement in mean")
+   }
+   
+   
+   if(abs(Var(buff.matrix,na.rm=TRUE) - var(as.vector(r.matrix),na.rm=TRUE)) > err.tol){
+     stop("No agreement in Var")
+   }
+   
+   
+ 
+   if(any(abs(rowMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,mean,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowMeans")
+   }
+   
+   
+   if(any(abs(colMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,mean,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colMeans")
+   }
+   
+   
+   if(any(abs(rowSums(buff.matrix,na.rm=TRUE)  -  apply(r.matrix,1,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in rowSums")
+   }
+   
+   
+   if(any(abs(colSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colSums")
+   }
+   
+   ### this is to get around the fact that R doesn't like to compute NA on an entire vector of NA when 
+   ### computing variance
+   my.Var <- function(x,na.rm=FALSE){
+    if (all(is.na(x))){
+      return(NA)
+    } else {
+      var(x,na.rm=na.rm)
+    }
+ 
+   }
+   
+   if(any(abs(rowVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+   
+   
+   if(any(abs(colVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+ 
+ 
+   if(any(abs(rowMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+ 
+   if(any(abs(colMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+   
+   
+   if(any(abs(rowMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+   
+ 
+   if(any(abs(colMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+ 
+   if(any(abs(colMedians(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,median,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMedian")
+   }
+ 
+   if(any(abs(colRanges(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,range,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colRanges")
+   }
+ 
+ 
+   
+ }
> 
> 
> 
> 
> 
> 
> 
> 
> 
> for (rep in 1:20){
+   copymatrix <- matrix(rnorm(200,150,15),10,20)
+   
+   tmp5[1:10,1:20] <- copymatrix
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ## now lets assign some NA values and check agreement
+ 
+   which.row <- sample(1:10,1,replace=TRUE)
+   which.col  <- sample(1:20,1,replace=TRUE)
+   
+   cat(which.row," ",which.col,"\n")
+   
+   tmp5[which.row,which.col] <- NA
+   copymatrix[which.row,which.col] <- NA
+   
+   agree.checks(tmp5,copymatrix)
+ 
+   ## make an entire row NA
+   tmp5[which.row,] <- NA
+   copymatrix[which.row,] <- NA
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ### also make an entire col NA
+   tmp5[,which.col] <- NA
+   copymatrix[,which.col] <- NA
+ 
+   agree.checks(tmp5,copymatrix)
+ 
+   ### now make 1 element non NA with NA in the rest of row and column
+ 
+   tmp5[which.row,which.col] <- rnorm(1,150,15)
+   copymatrix[which.row,which.col] <- tmp5[which.row,which.col]
+ 
+   agree.checks(tmp5,copymatrix)
+ }
4   1 
7   5 
5   17 
8   10 
1   19 
5   6 
10   13 
8   16 
1   8 
3   3 
3   3 
9   20 
8   4 
7   4 
8   1 
6   2 
9   1 
5   11 
3   12 
9   9 
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.065425
> Min(tmp)
[1] -2.713186
> mean(tmp)
[1] -0.1353397
> Sum(tmp)
[1] -13.53397
> Var(tmp)
[1] 1.076754
> 
> rowMeans(tmp)
[1] -0.1353397
> rowSums(tmp)
[1] -13.53397
> rowVars(tmp)
[1] 1.076754
> rowSd(tmp)
[1] 1.037667
> rowMax(tmp)
[1] 2.065425
> rowMin(tmp)
[1] -2.713186
> 
> colMeans(tmp)
  [1] -1.92708460  0.43652198 -0.09198876 -0.17471333 -2.13129551 -0.33460850
  [7] -0.44671550 -0.45839121 -0.75622553  0.61747086 -0.47153794 -0.34015701
 [13]  0.65594608 -0.24156415 -1.37873563 -0.58306999 -0.15497172 -0.25770762
 [19]  1.89242544  1.87216937 -0.12892754 -0.05653233 -1.51544730 -0.87669820
 [25]  0.18392924 -2.71318566 -0.51194916  1.35606051 -0.17570633 -0.04326803
 [31]  0.71948000 -1.70589189 -0.27805124 -1.26644960 -0.47933764  0.50833715
 [37] -0.13725479  0.62435134 -0.29995610 -0.91204420  0.98156917  1.98625135
 [43] -0.61005389 -0.92743507 -1.53487723 -1.58171370 -0.04061732 -0.78739949
 [49]  0.27681208 -0.17702909  2.05903296  0.79848417  0.43950367  0.04998294
 [55] -1.04520063 -1.52578667 -2.21127729 -0.67649606 -0.17670059 -1.00410293
 [61] -0.31513547 -0.01880843  0.49442046  0.77483339 -0.16476019 -1.12477502
 [67] -0.94008523  1.05354156 -0.15667173 -0.05009219  1.07100848 -0.91042803
 [73] -0.31839400  2.06542482  0.18602188 -0.52186378  1.59721817  0.49843069
 [79]  1.18966959 -0.86981912 -1.10041195  1.18618064 -0.19244696  0.16524666
 [85] -0.93189193 -0.68916346  0.58800950 -0.03094793 -0.35866968 -2.50488406
 [91] -1.89940093 -0.62614809  1.86897330  1.25257858  1.06769723  0.69980751
 [97]  1.53984548 -0.07540385  1.36221856 -0.70506173
> colSums(tmp)
  [1] -1.92708460  0.43652198 -0.09198876 -0.17471333 -2.13129551 -0.33460850
  [7] -0.44671550 -0.45839121 -0.75622553  0.61747086 -0.47153794 -0.34015701
 [13]  0.65594608 -0.24156415 -1.37873563 -0.58306999 -0.15497172 -0.25770762
 [19]  1.89242544  1.87216937 -0.12892754 -0.05653233 -1.51544730 -0.87669820
 [25]  0.18392924 -2.71318566 -0.51194916  1.35606051 -0.17570633 -0.04326803
 [31]  0.71948000 -1.70589189 -0.27805124 -1.26644960 -0.47933764  0.50833715
 [37] -0.13725479  0.62435134 -0.29995610 -0.91204420  0.98156917  1.98625135
 [43] -0.61005389 -0.92743507 -1.53487723 -1.58171370 -0.04061732 -0.78739949
 [49]  0.27681208 -0.17702909  2.05903296  0.79848417  0.43950367  0.04998294
 [55] -1.04520063 -1.52578667 -2.21127729 -0.67649606 -0.17670059 -1.00410293
 [61] -0.31513547 -0.01880843  0.49442046  0.77483339 -0.16476019 -1.12477502
 [67] -0.94008523  1.05354156 -0.15667173 -0.05009219  1.07100848 -0.91042803
 [73] -0.31839400  2.06542482  0.18602188 -0.52186378  1.59721817  0.49843069
 [79]  1.18966959 -0.86981912 -1.10041195  1.18618064 -0.19244696  0.16524666
 [85] -0.93189193 -0.68916346  0.58800950 -0.03094793 -0.35866968 -2.50488406
 [91] -1.89940093 -0.62614809  1.86897330  1.25257858  1.06769723  0.69980751
 [97]  1.53984548 -0.07540385  1.36221856 -0.70506173
> colVars(tmp)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> colSd(tmp)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> colMax(tmp)
  [1] -1.92708460  0.43652198 -0.09198876 -0.17471333 -2.13129551 -0.33460850
  [7] -0.44671550 -0.45839121 -0.75622553  0.61747086 -0.47153794 -0.34015701
 [13]  0.65594608 -0.24156415 -1.37873563 -0.58306999 -0.15497172 -0.25770762
 [19]  1.89242544  1.87216937 -0.12892754 -0.05653233 -1.51544730 -0.87669820
 [25]  0.18392924 -2.71318566 -0.51194916  1.35606051 -0.17570633 -0.04326803
 [31]  0.71948000 -1.70589189 -0.27805124 -1.26644960 -0.47933764  0.50833715
 [37] -0.13725479  0.62435134 -0.29995610 -0.91204420  0.98156917  1.98625135
 [43] -0.61005389 -0.92743507 -1.53487723 -1.58171370 -0.04061732 -0.78739949
 [49]  0.27681208 -0.17702909  2.05903296  0.79848417  0.43950367  0.04998294
 [55] -1.04520063 -1.52578667 -2.21127729 -0.67649606 -0.17670059 -1.00410293
 [61] -0.31513547 -0.01880843  0.49442046  0.77483339 -0.16476019 -1.12477502
 [67] -0.94008523  1.05354156 -0.15667173 -0.05009219  1.07100848 -0.91042803
 [73] -0.31839400  2.06542482  0.18602188 -0.52186378  1.59721817  0.49843069
 [79]  1.18966959 -0.86981912 -1.10041195  1.18618064 -0.19244696  0.16524666
 [85] -0.93189193 -0.68916346  0.58800950 -0.03094793 -0.35866968 -2.50488406
 [91] -1.89940093 -0.62614809  1.86897330  1.25257858  1.06769723  0.69980751
 [97]  1.53984548 -0.07540385  1.36221856 -0.70506173
> colMin(tmp)
  [1] -1.92708460  0.43652198 -0.09198876 -0.17471333 -2.13129551 -0.33460850
  [7] -0.44671550 -0.45839121 -0.75622553  0.61747086 -0.47153794 -0.34015701
 [13]  0.65594608 -0.24156415 -1.37873563 -0.58306999 -0.15497172 -0.25770762
 [19]  1.89242544  1.87216937 -0.12892754 -0.05653233 -1.51544730 -0.87669820
 [25]  0.18392924 -2.71318566 -0.51194916  1.35606051 -0.17570633 -0.04326803
 [31]  0.71948000 -1.70589189 -0.27805124 -1.26644960 -0.47933764  0.50833715
 [37] -0.13725479  0.62435134 -0.29995610 -0.91204420  0.98156917  1.98625135
 [43] -0.61005389 -0.92743507 -1.53487723 -1.58171370 -0.04061732 -0.78739949
 [49]  0.27681208 -0.17702909  2.05903296  0.79848417  0.43950367  0.04998294
 [55] -1.04520063 -1.52578667 -2.21127729 -0.67649606 -0.17670059 -1.00410293
 [61] -0.31513547 -0.01880843  0.49442046  0.77483339 -0.16476019 -1.12477502
 [67] -0.94008523  1.05354156 -0.15667173 -0.05009219  1.07100848 -0.91042803
 [73] -0.31839400  2.06542482  0.18602188 -0.52186378  1.59721817  0.49843069
 [79]  1.18966959 -0.86981912 -1.10041195  1.18618064 -0.19244696  0.16524666
 [85] -0.93189193 -0.68916346  0.58800950 -0.03094793 -0.35866968 -2.50488406
 [91] -1.89940093 -0.62614809  1.86897330  1.25257858  1.06769723  0.69980751
 [97]  1.53984548 -0.07540385  1.36221856 -0.70506173
> colMedians(tmp)
  [1] -1.92708460  0.43652198 -0.09198876 -0.17471333 -2.13129551 -0.33460850
  [7] -0.44671550 -0.45839121 -0.75622553  0.61747086 -0.47153794 -0.34015701
 [13]  0.65594608 -0.24156415 -1.37873563 -0.58306999 -0.15497172 -0.25770762
 [19]  1.89242544  1.87216937 -0.12892754 -0.05653233 -1.51544730 -0.87669820
 [25]  0.18392924 -2.71318566 -0.51194916  1.35606051 -0.17570633 -0.04326803
 [31]  0.71948000 -1.70589189 -0.27805124 -1.26644960 -0.47933764  0.50833715
 [37] -0.13725479  0.62435134 -0.29995610 -0.91204420  0.98156917  1.98625135
 [43] -0.61005389 -0.92743507 -1.53487723 -1.58171370 -0.04061732 -0.78739949
 [49]  0.27681208 -0.17702909  2.05903296  0.79848417  0.43950367  0.04998294
 [55] -1.04520063 -1.52578667 -2.21127729 -0.67649606 -0.17670059 -1.00410293
 [61] -0.31513547 -0.01880843  0.49442046  0.77483339 -0.16476019 -1.12477502
 [67] -0.94008523  1.05354156 -0.15667173 -0.05009219  1.07100848 -0.91042803
 [73] -0.31839400  2.06542482  0.18602188 -0.52186378  1.59721817  0.49843069
 [79]  1.18966959 -0.86981912 -1.10041195  1.18618064 -0.19244696  0.16524666
 [85] -0.93189193 -0.68916346  0.58800950 -0.03094793 -0.35866968 -2.50488406
 [91] -1.89940093 -0.62614809  1.86897330  1.25257858  1.06769723  0.69980751
 [97]  1.53984548 -0.07540385  1.36221856 -0.70506173
> colRanges(tmp)
          [,1]     [,2]        [,3]       [,4]      [,5]       [,6]       [,7]
[1,] -1.927085 0.436522 -0.09198876 -0.1747133 -2.131296 -0.3346085 -0.4467155
[2,] -1.927085 0.436522 -0.09198876 -0.1747133 -2.131296 -0.3346085 -0.4467155
           [,8]       [,9]     [,10]      [,11]     [,12]     [,13]      [,14]
[1,] -0.4583912 -0.7562255 0.6174709 -0.4715379 -0.340157 0.6559461 -0.2415641
[2,] -0.4583912 -0.7562255 0.6174709 -0.4715379 -0.340157 0.6559461 -0.2415641
         [,15]    [,16]      [,17]      [,18]    [,19]    [,20]      [,21]
[1,] -1.378736 -0.58307 -0.1549717 -0.2577076 1.892425 1.872169 -0.1289275
[2,] -1.378736 -0.58307 -0.1549717 -0.2577076 1.892425 1.872169 -0.1289275
           [,22]     [,23]      [,24]     [,25]     [,26]      [,27]    [,28]
[1,] -0.05653233 -1.515447 -0.8766982 0.1839292 -2.713186 -0.5119492 1.356061
[2,] -0.05653233 -1.515447 -0.8766982 0.1839292 -2.713186 -0.5119492 1.356061
          [,29]       [,30]   [,31]     [,32]      [,33]    [,34]      [,35]
[1,] -0.1757063 -0.04326803 0.71948 -1.705892 -0.2780512 -1.26645 -0.4793376
[2,] -0.1757063 -0.04326803 0.71948 -1.705892 -0.2780512 -1.26645 -0.4793376
         [,36]      [,37]     [,38]      [,39]      [,40]     [,41]    [,42]
[1,] 0.5083371 -0.1372548 0.6243513 -0.2999561 -0.9120442 0.9815692 1.986251
[2,] 0.5083371 -0.1372548 0.6243513 -0.2999561 -0.9120442 0.9815692 1.986251
          [,43]      [,44]     [,45]     [,46]       [,47]      [,48]     [,49]
[1,] -0.6100539 -0.9274351 -1.534877 -1.581714 -0.04061732 -0.7873995 0.2768121
[2,] -0.6100539 -0.9274351 -1.534877 -1.581714 -0.04061732 -0.7873995 0.2768121
          [,50]    [,51]     [,52]     [,53]      [,54]     [,55]     [,56]
[1,] -0.1770291 2.059033 0.7984842 0.4395037 0.04998294 -1.045201 -1.525787
[2,] -0.1770291 2.059033 0.7984842 0.4395037 0.04998294 -1.045201 -1.525787
         [,57]      [,58]      [,59]     [,60]      [,61]       [,62]     [,63]
[1,] -2.211277 -0.6764961 -0.1767006 -1.004103 -0.3151355 -0.01880843 0.4944205
[2,] -2.211277 -0.6764961 -0.1767006 -1.004103 -0.3151355 -0.01880843 0.4944205
         [,64]      [,65]     [,66]      [,67]    [,68]      [,69]       [,70]
[1,] 0.7748334 -0.1647602 -1.124775 -0.9400852 1.053542 -0.1566717 -0.05009219
[2,] 0.7748334 -0.1647602 -1.124775 -0.9400852 1.053542 -0.1566717 -0.05009219
        [,71]     [,72]     [,73]    [,74]     [,75]      [,76]    [,77]
[1,] 1.071008 -0.910428 -0.318394 2.065425 0.1860219 -0.5218638 1.597218
[2,] 1.071008 -0.910428 -0.318394 2.065425 0.1860219 -0.5218638 1.597218
         [,78]   [,79]      [,80]     [,81]    [,82]     [,83]     [,84]
[1,] 0.4984307 1.18967 -0.8698191 -1.100412 1.186181 -0.192447 0.1652467
[2,] 0.4984307 1.18967 -0.8698191 -1.100412 1.186181 -0.192447 0.1652467
          [,85]      [,86]     [,87]       [,88]      [,89]     [,90]     [,91]
[1,] -0.9318919 -0.6891635 0.5880095 -0.03094793 -0.3586697 -2.504884 -1.899401
[2,] -0.9318919 -0.6891635 0.5880095 -0.03094793 -0.3586697 -2.504884 -1.899401
          [,92]    [,93]    [,94]    [,95]     [,96]    [,97]       [,98]
[1,] -0.6261481 1.868973 1.252579 1.067697 0.6998075 1.539845 -0.07540385
[2,] -0.6261481 1.868973 1.252579 1.067697 0.6998075 1.539845 -0.07540385
        [,99]     [,100]
[1,] 1.362219 -0.7050617
[2,] 1.362219 -0.7050617
> 
> 
> Max(tmp2)
[1] 2.28625
> Min(tmp2)
[1] -2.88352
> mean(tmp2)
[1] -0.04923391
> Sum(tmp2)
[1] -4.923391
> Var(tmp2)
[1] 1.017156
> 
> rowMeans(tmp2)
  [1]  0.109221410  0.004892961 -0.623960382  2.105975839 -0.838926766
  [6]  0.580249407  0.667853109  0.204328446 -0.765033272 -1.306647990
 [11] -0.572255047  0.817816332 -0.489044283 -1.029151073 -0.138801394
 [16] -2.883520326 -0.243925611 -0.199111491 -0.753445109  1.821653693
 [21] -0.446912540 -2.271810107  0.177156577 -0.296781461  0.366460822
 [26] -0.288880926  0.485159426 -0.108791979  0.835791202  0.445435140
 [31]  0.018272825  2.286250260 -1.223742264 -0.388838695 -2.577008509
 [36] -1.193183881 -0.603552355  1.424009891  1.378529971 -0.420838056
 [41] -0.192346301  0.601078229 -0.344906028 -0.777762240  1.752276985
 [46]  0.582941424 -0.827928856 -1.397807211 -0.050173680  1.425825213
 [51]  0.651432081  0.258669958  1.507790202 -0.441585419 -0.298365586
 [56]  0.513689151  0.998275829 -0.892262831  0.138315686  0.622198739
 [61]  0.380790958 -1.823495373  0.435469830 -1.289517326  0.720548869
 [66]  0.107687302  1.299232465 -0.664332949  0.296658515 -0.910994363
 [71]  1.152479850  0.308176869  1.431127899 -1.155767307  0.651157623
 [76] -2.094357697 -0.192475003 -1.317171740 -1.546816298 -0.391458894
 [81] -0.354856755  0.641739374  1.117034838 -0.833534610  0.047498903
 [86]  0.598075828 -0.162845749 -0.025144746  0.701423004  1.794868181
 [91] -0.408708957  1.189658890  0.563390049 -1.031520669 -0.618401429
 [96] -0.073321307 -0.423840033 -1.301431044  1.180133286 -0.814800011
> rowSums(tmp2)
  [1]  0.109221410  0.004892961 -0.623960382  2.105975839 -0.838926766
  [6]  0.580249407  0.667853109  0.204328446 -0.765033272 -1.306647990
 [11] -0.572255047  0.817816332 -0.489044283 -1.029151073 -0.138801394
 [16] -2.883520326 -0.243925611 -0.199111491 -0.753445109  1.821653693
 [21] -0.446912540 -2.271810107  0.177156577 -0.296781461  0.366460822
 [26] -0.288880926  0.485159426 -0.108791979  0.835791202  0.445435140
 [31]  0.018272825  2.286250260 -1.223742264 -0.388838695 -2.577008509
 [36] -1.193183881 -0.603552355  1.424009891  1.378529971 -0.420838056
 [41] -0.192346301  0.601078229 -0.344906028 -0.777762240  1.752276985
 [46]  0.582941424 -0.827928856 -1.397807211 -0.050173680  1.425825213
 [51]  0.651432081  0.258669958  1.507790202 -0.441585419 -0.298365586
 [56]  0.513689151  0.998275829 -0.892262831  0.138315686  0.622198739
 [61]  0.380790958 -1.823495373  0.435469830 -1.289517326  0.720548869
 [66]  0.107687302  1.299232465 -0.664332949  0.296658515 -0.910994363
 [71]  1.152479850  0.308176869  1.431127899 -1.155767307  0.651157623
 [76] -2.094357697 -0.192475003 -1.317171740 -1.546816298 -0.391458894
 [81] -0.354856755  0.641739374  1.117034838 -0.833534610  0.047498903
 [86]  0.598075828 -0.162845749 -0.025144746  0.701423004  1.794868181
 [91] -0.408708957  1.189658890  0.563390049 -1.031520669 -0.618401429
 [96] -0.073321307 -0.423840033 -1.301431044  1.180133286 -0.814800011
> 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.109221410  0.004892961 -0.623960382  2.105975839 -0.838926766
  [6]  0.580249407  0.667853109  0.204328446 -0.765033272 -1.306647990
 [11] -0.572255047  0.817816332 -0.489044283 -1.029151073 -0.138801394
 [16] -2.883520326 -0.243925611 -0.199111491 -0.753445109  1.821653693
 [21] -0.446912540 -2.271810107  0.177156577 -0.296781461  0.366460822
 [26] -0.288880926  0.485159426 -0.108791979  0.835791202  0.445435140
 [31]  0.018272825  2.286250260 -1.223742264 -0.388838695 -2.577008509
 [36] -1.193183881 -0.603552355  1.424009891  1.378529971 -0.420838056
 [41] -0.192346301  0.601078229 -0.344906028 -0.777762240  1.752276985
 [46]  0.582941424 -0.827928856 -1.397807211 -0.050173680  1.425825213
 [51]  0.651432081  0.258669958  1.507790202 -0.441585419 -0.298365586
 [56]  0.513689151  0.998275829 -0.892262831  0.138315686  0.622198739
 [61]  0.380790958 -1.823495373  0.435469830 -1.289517326  0.720548869
 [66]  0.107687302  1.299232465 -0.664332949  0.296658515 -0.910994363
 [71]  1.152479850  0.308176869  1.431127899 -1.155767307  0.651157623
 [76] -2.094357697 -0.192475003 -1.317171740 -1.546816298 -0.391458894
 [81] -0.354856755  0.641739374  1.117034838 -0.833534610  0.047498903
 [86]  0.598075828 -0.162845749 -0.025144746  0.701423004  1.794868181
 [91] -0.408708957  1.189658890  0.563390049 -1.031520669 -0.618401429
 [96] -0.073321307 -0.423840033 -1.301431044  1.180133286 -0.814800011
> rowMin(tmp2)
  [1]  0.109221410  0.004892961 -0.623960382  2.105975839 -0.838926766
  [6]  0.580249407  0.667853109  0.204328446 -0.765033272 -1.306647990
 [11] -0.572255047  0.817816332 -0.489044283 -1.029151073 -0.138801394
 [16] -2.883520326 -0.243925611 -0.199111491 -0.753445109  1.821653693
 [21] -0.446912540 -2.271810107  0.177156577 -0.296781461  0.366460822
 [26] -0.288880926  0.485159426 -0.108791979  0.835791202  0.445435140
 [31]  0.018272825  2.286250260 -1.223742264 -0.388838695 -2.577008509
 [36] -1.193183881 -0.603552355  1.424009891  1.378529971 -0.420838056
 [41] -0.192346301  0.601078229 -0.344906028 -0.777762240  1.752276985
 [46]  0.582941424 -0.827928856 -1.397807211 -0.050173680  1.425825213
 [51]  0.651432081  0.258669958  1.507790202 -0.441585419 -0.298365586
 [56]  0.513689151  0.998275829 -0.892262831  0.138315686  0.622198739
 [61]  0.380790958 -1.823495373  0.435469830 -1.289517326  0.720548869
 [66]  0.107687302  1.299232465 -0.664332949  0.296658515 -0.910994363
 [71]  1.152479850  0.308176869  1.431127899 -1.155767307  0.651157623
 [76] -2.094357697 -0.192475003 -1.317171740 -1.546816298 -0.391458894
 [81] -0.354856755  0.641739374  1.117034838 -0.833534610  0.047498903
 [86]  0.598075828 -0.162845749 -0.025144746  0.701423004  1.794868181
 [91] -0.408708957  1.189658890  0.563390049 -1.031520669 -0.618401429
 [96] -0.073321307 -0.423840033 -1.301431044  1.180133286 -0.814800011
> 
> colMeans(tmp2)
[1] -0.04923391
> colSums(tmp2)
[1] -4.923391
> colVars(tmp2)
[1] 1.017156
> colSd(tmp2)
[1] 1.008542
> colMax(tmp2)
[1] 2.28625
> colMin(tmp2)
[1] -2.88352
> colMedians(tmp2)
[1] -0.09105664
> colRanges(tmp2)
         [,1]
[1,] -2.88352
[2,]  2.28625
> 
> 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] -1.03215359  6.68521570  0.88261167  3.22483046  1.05550781 -1.02018049
 [7] -4.24079986  3.52814356 -0.06313567 -0.13143505
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -1.5459159
[2,] -0.3754859
[3,] -0.2074063
[4,]  0.3141381
[5,]  1.4015302
> 
> rowApply(tmp,sum)
 [1]  1.4896780  0.3025167 -1.6596803  2.1654397  1.5311280  4.6735776
 [7]  2.6556990 -0.6111282 -6.1629474  4.5043212
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    1    8    5    4    5    7    6    9    3     3
 [2,]    5    7    9    9   10    2    7    2    7    10
 [3,]    4    5    1    5    9    3    2    5    6     9
 [4,]    6    6    7    7    8    9    5    7    4     7
 [5,]    9   10   10    6    3    5    1    8    5     1
 [6,]   10    4    2    1    7    8    8    6    1     5
 [7,]    3    2    8    3    1    4    9    1    2     8
 [8,]    7    9    3    8    2   10    4    3    9     4
 [9,]    8    3    6    2    4    1   10   10   10     2
[10,]    2    1    4   10    6    6    3    4    8     6
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1] -0.007277685  2.579170969 -2.125958644  0.143561311  1.660084181
 [6]  2.920160809  2.585460305 -1.174375640 -3.134922784 -3.982926982
[11] -0.331285376 -0.402607934  0.565841617 -3.460029956 -1.650455775
[16]  5.430917665  1.330585239 -0.568706361 -5.562261899 -0.987438427
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -1.6270586
[2,] -0.8465345
[3,] -0.4507401
[4,]  0.3889601
[5,]  2.5280955
> 
> rowApply(tmp,sum)
[1]  0.5863789 -5.6206815 -3.2669336  3.3280843 -1.1993134
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]   20    5    8   11    3
[2,]    5   20   16    8   17
[3,]    1    2    5   20   11
[4,]   12    9   14   16    6
[5,]   14    1    6   18   20
> 
> 
> as.matrix(tmp)
           [,1]       [,2]       [,3]       [,4]       [,5]      [,6]
[1,]  2.5280955 -0.8163519 -1.5254237  0.1247566  0.4457697 0.2321241
[2,] -0.8465345  1.6572595 -1.6188948 -0.4041233 -1.7234833 0.7151396
[3,] -0.4507401  0.6185805 -0.8266621  0.2234651 -0.7036514 0.3279822
[4,]  0.3889601 -0.2632231  1.9209055  0.9569033  1.2546956 1.0294131
[5,] -1.6270586  1.3829060 -0.0758836 -0.7574404  2.3867536 0.6155018
           [,7]       [,8]       [,9]      [,10]      [,11]       [,12]
[1,]  1.1053529 -0.7587709 -0.5075216 -1.2211214 -0.5372134  0.12404736
[2,] -0.5399381 -1.5861438  0.5851872 -0.2504911 -0.1253138 -0.05695599
[3,]  2.0890293 -0.1191696 -1.1803191 -1.4008743 -0.4767654  0.80662432
[4,]  0.4188448 -1.0190892  0.3544054 -1.0080933  0.9493975 -0.41962840
[5,] -0.4878286  2.3087977 -2.3866746 -0.1023469 -0.1413902 -0.85669523
           [,13]      [,14]      [,15]     [,16]       [,17]      [,18]
[1,] -0.18999354 -0.3434511  1.1576129 1.4940751  0.61518348  0.9365329
[2,] -0.59183248 -0.1541330 -1.5408267 0.8264059  0.83328984 -0.4173218
[3,] -0.43213715 -0.2374754 -1.3446515 0.8051225 -0.26858416 -1.1416669
[4,]  1.76465593 -1.7605873  0.6067275 0.5108307  0.22383827 -0.3768725
[5,]  0.01514885 -0.9643832 -0.5293180 1.7944834 -0.07314219  0.4306219
          [,19]       [,20]
[1,] -1.2743716 -1.00295239
[2,] -0.1839890 -0.19798198
[3,] -0.1771016  0.62206125
[4,] -1.7655593 -0.43844033
[5,] -2.1612404  0.02987502
> 
> 
> is.BufferedMatrix(tmp)
[1] TRUE
> 
> as.BufferedMatrix(as.matrix(tmp))
BufferedMatrix object
Matrix size:  5 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  800  bytes.
> 
> 
> 
> subBufferedMatrix(tmp,1:5,1:5)
BufferedMatrix object
Matrix size:  5 5 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  650  bytes.
Disk usage :  200  bytes.
> subBufferedMatrix(tmp,,5:8)
BufferedMatrix object
Matrix size:  5 4 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  563  bytes.
Disk usage :  160  bytes.
> subBufferedMatrix(tmp,1:3,)
BufferedMatrix object
Matrix size:  3 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  480  bytes.
> 
> 
> rm(tmp)
> 
> 
> ###
> ### Testing colnames and rownames
> ###
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> 
> 
> colnames(tmp)
NULL
> rownames(tmp)
NULL
> 
> 
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> colnames(tmp)
 [1] "col1"  "col2"  "col3"  "col4"  "col5"  "col6"  "col7"  "col8"  "col9" 
[10] "col10" "col11" "col12" "col13" "col14" "col15" "col16" "col17" "col18"
[19] "col19" "col20"
> rownames(tmp)
[1] "row1" "row2" "row3" "row4" "row5"
> 
> 
> tmp["row1",]
          col1      col2       col3      col4     col5       col6      col7
row1 0.7575222 -0.547884 -0.8980927 -1.141028 1.438828 -0.6315742 -1.952092
          col8       col9    col10    col11   col12      col13      col14
row1 -1.180905 -0.8696037 1.839613 1.680805 0.57574 -0.4286232 -0.1013919
          col15      col16  col17    col18    col19      col20
row1 -0.5715493 -0.1125195 1.5427 2.241126 1.730735 0.05186934
> tmp[,"col10"]
          col10
row1  1.8396126
row2  2.2135871
row3  0.9352943
row4 -0.9622329
row5  0.7349883
> tmp[c("row1","row5"),]
           col1      col2       col3      col4       col5       col6       col7
row1 0.75752219 -0.547884 -0.8980927 -1.141028  1.4388282 -0.6315742 -1.9520922
row5 0.03864379 -1.567577  2.4797326  1.155027 -0.8602758 -1.2968733 -0.5668958
           col8       col9     col10     col11     col12      col13      col14
row1 -1.1809052 -0.8696037 1.8396126  1.680805 0.5757400 -0.4286232 -0.1013919
row5  0.1479011 -1.6555753 0.7349883 -1.919721 0.3025985 -0.8733976 -0.2033715
          col15      col16    col17    col18      col19       col20
row1 -0.5715493 -0.1125195 1.542700 2.241126  1.7307348  0.05186934
row5 -0.5542347  0.6795747 1.333254 1.112398 -0.6296391 -2.17906476
> tmp[,c("col6","col20")]
           col6       col20
row1 -0.6315742  0.05186934
row2 -0.4737414  0.30645355
row3 -0.5136889  1.50835897
row4 -0.2917197  0.78964341
row5 -1.2968733 -2.17906476
> tmp[c("row1","row5"),c("col6","col20")]
           col6       col20
row1 -0.6315742  0.05186934
row5 -1.2968733 -2.17906476
> 
> 
> 
> 
> tmp["row1",] <- rnorm(20,mean=10)
> tmp[,"col10"] <- rnorm(5,mean=30)
> tmp[c("row1","row5"),] <- rnorm(40,mean=50)
> tmp[,c("col6","col20")] <- rnorm(10,mean=75)
> tmp[c("row1","row5"),c("col6","col20")]  <- rnorm(4,mean=105)
> 
> tmp["row1",]
         col1    col2     col3     col4     col5     col6     col7     col8
row1 48.96476 50.9727 49.44412 49.88429 51.13399 104.9686 49.58452 49.73236
         col9    col10    col11    col12    col13    col14    col15    col16
row1 49.23713 50.68831 51.23959 48.15856 50.53548 50.87642 50.09722 50.51711
        col17    col18    col19    col20
row1 48.94383 49.87917 47.86027 105.9387
> tmp[,"col10"]
        col10
row1 50.68831
row2 31.32019
row3 28.89002
row4 29.50804
row5 49.55817
> tmp[c("row1","row5"),]
         col1    col2     col3     col4     col5     col6     col7     col8
row1 48.96476 50.9727 49.44412 49.88429 51.13399 104.9686 49.58452 49.73236
row5 49.34681 48.6247 49.61621 50.31571 50.60773 105.7917 50.31019 49.08229
         col9    col10    col11    col12    col13    col14    col15    col16
row1 49.23713 50.68831 51.23959 48.15856 50.53548 50.87642 50.09722 50.51711
row5 50.20662 49.55817 49.91138 52.06579 49.57410 50.69314 50.70905 48.61371
        col17    col18    col19    col20
row1 48.94383 49.87917 47.86027 105.9387
row5 50.23857 47.95408 50.63809 105.5244
> tmp[,c("col6","col20")]
          col6     col20
row1 104.96856 105.93870
row2  75.12095  76.76533
row3  74.53364  74.69893
row4  74.80535  74.50090
row5 105.79168 105.52439
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 104.9686 105.9387
row5 105.7917 105.5244
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 104.9686 105.9387
row5 105.7917 105.5244
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
          col13
[1,]  0.7988414
[2,] -0.4266212
[3,]  0.3072276
[4,]  0.3803972
[5,]  0.6463769
> tmp[,c("col17","col7")]
          col17       col7
[1,] -1.2405442 -0.6816797
[2,]  0.8204293 -0.1320680
[3,] -2.2179427  0.7357367
[4,]  0.7074126 -0.5466424
[5,] -0.7787243  2.1375781
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
           col6      col20
[1,]  1.8751444 -0.8606867
[2,] -0.4242150  2.2070748
[3,] -0.2427456 -0.4821830
[4,] -0.2328280  1.0220914
[5,] -1.9465602  0.8203809
> subBufferedMatrix(tmp,1,c("col6"))[,1]
         col1
[1,] 1.875144
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
          col6
[1,]  1.875144
[2,] -0.424215
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> 
> 
> 
> subBufferedMatrix(tmp,c("row3","row1"),)[,1:20]
         [,1]      [,2]       [,3]      [,4]       [,5]       [,6]       [,7]
row3 1.291718 0.4771221 -0.3334167 0.2424392 -0.2467677 -1.7975581  0.6912939
row1 2.152252 2.3748123  0.8355913 0.3883997 -0.9678673  0.2274081 -1.0878038
          [,8]      [,9]     [,10]      [,11]      [,12]     [,13]      [,14]
row3  1.156503  0.770312 0.1881188 -0.6959527 -1.0259428 0.8492165 -0.4433727
row1 -2.220986 -1.740959 1.2662813  0.9744726  0.1152931 1.7614653  0.9131258
        [,15]      [,16]       [,17]      [,18]      [,19]      [,20]
row3 1.269244 -0.6105179 -0.01695262 -0.1872482  1.1139038  0.5251493
row1 1.277910  0.9990055 -0.06305953 -0.6833585 -0.5988196 -0.3012867
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
        [,1]     [,2]      [,3]     [,4]       [,5]     [,6]      [,7]
row2 1.79421 1.355018 0.3170163 0.980694 -0.2672952 0.912612 0.4666049
           [,8]      [,9]      [,10]
row2 -0.8662282 -1.147698 -0.2378837
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
          [,1]      [,2]      [,3]       [,4]       [,5]      [,6]       [,7]
row5 -0.521852 -1.315939 -1.004205 -0.1130856 0.03862755 -0.582997 0.01133259
           [,8]       [,9]     [,10]     [,11]      [,12]    [,13]      [,14]
row5 -0.5560505 -0.5072315 -1.290167 0.6438806 -0.6790241 2.279285 0.06685183
          [,15]     [,16]      [,17]     [,18]      [,19]   [,20]
row5 -0.4053619 -1.036911 -0.5892394 0.6738821 -0.5977364 1.57628
> 
> 
> 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: 0x73c6886c0>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM83623a2c7bf0"
 [2] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM83623e7ce766"
 [3] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM83627a3bf996"
 [4] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM8362777f258b"
 [5] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM83623c7a05f7"
 [6] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM83626f1dba25"
 [7] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM83628a80c21" 
 [8] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM836250b44ef7"
 [9] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM83626dac6385"
[10] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM836250b9e903"
[11] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM83625d70ed5c"
[12] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM836220ef62f1"
[13] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM83624448cd1b"
[14] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM8362791caa3" 
[15] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM8362748e9736"
> 
> 
> ### 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: 0x73c689320>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x73c689320>
Warning message:
In dir.create(new.directory) :
  '/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x73c689320>
> rowMedians(tmp)
  [1]  0.314519638 -0.578944702  0.103544523 -0.052395441  0.342727463
  [6] -0.346171380 -0.455023045  0.311116153 -0.509458399  0.148914499
 [11] -0.276461226  0.083704020  0.616614591  0.212831276 -0.317238818
 [16] -0.192745252 -0.193435342  0.131606138 -0.175670007 -0.433488214
 [21] -0.612870590  0.433169338 -0.253859372 -0.187257949 -0.100588212
 [26] -0.933787333 -0.181345553  0.322369047 -0.085599093 -0.052868062
 [31] -0.180194974  0.181524676 -0.353809457 -0.376734468 -0.027536469
 [36] -0.321182151  0.046704196  0.288719305  0.314583252 -0.194109912
 [41]  0.210174995 -0.038382605  0.187262436 -0.171042772 -0.382518422
 [46] -0.225793155 -0.112573792 -0.296085556  0.168449883 -0.262164121
 [51]  0.008851575 -0.395294557 -0.054165864 -0.246589867 -0.126093535
 [56]  0.387560602 -0.487369834 -0.124236128  0.227533745  0.249913316
 [61] -0.497206285  0.182510166 -0.048832535 -0.233977793 -0.434813058
 [66]  0.461234997 -0.111438923  0.913728063 -0.378775563  0.191142655
 [71] -0.183400480 -0.341913636 -0.180154541 -0.206388084 -0.390508855
 [76]  0.205662712  0.010228981  0.089426393 -0.479004245 -0.264755304
 [81] -0.088854949  0.058707952 -0.116097527 -0.294290240  0.268185199
 [86]  0.063625052  0.622288223  0.251711828 -0.786947764  0.172522055
 [91] -0.297099075  0.237707420 -0.137325954  0.550643882 -0.254227444
 [96]  0.459144996  0.001622727 -0.071111678 -0.337853887  0.002162932
[101]  0.065898256 -0.435025180  0.105013020 -0.362031324  0.353307204
[106] -0.227583665 -0.017506561  0.405142630 -0.034747203 -0.236297626
[111] -0.231700206 -0.380032578 -0.083767739  0.490732221  0.100685928
[116]  0.272604212 -0.182329715 -0.090488106  0.077394052 -0.196800501
[121] -0.649688814 -0.265378726  0.296635771  0.078336239  0.202930264
[126] -0.498966803 -0.112915589 -0.026497664  0.111345519  0.283524212
[131]  0.021654450  0.004920125 -0.551689593  0.179992903 -0.301310493
[136] -0.247122734  0.665067814  0.146912951 -0.073327498 -0.229855744
[141]  0.042049907 -0.194354314 -0.197171888 -0.345695364  0.011828427
[146] -0.224635089  0.571865743 -0.251859679  0.312422506 -0.391308348
[151]  0.343594385 -0.358380880 -0.180478731 -0.193730448 -0.195494644
[156] -0.156839219  0.066963557 -0.349674811 -0.780099801  0.299738768
[161]  0.355389016 -0.109073140  0.103516425  0.276709446 -0.330667280
[166]  0.359051481 -0.466427817  0.397832523 -0.180331371 -0.507122333
[171] -0.136201196  0.077467483  0.243596351 -0.109712234 -0.006104262
[176] -0.526391588 -0.261688560 -0.728424450  0.377441592 -0.020578992
[181] -0.295475648 -0.726277293 -0.088976741 -0.216353914  0.705671737
[186]  0.077708164  0.274522537  0.438690108  0.191607314  0.090056547
[191] -0.325682897  0.262231865 -0.108736093 -0.035463192  0.106392159
[196]  0.337233992 -0.221426460  0.639977920  0.018050397 -0.093395574
[201]  0.350993603  0.152944963  0.147877352  0.407216636 -0.305356329
[206]  0.371363104 -0.079522693  0.131306444 -0.489035116 -0.182590095
[211]  0.216901597 -0.318961892  0.684461599  0.181037817 -0.451092105
[216]  0.159937554 -0.196781593  0.030783137 -0.146594806  0.316805375
[221]  0.504143630 -0.291290999 -0.222706612 -0.004340578 -0.238898177
[226]  0.036219601  0.044866686  0.043041297  0.630964039 -0.129494919
> 
> proc.time()
   user  system elapsed 
  0.794   5.089   5.987 

BufferedMatrix.Rcheck/tests/rawCalltesting.Rout


R Under development (unstable) (2026-03-20 r89666) -- "Unsuffered Consequences"
Copyright (C) 2026 The R Foundation for Statistical Computing
Platform: aarch64-apple-darwin23

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: 0x103b857b0>
> .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: 0x103b857b0>
> .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: 0x103b857b0>
> .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: 0x103b857b0>
> 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: 0x875c20000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x875c20000>
> .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: 0x875c20000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x875c20000>
> .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: 0x875c20000>
> 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: 0x875c203c0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x875c203c0>
> .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: 0x875c203c0>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x875c203c0>
> .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: 0x875c203c0>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x875c203c0>
> .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: 0x875c203c0>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x875c203c0>
> .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: 0x875c203c0>
> 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: 0x875c204e0>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x875c204e0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x875c204e0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x875c204e0>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile872155673a62" "BufferedMatrixFile87216c2a23bb"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile872155673a62" "BufferedMatrixFile87216c2a23bb"
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x875c20600>
> .Call("R_bm_AddColumn",P)
<pointer: 0x875c20600>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x875c20600>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x875c20600>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x875c20600>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x875c20600>
> .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: 0x875c20780>
> .Call("R_bm_AddColumn",P)
<pointer: 0x875c20780>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x875c20780>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x875c20780>
> 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: 0x875c208a0>
> .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: 0x875c208a0>
> rm(P)
> 
> proc.time()
   user  system elapsed 
  0.124   0.053   0.175 

BufferedMatrix.Rcheck/tests/Rcodetesting.Rout


R Under development (unstable) (2026-03-20 r89666) -- "Unsuffered Consequences"
Copyright (C) 2026 The R Foundation for Statistical Computing
Platform: aarch64-apple-darwin23

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.140   0.033   0.169 

Example timings