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

This page was generated on 2025-08-04 12:12 -0400 (Mon, 04 Aug 2025).

HostnameOSArch (*)R versionInstalled pkgs
nebbiolo2Linux (Ubuntu 24.04.2 LTS)x86_644.5.1 (2025-06-13) -- "Great Square Root" 4796
palomino8Windows Server 2022 Datacenterx644.5.1 (2025-06-13 ucrt) -- "Great Square Root" 4536
lconwaymacOS 12.7.1 Montereyx86_644.5.1 (2025-06-13) -- "Great Square Root" 4578
kjohnson3macOS 13.7.1 Venturaarm644.5.1 Patched (2025-06-14 r88325) -- "Great Square Root" 4519
taishanLinux (openEuler 24.03 LTS)aarch644.5.0 (2025-04-11) -- "How About a Twenty-Six" 4517
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 251/2313HostnameOS / ArchINSTALLBUILDCHECKBUILD BIN
BufferedMatrix 1.73.0  (landing page)
Ben Bolstad
Snapshot Date: 2025-08-03 13:25 -0400 (Sun, 03 Aug 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.2 LTS) / x86_64  OK    OK    OK  UNNEEDED, same version is already published
palomino8Windows Server 2022 Datacenter / x64  OK    OK    OK    OK  UNNEEDED, same version is already published
lconwaymacOS 12.7.1 Monterey / x86_64  OK    OK    WARNINGS    OK  UNNEEDED, same version is already published
kjohnson3macOS 13.7.1 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-08-01 04:50:49 -0000 (Fri, 01 Aug 2025)
EndedAt: 2025-08-01 04:51:13 -0000 (Fri, 01 Aug 2025)
EllapsedTime: 23.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.325   0.062   0.371 

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 Aug  1 04:51:07 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 Aug  1 04:51:07 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: 0x2bcf4ff0>
> 
> 
> 
> 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 Aug  1 04:51:07 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 Aug  1 04:51:07 2025"
> 
> ColMode(tmp2)
<pointer: 0x2bcf4ff0>
> 
> 
> 
> ### Now testing assignments
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+ 
+   new.data <- rnorm(20)
+   tmp2[which.row,] <- new.data
+   test.matrix[which.row,] <- new.data
+   if (rep > 1){
+     if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+   
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   new.data <- rnorm(10)
+   tmp2[,which.col] <- new.data
+   test.matrix[,which.col]<- new.data
+ 
+   if (rep > 1){
+     if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.col <- which.col
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,5,replace=TRUE)
+   new.data <- matrix(rnorm(50),5,10)
+   tmp2[,which.col] <- new.data
+   test.matrix[,which.col]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.col <- which.col
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   new.data <- matrix(rnorm(50),5,10)
+   tmp2[which.row,] <- new.data
+   test.matrix[which.row,]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col  <- sample(1:20,5,replace=TRUE)
+   new.data <- matrix(rnorm(25),5,5)
+   tmp2[which.row,which.col] <- new.data
+   test.matrix[which.row,which.col]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[prev.row,prev.col] == test.matrix[prev.row,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+   prev.col <- which.col
+ }
> 
> 
> 
> 
> ###
> ###
> ### testing some more functions
> ###
> 
> 
> 
> ## duplication function
> tmp5 <- duplicate(tmp2)
> 
> # making sure really did copy everything.
> tmp5[1,1] <- tmp5[1,1] +100.00
> 
> if (tmp5[1,1] == tmp2[1,1]){
+   stop("Problem with duplication")
+ }
> 
> 
> 
> 
> ### testing elementwise applying of functions
> 
> tmp5[1:4,1:4]
            [,1]       [,2]       [,3]       [,4]
[1,] 101.1969927 -0.4099892 -0.7256895  0.4160388
[2,]  -1.9734375 -1.2007665  1.3086460 -1.9834740
[3,]   1.9406408 -0.2895119 -2.2196377 -0.5218262
[4,]  -0.1325594  1.7804554 -0.7477703 -0.3634349
> 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,] 101.1969927 0.4099892 0.7256895 0.4160388
[2,]   1.9734375 1.2007665 1.3086460 1.9834740
[3,]   1.9406408 0.2895119 2.2196377 0.5218262
[4,]   0.1325594 1.7804554 0.7477703 0.3634349
> 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,] 10.059672 0.6403040 0.8518741 0.6450107
[2,]  1.404791 1.0957949 1.1439606 1.4083586
[3,]  1.393069 0.5380631 1.4898448 0.7223754
[4,]  0.364087 1.3343371 0.8647371 0.6028556
> 
> 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,] 226.79371 31.81303 34.24443 31.86615
[2,]  41.02135 37.15872 37.74825 41.06706
[3,]  40.87133 30.67014 42.11809 32.74558
[4,]  28.77343 40.12383 34.39514 31.39199
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x2cf249a0>
> exp(tmp5)
<pointer: 0x2cf249a0>
> log(tmp5,2)
<pointer: 0x2cf249a0>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 472.0414
> Min(tmp5)
[1] 53.90484
> mean(tmp5)
[1] 72.86324
> Sum(tmp5)
[1] 14572.65
> Var(tmp5)
[1] 877.3863
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 90.01661 73.26610 72.72686 74.85259 71.00021 68.57684 68.54067 70.09371
 [9] 71.34395 68.21487
> rowSums(tmp5)
 [1] 1800.332 1465.322 1454.537 1497.052 1420.004 1371.537 1370.813 1401.874
 [9] 1426.879 1364.297
> rowVars(tmp5)
 [1] 8146.09702   84.67305   63.54201   99.48134   67.66686   96.87811
 [7]   57.02052   44.82653   76.59550   62.69511
> rowSd(tmp5)
 [1] 90.255731  9.201796  7.971325  9.974033  8.225987  9.842668  7.551193
 [8]  6.695261  8.751885  7.918025
> rowMax(tmp5)
 [1] 472.04139  87.45192  87.66328  94.41639  86.05877  86.92746  82.13470
 [8]  83.76539  90.00981  80.51933
> rowMin(tmp5)
 [1] 59.23617 58.49426 55.46248 59.88812 57.55208 54.83184 56.60408 55.28416
 [9] 58.50362 53.90484
> 
> colMeans(tmp5)
 [1] 111.42477  69.01156  73.78306  69.09764  69.81523  70.62692  66.38644
 [8]  74.55313  73.74288  72.52363  76.33379  71.35312  67.00311  70.35869
[15]  71.44850  73.24528  73.13897  65.35661  68.30893  69.75258
> colSums(tmp5)
 [1] 1114.2477  690.1156  737.8306  690.9764  698.1523  706.2692  663.8644
 [8]  745.5313  737.4288  725.2363  763.3379  713.5312  670.0311  703.5869
[15]  714.4850  732.4528  731.3897  653.5661  683.0893  697.5258
> colVars(tmp5)
 [1] 16143.03190    65.75887    43.78904    60.85344   114.30907    42.27252
 [7]    52.00210    70.38237    75.14271   104.69973    56.34509    59.99450
[13]    59.37137    71.91215    89.28771    93.67557    89.87530    39.73239
[19]    52.20321   103.38209
> colSd(tmp5)
 [1] 127.055232   8.109184   6.617329   7.800862  10.691542   6.501732
 [7]   7.211248   8.389420   8.668489  10.232288   7.506336   7.745612
