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

This page was generated on 2025-10-14 12:07 -0400 (Tue, 14 Oct 2025).

HostnameOSArch (*)R versionInstalled pkgs
nebbiolo2Linux (Ubuntu 24.04.3 LTS)x86_644.5.1 Patched (2025-08-23 r88802) -- "Great Square Root" 4864
lconwaymacOS 12.7.1 Montereyx86_644.5.1 Patched (2025-09-10 r88807) -- "Great Square Root" 4652
kjohnson3macOS 13.7.7 Venturaarm644.5.1 Patched (2025-09-10 r88807) -- "Great Square Root" 4597
taishanLinux (openEuler 24.03 LTS)aarch644.5.0 (2025-04-11) -- "How About a Twenty-Six" 4610
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 255/2346HostnameOS / ArchINSTALLBUILDCHECKBUILD BIN
BufferedMatrix 1.73.0  (landing page)
Ben Bolstad
Snapshot Date: 2025-10-13 13:45 -0400 (Mon, 13 Oct 2025)
git_url: https://git.bioconductor.org/packages/BufferedMatrix
git_branch: devel
git_last_commit: 0147962
git_last_commit_date: 2025-04-15 09:39:39 -0400 (Tue, 15 Apr 2025)
nebbiolo2Linux (Ubuntu 24.04.3 LTS) / x86_64  OK    OK    OK  UNNEEDED, same version is already published
lconwaymacOS 12.7.1 Monterey / x86_64  OK    OK    WARNINGS    OK  UNNEEDED, same version is already published
kjohnson3macOS 13.7.7 Ventura / arm64  OK    OK    WARNINGS    OK  UNNEEDED, same version is already published
taishanLinux (openEuler 24.03 LTS) / aarch64  OK    OK    OK  


CHECK results for BufferedMatrix on taishan

To the developers/maintainers of the BufferedMatrix package:
- Allow up to 24 hours (and sometimes 48 hours) for your latest push to git@git.bioconductor.org:packages/BufferedMatrix.git to reflect on this report. See Troubleshooting Build Report for more information.
- Use the following Renviron settings to reproduce errors and warnings.
- If 'R CMD check' started to fail recently on the Linux builder(s) over a missing dependency, add the missing dependency to 'Suggests:' in your DESCRIPTION file. See Renviron.bioc for more information.
- See Martin Grigorov's blog post for how to debug Linux ARM64 related issues on a x86_64 host.

raw results


Summary

Package: BufferedMatrix
Version: 1.73.0
Command: /home/biocbuild/R/R/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/home/biocbuild/R/R/site-library --no-vignettes --timings BufferedMatrix_1.73.0.tar.gz
StartedAt: 2025-10-14 06:18:14 -0000 (Tue, 14 Oct 2025)
EndedAt: 2025-10-14 06:18:37 -0000 (Tue, 14 Oct 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.338   0.028   0.351 

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] "Tue Oct 14 06:18:31 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] "Tue Oct 14 06:18:31 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: 0x2fdd7ff0>
> 
> 
> 
> 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] "Tue Oct 14 06:18:31 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] "Tue Oct 14 06:18:31 2025"
> 
> ColMode(tmp2)
<pointer: 0x2fdd7ff0>
> 
> 
> 
> ### 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,] 100.3436528  0.8595039 -0.8507083 -0.4779330
[2,]   2.4006578 -0.3422372  0.2392378 -1.4528520
[3,]   0.6851591 -1.9462830 -0.2333785 -0.3399717
[4,]  -0.1846319  1.7714634  0.1688249 -1.6389318
> 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 :  1.9  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
            [,1]      [,2]      [,3]      [,4]
[1,] 100.3436528 0.8595039 0.8507083 0.4779330
[2,]   2.4006578 0.3422372 0.2392378 1.4528520
[3,]   0.6851591 1.9462830 0.2333785 0.3399717
[4,]   0.1846319 1.7714634 0.1688249 1.6389318
> 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 :  1.9  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
           [,1]      [,2]      [,3]      [,4]
[1,] 10.0171679 0.9270944 0.9223385 0.6913270
[2,]  1.5494056 0.5850104 0.4891194 1.2053431
[3,]  0.8277434 1.3950925 0.4830926 0.5830709
[4,]  0.4296881 1.3309633 0.4108831 1.2802077
> 
> 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 :  1.9  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
          [,1]     [,2]     [,3]     [,4]
[1,] 225.51533 35.13045 35.07409 32.39120
[2,]  42.89471 31.19234 30.13043 38.50628
[3,]  33.96259 40.89721 30.06430 31.17068
[4,]  29.48151 40.08110 29.27766 39.44101
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x310079a0>
> exp(tmp5)
<pointer: 0x310079a0>
> log(tmp5,2)
<pointer: 0x310079a0>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 469.3806
> Min(tmp5)
[1] 53.13773
> mean(tmp5)
[1] 73.58066
> Sum(tmp5)
[1] 14716.13
> Var(tmp5)
[1] 875.063
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 90.21472 70.73417 72.65720 70.74809 72.47832 69.60516 74.51673 72.26548
 [9] 71.05680 71.52993
> rowSums(tmp5)
 [1] 1804.294 1414.683 1453.144 1414.962 1449.566 1392.103 1490.335 1445.310
 [9] 1421.136 1430.599
> rowVars(tmp5)
 [1] 8041.53848  107.29022   56.69263   85.94736  115.57499   48.11909
 [7]  108.63710   82.58178   77.93878   99.89534
> rowSd(tmp5)
 [1] 89.674626 10.358099  7.529451  9.270780 10.750581  6.936792 10.422912
 [8]  9.087452  8.828294  9.994766
> rowMax(tmp5)
 [1] 469.38062  89.27973  86.96927  87.21062  90.17564  86.34396  97.25470
 [8]  84.29500  87.28444  88.85910
> rowMin(tmp5)
 [1] 56.95666 55.10996 62.57491 53.13773 54.50826 60.34968 57.29754 54.15177
 [9] 57.17635 55.06896
> 
> colMeans(tmp5)
 [1] 113.52050  76.72345  69.49325  73.35543  69.93203  66.62919  71.90441
 [8]  68.97192  75.75733  73.29864  64.89479  69.58010  70.12053  72.77239
[15]  73.00365  69.12832  72.00485  72.88380  75.37297  72.26564
> colSums(tmp5)
 [1] 1135.2050  767.2345  694.9325  733.5543  699.3203  666.2919  719.0441
 [8]  689.7192  757.5733  732.9864  648.9479  695.8010  701.2053  727.7239
[15]  730.0365  691.2832  720.0485  728.8380  753.7297  722.6564
> colVars(tmp5)
 [1] 15721.68149    42.51740    65.54665    30.79689    95.89437    86.56012
 [7]    53.18606   145.82156   111.82149   187.09546    68.44674   118.69313
[13]   108.44340    45.13956   102.97940    68.30667   118.89558    28.55352
[19]    51.11446    47.70975
> colSd(tmp5)
 [1] 125.386130   6.520537   8.096088   5.549494   9.792567   9.303769
 [7]   7.292877  12.075660  10.574568  13.678284   8.273254  10.894637
[13]  10.413616   6.718598  10.147876   8.264785  10.903925   5.343550
[19]   7.149438   6.907224
> colMax(tmp5)
 [1] 469.38062  85.12218  87.07533  82.09129  86.25713  82.50912  82.02821
 [8]  91.44903  87.28444  97.25470  82.78518  88.05433  90.17564  82.14174
