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

This page was generated on 2025-03-28 11:54 -0400 (Fri, 28 Mar 2025).

HostnameOSArch (*)R versionInstalled pkgs
nebbiolo1Linux (Ubuntu 24.04.1 LTS)x86_64R Under development (unstable) (2025-03-13 r87965) -- "Unsuffered Consequences" 4783
palomino7Windows Server 2022 Datacenterx64R Under development (unstable) (2025-03-01 r87860 ucrt) -- "Unsuffered Consequences" 4552
lconwaymacOS 12.7.1 Montereyx86_64R Under development (unstable) (2025-03-02 r87868) -- "Unsuffered Consequences" 4581
kunpeng2Linux (openEuler 24.03 LTS)aarch64R Under development (unstable) (2025-02-19 r87757) -- "Unsuffered Consequences" 4518
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 249/2315HostnameOS / ArchINSTALLBUILDCHECKBUILD BIN
BufferedMatrix 1.71.1  (landing page)
Ben Bolstad
Snapshot Date: 2025-03-27 13:40 -0400 (Thu, 27 Mar 2025)
git_url: https://git.bioconductor.org/packages/BufferedMatrix
git_branch: devel
git_last_commit: 824836d
git_last_commit_date: 2024-12-14 17:47:34 -0400 (Sat, 14 Dec 2024)
nebbiolo1Linux (Ubuntu 24.04.1 LTS) / x86_64  OK    OK    OK  UNNEEDED, same version is already published
palomino7Windows Server 2022 Datacenter / x64  OK    OK    OK    OK  UNNEEDED, same version is already published
lconwaymacOS 12.7.1 Monterey / x86_64  OK    OK    WARNINGS    OK  UNNEEDED, same version is already published
kunpeng2Linux (openEuler 24.03 LTS) / aarch64  OK    OK    OK  


CHECK results for BufferedMatrix on kunpeng2

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.
- See Martin Grigorov's blog post for how to debug Linux ARM64 related issues on a x86_64 host.

raw results


Summary

Package: BufferedMatrix
Version: 1.71.1
Command: /home/biocbuild/R/R/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/home/biocbuild/R/R/site-library --no-vignettes --timings BufferedMatrix_1.71.1.tar.gz
StartedAt: 2025-03-28 04:30:52 -0000 (Fri, 28 Mar 2025)
EndedAt: 2025-03-28 04:31:16 -0000 (Fri, 28 Mar 2025)
EllapsedTime: 24.0 seconds
RetCode: 0
Status:   OK  
CheckDir: BufferedMatrix.Rcheck
Warnings: 0

Command output

##############################################################################
##############################################################################
###
### Running command:
###
###   /home/biocbuild/R/R/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/home/biocbuild/R/R/site-library --no-vignettes --timings BufferedMatrix_1.71.1.tar.gz
###
##############################################################################
##############################################################################


* using log directory ‘/home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck’
* using R Under development (unstable) (2025-02-19 r87757)
* using platform: aarch64-unknown-linux-gnu
* R was compiled by
    aarch64-unknown-linux-gnu-gcc (GCC) 14.2.0
    GNU Fortran (GCC) 14.2.0
* running under: openEuler 24.03 (LTS-SP1)
* using session charset: UTF-8
* using option ‘--no-vignettes’
* checking for file ‘BufferedMatrix/DESCRIPTION’ ... OK
* this is package ‘BufferedMatrix’ version ‘1.71.1’
* 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 ... OK
* used C compiler: ‘aarch64-unknown-linux-gnu-gcc (GCC) 14.2.0’
* 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 loading without being on the library search path ... OK
* checking dependencies in R code ... OK
* checking S3 generic/method consistency ... OK
* checking replacement functions ... OK
* checking foreign function calls ... OK
* checking R code for possible problems ... OK
* checking Rd files ... NOTE
checkRd: (-1) BufferedMatrix-class.Rd:209: Lost braces; missing escapes or markup?
   209 |     $x^{power}$ elementwise of the matrix
       |        ^
prepare_Rd: createBufferedMatrix.Rd:26: Dropping empty section \keyword
prepare_Rd: createBufferedMatrix.Rd:17-18: Dropping empty section \details
prepare_Rd: createBufferedMatrix.Rd:15-16: Dropping empty section \value
prepare_Rd: createBufferedMatrix.Rd:19-20: Dropping empty section \references
prepare_Rd: createBufferedMatrix.Rd:21-22: Dropping empty section \seealso
prepare_Rd: createBufferedMatrix.Rd:23-24: Dropping empty section \examples
* checking Rd metadata ... OK
* checking Rd cross-references ... OK
* checking for missing documentation entries ... OK
* checking for code/documentation mismatches ... OK
* checking Rd \usage sections ... OK
* checking Rd contents ... OK
* checking for unstated dependencies in examples ... OK
* checking line endings in C/C++/Fortran sources/headers ... OK
* checking compiled code ... NOTE
Note: information on .o files is not available
* checking 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: 2 NOTEs
See
  ‘/home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/00check.log’
for details.


Installation output

BufferedMatrix.Rcheck/00install.out

##############################################################################
##############################################################################
###
### Running command:
###
###   /home/biocbuild/R/R/bin/R CMD INSTALL BufferedMatrix
###
##############################################################################
##############################################################################