[13]   7.705282   8.480103   9.449218   9.678614   9.480259   6.303364
[19]   7.225179  10.167699
> colMax(tmp5)
 [1] 472.04139  83.51249  87.66328  85.47571  90.00981  83.76539  76.11713
 [8]  89.93135  86.05877  86.92746  88.48984  82.00459  80.17882  80.81090
[15]  82.97493  94.41639  84.36336  76.19711  79.58344  87.45192
> colMin(tmp5)
 [1] 59.88812 56.60408 62.70900 59.51276 55.46248 59.77880 55.28416 58.50362
 [9] 60.33780 58.02514 63.85706 60.43642 58.49426 54.83184 53.90484 61.80710
[17] 56.48384 59.71807 56.81197 57.55208
> 
> 
> ### 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 73.26610 72.72686 74.85259 71.00021 68.57684 68.54067 70.09371
 [9] 71.34395 68.21487
> rowSums(tmp5)
 [1]       NA 1465.322 1454.537 1497.052 1420.004 1371.537 1370.813 1401.874
 [9] 1426.879 1364.297
> rowVars(tmp5)
 [1] 8584.70611   84.67305   63.54201   99.48134   67.66686   96.87811
 [7]   57.02052   44.82653   76.59550   62.69511
> rowSd(tmp5)
 [1] 92.653689  9.201796  7.971325  9.974033  8.225987  9.842668  7.551193
 [8]  6.695261  8.751885  7.918025
> rowMax(tmp5)
 [1]       NA 87.45192 87.66328 94.41639 86.05877 86.92746 82.13470 83.76539
 [9] 90.00981 80.51933
> rowMin(tmp5)
 [1]       NA 58.49426 55.46248 59.88812 57.55208 54.83184 56.60408 55.28416
 [9] 58.50362 53.90484
> 
> colMeans(tmp5)
 [1] 111.42477  69.01156  73.78306  69.09764  69.81523  70.62692  66.38644
 [8]  74.55313  73.74288  72.52363  76.33379  71.35312  67.00311  70.35869
[15]  71.44850  73.24528  73.13897  65.35661  68.30893        NA
> colSums(tmp5)
 [1] 1114.2477  690.1156  737.8306  690.9764  698.1523  706.2692  663.8644
 [8]  745.5313  737.4288  725.2363  763.3379  713.5312  670.0311  703.5869
[15]  714.4850  732.4528  731.3897  653.5661  683.0893        NA
> colVars(tmp5)
 [1] 16143.03190    65.75887    43.78904    60.85344   114.30907    42.27252
 [7]    52.00210    70.38237    75.14271   104.69973    56.34509    59.99450
[13]    59.37137    71.91215    89.28771    93.67557    89.87530    39.73239
[19]    52.20321          NA
> colSd(tmp5)
 [1] 127.055232   8.109184   6.617329   7.800862  10.691542   6.501732
 [7]   7.211248   8.389420   8.668489  10.232288   7.506336   7.745612
[13]   7.705282   8.480103   9.449218   9.678614   9.480259   6.303364
[19]   7.225179         NA
> colMax(tmp5)
 [1] 472.04139  83.51249  87.66328  85.47571  90.00981  83.76539  76.11713
 [8]  89.93135  86.05877  86.92746  88.48984  82.00459  80.17882  80.81090
[15]  82.97493  94.41639  84.36336  76.19711  79.58344        NA
> colMin(tmp5)
 [1] 59.88812 56.60408 62.70900 59.51276 55.46248 59.77880 55.28416 58.50362
 [9] 60.33780 58.02514 63.85706 60.43642 58.49426 54.83184 53.90484 61.80710
[17] 56.48384 59.71807 56.81197       NA
> 
> Max(tmp5,na.rm=TRUE)
[1] 472.0414
> Min(tmp5,na.rm=TRUE)
[1] 53.90484
> mean(tmp5,na.rm=TRUE)
[1] 72.85466
> Sum(tmp5,na.rm=TRUE)
[1] 14498.08
> Var(tmp5,na.rm=TRUE)
[1] 881.8027
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 90.82956 73.26610 72.72686 74.85259 71.00021 68.57684 68.54067 70.09371
 [9] 71.34395 68.21487
> rowSums(tmp5,na.rm=TRUE)
 [1] 1725.762 1465.322 1454.537 1497.052 1420.004 1371.537 1370.813 1401.874
 [9] 1426.879 1364.297
> rowVars(tmp5,na.rm=TRUE)
 [1] 8584.70611   84.67305   63.54201   99.48134   67.66686   96.87811
 [7]   57.02052   44.82653   76.59550   62.69511
> rowSd(tmp5,na.rm=TRUE)
 [1] 92.653689  9.201796  7.971325  9.974033  8.225987  9.842668  7.551193
 [8]  6.695261  8.751885  7.918025
> rowMax(tmp5,na.rm=TRUE)
 [1] 472.04139  87.45192  87.66328  94.41639  86.05877  86.92746  82.13470
 [8]  83.76539  90.00981  80.51933
> rowMin(tmp5,na.rm=TRUE)
 [1] 59.23617 58.49426 55.46248 59.88812 57.55208 54.83184 56.60408 55.28416
 [9] 58.50362 53.90484
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 111.42477  69.01156  73.78306  69.09764  69.81523  70.62692  66.38644
 [8]  74.55313  73.74288  72.52363  76.33379  71.35312  67.00311  70.35869
[15]  71.44850  73.24528  73.13897  65.35661  68.30893  69.21724
> colSums(tmp5,na.rm=TRUE)
 [1] 1114.2477  690.1156  737.8306  690.9764  698.1523  706.2692  663.8644
 [8]  745.5313  737.4288  725.2363  763.3379  713.5312  670.0311  703.5869
[15]  714.4850  732.4528  731.3897  653.5661  683.0893  622.9551
> colVars(tmp5,na.rm=TRUE)
 [1] 16143.03190    65.75887    43.78904    60.85344   114.30907    42.27252
 [7]    52.00210    70.38237    75.14271   104.69973    56.34509    59.99450
[13]    59.37137    71.91215    89.28771    93.67557    89.87530    39.73239
[19]    52.20321   113.08068
> colSd(tmp5,na.rm=TRUE)
 [1] 127.055232   8.109184   6.617329   7.800862  10.691542   6.501732
 [7]   7.211248   8.389420   8.668489  10.232288   7.506336   7.745612
[13]   7.705282   8.480103   9.449218   9.678614   9.480259   6.303364
[19]   7.225179  10.633940
> colMax(tmp5,na.rm=TRUE)
 [1] 472.04139  83.51249  87.66328  85.47571  90.00981  83.76539  76.11713
 [8]  89.93135  86.05877  86.92746  88.48984  82.00459  80.17882  80.81090
[15]  82.97493  94.41639  84.36336  76.19711  79.58344  87.45192
> colMin(tmp5,na.rm=TRUE)
 [1] 59.88812 56.60408 62.70900 59.51276 55.46248 59.77880 55.28416 58.50362
 [9] 60.33780 58.02514 63.85706 60.43642 58.49426 54.83184 53.90484 61.80710
[17] 56.48384 59.71807 56.81197 57.55208
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1]      NaN 73.26610 72.72686 74.85259 71.00021 68.57684 68.54067 70.09371
 [9] 71.34395 68.21487
> rowSums(tmp5,na.rm=TRUE)
 [1]    0.000 1465.322 1454.537 1497.052 1420.004 1371.537 1370.813 1401.874
 [9] 1426.879 1364.297