[15]  91.41732  87.21062  88.85910  81.44612  84.71512  82.53242
> colMin(tmp5)
 [1] 61.36191 64.92277 60.93760 64.87769 53.13773 55.10996 57.58947 56.09678
 [9] 56.52570 54.15177 54.50826 56.93747 55.06896 59.18612 57.99861 59.68132
[17] 55.00005 64.71903 60.28788 61.83127
> 
> 
> ### setting a random element to NA and then testing with na.rm=TRUE or na.rm=FALSE (The default)
> 
> 
> which.row <- sample(1:10,1,replace=TRUE)
> which.col  <- sample(1:20,1,replace=TRUE)
> 
> tmp5[which.row,which.col] <- NA
> 
> Max(tmp5)
[1] NA
> Min(tmp5)
[1] NA
> mean(tmp5)
[1] NA
> Sum(tmp5)
[1] NA
> Var(tmp5)
[1] NA
> 
> rowMeans(tmp5)
 [1] 90.21472 70.73417 72.65720 70.74809       NA 69.60516 74.51673 72.26548
 [9] 71.05680 71.52993
> rowSums(tmp5)
 [1] 1804.294 1414.683 1453.144 1414.962       NA 1392.103 1490.335 1445.310
 [9] 1421.136 1430.599
> rowVars(tmp5)
 [1] 8041.53848  107.29022   56.69263   85.94736  119.32161   48.11909
 [7]  108.63710   82.58178   77.93878   99.89534
> rowSd(tmp5)
 [1] 89.674626 10.358099  7.529451  9.270780 10.923443  6.936792 10.422912
 [8]  9.087452  8.828294  9.994766
> rowMax(tmp5)
 [1] 469.38062  89.27973  86.96927  87.21062        NA  86.34396  97.25470
 [8]  84.29500  87.28444  88.85910
> rowMin(tmp5)
 [1] 56.95666 55.10996 62.57491 53.13773       NA 60.34968 57.29754 54.15177
 [9] 57.17635 55.06896
> 
> colMeans(tmp5)
 [1] 113.52050  76.72345  69.49325  73.35543  69.93203  66.62919  71.90441
 [8]  68.97192  75.75733  73.29864  64.89479  69.58010  70.12053  72.77239
[15]        NA  69.12832  72.00485  72.88380  75.37297  72.26564
> colSums(tmp5)
 [1] 1135.2050  767.2345  694.9325  733.5543  699.3203  666.2919  719.0441
 [8]  689.7192  757.5733  732.9864  648.9479  695.8010  701.2053  727.7239
[15]        NA  691.2832  720.0485  728.8380  753.7297  722.6564
> colVars(tmp5)
 [1] 15721.68149    42.51740    65.54665    30.79689    95.89437    86.56012
 [7]    53.18606   145.82156   111.82149   187.09546    68.44674   118.69313
[13]   108.44340    45.13956          NA    68.30667   118.89558    28.55352
[19]    51.11446    47.70975
> colSd(tmp5)
 [1] 125.386130   6.520537   8.096088   5.549494   9.792567   9.303769
 [7]   7.292877  12.075660  10.574568  13.678284   8.273254  10.894637
[13]  10.413616   6.718598         NA   8.264785  10.903925   5.343550
[19]   7.149438   6.907224
> colMax(tmp5)
 [1] 469.38062  85.12218  87.07533  82.09129  86.25713  82.50912  82.02821
 [8]  91.44903  87.28444  97.25470  82.78518  88.05433  90.17564  82.14174
[15]        NA  87.21062  88.85910  81.44612  84.71512  82.53242
> colMin(tmp5)
 [1] 61.36191 64.92277 60.93760 64.87769 53.13773 55.10996 57.58947 56.09678
 [9] 56.52570 54.15177 54.50826 56.93747 55.06896 59.18612       NA 59.68132
[17] 55.00005 64.71903 60.28788 61.83127
> 
> Max(tmp5,na.rm=TRUE)
[1] 469.3806
> Min(tmp5,na.rm=TRUE)
[1] 53.13773
> mean(tmp5,na.rm=TRUE)
[1] 73.55222
> Sum(tmp5,na.rm=TRUE)
[1] 14636.89
> Var(tmp5,na.rm=TRUE)
[1] 879.3199
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 90.21472 70.73417 72.65720 70.74809 72.12241 69.60516 74.51673 72.26548
 [9] 71.05680 71.52993
> rowSums(tmp5,na.rm=TRUE)
 [1] 1804.294 1414.683 1453.144 1414.962 1370.326 1392.103 1490.335 1445.310
 [9] 1421.136 1430.599
> rowVars(tmp5,na.rm=TRUE)
 [1] 8041.53848  107.29022   56.69263   85.94736  119.32161   48.11909
 [7]  108.63710   82.58178   77.93878   99.89534
> rowSd(tmp5,na.rm=TRUE)
 [1] 89.674626 10.358099  7.529451  9.270780 10.923443  6.936792 10.422912
 [8]  9.087452  8.828294  9.994766
> rowMax(tmp5,na.rm=TRUE)
 [1] 469.38062  89.27973  86.96927  87.21062  90.17564  86.34396  97.25470
 [8]  84.29500  87.28444  88.85910
> rowMin(tmp5,na.rm=TRUE)
 [1] 56.95666 55.10996 62.57491 53.13773 54.50826 60.34968 57.29754 54.15177
 [9] 57.17635 55.06896
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 113.52050  76.72345  69.49325  73.35543  69.93203  66.62919  71.90441
 [8]  68.97192  75.75733  73.29864  64.89479  69.58010  70.12053  72.77239
[15]  72.31065  69.12832  72.00485  72.88380  75.37297  72.26564
> colSums(tmp5,na.rm=TRUE)
 [1] 1135.2050  767.2345  694.9325  733.5543  699.3203  666.2919  719.0441
 [8]  689.7192  757.5733  732.9864  648.9479  695.8010  701.2053  727.7239
[15]  650.7959  691.2832  720.0485  728.8380  753.7297  722.6564
> colVars(tmp5,na.rm=TRUE)
 [1] 15721.68149    42.51740    65.54665    30.79689    95.89437    86.56012
 [7]    53.18606   145.82156   111.82149   187.09546    68.44674   118.69313
[13]   108.44340    45.13956   110.44904    68.30667   118.89558    28.55352
[19]    51.11446    47.70975
> colSd(tmp5,na.rm=TRUE)
 [1] 125.386130   6.520537   8.096088   5.549494   9.792567   9.303769
 [7]   7.292877  12.075660  10.574568  13.678284   8.273254  10.894637
[13]  10.413616   6.718598  10.509474   8.264785  10.903925   5.343550
[19]   7.149438   6.907224
> colMax(tmp5,na.rm=TRUE)
 [1] 469.38062  85.12218  87.07533  82.09129  86.25713  82.50912  82.02821
 [8]  91.44903  87.28444  97.25470  82.78518  88.05433  90.17564  82.14174
[15]  91.41732  87.21062  88.85910  81.44612  84.71512  82.53242
> colMin(tmp5,na.rm=TRUE)
 [1] 61.36191 64.92277 60.93760 64.87769 53.13773 55.10996 57.58947 56.09678
 [9] 56.52570 54.15177 54.50826 56.93747 55.06896 59.18612 57.99861 59.68132
