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

This page was generated on 2025-09-20 12:06 -0400 (Sat, 20 Sep 2025).

HostnameOSArch (*)R versionInstalled pkgs
nebbiolo2Linux (Ubuntu 24.04.3 LTS)x86_644.5.1 Patched (2025-08-23 r88802) -- "Great Square Root" 4814
lconwaymacOS 12.7.1 Montereyx86_644.5.1 Patched (2025-09-10 r88807) -- "Great Square Root" 4603
kjohnson3macOS 13.7.7 Venturaarm644.5.1 Patched (2025-09-10 r88807) -- "Great Square Root" 4547
taishanLinux (openEuler 24.03 LTS)aarch644.5.0 (2025-04-11) -- "How About a Twenty-Six" 4553
Click on any hostname to see more info about the system (e.g. compilers)      (*) as reported by 'uname -p', except on Windows and Mac OS X

Package 253/2333HostnameOS / ArchINSTALLBUILDCHECKBUILD BIN
BufferedMatrix 1.73.0  (landing page)
Ben Bolstad
Snapshot Date: 2025-09-19 13:45 -0400 (Fri, 19 Sep 2025)
git_url: https://git.bioconductor.org/packages/BufferedMatrix
git_branch: devel
git_last_commit: 0147962
git_last_commit_date: 2025-04-15 09:39:39 -0400 (Tue, 15 Apr 2025)
nebbiolo2Linux (Ubuntu 24.04.3 LTS) / x86_64  OK    OK    OK  UNNEEDED, same version is already published
lconwaymacOS 12.7.1 Monterey / x86_64  OK    OK    WARNINGS    OK  UNNEEDED, same version is already published
kjohnson3macOS 13.7.7 Ventura / arm64  OK    OK    WARNINGS    OK  UNNEEDED, same version is already published
taishanLinux (openEuler 24.03 LTS) / aarch64  OK    OK    OK  


CHECK results for BufferedMatrix on taishan

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.73.0
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.73.0.tar.gz
StartedAt: 2025-09-19 06:40:42 -0000 (Fri, 19 Sep 2025)
EndedAt: 2025-09-19 06:41:06 -0000 (Fri, 19 Sep 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.73.0.tar.gz
###
##############################################################################
##############################################################################


* using log directory ‘/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck’
* using R version 4.5.0 (2025-04-11)
* 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)
* using session charset: UTF-8
* using option ‘--no-vignettes’
* checking for file ‘BufferedMatrix/DESCRIPTION’ ... OK
* this is package ‘BufferedMatrix’ version ‘1.73.0’
* checking package namespace information ... OK
* checking package dependencies ... OK
* checking if this is a source package ... OK
* checking if there is a namespace ... OK
* checking for hidden files and directories ... OK
* checking for portable file names ... OK
* checking for sufficient/correct file permissions ... OK
* checking whether package ‘BufferedMatrix’ can be installed ... 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.22-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-4.5.0/site-library’
* installing *source* package ‘BufferedMatrix’ ...
** this is package ‘BufferedMatrix’ version ‘1.73.0’
** 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-4.5.0/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-4.5.0/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-4.5.0/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-4.5.0/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-4.5.0/lib -L/usr/local/lib -o BufferedMatrix.so RBufferedMatrix.o doubleBufferedMatrix.o doubleBufferedMatrix_C_tests.o init_package.o -L/home/biocbuild/R/R-4.5.0/lib -lR
installing to /home/biocbuild/R/R-4.5.0/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 version 4.5.0 (2025-04-11) -- "How About a Twenty-Six"
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.318   0.039   0.342 

BufferedMatrix.Rcheck/tests/objectTesting.Rout


R version 4.5.0 (2025-04-11) -- "How About a Twenty-Six"
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.22-bioc/meat/BufferedMatrix.Rcheck/tests"
> prefix(tmp3)
[1] "BM"
> 
> ## testing if we can remove these objects
> rm(tmp, tmp2, tmp3)
> gc()
         used (Mb) gc trigger (Mb) max used (Mb)