> rowVars(tmp5,na.rm=TRUE)
 [1]       NA 84.67305 63.54201 99.48134 67.66686 96.87811 57.02052 44.82653
 [9] 76.59550 62.69511
> rowSd(tmp5,na.rm=TRUE)
 [1]       NA 9.201796 7.971325 9.974033 8.225987 9.842668 7.551193 6.695261
 [9] 8.751885 7.918025
> rowMax(tmp5,na.rm=TRUE)
 [1]       NA 87.45192 87.66328 94.41639 86.05877 86.92746 82.13470 83.76539
 [9] 90.00981 80.51933
> rowMin(tmp5,na.rm=TRUE)
 [1]       NA 58.49426 55.46248 59.88812 57.55208 54.83184 56.60408 55.28416
 [9] 58.50362 53.90484
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1] 71.35626 69.32233 74.06170 69.40569 70.67560 71.29800 65.30525 74.24552
 [9] 72.40421 72.10270 75.81760 72.55597 67.86610 71.34640 70.47286 74.35347
[17] 73.21095 65.76638 68.36198      NaN
> colSums(tmp5,na.rm=TRUE)
 [1] 642.2063 623.9010 666.5553 624.6512 636.0804 641.6820 587.7473 668.2096
 [9] 651.6379 648.9243 682.3584 653.0037 610.7949 642.1176 634.2558 669.1813
[17] 658.8986 591.8974 615.2578   0.0000
> colVars(tmp5,na.rm=TRUE)
 [1]  99.19594  72.89224  48.38921  67.39257 120.27007  42.49008  45.35149
 [8]  78.11565  64.37531 115.79392  60.39069  51.21669  58.41427  69.92595
[15]  89.74021  91.56902 101.05143  42.80994  58.69695        NA
> colSd(tmp5,na.rm=TRUE)
 [1]  9.959716  8.537695  6.956235  8.209298 10.966771  6.518442  6.734352
 [8]  8.838306  8.023423 10.760758  7.771145  7.156584  7.642923  8.362174
[15]  9.473131  9.569170 10.052434  6.542930  7.661394        NA
> colMax(tmp5,na.rm=TRUE)
 [1] 85.38056 83.51249 87.66328 85.47571 90.00981 83.76539 74.02174 89.93135
 [9] 86.05877 86.92746 88.48984 82.00459 80.17882 80.81090 82.97493 94.41639
[17] 84.36336 76.19711 79.58344     -Inf
> colMin(tmp5,na.rm=TRUE)
 [1] 59.88812 56.60408 62.70900 59.51276 55.46248 59.77880 55.28416 58.50362
 [9] 60.33780 58.02514 63.85706 60.43642 58.49426 54.83184 53.90484 61.80710
[17] 56.48384 59.71807 56.81197      Inf
> 
> 
> 
> 
> copymatrix <- matrix(rnorm(200,150,15),10,20)
> 
> tmp5[1:10,1:20] <- copymatrix
> which.row <- 3
> which.col  <- 1
> cat(which.row," ",which.col,"\n")
3   1 
> tmp5[which.row,which.col] <- NA
> copymatrix[which.row,which.col] <- NA
> 
> rowVars(tmp5,na.rm=TRUE)
 [1] 186.3086 222.7057 349.9885 238.0407 312.1093 265.1757 203.2303 267.8494
 [9] 145.9808 222.6435
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 186.3086 222.7057 349.9885 238.0407 312.1093 265.1757 203.2303 267.8494
 [9] 145.9808 222.6435
> 
> 
> 
> 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-13 -1.136868e-13  0.000000e+00  2.842171e-14 -1.136868e-13
 [6]  0.000000e+00  1.136868e-13  2.842171e-14  1.421085e-14 -2.842171e-14
[11] -5.684342e-14 -2.842171e-13  5.684342e-14 -2.842171e-14  2.842171e-14
[16] -1.136868e-13 -5.684342e-14  1.705303e-13  0.000000e+00  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)
+ }
7   17 
10   20 
2   1 
4   3 
8   4 
4   16 
7   17 
7   2 
10   19 
10   9 
10   14 
8   6 
1   13 
4   7 
5   6 
8   6 
4   7 
10   17 
2   15 
2   3 
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.605138
> Min(tmp)
[1] -2.557663
> mean(tmp)
[1] -0.08099276
> Sum(tmp)
[1] -8.099276
> Var(tmp)
[1] 0.8472024
> 
> rowMeans(tmp)
[1] -0.08099276
> rowSums(tmp)
[1] -8.099276
> rowVars(tmp)
[1] 0.8472024
> rowSd(tmp)
[1] 0.920436
> rowMax(tmp)
[1] 2.605138
> rowMin(tmp)
[1] -2.557663
> 
> colMeans(tmp)
  [1] -0.767801310 -0.618196884  0.721288640 -1.161571366  1.180900538
  [6] -1.715476722 -0.863370158  0.036554079 -1.263244125  0.210323956
 [11] -0.276315786 -0.633284832 -0.038288846 -0.867940774  0.419012263
 [16]  1.013179091  1.449529352  1.388616209 -0.512694977  0.177365415
 [21]  0.153154538 -0.653875329 -0.075454086 -0.230849243  0.674915699
 [26] -1.517106699  1.749050484 -0.376060486  0.134261232  0.841115973
 [31] -0.334293667 -0.665083743  0.403890129  0.839420458  0.242362151
 [36] -0.693557542 -0.502069204 -0.861815828  0.494799734 -1.321833975
 [41] -0.733288475  0.778179288 -0.895907723  0.428964543 -0.306588427
 [46] -0.500548235  0.065404605 -2.557663343  0.994453932  0.799337414
 [51]  1.580919942 -0.757697189 -0.946544192 -0.896072758  0.954613746
 [56]  0.074704387  1.735889827 -0.516336275 -0.078021092 -0.479591047
 [61] -0.497540675 -1.072969741  1.610840770  0.305720435 -0.594291707
 [66]  0.062612018 -0.511968166 -1.195197989  1.234992063  0.300164176
 [71]  0.268102449  1.530766532 -0.047385942 -0.003980085 -0.274250644
 [76] -1.551143203 -0.425475211 -0.970005422 -0.808584127 -0.337661359
 [81] -1.255341730  0.678820811  0.005295045  2.605137814 -0.931570078
 [86] -1.842418402  1.490277303  0.632180789 -0.797288723  0.894032734
 [91]  0.506253490 -0.072104343 -0.292480617  0.146738170 -0.767042332
 [96] -0.891871803  1.112911263 -0.055822397 -1.239302333  0.027811979