[17] 55.00005 64.71903 60.28788 61.83127
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1] 90.21472 70.73417 72.65720 70.74809      NaN 69.60516 74.51673 72.26548
 [9] 71.05680 71.52993
> rowSums(tmp5,na.rm=TRUE)
 [1] 1804.294 1414.683 1453.144 1414.962    0.000 1392.103 1490.335 1445.310
 [9] 1421.136 1430.599
> rowVars(tmp5,na.rm=TRUE)
 [1] 8041.53848  107.29022   56.69263   85.94736         NA   48.11909
 [7]  108.63710   82.58178   77.93878   99.89534
> rowSd(tmp5,na.rm=TRUE)
 [1] 89.674626 10.358099  7.529451  9.270780        NA  6.936792 10.422912
 [8]  9.087452  8.828294  9.994766
> rowMax(tmp5,na.rm=TRUE)
 [1] 469.38062  89.27973  86.96927  87.21062        NA  86.34396  97.25470
 [8]  84.29500  87.28444  88.85910
> rowMin(tmp5,na.rm=TRUE)
 [1] 56.95666 55.10996 62.57491 53.13773       NA 60.34968 57.29754 54.15177
 [9] 57.17635 55.06896
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1] 117.14353  77.04743  69.13549  73.65827  68.92393  64.86475  72.60771
 [8]  69.08797  77.89418  72.51900  66.04885  67.52741  67.89218  72.84677
[15]       NaN  69.85465  73.89427  73.04582  74.33496  73.42501
> colSums(tmp5,na.rm=TRUE)
 [1] 1054.2917  693.4269  622.2194  662.9244  620.3154  583.7828  653.4694
 [8]  621.7917  701.0477  652.6710  594.4396  607.7467  611.0296  655.6209
[15]    0.0000  628.6919  665.0484  657.4123  669.0146  660.8251
> colVars(tmp5,na.rm=TRUE)
 [1] 17539.22043    46.65119    72.30005    33.61480    96.44836    62.35622
 [7]    54.26981   163.89776    74.43029   203.64420    62.01925    86.12736
[13]    66.13666    50.71976          NA    70.90994    93.59596    31.82739
[19]    45.38213    38.55179
> colSd(tmp5,na.rm=TRUE)
 [1] 132.435722   6.830168   8.502944   5.797827   9.820813   7.896595
 [7]   7.366805  12.802256   8.627299  14.270396   7.875230   9.280483
[13]   8.132445   7.121781         NA   8.420804   9.674500   5.641577
[19]   6.736626   6.209009
> colMax(tmp5,na.rm=TRUE)
 [1] 469.38062  85.12218  87.07533  82.09129  86.25713  81.35107  82.02821
 [8]  91.44903  87.28444  97.25470  82.78518  81.28980  77.10442  82.14174
[15]      -Inf  87.21062  88.85910  81.44612  82.62756  82.53242
> colMin(tmp5,na.rm=TRUE)
 [1] 61.36191 64.92277 60.93760 64.87769 53.13773 55.10996 57.58947 56.09678
 [9] 65.19576 54.15177 57.29754 56.93747 55.06896 59.18612      Inf 59.68132
[17] 57.76017 64.71903 60.28788 68.34726
> 
> 
> 
> 
> 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] 269.8402 209.2593 298.4653 203.6309 282.6385 202.2464 197.7000 238.8359
 [9] 338.0595  88.1501
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 269.8402 209.2593 298.4653 203.6309 282.6385 202.2464 197.7000 238.8359
 [9] 338.0595  88.1501
> 
> 
> 
> 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] -5.684342e-14 -5.684342e-14 -1.421085e-14 -5.684342e-14  5.684342e-14
 [6]  5.684342e-14 -7.105427e-14 -5.684342e-14 -2.842171e-14 -5.684342e-14
[11]  2.842171e-14  2.273737e-13  1.136868e-13 -8.526513e-14  5.684342e-14
[16] -1.705303e-13 -1.136868e-13 -2.842171e-14  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)
+ }
4   13 
8   15 
5   1 
2   14 
1   17 
9   12 
1   11 
2   3 
1   8 
1   18 
1   13 
4   15 
7   3 
2   7 
5   18 
8   18 
8   6 
1   20 
4   20 
2   7 
There were 50 or more warnings (use warnings() to see the first 50)
> 
> 
> ### now test 1 by n and n by 1 matrix
> 
> 
> err.tol <- 1e-12
> 
> rm(tmp5)
> 
> dataset1 <- rnorm(100)
> dataset2 <- rnorm(100)
> 
> tmp <- createBufferedMatrix(1,100)
> tmp[1,] <- dataset1
> 
> tmp2 <- createBufferedMatrix(100,1)
> tmp2[,1] <- dataset2
> 
> 
> 
> 
> 
> Max(tmp)
[1] 2.449493
> Min(tmp)
[1] -2.685792
> mean(tmp)
[1] -0.03431915
> Sum(tmp)
[1] -3.431915
> Var(tmp)
[1] 0.9300898
> 
> rowMeans(tmp)
[1] -0.03431915
> rowSums(tmp)
[1] -3.431915
> rowVars(tmp)
[1] 0.9300898
> rowSd(tmp)
[1] 0.9644117
> rowMax(tmp)
[1] 2.449493
> rowMin(tmp)
[1] -2.685792
> 
> colMeans(tmp)
  [1] -0.896474681  0.848403334 -0.103532204 -0.925523067 -1.304793956
  [6]  0.928495481 -0.758335783 -1.318139567 -0.055756089  1.090639778
 [11]  1.438288717  1.036312596 -0.859249669  0.777540886  0.259802584
 [16] -1.249514853  0.277409423  0.762865563 -1.595429311  0.634494839
 [21] -0.832406295  1.539709388 -0.192610013 -2.142287323 -1.178741458
 [26]  0.931345719 -0.010141781  1.231586398 -0.307550190  0.048899837
 [31]  0.397946409  1.534292065  0.979682713  0.600898683  0.133094582
 [36]  0.209020656 -0.558274539 -0.681828697  0.805227425 -0.380330849
 [41] -0.925807678 -0.665993532 -0.453668732 -0.939437310  0.315521563
 [46] -0.790596868  0.329372236 -0.242884841 -0.896269617 -0.534970040
 [51]  0.245396407 -0.229229197  0.897027711 -0.847742118 -0.479715553
 [56] -0.923007655  0.780950387 -0.866836141 -0.139585718  1.331066583
 [61]  0.726997516 -0.040999402 -2.073620194  2.326967041 -1.875866918
 [66]  1.076945407 -2.685791570 -0.519152964  1.521626966  0.189955016
 [71] -0.574417817  0.492624539  1.014388469  0.972330497 -1.270643370
 [76] -0.006620303 -0.380674243 -0.834407951 -0.715763697 -0.102757390
 [81]  1.654136383  0.174339138 -0.024511784 -0.774772086 -0.971583920
 [86] -0.150703559 -0.666460114  0.635337483  0.065613783 -0.414067285
 [91] -0.706572839 -0.127397077  0.916469652  1.207053893  2.449492627
 [96] -0.855495930  0.204094088  0.510073983 -0.730049256  0.853342047