* installing to library ‘/home/biocbuild/R/R-devel_2025-02-19/site-library’
* installing *source* package ‘BufferedMatrix’ ...
** this is package ‘BufferedMatrix’ version ‘1.71.1’
** using staged installation
** libs
using C compiler: ‘aarch64-unknown-linux-gnu-gcc (GCC) 14.2.0’
/opt/ohpc/pub/compiler/gcc/14.2.0/bin/aarch64-unknown-linux-gnu-gcc -std=gnu23 -I"/home/biocbuild/R/R/include" -DNDEBUG   -I/usr/local/include    -fPIC  -g -O2  -Wall -Werror=format-security -c RBufferedMatrix.c -o RBufferedMatrix.o
/opt/ohpc/pub/compiler/gcc/14.2.0/bin/aarch64-unknown-linux-gnu-gcc -std=gnu23 -I"/home/biocbuild/R/R/include" -DNDEBUG   -I/usr/local/include    -fPIC  -g -O2  -Wall -Werror=format-security -c doubleBufferedMatrix.c -o doubleBufferedMatrix.o
doubleBufferedMatrix.c: In function ‘dbm_ReadOnlyMode’:
doubleBufferedMatrix.c:1580:7: warning: suggest parentheses around operand of ‘!’ or change ‘&’ to ‘&&’ or ‘!’ to ‘~’ [-Wparentheses]
 1580 |   if (!(Matrix->readonly) & setting){
      |       ^~~~~~~~~~~~~~~~~~~
doubleBufferedMatrix.c: At top level:
doubleBufferedMatrix.c:3327:12: warning: ‘sort_double’ defined but not used [-Wunused-function]
 3327 | static int sort_double(const double *a1,const double *a2){
      |            ^~~~~~~~~~~
/opt/ohpc/pub/compiler/gcc/14.2.0/bin/aarch64-unknown-linux-gnu-gcc -std=gnu23 -I"/home/biocbuild/R/R/include" -DNDEBUG   -I/usr/local/include    -fPIC  -g -O2  -Wall -Werror=format-security -c doubleBufferedMatrix_C_tests.c -o doubleBufferedMatrix_C_tests.o
/opt/ohpc/pub/compiler/gcc/14.2.0/bin/aarch64-unknown-linux-gnu-gcc -std=gnu23 -I"/home/biocbuild/R/R/include" -DNDEBUG   -I/usr/local/include    -fPIC  -g -O2  -Wall -Werror=format-security -c init_package.c -o init_package.o
/opt/ohpc/pub/compiler/gcc/14.2.0/bin/aarch64-unknown-linux-gnu-gcc -std=gnu23 -shared -L/home/biocbuild/R/R/lib -L/usr/local/lib -o BufferedMatrix.so RBufferedMatrix.o doubleBufferedMatrix.o doubleBufferedMatrix_C_tests.o init_package.o -L/home/biocbuild/R/R/lib -lR
installing to /home/biocbuild/R/R-devel_2025-02-19/site-library/00LOCK-BufferedMatrix/00new/BufferedMatrix/libs
** R
** inst
** byte-compile and prepare package for lazy loading
Creating a new generic function for ‘rowMeans’ in package ‘BufferedMatrix’
Creating a new generic function for ‘rowSums’ in package ‘BufferedMatrix’
Creating a new generic function for ‘colMeans’ in package ‘BufferedMatrix’
Creating a new generic function for ‘colSums’ in package ‘BufferedMatrix’
Creating a generic function for ‘ncol’ from package ‘base’ in package ‘BufferedMatrix’
Creating a generic function for ‘nrow’ from package ‘base’ in package ‘BufferedMatrix’
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
** checking absolute paths in shared objects and dynamic libraries
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (BufferedMatrix)

Tests output

BufferedMatrix.Rcheck/tests/c_code_level_tests.Rout


R Under development (unstable) (2025-02-19 r87757) -- "Unsuffered Consequences"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: aarch64-unknown-linux-gnu

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.353   0.052   0.392 

BufferedMatrix.Rcheck/tests/objectTesting.Rout


R Under development (unstable) (2025-02-19 r87757) -- "Unsuffered Consequences"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: aarch64-unknown-linux-gnu

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] "/home/biocbuild/bbs-3.21-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) max used (Mb)
Ncells 477833 25.6    1045337 55.9   639800 34.2
Vcells 884297  6.8    8388608 64.0  2080696 15.9
> 
> 
> 
> 
> ##
> ## 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] "Fri Mar 28 04:31:10 2025"
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> date()
[1] "Fri Mar 28 04:31:10 2025"
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,which.col] == test.matrix[which.row,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> 
> 
> RowMode(tmp2)
<pointer: 0x28136e0>
> 
> 
> 
> 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] "Fri Mar 28 04:31:10 2025"
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col <- sample(1:20,5,replace=TRUE)
+   if (!all(tmp2[which.row,which.col] == test.matrix[which.row,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> date()
[1] "Fri Mar 28 04:31:10 2025"
> 
> ColMode(tmp2)
<pointer: 0x28136e0>
> 
> 
> 
> ### 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,] 99.5074702  1.2946766 -0.1534697  0.9976369
[2,]  0.9591945  0.1086413 -0.8443688 -0.4648408
[3,]  1.5960916  0.6382680  2.1546444  0.2205626
[4,]  0.6067701 -0.3076759  0.1946399  0.7469850
> ewApply(tmp5,abs)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
           [,1]      [,2]      [,3]      [,4]
[1,] 99.5074702 1.2946766 0.1534697 0.9976369
[2,]  0.9591945 0.1086413 0.8443688 0.4648408
[3,]  1.5960916 0.6382680 2.1546444 0.2205626
[4,]  0.6067701 0.3076759 0.1946399 0.7469850
> ewApply(tmp5,sqrt)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
          [,1]      [,2]      [,3]      [,4]
[1,] 9.9753431 1.1378386 0.3917520 0.9988177
[2,] 0.9793848 0.3296078 0.9188954 0.6817923
[3,] 1.2633652 0.7989168 1.4678707 0.4696409
[4,] 0.7789545 0.5546854 0.4411801 0.8642829
> 
> 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:    /home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
          [,1]     [,2]     [,3]     [,4]
[1,] 224.26090 37.67306 29.07099 35.98581
[2,]  35.75304 28.40472 35.03332 32.28276
[3,]  39.22974 33.62744 41.83335 29.91697
[4,]  33.39632 30.85453 29.60644 34.38981
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x180c4e0>
> exp(tmp5)
<pointer: 0x180c4e0>
> log(tmp5,2)
<pointer: 0x180c4e0>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 466.7697
> Min(tmp5)
[1] 53.53502
> mean(tmp5)
[1] 72.82081
> Sum(tmp5)
[1] 14564.16
> Var(tmp5)
[1] 858.3246
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 90.56282 69.29237 70.51923 68.79830 72.21143 70.45546 72.88570 69.46830
 [9] 72.40812 71.60639
> rowSums(tmp5)
 [1] 1811.256 1385.847 1410.385 1375.966 1444.229 1409.109 1457.714 1389.366
 [9] 1448.162 1432.128
> rowVars(tmp5)
 [1] 7887.00962  108.95391  115.04823   48.29734   40.66893   94.40801
 [7]  100.43674   58.49127   78.02633   71.57313
> rowSd(tmp5)
 [1] 88.808838 10.438099 10.726054  6.949629  6.377220  9.716378 10.021813
 [8]  7.647958  8.833252  8.460091
> rowMax(tmp5)
 [1] 466.76968  96.24759  94.26691  80.35529  81.33170  86.04735  91.70991
 [8]  82.78886  91.25023  84.05621
> rowMin(tmp5)
 [1] 59.62685 57.97252 53.53502 57.41737 55.76124 53.92372 54.62939 55.52217
 [9] 59.66503 54.89090
> 
> colMeans(tmp5)
 [1] 111.97147  67.74508  69.28386  72.15011  71.08034  74.40851  70.83901
 [8]  68.96806  66.55657  67.79090  74.53614  74.28565  68.58376  72.16360
[15]  71.28503  71.80064  70.67279  69.66286  73.04510  69.58675
> colSums(tmp5)
 [1] 1119.7147  677.4508  692.8386  721.5011  710.8034  744.0851  708.3901
 [8]  689.6806  665.5657  677.9090  745.3614  742.8565  685.8376  721.6360
[15]  712.8503  718.0064  706.7279  696.6286  730.4510  695.8675
> colVars(tmp5)
 [1] 15573.61542    54.64710    79.14348    44.70497    68.48829   135.65190
 [7]    98.01574    73.83614    81.12085   104.85451    41.89786    85.77942
[13]    52.25627   131.49199    48.72713    27.33181   124.92809    80.73789
[19]   100.88907    67.80604
> colSd(tmp5)
 [1] 124.794292   7.392368   8.896262   6.686177   8.275766  11.646970
 [7]   9.900290   8.592796   9.006711  10.239849   6.472856   9.261718
[13]   7.228850  11.466996   6.980482   5.227984  11.177124   8.985426
[19]  10.044355   8.234442
> colMax(tmp5)
 [1] 466.76968  78.41154  87.07064  85.07249  86.43376  94.26691  85.24213
 [8]  80.75435  78.25857  81.89716  82.78886  83.21391  79.35262  96.24759
[15]  81.05894  79.46489  86.04735  78.88405  91.70991  85.98873
> colMin(tmp5)
 [1] 62.24593 58.39180 60.13574 62.26826 59.66503 62.31939 58.06246 54.40821
 [9] 54.62939 55.52217 57.97252 53.53502 55.76124 59.62685 58.94647 62.10819
[17] 54.94631 53.92372 60.62487 56.96828
> 
> 
> ### setting a random element to NA and then testing with na.rm=TRUE or na.rm=FALSE (The default)
> 
> 
> which.row <- sample(1:10,1,replace=TRUE)
> which.col  <- sample(1:20,1,replace=TRUE)
> 
> tmp5[which.row,which.col] <- NA
> 
> Max(tmp5)
[1] NA
> Min(tmp5)
[1] NA
> mean(tmp5)
[1] NA
> Sum(tmp5)
[1] NA
> Var(tmp5)
[1] NA
> 
> rowMeans(tmp5)
 [1] 90.56282 69.29237 70.51923 68.79830 72.21143 70.45546       NA 69.46830
 [9] 72.40812 71.60639
> rowSums(tmp5)
 [1] 1811.256 1385.847 1410.385 1375.966 1444.229 1409.109       NA 1389.366
 [9] 1448.162 1432.128
> rowVars(tmp5)
 [1] 7887.00962  108.95391  115.04823   48.29734   40.66893   94.40801
 [7]  105.44666   58.49127   78.02633   71.57313
> rowSd(tmp5)
 [1] 88.808838 10.438099 10.726054  6.949629  6.377220  9.716378 10.268723
 [8]  7.647958  8.833252  8.460091
> rowMax(tmp5)
 [1] 466.76968  96.24759  94.26691  80.35529  81.33170  86.04735        NA
 [8]  82.78886  91.25023  84.05621
> rowMin(tmp5)
 [1] 59.62685 57.97252 53.53502 57.41737 55.76124 53.92372       NA 55.52217
 [9] 59.66503 54.89090
> 
> colMeans(tmp5)
 [1] 111.97147  67.74508  69.28386  72.15011  71.08034        NA  70.83901
 [8]  68.96806  66.55657  67.79090  74.53614  74.28565  68.58376  72.16360
[15]  71.28503  71.80064  70.67279  69.66286  73.04510  69.58675
> colSums(tmp5)
 [1] 1119.7147  677.4508  692.8386  721.5011  710.8034        NA  708.3901
 [8]  689.6806  665.5657  677.9090  745.3614  742.8565  685.8376  721.6360
[15]  712.8503  718.0064  706.7279  696.6286  730.4510  695.8675
> colVars(tmp5)
 [1] 15573.61542    54.64710    79.14348    44.70497    68.48829          NA
 [7]    98.01574    73.83614    81.12085   104.85451    41.89786    85.77942
[13]    52.25627   131.49199    48.72713    27.33181   124.92809    80.73789
[19]   100.88907    67.80604
> colSd(tmp5)
 [1] 124.794292   7.392368   8.896262   6.686177   8.275766         NA
 [7]   9.900290   8.592796   9.006711  10.239849   6.472856   9.261718
[13]   7.228850  11.466996   6.980482   5.227984  11.177124   8.985426
[19]  10.044355   8.234442
> colMax(tmp5)
 [1] 466.76968  78.41154  87.07064  85.07249  86.43376        NA  85.24213
 [8]  80.75435  78.25857  81.89716  82.78886  83.21391  79.35262  96.24759
[15]  81.05894  79.46489  86.04735  78.88405  91.70991  85.98873
> colMin(tmp5)
 [1] 62.24593 58.39180 60.13574 62.26826 59.66503       NA 58.06246 54.40821
 [9] 54.62939 55.52217 57.97252 53.53502 55.76124 59.62685 58.94647 62.10819
[17] 54.94631 53.92372 60.62487 56.96828
> 
> Max(tmp5,na.rm=TRUE)
[1] 466.7697
> Min(tmp5,na.rm=TRUE)
[1] 53.53502
> mean(tmp5,na.rm=TRUE)
[1] 72.8048
> Sum(tmp5,na.rm=TRUE)
[1] 14488.16
> Var(tmp5,na.rm=TRUE)
[1] 862.608
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 90.56282 69.29237 70.51923 68.79830 72.21143 70.45546 72.72140 69.46830
 [9] 72.40812 71.60639
> rowSums(tmp5,na.rm=TRUE)
 [1] 1811.256 1385.847 1410.385 1375.966 1444.229 1409.109 1381.707 1389.366
 [9] 1448.162 1432.128
> rowVars(tmp5,na.rm=TRUE)
 [1] 7887.00962  108.95391  115.04823   48.29734   40.66893   94.40801
 [7]  105.44666   58.49127   78.02633   71.57313
> rowSd(tmp5,na.rm=TRUE)
 [1] 88.808838 10.438099 10.726054  6.949629  6.377220  9.716378 10.268723
 [8]  7.647958  8.833252  8.460091
> rowMax(tmp5,na.rm=TRUE)
 [1] 466.76968  96.24759  94.26691  80.35529  81.33170  86.04735  91.70991
 [8]  82.78886  91.25023  84.05621
> rowMin(tmp5,na.rm=TRUE)
 [1] 59.62685 57.97252 53.53502 57.41737 55.76124 53.92372 54.62939 55.52217
 [9] 59.66503 54.89090
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 111.97147  67.74508  69.28386  72.15011  71.08034  74.23085  70.83901
 [8]  68.96806  66.55657  67.79090  74.53614  74.28565  68.58376  72.16360
[15]  71.28503  71.80064  70.67279  69.66286  73.04510  69.58675
> colSums(tmp5,na.rm=TRUE)
 [1] 1119.7147  677.4508  692.8386  721.5011  710.8034  668.0777  708.3901
 [8]  689.6806  665.5657  677.9090  745.3614  742.8565  685.8376  721.6360
[15]  712.8503  718.0064  706.7279  696.6286  730.4510  695.8675
> colVars(tmp5,na.rm=TRUE)
 [1] 15573.61542    54.64710    79.14348    44.70497    68.48829   152.25331
 [7]    98.01574    73.83614    81.12085   104.85451    41.89786    85.77942
[13]    52.25627   131.49199    48.72713    27.33181   124.92809    80.73789
[19]   100.88907    67.80604
> colSd(tmp5,na.rm=TRUE)
 [1] 124.794292   7.392368   8.896262   6.686177   8.275766  12.339097
 [7]   9.900290   8.592796   9.006711  10.239849   6.472856   9.261718
[13]   7.228850  11.466996   6.980482   5.227984  11.177124   8.985426
[19]  10.044355   8.234442
> colMax(tmp5,na.rm=TRUE)
 [1] 466.76968  78.41154  87.07064  85.07249  86.43376  94.26691  85.24213
 [8]  80.75435  78.25857  81.89716  82.78886  83.21391  79.35262  96.24759
[15]  81.05894  79.46489  86.04735  78.88405  91.70991  85.98873
> colMin(tmp5,na.rm=TRUE)
 [1] 62.24593 58.39180 60.13574 62.26826 59.66503 62.31939 58.06246 54.40821
 [9] 54.62939 55.52217 57.97252 53.53502 55.76124 59.62685 58.94647 62.10819
[17] 54.94631 53.92372 60.62487 56.96828
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1] 90.56282 69.29237 70.51923 68.79830 72.21143 70.45546      NaN 69.46830
 [9] 72.40812 71.60639
> rowSums(tmp5,na.rm=TRUE)
 [1] 1811.256 1385.847 1410.385 1375.966 1444.229 1409.109    0.000 1389.366
 [9] 1448.162 1432.128
> rowVars(tmp5,na.rm=TRUE)
 [1] 7887.00962  108.95391  115.04823   48.29734   40.66893   94.40801
 [7]         NA   58.49127   78.02633   71.57313
> rowSd(tmp5,na.rm=TRUE)
 [1] 88.808838 10.438099 10.726054  6.949629  6.377220  9.716378        NA
 [8]  7.647958  8.833252  8.460091
> rowMax(tmp5,na.rm=TRUE)
 [1] 466.76968  96.24759  94.26691  80.35529  81.33170  86.04735        NA
 [8]  82.78886  91.25023  84.05621
> rowMin(tmp5,na.rm=TRUE)
 [1] 59.62685 57.97252 53.53502 57.41737 55.76124 53.92372       NA 55.52217
 [9] 59.66503 54.89090
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1] 116.32165  68.78433  69.09768  71.79732  69.37440       NaN  71.57458
 [8]  68.18946  67.88181  66.23796  74.00478  73.63465  67.38722  72.66329
[15]  71.82777  72.02663  69.18322  70.09439  70.97123  70.98881
> colSums(tmp5,na.rm=TRUE)
 [1] 1046.8949  619.0590  621.8791  646.1759  624.3696    0.0000  644.1712
 [8]  613.7052  610.9363  596.1416  666.0430  662.7119  606.4850  653.9696
[15]  646.4500  648.2397  622.6489  630.8495  638.7411  638.8993
> colVars(tmp5,na.rm=TRUE)
 [1] 17307.42157    49.32747    88.64646    48.89289    44.30938          NA
 [7]   104.18090    76.24586    71.50294    90.83063    43.95869    91.73418
[13]    42.68159   145.11953    51.50415    30.17375   115.58224    88.73513
[19]    65.11478    54.16707
> colSd(tmp5,na.rm=TRUE)
 [1] 131.557674   7.023352   9.415225   6.992345   6.656529         NA
 [7]  10.206905   8.731887   8.455941   9.530510   6.630135   9.577796
[13]   6.533115  12.046557   7.176639   5.493064  10.750918   9.419933
[19]   8.069373   7.359828
> colMax(tmp5,na.rm=TRUE)
 [1] 466.76968  78.41154  87.07064  85.07249  78.03491      -Inf  85.24213
 [8]  80.75435  78.25857  81.89716  82.78886  83.21391  73.41505  96.24759
[15]  81.05894  79.46489  86.04735  78.88405  87.87759  85.98873
> colMin(tmp5,na.rm=TRUE)
 [1] 62.24593 59.12070 60.13574 62.26826 59.66503      Inf 58.06246 54.40821
 [9] 57.44392 55.52217 57.97252 53.53502 55.76124 59.62685 58.94647 62.10819
[17] 54.94631 53.92372 60.62487 60.04267
> 
> 
> 
> 
> 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] 196.0488 234.1884 118.2677 137.8794 232.6211 186.8331 176.0087 346.6000
 [9] 163.2370 162.0297
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 196.0488 234.1884 118.2677 137.8794 232.6211 186.8331 176.0087 346.6000
 [9] 163.2370 162.0297