> colSums(tmp)
  [1] -0.767801310 -0.618196884  0.721288640 -1.161571366  1.180900538
  [6] -1.715476722 -0.863370158  0.036554079 -1.263244125  0.210323956
 [11] -0.276315786 -0.633284832 -0.038288846 -0.867940774  0.419012263
 [16]  1.013179091  1.449529352  1.388616209 -0.512694977  0.177365415
 [21]  0.153154538 -0.653875329 -0.075454086 -0.230849243  0.674915699
 [26] -1.517106699  1.749050484 -0.376060486  0.134261232  0.841115973
 [31] -0.334293667 -0.665083743  0.403890129  0.839420458  0.242362151
 [36] -0.693557542 -0.502069204 -0.861815828  0.494799734 -1.321833975
 [41] -0.733288475  0.778179288 -0.895907723  0.428964543 -0.306588427
 [46] -0.500548235  0.065404605 -2.557663343  0.994453932  0.799337414
 [51]  1.580919942 -0.757697189 -0.946544192 -0.896072758  0.954613746
 [56]  0.074704387  1.735889827 -0.516336275 -0.078021092 -0.479591047
 [61] -0.497540675 -1.072969741  1.610840770  0.305720435 -0.594291707
 [66]  0.062612018 -0.511968166 -1.195197989  1.234992063  0.300164176
 [71]  0.268102449  1.530766532 -0.047385942 -0.003980085 -0.274250644
 [76] -1.551143203 -0.425475211 -0.970005422 -0.808584127 -0.337661359
 [81] -1.255341730  0.678820811  0.005295045  2.605137814 -0.931570078
 [86] -1.842418402  1.490277303  0.632180789 -0.797288723  0.894032734
 [91]  0.506253490 -0.072104343 -0.292480617  0.146738170 -0.767042332
 [96] -0.891871803  1.112911263 -0.055822397 -1.239302333  0.027811979
> 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.767801310 -0.618196884  0.721288640 -1.161571366  1.180900538
  [6] -1.715476722 -0.863370158  0.036554079 -1.263244125  0.210323956
 [11] -0.276315786 -0.633284832 -0.038288846 -0.867940774  0.419012263
 [16]  1.013179091  1.449529352  1.388616209 -0.512694977  0.177365415
 [21]  0.153154538 -0.653875329 -0.075454086 -0.230849243  0.674915699
 [26] -1.517106699  1.749050484 -0.376060486  0.134261232  0.841115973
 [31] -0.334293667 -0.665083743  0.403890129  0.839420458  0.242362151
 [36] -0.693557542 -0.502069204 -0.861815828  0.494799734 -1.321833975
 [41] -0.733288475  0.778179288 -0.895907723  0.428964543 -0.306588427
 [46] -0.500548235  0.065404605 -2.557663343  0.994453932  0.799337414
 [51]  1.580919942 -0.757697189 -0.946544192 -0.896072758  0.954613746
 [56]  0.074704387  1.735889827 -0.516336275 -0.078021092 -0.479591047
 [61] -0.497540675 -1.072969741  1.610840770  0.305720435 -0.594291707
 [66]  0.062612018 -0.511968166 -1.195197989  1.234992063  0.300164176
 [71]  0.268102449  1.530766532 -0.047385942 -0.003980085 -0.274250644
 [76] -1.551143203 -0.425475211 -0.970005422 -0.808584127 -0.337661359
 [81] -1.255341730  0.678820811  0.005295045  2.605137814 -0.931570078
 [86] -1.842418402  1.490277303  0.632180789 -0.797288723  0.894032734
 [91]  0.506253490 -0.072104343 -0.292480617  0.146738170 -0.767042332
 [96] -0.891871803  1.112911263 -0.055822397 -1.239302333  0.027811979
> colMin(tmp)
  [1] -0.767801310 -0.618196884  0.721288640 -1.161571366  1.180900538
  [6] -1.715476722 -0.863370158  0.036554079 -1.263244125  0.210323956
 [11] -0.276315786 -0.633284832 -0.038288846 -0.867940774  0.419012263
 [16]  1.013179091  1.449529352  1.388616209 -0.512694977  0.177365415
 [21]  0.153154538 -0.653875329 -0.075454086 -0.230849243  0.674915699
 [26] -1.517106699  1.749050484 -0.376060486  0.134261232  0.841115973
 [31] -0.334293667 -0.665083743  0.403890129  0.839420458  0.242362151
 [36] -0.693557542 -0.502069204 -0.861815828  0.494799734 -1.321833975
 [41] -0.733288475  0.778179288 -0.895907723  0.428964543 -0.306588427
 [46] -0.500548235  0.065404605 -2.557663343  0.994453932  0.799337414
 [51]  1.580919942 -0.757697189 -0.946544192 -0.896072758  0.954613746
 [56]  0.074704387  1.735889827 -0.516336275 -0.078021092 -0.479591047
 [61] -0.497540675 -1.072969741  1.610840770  0.305720435 -0.594291707
 [66]  0.062612018 -0.511968166 -1.195197989  1.234992063  0.300164176
 [71]  0.268102449  1.530766532 -0.047385942 -0.003980085 -0.274250644
 [76] -1.551143203 -0.425475211 -0.970005422 -0.808584127 -0.337661359
 [81] -1.255341730  0.678820811  0.005295045  2.605137814 -0.931570078
 [86] -1.842418402  1.490277303  0.632180789 -0.797288723  0.894032734
 [91]  0.506253490 -0.072104343 -0.292480617  0.146738170 -0.767042332
 [96] -0.891871803  1.112911263 -0.055822397 -1.239302333  0.027811979
> colMedians(tmp)
  [1] -0.767801310 -0.618196884  0.721288640 -1.161571366  1.180900538
  [6] -1.715476722 -0.863370158  0.036554079 -1.263244125  0.210323956
 [11] -0.276315786 -0.633284832 -0.038288846 -0.867940774  0.419012263
 [16]  1.013179091  1.449529352  1.388616209 -0.512694977  0.177365415
 [21]  0.153154538 -0.653875329 -0.075454086 -0.230849243  0.674915699
 [26] -1.517106699  1.749050484 -0.376060486  0.134261232  0.841115973
 [31] -0.334293667 -0.665083743  0.403890129  0.839420458  0.242362151
 [36] -0.693557542 -0.502069204 -0.861815828  0.494799734 -1.321833975
 [41] -0.733288475  0.778179288 -0.895907723  0.428964543 -0.306588427
 [46] -0.500548235  0.065404605 -2.557663343  0.994453932  0.799337414
 [51]  1.580919942 -0.757697189 -0.946544192 -0.896072758  0.954613746
 [56]  0.074704387  1.735889827 -0.516336275 -0.078021092 -0.479591047
 [61] -0.497540675 -1.072969741  1.610840770  0.305720435 -0.594291707
 [66]  0.062612018 -0.511968166 -1.195197989  1.234992063  0.300164176
 [71]  0.268102449  1.530766532 -0.047385942 -0.003980085 -0.274250644
 [76] -1.551143203 -0.425475211 -0.970005422 -0.808584127 -0.337661359
 [81] -1.255341730  0.678820811  0.005295045  2.605137814 -0.931570078
 [86] -1.842418402  1.490277303  0.632180789 -0.797288723  0.894032734
 [91]  0.506253490 -0.072104343 -0.292480617  0.146738170 -0.767042332
 [96] -0.891871803  1.112911263 -0.055822397 -1.239302333  0.027811979
> colRanges(tmp)
           [,1]       [,2]      [,3]      [,4]     [,5]      [,6]       [,7]
[1,] -0.7678013 -0.6181969 0.7212886 -1.161571 1.180901 -1.715477 -0.8633702
[2,] -0.7678013 -0.6181969 0.7212886 -1.161571 1.180901 -1.715477 -0.8633702
           [,8]      [,9]    [,10]      [,11]      [,12]       [,13]      [,14]
[1,] 0.03655408 -1.263244 0.210324 -0.2763158 -0.6332848 -0.03828885 -0.8679408
[2,] 0.03655408 -1.263244 0.210324 -0.2763158 -0.6332848 -0.03828885 -0.8679408
         [,15]    [,16]    [,17]    [,18]     [,19]     [,20]     [,21]