> colSums(tmp)
  [1] -0.896474681  0.848403334 -0.103532204 -0.925523067 -1.304793956
  [6]  0.928495481 -0.758335783 -1.318139567 -0.055756089  1.090639778
 [11]  1.438288717  1.036312596 -0.859249669  0.777540886  0.259802584
 [16] -1.249514853  0.277409423  0.762865563 -1.595429311  0.634494839
 [21] -0.832406295  1.539709388 -0.192610013 -2.142287323 -1.178741458
 [26]  0.931345719 -0.010141781  1.231586398 -0.307550190  0.048899837
 [31]  0.397946409  1.534292065  0.979682713  0.600898683  0.133094582
 [36]  0.209020656 -0.558274539 -0.681828697  0.805227425 -0.380330849
 [41] -0.925807678 -0.665993532 -0.453668732 -0.939437310  0.315521563
 [46] -0.790596868  0.329372236 -0.242884841 -0.896269617 -0.534970040
 [51]  0.245396407 -0.229229197  0.897027711 -0.847742118 -0.479715553
 [56] -0.923007655  0.780950387 -0.866836141 -0.139585718  1.331066583
 [61]  0.726997516 -0.040999402 -2.073620194  2.326967041 -1.875866918
 [66]  1.076945407 -2.685791570 -0.519152964  1.521626966  0.189955016
 [71] -0.574417817  0.492624539  1.014388469  0.972330497 -1.270643370
 [76] -0.006620303 -0.380674243 -0.834407951 -0.715763697 -0.102757390
 [81]  1.654136383  0.174339138 -0.024511784 -0.774772086 -0.971583920
 [86] -0.150703559 -0.666460114  0.635337483  0.065613783 -0.414067285
 [91] -0.706572839 -0.127397077  0.916469652  1.207053893  2.449492627
 [96] -0.855495930  0.204094088  0.510073983 -0.730049256  0.853342047
> 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.896474681  0.848403334 -0.103532204 -0.925523067 -1.304793956
  [6]  0.928495481 -0.758335783 -1.318139567 -0.055756089  1.090639778
 [11]  1.438288717  1.036312596 -0.859249669  0.777540886  0.259802584
 [16] -1.249514853  0.277409423  0.762865563 -1.595429311  0.634494839
 [21] -0.832406295  1.539709388 -0.192610013 -2.142287323 -1.178741458
 [26]  0.931345719 -0.010141781  1.231586398 -0.307550190  0.048899837
 [31]  0.397946409  1.534292065  0.979682713  0.600898683  0.133094582
 [36]  0.209020656 -0.558274539 -0.681828697  0.805227425 -0.380330849
 [41] -0.925807678 -0.665993532 -0.453668732 -0.939437310  0.315521563
 [46] -0.790596868  0.329372236 -0.242884841 -0.896269617 -0.534970040
 [51]  0.245396407 -0.229229197  0.897027711 -0.847742118 -0.479715553
 [56] -0.923007655  0.780950387 -0.866836141 -0.139585718  1.331066583
 [61]  0.726997516 -0.040999402 -2.073620194  2.326967041 -1.875866918
 [66]  1.076945407 -2.685791570 -0.519152964  1.521626966  0.189955016
 [71] -0.574417817  0.492624539  1.014388469  0.972330497 -1.270643370
 [76] -0.006620303 -0.380674243 -0.834407951 -0.715763697 -0.102757390
 [81]  1.654136383  0.174339138 -0.024511784 -0.774772086 -0.971583920
 [86] -0.150703559 -0.666460114  0.635337483  0.065613783 -0.414067285
 [91] -0.706572839 -0.127397077  0.916469652  1.207053893  2.449492627
 [96] -0.855495930  0.204094088  0.510073983 -0.730049256  0.853342047
> colMin(tmp)
  [1] -0.896474681  0.848403334 -0.103532204 -0.925523067 -1.304793956
  [6]  0.928495481 -0.758335783 -1.318139567 -0.055756089  1.090639778
 [11]  1.438288717  1.036312596 -0.859249669  0.777540886  0.259802584
 [16] -1.249514853  0.277409423  0.762865563 -1.595429311  0.634494839
 [21] -0.832406295  1.539709388 -0.192610013 -2.142287323 -1.178741458
 [26]  0.931345719 -0.010141781  1.231586398 -0.307550190  0.048899837
 [31]  0.397946409  1.534292065  0.979682713  0.600898683  0.133094582
 [36]  0.209020656 -0.558274539 -0.681828697  0.805227425 -0.380330849
 [41] -0.925807678 -0.665993532 -0.453668732 -0.939437310  0.315521563
 [46] -0.790596868  0.329372236 -0.242884841 -0.896269617 -0.534970040
 [51]  0.245396407 -0.229229197  0.897027711 -0.847742118 -0.479715553
 [56] -0.923007655  0.780950387 -0.866836141 -0.139585718  1.331066583
 [61]  0.726997516 -0.040999402 -2.073620194  2.326967041 -1.875866918
 [66]  1.076945407 -2.685791570 -0.519152964  1.521626966  0.189955016
 [71] -0.574417817  0.492624539  1.014388469  0.972330497 -1.270643370
 [76] -0.006620303 -0.380674243 -0.834407951 -0.715763697 -0.102757390
 [81]  1.654136383  0.174339138 -0.024511784 -0.774772086 -0.971583920
 [86] -0.150703559 -0.666460114  0.635337483  0.065613783 -0.414067285
 [91] -0.706572839 -0.127397077  0.916469652  1.207053893  2.449492627
 [96] -0.855495930  0.204094088  0.510073983 -0.730049256  0.853342047
> colMedians(tmp)
  [1] -0.896474681  0.848403334 -0.103532204 -0.925523067 -1.304793956
  [6]  0.928495481 -0.758335783 -1.318139567 -0.055756089  1.090639778
 [11]  1.438288717  1.036312596 -0.859249669  0.777540886  0.259802584
 [16] -1.249514853  0.277409423  0.762865563 -1.595429311  0.634494839
 [21] -0.832406295  1.539709388 -0.192610013 -2.142287323 -1.178741458
 [26]  0.931345719 -0.010141781  1.231586398 -0.307550190  0.048899837
 [31]  0.397946409  1.534292065  0.979682713  0.600898683  0.133094582
 [36]  0.209020656 -0.558274539 -0.681828697  0.805227425 -0.380330849
 [41] -0.925807678 -0.665993532 -0.453668732 -0.939437310  0.315521563
 [46] -0.790596868  0.329372236 -0.242884841 -0.896269617 -0.534970040
 [51]  0.245396407 -0.229229197  0.897027711 -0.847742118 -0.479715553
 [56] -0.923007655  0.780950387 -0.866836141 -0.139585718  1.331066583
 [61]  0.726997516 -0.040999402 -2.073620194  2.326967041 -1.875866918
 [66]  1.076945407 -2.685791570 -0.519152964  1.521626966  0.189955016
 [71] -0.574417817  0.492624539  1.014388469  0.972330497 -1.270643370
 [76] -0.006620303 -0.380674243 -0.834407951 -0.715763697 -0.102757390
 [81]  1.654136383  0.174339138 -0.024511784 -0.774772086 -0.971583920
 [86] -0.150703559 -0.666460114  0.635337483  0.065613783 -0.414067285
 [91] -0.706572839 -0.127397077  0.916469652  1.207053893  2.449492627
 [96] -0.855495930  0.204094088  0.510073983 -0.730049256  0.853342047
> colRanges(tmp)
           [,1]      [,2]       [,3]       [,4]      [,5]      [,6]       [,7]