> 
> 
> 
> 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] -8.526513e-14  0.000000e+00 -5.684342e-14  5.684342e-14  1.136868e-13
 [6]  2.842171e-14  5.684342e-14 -1.136868e-13 -4.263256e-14  2.273737e-13
[11]  4.547474e-13  5.684342e-14  5.684342e-14  2.842171e-14  1.136868e-13
[16] -1.705303e-13 -2.842171e-14  1.136868e-13 -1.421085e-13 -1.136868e-13
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> ## making sure these things agree
> ##
> ## first when there is no NA
> 
> 
> 
> agree.checks <- function(buff.matrix,r.matrix,err.tol=1e-10){
+ 
+   if (Max(buff.matrix,na.rm=TRUE) != max(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Max")
+   }
+   
+ 
+   if (Min(buff.matrix,na.rm=TRUE) != min(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Min")
+   }
+ 
+ 
+   if (abs(Sum(buff.matrix,na.rm=TRUE)- sum(r.matrix,na.rm=TRUE)) > err.tol){
+ 
+     cat(Sum(buff.matrix,na.rm=TRUE),"\n")
+     cat(sum(r.matrix,na.rm=TRUE),"\n")
+     cat(Sum(buff.matrix,na.rm=TRUE) - sum(r.matrix,na.rm=TRUE),"\n")
+     
+     stop("No agreement in Sum")
+   }
+   
+   if (abs(mean(buff.matrix,na.rm=TRUE) - mean(r.matrix,na.rm=TRUE)) > err.tol){
+     stop("No agreement in mean")
+   }
+   
+   
+   if(abs(Var(buff.matrix,na.rm=TRUE) - var(as.vector(r.matrix),na.rm=TRUE)) > err.tol){
+     stop("No agreement in Var")
+   }
+   
+   
+ 
+   if(any(abs(rowMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,mean,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowMeans")
+   }
+   
+   
+   if(any(abs(colMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,mean,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colMeans")
+   }
+   
+   
+   if(any(abs(rowSums(buff.matrix,na.rm=TRUE)  -  apply(r.matrix,1,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in rowSums")
+   }
+   
+   
+   if(any(abs(colSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colSums")
+   }
+   
+   ### this is to get around the fact that R doesn't like to compute NA on an entire vector of NA when 
+   ### computing variance
+   my.Var <- function(x,na.rm=FALSE){
+    if (all(is.na(x))){
+      return(NA)
+    } else {
+      var(x,na.rm=na.rm)
+    }
+ 
+   }
+   
+   if(any(abs(rowVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+   
+   
+   if(any(abs(colVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+ 
+ 
+   if(any(abs(rowMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+ 
+   if(any(abs(colMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+   
+   
+   if(any(abs(rowMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+   
+ 
+   if(any(abs(colMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+ 
+   if(any(abs(colMedians(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,median,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMedian")
+   }
+ 
+   if(any(abs(colRanges(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,range,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colRanges")
+   }
+ 
+ 
+   
+ }
> 
> 
> 
> 
> 
> 
> 
> 
> 
> for (rep in 1:20){
+   copymatrix <- matrix(rnorm(200,150,15),10,20)
+   
+   tmp5[1:10,1:20] <- copymatrix
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ## now lets assign some NA values and check agreement
+ 
+   which.row <- sample(1:10,1,replace=TRUE)
+   which.col  <- sample(1:20,1,replace=TRUE)
+   
+   cat(which.row," ",which.col,"\n")
+   
+   tmp5[which.row,which.col] <- NA
+   copymatrix[which.row,which.col] <- NA
+   
+   agree.checks(tmp5,copymatrix)
+ 
+   ## make an entire row NA
+   tmp5[which.row,] <- NA
+   copymatrix[which.row,] <- NA
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ### also make an entire col NA
+   tmp5[,which.col] <- NA
+   copymatrix[,which.col] <- NA
+ 
+   agree.checks(tmp5,copymatrix)
+ 
+   ### now make 1 element non NA with NA in the rest of row and column
+ 
+   tmp5[which.row,which.col] <- rnorm(1,150,15)
+   copymatrix[which.row,which.col] <- tmp5[which.row,which.col]
+ 
+   agree.checks(tmp5,copymatrix)
+ }
5   15 
3   8 
9   7 
3   5 
5   18 
6   12 
6   8 
5   12 
4   13 
7   2 
9   5 
10   2 
6   13 
1   16 
5   1 
7   19 
7   14 
10   18 
2   19 
10   7 
There were 50 or more warnings (use warnings() to see the first 50)
> 
> 
> ### now test 1 by n and n by 1 matrix
> 
> 
> err.tol <- 1e-12
> 
> rm(tmp5)
> 
> dataset1 <- rnorm(100)
> dataset2 <- rnorm(100)
> 
> tmp <- createBufferedMatrix(1,100)
> tmp[1,] <- dataset1
> 
> tmp2 <- createBufferedMatrix(100,1)
> tmp2[,1] <- dataset2
> 
> 
> 
> 
> 
> Max(tmp)
[1] 1.746857
> Min(tmp)
[1] -2.353924
> mean(tmp)
[1] -0.0653567
> Sum(tmp)
[1] -6.53567
> Var(tmp)
[1] 0.82996
> 
> rowMeans(tmp)
[1] -0.0653567
> rowSums(tmp)
[1] -6.53567
> rowVars(tmp)
[1] 0.82996
> rowSd(tmp)
[1] 0.9110214
> rowMax(tmp)
[1] 1.746857
> rowMin(tmp)
[1] -2.353924
> 
> colMeans(tmp)
  [1] -0.78180899 -1.26825836  0.67447426 -0.08065411 -0.97686078 -0.03780090
  [7] -0.64386885 -1.55140177  1.50082697  0.37386960 -2.31689485 -0.70813700
 [13]  0.35874954 -0.48185890  1.12585271  0.33481474  0.49495730  0.47457062
 [19] -1.03887386  0.07589607 -0.48886014  0.39536320  1.12928117 -0.57659029
 [25]  1.74685744  1.44406956  0.33744551 -0.04140227 -0.60497473 -0.16533261
 [31] -0.74594225 -0.39452393 -1.01471636 -0.25535472 -0.87582421 -0.06078151
 [37] -0.72828661  0.40599826 -0.80503555 -0.66631718 -0.29403269  0.11215911
 [43] -0.25176948 -0.36674791 -0.44083423  0.98273460  0.16407796  1.50770014
 [49]  1.22528391  0.05001593  0.46232834  0.27919353  0.88808139  1.19929684
 [55]  0.30362483 -1.02105224 -1.32971333 -0.44909234 -0.81930117  1.49298377
 [61]  1.17264062 -0.31340836 -0.34935713  0.99294016  1.62108195  1.63786686
 [67] -0.40642834 -0.78009755 -0.42716691 -0.34647432 -1.09650797 -0.84597419
 [73] -0.75205296 -0.24191472 -0.33344816 -2.35392432 -0.36204049 -1.07840014
 [79] -1.38879280  1.55276965 -0.14101667 -1.29895698 -1.61448946 -0.58456520
 [85]  1.10362798 -0.31475749 -0.27385619  0.33489255  1.38720736  1.45588702
 [91]  0.44220812  0.62159489 -0.30550849  0.88742823 -0.57238625  0.54130649
 [97]  0.02270562 -1.88881276  0.27827254  0.22463506
> colSums(tmp)
  [1] -0.78180899 -1.26825836  0.67447426 -0.08065411 -0.97686078 -0.03780090
  [7] -0.64386885 -1.55140177  1.50082697  0.37386960 -2.31689485 -0.70813700
 [13]  0.35874954 -0.48185890  1.12585271  0.33481474  0.49495730  0.47457062
 [19] -1.03887386  0.07589607 -0.48886014  0.39536320  1.12928117 -0.57659029
 [25]  1.74685744  1.44406956  0.33744551 -0.04140227 -0.60497473 -0.16533261
 [31] -0.74594225 -0.39452393 -1.01471636 -0.25535472 -0.87582421 -0.06078151
 [37] -0.72828661  0.40599826 -0.80503555 -0.66631718 -0.29403269  0.11215911
 [43] -0.25176948 -0.36674791 -0.44083423  0.98273460  0.16407796  1.50770014
 [49]  1.22528391  0.05001593  0.46232834  0.27919353  0.88808139  1.19929684
 [55]  0.30362483 -1.02105224 -1.32971333 -0.44909234 -0.81930117  1.49298377
 [61]  1.17264062 -0.31340836 -0.34935713  0.99294016  1.62108195  1.63786686
 [67] -0.40642834 -0.78009755 -0.42716691 -0.34647432 -1.09650797 -0.84597419
 [73] -0.75205296 -0.24191472 -0.33344816 -2.35392432 -0.36204049 -1.07840014
 [79] -1.38879280  1.55276965 -0.14101667 -1.29895698 -1.61448946 -0.58456520
 [85]  1.10362798 -0.31475749 -0.27385619  0.33489255  1.38720736  1.45588702
 [91]  0.44220812  0.62159489 -0.30550849  0.88742823 -0.57238625  0.54130649
 [97]  0.02270562 -1.88881276  0.27827254  0.22463506
> colVars(tmp)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> colSd(tmp)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> colMax(tmp)
  [1] -0.78180899 -1.26825836  0.67447426 -0.08065411 -0.97686078 -0.03780090
  [7] -0.64386885 -1.55140177  1.50082697  0.37386960 -2.31689485 -0.70813700
 [13]  0.35874954 -0.48185890  1.12585271  0.33481474  0.49495730  0.47457062
 [19] -1.03887386  0.07589607 -0.48886014  0.39536320  1.12928117 -0.57659029
 [25]  1.74685744  1.44406956  0.33744551 -0.04140227 -0.60497473 -0.16533261
 [31] -0.74594225 -0.39452393 -1.01471636 -0.25535472 -0.87582421 -0.06078151
 [37] -0.72828661  0.40599826 -0.80503555 -0.66631718 -0.29403269  0.11215911
 [43] -0.25176948 -0.36674791 -0.44083423  0.98273460  0.16407796  1.50770014
 [49]  1.22528391  0.05001593  0.46232834  0.27919353  0.88808139  1.19929684
 [55]  0.30362483 -1.02105224 -1.32971333 -0.44909234 -0.81930117  1.49298377
 [61]  1.17264062 -0.31340836 -0.34935713  0.99294016  1.62108195  1.63786686
 [67] -0.40642834 -0.78009755 -0.42716691 -0.34647432 -1.09650797 -0.84597419
 [73] -0.75205296 -0.24191472 -0.33344816 -2.35392432 -0.36204049 -1.07840014
 [79] -1.38879280  1.55276965 -0.14101667 -1.29895698 -1.61448946 -0.58456520
 [85]  1.10362798 -0.31475749 -0.27385619  0.33489255  1.38720736  1.45588702
 [91]  0.44220812  0.62159489 -0.30550849  0.88742823 -0.57238625  0.54130649
 [97]  0.02270562 -1.88881276  0.27827254  0.22463506
> colMin(tmp)
  [1] -0.78180899 -1.26825836  0.67447426 -0.08065411 -0.97686078 -0.03780090
  [7] -0.64386885 -1.55140177  1.50082697  0.37386960 -2.31689485 -0.70813700
 [13]  0.35874954 -0.48185890  1.12585271  0.33481474  0.49495730  0.47457062
 [19] -1.03887386  0.07589607 -0.48886014  0.39536320  1.12928117 -0.57659029
 [25]  1.74685744  1.44406956  0.33744551 -0.04140227 -0.60497473 -0.16533261
 [31] -0.74594225 -0.39452393 -1.01471636 -0.25535472 -0.87582421 -0.06078151
 [37] -0.72828661  0.40599826 -0.80503555 -0.66631718 -0.29403269  0.11215911
 [43] -0.25176948 -0.36674791 -0.44083423  0.98273460  0.16407796  1.50770014
 [49]  1.22528391  0.05001593  0.46232834  0.27919353  0.88808139  1.19929684
 [55]  0.30362483 -1.02105224 -1.32971333 -0.44909234 -0.81930117  1.49298377
 [61]  1.17264062 -0.31340836 -0.34935713  0.99294016  1.62108195  1.63786686
 [67] -0.40642834 -0.78009755 -0.42716691 -0.34647432 -1.09650797 -0.84597419
 [73] -0.75205296 -0.24191472 -0.33344816 -2.35392432 -0.36204049 -1.07840014
 [79] -1.38879280  1.55276965 -0.14101667 -1.29895698 -1.61448946 -0.58456520
 [85]  1.10362798 -0.31475749 -0.27385619  0.33489255  1.38720736  1.45588702
 [91]  0.44220812  0.62159489 -0.30550849  0.88742823 -0.57238625  0.54130649
 [97]  0.02270562 -1.88881276  0.27827254  0.22463506
> colMedians(tmp)
  [1] -0.78180899 -1.26825836  0.67447426 -0.08065411 -0.97686078 -0.03780090
  [7] -0.64386885 -1.55140177  1.50082697  0.37386960 -2.31689485 -0.70813700
 [13]  0.35874954 -0.48185890  1.12585271  0.33481474  0.49495730  0.47457062
 [19] -1.03887386  0.07589607 -0.48886014  0.39536320  1.12928117 -0.57659029
 [25]  1.74685744  1.44406956  0.33744551 -0.04140227 -0.60497473 -0.16533261
 [31] -0.74594225 -0.39452393 -1.01471636 -0.25535472 -0.87582421 -0.06078151
 [37] -0.72828661  0.40599826 -0.80503555 -0.66631718 -0.29403269  0.11215911
 [43] -0.25176948 -0.36674791 -0.44083423  0.98273460  0.16407796  1.50770014
 [49]  1.22528391  0.05001593  0.46232834  0.27919353  0.88808139  1.19929684
 [55]  0.30362483 -1.02105224 -1.32971333 -0.44909234 -0.81930117  1.49298377
 [61]  1.17264062 -0.31340836 -0.34935713  0.99294016  1.62108195  1.63786686
 [67] -0.40642834 -0.78009755 -0.42716691 -0.34647432 -1.09650797 -0.84597419
 [73] -0.75205296 -0.24191472 -0.33344816 -2.35392432 -0.36204049 -1.07840014
 [79] -1.38879280  1.55276965 -0.14101667 -1.29895698 -1.61448946 -0.58456520
 [85]  1.10362798 -0.31475749 -0.27385619  0.33489255  1.38720736  1.45588702
 [91]  0.44220812  0.62159489 -0.30550849  0.88742823 -0.57238625  0.54130649
 [97]  0.02270562 -1.88881276  0.27827254  0.22463506
> colRanges(tmp)
          [,1]      [,2]      [,3]        [,4]       [,5]       [,6]       [,7]
[1,] -0.781809 -1.268258 0.6744743 -0.08065411 -0.9768608 -0.0378009 -0.6438689
[2,] -0.781809 -1.268258 0.6744743 -0.08065411 -0.9768608 -0.0378009 -0.6438689
          [,8]     [,9]     [,10]     [,11]     [,12]     [,13]      [,14]
[1,] -1.551402 1.500827 0.3738696 -2.316895 -0.708137 0.3587495 -0.4818589
[2,] -1.551402 1.500827 0.3738696 -2.316895 -0.708137 0.3587495 -0.4818589
        [,15]     [,16]     [,17]     [,18]     [,19]      [,20]      [,21]
[1,] 1.125853 0.3348147 0.4949573 0.4745706 -1.038874 0.07589607 -0.4888601
[2,] 1.125853 0.3348147 0.4949573 0.4745706 -1.038874 0.07589607 -0.4888601
         [,22]    [,23]      [,24]    [,25]   [,26]     [,27]       [,28]
[1,] 0.3953632 1.129281 -0.5765903 1.746857 1.44407 0.3374455 -0.04140227
[2,] 0.3953632 1.129281 -0.5765903 1.746857 1.44407 0.3374455 -0.04140227
          [,29]      [,30]      [,31]      [,32]     [,33]      [,34]
[1,] -0.6049747 -0.1653326 -0.7459422 -0.3945239 -1.014716 -0.2553547
[2,] -0.6049747 -0.1653326 -0.7459422 -0.3945239 -1.014716 -0.2553547
          [,35]       [,36]      [,37]     [,38]      [,39]      [,40]
[1,] -0.8758242 -0.06078151 -0.7282866 0.4059983 -0.8050356 -0.6663172
[2,] -0.8758242 -0.06078151 -0.7282866 0.4059983 -0.8050356 -0.6663172
          [,41]     [,42]      [,43]      [,44]      [,45]     [,46]    [,47]
[1,] -0.2940327 0.1121591 -0.2517695 -0.3667479 -0.4408342 0.9827346 0.164078
[2,] -0.2940327 0.1121591 -0.2517695 -0.3667479 -0.4408342 0.9827346 0.164078
      [,48]    [,49]      [,50]     [,51]     [,52]     [,53]    [,54]
[1,] 1.5077 1.225284 0.05001593 0.4623283 0.2791935 0.8880814 1.199297
[2,] 1.5077 1.225284 0.05001593 0.4623283 0.2791935 0.8880814 1.199297
         [,55]     [,56]     [,57]      [,58]      [,59]    [,60]    [,61]
[1,] 0.3036248 -1.021052 -1.329713 -0.4490923 -0.8193012 1.492984 1.172641
[2,] 0.3036248 -1.021052 -1.329713 -0.4490923 -0.8193012 1.492984 1.172641
          [,62]      [,63]     [,64]    [,65]    [,66]      [,67]      [,68]
[1,] -0.3134084 -0.3493571 0.9929402 1.621082 1.637867 -0.4064283 -0.7800975
[2,] -0.3134084 -0.3493571 0.9929402 1.621082 1.637867 -0.4064283 -0.7800975
          [,69]      [,70]     [,71]      [,72]     [,73]      [,74]      [,75]
[1,] -0.4271669 -0.3464743 -1.096508 -0.8459742 -0.752053 -0.2419147 -0.3334482
[2,] -0.4271669 -0.3464743 -1.096508 -0.8459742 -0.752053 -0.2419147 -0.3334482
         [,76]      [,77]   [,78]     [,79]   [,80]      [,81]     [,82]
[1,] -2.353924 -0.3620405 -1.0784 -1.388793 1.55277 -0.1410167 -1.298957
[2,] -2.353924 -0.3620405 -1.0784 -1.388793 1.55277 -0.1410167 -1.298957
         [,83]      [,84]    [,85]      [,86]      [,87]     [,88]    [,89]
[1,] -1.614489 -0.5845652 1.103628 -0.3147575 -0.2738562 0.3348926 1.387207
[2,] -1.614489 -0.5845652 1.103628 -0.3147575 -0.2738562 0.3348926 1.387207
        [,90]     [,91]     [,92]      [,93]     [,94]      [,95]     [,96]
[1,] 1.455887 0.4422081 0.6215949 -0.3055085 0.8874282 -0.5723863 0.5413065
[2,] 1.455887 0.4422081 0.6215949 -0.3055085 0.8874282 -0.5723863 0.5413065
          [,97]     [,98]     [,99]    [,100]
[1,] 0.02270562 -1.888813 0.2782725 0.2246351
[2,] 0.02270562 -1.888813 0.2782725 0.2246351
> 
> 
> Max(tmp2)
[1] 2.34429
> Min(tmp2)
[1] -2.207282
> mean(tmp2)
[1] -0.1612384
> Sum(tmp2)
[1] -16.12384
> Var(tmp2)
[1] 0.9571995
> 
> rowMeans(tmp2)
  [1] -1.29796036 -0.19825260  0.24999891 -2.20728225  1.09798806 -1.95729807
  [7] -1.99091785 -0.73367054 -1.33141788  1.00086322  0.64817720 -2.03167358
 [13]  0.73016687  0.53745381 -0.98574560 -0.49210752  0.01075759  0.51876162
 [19] -1.10194869 -1.20532341  1.36226482  0.07716515 -0.30993786 -0.07715123
 [25] -1.39804215 -1.76487565  0.48608865 -1.45008854 -1.79989493  1.21966748
 [31] -0.44817695 -0.76631814 -0.16895672 -0.97082993  0.05188504  1.16825299
 [37] -0.34584920 -1.57974146  0.55305616 -0.81036385 -0.47732026  0.23703729
 [43] -1.26237802 -0.37691252  1.31986327  0.56267300  0.09808044 -0.63988221
 [49]  0.62633129 -0.32032228 -1.43335473  1.06192067 -0.28875195 -0.26686334
 [55] -0.27273017 -0.96211094 -0.08595296  0.76391704 -0.09174948 -0.06075078
 [61] -1.67979706 -1.18162192 -0.60269059  0.80762114  0.58944814  0.55044529
 [67]  0.01430080 -1.13544585  1.03843242 -1.61539232  1.04358298  0.51813002
 [73]  1.92611848  0.12357417  1.35020609 -0.65474661  0.68667414 -1.55248707
 [79] -0.15245109 -0.39085973  1.49060480 -0.16206020 -1.90202412 -0.99608427
 [85] -0.27844386  0.92178647  0.53432290  0.19613169  0.40883497  0.19045167
 [91] -0.31346615  0.61187895 -0.29772191 -0.47550817 -0.14260841 -0.48823873
 [97]  1.27781509  0.30448831  0.54920758  2.34429033
> rowSums(tmp2)
  [1] -1.29796036 -0.19825260  0.24999891 -2.20728225  1.09798806 -1.95729807
  [7] -1.99091785 -0.73367054 -1.33141788  1.00086322  0.64817720 -2.03167358
 [13]  0.73016687  0.53745381 -0.98574560 -0.49210752  0.01075759  0.51876162
 [19] -1.10194869 -1.20532341  1.36226482  0.07716515 -0.30993786 -0.07715123
 [25] -1.39804215 -1.76487565  0.48608865 -1.45008854 -1.79989493  1.21966748
 [31] -0.44817695 -0.76631814 -0.16895672 -0.97082993  0.05188504  1.16825299
 [37] -0.34584920 -1.57974146  0.55305616 -0.81036385 -0.47732026  0.23703729
 [43] -1.26237802 -0.37691252  1.31986327  0.56267300  0.09808044 -0.63988221
 [49]  0.62633129 -0.32032228 -1.43335473  1.06192067 -0.28875195 -0.26686334
 [55] -0.27273017 -0.96211094 -0.08595296  0.76391704 -0.09174948 -0.06075078
 [61] -1.67979706 -1.18162192 -0.60269059  0.80762114  0.58944814  0.55044529
 [67]  0.01430080 -1.13544585  1.03843242 -1.61539232  1.04358298  0.51813002
 [73]  1.92611848  0.12357417  1.35020609 -0.65474661  0.68667414 -1.55248707
 [79] -0.15245109 -0.39085973  1.49060480 -0.16206020 -1.90202412 -0.99608427
 [85] -0.27844386  0.92178647  0.53432290  0.19613169  0.40883497  0.19045167
 [91] -0.31346615  0.61187895 -0.29772191 -0.47550817 -0.14260841 -0.48823873
 [97]  1.27781509  0.30448831  0.54920758  2.34429033
> rowVars(tmp2)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowSd(tmp2)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowMax(tmp2)
  [1] -1.29796036 -0.19825260  0.24999891 -2.20728225  1.09798806 -1.95729807
  [7] -1.99091785 -0.73367054 -1.33141788  1.00086322  0.64817720 -2.03167358
 [13]  0.73016687  0.53745381 -0.98574560 -0.49210752  0.01075759  0.51876162
 [19] -1.10194869 -1.20532341  1.36226482  0.07716515 -0.30993786 -0.07715123
 [25] -1.39804215 -1.76487565  0.48608865 -1.45008854 -1.79989493  1.21966748
 [31] -0.44817695 -0.76631814 -0.16895672 -0.97082993  0.05188504  1.16825299
 [37] -0.34584920 -1.57974146  0.55305616 -0.81036385 -0.47732026  0.23703729
 [43] -1.26237802 -0.37691252  1.31986327  0.56267300  0.09808044 -0.63988221
 [49]  0.62633129 -0.32032228 -1.43335473  1.06192067 -0.28875195 -0.26686334
 [55] -0.27273017 -0.96211094 -0.08595296  0.76391704 -0.09174948 -0.06075078
 [61] -1.67979706 -1.18162192 -0.60269059  0.80762114  0.58944814  0.55044529
 [67]  0.01430080 -1.13544585  1.03843242 -1.61539232  1.04358298  0.51813002
 [73]  1.92611848  0.12357417  1.35020609 -0.65474661  0.68667414 -1.55248707
 [79] -0.15245109 -0.39085973  1.49060480 -0.16206020 -1.90202412 -0.99608427
 [85] -0.27844386  0.92178647  0.53432290  0.19613169  0.40883497  0.19045167
 [91] -0.31346615  0.61187895 -0.29772191 -0.47550817 -0.14260841 -0.48823873
 [97]  1.27781509  0.30448831  0.54920758  2.34429033
> rowMin(tmp2)
  [1] -1.29796036 -0.19825260  0.24999891 -2.20728225  1.09798806 -1.95729807
  [7] -1.99091785 -0.73367054 -1.33141788  1.00086322  0.64817720 -2.03167358
 [13]  0.73016687  0.53745381 -0.98574560 -0.49210752  0.01075759  0.51876162
 [19] -1.10194869 -1.20532341  1.36226482  0.07716515 -0.30993786 -0.07715123
 [25] -1.39804215 -1.76487565  0.48608865 -1.45008854 -1.79989493  1.21966748
 [31] -0.44817695 -0.76631814 -0.16895672 -0.97082993  0.05188504  1.16825299
 [37] -0.34584920 -1.57974146  0.55305616 -0.81036385 -0.47732026  0.23703729
 [43] -1.26237802 -0.37691252  1.31986327  0.56267300  0.09808044 -0.63988221
 [49]  0.62633129 -0.32032228 -1.43335473  1.06192067 -0.28875195 -0.26686334
 [55] -0.27273017 -0.96211094 -0.08595296  0.76391704 -0.09174948 -0.06075078
 [61] -1.67979706 -1.18162192 -0.60269059  0.80762114  0.58944814  0.55044529
 [67]  0.01430080 -1.13544585  1.03843242 -1.61539232  1.04358298  0.51813002
 [73]  1.92611848  0.12357417  1.35020609 -0.65474661  0.68667414 -1.55248707
 [79] -0.15245109 -0.39085973  1.49060480 -0.16206020 -1.90202412 -0.99608427
 [85] -0.27844386  0.92178647  0.53432290  0.19613169  0.40883497  0.19045167
 [91] -0.31346615  0.61187895 -0.29772191 -0.47550817 -0.14260841 -0.48823873
 [97]  1.27781509  0.30448831  0.54920758  2.34429033
> 
> colMeans(tmp2)
[1] -0.1612384
> colSums(tmp2)
[1] -16.12384
> colVars(tmp2)
[1] 0.9571995
> colSd(tmp2)
[1] 0.9783657
> colMax(tmp2)
[1] 2.34429
> colMin(tmp2)
[1] -2.207282
> colMedians(tmp2)
[1] -0.1572556
> colRanges(tmp2)
          [,1]
[1,] -2.207282
[2,]  2.344290
> 
> 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.0389112  1.0023776 -5.3167101 -0.3958729  2.8985088 -1.7185941
 [7] -1.6181566 -0.6704035  0.5289618 -1.8265984
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -1.6670842
[2,] -0.1969868
[3,]  0.1782085
[4,]  0.5579388
[5,]  1.2355374
> 
> rowApply(tmp,sum)
 [1]  3.69392057 -5.89332183 -5.75595180  1.45733096  6.58542065  3.25597757
 [7] -8.40946634 -3.35778402  2.43624076 -0.08994273
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    4    7    8    4    5    5    2    9    9     5
 [2,]    5   10    1    9    4    7    4    6    2    10
 [3,]    7    2    4    3    7    3    3    3    5     2
 [4,]    6    4    7    7    1    6    8    5    7     6
 [5,]    8    9    2    5    3   10    9    7    8     3
 [6,]    1    1    5    2    9    9    5    4   10     9
 [7,]    3    5   10    1   10    2    6    8    1     4
 [8,]    2    6    3    6    8    8   10    1    6     8
 [9,]    9    3    9    8    6    1    7   10    4     1
[10,]   10    8    6   10    2    4    1    2    3     7
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1] -2.3491800 -1.8343836  2.3303888 -0.4097500  2.2916784 -1.1906291
 [7]  2.0319594 -0.1046019  3.6590181  1.2264286  3.1005248 -0.3996460
[13]  4.7970339  0.1659387 -2.6799833 -1.6899013 -1.0639483  1.9065909
[19] -1.3467919  4.8283540
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -1.5712979
[2,] -0.5666385
[3,] -0.4792854
[4,] -0.3641232
[5,]  0.6321651
> 
> rowApply(tmp,sum)
[1]  1.348827  8.847455 -7.202910  8.158997  2.116732
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]    7    5    4   12    5
[2,]    8    8    1   10   16
[3,]   14    9   13   11   19
[4,]    4   13    8   17    7
[5,]   19   20    3   14    2
> 
> 
> as.matrix(tmp)
           [,1]        [,2]       [,3]       [,4]       [,5]       [,6]
[1,] -0.3641232 -0.34671772  0.5936427 -0.8006543  1.3520100  1.1927075
[2,] -0.5666385 -0.07819687  0.2315443  0.5810665  2.7147951 -0.9467260
[3,] -1.5712979 -2.91493331 -0.1156314 -0.9507397 -1.5819956 -0.5309660
[4,]  0.6321651  0.55492962  0.6039177  1.2073629  0.7757279 -0.2041561
[5,] -0.4792854  0.95053469  1.0169154 -0.4467854 -0.9688591 -0.7014885
           [,7]        [,8]       [,9]      [,10]      [,11]      [,12]
[1,]  1.3452988  0.02946341 -0.6699703 -1.4018333  0.6609949 -0.1910475
[2,]  1.3693786  0.41819651  0.8691388  1.4760326  1.0286731 -0.5809764
[3,] -2.3440067 -0.26046782  1.7061856 -0.4327260  2.0260313  0.7292868
[4,]  0.6622846 -0.33561499  1.4940841  0.9192637 -0.1518544  0.9403916
[5,]  0.9990041  0.04382101  0.2595799  0.6656915 -0.4633201 -1.2973004
         [,13]      [,14]        [,15]       [,16]      [,17]      [,18]
[1,] 1.0365039 -0.4877541 -1.133396377 -0.96413602 -0.2641527  0.4700294
[2,] 0.4858493 -0.7266012 -0.333519574  0.45517548  1.3987200 -0.4909978
[3,] 1.1449504  0.5230756 -1.056341801 -1.20336597 -1.0833278  0.1077458
[4,] 1.4235713 -0.4500086 -0.161029689  0.03468008 -0.5587206  1.3006195
[5,] 0.7061591  1.3072270  0.004304123 -0.01225484 -0.5564673  0.5191940
          [,19]      [,20]
[1,] -0.2296611  1.5216225
[2,] -1.0615058  2.6040466
[3,] -0.1602086  0.7658235
[4,] -0.8579210  0.3293043
[5,]  0.9625047 -0.3924428
> 
> 
> is.BufferedMatrix(tmp)
[1] TRUE
> 
> as.BufferedMatrix(as.matrix(tmp))
BufferedMatrix object
Matrix size:  5 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.21-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:    /home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  652  bytes.
Disk usage :  200  bytes.
> subBufferedMatrix(tmp,,5:8)
BufferedMatrix object
Matrix size:  5 4 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  565  bytes.
Disk usage :  160  bytes.
> subBufferedMatrix(tmp,1:3,)
BufferedMatrix object
Matrix size:  3 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  480  bytes.
> 
> 
> rm(tmp)
> 
> 
> ###
> ### Testing colnames and rownames
> ###
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> 
> 
> colnames(tmp)
NULL
> rownames(tmp)
NULL
> 
> 
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> colnames(tmp)
 [1] "col1"  "col2"  "col3"  "col4"  "col5"  "col6"  "col7"  "col8"  "col9" 
[10] "col10" "col11" "col12" "col13" "col14" "col15" "col16" "col17" "col18"
[19] "col19" "col20"
> rownames(tmp)
[1] "row1" "row2" "row3" "row4" "row5"
> 
> 
> tmp["row1",]
         col1      col2       col3       col4       col5      col6      col7
row1 2.242222 0.4009498 0.02442665 -0.7051772 -0.1009103 0.8743298 -1.278914
          col8      col9    col10    col11      col12     col13    col14
row1 0.4171238 -1.646187 1.539191 1.286413 -0.1145848 0.4814396 1.591384
         col15      col16      col17     col18     col19    col20
row1 0.8090059 -0.2482203 -0.1342766 -0.915639 0.0461342 1.703802
> tmp[,"col10"]
          col10
row1  1.5391909
row2  0.7649891
row3 -0.6663766
row4 -1.1286331
row5 -0.1143825
> tmp[c("row1","row5"),]
          col1      col2        col3       col4       col5       col6
row1 2.2422216 0.4009498  0.02442665 -0.7051772 -0.1009103  0.8743298
row5 0.7066856 0.8750101 -0.34831438 -0.2900750  0.6835973 -1.2920288
            col7      col8      col9      col10     col11      col12      col13
row1 -1.27891428 0.4171238 -1.646187  1.5391909  1.286413 -0.1145848  0.4814396
row5 -0.04786267 0.4244440 -1.248698 -0.1143825 -2.244809  0.9350047 -1.5518590
         col14      col15      col16      col17     col18     col19     col20
row1  1.591384  0.8090059 -0.2482203 -0.1342766 -0.915639 0.0461342  1.703802
row5 -1.111937 -0.3052777 -0.2323300 -0.8548760  1.412721 1.1081050 -1.516491
> tmp[,c("col6","col20")]
           col6      col20
row1  0.8743298  1.7038019
row2  0.1230633 -0.6548127
row3  1.1574291 -2.4415148
row4  0.4795266 -0.7441637
row5 -1.2920288 -1.5164913
> tmp[c("row1","row5"),c("col6","col20")]
           col6     col20
row1  0.8743298  1.703802
row5 -1.2920288 -1.516491
> 
> 
> 
> 
> tmp["row1",] <- rnorm(20,mean=10)
> tmp[,"col10"] <- rnorm(5,mean=30)
> tmp[c("row1","row5"),] <- rnorm(40,mean=50)
> tmp[,c("col6","col20")] <- rnorm(10,mean=75)
> tmp[c("row1","row5"),c("col6","col20")]  <- rnorm(4,mean=105)
> 
> tmp["row1",]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 50.24095 48.76179 50.61866 48.35056 49.36155 104.9595 48.31415 49.54039
         col9    col10    col11    col12    col13    col14    col15   col16
row1 50.06206 49.92254 48.79796 48.73059 50.05179 49.34338 52.11327 49.2206
        col17    col18    col19    col20
row1 50.52892 51.58825 50.99183 104.5402
> tmp[,"col10"]
        col10
row1 49.92254
row2 28.77239
row3 30.72906
row4 30.53814
row5 49.69802
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 50.24095 48.76179 50.61866 48.35056 49.36155 104.9595 48.31415 49.54039
row5 51.34970 49.63443 49.11859 51.86870 49.64918 104.7023 50.44162 50.79628
         col9    col10    col11    col12    col13    col14    col15    col16
row1 50.06206 49.92254 48.79796 48.73059 50.05179 49.34338 52.11327 49.22060
row5 51.12799 49.69802 51.04453 49.36829 49.86726 49.73228 50.11109 49.50051
        col17    col18    col19    col20
row1 50.52892 51.58825 50.99183 104.5402
row5 50.07756 51.62270 48.27144 105.7684
> tmp[,c("col6","col20")]
          col6     col20
row1 104.95945 104.54024
row2  75.39034  76.84891
row3  73.45917  74.71909
row4  74.50660  74.44553
row5 104.70231 105.76835
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 104.9595 104.5402
row5 104.7023 105.7684
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 104.9595 104.5402
row5 104.7023 105.7684
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
         col13
[1,] 0.1335190
[2,] 1.8229274
[3,] 0.2403840
[4,] 0.1734375
[5,] 0.8477074
> tmp[,c("col17","col7")]
          col17       col7
[1,]  0.7084536 -2.3565059
[2,] -0.2217210  0.5967957
[3,]  0.5853794 -0.3372339
[4,] -1.8087020 -2.2044986
[5,] -0.8101447 -0.6121464
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
            col6      col20
[1,] -0.01379178  1.1731023
[2,]  0.13954384 -0.1505601
[3,]  1.04821847 -0.2072465
[4,]  1.28877366  0.8978760
[5,]  0.19185428 -0.1064666
> subBufferedMatrix(tmp,1,c("col6"))[,1]
            col1
[1,] -0.01379178
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
            col6
[1,] -0.01379178
[2,]  0.13954384
> 
> 
> 
> 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.392831 0.4937815  0.8578545 0.5565284 1.4036549 -0.7503421  0.5469572
row1 -1.045326 0.1011518 -1.1845430 2.1914982 0.5464501  0.9494989 -1.0408628
           [,8]       [,9]     [,10]     [,11]     [,12]     [,13]      [,14]
row3 -1.6553783 -0.6224674 0.4292276 0.3641328 -1.207414 0.1735822 0.02564672
row1 -0.9790685  1.0434048 2.3164679 1.3653541  2.112212 2.3253797 1.58752517
          [,15]      [,16]     [,17]     [,18]      [,19]      [,20]
row3 -2.0495596 -0.2195161 -1.329444 0.9353875 -0.1812689  0.7193354
row1 -0.9136442  2.0158410 -0.455501 0.8004515  2.4657792 -0.8861184
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
          [,1]       [,2]      [,3]       [,4]       [,5]      [,6]       [,7]
row2 0.3751644 0.01928681 -1.949616 -0.3002921 -0.4751405 -1.503794 -0.2067662
          [,8]     [,9]     [,10]
row2 -1.026393 -1.42328 0.7380038
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
          [,1]     [,2]        [,3]      [,4]      [,5]      [,6]      [,7]
row5 0.1780594 -2.31235 -0.07742219 0.7721294 -1.010932 -1.371826 0.9629467
          [,8]      [,9]     [,10]      [,11]      [,12]   [,13]      [,14]
row5 0.6773854 0.2578559 0.1093758 -0.4904603 -0.8524382 1.33407 -0.7912619
           [,15]   [,16]    [,17]     [,18]     [,19]    [,20]
row5 -0.01724977 1.10603 -1.45682 0.1710232 0.9338264 1.061751
> 
> 
> 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: 0x1cefdb0>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "/home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM2f86e4731d446f"
 [2] "/home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM2f86e46a131b34"
 [3] "/home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM2f86e4793530e0"
 [4] "/home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM2f86e42dc1fea4"
 [5] "/home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM2f86e4109ce5cb"
 [6] "/home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM2f86e42c0d67f7"
 [7] "/home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM2f86e4307f5711"
 [8] "/home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM2f86e42898b600"
 [9] "/home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM2f86e43a78c257"
[10] "/home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM2f86e46e65e79" 
[11] "/home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM2f86e45e8f9885"
[12] "/home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM2f86e4c1262c5" 
[13] "/home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM2f86e45246fe71"
[14] "/home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM2f86e44fc3f8a9"
[15] "/home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM2f86e4d5bbb77" 
> 
> 
> ### 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: 0x3a09260>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x3a09260>
Warning message:
In dir.create(new.directory) :
  '/home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x3a09260>
> rowMedians(tmp)
  [1]  0.059785302  0.244753393 -0.171241427 -0.149913852 -0.341217668
  [6]  0.171845495 -0.266773993  0.133876784 -0.202994382  0.269435183
 [11] -0.474967734  0.395774300 -0.545249184 -0.017079444  0.116351483
 [16] -0.156017656  0.266245550 -0.362655184 -0.098808927  0.781736272
 [21] -0.133938411  0.079397286 -0.061378577  0.011890332  0.084268345
 [26] -0.426770124  0.230623595 -0.072546824  0.613455053  0.135066373
 [31] -0.005674510 -0.145408039 -0.344522153 -0.498562253  0.411318811
 [36] -0.207658715  0.132221568  0.160607801 -0.089068042  0.313778157
 [41]  0.085793530 -0.003805837  0.095713593  0.160077481  0.072983360
 [46]  0.297798819 -0.094321820  0.194571539  0.396501101  0.135030173
 [51]  0.491445049 -0.442753708 -0.035677720  0.429090968 -0.220005659
 [56] -0.347088438  0.193432546 -0.384131619  0.342077342  0.232349371
 [61]  0.057594395  0.433358964 -0.064281114 -0.415248788 -0.363014053
 [66]  0.368871009  0.614143502  0.623994270  0.279637122  0.368843963
 [71]  0.019480594 -0.347869900 -0.092053089  0.397164143 -0.162413230
 [76] -0.252781755 -0.249686872 -0.215698079  0.283570496  0.001275459
 [81]  0.320253768 -0.199568374  0.060085420  0.292605279 -0.245019876
 [86] -0.131042556 -0.153996899  0.354694946 -0.601517792  0.024519438
 [91] -0.240806371 -0.272690353 -0.536456593 -0.076266779  0.318461451
 [96]  0.268296931  0.534517259  0.234157762 -0.564439542  0.103975900
[101]  0.248776655  0.770322307  0.180940802 -0.288960951 -0.146479600
[106] -0.158614580  0.356064735 -0.762151724 -0.328316904  0.140745812
[111]  0.083101467  0.278680736  0.546349208 -0.069556633  0.336880346
[116] -0.137757140  0.159859028 -0.007498644 -0.500081399 -0.006059229
[121]  0.209416619 -0.291831721 -0.198362634  0.203046118  0.139483182
[126] -0.044037918  0.027373688  0.164232504  0.682708571  0.371207924
[131] -0.112688723  0.087689024 -0.006583630 -0.624012775  0.213306076
[136] -0.058536904 -0.274240737  0.185868621 -0.266291336  0.484431141
[141] -0.435310665 -0.146497535 -0.008351043 -0.271359228 -0.035121816
[146]  0.272719132 -0.433826444 -0.337082226  0.482472630  0.255399047
[151]  0.524431216 -0.374428657 -0.422468895  0.140678252 -0.385830526
[156] -0.408817261 -0.146601922  0.281076319 -0.378862428  0.197842189
[161] -0.008612297  0.174651256 -0.233624436 -0.311114926 -0.364654338
[166] -0.098454025 -0.212965833 -0.064703926 -0.073414804  0.206426888
[171] -0.157491521  0.149060907 -0.423467886 -0.873086676  0.083062300
[176]  0.099392060 -0.334943717  0.078229064  0.636047390  0.017444157
[181] -0.302002407 -0.219252818 -0.441998282  0.134217963  0.023255251
[186] -0.045605407 -0.030412809 -0.555256758  0.178257981 -0.493740575
[191]  0.310156125 -0.281965386 -0.100862842  0.108133808  0.400405742
[196] -0.079978726  0.357057872  0.308887650 -0.269557003 -0.382903770
[201] -0.054687934 -0.534797921 -0.116305717  0.240538329 -0.560767059
[206] -0.081808771  0.161659017  0.316391951  0.294803200 -0.010101499
[211]  0.020989969  0.203167169  0.149529118 -0.136864083  0.664068352
[216] -0.138124002 -0.007300635 -0.006091282  0.063058185 -0.143219556
[221]  0.408766646  0.561271350  0.040268950 -0.671903624  0.124636362
[226] -0.990085150 -0.117058180  0.149006568 -0.593179217 -0.010752609
> 
> proc.time()
   user  system elapsed 
  1.829   0.925   2.779 

BufferedMatrix.Rcheck/tests/rawCalltesting.Rout


R Under development (unstable) (2025-02-19 r87757) -- "Unsuffered Consequences"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: aarch64-unknown-linux-gnu

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: 0x3c016e0>
> .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: 0x3c016e0>
> .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: 0x3c016e0>
> .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: 0x3c016e0>
> 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: 0x3c496a0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x3c496a0>
> .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: 0x3c496a0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x3c496a0>
> .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: 0x3c496a0>
> 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: 0x2e057d0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x2e057d0>
> .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: 0x2e057d0>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x2e057d0>
> .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: 0x2e057d0>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x2e057d0>
> .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: 0x2e057d0>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x2e057d0>
> .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: 0x2e057d0>
> 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: 0x3964d70>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x3964d70>
> .Call("R_bm_AddColumn",P)
<pointer: 0x3964d70>
> .Call("R_bm_AddColumn",P)
<pointer: 0x3964d70>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile2f878c6cb15898" "BufferedMatrixFile2f878c713b51a0"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile2f878c6cb15898" "BufferedMatrixFile2f878c713b51a0"
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x3507cd0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x3507cd0>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x3507cd0>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x3507cd0>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x3507cd0>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x3507cd0>
> .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: 0x2476a10>
> .Call("R_bm_AddColumn",P)
<pointer: 0x2476a10>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x2476a10>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x2476a10>
> 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: 0x4390c70>
> .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: 0x4390c70>
> rm(P)
> 
> proc.time()
   user  system elapsed 
  0.361   0.044   0.391 

BufferedMatrix.Rcheck/tests/Rcodetesting.Rout


R Under development (unstable) (2025-02-19 r87757) -- "Unsuffered Consequences"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: aarch64-unknown-linux-gnu

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.344   0.040   0.369 

Example timings