[1,] 0.4190123 1.013179 1.449529 1.388616 -0.512695 0.1773654 0.1531545
[2,] 0.4190123 1.013179 1.449529 1.388616 -0.512695 0.1773654 0.1531545
          [,22]       [,23]      [,24]     [,25]     [,26]   [,27]      [,28]
[1,] -0.6538753 -0.07545409 -0.2308492 0.6749157 -1.517107 1.74905 -0.3760605
[2,] -0.6538753 -0.07545409 -0.2308492 0.6749157 -1.517107 1.74905 -0.3760605
         [,29]    [,30]      [,31]      [,32]     [,33]     [,34]     [,35]
[1,] 0.1342612 0.841116 -0.3342937 -0.6650837 0.4038901 0.8394205 0.2423622
[2,] 0.1342612 0.841116 -0.3342937 -0.6650837 0.4038901 0.8394205 0.2423622
          [,36]      [,37]      [,38]     [,39]     [,40]      [,41]     [,42]
[1,] -0.6935575 -0.5020692 -0.8618158 0.4947997 -1.321834 -0.7332885 0.7781793
[2,] -0.6935575 -0.5020692 -0.8618158 0.4947997 -1.321834 -0.7332885 0.7781793
          [,43]     [,44]      [,45]      [,46]      [,47]     [,48]     [,49]
[1,] -0.8959077 0.4289645 -0.3065884 -0.5005482 0.06540461 -2.557663 0.9944539
[2,] -0.8959077 0.4289645 -0.3065884 -0.5005482 0.06540461 -2.557663 0.9944539
         [,50]   [,51]      [,52]      [,53]      [,54]     [,55]      [,56]
[1,] 0.7993374 1.58092 -0.7576972 -0.9465442 -0.8960728 0.9546137 0.07470439
[2,] 0.7993374 1.58092 -0.7576972 -0.9465442 -0.8960728 0.9546137 0.07470439
       [,57]      [,58]       [,59]     [,60]      [,61]    [,62]    [,63]
[1,] 1.73589 -0.5163363 -0.07802109 -0.479591 -0.4975407 -1.07297 1.610841
[2,] 1.73589 -0.5163363 -0.07802109 -0.479591 -0.4975407 -1.07297 1.610841
         [,64]      [,65]      [,66]      [,67]     [,68]    [,69]     [,70]
[1,] 0.3057204 -0.5942917 0.06261202 -0.5119682 -1.195198 1.234992 0.3001642
[2,] 0.3057204 -0.5942917 0.06261202 -0.5119682 -1.195198 1.234992 0.3001642
         [,71]    [,72]       [,73]        [,74]      [,75]     [,76]
[1,] 0.2681024 1.530767 -0.04738594 -0.003980085 -0.2742506 -1.551143
[2,] 0.2681024 1.530767 -0.04738594 -0.003980085 -0.2742506 -1.551143
          [,77]      [,78]      [,79]      [,80]     [,81]     [,82]
[1,] -0.4254752 -0.9700054 -0.8085841 -0.3376614 -1.255342 0.6788208
[2,] -0.4254752 -0.9700054 -0.8085841 -0.3376614 -1.255342 0.6788208
           [,83]    [,84]      [,85]     [,86]    [,87]     [,88]      [,89]
[1,] 0.005295045 2.605138 -0.9315701 -1.842418 1.490277 0.6321808 -0.7972887
[2,] 0.005295045 2.605138 -0.9315701 -1.842418 1.490277 0.6321808 -0.7972887
         [,90]     [,91]       [,92]      [,93]     [,94]      [,95]      [,96]
[1,] 0.8940327 0.5062535 -0.07210434 -0.2924806 0.1467382 -0.7670423 -0.8918718
[2,] 0.8940327 0.5062535 -0.07210434 -0.2924806 0.1467382 -0.7670423 -0.8918718
        [,97]      [,98]     [,99]     [,100]
[1,] 1.112911 -0.0558224 -1.239302 0.02781198
[2,] 1.112911 -0.0558224 -1.239302 0.02781198
> 
> 
> Max(tmp2)
[1] 2.662071
> Min(tmp2)
[1] -2.280355
> mean(tmp2)
[1] -0.06823089
> Sum(tmp2)
[1] -6.823089
> Var(tmp2)
[1] 0.9942984
> 
> rowMeans(tmp2)
  [1]  0.08117436  0.59911283 -0.78729171  0.91611066  0.88572859 -1.36142844
  [7]  1.88323776 -0.45641418 -1.32167204  0.07850878  0.54339867  1.13754362
 [13]  0.26485027  0.12521441  0.14042304 -0.35839535  0.18987992 -0.58142165
 [19] -0.42683242 -0.52246560 -1.21041413 -0.61352239 -2.15184516 -1.17795512
 [25] -0.13009760  0.11534452 -0.26996638  1.24644364  1.26526013  0.46050917
 [31] -1.63228415 -0.12557043  2.46116141 -1.00911082 -0.46370092  0.61441486
 [37]  0.12826219  0.04779552  0.24083061 -0.86559131  0.62522181  0.28169693
 [43] -0.69242004 -0.11237856 -0.57432134 -1.10838940  1.72255075  0.93582518
 [49] -1.75610410  0.40063847 -0.42182146 -1.82196373  0.01768901 -0.87928185
 [55]  0.79042210 -1.17649533 -0.38005470  2.30019763 -0.87577682  0.73294821
 [61] -0.37941284  1.93468783  2.66207104 -1.68216653  0.32508696 -0.32731358
 [67] -0.02892564 -0.42173406  0.10149141  0.80344154 -0.11905103  0.33834235
 [73] -0.29084844  0.77680744  0.31321079 -1.36486028 -0.17567399  1.29960733
 [79] -0.87326369 -0.70211530  0.98177917 -1.42815545  0.18571396 -1.01248893
 [85] -0.92240775 -0.02239203  1.01817802  0.09668614 -0.87093031 -2.28035461
 [91]  0.33692259  0.30635059 -1.16096003 -0.64764379  0.23429520  0.47244370
 [97] -1.56361406 -0.29202306 -0.34131958  1.93004172
> rowSums(tmp2)
  [1]  0.08117436  0.59911283 -0.78729171  0.91611066  0.88572859 -1.36142844
  [7]  1.88323776 -0.45641418 -1.32167204  0.07850878  0.54339867  1.13754362
 [13]  0.26485027  0.12521441  0.14042304 -0.35839535  0.18987992 -0.58142165
 [19] -0.42683242 -0.52246560 -1.21041413 -0.61352239 -2.15184516 -1.17795512
 [25] -0.13009760  0.11534452 -0.26996638  1.24644364  1.26526013  0.46050917
 [31] -1.63228415 -0.12557043  2.46116141 -1.00911082 -0.46370092  0.61441486
 [37]  0.12826219  0.04779552  0.24083061 -0.86559131  0.62522181  0.28169693
 [43] -0.69242004 -0.11237856 -0.57432134 -1.10838940  1.72255075  0.93582518
 [49] -1.75610410  0.40063847 -0.42182146 -1.82196373  0.01768901 -0.87928185
 [55]  0.79042210 -1.17649533 -0.38005470  2.30019763 -0.87577682  0.73294821
 [61] -0.37941284  1.93468783  2.66207104 -1.68216653  0.32508696 -0.32731358
 [67] -0.02892564 -0.42173406  0.10149141  0.80344154 -0.11905103  0.33834235
 [73] -0.29084844  0.77680744  0.31321079 -1.36486028 -0.17567399  1.29960733
 [79] -0.87326369 -0.70211530  0.98177917 -1.42815545  0.18571396 -1.01248893
 [85] -0.92240775 -0.02239203  1.01817802  0.09668614 -0.87093031 -2.28035461
 [91]  0.33692259  0.30635059 -1.16096003 -0.64764379  0.23429520  0.47244370
 [97] -1.56361406 -0.29202306 -0.34131958  1.93004172