[1,] -0.8964747 0.8484033 -0.1035322 -0.9255231 -1.304794 0.9284955 -0.7583358
[2,] -0.8964747 0.8484033 -0.1035322 -0.9255231 -1.304794 0.9284955 -0.7583358
         [,8]        [,9]   [,10]    [,11]    [,12]      [,13]     [,14]
[1,] -1.31814 -0.05575609 1.09064 1.438289 1.036313 -0.8592497 0.7775409
[2,] -1.31814 -0.05575609 1.09064 1.438289 1.036313 -0.8592497 0.7775409
         [,15]     [,16]     [,17]     [,18]     [,19]     [,20]      [,21]
[1,] 0.2598026 -1.249515 0.2774094 0.7628656 -1.595429 0.6344948 -0.8324063
[2,] 0.2598026 -1.249515 0.2774094 0.7628656 -1.595429 0.6344948 -0.8324063
        [,22]    [,23]     [,24]     [,25]     [,26]       [,27]    [,28]
[1,] 1.539709 -0.19261 -2.142287 -1.178741 0.9313457 -0.01014178 1.231586
[2,] 1.539709 -0.19261 -2.142287 -1.178741 0.9313457 -0.01014178 1.231586
          [,29]      [,30]     [,31]    [,32]     [,33]     [,34]     [,35]
[1,] -0.3075502 0.04889984 0.3979464 1.534292 0.9796827 0.6008987 0.1330946
[2,] -0.3075502 0.04889984 0.3979464 1.534292 0.9796827 0.6008987 0.1330946
         [,36]      [,37]      [,38]     [,39]      [,40]      [,41]      [,42]
[1,] 0.2090207 -0.5582745 -0.6818287 0.8052274 -0.3803308 -0.9258077 -0.6659935
[2,] 0.2090207 -0.5582745 -0.6818287 0.8052274 -0.3803308 -0.9258077 -0.6659935
          [,43]      [,44]     [,45]      [,46]     [,47]      [,48]      [,49]
[1,] -0.4536687 -0.9394373 0.3155216 -0.7905969 0.3293722 -0.2428848 -0.8962696
[2,] -0.4536687 -0.9394373 0.3155216 -0.7905969 0.3293722 -0.2428848 -0.8962696
        [,50]     [,51]      [,52]     [,53]      [,54]      [,55]      [,56]
[1,] -0.53497 0.2453964 -0.2292292 0.8970277 -0.8477421 -0.4797156 -0.9230077
[2,] -0.53497 0.2453964 -0.2292292 0.8970277 -0.8477421 -0.4797156 -0.9230077
         [,57]      [,58]      [,59]    [,60]     [,61]      [,62]    [,63]
[1,] 0.7809504 -0.8668361 -0.1395857 1.331067 0.7269975 -0.0409994 -2.07362
[2,] 0.7809504 -0.8668361 -0.1395857 1.331067 0.7269975 -0.0409994 -2.07362
        [,64]     [,65]    [,66]     [,67]     [,68]    [,69]    [,70]
[1,] 2.326967 -1.875867 1.076945 -2.685792 -0.519153 1.521627 0.189955
[2,] 2.326967 -1.875867 1.076945 -2.685792 -0.519153 1.521627 0.189955
          [,71]     [,72]    [,73]     [,74]     [,75]        [,76]      [,77]
[1,] -0.5744178 0.4926245 1.014388 0.9723305 -1.270643 -0.006620303 -0.3806742
[2,] -0.5744178 0.4926245 1.014388 0.9723305 -1.270643 -0.006620303 -0.3806742
         [,78]      [,79]      [,80]    [,81]     [,82]       [,83]      [,84]
[1,] -0.834408 -0.7157637 -0.1027574 1.654136 0.1743391 -0.02451178 -0.7747721
[2,] -0.834408 -0.7157637 -0.1027574 1.654136 0.1743391 -0.02451178 -0.7747721
          [,85]      [,86]      [,87]     [,88]      [,89]      [,90]
[1,] -0.9715839 -0.1507036 -0.6664601 0.6353375 0.06561378 -0.4140673
[2,] -0.9715839 -0.1507036 -0.6664601 0.6353375 0.06561378 -0.4140673
          [,91]      [,92]     [,93]    [,94]    [,95]      [,96]     [,97]
[1,] -0.7065728 -0.1273971 0.9164697 1.207054 2.449493 -0.8554959 0.2040941
[2,] -0.7065728 -0.1273971 0.9164697 1.207054 2.449493 -0.8554959 0.2040941
        [,98]      [,99]   [,100]
[1,] 0.510074 -0.7300493 0.853342
[2,] 0.510074 -0.7300493 0.853342
> 
> 
> Max(tmp2)
[1] 1.997532
> Min(tmp2)
[1] -1.891928
> mean(tmp2)
[1] -0.1382999
> Sum(tmp2)
[1] -13.82999
> Var(tmp2)
[1] 0.7819924
> 
> rowMeans(tmp2)
  [1] -1.78233588 -0.35177503  1.02641668 -0.35379968 -1.26728193 -1.00428328
  [7]  0.34858993  0.17790088  1.53982560 -0.66604709  0.48649830 -1.86329755
 [13] -1.72877617 -1.42396810 -1.81147838  0.51686376  1.36122201 -1.25133254
 [19]  0.16382246 -0.13529699 -1.09221077  1.58129862 -0.56784493 -0.55820351
 [25]  0.08110029 -0.16506415  1.59540344  1.04475143  0.21729515 -0.74621950
 [31]  1.40133519  0.22543707  0.15762005 -1.17121748  0.50332739 -0.34674968
 [37]  0.50646799  0.51606731  0.14405264 -0.15795292  0.86070813  0.92529177
 [43] -0.47264599  0.38298515 -0.02023578 -0.13087455  0.48656758  0.91607266
 [49] -1.89192822 -0.38964468  0.04517522 -0.64522106  0.21278529  0.79178904
 [55]  0.10863159 -0.84906107  0.11358876  0.23597112 -0.81182298  0.02037556
 [61]  0.29649419 -1.14797157 -1.11238133 -1.47003950 -0.44872337 -0.04623749
 [67]  0.54523905  1.47931340 -0.86051559 -0.81464547  0.72343541 -0.39800372
 [73]  0.05476529  0.45909958  0.23957304  0.42998461 -0.56181420 -0.39077602
 [79] -0.95252164 -1.68736458 -1.25674587 -0.31000745 -0.87192979 -0.32472010
 [85] -0.91128777 -0.07069007  0.13740201  0.85638260  0.46143597 -0.96026985
 [91] -0.99058951 -1.58383258  1.99753167  0.45052890 -1.17402954  1.11586489
 [97]  0.33898316  0.25537465  0.57818183 -0.94314722