Ncells 478398 25.6    1047041   56   639620 34.2
Vcells 885166  6.8    8388608   64  2080985 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 Sep 19 06:41:00 2025"
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> date()
[1] "Fri Sep 19 06:41:00 2025"
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,which.col] == test.matrix[which.row,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> 
> 
> RowMode(tmp2)
<pointer: 0x38ebbff0>
> 
> 
> 
> 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 Sep 19 06:41:01 2025"
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col <- sample(1:20,5,replace=TRUE)
+   if (!all(tmp2[which.row,which.col] == test.matrix[which.row,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> date()
[1] "Fri Sep 19 06:41:01 2025"
> 
> ColMode(tmp2)
<pointer: 0x38ebbff0>
> 
> 
> 
> ### 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,] 98.7903632  0.9454829  0.6637847 -1.2238636
[2,]  0.8944987 -0.7917208 -0.3821750  0.2465909
[3,]  2.1331823 -2.2481169 -0.9578079 -0.3693850
[4,] -0.9255701 -0.3310637 -0.7895238  0.4570819
> ewApply(tmp5,abs)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.22-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,] 98.7903632 0.9454829 0.6637847 1.2238636
[2,]  0.8944987 0.7917208 0.3821750 0.2465909
[3,]  2.1331823 2.2481169 0.9578079 0.3693850
[4,]  0.9255701 0.3310637 0.7895238 0.4570819
> ewApply(tmp5,sqrt)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.22-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.9393341 0.9723595 0.8147298 1.1062837
[2,] 0.9457794 0.8897869 0.6182030 0.4965792
[3,] 1.4605418 1.4993722 0.9786766 0.6077706
[4,] 0.9620655 0.5753813 0.8885515 0.6760783
> 
> 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.22-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,] 223.18370 35.66908 33.81108 37.28670
[2,]  35.35229 34.68959 31.56421 30.21238
[3,]  41.73860 42.24184 35.74457 31.44709
[4,]  35.54623 31.08488 34.67504 32.21787
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x3a0eb9a0>
> exp(tmp5)
<pointer: 0x3a0eb9a0>
> log(tmp5,2)
<pointer: 0x3a0eb9a0>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 464.5276
> Min(tmp5)
[1] 54.01711
> mean(tmp5)
[1] 72.46645
> Sum(tmp5)
[1] 14493.29
> Var(tmp5)
[1] 838.7267
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 90.73155 71.61950 72.13446 72.56059 64.98849 70.39942 72.81182 69.93822
 [9] 69.64006 69.84034
> rowSums(tmp5)
 [1] 1814.631 1432.390 1442.689 1451.212 1299.770 1407.988 1456.236 1398.764
 [9] 1392.801 1396.807
> rowVars(tmp5)
 [1] 7795.36610   62.44205   63.88958   83.31805   39.14474   42.20420
 [7]   84.75273   39.83333   74.60583   61.06611
> rowSd(tmp5)
 [1] 88.291370  7.902029  7.993096  9.127872  6.256576  6.496476  9.206124
 [8]  6.311365  8.637467  7.814481
> rowMax(tmp5)
 [1] 464.52764  86.98566  87.92085  87.37467  77.68567  83.35914  87.17458
 [8]  79.28095  92.68261  84.18407
> rowMin(tmp5)
 [1] 55.68416 60.69615 56.59888 54.93413 54.01711 57.86469 54.31071 58.09167
 [9] 55.88031 55.47906
> 
> colMeans(tmp5)
 [1] 114.68111  73.07678  65.99863  69.26549  69.43605  70.75461  72.58863
 [8]  69.96489  70.23442  69.26325  71.59758  69.92645  67.23858  71.76991
[15]  68.25950  68.07868  68.85356  72.67042  75.70890  69.96146
> colSums(tmp5)
 [1] 1146.8111  730.7678  659.9863  692.6549  694.3605  707.5461  725.8863
 [8]  699.6489  702.3442  692.6325  715.9758  699.2645  672.3858  717.6991
[15]  682.5950  680.7868  688.5356  726.7042  757.0890  699.6146
> colVars(tmp5)
 [1] 15151.04215    44.74166    35.10750    43.80627    72.67328    60.15419
 [7]    24.95550   100.31878    49.19627    87.03213    27.77489    71.27826
[13]    49.43274   117.07136   105.75679    20.32312    45.02315    79.37082
[19]    96.30080    74.91544
> colSd(tmp5)
 [1] 123.089570   6.688921   5.925158   6.618631   8.524863   7.755913
 [7]   4.995548  10.015927   7.014005   9.329101   5.270189   8.442646
[13]   7.030842  10.819952  10.283812   4.508117   6.709929   8.909030
[19]   9.813297   8.655370
> colMax(tmp5)
 [1] 464.52764  87.92085  74.39765  77.60738  84.18407  80.72662  79.92681
 [8]  87.37467  78.39948  87.17458  78.43115  80.08988  80.62829  85.49449
[15]  83.35914  74.05930  77.74944  86.98566  92.68261  82.32837
> colMin(tmp5)
 [1] 64.50279 64.69910 56.08272 59.79871 54.93413 62.04676 63.62709 58.82995
 [9] 59.00416 55.68416 64.46744 56.23513 54.31071 56.55667 54.01711 60.69615
[17] 58.35877 55.47906 63.13103 57.55024
> 
> 
> ### setting a random element to NA and then testing with na.rm=TRUE or na.rm=FALSE (The default)
> 
> 
> which.row <- sample(1:10,1,replace=TRUE)
> which.col  <- sample(1:20,1,replace=TRUE)
> 
> tmp5[which.row,which.col] <- NA
> 
> Max(tmp5)
[1] NA
> Min(tmp5)
[1] NA
> mean(tmp5)
[1] NA
> Sum(tmp5)
[1] NA
> Var(tmp5)
[1] NA
> 
> rowMeans(tmp5)
 [1]       NA 71.61950 72.13446 72.56059 64.98849 70.39942 72.81182 69.93822
 [9] 69.64006 69.84034
> rowSums(tmp5)
 [1]       NA 1432.390 1442.689 1451.212 1299.770 1407.988 1456.236 1398.764
 [9] 1392.801 1396.807
> rowVars(tmp5)
 [1] 8171.67363   62.44205   63.88958   83.31805   39.14474   42.20420
 [7]   84.75273   39.83333   74.60583   61.06611
> rowSd(tmp5)
 [1] 90.397310  7.902029  7.993096  9.127872  6.256576  6.496476  9.206124
 [8]  6.311365  8.637467  7.814481
> rowMax(tmp5)
 [1]       NA 86.98566 87.92085 87.37467 77.68567 83.35914 87.17458 79.28095
 [9] 92.68261 84.18407
> rowMin(tmp5)
 [1]       NA 60.69615 56.59888 54.93413 54.01711 57.86469 54.31071 58.09167
 [9] 55.88031 55.47906
> 
> colMeans(tmp5)
 [1] 114.68111  73.07678  65.99863  69.26549  69.43605  70.75461  72.58863
 [8]  69.96489  70.23442  69.26325  71.59758  69.92645        NA  71.76991
[15]  68.25950  68.07868  68.85356  72.67042  75.70890  69.96146
> colSums(tmp5)
 [1] 1146.8111  730.7678  659.9863  692.6549  694.3605  707.5461  725.8863
 [8]  699.6489  702.3442  692.6325  715.9758  699.2645        NA  717.6991
[15]  682.5950  680.7868  688.5356  726.7042  757.0890  699.6146
> colVars(tmp5)
 [1] 15151.04215    44.74166    35.10750    43.80627    72.67328    60.15419
 [7]    24.95550   100.31878    49.19627    87.03213    27.77489    71.27826
[13]          NA   117.07136   105.75679    20.32312    45.02315    79.37082
[19]    96.30080    74.91544
> colSd(tmp5)
 [1] 123.089570   6.688921   5.925158   6.618631   8.524863   7.755913
 [7]   4.995548  10.015927   7.014005   9.329101   5.270189   8.442646
[13]         NA  10.819952  10.283812   4.508117   6.709929   8.909030
[19]   9.813297   8.655370
> colMax(tmp5)
 [1] 464.52764  87.92085  74.39765  77.60738  84.18407  80.72662  79.92681
 [8]  87.37467  78.39948  87.17458  78.43115  80.08988        NA  85.49449
[15]  83.35914  74.05930  77.74944  86.98566  92.68261  82.32837
> colMin(tmp5)
 [1] 64.50279 64.69910 56.08272 59.79871 54.93413 62.04676 63.62709 58.82995
 [9] 59.00416 55.68416 64.46744 56.23513       NA 56.55667 54.01711 60.69615
[17] 58.35877 55.47906 63.13103 57.55024
> 
> Max(tmp5,na.rm=TRUE)
[1] 464.5276
> Min(tmp5,na.rm=TRUE)
[1] 54.01711
> mean(tmp5,na.rm=TRUE)
[1] 72.53123
> Sum(tmp5,na.rm=TRUE)
[1] 14433.71
> Var(tmp5,na.rm=TRUE)
[1] 842.1191
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 92.37138 71.61950 72.13446 72.56059 64.98849 70.39942 72.81182 69.93822
 [9] 69.64006 69.84034
> rowSums(tmp5,na.rm=TRUE)
 [1] 1755.056 1432.390 1442.689 1451.212 1299.770 1407.988 1456.236 1398.764
 [9] 1392.801 1396.807
> rowVars(tmp5,na.rm=TRUE)
 [1] 8171.67363   62.44205   63.88958   83.31805   39.14474   42.20420
 [7]   84.75273   39.83333   74.60583   61.06611
> rowSd(tmp5,na.rm=TRUE)
 [1] 90.397310  7.902029  7.993096  9.127872  6.256576  6.496476  9.206124
 [8]  6.311365  8.637467  7.814481
> rowMax(tmp5,na.rm=TRUE)
 [1] 464.52764  86.98566  87.92085  87.37467  77.68567  83.35914  87.17458
 [8]  79.28095  92.68261  84.18407
> rowMin(tmp5,na.rm=TRUE)
 [1] 55.68416 60.69615 56.59888 54.93413 54.01711 57.86469 54.31071 58.09167
 [9] 55.88031 55.47906
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 114.68111  73.07678  65.99863  69.26549  69.43605  70.75461  72.58863
 [8]  69.96489  70.23442  69.26325  71.59758  69.92645  68.09010  71.76991
[15]  68.25950  68.07868  68.85356  72.67042  75.70890  69.96146
> colSums(tmp5,na.rm=TRUE)
 [1] 1146.8111  730.7678  659.9863  692.6549  694.3605  707.5461  725.8863
 [8]  699.6489  702.3442  692.6325  715.9758  699.2645  612.8109  717.6991
[15]  682.5950  680.7868  688.5356  726.7042  757.0890  699.6146
> colVars(tmp5,na.rm=TRUE)
 [1] 15151.04215    44.74166    35.10750    43.80627    72.67328    60.15419
 [7]    24.95550   100.31878    49.19627    87.03213    27.77489    71.27826
[13]    47.45454   117.07136   105.75679    20.32312    45.02315    79.37082
[19]    96.30080    74.91544
> colSd(tmp5,na.rm=TRUE)
 [1] 123.089570   6.688921   5.925158   6.618631   8.524863   7.755913
 [7]   4.995548  10.015927   7.014005   9.329101   5.270189   8.442646
[13]   6.888726  10.819952  10.283812   4.508117   6.709929   8.909030
[19]   9.813297   8.655370
> colMax(tmp5,na.rm=TRUE)
 [1] 464.52764  87.92085  74.39765  77.60738  84.18407  80.72662  79.92681
 [8]  87.37467  78.39948  87.17458  78.43115  80.08988  80.62829  85.49449
[15]  83.35914  74.05930  77.74944  86.98566  92.68261  82.32837
> colMin(tmp5,na.rm=TRUE)
 [1] 64.50279 64.69910 56.08272 59.79871 54.93413 62.04676 63.62709 58.82995
 [9] 59.00416 55.68416 64.46744 56.23513 54.31071 56.55667 54.01711 60.69615
[17] 58.35877 55.47906 63.13103 57.55024
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1]      NaN 71.61950 72.13446 72.56059 64.98849 70.39942 72.81182 69.93822
 [9] 69.64006 69.84034
> rowSums(tmp5,na.rm=TRUE)
 [1]    0.000 1432.390 1442.689 1451.212 1299.770 1407.988 1456.236 1398.764
 [9] 1392.801 1396.807
> rowVars(tmp5,na.rm=TRUE)
 [1]       NA 62.44205 63.88958 83.31805 39.14474 42.20420 84.75273 39.83333
 [9] 74.60583 61.06611
> rowSd(tmp5,na.rm=TRUE)
 [1]       NA 7.902029 7.993096 9.127872 6.256576 6.496476 9.206124 6.311365
 [9] 8.637467 7.814481
> rowMax(tmp5,na.rm=TRUE)
 [1]       NA 86.98566 87.92085 87.37467 77.68567 83.35914 87.17458 79.28095
 [9] 92.68261 84.18407
> rowMin(tmp5,na.rm=TRUE)
 [1]       NA 60.69615 56.59888 54.93413 54.01711 57.86469 54.31071 58.09167
 [9] 55.88031 55.47906
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1] 75.80927 72.94748 65.51256 68.33862 70.03288 71.39763 72.28243 68.74506
 [9] 70.50698 70.77204 70.83830 69.57345      NaN 71.34171 67.21298 67.41416