> rowVars(tmp2)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowSd(tmp2)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowMax(tmp2)
  [1]  0.08117436  0.59911283 -0.78729171  0.91611066  0.88572859 -1.36142844
  [7]  1.88323776 -0.45641418 -1.32167204  0.07850878  0.54339867  1.13754362
 [13]  0.26485027  0.12521441  0.14042304 -0.35839535  0.18987992 -0.58142165
 [19] -0.42683242 -0.52246560 -1.21041413 -0.61352239 -2.15184516 -1.17795512
 [25] -0.13009760  0.11534452 -0.26996638  1.24644364  1.26526013  0.46050917
 [31] -1.63228415 -0.12557043  2.46116141 -1.00911082 -0.46370092  0.61441486
 [37]  0.12826219  0.04779552  0.24083061 -0.86559131  0.62522181  0.28169693
 [43] -0.69242004 -0.11237856 -0.57432134 -1.10838940  1.72255075  0.93582518
 [49] -1.75610410  0.40063847 -0.42182146 -1.82196373  0.01768901 -0.87928185
 [55]  0.79042210 -1.17649533 -0.38005470  2.30019763 -0.87577682  0.73294821
 [61] -0.37941284  1.93468783  2.66207104 -1.68216653  0.32508696 -0.32731358
 [67] -0.02892564 -0.42173406  0.10149141  0.80344154 -0.11905103  0.33834235
 [73] -0.29084844  0.77680744  0.31321079 -1.36486028 -0.17567399  1.29960733
 [79] -0.87326369 -0.70211530  0.98177917 -1.42815545  0.18571396 -1.01248893
 [85] -0.92240775 -0.02239203  1.01817802  0.09668614 -0.87093031 -2.28035461
 [91]  0.33692259  0.30635059 -1.16096003 -0.64764379  0.23429520  0.47244370
 [97] -1.56361406 -0.29202306 -0.34131958  1.93004172
> rowMin(tmp2)
  [1]  0.08117436  0.59911283 -0.78729171  0.91611066  0.88572859 -1.36142844
  [7]  1.88323776 -0.45641418 -1.32167204  0.07850878  0.54339867  1.13754362
 [13]  0.26485027  0.12521441  0.14042304 -0.35839535  0.18987992 -0.58142165
 [19] -0.42683242 -0.52246560 -1.21041413 -0.61352239 -2.15184516 -1.17795512
 [25] -0.13009760  0.11534452 -0.26996638  1.24644364  1.26526013  0.46050917
 [31] -1.63228415 -0.12557043  2.46116141 -1.00911082 -0.46370092  0.61441486
 [37]  0.12826219  0.04779552  0.24083061 -0.86559131  0.62522181  0.28169693
 [43] -0.69242004 -0.11237856 -0.57432134 -1.10838940  1.72255075  0.93582518
 [49] -1.75610410  0.40063847 -0.42182146 -1.82196373  0.01768901 -0.87928185
 [55]  0.79042210 -1.17649533 -0.38005470  2.30019763 -0.87577682  0.73294821
 [61] -0.37941284  1.93468783  2.66207104 -1.68216653  0.32508696 -0.32731358
 [67] -0.02892564 -0.42173406  0.10149141  0.80344154 -0.11905103  0.33834235
 [73] -0.29084844  0.77680744  0.31321079 -1.36486028 -0.17567399  1.29960733
 [79] -0.87326369 -0.70211530  0.98177917 -1.42815545  0.18571396 -1.01248893
 [85] -0.92240775 -0.02239203  1.01817802  0.09668614 -0.87093031 -2.28035461
 [91]  0.33692259  0.30635059 -1.16096003 -0.64764379  0.23429520  0.47244370
 [97] -1.56361406 -0.29202306 -0.34131958  1.93004172
> 
> colMeans(tmp2)
[1] -0.06823089
> colSums(tmp2)
[1] -6.823089
> colVars(tmp2)
[1] 0.9942984
> colSd(tmp2)
[1] 0.9971451
> colMax(tmp2)
[1] 2.662071
> colMin(tmp2)
[1] -2.280355
> colMedians(tmp2)
[1] -0.0706521
> colRanges(tmp2)
          [,1]
[1,] -2.280355
[2,]  2.662071
> 
> 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] -5.9258900 -1.2179786  3.1314466 -4.5003423  2.5421424  3.3159610
 [7]  0.9393259  1.2631559 -1.8217703  2.3896769
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -3.1731551
[2,] -1.0767964
[3,] -0.5266489
[4,]  0.1004039
[5,]  1.1096511
> 
> rowApply(tmp,sum)
 [1]  2.4068781 -7.0466503 -2.7186866  0.6227041  1.1143200 -3.8936413
 [7]  2.2608008  1.4514496  4.8916857  1.0268673
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    1    5    2    9    4    9    4    2    9     1
 [2,]    5    3    6    8    5    7    2    1    5     4
 [3,]    9    4   10    3    3    2    1    9   10     9
 [4,]    7    1    4    7    1    5    6    6    2     2
 [5,]    6   10    8    4    8    1    7    3    4     8
 [6,]    8    9    3    5   10   10    5    5    7     6
 [7,]   10    8    9    1    2    3    9    8    6    10
 [8,]    4    2    7   10    6    8    8    4    1     7
 [9,]    3    7    1    6    9    6    3    7    3     3
[10,]    2    6    5    2    7    4   10   10    8     5
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1] -1.56166555  3.02198381  2.54195078 -1.52752818 -0.54649438 -1.11905807
 [7] -2.51387762 -0.30773436  1.31143081 -0.07189587 -2.14471694  2.37523428
[13]  0.73976315 -0.45825698  0.80951566  1.14156188  2.20210000 -2.01763110
[19]  3.44788799  2.17782737
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -1.5450684
[2,] -0.9870063
[3,] -0.4188440
[4,]  0.6659775
[5,]  0.7232756
> 
> rowApply(tmp,sum)
[1]  3.081666 -2.596789 -3.968952 10.951993  0.032479
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]   16    6    2    4   16
[2,]   11   17   15    8   15
[3,]   20   15   16    7    9
[4,]    4    9   10    6    7
[5,]    1    8   14   20    6
> 
> 
> as.matrix(tmp)
           [,1]      [,2]        [,3]       [,4]       [,5]        [,6]
[1,]  0.7232756 0.2462521  1.41244717 -0.7171696 -2.0243642  0.23589762
[2,] -0.9870063 1.2948339  0.32705105 -0.4494963 -0.6142063 -0.05192216
[3,] -1.5450684 0.4020353  0.49368254 -0.3020334  0.3272388 -0.73320288
[4,] -0.4188440 0.4735582  0.32181527  0.1834786  2.0992021  0.57699945
[5,]  0.6659775 0.6053043 -0.01304525 -0.2423075 -0.3343649 -1.14683010
           [,7]        [,8]       [,9]      [,10]      [,11]      [,12]