> rowSums(tmp2)
  [1] -1.78233588 -0.35177503  1.02641668 -0.35379968 -1.26728193 -1.00428328
  [7]  0.34858993  0.17790088  1.53982560 -0.66604709  0.48649830 -1.86329755
 [13] -1.72877617 -1.42396810 -1.81147838  0.51686376  1.36122201 -1.25133254
 [19]  0.16382246 -0.13529699 -1.09221077  1.58129862 -0.56784493 -0.55820351
 [25]  0.08110029 -0.16506415  1.59540344  1.04475143  0.21729515 -0.74621950
 [31]  1.40133519  0.22543707  0.15762005 -1.17121748  0.50332739 -0.34674968
 [37]  0.50646799  0.51606731  0.14405264 -0.15795292  0.86070813  0.92529177
 [43] -0.47264599  0.38298515 -0.02023578 -0.13087455  0.48656758  0.91607266
 [49] -1.89192822 -0.38964468  0.04517522 -0.64522106  0.21278529  0.79178904
 [55]  0.10863159 -0.84906107  0.11358876  0.23597112 -0.81182298  0.02037556
 [61]  0.29649419 -1.14797157 -1.11238133 -1.47003950 -0.44872337 -0.04623749
 [67]  0.54523905  1.47931340 -0.86051559 -0.81464547  0.72343541 -0.39800372
 [73]  0.05476529  0.45909958  0.23957304  0.42998461 -0.56181420 -0.39077602
 [79] -0.95252164 -1.68736458 -1.25674587 -0.31000745 -0.87192979 -0.32472010
 [85] -0.91128777 -0.07069007  0.13740201  0.85638260  0.46143597 -0.96026985
 [91] -0.99058951 -1.58383258  1.99753167  0.45052890 -1.17402954  1.11586489
 [97]  0.33898316  0.25537465  0.57818183 -0.94314722
> rowVars(tmp2)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowSd(tmp2)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowMax(tmp2)
  [1] -1.78233588 -0.35177503  1.02641668 -0.35379968 -1.26728193 -1.00428328
  [7]  0.34858993  0.17790088  1.53982560 -0.66604709  0.48649830 -1.86329755
 [13] -1.72877617 -1.42396810 -1.81147838  0.51686376  1.36122201 -1.25133254
 [19]  0.16382246 -0.13529699 -1.09221077  1.58129862 -0.56784493 -0.55820351
 [25]  0.08110029 -0.16506415  1.59540344  1.04475143  0.21729515 -0.74621950
 [31]  1.40133519  0.22543707  0.15762005 -1.17121748  0.50332739 -0.34674968
 [37]  0.50646799  0.51606731  0.14405264 -0.15795292  0.86070813  0.92529177
 [43] -0.47264599  0.38298515 -0.02023578 -0.13087455  0.48656758  0.91607266
 [49] -1.89192822 -0.38964468  0.04517522 -0.64522106  0.21278529  0.79178904
 [55]  0.10863159 -0.84906107  0.11358876  0.23597112 -0.81182298  0.02037556
 [61]  0.29649419 -1.14797157 -1.11238133 -1.47003950 -0.44872337 -0.04623749
 [67]  0.54523905  1.47931340 -0.86051559 -0.81464547  0.72343541 -0.39800372
 [73]  0.05476529  0.45909958  0.23957304  0.42998461 -0.56181420 -0.39077602
 [79] -0.95252164 -1.68736458 -1.25674587 -0.31000745 -0.87192979 -0.32472010
 [85] -0.91128777 -0.07069007  0.13740201  0.85638260  0.46143597 -0.96026985
 [91] -0.99058951 -1.58383258  1.99753167  0.45052890 -1.17402954  1.11586489
 [97]  0.33898316  0.25537465  0.57818183 -0.94314722
> rowMin(tmp2)
  [1] -1.78233588 -0.35177503  1.02641668 -0.35379968 -1.26728193 -1.00428328
  [7]  0.34858993  0.17790088  1.53982560 -0.66604709  0.48649830 -1.86329755
 [13] -1.72877617 -1.42396810 -1.81147838  0.51686376  1.36122201 -1.25133254
 [19]  0.16382246 -0.13529699 -1.09221077  1.58129862 -0.56784493 -0.55820351
 [25]  0.08110029 -0.16506415  1.59540344  1.04475143  0.21729515 -0.74621950
 [31]  1.40133519  0.22543707  0.15762005 -1.17121748  0.50332739 -0.34674968
 [37]  0.50646799  0.51606731  0.14405264 -0.15795292  0.86070813  0.92529177
 [43] -0.47264599  0.38298515 -0.02023578 -0.13087455  0.48656758  0.91607266
 [49] -1.89192822 -0.38964468  0.04517522 -0.64522106  0.21278529  0.79178904
 [55]  0.10863159 -0.84906107  0.11358876  0.23597112 -0.81182298  0.02037556
 [61]  0.29649419 -1.14797157 -1.11238133 -1.47003950 -0.44872337 -0.04623749
 [67]  0.54523905  1.47931340 -0.86051559 -0.81464547  0.72343541 -0.39800372
 [73]  0.05476529  0.45909958  0.23957304  0.42998461 -0.56181420 -0.39077602
 [79] -0.95252164 -1.68736458 -1.25674587 -0.31000745 -0.87192979 -0.32472010
 [85] -0.91128777 -0.07069007  0.13740201  0.85638260  0.46143597 -0.96026985
 [91] -0.99058951 -1.58383258  1.99753167  0.45052890 -1.17402954  1.11586489
 [97]  0.33898316  0.25537465  0.57818183 -0.94314722
> 
> colMeans(tmp2)
[1] -0.1382999
> colSums(tmp2)
[1] -13.82999
> colVars(tmp2)
[1] 0.7819924
> colSd(tmp2)
[1] 0.8843034
> colMax(tmp2)
[1] 1.997532
> colMin(tmp2)
[1] -1.891928
> colMedians(tmp2)
[1] -0.03323664
> colRanges(tmp2)
          [,1]
[1,] -1.891928
[2,]  1.997532
> 
> 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]  4.3070587 -1.1054273  1.2510224 -1.2714866 -0.1769240 -0.4185938
 [7]  0.5632175 -1.9717737 -2.0860937 -4.4679238
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -2.6354746
[2,] -0.6093663
[3,]  0.7473405
[4,]  1.6823173
[5,]  2.1534991
> 
> rowApply(tmp,sum)
 [1] -0.7802659 -1.8297437  0.7925550 -0.1914169  1.3276882 -1.2547699
 [7]  2.4776842 -6.8249338 -0.2791847  1.1854633
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    1   10   10    4   10    4    9    6    8    10
 [2,]    4    4    7    7    9    5    4    4    9     1
 [3,]    7    8    1    2    8    9    2   10    3     3
 [4,]    8    5    9    8    3    8    1    7    2     5
 [5,]    6    2    8    6    2    7    6    8    7     4
 [6,]    5    9    6    5    5    3   10    5   10     2
 [7,]   10    6    5    3    7   10    3    1    5     6
 [8,]    3    7    2    1    4    1    5    9    6     9
 [9,]    9    3    4   10    6    2    7    2    1     8
[10,]    2    1    3    9    1    6    8    3    4     7
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1]  2.5205409 -4.6486878  1.7033082  0.8408589 -2.2277815 -2.0786716
 [7] -1.9698032 -0.8971124  0.3856300  0.2396651 -1.7781280  2.7742710
[13] -5.8558766 -4.3796791  2.2866348  1.6899803  3.1493922  4.2098767
[19] -1.3564430 -3.7442716
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -0.1028930
[2,]  0.2797344
[3,]  0.3333163
[4,]  0.3459403
[5,]  1.6644429
> 
> rowApply(tmp,sum)
[1]  5.6197876  0.9218978 -7.9923210 -3.4937229 -4.1919381
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]   10   20   16   12   12
[2,]    1    2    8    3   10
[3,]   18    8   11   19    8
[4,]    8   10    5   17   11
[5,]   20    6    7   14    1
> 
> 
> as.matrix(tmp)
           [,1]       [,2]        [,3]       [,4]       [,5]       [,6]