[17] 69.76625 72.72620 76.84433 68.58736
> colSums(tmp5,na.rm=TRUE)
 [1] 682.2834 656.5273 589.6130 615.0476 630.2959 642.5787 650.5419 618.7056
 [9] 634.5628 636.9483 637.5447 626.1610   0.0000 642.0754 604.9168 606.7275
[17] 627.8962 654.5358 691.5990 617.2862
> colVars(tmp5,na.rm=TRUE)
 [1]  45.95061  50.14628  36.83787  39.61719  77.75012  63.02193  27.02017
 [8]  96.11875  54.51007  72.30119  24.76096  78.78622        NA 129.64252
[15] 106.65540  17.89576  41.27976  89.25717  93.83492  63.03812
> colSd(tmp5,na.rm=TRUE)
 [1]  6.778688  7.081404  6.069421  6.294218  8.817603  7.938635  5.198093
 [8]  9.804017  7.383094  8.503011  4.976039  8.876160        NA 11.386067
[15] 10.327410  4.230338  6.424933  9.447601  9.686843  7.939655
> colMax(tmp5,na.rm=TRUE)
 [1] 86.87343 87.92085 74.39765 76.98433 84.18407 80.72662 79.92681 87.37467
 [9] 78.39948 87.17458 78.04237 80.08988     -Inf 85.49449 83.35914 71.97240
[17] 77.74944 86.98566 92.68261 81.49500
> colMin(tmp5,na.rm=TRUE)
 [1] 64.50279 64.69910 56.08272 59.79871 54.93413 62.04676 63.62709 58.82995
 [9] 59.00416 55.88031 64.46744 56.23513      Inf 56.55667 54.01711 60.69615
[17] 58.35877 55.47906 63.13103 57.55024
> 
> 
> 
> 
> 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] 151.4388 277.0255 329.7900 293.1114 200.1013 184.3700 247.1475 186.6032
 [9] 245.8678 293.4045
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 151.4388 277.0255 329.7900 293.1114 200.1013 184.3700 247.1475 186.6032
 [9] 245.8678 293.4045
> 
> 
> 
> copymatrix <- matrix(rnorm(200,150,15),10,20)
> 
> tmp5[1:10,1:20] <- copymatrix
> which.row <- 1
> which.col  <- 3
> cat(which.row," ",which.col,"\n")
1   3 
> tmp5[which.row,which.col] <- NA
> copymatrix[which.row,which.col] <- NA
> 
> colVars(tmp5,na.rm=TRUE)-apply(copymatrix,2,var,na.rm=TRUE)
 [1] -2.842171e-14  0.000000e+00 -5.684342e-14  1.705303e-13  5.684342e-14
 [6]  0.000000e+00  0.000000e+00  8.526513e-14  0.000000e+00  1.705303e-13