[1,]  0.3194640 -0.92162849 -0.1493236  0.6067198 -0.6135005  1.3854858
[2,]  0.1046374 -0.87113011 -1.0468221 -1.5166282 -1.7755678  2.2036704
[3,] -1.8310791 -0.03981409  1.0912647  0.8789280 -0.2343407 -1.2064771
[4,]  0.4903389  0.74678053  1.1564534  0.1396722  1.2431525 -0.7324633
[5,] -1.5972389  0.77805780  0.2598584 -0.1805876 -0.7644604  0.7250185
          [,13]        [,14]      [,15]      [,16]      [,17]      [,18]
[1,]  0.4420266  0.009729376 -0.1683384  0.1932314  0.9543982 -0.8918865
[2,] -1.8963783  0.147539452 -2.3465185  1.3093707  0.3200097 -0.1681698
[3,] -0.5013811 -1.272443018  2.1930899 -1.5340034  0.9036410 -0.5335828
[4,]  1.2401429  0.490222642  0.6565465  1.7987446  1.2918459 -0.7882612
[5,]  1.4553530  0.166694572  0.4747362 -0.6257814 -1.2677948  0.3642693
          [,19]       [,20]
[1,]  1.3537065  0.68524325
[2,]  1.1969639  2.22297986
[3,] -0.4587935 -0.06661289
[4,]  0.6338802 -0.65127222
[5,]  0.7221309 -0.01251063
> 
> 
> 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 :  564  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.4356673 -0.03251342 0.615416 -0.3111442 0.8978478 1.150559 -0.03647384
         col8      col9    col10     col11    col12     col13    col14
row1 1.067986 0.3135389 1.463345 0.9045921 1.679077 -1.834612 1.402942
          col15     col16     col17   col18     col19      col20
row1 -0.6869946 0.5469146 -2.023029 2.14316 0.2118312 -0.9396566
> tmp[,"col10"]
          col10
row1  1.4633452
row2 -1.1711050
row3 -0.3610959
row4  0.5465797
row5 -1.2586981
> tmp[c("row1","row5"),]
          col1        col2      col3       col4      col5      col6        col7
row1 0.4356673 -0.03251342  0.615416 -0.3111442 0.8978478  1.150559 -0.03647384
row5 1.3705703 -0.92879059 -1.375856  1.1891245 0.2410813 -1.077069 -0.80315291
         col8      col9     col10      col11    col12      col13      col14
row1 1.067986 0.3135389  1.463345  0.9045921 1.679077 -1.8346124 1.40294214
row5 1.351000 1.3138472 -1.258698 -0.2837885 1.030168  0.2135637 0.01662194
          col15     col16      col17      col18     col19      col20
row1 -0.6869946 0.5469146 -2.0230286  2.1431598 0.2118312 -0.9396566
row5  1.4970677 0.8441582  0.1631259 -0.3083405 1.0705643 -1.2555132
> tmp[,c("col6","col20")]
           col6      col20
row1  1.1505587 -0.9396566
row2 -0.5745443 -0.4388072
row3  1.1763571  0.6336941
row4 -0.1755717  1.7231298
row5 -1.0770692 -1.2555132
> tmp[c("row1","row5"),c("col6","col20")]
          col6      col20
row1  1.150559 -0.9396566
row5 -1.077069 -1.2555132
> 
> 
> 
> 
> tmp["row1",] <- rnorm(20,mean=10)
> tmp[,"col10"] <- rnorm(5,mean=30)
> tmp[c("row1","row5"),] <- rnorm(40,mean=50)
> tmp[,c("col6","col20")] <- rnorm(10,mean=75)
> tmp[c("row1","row5"),c("col6","col20")]  <- rnorm(4,mean=105)
> 
> tmp["row1",]
         col1     col2     col3    col4     col5     col6     col7     col8
row1 48.98683 47.75338 49.18429 49.8288 48.89505 105.0025 50.33001 50.61977
         col9    col10    col11   col12   col13    col14    col15    col16
row1 50.71227 48.54204 50.24703 48.0246 49.2587 50.92228 50.26717 51.54911
        col17    col18    col19    col20
row1 48.69856 50.54887 49.42646 103.8735
> tmp[,"col10"]
        col10
row1 48.54204
row2 30.63261
row3 27.48509
row4 30.11154
row5 50.23318
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 48.98683 47.75338 49.18429 49.82880 48.89505 105.0025 50.33001 50.61977
row5 49.18104 49.05638 49.49054 48.86748 49.64986 105.1133 50.96830 48.37449
         col9    col10    col11   col12   col13    col14    col15    col16
row1 50.71227 48.54204 50.24703 48.0246 49.2587 50.92228 50.26717 51.54911
row5 50.66999 50.23318 49.67760 50.5336 51.3438 50.51496 50.64368 48.88662
        col17    col18    col19    col20
row1 48.69856 50.54887 49.42646 103.8735
row5 49.79716 49.52042 49.49674 105.1134
> tmp[,c("col6","col20")]
          col6     col20
row1 105.00254 103.87350
row2  73.40369  76.26454
row3  74.87915  74.99368
row4  76.25727  75.05216
row5 105.11331 105.11338
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 105.0025 103.8735
row5 105.1133 105.1134
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 105.0025 103.8735
row5 105.1133 105.1134
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
          col13
[1,] -1.5006345
[2,] -0.7881285
[3,]  0.4005030
[4,]  1.2474708
[5,]  0.2142165
> tmp[,c("col17","col7")]
          col17       col7
[1,] -0.3423442  0.5230505
[2,]  0.5137795  0.2798096
[3,] -0.9814110 -1.2907212
[4,] -1.7881877  1.7272622
[5,]  0.4662988 -0.6539403
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
           col6       col20
[1,] -0.2838211  0.56086561
[2,]  0.5534844 -0.38209921
[3,] -0.3721738 -1.48794641
[4,]  0.3870425  0.09586443
[5,]  0.8034221 -1.42147088
> subBufferedMatrix(tmp,1,c("col6"))[,1]
           col1
[1,] -0.2838211
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
           col6
[1,] -0.2838211
[2,]  0.5534844
> 
> 
> 
> 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.1368405 -0.7636920  1.2638570  1.440948 -0.16156113 -0.6672212
row1 -0.2270022 -0.2872151 -0.6848701 -0.189840 -0.09160375 -1.1420499
           [,7]        [,8]       [,9]     [,10]      [,11]      [,12]
row3 -0.5256529 -0.13003034 -0.2314837 0.4820414 -1.5830071 -0.6991412
row1 -0.2016956 -0.07653061 -0.6577213 0.1447602  0.5059804 -0.9571841
          [,13]    [,14]      [,15]      [,16]      [,17]      [,18]      [,19]
row3 -1.4355649 0.985286 -0.1002534 -0.1883854 -1.5357389  0.4821495 -1.0211944
row1  0.7421085 0.127515 -0.6278977  0.9876433 -0.5807903 -0.6101704 -0.7719187
          [,20]
row3  0.4955789
row1 -0.6315091
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
           [,1]     [,2]      [,3]     [,4]     [,5]       [,6]      [,7]
row2 -0.4242777 0.384333 0.6116594 1.208837 -1.95899 -0.3905056 0.7961905
          [,8]     [,9]     [,10]