[1,]  0.2797344 -1.1142036  1.32717927  0.2018453  1.9537651 -0.5538604
[2,]  1.6644429 -1.1625351 -0.08106364  0.1005695 -0.3951197  0.7826099
[3,]  0.3333163 -0.6970024 -0.56585955 -1.0729988 -0.8878900 -1.8915868
[4,] -0.1028930 -1.4611160  1.44909170  1.2958776  0.0588919 -0.7659101
[5,]  0.3459403 -0.2138306 -0.42603957  0.3155653 -2.9574288  0.3500758
            [,7]       [,8]        [,9]      [,10]      [,11]       [,12]
[1,]  0.73567083  0.8105861 -0.03432725  0.2476959 -0.8594905  1.02013510
[2,]  0.16396593  0.7422249  1.31582912 -0.2613387 -0.9500205 -0.05816669
[3,] -2.57230830  0.2854658 -1.83598987 -0.6331578 -0.9847952  2.11183789
[4,] -0.03463545 -1.5845602  2.04410466  0.4528246  0.4935964 -0.97854757
[5,] -0.26249621 -1.1508290 -1.10398662  0.4336411  0.5225817  0.67901227
          [,13]      [,14]      [,15]      [,16]      [,17]     [,18]
[1,] -0.7694099  0.3990728  1.7878998 -0.3040369  0.3841695 0.4507926
[2,] -0.8083932 -0.9346166  0.7557511  0.8435813  1.0175776 0.2028624
[3,] -0.2945413 -1.4436917 -0.0866066 -0.6429693  0.8918918 1.1489446
[4,] -2.1447309 -0.6955671 -0.9639705 -0.3173899 -0.1802343 1.3001048
[5,] -1.8388014 -1.7048765  0.7935609  2.1107951  1.0359877 1.1071722
          [,19]       [,20]
[1,] -0.8991969  0.55576632
[2,]  0.3120296 -2.32829247
[3,]  0.9453788 -0.09975851
[4,] -1.0279120 -0.33074765
[5,] -0.6867425 -1.54123928
> 
> 
> 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 :  649  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 :  562  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.3914957 0.2044079 0.1752931 -1.072384 1.593082 -0.9544304 0.5883245
           col8     col9     col10     col11      col12     col13     col14
row1 -0.6195294 1.105155 -1.100473 -1.347613 -0.6636208 0.3645486 0.7512939
          col15   col16     col17     col18      col19     col20
row1 -0.7281325 1.40188 0.4290291 0.4731742 -0.4511863 0.2621594
> tmp[,"col10"]
          col10
row1 -1.1004728
row2  1.0758878
row3 -0.6039554
row4  1.5021798
row5  1.5643672
> tmp[c("row1","row5"),]
            col1       col2       col3       col4       col5       col6
row1  0.39149573  0.2044079  0.1752931 -1.0723837  1.5930816 -0.9544304
row5 -0.04803393 -0.1127656 -0.8267461  0.6552131 -0.5059579 -0.8051729
          col7       col8        col9     col10      col11      col12
row1 0.5883245 -0.6195294  1.10515546 -1.100473 -1.3476127 -0.6636208
row5 0.3695283 -2.4315047 -0.01367348  1.564367  0.5035464 -2.0538244
          col13     col14      col15     col16     col17      col18      col19
row1  0.3645486 0.7512939 -0.7281325 1.4018795 0.4290291  0.4731742 -0.4511863
row5 -0.2602846 0.9090912 -0.2747218 0.1601826 0.4951165 -0.4153219 -0.3290511
         col20
row1 0.2621594
row5 0.1680099
> tmp[,c("col6","col20")]
           col6      col20
row1 -0.9544304  0.2621594
row2 -0.7163792  0.4575405
row3  1.6962437 -2.6857001
row4  0.4345320 -2.5731750
row5 -0.8051729  0.1680099
> tmp[c("row1","row5"),c("col6","col20")]
           col6     col20
row1 -0.9544304 0.2621594
row5 -0.8051729 0.1680099
> 
> 
> 
> 
> 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 51.54921 50.33266 51.09856 48.90576 49.07451 104.4867 50.30271 49.00131
         col9    col10    col11    col12    col13    col14   col15    col16
row1 49.01373 49.73682 49.49871 51.09105 50.81253 51.19929 51.5962 47.95718
        col17    col18    col19    col20
row1 50.63989 50.09649 51.19015 104.8116
> tmp[,"col10"]
        col10
row1 49.73682
row2 30.62467
row3 31.41172
row4 30.14158
row5 49.87994
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 51.54921 50.33266 51.09856 48.90576 49.07451 104.4867 50.30271 49.00131
row5 51.26715 49.20436 51.49630 51.09682 49.33674 104.5248 51.00009 49.14508
         col9    col10    col11    col12    col13    col14    col15    col16
row1 49.01373 49.73682 49.49871 51.09105 50.81253 51.19929 51.59620 47.95718
row5 50.78968 49.87994 49.79645 50.06684 50.82389 50.09691 50.25044 50.65127
        col17    col18    col19    col20
row1 50.63989 50.09649 51.19015 104.8116
row5 47.48884 49.86753 48.77568 105.4148
> tmp[,c("col6","col20")]
          col6     col20
row1 104.48665 104.81161
row2  76.36303  75.83929
row3  74.66407  75.73796
row4  76.18183  72.81048
row5 104.52484 105.41482
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 104.4867 104.8116
row5 104.5248 105.4148
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 104.4867 104.8116
row5 104.5248 105.4148
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
           col13
[1,]  0.33179573
[2,]  0.67764901
[3,]  0.62594127
[4,] -0.09824845
[5,]  1.01349305
> tmp[,c("col17","col7")]
           col17       col7
[1,]  0.02094585 -1.6121664
[2,]  0.99485143  0.1510008
[3,]  0.37851645  1.3785600
[4,]  0.18487473  0.6380561
[5,] -1.74831053  2.4327650
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
            col6      col20
[1,] -1.82943289  0.1198586
[2,]  0.08883318 -0.1786875
[3,] -0.13840073 -0.8106906
[4,] -0.96971736 -0.4744447
[5,]  0.86924354  1.9047850
> subBufferedMatrix(tmp,1,c("col6"))[,1]
          col1
[1,] -1.829433
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
            col6
[1,] -1.82943289
[2,]  0.08883318
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> 
> 
> 
> subBufferedMatrix(tmp,c("row3","row1"),)[,1:20]
           [,1]       [,2]       [,3]       [,4]      [,5]       [,6]      [,7]
row3 -1.5593542  0.5946017  0.4203288 -0.8376565 1.1134756  0.7761517 0.1579833
row1  0.5966549 -1.1836608 -0.7685776 -2.0144331 0.2153279 -0.9412431 0.4984014
           [,8]       [,9]      [,10]     [,11]     [,12]     [,13]      [,14]
row3 -0.0846790 -0.8641314 0.06609554 0.9206397 0.7609034 0.7010642 -0.2146124
row1 -0.4066256 -0.9321793 1.67611291 0.2048214 1.4205702 0.8113697 -1.3377844
          [,15]      [,16]       [,17]      [,18]      [,19]     [,20]
row3 -0.8743239 -0.4258637 -0.19981938  0.9557065  0.8096210 1.0789016
row1 -0.7015591  0.1856771 -0.07423116 -0.3242001 -0.7175869 0.2242675
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
          [,1]       [,2]      [,3]        [,4]      [,5]       [,6]      [,7]