[11]  1.136868e-13  0.000000e+00 -5.684342e-14  1.421085e-14 -1.136868e-13
[16]  0.000000e+00 -5.684342e-14 -1.136868e-13  5.684342e-14  0.000000e+00
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> ## making sure these things agree
> ##
> ## first when there is no NA
> 
> 
> 
> agree.checks <- function(buff.matrix,r.matrix,err.tol=1e-10){
+ 
+   if (Max(buff.matrix,na.rm=TRUE) != max(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Max")
+   }
+   
+ 
+   if (Min(buff.matrix,na.rm=TRUE) != min(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Min")
+   }
+ 
+ 
+   if (abs(Sum(buff.matrix,na.rm=TRUE)- sum(r.matrix,na.rm=TRUE)) > err.tol){
+ 
+     cat(Sum(buff.matrix,na.rm=TRUE),"\n")
+     cat(sum(r.matrix,na.rm=TRUE),"\n")
+     cat(Sum(buff.matrix,na.rm=TRUE) - sum(r.matrix,na.rm=TRUE),"\n")
+     
+     stop("No agreement in Sum")
+   }
+   
+   if (abs(mean(buff.matrix,na.rm=TRUE) - mean(r.matrix,na.rm=TRUE)) > err.tol){
+     stop("No agreement in mean")
+   }
+   
+   
+   if(abs(Var(buff.matrix,na.rm=TRUE) - var(as.vector(r.matrix),na.rm=TRUE)) > err.tol){
+     stop("No agreement in Var")
+   }
+   
+   
+ 
+   if(any(abs(rowMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,mean,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowMeans")
+   }
+   
+   
+   if(any(abs(colMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,mean,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colMeans")
+   }
+   
+   
+   if(any(abs(rowSums(buff.matrix,na.rm=TRUE)  -  apply(r.matrix,1,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in rowSums")
+   }
+   
+   
+   if(any(abs(colSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colSums")
+   }
+   
+   ### this is to get around the fact that R doesn't like to compute NA on an entire vector of NA when 
+   ### computing variance
+   my.Var <- function(x,na.rm=FALSE){
+    if (all(is.na(x))){
+      return(NA)
+    } else {
+      var(x,na.rm=na.rm)
+    }
+ 
+   }
+   
+   if(any(abs(rowVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+   
+   
+   if(any(abs(colVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+ 
+ 
+   if(any(abs(rowMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+ 
+   if(any(abs(colMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+   
+   
+   if(any(abs(rowMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+   
+ 
+   if(any(abs(colMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+ 
+   if(any(abs(colMedians(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,median,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMedian")
+   }
+ 
+   if(any(abs(colRanges(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,range,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colRanges")
+   }
+ 
+ 
+   
+ }
> 
> 
> 
> 
> 
> 
> 
> 
> 
> for (rep in 1:20){
+   copymatrix <- matrix(rnorm(200,150,15),10,20)
+   
+   tmp5[1:10,1:20] <- copymatrix
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ## now lets assign some NA values and check agreement
+ 
+   which.row <- sample(1:10,1,replace=TRUE)
+   which.col  <- sample(1:20,1,replace=TRUE)
+   
+   cat(which.row," ",which.col,"\n")
+   
+   tmp5[which.row,which.col] <- NA
+   copymatrix[which.row,which.col] <- NA
+   
+   agree.checks(tmp5,copymatrix)
+ 
+   ## make an entire row NA
+   tmp5[which.row,] <- NA
+   copymatrix[which.row,] <- NA
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ### also make an entire col NA
+   tmp5[,which.col] <- NA
+   copymatrix[,which.col] <- NA
+ 
+   agree.checks(tmp5,copymatrix)
+ 
+   ### now make 1 element non NA with NA in the rest of row and column
+ 
+   tmp5[which.row,which.col] <- rnorm(1,150,15)
+   copymatrix[which.row,which.col] <- tmp5[which.row,which.col]
+ 
+   agree.checks(tmp5,copymatrix)
+ }
6   11 
10   18 
2   7 
9   2 
2   18 
4   4 
7   12 
5   14 
3   7 
1   17 
6   10 
10   20 
7   13 
7   19 
10   17 
5   15 
3   15 
7   11 
8   3 
10   4 
There were 50 or more warnings (use warnings() to see the first 50)
> 
> 
> ### now test 1 by n and n by 1 matrix
> 
> 
> err.tol <- 1e-12
> 
> rm(tmp5)
> 
> dataset1 <- rnorm(100)
> dataset2 <- rnorm(100)
> 
> tmp <- createBufferedMatrix(1,100)
> tmp[1,] <- dataset1
> 
> tmp2 <- createBufferedMatrix(100,1)
> tmp2[,1] <- dataset2
> 
> 
> 
> 
> 
> Max(tmp)
[1] 2.551773
> Min(tmp)
[1] -2.969481
> mean(tmp)
[1] -0.02666214
> Sum(tmp)
[1] -2.666214
> Var(tmp)
[1] 1.243711
> 
> rowMeans(tmp)
[1] -0.02666214
> rowSums(tmp)
[1] -2.666214
> rowVars(tmp)
[1] 1.243711
> rowSd(tmp)
[1] 1.115218
> rowMax(tmp)
[1] 2.551773
> rowMin(tmp)
[1] -2.969481
> 
> colMeans(tmp)
  [1] -0.205278895 -0.154872304  0.601078076 -1.380084878 -1.395053938
  [6]  0.624465986 -0.482554889 -2.121654498  0.691478505 -0.328052694
 [11] -0.893031789  0.681793386 -0.451085039 -2.093170649  0.286448965
 [16] -0.325650618  2.551773444 -0.061991431 -1.628410516  1.374492760
 [21]  0.946992700  0.696006255 -0.835656792 -2.156050374 -0.347035372
 [26] -0.535422633 -0.965143330  1.478324403  0.052372340 -0.426737909
 [31]  0.594762477  1.124634433  1.150438035 -0.942830811 -1.651389511
 [36] -1.324737224  0.631396985  0.256745275  1.603009177 -2.969480792
 [41]  0.273714281  0.410404642  0.431588725 -0.385821313  1.378993364
 [46]  1.008830766  1.495707975 -1.260231172  1.817877409  1.930838915
 [51]  1.107295407  0.676929319 -0.072780566  0.569530282  0.691657438
 [56] -0.227021770 -0.393728093 -1.047554997 -1.005209118 -0.324820567
 [61]  0.434105980  0.201697246  0.015979857 -0.122495363  0.235882202
 [66] -0.008515659  1.890036523 -0.771044357  0.206653199 -1.004031843
 [71] -1.545126468  0.021293808 -0.155308566 -0.800191234 -0.156548178
 [76] -0.121920690 -0.801908270  1.810397161 -1.670773617  0.341622418
 [81]  1.182640589  0.150359763 -0.626113852  1.189844674  1.602081768
 [86] -0.027540436  0.555044683 -1.865955362  0.936317632  0.416353705
 [91]  0.081785943  0.455267869 -0.057168772 -2.519926605  2.442064195
 [96] -1.713009667  1.119221311 -1.222130755 -0.116182881 -1.396009478
> colSums(tmp)
  [1] -0.205278895 -0.154872304  0.601078076 -1.380084878 -1.395053938
  [6]  0.624465986 -0.482554889 -2.121654498  0.691478505 -0.328052694
 [11] -0.893031789  0.681793386 -0.451085039 -2.093170649  0.286448965
 [16] -0.325650618  2.551773444 -0.061991431 -1.628410516  1.374492760
 [21]  0.946992700  0.696006255 -0.835656792 -2.156050374 -0.347035372
 [26] -0.535422633 -0.965143330  1.478324403  0.052372340 -0.426737909
 [31]  0.594762477  1.124634433  1.150438035 -0.942830811 -1.651389511
 [36] -1.324737224  0.631396985  0.256745275  1.603009177 -2.969480792
 [41]  0.273714281  0.410404642  0.431588725 -0.385821313  1.378993364
 [46]  1.008830766  1.495707975 -1.260231172  1.817877409  1.930838915
 [51]  1.107295407  0.676929319 -0.072780566  0.569530282  0.691657438
 [56] -0.227021770 -0.393728093 -1.047554997 -1.005209118 -0.324820567
 [61]  0.434105980  0.201697246  0.015979857 -0.122495363  0.235882202
 [66] -0.008515659  1.890036523 -0.771044357  0.206653199 -1.004031843
 [71] -1.545126468  0.021293808 -0.155308566 -0.800191234 -0.156548178
 [76] -0.121920690 -0.801908270  1.810397161 -1.670773617  0.341622418
 [81]  1.182640589  0.150359763 -0.626113852  1.189844674  1.602081768
 [86] -0.027540436  0.555044683 -1.865955362  0.936317632  0.416353705
 [91]  0.081785943  0.455267869 -0.057168772 -2.519926605  2.442064195
 [96] -1.713009667  1.119221311 -1.222130755 -0.116182881 -1.396009478
> 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.205278895 -0.154872304  0.601078076 -1.380084878 -1.395053938
  [6]  0.624465986 -0.482554889 -2.121654498  0.691478505 -0.328052694
 [11] -0.893031789  0.681793386 -0.451085039 -2.093170649  0.286448965
 [16] -0.325650618  2.551773444 -0.061991431 -1.628410516  1.374492760
 [21]  0.946992700  0.696006255 -0.835656792 -2.156050374 -0.347035372
 [26] -0.535422633 -0.965143330  1.478324403  0.052372340 -0.426737909
 [31]  0.594762477  1.124634433  1.150438035 -0.942830811 -1.651389511
 [36] -1.324737224  0.631396985  0.256745275  1.603009177 -2.969480792
 [41]  0.273714281  0.410404642  0.431588725 -0.385821313  1.378993364
 [46]  1.008830766  1.495707975 -1.260231172  1.817877409  1.930838915
 [51]  1.107295407  0.676929319 -0.072780566  0.569530282  0.691657438
 [56] -0.227021770 -0.393728093 -1.047554997 -1.005209118 -0.324820567
 [61]  0.434105980  0.201697246  0.015979857 -0.122495363  0.235882202
 [66] -0.008515659  1.890036523 -0.771044357  0.206653199 -1.004031843
 [71] -1.545126468  0.021293808 -0.155308566 -0.800191234 -0.156548178
 [76] -0.121920690 -0.801908270  1.810397161 -1.670773617  0.341622418
 [81]  1.182640589  0.150359763 -0.626113852  1.189844674  1.602081768
 [86] -0.027540436  0.555044683 -1.865955362  0.936317632  0.416353705
 [91]  0.081785943  0.455267869 -0.057168772 -2.519926605  2.442064195
 [96] -1.713009667  1.119221311 -1.222130755 -0.116182881 -1.396009478
> colMin(tmp)
  [1] -0.205278895 -0.154872304  0.601078076 -1.380084878 -1.395053938
  [6]  0.624465986 -0.482554889 -2.121654498  0.691478505 -0.328052694
 [11] -0.893031789  0.681793386 -0.451085039 -2.093170649  0.286448965
 [16] -0.325650618  2.551773444 -0.061991431 -1.628410516  1.374492760
 [21]  0.946992700  0.696006255 -0.835656792 -2.156050374 -0.347035372
 [26] -0.535422633 -0.965143330  1.478324403  0.052372340 -0.426737909
 [31]  0.594762477  1.124634433  1.150438035 -0.942830811 -1.651389511
 [36] -1.324737224  0.631396985  0.256745275  1.603009177 -2.969480792
 [41]  0.273714281  0.410404642  0.431588725 -0.385821313  1.378993364
 [46]  1.008830766  1.495707975 -1.260231172  1.817877409  1.930838915
 [51]  1.107295407  0.676929319 -0.072780566  0.569530282  0.691657438
 [56] -0.227021770 -0.393728093 -1.047554997 -1.005209118 -0.324820567
 [61]  0.434105980  0.201697246  0.015979857 -0.122495363  0.235882202
 [66] -0.008515659  1.890036523 -0.771044357  0.206653199 -1.004031843
 [71] -1.545126468  0.021293808 -0.155308566 -0.800191234 -0.156548178
 [76] -0.121920690 -0.801908270  1.810397161 -1.670773617  0.341622418
 [81]  1.182640589  0.150359763 -0.626113852  1.189844674  1.602081768
 [86] -0.027540436  0.555044683 -1.865955362  0.936317632  0.416353705
 [91]  0.081785943  0.455267869 -0.057168772 -2.519926605  2.442064195
 [96] -1.713009667  1.119221311 -1.222130755 -0.116182881 -1.396009478
> colMedians(tmp)
  [1] -0.205278895 -0.154872304  0.601078076 -1.380084878 -1.395053938
  [6]  0.624465986 -0.482554889 -2.121654498  0.691478505 -0.328052694
 [11] -0.893031789  0.681793386 -0.451085039 -2.093170649  0.286448965
 [16] -0.325650618  2.551773444 -0.061991431 -1.628410516  1.374492760
 [21]  0.946992700  0.696006255 -0.835656792 -2.156050374 -0.347035372
 [26] -0.535422633 -0.965143330  1.478324403  0.052372340 -0.426737909
 [31]  0.594762477  1.124634433  1.150438035 -0.942830811 -1.651389511
 [36] -1.324737224  0.631396985  0.256745275  1.603009177 -2.969480792
 [41]  0.273714281  0.410404642  0.431588725 -0.385821313  1.378993364
 [46]  1.008830766  1.495707975 -1.260231172  1.817877409  1.930838915
 [51]  1.107295407  0.676929319 -0.072780566  0.569530282  0.691657438
 [56] -0.227021770 -0.393728093 -1.047554997 -1.005209118 -0.324820567
 [61]  0.434105980  0.201697246  0.015979857 -0.122495363  0.235882202
 [66] -0.008515659  1.890036523 -0.771044357  0.206653199 -1.004031843
 [71] -1.545126468  0.021293808 -0.155308566 -0.800191234 -0.156548178
 [76] -0.121920690 -0.801908270  1.810397161 -1.670773617  0.341622418
 [81]  1.182640589  0.150359763 -0.626113852  1.189844674  1.602081768
 [86] -0.027540436  0.555044683 -1.865955362  0.936317632  0.416353705
 [91]  0.081785943  0.455267869 -0.057168772 -2.519926605  2.442064195
 [96] -1.713009667  1.119221311 -1.222130755 -0.116182881 -1.396009478
> colRanges(tmp)
           [,1]       [,2]      [,3]      [,4]      [,5]     [,6]       [,7]
[1,] -0.2052789 -0.1548723 0.6010781 -1.380085 -1.395054 0.624466 -0.4825549
[2,] -0.2052789 -0.1548723 0.6010781 -1.380085 -1.395054 0.624466 -0.4825549
          [,8]      [,9]      [,10]      [,11]     [,12]     [,13]     [,14]
[1,] -2.121654 0.6914785 -0.3280527 -0.8930318 0.6817934 -0.451085 -2.093171
[2,] -2.121654 0.6914785 -0.3280527 -0.8930318 0.6817934 -0.451085 -2.093171
        [,15]      [,16]    [,17]       [,18]     [,19]    [,20]     [,21]
[1,] 0.286449 -0.3256506 2.551773 -0.06199143 -1.628411 1.374493 0.9469927
[2,] 0.286449 -0.3256506 2.551773 -0.06199143 -1.628411 1.374493 0.9469927
         [,22]      [,23]    [,24]      [,25]      [,26]      [,27]    [,28]
[1,] 0.6960063 -0.8356568 -2.15605 -0.3470354 -0.5354226 -0.9651433 1.478324
[2,] 0.6960063 -0.8356568 -2.15605 -0.3470354 -0.5354226 -0.9651433 1.478324
          [,29]      [,30]     [,31]    [,32]    [,33]      [,34]    [,35]
[1,] 0.05237234 -0.4267379 0.5947625 1.124634 1.150438 -0.9428308 -1.65139
[2,] 0.05237234 -0.4267379 0.5947625 1.124634 1.150438 -0.9428308 -1.65139
         [,36]    [,37]     [,38]    [,39]     [,40]     [,41]     [,42]
[1,] -1.324737 0.631397 0.2567453 1.603009 -2.969481 0.2737143 0.4104046
[2,] -1.324737 0.631397 0.2567453 1.603009 -2.969481 0.2737143 0.4104046
         [,43]      [,44]    [,45]    [,46]    [,47]     [,48]    [,49]
[1,] 0.4315887 -0.3858213 1.378993 1.008831 1.495708 -1.260231 1.817877
[2,] 0.4315887 -0.3858213 1.378993 1.008831 1.495708 -1.260231 1.817877
        [,50]    [,51]     [,52]       [,53]     [,54]     [,55]      [,56]
[1,] 1.930839 1.107295 0.6769293 -0.07278057 0.5695303 0.6916574 -0.2270218
[2,] 1.930839 1.107295 0.6769293 -0.07278057 0.5695303 0.6916574 -0.2270218
          [,57]     [,58]     [,59]      [,60]    [,61]     [,62]      [,63]
[1,] -0.3937281 -1.047555 -1.005209 -0.3248206 0.434106 0.2016972 0.01597986
[2,] -0.3937281 -1.047555 -1.005209 -0.3248206 0.434106 0.2016972 0.01597986
          [,64]     [,65]        [,66]    [,67]      [,68]     [,69]     [,70]
[1,] -0.1224954 0.2358822 -0.008515659 1.890037 -0.7710444 0.2066532 -1.004032
[2,] -0.1224954 0.2358822 -0.008515659 1.890037 -0.7710444 0.2066532 -1.004032
         [,71]      [,72]      [,73]      [,74]      [,75]      [,76]
[1,] -1.545126 0.02129381 -0.1553086 -0.8001912 -0.1565482 -0.1219207
[2,] -1.545126 0.02129381 -0.1553086 -0.8001912 -0.1565482 -0.1219207
          [,77]    [,78]     [,79]     [,80]    [,81]     [,82]      [,83]
[1,] -0.8019083 1.810397 -1.670774 0.3416224 1.182641 0.1503598 -0.6261139
[2,] -0.8019083 1.810397 -1.670774 0.3416224 1.182641 0.1503598 -0.6261139
        [,84]    [,85]       [,86]     [,87]     [,88]     [,89]     [,90]
[1,] 1.189845 1.602082 -0.02754044 0.5550447 -1.865955 0.9363176 0.4163537
[2,] 1.189845 1.602082 -0.02754044 0.5550447 -1.865955 0.9363176 0.4163537
          [,91]     [,92]       [,93]     [,94]    [,95]    [,96]    [,97]
[1,] 0.08178594 0.4552679 -0.05716877 -2.519927 2.442064 -1.71301 1.119221
[2,] 0.08178594 0.4552679 -0.05716877 -2.519927 2.442064 -1.71301 1.119221
         [,98]      [,99]    [,100]
[1,] -1.222131 -0.1161829 -1.396009
[2,] -1.222131 -0.1161829 -1.396009
> 
> 
> Max(tmp2)
[1] 2.19006
> Min(tmp2)
[1] -1.788433
> mean(tmp2)
[1] 0.1086551
> Sum(tmp2)
[1] 10.86551
> Var(tmp2)
[1] 0.7404632
> 
> rowMeans(tmp2)
  [1]  2.075513822 -0.126777131  1.387405157  0.602967026 -0.929375322
  [6]  1.406210796  0.511476015 -1.329118804 -0.084555927 -1.682401567
 [11]  0.457863556  0.475482352  1.178249334  0.550098681  1.457791363
 [16] -0.335656324  0.363752894  0.685287648  1.314203460  0.236977192
 [21] -0.094073598 -1.210556272 -0.592906489  0.169892200  0.318180820
 [26]  0.699501669  0.166321831 -0.628466614  1.261207983 -0.891854316
 [31]  1.934076807  2.190059528  1.197103049 -0.685481515 -0.324353621
 [36]  0.338547577  0.043025475  0.826409184  1.130440561 -0.204469241
 [41]  0.824867620 -1.057400679 -0.927327493  0.608702216 -1.313600920
 [46] -0.163764386  0.994275207 -0.577933047  0.379573038  1.484748741
 [51] -1.136599591 -1.788433381  0.178507032 -0.472560950 -0.335541349
 [56]  0.546677027 -0.406489662 -0.178473438  0.052397935  0.757522740
 [61] -0.258996417 -0.280900045 -0.668322789  1.025574514 -0.002838088
 [66]  0.383252001  0.172670464  0.404833665  0.780114704 -0.700348120
 [71] -0.260897691 -0.504919823 -0.512478811 -0.586082410  0.329112784
 [76]  1.548980749 -1.236235939 -0.287546102  1.453751500  0.570962903
 [81] -0.322111728  0.105649273  0.004939964 -0.229239080 -1.064582267
 [86]  0.225567571  0.956409485  0.347700652 -0.965520365  0.041717642
 [91]  0.664715895  0.446397022 -0.141561228 -0.600643023 -1.412459244
 [96] -1.341840806  1.419275405  0.116382820  0.391906935 -0.474025673
> rowSums(tmp2)
  [1]  2.075513822 -0.126777131  1.387405157  0.602967026 -0.929375322
  [6]  1.406210796  0.511476015 -1.329118804 -0.084555927 -1.682401567
 [11]  0.457863556  0.475482352  1.178249334  0.550098681  1.457791363
 [16] -0.335656324  0.363752894  0.685287648  1.314203460  0.236977192
 [21] -0.094073598 -1.210556272 -0.592906489  0.169892200  0.318180820
 [26]  0.699501669  0.166321831 -0.628466614  1.261207983 -0.891854316
 [31]  1.934076807  2.190059528  1.197103049 -0.685481515 -0.324353621
 [36]  0.338547577  0.043025475  0.826409184  1.130440561 -0.204469241
 [41]  0.824867620 -1.057400679 -0.927327493  0.608702216 -1.313600920
 [46] -0.163764386  0.994275207 -0.577933047  0.379573038  1.484748741
 [51] -1.136599591 -1.788433381  0.178507032 -0.472560950 -0.335541349
 [56]  0.546677027 -0.406489662 -0.178473438  0.052397935  0.757522740
 [61] -0.258996417 -0.280900045 -0.668322789  1.025574514 -0.002838088
 [66]  0.383252001  0.172670464  0.404833665  0.780114704 -0.700348120
 [71] -0.260897691 -0.504919823 -0.512478811 -0.586082410  0.329112784
 [76]  1.548980749 -1.236235939 -0.287546102  1.453751500  0.570962903
 [81] -0.322111728  0.105649273  0.004939964 -0.229239080 -1.064582267
 [86]  0.225567571  0.956409485  0.347700652 -0.965520365  0.041717642
 [91]  0.664715895  0.446397022 -0.141561228 -0.600643023 -1.412459244
 [96] -1.341840806  1.419275405  0.116382820  0.391906935 -0.474025673
> 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]  2.075513822 -0.126777131  1.387405157  0.602967026 -0.929375322
  [6]  1.406210796  0.511476015 -1.329118804 -0.084555927 -1.682401567
 [11]  0.457863556  0.475482352  1.178249334  0.550098681  1.457791363
 [16] -0.335656324  0.363752894  0.685287648  1.314203460  0.236977192
 [21] -0.094073598 -1.210556272 -0.592906489  0.169892200  0.318180820
 [26]  0.699501669  0.166321831 -0.628466614  1.261207983 -0.891854316
 [31]  1.934076807  2.190059528  1.197103049 -0.685481515 -0.324353621
 [36]  0.338547577  0.043025475  0.826409184  1.130440561 -0.204469241
 [41]  0.824867620 -1.057400679 -0.927327493  0.608702216 -1.313600920
 [46] -0.163764386  0.994275207 -0.577933047  0.379573038  1.484748741
 [51] -1.136599591 -1.788433381  0.178507032 -0.472560950 -0.335541349
 [56]  0.546677027 -0.406489662 -0.178473438  0.052397935  0.757522740
 [61] -0.258996417 -0.280900045 -0.668322789  1.025574514 -0.002838088
 [66]  0.383252001  0.172670464  0.404833665  0.780114704 -0.700348120
 [71] -0.260897691 -0.504919823 -0.512478811 -0.586082410  0.329112784
 [76]  1.548980749 -1.236235939 -0.287546102  1.453751500  0.570962903
 [81] -0.322111728  0.105649273  0.004939964 -0.229239080 -1.064582267
 [86]  0.225567571  0.956409485  0.347700652 -0.965520365  0.041717642
 [91]  0.664715895  0.446397022 -0.141561228 -0.600643023 -1.412459244
 [96] -1.341840806  1.419275405  0.116382820  0.391906935 -0.474025673
> rowMin(tmp2)
  [1]  2.075513822 -0.126777131  1.387405157  0.602967026 -0.929375322
  [6]  1.406210796  0.511476015 -1.329118804 -0.084555927 -1.682401567
 [11]  0.457863556  0.475482352  1.178249334  0.550098681  1.457791363
 [16] -0.335656324  0.363752894  0.685287648  1.314203460  0.236977192
 [21] -0.094073598 -1.210556272 -0.592906489  0.169892200  0.318180820
 [26]  0.699501669  0.166321831 -0.628466614  1.261207983 -0.891854316
 [31]  1.934076807  2.190059528  1.197103049 -0.685481515 -0.324353621
 [36]  0.338547577  0.043025475  0.826409184  1.130440561 -0.204469241
 [41]  0.824867620 -1.057400679 -0.927327493  0.608702216 -1.313600920
 [46] -0.163764386  0.994275207 -0.577933047  0.379573038  1.484748741
 [51] -1.136599591 -1.788433381  0.178507032 -0.472560950 -0.335541349
 [56]  0.546677027 -0.406489662 -0.178473438  0.052397935  0.757522740
 [61] -0.258996417 -0.280900045 -0.668322789  1.025574514 -0.002838088
 [66]  0.383252001  0.172670464  0.404833665  0.780114704 -0.700348120
 [71] -0.260897691 -0.504919823 -0.512478811 -0.586082410  0.329112784
 [76]  1.548980749 -1.236235939 -0.287546102  1.453751500  0.570962903
 [81] -0.322111728  0.105649273  0.004939964 -0.229239080 -1.064582267
 [86]  0.225567571  0.956409485  0.347700652 -0.965520365  0.041717642
 [91]  0.664715895  0.446397022 -0.141561228 -0.600643023 -1.412459244
 [96] -1.341840806  1.419275405  0.116382820  0.391906935 -0.474025673
> 
> colMeans(tmp2)
[1] 0.1086551
> colSums(tmp2)
[1] 10.86551
> colVars(tmp2)
[1] 0.7404632
> colSd(tmp2)
[1] 0.8605017
> colMax(tmp2)
[1] 2.19006
> colMin(tmp2)
[1] -1.788433
> colMedians(tmp2)
[1] 0.111016
> colRanges(tmp2)
          [,1]
[1,] -1.788433
[2,]  2.190060
> 
> dataset1 <- matrix(dataset1,1,100)
> 
> agree.checks(tmp,dataset1)
> 
> dataset2 <- matrix(dataset2,100,1)
> agree.checks(tmp2,dataset2)
>   
> 
> tmp <- createBufferedMatrix(10,10)
> 
> tmp[1:10,1:10] <- rnorm(100)
> colApply(tmp,sum)
 [1]  0.2037624  1.7030141  0.8435207  6.8072372  5.4324832 -6.1747989
 [7] -0.2986472  3.9943799 -2.9847508  4.3663961
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -1.0563429
[2,] -0.7546218
[3,] -0.1439513
[4,]  0.5085580
[5,]  1.7845310
> 
> rowApply(tmp,sum)
 [1]  0.3287130  4.7060187  1.0007481  4.6881194  4.0302956  4.5255036
 [7] -0.3039282 -6.5093723  2.6871839 -1.2606849
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    5    1    2    6    3    3   10    3    9     8
 [2,]   10    4    5    3    8    2    8   10    6     7
 [3,]    6    9    4    9    6    4    3    6    8     1
 [4,]    8    2    7    4    5   10    1    7   10    10
 [5,]    9   10    6    2   10    5    9    9    5     5
 [6,]    2    3    3    1    4    1    5    5    4     2
 [7,]    4    8    1    8    7    8    7    1    2     3
 [8,]    3    7    8   10    1    7    4    2    7     9
 [9,]    1    5   10    7    2    6    6    4    1     4
[10,]    7    6    9    5    9    9    2    8    3     6
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1] -1.385551019 -1.619151964 -0.848019858  1.562592265  1.599658217
 [6] -3.240900388 -3.551523328  1.222441931  1.023463794 -0.295936259
[11]  1.994051177  1.225519060  0.004053707  1.411734805  1.427931342
[16]  4.870728281  1.674144503 -0.590091765 -1.456459680  1.312986596
> colApply(tmp,quantile)[,1]
            [,1]
[1,] -0.98618698
[2,] -0.39275681
[3,] -0.28879496
[4,]  0.09051701
[5,]  0.19167071
> 
> rowApply(tmp,sum)
[1]  1.728667 -1.767166  3.679643  0.417117  2.283410
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]    9    8   10   12    3
[2,]    2    7   18    3   11
[3,]    3    5   16    5   12
[4,]    8   18    9   20    4
[5,]   14   19   15   11    5
> 
> 
> as.matrix(tmp)
            [,1]       [,2]       [,3]       [,4]        [,5]       [,6]
[1,] -0.39275681 -1.3243660 -0.8079730 -0.4405811  0.40028424 -0.2031799
[2,] -0.28879496 -0.3995858 -0.5392705  1.0186447  1.13297624 -0.2108326
[3,]  0.19167071  0.9865202  0.6466481  0.1047333  0.48214902 -0.2497088
[4,]  0.09051701 -1.0354761 -0.4712456  1.3721404  0.06235463 -0.6788072
[5,] -0.98618698  0.1537557  0.3238211 -0.4923450 -0.47810591 -1.8983719
          [,7]        [,8]        [,9]       [,10]      [,11]      [,12]
[1,] -0.484929 -0.59241619  1.75506910 -0.20196496  1.7266253  1.1367654
[2,]  1.828662  0.04247294 -1.68810658 -0.90499579  0.9314703 -0.5034295
[3,] -1.677471  0.41054691  0.01525428  0.05749435  0.2439821 -0.5370975
[4,] -1.302274  0.91131711  1.11351940  0.93261453 -1.6290307  0.9778361
[5,] -1.915511  0.45052116 -0.17227240 -0.17908439  0.7210041  0.1514446
           [,13]       [,14]      [,15]       [,16]      [,17]       [,18]
[1,] -0.48056412  0.06063347  0.8705916  1.56073604 -0.4843108  0.38447614
[2,] -0.06571508 -0.07022476 -0.2703645 -0.07231826  0.6396249 -1.04304419
[3,] -0.57269233  1.28428406  0.2510295  1.21283983  0.2076346 -0.05001253
[4,] -0.17657506  0.30492421 -0.3959797  0.41355424 -0.1315919  0.05669506
[5,]  1.29960030 -0.16788217  0.9726544  1.75591643  1.4427877  0.06179375
          [,19]       [,20]
[1,] -2.0341061  1.28063365
[2,] -1.3878975  0.08356337
[3,]  0.9604168 -0.28857864
[4,]  0.2377126 -0.23508797
[5,]  0.7674144  0.47245618
> 
> 
> 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.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  800  bytes.
> 
> 
> 
> subBufferedMatrix(tmp,1:5,1:5)
BufferedMatrix object
Matrix size:  5 5 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  654  bytes.
Disk usage :  200  bytes.
> subBufferedMatrix(tmp,,5:8)
BufferedMatrix object
Matrix size:  5 4 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.22-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.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  480  bytes.
> 
> 
> rm(tmp)
> 
> 
> ###
> ### Testing colnames and rownames
> ###
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> 
> 
> colnames(tmp)
NULL
> rownames(tmp)
NULL
> 
> 
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> colnames(tmp)
 [1] "col1"  "col2"  "col3"  "col4"  "col5"  "col6"  "col7"  "col8"  "col9" 
[10] "col10" "col11" "col12" "col13" "col14" "col15" "col16" "col17" "col18"
[19] "col19" "col20"
> rownames(tmp)
[1] "row1" "row2" "row3" "row4" "row5"
> 
> 
> tmp["row1",]
           col1     col2      col3     col4       col5     col6       col7
row1 0.07605355 0.643885 0.1568943 1.490453 -0.2534716 1.113238 -0.6364013
          col8      col9    col10      col11      col12     col13      col14
row1 -1.880982 0.7478431 1.230608 -0.6135331 -0.4543995 -2.009864 -0.6809047
         col15      col16     col17       col18     col19    col20
row1 0.9132329 -0.7092718 -1.399745 -0.03389009 0.2754538 -1.39595
> tmp[,"col10"]
          col10
row1 1.23060821
row2 1.49353937
row3 0.66987133
row4 0.45096857
row5 0.02202856
> tmp[c("row1","row5"),]
           col1     col2       col3      col4       col5       col6       col7
row1 0.07605355 0.643885  0.1568943  1.490453 -0.2534716  1.1132378 -0.6364013
row5 1.66981135 2.126248 -0.8840247 -1.130781  0.0253155 -0.7151829  0.8235271
           col8       col9      col10      col11      col12     col13
row1 -1.8809822  0.7478431 1.23060821 -0.6135331 -0.4543995 -2.009864
row5 -0.1686809 -0.0651756 0.02202856 -0.2072157  0.1993432 -2.060497
          col14     col15      col16      col17       col18     col19
row1 -0.6809047 0.9132329 -0.7092718 -1.3997451 -0.03389009 0.2754538
row5 -0.3031975 0.7952339  1.0822945  0.8994118  0.09790138 0.7477724
          col20
row1 -1.3959496
row5 -0.9784202
> tmp[,c("col6","col20")]
           col6      col20
row1  1.1132378 -1.3959496
row2 -0.2509995  0.1458719
row3 -0.8416598 -0.4146156
row4  0.7360393 -0.6996862
row5 -0.7151829 -0.9784202
> tmp[c("row1","row5"),c("col6","col20")]
           col6      col20
row1  1.1132378 -1.3959496
row5 -0.7151829 -0.9784202
> 
> 
> 
> 
> tmp["row1",] <- rnorm(20,mean=10)
> tmp[,"col10"] <- rnorm(5,mean=30)
> tmp[c("row1","row5"),] <- rnorm(40,mean=50)
> tmp[,c("col6","col20")] <- rnorm(10,mean=75)
> tmp[c("row1","row5"),c("col6","col20")]  <- rnorm(4,mean=105)
> 
> tmp["row1",]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 49.23996 50.56068 48.96341 50.52301 48.72861 104.8248 49.98198 49.57883
         col9    col10    col11    col12    col13    col14  col15    col16
row1 49.80512 52.21446 48.18293 50.06867 47.81256 50.42984 49.567 49.87629
       col17    col18   col19   col20
row1 51.2391 50.07008 49.4167 106.402
> tmp[,"col10"]
        col10
row1 52.21446
row2 29.43444
row3 28.29475
row4 31.60203
row5 51.09309
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 49.23996 50.56068 48.96341 50.52301 48.72861 104.8248 49.98198 49.57883
row5 50.75990 49.30073 49.10719 48.34639 49.56456 105.0167 50.20873 50.25394
         col9    col10    col11    col12    col13    col14    col15    col16
row1 49.80512 52.21446 48.18293 50.06867 47.81256 50.42984 49.56700 49.87629
row5 50.99702 51.09309 50.28310 49.33758 47.85351 51.95721 50.91792 48.47545
        col17    col18    col19    col20
row1 51.23910 50.07008 49.41670 106.4020
row5 48.59483 47.52632 49.57129 104.7313
> tmp[,c("col6","col20")]
          col6     col20
row1 104.82484 106.40199
row2  75.33719  75.19333
row3  74.62404  76.75836
row4  76.18881  74.44506
row5 105.01669 104.73133
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 104.8248 106.4020
row5 105.0167 104.7313
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 104.8248 106.4020
row5 105.0167 104.7313
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
          col13
[1,]  0.4186399
[2,] -0.3478284
[3,] -2.1947818
[4,] -0.4796592
[5,]  0.4988220
> tmp[,c("col17","col7")]
          col17        col7
[1,]  0.4788562 -0.89815194
[2,] -0.9987509  0.05765947
[3,]  0.5259334 -0.51175144
[4,]  0.6375946  0.73524521
[5,]  2.4864671 -0.11327709
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
            col6      col20
[1,]  0.38012545 -1.9936753
[2,] -1.37566274 -0.6933965
[3,]  0.74462550 -1.2462379
[4,]  0.03084078 -0.0578886
[5,]  1.29339028  0.2940178
> subBufferedMatrix(tmp,1,c("col6"))[,1]
          col1
[1,] 0.3801255
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
           col6
[1,]  0.3801255
[2,] -1.3756627
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> 
> 
> 
> subBufferedMatrix(tmp,c("row3","row1"),)[,1:20]
           [,1]      [,2]        [,3]       [,4]       [,5]       [,6]
row3  0.4992610 0.2669368 -1.36270467 0.62925254 -0.3098851 -0.0221784
row1 -0.5477004 0.4743446 -0.02123559 0.07571684 -0.7094405  0.2928716
           [,7]      [,8]      [,9]       [,10]      [,11]      [,12]
row3 -0.3309046 -1.142962  0.539950  0.06971428 -0.1874325 -0.1444789
row1  0.9081289  1.255184 -1.611191 -0.27465932 -0.2519286  0.6929611
          [,13]      [,14]     [,15]      [,16]      [,17]      [,18]     [,19]
row3 -1.1307849 -0.5277440 0.7097368 0.06570512  0.9037012 -0.5463848 -1.936235
row1 -0.1125884  0.1998414 1.1933406 1.57465534 -0.2236134  0.5863653  0.628103
          [,20]
row3  1.1282459
row1 -0.8755398
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
         [,1]       [,2]       [,3]      [,4]      [,5]      [,6]     [,7]
row2 0.496945 -0.9785865 -0.7474359 0.6384619 0.4195647 0.3806021 1.463968
          [,8]      [,9]     [,10]
row2 -1.023884 -1.153565 0.2780201
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
        [,1]     [,2]      [,3]      [,4]      [,5]      [,6]      [,7]
row5 1.87924 1.262691 0.6992312 0.0780998 0.6163338 -1.135971 0.9925544
           [,8]     [,9]      [,10]      [,11]     [,12]    [,13]     [,14]
row5 -0.4235631 1.314506 -0.2009301 -0.8147633 0.4211757 1.506576 -0.158191
         [,15]     [,16]    [,17]     [,18]     [,19]     [,20]
row5 -1.482909 0.7413196 0.537369 -1.037048 0.6617766 -2.266471
> 
> 
> 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: 0x378e1810>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM14713062a4812c"
 [2] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM147130f68a50a" 
 [3] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM1471304a193f8" 
 [4] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM1471306cc14d47"
 [5] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM1471303a514f28"
 [6] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM1471304ceaa264"
 [7] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM1471302ba4c840"
 [8] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM1471304fd5de43"
 [9] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM147130407e6ad7"
[10] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM1471301ba04b3c"
[11] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM1471301e497ad8"
[12] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM147130507dc0a4"
[13] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM14713057e95983"
[14] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM14713069f2f155"
[15] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM14713078cb8149"
> 
> 
> ### 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: 0x398adc20>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x398adc20>
Warning message:
In dir.create(new.directory) :
  '/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x398adc20>
> rowMedians(tmp)
  [1] -0.035613631 -0.345794686 -0.006113063 -0.148678438  0.279848351
  [6]  0.112024927  0.199667350 -0.226296119  0.315316418  0.059845924
 [11] -0.426739276 -0.266640966  0.896480978 -0.180763951 -0.091014485
 [16] -0.281758069  0.033670500  0.131822905  0.716190720 -0.366353464
 [21] -0.230140957  0.469850587  0.211550069 -0.151232288 -0.466901082
 [26] -0.199090814  0.164549836 -0.401360138  0.233750712  0.158102794
 [31] -0.281556270 -0.010097209 -0.035546941 -0.026919021 -0.197965892
 [36]  0.217020017  0.208175336 -0.242215728 -0.001628137 -0.034666325
 [41]  0.077710159  0.118030347 -0.442804605 -0.236848541  0.039140328
 [46] -0.181523995 -0.497536664 -0.231443907 -0.268042044 -0.127703529
 [51]  0.034214940  0.198325449  0.506218583 -0.307511048  0.111606916
 [56]  0.150230416 -0.327254375 -0.130459056  0.107865483 -0.175021209
 [61]  0.554708902  0.228072409 -0.013769655 -0.365331550 -0.281618252
 [66]  0.133173387  0.151844697 -0.220633675  0.103774600 -0.035275562
 [71]  0.098026992  0.019469407 -0.163439912 -0.255359931 -0.129384117
 [76]  0.097705026 -0.382714837  0.048734717  0.020297441  0.347266622
 [81] -0.057072020  0.071817326 -0.636616124  0.102298154  0.037945438
 [86] -0.195671745 -0.020666970  0.082742470 -0.260828969 -0.025918283
 [91] -0.179547008  0.259836471 -0.155932891  0.403930958 -0.222227180
 [96]  0.394884847  0.094331022  0.003308561 -0.065397739  0.497261562
[101]  0.438037373  0.035313135 -0.012770626  0.289522585  0.256733665
[106]  0.063025266 -0.191185013 -0.342416255 -0.096989023  0.085661152
[111]  0.129477455  0.607547639  0.232804546  0.644162727  0.330967165
[116]  0.202062498 -0.580257195 -0.022230833 -0.068416665  0.018959678
[121]  0.265568292  0.007100383  0.055053424  0.467311928 -0.233040105
[126]  0.338555518 -0.332875615 -0.151542785  0.261249953 -0.703816623
[131] -0.118644513 -0.022968564  0.441491531  0.117366688  0.090034044
[136] -0.112996326  0.330572310 -0.586145701 -0.205417256  0.210017822
[141] -0.223232921  0.256332377 -0.301754425  0.599979163 -0.120273977
[146]  0.159483121 -0.577548788 -0.073659034  0.341776351 -0.200497838
[151] -0.152136154 -0.307641716 -0.241091394  0.509092648  0.195896056
[156]  0.594844221 -0.170355065  0.011007856 -0.080116361  0.162375721
[161] -0.159884853 -0.050505362 -0.200842917 -0.019949424 -0.177581217
[166] -0.202266650  0.415519829 -0.415876345  0.054491054 -0.083337064
[171] -0.319608379 -0.149478013 -0.458091884  0.438569038 -0.009417352
[176]  0.332208502 -0.258529554 -0.189017870  0.262455900 -0.321940204
[181]  0.072877939  0.508777528 -0.109499295 -0.041811973  0.124270994
[186] -0.230556325 -0.827538886  0.743284645 -0.178413880  0.461502871
[191] -0.135847086 -0.169086596 -0.807982923  0.327294356 -0.047427641
[196]  0.774493973  0.544212151 -0.432125472  0.184834875 -0.124660466
[201]  0.346225552  0.151260762 -0.198878608  0.595412817 -0.205492852
[206]  0.128666737  0.381917571  0.303105821 -0.424784331 -0.143951026
[211]  0.338027128  0.038081489  0.334357317  0.301644401 -0.420742434
[216]  0.331963002 -0.022083877  0.061570037 -0.186807228  0.062381641
[221] -0.043361304  0.182617413  0.410417407 -0.069516895 -0.341236647
[226] -0.737908495  0.186346313 -0.210174521  0.234689462 -0.368435251
> 
> proc.time()
   user  system elapsed 
  1.796   0.883   2.700 

BufferedMatrix.Rcheck/tests/rawCalltesting.Rout


R version 4.5.0 (2025-04-11) -- "How About a Twenty-Six"
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: 0x108d8ff0>
> .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: 0x108d8ff0>
> .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: 0x108d8ff0>
> .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: 0x108d8ff0>
> 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: 0x107e3470>
> .Call("R_bm_AddColumn",P)
<pointer: 0x107e3470>
> .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: 0x107e3470>
> .Call("R_bm_AddColumn",P)
<pointer: 0x107e3470>
> .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: 0x107e3470>
> 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: 0x107be0e0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x107be0e0>
> .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: 0x107be0e0>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x107be0e0>
> .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: 0x107be0e0>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x107be0e0>
> .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: 0x107be0e0>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x107be0e0>
> .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: 0x107be0e0>
> 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: 0xf745520>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0xf745520>
> .Call("R_bm_AddColumn",P)
<pointer: 0xf745520>
> .Call("R_bm_AddColumn",P)
<pointer: 0xf745520>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile1471a6462738fe" "BufferedMatrixFile1471a669350bf3"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile1471a6462738fe" "BufferedMatrixFile1471a669350bf3"
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x1168e030>
> .Call("R_bm_AddColumn",P)
<pointer: 0x1168e030>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x1168e030>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x1168e030>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x1168e030>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x1168e030>
> .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: 0x100595c0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x100595c0>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x100595c0>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x100595c0>
> 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: 0x11139f30>
> .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: 0x11139f30>
> rm(P)
> 
> proc.time()
   user  system elapsed 
  0.314   0.056   0.355 

BufferedMatrix.Rcheck/tests/Rcodetesting.Rout


R version 4.5.0 (2025-04-11) -- "How About a Twenty-Six"
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.319   0.050   0.354 

Example timings