row2 0.9990417 1.658676 -1.489463
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
          [,1]       [,2]       [,3]      [,4]     [,5]       [,6]        [,7]
row5 0.1580257 -0.6952521 0.02752514 -1.835913 1.800793 -0.9770654 -0.05942014
           [,8]     [,9]      [,10]     [,11]      [,12]      [,13]      [,14]
row5 -0.7455477 2.419159 -0.6602652 -1.333984 -0.7967176 -0.8789408 -0.7159493
         [,15]    [,16]     [,17]      [,18]      [,19]     [,20]
row5 -1.570355 -1.34545 0.7005382 -0.8274246 -0.3482362 0.1699158
> 
> 
> 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: 0x2b458040>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM32e20a70af1db2"
 [2] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM32e20a1cec6dd" 
 [3] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM32e20a262f6a74"
 [4] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM32e20a299e0052"
 [5] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM32e20a3d7ee4c6"
 [6] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM32e20a3c42e5bf"
 [7] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM32e20a375d688e"
 [8] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM32e20a6f5f0619"
 [9] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM32e20a3e655d3f"
[10] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM32e20a63f0c3d3"
[11] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM32e20a4be5c7cd"
[12] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM32e20a2ed94fc1"
[13] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM32e20a68ee28bd"
[14] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM32e20a6e9e8dfd"
[15] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM32e20a234dc11" 
> 
> 
> ### 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: 0x2b3f7490>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x2b3f7490>
Warning message:
In dir.create(new.directory) :
  '/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x2b3f7490>
> rowMedians(tmp)
  [1] -0.322394718 -0.078275083  0.359385156  0.324869496  0.041567765
  [6] -0.119109337 -0.144548357 -0.122812872 -0.125941014 -0.016164839
 [11] -0.327457181 -0.195959964 -0.122063436  0.121685131 -0.406247224
 [16]  0.518721514  0.341448384  0.048246849 -0.244439982  0.125432246
 [21] -0.341238825  0.050767572  0.198046546 -0.025342893 -0.016672402
 [26] -0.117364197  0.148481616 -0.022476671 -0.314250082 -0.554309329
 [31]  0.044129760  0.624409197 -0.278916144  0.144935531  0.998844368
 [36]  0.296972816  0.591272309 -0.229674756  0.600915152  0.499842709
 [41]  0.152510405  0.342055101  0.486861175 -0.241066634 -0.085017351
 [46] -0.274461243  0.576949776  0.332158276 -0.104832066 -0.012103745
 [51]  0.112856903  0.071545301  0.096701700 -0.343593041  0.673770784
 [56] -0.299924551  0.569233481  0.038889444  0.284580561  0.207901029
 [61] -0.037046286 -0.185987600 -0.152473407  0.620695575 -0.293877188
 [66]  0.222638013  0.148720064  0.242432582 -0.072843783 -0.362350844
 [71]  0.109515157  0.032401873  0.100550122  0.214872547 -0.592258204
 [76] -0.299003182  0.304703053 -0.049056092 -0.045996743  0.315446291
 [81] -0.010699187  0.435759074 -0.102247381  0.502949895 -0.091156303
 [86] -0.160505310 -0.199489422  0.352406805 -0.598041518 -0.403943435
 [91] -0.404786960 -0.244606435  0.520013526  0.006974549 -0.180709094
 [96]  0.145304274 -0.674246789  0.238110532 -0.116884967 -0.571591108
[101]  0.262534105 -0.490318481  0.057190349 -0.231860924  0.038000376
[106]  0.125932719  0.397551600 -0.062879121  0.250503576  0.082709798
[111] -0.481450414  0.080189064 -0.336347739 -0.182102135  0.023070928
[116] -0.284036994  0.049830697 -0.317855889  0.441919593 -0.315494146
[121] -0.428734875 -0.267567476 -0.233688962  0.748995690  0.370396595
[126] -0.125539506  0.289943950 -0.817319701 -0.384273246  0.550235898
[131]  0.621734283 -0.239338862  0.288544639  0.576274275  0.261739839
[136] -0.331981121  0.071442618  0.055720628  0.875439233 -0.431861442
[141]  0.086587399 -0.253650917 -0.358766412  0.384733252 -0.059428127
[146] -0.127916819  0.004405657  0.023433053  0.172016356 -0.418352984
[151]  0.653811196 -0.456844043  0.291636092 -0.140937313  0.090957105
[156] -0.051024851  0.548347602  0.443212232 -0.398771537 -0.048177221
[161]  0.061604641 -0.338804990 -0.067494665 -0.405991538  0.299733219
[166] -0.018562166 -0.553544349 -0.580258889 -0.228921301  0.027999054
[171] -0.563772667  0.107184958  0.307298453 -0.404315971 -0.196486616
[176] -0.401930647  0.355677099 -0.120419870 -0.683517173  0.034337265
[181]  0.386236499 -0.659346349  0.122735447 -0.544985716  0.335428502
[186]  0.188607906 -0.137527488  0.356370074 -0.150968256 -0.503181586
[191] -0.285558924  0.013996660  0.098744761  0.347882976 -0.219103539
[196]  0.021300161  0.365393441 -0.220323815 -0.301677163  0.236281631
[201] -0.223472361 -0.222848500 -0.517554469 -0.167865919  0.507680135
[206]  0.327474259 -0.369283147 -0.444813878  0.123681355  0.087249405
[211]  0.561169546  0.366220028  0.124711046  0.577146129  0.539642622
[216]  0.007720149 -0.193269145  0.035221127  0.239418276  0.111041692
[221]  0.202024346 -0.158556546  0.141594008 -0.209901653  0.375769707
[226]  0.509297441 -0.321046120  0.102333984 -0.207039385 -0.258983611
> 
> proc.time()
   user  system elapsed 
  1.824   0.851   2.701 

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: 0x10358ff0>
> .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: 0x10358ff0>
> .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: 0x10358ff0>
> .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: 0x10358ff0>
> 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: 0x10263470>
> .Call("R_bm_AddColumn",P)
<pointer: 0x10263470>
> .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: 0x10263470>
> .Call("R_bm_AddColumn",P)
<pointer: 0x10263470>
> .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: 0x10263470>
> 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: 0x1023e0e0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x1023e0e0>
> .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: 0x1023e0e0>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x1023e0e0>
> .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: 0x1023e0e0>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x1023e0e0>
> .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: 0x1023e0e0>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x1023e0e0>
> .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: 0x1023e0e0>
> 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: 0xf1c5520>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0xf1c5520>
> .Call("R_bm_AddColumn",P)
<pointer: 0xf1c5520>
> .Call("R_bm_AddColumn",P)
<pointer: 0xf1c5520>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile32e25835e76a95" "BufferedMatrixFile32e258501b32f3"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile32e25835e76a95" "BufferedMatrixFile32e258501b32f3"
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x1110e030>
> .Call("R_bm_AddColumn",P)
<pointer: 0x1110e030>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x1110e030>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x1110e030>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x1110e030>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x1110e030>
> .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: 0xfad95c0>
> .Call("R_bm_AddColumn",P)
<pointer: 0xfad95c0>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0xfad95c0>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0xfad95c0>
> 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: 0x10bb9f30>
> .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: 0x10bb9f30>
> rm(P)
> 
> proc.time()
   user  system elapsed 
  0.346   0.026   0.358 

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.340   0.025   0.350 

Example timings