row2 0.5869734 0.07775291 -1.367383 0.001226787 -2.482617 -0.1300483 0.4456459
           [,8]       [,9]     [,10]
row2 -0.8403859 0.01216401 0.8404826
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
         [,1]      [,2]     [,3]       [,4]     [,5]       [,6]      [,7]
row5 1.374313 -1.025271 1.212447 -0.2101212 1.191092 -0.7730937 0.6126637
           [,8]      [,9]      [,10]      [,11]      [,12]     [,13]    [,14]
row5 -0.7915757 0.3561089 -0.6897195 0.06601959 -0.5788664 0.5615594 2.329103
         [,15]      [,16]    [,17]     [,18]     [,19]     [,20]
row5 0.6360383 -0.2112118 0.154011 0.1364543 -0.405881 0.9087585
> 
> 
> 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: 0x30d113f0>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM8f31c392958d3"
 [2] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM8f31c45f0417" 
 [3] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM8f31c266c92c5"
 [4] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM8f31c567ddbc3"
 [5] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM8f31c45ad8ff6"
 [6] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM8f31cb3f5372" 
 [7] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM8f31c459f97d1"
 [8] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM8f31c7f153292"
 [9] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM8f31c69788b96"
[10] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM8f31c26a25a30"
[11] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM8f31c1483385" 
[12] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM8f31c1cd77aac"
[13] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM8f31c7683b5a3"
[14] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM8f31c38d04578"
[15] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM8f31c2acf6e4c"
> 
> 
> ### 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: 0x2ec83c00>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x2ec83c00>
Warning message:
In dir.create(new.directory) :
  '/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x2ec83c00>
> rowMedians(tmp)
  [1]  0.050783479  0.012491393  0.016001554  0.456666844 -0.210373696
  [6]  0.365946972  0.347427258  0.273834637 -0.095298591  0.055045390
 [11] -0.211413065  0.133188832  0.210526295 -0.085339659  0.077105929
 [16]  0.217548598  0.110573012 -0.386243564  0.095682070 -0.021156254
 [21] -0.164742868  0.285528461  0.051246289 -0.028542932  0.205789053
 [26]  0.274270342  0.145185200 -0.656261304  0.602392440 -0.148497475
 [31]  0.782105415 -0.521250133 -0.103746217 -0.354665041  0.112302176
 [36]  0.018634995 -0.476450659  0.183519534 -0.019274086 -0.327021547
 [41]  0.221478060  0.066890782 -0.129774093  0.025368606  0.288814835
 [46] -0.166612502 -0.290944444  0.169453887 -0.344229831 -0.090972989
 [51] -0.320127241  0.773919602 -0.044845115 -0.153168344 -0.159554681
 [56] -0.111940708  0.339134283 -0.017217101 -0.436060368 -0.172755914
 [61] -0.565965310 -0.574634515 -0.504799973  0.388245407 -0.188182896
 [66] -0.084193761  0.142660036 -0.373849970 -0.211196348 -0.124550057
 [71]  0.488044480  0.512923039  0.044962443  0.656386549  0.198885542
 [76]  0.376959392  0.227491756 -0.241714071  0.592835899  0.377559854
 [81]  0.009501843  0.311269910  0.324031648  0.211236903 -0.289045952
 [86]  0.267042575  0.169272086  0.232974083 -0.126027769 -0.301146835
 [91]  0.275050368  0.219432752  0.419503631 -0.670310440  0.185718693
 [96]  0.047687756  0.137730329 -0.008011231  0.183269867  0.002392454
[101] -0.172842144  0.051904213 -0.219232284  0.442209430 -0.031448282
[106] -0.208925601  0.293070964 -0.553073713  0.382738229 -0.033117549
[111]  0.152405626 -0.484286323 -0.108458749  0.291980659 -0.136454741
[116]  0.251146562 -0.252331113  0.360650739  0.508941916  0.400176099
[121] -0.713897295 -0.190480045  0.157050300  0.413853192 -0.178632027
[126]  0.050257989 -0.199536505 -0.465738653  0.168366601 -0.117314284
[131]  0.528736788  0.195531598 -0.326963204 -0.488433292 -0.179586267
[136]  0.679336197  0.128787864  0.355721094  0.290383460 -0.148888562
[141] -0.212999678 -0.375618737  0.289394562  0.078143032  0.092818106
[146]  0.077680922  0.473445879 -0.754785223 -0.170977322  0.218865524
[151]  0.341453555 -0.042314535  0.473804546  0.042168573 -0.177413963
[156] -0.081594747  0.571657833 -0.506055038  0.075215674 -0.604250557
[161]  0.215018216 -0.095934201  0.272210348 -0.218009840 -0.245184501
[166] -0.513446051  0.056328119 -0.621476908 -0.271129886 -0.422389809
[171] -0.571655713  0.357481185 -0.176292469  0.016268645 -0.329409009
[176] -0.255789084 -0.228788805 -0.546937444  0.003236418 -0.612473671
[181] -0.017883909  0.090818710  0.081130542  0.390296524  0.198356171
[186] -0.165432892 -0.173433938 -0.413696142  0.202787879 -0.021016180
[191]  0.196625289 -0.282706016 -0.143192707  0.175225131  0.141831666
[196]  0.163423941 -0.493235638 -0.095986046 -0.335972782 -1.089195460
[201] -0.276977275  0.451831827  0.638662862  0.305289548 -0.603254413
[206]  0.078799285 -0.331463217  0.601091390  0.196167505  0.150586129
[211]  0.259882375 -0.029810416  0.081716674 -0.106855359  0.361307507
[216]  0.406788174  0.126959471 -0.517787408 -0.099565691  0.194205096
[221]  0.023384896  0.472749599 -0.366478615  0.147082837 -0.008325349
[226]  0.200936684 -0.067552270  0.041139698 -0.004129285  0.298392816
> 
> proc.time()
   user  system elapsed 
  1.903   0.840   2.768 

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: 0x2e1fbff0>
> .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: 0x2e1fbff0>
> .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: 0x2e1fbff0>
> .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: 0x2e1fbff0>
> 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: 0x2e106470>
> .Call("R_bm_AddColumn",P)
<pointer: 0x2e106470>
> .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: 0x2e106470>
> .Call("R_bm_AddColumn",P)
<pointer: 0x2e106470>
> .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: 0x2e106470>
> 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: 0x2e0e10e0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x2e0e10e0>
> .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: 0x2e0e10e0>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x2e0e10e0>
> .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: 0x2e0e10e0>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x2e0e10e0>
> .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: 0x2e0e10e0>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x2e0e10e0>
> .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: 0x2e0e10e0>
> 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: 0x2d068520>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x2d068520>
> .Call("R_bm_AddColumn",P)
<pointer: 0x2d068520>
> .Call("R_bm_AddColumn",P)
<pointer: 0x2d068520>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile8f363151f245"  "BufferedMatrixFile8f36351499968"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile8f363151f245"  "BufferedMatrixFile8f36351499968"
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x2efb1030>
> .Call("R_bm_AddColumn",P)
<pointer: 0x2efb1030>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x2efb1030>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x2efb1030>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x2efb1030>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x2efb1030>
> .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: 0x2d97c5c0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x2d97c5c0>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x2d97c5c0>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x2d97c5c0>
> 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: 0x2ea5cf30>
> .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: 0x2ea5cf30>
> rm(P)
> 
> proc.time()
   user  system elapsed 
  0.345   0.038   0.368 

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.310   0.059   0.355 

Example timings