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

This page was generated on 2025-10-04 12:03 -0400 (Sat, 04 Oct 2025).

HostnameOSArch (*)R versionInstalled pkgs
nebbiolo2Linux (Ubuntu 24.04.3 LTS)x86_644.5.1 Patched (2025-08-23 r88802) -- "Great Square Root" 4853
lconwaymacOS 12.7.1 Montereyx86_644.5.1 Patched (2025-09-10 r88807) -- "Great Square Root" 4640
kjohnson3macOS 13.7.7 Venturaarm644.5.1 Patched (2025-09-10 r88807) -- "Great Square Root" 4585
taishanLinux (openEuler 24.03 LTS)aarch644.5.0 (2025-04-11) -- "How About a Twenty-Six" 4576
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/2341HostnameOS / ArchINSTALLBUILDCHECKBUILD BIN
BufferedMatrix 1.73.0  (landing page)
Ben Bolstad
Snapshot Date: 2025-10-03 13:45 -0400 (Fri, 03 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 nebbiolo2

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

raw results


Summary

Package: BufferedMatrix
Version: 1.73.0
Command: /home/biocbuild/bbs-3.22-bioc/R/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/home/biocbuild/bbs-3.22-bioc/R/site-library --timings BufferedMatrix_1.73.0.tar.gz
StartedAt: 2025-10-03 21:45:28 -0400 (Fri, 03 Oct 2025)
EndedAt: 2025-10-03 21:46:03 -0400 (Fri, 03 Oct 2025)
EllapsedTime: 35.1 seconds
RetCode: 0
Status:   OK  
CheckDir: BufferedMatrix.Rcheck
Warnings: 0

Command output

##############################################################################
##############################################################################
###
### Running command:
###
###   /home/biocbuild/bbs-3.22-bioc/R/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/home/biocbuild/bbs-3.22-bioc/R/site-library --timings BufferedMatrix_1.73.0.tar.gz
###
##############################################################################
##############################################################################


* using log directory ‘/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck’
* using R version 4.5.1 Patched (2025-08-23 r88802)
* using platform: x86_64-pc-linux-gnu
* R was compiled by
    gcc (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0
    GNU Fortran (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0
* running under: Ubuntu 24.04.3 LTS
* using session charset: UTF-8
* 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: ‘gcc (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.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 re-building of vignette outputs ... OK
* 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/bbs-3.22-bioc/R/bin/R CMD INSTALL BufferedMatrix
###
##############################################################################
##############################################################################


* installing to library ‘/home/biocbuild/bbs-3.22-bioc/R/site-library’
* installing *source* package ‘BufferedMatrix’ ...
** this is package ‘BufferedMatrix’ version ‘1.73.0’
** using staged installation
** libs
using C compiler: ‘gcc (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0’
gcc -std=gnu2x -I"/home/biocbuild/bbs-3.22-bioc/R/include" -DNDEBUG   -I/usr/local/include    -fpic  -g -O2  -Wall -Werror=format-security -c RBufferedMatrix.c -o RBufferedMatrix.o
gcc -std=gnu2x -I"/home/biocbuild/bbs-3.22-bioc/R/include" -DNDEBUG   -I/usr/local/include    -fpic  -g -O2  -Wall -Werror=format-security -c doubleBufferedMatrix.c -o doubleBufferedMatrix.o
doubleBufferedMatrix.c: In function ‘dbm_ReadOnlyMode’:
doubleBufferedMatrix.c:1580:7: warning: suggest parentheses around operand of ‘!’ or change ‘&’ to ‘&&’ or ‘!’ to ‘~’ [-Wparentheses]
 1580 |   if (!(Matrix->readonly) & setting){
      |       ^~~~~~~~~~~~~~~~~~~
doubleBufferedMatrix.c: At top level:
doubleBufferedMatrix.c:3327:12: warning: ‘sort_double’ defined but not used [-Wunused-function]
 3327 | static int sort_double(const double *a1,const double *a2){
      |            ^~~~~~~~~~~
gcc -std=gnu2x -I"/home/biocbuild/bbs-3.22-bioc/R/include" -DNDEBUG   -I/usr/local/include    -fpic  -g -O2  -Wall -Werror=format-security -c doubleBufferedMatrix_C_tests.c -o doubleBufferedMatrix_C_tests.o
gcc -std=gnu2x -I"/home/biocbuild/bbs-3.22-bioc/R/include" -DNDEBUG   -I/usr/local/include    -fpic  -g -O2  -Wall -Werror=format-security -c init_package.c -o init_package.o
gcc -std=gnu2x -shared -L/home/biocbuild/bbs-3.22-bioc/R/lib -L/usr/local/lib -o BufferedMatrix.so RBufferedMatrix.o doubleBufferedMatrix.o doubleBufferedMatrix_C_tests.o init_package.o -L/home/biocbuild/bbs-3.22-bioc/R/lib -lR
installing to /home/biocbuild/bbs-3.22-bioc/R/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.1 Patched (2025-08-23 r88802) -- "Great Square Root"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: x86_64-pc-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.299   0.054   0.368 

BufferedMatrix.Rcheck/tests/objectTesting.Rout


R version 4.5.1 Patched (2025-08-23 r88802) -- "Great Square Root"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: x86_64-pc-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 478419 25.6    1047111   56   639600 34.2
Vcells 885237  6.8    8388608   64  2081604 15.9
> 
> 
> 
> 
> ##
> ## checking reads
> ##
> 
> tmp2 <- createBufferedMatrix(10,20)
> 
> test.sample <- rnorm(10*20)
> 
> tmp2[1:10,1:20] <- test.sample
> 
> test.matrix <- matrix(test.sample,10,20)
> 
> ## testing reads
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   which.col <- sample(1:20,1)
+   if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> date()
[1] "Fri Oct  3 21:45:49 2025"
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> date()
[1] "Fri Oct  3 21:45:49 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: 0x5d5db5dccc80>
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   which.col <- sample(1:20,1)
+   if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,5,replace=TRUE)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> date()
[1] "Fri Oct  3 21:45:50 2025"
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col <- sample(1:20,5,replace=TRUE)
+   if (!all(tmp2[which.row,which.col] == test.matrix[which.row,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> date()
[1] "Fri Oct  3 21:45:50 2025"
> 
> ColMode(tmp2)
<pointer: 0x5d5db5dccc80>
> 
> 
> 
> ### Now testing assignments
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+ 
+   new.data <- rnorm(20)
+   tmp2[which.row,] <- new.data
+   test.matrix[which.row,] <- new.data
+   if (rep > 1){
+     if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+   
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   new.data <- rnorm(10)
+   tmp2[,which.col] <- new.data
+   test.matrix[,which.col]<- new.data
+ 
+   if (rep > 1){
+     if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.col <- which.col
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,5,replace=TRUE)
+   new.data <- matrix(rnorm(50),5,10)
+   tmp2[,which.col] <- new.data
+   test.matrix[,which.col]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.col <- which.col
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   new.data <- matrix(rnorm(50),5,10)
+   tmp2[which.row,] <- new.data
+   test.matrix[which.row,]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col  <- sample(1:20,5,replace=TRUE)
+   new.data <- matrix(rnorm(25),5,5)
+   tmp2[which.row,which.col] <- new.data
+   test.matrix[which.row,which.col]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[prev.row,prev.col] == test.matrix[prev.row,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+   prev.col <- which.col
+ }
> 
> 
> 
> 
> ###
> ###
> ### testing some more functions
> ###
> 
> 
> 
> ## duplication function
> tmp5 <- duplicate(tmp2)
> 
> # making sure really did copy everything.
> tmp5[1,1] <- tmp5[1,1] +100.00
> 
> if (tmp5[1,1] == tmp2[1,1]){
+   stop("Problem with duplication")
+ }
> 
> 
> 
> 
> ### testing elementwise applying of functions
> 
> tmp5[1:4,1:4]
            [,1]       [,2]        [,3]       [,4]
[1,] 101.3679747 -0.8087479 -0.06120112 -1.1737393
[2,]   0.6588794 -0.7768854  0.65514369 -0.7839195
[3,]   0.2854527 -1.4388185  1.56606708  0.5028167
[4,]   1.0682517  0.3390691  0.13146958 -1.4781108
> ewApply(tmp5,abs)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
            [,1]      [,2]       [,3]      [,4]
[1,] 101.3679747 0.8087479 0.06120112 1.1737393
[2,]   0.6588794 0.7768854 0.65514369 0.7839195
[3,]   0.2854527 1.4388185 1.56606708 0.5028167
[4,]   1.0682517 0.3390691 0.13146958 1.4781108
> ewApply(tmp5,sqrt)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
           [,1]      [,2]      [,3]      [,4]
[1,] 10.0681664 0.8993041 0.2473886 1.0833925
[2,]  0.8117139 0.8814110 0.8094095 0.8853923
[3,]  0.5342777 1.1995076 1.2514260 0.7090957
[4,]  1.0335626 0.5822964 0.3625873 1.2157758
> 
> my.function <- function(x,power){
+   (x+5)^power
+ }
> 
> ewApply(tmp5,my.function,power=2)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
          [,1]     [,2]     [,3]     [,4]
[1,] 227.04964 34.80179 27.53509 37.00766
[2,]  33.77602 34.59100 33.74924 34.63784
[3,]  30.62823 38.43389 39.08033 32.59377
[4,]  36.40388 31.16203 28.75734 38.63587
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x5d5db660a260>
> exp(tmp5)
<pointer: 0x5d5db660a260>
> log(tmp5,2)
<pointer: 0x5d5db660a260>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 472.5741
> Min(tmp5)
[1] 52.60758
> mean(tmp5)
[1] 73.61719
> Sum(tmp5)
[1] 14723.44
> Var(tmp5)
[1] 873.984
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 91.53006 70.46664 69.68858 70.45119 72.16133 71.84110 71.10736 72.68631
 [9] 75.23927 71.00002
> rowSums(tmp5)
 [1] 1830.601 1409.333 1393.772 1409.024 1443.227 1436.822 1422.147 1453.726
 [9] 1504.785 1420.000
> rowVars(tmp5)
 [1] 8125.21157   73.34323   74.37600   63.06628   81.74177   59.66174
 [7]  102.85865   89.09264   39.57760   46.82446
> rowSd(tmp5)
 [1] 90.139955  8.564066  8.624152  7.941428  9.041116  7.724101 10.141926
 [8]  9.438890  6.291073  6.842840
> rowMax(tmp5)
 [1] 472.57408  90.94285  81.34058  87.85065  89.67801  86.38056  90.23052
 [8]  90.28305  83.89547  81.82517
> rowMin(tmp5)
 [1] 57.31068 54.81102 55.82268 57.31123 52.60758 58.51629 54.69120 56.74995
 [9] 59.42843 58.48123
> 
> colMeans(tmp5)
 [1] 110.93397  74.18399  70.67889  74.13232  78.45001  70.98086  74.76862
 [8]  71.40598  73.17989  72.35435  71.88615  69.85583  71.51624  65.03777
[15]  70.80018  72.70865  68.13784  71.79447  71.45581  68.08192
> colSums(tmp5)
 [1] 1109.3397  741.8399  706.7889  741.3232  784.5001  709.8086  747.6862
 [8]  714.0598  731.7989  723.5435  718.8615  698.5583  715.1624  650.3777
[15]  708.0018  727.0865  681.3784  717.9447  714.5581  680.8192
> colVars(tmp5)
 [1] 16244.04917    69.08400   100.91419    38.38861    68.69036    63.15312
 [7]    54.45574    28.46121    18.20819    69.90076    82.69957    67.26809
[13]    89.00018    48.32021   127.47955    94.51414    87.42480    90.64213
[19]    66.41746    23.85114
> colSd(tmp5)
 [1] 127.452145   8.311679  10.045606   6.195855   8.287965   7.946894
 [7]   7.379414   5.334905   4.267105   8.360667   9.093930   8.201712
[13]   9.433991   6.951274  11.290684   9.721838   9.350123   9.520616
[19]   8.149691   4.883763
> colMax(tmp5)
 [1] 472.57408  89.67801  90.23052  83.89547  90.94285  81.82517  85.66789
 [8]  79.67979  78.07269  84.68501  86.53598  81.22020  80.86539  73.51008
[15]  87.85065  90.72916  80.74316  84.78933  80.60351  78.31531
> colMin(tmp5)
 [1] 56.74995 61.80158 57.31068 66.64751 64.44071 58.86230 62.55767 63.00178
 [9] 66.51810 61.52891 57.46732 60.27383 52.60758 54.81102 56.35382 61.16822
[17] 54.69120 59.46031 57.60903 61.40163
> 
> 
> ### 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] 91.53006 70.46664 69.68858       NA 72.16133 71.84110 71.10736 72.68631
 [9] 75.23927 71.00002
> rowSums(tmp5)
 [1] 1830.601 1409.333 1393.772       NA 1443.227 1436.822 1422.147 1453.726
 [9] 1504.785 1420.000
> rowVars(tmp5)
 [1] 8125.21157   73.34323   74.37600   48.86580   81.74177   59.66174
 [7]  102.85865   89.09264   39.57760   46.82446
> rowSd(tmp5)
 [1] 90.139955  8.564066  8.624152  6.990408  9.041116  7.724101 10.141926
 [8]  9.438890  6.291073  6.842840
> rowMax(tmp5)
 [1] 472.57408  90.94285  81.34058        NA  89.67801  86.38056  90.23052
 [8]  90.28305  83.89547  81.82517
> rowMin(tmp5)
 [1] 57.31068 54.81102 55.82268       NA 52.60758 58.51629 54.69120 56.74995
 [9] 59.42843 58.48123
> 
> colMeans(tmp5)
 [1] 110.93397  74.18399  70.67889  74.13232  78.45001  70.98086  74.76862
 [8]  71.40598  73.17989  72.35435  71.88615  69.85583  71.51624  65.03777
[15]        NA  72.70865  68.13784  71.79447  71.45581  68.08192
> colSums(tmp5)
 [1] 1109.3397  741.8399  706.7889  741.3232  784.5001  709.8086  747.6862
 [8]  714.0598  731.7989  723.5435  718.8615  698.5583  715.1624  650.3777
[15]        NA  727.0865  681.3784  717.9447  714.5581  680.8192
> colVars(tmp5)
 [1] 16244.04917    69.08400   100.91419    38.38861    68.69036    63.15312
 [7]    54.45574    28.46121    18.20819    69.90076    82.69957    67.26809
[13]    89.00018    48.32021          NA    94.51414    87.42480    90.64213
[19]    66.41746    23.85114
> colSd(tmp5)
 [1] 127.452145   8.311679  10.045606   6.195855   8.287965   7.946894
 [7]   7.379414   5.334905   4.267105   8.360667   9.093930   8.201712
[13]   9.433991   6.951274         NA   9.721838   9.350123   9.520616
[19]   8.149691   4.883763
> colMax(tmp5)
 [1] 472.57408  89.67801  90.23052  83.89547  90.94285  81.82517  85.66789
 [8]  79.67979  78.07269  84.68501  86.53598  81.22020  80.86539  73.51008
[15]        NA  90.72916  80.74316  84.78933  80.60351  78.31531
> colMin(tmp5)
 [1] 56.74995 61.80158 57.31068 66.64751 64.44071 58.86230 62.55767 63.00178
 [9] 66.51810 61.52891 57.46732 60.27383 52.60758 54.81102       NA 61.16822
[17] 54.69120 59.46031 57.60903 61.40163
> 
> Max(tmp5,na.rm=TRUE)
[1] 472.5741
> Min(tmp5,na.rm=TRUE)
[1] 52.60758
> mean(tmp5,na.rm=TRUE)
[1] 73.54566
> Sum(tmp5,na.rm=TRUE)
[1] 14635.59
> Var(tmp5,na.rm=TRUE)
[1] 877.3698
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 91.53006 70.46664 69.68858 69.53543 72.16133 71.84110 71.10736 72.68631
 [9] 75.23927 71.00002
> rowSums(tmp5,na.rm=TRUE)
 [1] 1830.601 1409.333 1393.772 1321.173 1443.227 1436.822 1422.147 1453.726
 [9] 1504.785 1420.000
> rowVars(tmp5,na.rm=TRUE)
 [1] 8125.21157   73.34323   74.37600   48.86580   81.74177   59.66174
 [7]  102.85865   89.09264   39.57760   46.82446
> rowSd(tmp5,na.rm=TRUE)
 [1] 90.139955  8.564066  8.624152  6.990408  9.041116  7.724101 10.141926
 [8]  9.438890  6.291073  6.842840
> rowMax(tmp5,na.rm=TRUE)
 [1] 472.57408  90.94285  81.34058  80.41550  89.67801  86.38056  90.23052
 [8]  90.28305  83.89547  81.82517
> rowMin(tmp5,na.rm=TRUE)
 [1] 57.31068 54.81102 55.82268 57.31123 52.60758 58.51629 54.69120 56.74995
 [9] 59.42843 58.48123
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 110.93397  74.18399  70.67889  74.13232  78.45001  70.98086  74.76862
 [8]  71.40598  73.17989  72.35435  71.88615  69.85583  71.51624  65.03777
[15]  68.90569  72.70865  68.13784  71.79447  71.45581  68.08192
> colSums(tmp5,na.rm=TRUE)
 [1] 1109.3397  741.8399  706.7889  741.3232  784.5001  709.8086  747.6862
 [8]  714.0598  731.7989  723.5435  718.8615  698.5583  715.1624  650.3777
[15]  620.1512  727.0865  681.3784  717.9447  714.5581  680.8192
> colVars(tmp5,na.rm=TRUE)
 [1] 16244.04917    69.08400   100.91419    38.38861    68.69036    63.15312
 [7]    54.45574    28.46121    18.20819    69.90076    82.69957    67.26809
[13]    89.00018    48.32021   103.03695    94.51414    87.42480    90.64213
[19]    66.41746    23.85114
> colSd(tmp5,na.rm=TRUE)
 [1] 127.452145   8.311679  10.045606   6.195855   8.287965   7.946894
 [7]   7.379414   5.334905   4.267105   8.360667   9.093930   8.201712
[13]   9.433991   6.951274  10.150712   9.721838   9.350123   9.520616
[19]   8.149691   4.883763
> colMax(tmp5,na.rm=TRUE)
 [1] 472.57408  89.67801  90.23052  83.89547  90.94285  81.82517  85.66789
 [8]  79.67979  78.07269  84.68501  86.53598  81.22020  80.86539  73.51008
[15]  81.88863  90.72916  80.74316  84.78933  80.60351  78.31531
> colMin(tmp5,na.rm=TRUE)
 [1] 56.74995 61.80158 57.31068 66.64751 64.44071 58.86230 62.55767 63.00178
 [9] 66.51810 61.52891 57.46732 60.27383 52.60758 54.81102 56.35382 61.16822
[17] 54.69120 59.46031 57.60903 61.40163
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1] 91.53006 70.46664 69.68858      NaN 72.16133 71.84110 71.10736 72.68631
 [9] 75.23927 71.00002
> rowSums(tmp5,na.rm=TRUE)
 [1] 1830.601 1409.333 1393.772    0.000 1443.227 1436.822 1422.147 1453.726
 [9] 1504.785 1420.000
> rowVars(tmp5,na.rm=TRUE)
 [1] 8125.21157   73.34323   74.37600         NA   81.74177   59.66174
 [7]  102.85865   89.09264   39.57760   46.82446
> rowSd(tmp5,na.rm=TRUE)
 [1] 90.139955  8.564066  8.624152        NA  9.041116  7.724101 10.141926
 [8]  9.438890  6.291073  6.842840
> rowMax(tmp5,na.rm=TRUE)
 [1] 472.57408  90.94285  81.34058        NA  89.67801  86.38056  90.23052
 [8]  90.28305  83.89547  81.82517
> rowMin(tmp5,na.rm=TRUE)
 [1] 57.31068 54.81102 55.82268       NA 52.60758 58.51629 54.69120 56.74995
 [9] 59.42843 58.48123
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1] 114.84109  75.22002  71.88158  73.43419  78.47802  71.20249  75.00996
 [8]  71.50607  72.86303  72.68937  72.47022  69.01413  72.52317  65.89627
[15]       NaN  73.75818  68.90068  72.27043  70.57626  67.93844
> colSums(tmp5,na.rm=TRUE)
 [1] 1033.5698  676.9802  646.9342  660.9077  706.3022  640.8224  675.0896
 [8]  643.5546  655.7673  654.2043  652.2320  621.1271  652.7085  593.0664
[15]    0.0000  663.8236  620.1061  650.4339  635.1863  611.4460
> colVars(tmp5,na.rm=TRUE)
 [1] 18102.81760    65.64414    97.25565    37.70408    77.26783    70.49465
 [7]    60.60746    31.90616    19.35477    77.37570    89.19928    67.70636
[13]    88.71886    46.06865          NA    93.93624    91.80618    99.42384
[19]    66.01657    26.60093
> colSd(tmp5,na.rm=TRUE)
 [1] 134.546712   8.102107   9.861828   6.140365   8.790212   8.396109
 [7]   7.785079   5.648554   4.399406   8.796346   9.444537   8.228387
[13]   9.419069   6.787389         NA   9.692071   9.581554   9.971150
[19]   8.125058   5.157609
> colMax(tmp5,na.rm=TRUE)
 [1] 472.57408  89.67801  90.23052  83.89547  90.94285  81.82517  85.66789
 [8]  79.67979  78.07269  84.68501  86.53598  81.22020  80.86539  73.51008
[15]      -Inf  90.72916  80.74316  84.78933  80.60351  78.31531
> colMin(tmp5,na.rm=TRUE)
 [1] 56.74995 61.80158 57.31068 66.64751 64.44071 58.86230 62.55767 63.00178
 [9] 66.51810 61.52891 57.46732 60.27383 52.60758 54.81102      Inf 61.16822
[17] 54.69120 59.46031 57.60903 61.40163
> 
> 
> 
> 
> 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] 271.7477 197.9699 242.7245 214.5787 249.0283 181.7967 312.8679 108.9428
 [9] 204.4198 244.3277
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 271.7477 197.9699 242.7245 214.5787 249.0283 181.7967 312.8679 108.9428
 [9] 204.4198 244.3277
> 
> 
> 
> copymatrix <- matrix(rnorm(200,150,15),10,20)
> 
> tmp5[1:10,1:20] <- copymatrix
> which.row <- 1
> which.col  <- 3
> cat(which.row," ",which.col,"\n")
1   3 
> tmp5[which.row,which.col] <- NA
> copymatrix[which.row,which.col] <- NA
> 
> colVars(tmp5,na.rm=TRUE)-apply(copymatrix,2,var,na.rm=TRUE)
 [1] -2.842171e-14 -5.684342e-14 -5.684342e-14  5.684342e-14 -1.705303e-13
 [6] -5.684342e-14 -2.842171e-14  2.557954e-13 -8.526513e-14  5.684342e-14
[11]  2.842171e-14 -5.684342e-14  2.131628e-14  1.136868e-13  4.263256e-14
[16]  0.000000e+00 -5.684342e-14  5.684342e-14  1.705303e-13 -2.842171e-14
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> ## making sure these things agree
> ##
> ## first when there is no NA
> 
> 
> 
> agree.checks <- function(buff.matrix,r.matrix,err.tol=1e-10){
+ 
+   if (Max(buff.matrix,na.rm=TRUE) != max(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Max")
+   }
+   
+ 
+   if (Min(buff.matrix,na.rm=TRUE) != min(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Min")
+   }
+ 
+ 
+   if (abs(Sum(buff.matrix,na.rm=TRUE)- sum(r.matrix,na.rm=TRUE)) > err.tol){
+ 
+     cat(Sum(buff.matrix,na.rm=TRUE),"\n")
+     cat(sum(r.matrix,na.rm=TRUE),"\n")
+     cat(Sum(buff.matrix,na.rm=TRUE) - sum(r.matrix,na.rm=TRUE),"\n")
+     
+     stop("No agreement in Sum")
+   }
+   
+   if (abs(mean(buff.matrix,na.rm=TRUE) - mean(r.matrix,na.rm=TRUE)) > err.tol){
+     stop("No agreement in mean")
+   }
+   
+   
+   if(abs(Var(buff.matrix,na.rm=TRUE) - var(as.vector(r.matrix),na.rm=TRUE)) > err.tol){
+     stop("No agreement in Var")
+   }
+   
+   
+ 
+   if(any(abs(rowMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,mean,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowMeans")
+   }
+   
+   
+   if(any(abs(colMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,mean,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colMeans")
+   }
+   
+   
+   if(any(abs(rowSums(buff.matrix,na.rm=TRUE)  -  apply(r.matrix,1,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in rowSums")
+   }
+   
+   
+   if(any(abs(colSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colSums")
+   }
+   
+   ### this is to get around the fact that R doesn't like to compute NA on an entire vector of NA when 
+   ### computing variance
+   my.Var <- function(x,na.rm=FALSE){
+    if (all(is.na(x))){
+      return(NA)
+    } else {
+      var(x,na.rm=na.rm)
+    }
+ 
+   }
+   
+   if(any(abs(rowVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+   
+   
+   if(any(abs(colVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+ 
+ 
+   if(any(abs(rowMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+ 
+   if(any(abs(colMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+   
+   
+   if(any(abs(rowMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+   
+ 
+   if(any(abs(colMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+ 
+   if(any(abs(colMedians(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,median,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMedian")
+   }
+ 
+   if(any(abs(colRanges(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,range,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colRanges")
+   }
+ 
+ 
+   
+ }
> 
> 
> 
> 
> 
> 
> 
> 
> 
> for (rep in 1:20){
+   copymatrix <- matrix(rnorm(200,150,15),10,20)
+   
+   tmp5[1:10,1:20] <- copymatrix
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ## now lets assign some NA values and check agreement
+ 
+   which.row <- sample(1:10,1,replace=TRUE)
+   which.col  <- sample(1:20,1,replace=TRUE)
+   
+   cat(which.row," ",which.col,"\n")
+   
+   tmp5[which.row,which.col] <- NA
+   copymatrix[which.row,which.col] <- NA
+   
+   agree.checks(tmp5,copymatrix)
+ 
+   ## make an entire row NA
+   tmp5[which.row,] <- NA
+   copymatrix[which.row,] <- NA
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ### also make an entire col NA
+   tmp5[,which.col] <- NA
+   copymatrix[,which.col] <- NA
+ 
+   agree.checks(tmp5,copymatrix)
+ 
+   ### now make 1 element non NA with NA in the rest of row and column
+ 
+   tmp5[which.row,which.col] <- rnorm(1,150,15)
+   copymatrix[which.row,which.col] <- tmp5[which.row,which.col]
+ 
+   agree.checks(tmp5,copymatrix)
+ }
4   18 
9   14 
3   20 
5   8 
8   20 
6   3 
5   13 
1   13 
2   16 
6   2 
7   18 
5   1 
2   5 
4   17 
10   6 
6   7 
1   18 
10   6 
4   11 
4   16 
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.1174
> Min(tmp)
[1] -2.2616
> mean(tmp)
[1] 0.1858114
> Sum(tmp)
[1] 18.58114
> Var(tmp)
[1] 0.834346
> 
> rowMeans(tmp)
[1] 0.1858114
> rowSums(tmp)
[1] 18.58114
> rowVars(tmp)
[1] 0.834346
> rowSd(tmp)
[1] 0.9134254
> rowMax(tmp)
[1] 2.1174
> rowMin(tmp)
[1] -2.2616
> 
> colMeans(tmp)
  [1] -0.143589588  0.997656411 -0.200851231  0.002048113  0.618425164
  [6]  1.698128419 -0.059124870 -0.473361127  0.228685980 -2.261600019
 [11]  1.760558320  1.292041881  0.322963266 -0.134487100  1.416750170
 [16] -0.058379017 -1.176190254  0.083857521  1.080346177  1.362788467
 [21] -0.793028497  0.396972653 -0.520966767  0.658555564 -1.033967995
 [26]  0.178302252  0.174236736  1.055119326  1.916214135  0.129986997
 [31] -0.003716046  0.940056948 -0.213414994 -0.252668849  1.277263360
 [36] -1.030711959  0.616462088  0.329914717  1.033931681 -0.137304742
 [41]  1.640741466  1.055847014 -0.090211799 -0.406084514 -0.905768780
 [46]  1.713247644  1.356776694  0.071114336 -0.469840106  1.589840114
 [51] -1.460808043 -0.202098562  1.181766386 -0.518080544 -1.295274835
 [56] -0.761261436  0.076097273  0.630451863  1.026133178 -1.367322392
 [61]  0.152774360  0.176712564  0.416323923  0.426166456 -0.485553974
 [66]  0.209546303  0.453093918  0.591854284 -0.638959548 -1.053781056
 [71]  0.722526260  0.191941499  1.898880221 -1.459947681 -0.171858768
 [76] -0.051454798  0.866252927 -0.871322498  2.117400036 -0.397845982
 [81] -0.499634034 -0.961364829  0.852763752  0.219199154 -1.113623916
 [86] -0.864229906 -0.697321103 -1.074261354  0.797340615  0.578830928
 [91]  0.720855732  0.658444823 -1.642903979 -0.088739540  0.298943221
 [96]  1.319145111  1.280760050  0.687843536  1.088260047 -0.015087662
> colSums(tmp)
  [1] -0.143589588  0.997656411 -0.200851231  0.002048113  0.618425164
  [6]  1.698128419 -0.059124870 -0.473361127  0.228685980 -2.261600019
 [11]  1.760558320  1.292041881  0.322963266 -0.134487100  1.416750170
 [16] -0.058379017 -1.176190254  0.083857521  1.080346177  1.362788467
 [21] -0.793028497  0.396972653 -0.520966767  0.658555564 -1.033967995
 [26]  0.178302252  0.174236736  1.055119326  1.916214135  0.129986997
 [31] -0.003716046  0.940056948 -0.213414994 -0.252668849  1.277263360
 [36] -1.030711959  0.616462088  0.329914717  1.033931681 -0.137304742
 [41]  1.640741466  1.055847014 -0.090211799 -0.406084514 -0.905768780
 [46]  1.713247644  1.356776694  0.071114336 -0.469840106  1.589840114
 [51] -1.460808043 -0.202098562  1.181766386 -0.518080544 -1.295274835
 [56] -0.761261436  0.076097273  0.630451863  1.026133178 -1.367322392
 [61]  0.152774360  0.176712564  0.416323923  0.426166456 -0.485553974
 [66]  0.209546303  0.453093918  0.591854284 -0.638959548 -1.053781056
 [71]  0.722526260  0.191941499  1.898880221 -1.459947681 -0.171858768
 [76] -0.051454798  0.866252927 -0.871322498  2.117400036 -0.397845982
 [81] -0.499634034 -0.961364829  0.852763752  0.219199154 -1.113623916
 [86] -0.864229906 -0.697321103 -1.074261354  0.797340615  0.578830928
 [91]  0.720855732  0.658444823 -1.642903979 -0.088739540  0.298943221
 [96]  1.319145111  1.280760050  0.687843536  1.088260047 -0.015087662
> 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.143589588  0.997656411 -0.200851231  0.002048113  0.618425164
  [6]  1.698128419 -0.059124870 -0.473361127  0.228685980 -2.261600019
 [11]  1.760558320  1.292041881  0.322963266 -0.134487100  1.416750170
 [16] -0.058379017 -1.176190254  0.083857521  1.080346177  1.362788467
 [21] -0.793028497  0.396972653 -0.520966767  0.658555564 -1.033967995
 [26]  0.178302252  0.174236736  1.055119326  1.916214135  0.129986997
 [31] -0.003716046  0.940056948 -0.213414994 -0.252668849  1.277263360
 [36] -1.030711959  0.616462088  0.329914717  1.033931681 -0.137304742
 [41]  1.640741466  1.055847014 -0.090211799 -0.406084514 -0.905768780
 [46]  1.713247644  1.356776694  0.071114336 -0.469840106  1.589840114
 [51] -1.460808043 -0.202098562  1.181766386 -0.518080544 -1.295274835
 [56] -0.761261436  0.076097273  0.630451863  1.026133178 -1.367322392
 [61]  0.152774360  0.176712564  0.416323923  0.426166456 -0.485553974
 [66]  0.209546303  0.453093918  0.591854284 -0.638959548 -1.053781056
 [71]  0.722526260  0.191941499  1.898880221 -1.459947681 -0.171858768
 [76] -0.051454798  0.866252927 -0.871322498  2.117400036 -0.397845982
 [81] -0.499634034 -0.961364829  0.852763752  0.219199154 -1.113623916
 [86] -0.864229906 -0.697321103 -1.074261354  0.797340615  0.578830928
 [91]  0.720855732  0.658444823 -1.642903979 -0.088739540  0.298943221
 [96]  1.319145111  1.280760050  0.687843536  1.088260047 -0.015087662
> colMin(tmp)
  [1] -0.143589588  0.997656411 -0.200851231  0.002048113  0.618425164
  [6]  1.698128419 -0.059124870 -0.473361127  0.228685980 -2.261600019
 [11]  1.760558320  1.292041881  0.322963266 -0.134487100  1.416750170
 [16] -0.058379017 -1.176190254  0.083857521  1.080346177  1.362788467
 [21] -0.793028497  0.396972653 -0.520966767  0.658555564 -1.033967995
 [26]  0.178302252  0.174236736  1.055119326  1.916214135  0.129986997
 [31] -0.003716046  0.940056948 -0.213414994 -0.252668849  1.277263360
 [36] -1.030711959  0.616462088  0.329914717  1.033931681 -0.137304742
 [41]  1.640741466  1.055847014 -0.090211799 -0.406084514 -0.905768780
 [46]  1.713247644  1.356776694  0.071114336 -0.469840106  1.589840114
 [51] -1.460808043 -0.202098562  1.181766386 -0.518080544 -1.295274835
 [56] -0.761261436  0.076097273  0.630451863  1.026133178 -1.367322392
 [61]  0.152774360  0.176712564  0.416323923  0.426166456 -0.485553974
 [66]  0.209546303  0.453093918  0.591854284 -0.638959548 -1.053781056
 [71]  0.722526260  0.191941499  1.898880221 -1.459947681 -0.171858768
 [76] -0.051454798  0.866252927 -0.871322498  2.117400036 -0.397845982
 [81] -0.499634034 -0.961364829  0.852763752  0.219199154 -1.113623916
 [86] -0.864229906 -0.697321103 -1.074261354  0.797340615  0.578830928
 [91]  0.720855732  0.658444823 -1.642903979 -0.088739540  0.298943221
 [96]  1.319145111  1.280760050  0.687843536  1.088260047 -0.015087662
> colMedians(tmp)
  [1] -0.143589588  0.997656411 -0.200851231  0.002048113  0.618425164
  [6]  1.698128419 -0.059124870 -0.473361127  0.228685980 -2.261600019
 [11]  1.760558320  1.292041881  0.322963266 -0.134487100  1.416750170
 [16] -0.058379017 -1.176190254  0.083857521  1.080346177  1.362788467
 [21] -0.793028497  0.396972653 -0.520966767  0.658555564 -1.033967995
 [26]  0.178302252  0.174236736  1.055119326  1.916214135  0.129986997
 [31] -0.003716046  0.940056948 -0.213414994 -0.252668849  1.277263360
 [36] -1.030711959  0.616462088  0.329914717  1.033931681 -0.137304742
 [41]  1.640741466  1.055847014 -0.090211799 -0.406084514 -0.905768780
 [46]  1.713247644  1.356776694  0.071114336 -0.469840106  1.589840114
 [51] -1.460808043 -0.202098562  1.181766386 -0.518080544 -1.295274835
 [56] -0.761261436  0.076097273  0.630451863  1.026133178 -1.367322392
 [61]  0.152774360  0.176712564  0.416323923  0.426166456 -0.485553974
 [66]  0.209546303  0.453093918  0.591854284 -0.638959548 -1.053781056
 [71]  0.722526260  0.191941499  1.898880221 -1.459947681 -0.171858768
 [76] -0.051454798  0.866252927 -0.871322498  2.117400036 -0.397845982
 [81] -0.499634034 -0.961364829  0.852763752  0.219199154 -1.113623916
 [86] -0.864229906 -0.697321103 -1.074261354  0.797340615  0.578830928
 [91]  0.720855732  0.658444823 -1.642903979 -0.088739540  0.298943221
 [96]  1.319145111  1.280760050  0.687843536  1.088260047 -0.015087662
> colRanges(tmp)
           [,1]      [,2]       [,3]        [,4]      [,5]     [,6]        [,7]
[1,] -0.1435896 0.9976564 -0.2008512 0.002048113 0.6184252 1.698128 -0.05912487
[2,] -0.1435896 0.9976564 -0.2008512 0.002048113 0.6184252 1.698128 -0.05912487
           [,8]     [,9]   [,10]    [,11]    [,12]     [,13]      [,14]   [,15]
[1,] -0.4733611 0.228686 -2.2616 1.760558 1.292042 0.3229633 -0.1344871 1.41675
[2,] -0.4733611 0.228686 -2.2616 1.760558 1.292042 0.3229633 -0.1344871 1.41675
           [,16]    [,17]      [,18]    [,19]    [,20]      [,21]     [,22]
[1,] -0.05837902 -1.17619 0.08385752 1.080346 1.362788 -0.7930285 0.3969727
[2,] -0.05837902 -1.17619 0.08385752 1.080346 1.362788 -0.7930285 0.3969727
          [,23]     [,24]     [,25]     [,26]     [,27]    [,28]    [,29]
[1,] -0.5209668 0.6585556 -1.033968 0.1783023 0.1742367 1.055119 1.916214
[2,] -0.5209668 0.6585556 -1.033968 0.1783023 0.1742367 1.055119 1.916214
        [,30]        [,31]     [,32]     [,33]      [,34]    [,35]     [,36]
[1,] 0.129987 -0.003716046 0.9400569 -0.213415 -0.2526688 1.277263 -1.030712
[2,] 0.129987 -0.003716046 0.9400569 -0.213415 -0.2526688 1.277263 -1.030712
         [,37]     [,38]    [,39]      [,40]    [,41]    [,42]      [,43]
[1,] 0.6164621 0.3299147 1.033932 -0.1373047 1.640741 1.055847 -0.0902118
[2,] 0.6164621 0.3299147 1.033932 -0.1373047 1.640741 1.055847 -0.0902118
          [,44]      [,45]    [,46]    [,47]      [,48]      [,49]   [,50]
[1,] -0.4060845 -0.9057688 1.713248 1.356777 0.07111434 -0.4698401 1.58984
[2,] -0.4060845 -0.9057688 1.713248 1.356777 0.07111434 -0.4698401 1.58984
         [,51]      [,52]    [,53]      [,54]     [,55]      [,56]      [,57]
[1,] -1.460808 -0.2020986 1.181766 -0.5180805 -1.295275 -0.7612614 0.07609727
[2,] -1.460808 -0.2020986 1.181766 -0.5180805 -1.295275 -0.7612614 0.07609727
         [,58]    [,59]     [,60]     [,61]     [,62]     [,63]     [,64]
[1,] 0.6304519 1.026133 -1.367322 0.1527744 0.1767126 0.4163239 0.4261665
[2,] 0.6304519 1.026133 -1.367322 0.1527744 0.1767126 0.4163239 0.4261665
         [,65]     [,66]     [,67]     [,68]      [,69]     [,70]     [,71]
[1,] -0.485554 0.2095463 0.4530939 0.5918543 -0.6389595 -1.053781 0.7225263
[2,] -0.485554 0.2095463 0.4530939 0.5918543 -0.6389595 -1.053781 0.7225263
         [,72]   [,73]     [,74]      [,75]      [,76]     [,77]      [,78]
[1,] 0.1919415 1.89888 -1.459948 -0.1718588 -0.0514548 0.8662529 -0.8713225
[2,] 0.1919415 1.89888 -1.459948 -0.1718588 -0.0514548 0.8662529 -0.8713225
      [,79]     [,80]     [,81]      [,82]     [,83]     [,84]     [,85]
[1,] 2.1174 -0.397846 -0.499634 -0.9613648 0.8527638 0.2191992 -1.113624
[2,] 2.1174 -0.397846 -0.499634 -0.9613648 0.8527638 0.2191992 -1.113624
          [,86]      [,87]     [,88]     [,89]     [,90]     [,91]     [,92]
[1,] -0.8642299 -0.6973211 -1.074261 0.7973406 0.5788309 0.7208557 0.6584448
[2,] -0.8642299 -0.6973211 -1.074261 0.7973406 0.5788309 0.7208557 0.6584448
         [,93]       [,94]     [,95]    [,96]   [,97]     [,98]   [,99]
[1,] -1.642904 -0.08873954 0.2989432 1.319145 1.28076 0.6878435 1.08826
[2,] -1.642904 -0.08873954 0.2989432 1.319145 1.28076 0.6878435 1.08826
          [,100]
[1,] -0.01508766
[2,] -0.01508766
> 
> 
> Max(tmp2)
[1] 2.296875
> Min(tmp2)
[1] -2.075226
> mean(tmp2)
[1] 0.02948859
> Sum(tmp2)
[1] 2.948859
> Var(tmp2)
[1] 0.9366405
> 
> rowMeans(tmp2)
  [1] -2.001735187 -1.158612588 -0.030365719 -1.371455794  0.998033104
  [6] -0.094035588  1.008046840  1.107842401 -1.672936764 -0.062843172
 [11]  0.137669622 -0.399281669  1.505865098  0.869779518  1.946471900
 [16] -0.935024949  1.328659857 -0.309323143  0.227540898 -0.244940156
 [21]  0.421805375  0.861411577 -0.640075254 -1.025132854  2.021979213
 [26]  1.196349806  0.512667625 -0.524752791 -0.609756232 -1.503579206
 [31]  0.214622602 -0.727775225 -0.612395334 -0.559520297 -0.356112561
 [36]  0.831841648  0.172522188 -1.056364625  0.184865559 -2.075225802
 [41]  1.144960829 -0.119409618  1.378136532 -0.702502788  0.013193183
 [46] -0.037383934 -1.025383019  0.033608090  1.327151844 -0.198613754
 [51]  0.642162664  0.152258262 -0.929557652 -0.594822010 -0.715394058
 [56] -0.269524268 -0.117776354 -0.709012822 -0.375200149 -0.378931856
 [61] -0.007523850 -1.732794224  1.157369137  0.869900345 -1.055908265
 [66]  1.141798592 -0.176352317 -0.677995350  1.520940438  1.330346599
 [71] -0.449124052  0.466676661  1.362733851 -0.145936563  0.575014765
 [76] -0.092991005  0.993776761 -1.365134861  0.116267409  1.206538881
 [81]  0.007528433  1.153785163  2.296875486 -0.603226767  1.609007496
 [86]  0.174890737 -1.477981046 -1.608337948 -1.145896121  0.054980601
 [91]  1.626306498  0.756073823 -0.279295426 -0.854030322  0.690456191
 [96]  0.886202745 -0.327416072  0.383152739 -0.836122892 -0.690386479
> rowSums(tmp2)
  [1] -2.001735187 -1.158612588 -0.030365719 -1.371455794  0.998033104
  [6] -0.094035588  1.008046840  1.107842401 -1.672936764 -0.062843172
 [11]  0.137669622 -0.399281669  1.505865098  0.869779518  1.946471900
 [16] -0.935024949  1.328659857 -0.309323143  0.227540898 -0.244940156
 [21]  0.421805375  0.861411577 -0.640075254 -1.025132854  2.021979213
 [26]  1.196349806  0.512667625 -0.524752791 -0.609756232 -1.503579206
 [31]  0.214622602 -0.727775225 -0.612395334 -0.559520297 -0.356112561
 [36]  0.831841648  0.172522188 -1.056364625  0.184865559 -2.075225802
 [41]  1.144960829 -0.119409618  1.378136532 -0.702502788  0.013193183
 [46] -0.037383934 -1.025383019  0.033608090  1.327151844 -0.198613754
 [51]  0.642162664  0.152258262 -0.929557652 -0.594822010 -0.715394058
 [56] -0.269524268 -0.117776354 -0.709012822 -0.375200149 -0.378931856
 [61] -0.007523850 -1.732794224  1.157369137  0.869900345 -1.055908265
 [66]  1.141798592 -0.176352317 -0.677995350  1.520940438  1.330346599
 [71] -0.449124052  0.466676661  1.362733851 -0.145936563  0.575014765
 [76] -0.092991005  0.993776761 -1.365134861  0.116267409  1.206538881
 [81]  0.007528433  1.153785163  2.296875486 -0.603226767  1.609007496
 [86]  0.174890737 -1.477981046 -1.608337948 -1.145896121  0.054980601
 [91]  1.626306498  0.756073823 -0.279295426 -0.854030322  0.690456191
 [96]  0.886202745 -0.327416072  0.383152739 -0.836122892 -0.690386479
> rowVars(tmp2)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowSd(tmp2)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowMax(tmp2)
  [1] -2.001735187 -1.158612588 -0.030365719 -1.371455794  0.998033104
  [6] -0.094035588  1.008046840  1.107842401 -1.672936764 -0.062843172
 [11]  0.137669622 -0.399281669  1.505865098  0.869779518  1.946471900
 [16] -0.935024949  1.328659857 -0.309323143  0.227540898 -0.244940156
 [21]  0.421805375  0.861411577 -0.640075254 -1.025132854  2.021979213
 [26]  1.196349806  0.512667625 -0.524752791 -0.609756232 -1.503579206
 [31]  0.214622602 -0.727775225 -0.612395334 -0.559520297 -0.356112561
 [36]  0.831841648  0.172522188 -1.056364625  0.184865559 -2.075225802
 [41]  1.144960829 -0.119409618  1.378136532 -0.702502788  0.013193183
 [46] -0.037383934 -1.025383019  0.033608090  1.327151844 -0.198613754
 [51]  0.642162664  0.152258262 -0.929557652 -0.594822010 -0.715394058
 [56] -0.269524268 -0.117776354 -0.709012822 -0.375200149 -0.378931856
 [61] -0.007523850 -1.732794224  1.157369137  0.869900345 -1.055908265
 [66]  1.141798592 -0.176352317 -0.677995350  1.520940438  1.330346599
 [71] -0.449124052  0.466676661  1.362733851 -0.145936563  0.575014765
 [76] -0.092991005  0.993776761 -1.365134861  0.116267409  1.206538881
 [81]  0.007528433  1.153785163  2.296875486 -0.603226767  1.609007496
 [86]  0.174890737 -1.477981046 -1.608337948 -1.145896121  0.054980601
 [91]  1.626306498  0.756073823 -0.279295426 -0.854030322  0.690456191
 [96]  0.886202745 -0.327416072  0.383152739 -0.836122892 -0.690386479
> rowMin(tmp2)
  [1] -2.001735187 -1.158612588 -0.030365719 -1.371455794  0.998033104
  [6] -0.094035588  1.008046840  1.107842401 -1.672936764 -0.062843172
 [11]  0.137669622 -0.399281669  1.505865098  0.869779518  1.946471900
 [16] -0.935024949  1.328659857 -0.309323143  0.227540898 -0.244940156
 [21]  0.421805375  0.861411577 -0.640075254 -1.025132854  2.021979213
 [26]  1.196349806  0.512667625 -0.524752791 -0.609756232 -1.503579206
 [31]  0.214622602 -0.727775225 -0.612395334 -0.559520297 -0.356112561
 [36]  0.831841648  0.172522188 -1.056364625  0.184865559 -2.075225802
 [41]  1.144960829 -0.119409618  1.378136532 -0.702502788  0.013193183
 [46] -0.037383934 -1.025383019  0.033608090  1.327151844 -0.198613754
 [51]  0.642162664  0.152258262 -0.929557652 -0.594822010 -0.715394058
 [56] -0.269524268 -0.117776354 -0.709012822 -0.375200149 -0.378931856
 [61] -0.007523850 -1.732794224  1.157369137  0.869900345 -1.055908265
 [66]  1.141798592 -0.176352317 -0.677995350  1.520940438  1.330346599
 [71] -0.449124052  0.466676661  1.362733851 -0.145936563  0.575014765
 [76] -0.092991005  0.993776761 -1.365134861  0.116267409  1.206538881
 [81]  0.007528433  1.153785163  2.296875486 -0.603226767  1.609007496
 [86]  0.174890737 -1.477981046 -1.608337948 -1.145896121  0.054980601
 [91]  1.626306498  0.756073823 -0.279295426 -0.854030322  0.690456191
 [96]  0.886202745 -0.327416072  0.383152739 -0.836122892 -0.690386479
> 
> colMeans(tmp2)
[1] 0.02948859
> colSums(tmp2)
[1] 2.948859
> colVars(tmp2)
[1] 0.9366405
> colSd(tmp2)
[1] 0.9678019
> colMax(tmp2)
[1] 2.296875
> colMin(tmp2)
[1] -2.075226
> colMedians(tmp2)
[1] -0.05011355
> colRanges(tmp2)
          [,1]
[1,] -2.075226
[2,]  2.296875
> 
> dataset1 <- matrix(dataset1,1,100)
> 
> agree.checks(tmp,dataset1)
> 
> dataset2 <- matrix(dataset2,100,1)
> agree.checks(tmp2,dataset2)
>   
> 
> tmp <- createBufferedMatrix(10,10)
> 
> tmp[1:10,1:10] <- rnorm(100)
> colApply(tmp,sum)
 [1]  0.5107990 -1.7156512  4.9356306  1.7316416  4.5875968  2.3545413
 [7] -2.0914408  0.9527705  3.8500020 -4.6468612
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -1.2517171
[2,] -0.3060608
[3,]  0.1488528
[4,]  0.3767188
[5,]  0.9183454
> 
> rowApply(tmp,sum)
 [1]  2.2284101  3.2211187  6.2811393  1.6335028 -7.4020655  1.5665574
 [7]  0.2528810 -1.5188412  0.8872339  3.3190920
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    5    9    2    5    5    3    7    6    1     8
 [2,]    4    5    4   10    1    4   10    1    5     2
 [3,]    6    6    8    4    7    9    5   10    2     5
 [4,]    3    1    5    2   10    6    6    8   10     7
 [5,]    8    8    9    7    3    8    9    4    8     3
 [6,]    7    4    6    6    6    5    2    9    7     6
 [7,]    2    2    1    8    8   10    3    2    3     1
 [8,]   10   10    3    1    2    7    8    3    4    10
 [9,]    9    7   10    9    9    1    4    5    6     9
[10,]    1    3    7    3    4    2    1    7    9     4
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1] -2.5185168 -0.2498611  2.9520805 -0.4513933 -1.3406709 -3.8381694
 [7] -2.9924550  1.1951324 -2.5241399  1.5948793  5.0408953 -2.0540365
[13]  2.3464284 -2.2019289 -2.8280829  5.2904122 -0.1509287 -1.3558371
[19]  2.0024611 -3.1368758
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -1.6848724
[2,] -1.6031747
[3,] -0.7434314
[4,]  0.2663049
[5,]  1.2466568
> 
> rowApply(tmp,sum)
[1] -2.5923308 -0.5139247  4.6449907  3.0109686 -9.7703106
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]    1   20    4   13    2
[2,]   18    1   13   11   17
[3,]   17   18   18   17    5
[4,]    5   19    9    5   12
[5,]    9   15    6    2   14
> 
> 
> as.matrix(tmp)
           [,1]       [,2]       [,3]        [,4]       [,5]       [,6]
[1,] -1.6848724  0.6034273  0.5585719 -0.78203025 -0.2668173 -0.9908332
[2,]  1.2466568 -1.7807155  1.1818354  1.22206921  0.7203888 -1.6272771
[3,] -0.7434314  0.3870239  1.4972534 -0.09738696 -0.5397166 -0.4951422
[4,]  0.2663049  0.1086398  1.1156966 -0.77557634 -1.3848547 -0.1172453
[5,] -1.6031747  0.4317635 -1.4012767 -0.01846892  0.1303289 -0.6076716
           [,7]       [,8]       [,9]       [,10]      [,11]      [,12]
[1,] -1.1851532 -0.3417684  0.7979251  0.49122183 -0.3734085 -0.8473933
[2,] -0.2540813 -0.4662446 -1.3662464  0.46883253  0.5880889  0.8687350
[3,]  0.2594702  1.3252722 -0.5948900  0.19916845  0.9774583  0.5585974
[4,] -0.3875562  0.1103850  0.4939088 -0.05785224  2.2447578 -1.0656857
[5,] -1.4251345  0.5674883 -1.8548375  0.49350874  1.6039987 -1.5682899
          [,13]       [,14]      [,15]       [,16]       [,17]      [,18]
[1,]  2.2127806  0.02420069 -0.2584464  0.01528359  0.20526287 -0.6460822
[2,] -0.4912081  0.03844227  0.7063968  1.12872026 -1.67648322 -1.1699834
[3,]  0.4940194 -0.41260135 -0.9720535  2.83172023  0.36784256 -1.1636172
[4,] -0.2793436 -0.87314052 -1.8073270  2.67864633  0.89448580  1.3655754
[5,]  0.4101801 -0.97882996 -0.4966527 -1.36395816  0.05796332  0.2582702
           [,19]       [,20]
[1,]  0.05604639 -0.18024575
[2,]  0.09181246  0.05633646
[3,]  2.21821889 -1.45221492
[4,]  0.78640661 -0.30525697
[5,] -1.15002325 -1.25549466
> 
> 
> 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 :  653  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 :  566  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.5435535 -0.8463965 -0.9002233 -0.7034085 0.6014382 -0.3441515 1.37955
          col8    col9     col10     col11      col12        col13    col14
row1 -1.505474 0.67303 0.1766452 0.1007671 -0.5113892 -0.003935918 1.387712
         col15      col16     col17      col18    col19    col20
row1 -1.336635 -0.3892946 0.1609233 -0.9654991 0.423617 1.310215
> tmp[,"col10"]
          col10
row1  0.1766452
row2 -1.8100459
row3  1.0776787
row4  0.5579014
row5 -0.9479868
> tmp[c("row1","row5"),]
          col1        col2       col3       col4       col5        col6
row1 0.5435535 -0.84639649 -0.9002233 -0.7034085  0.6014382 -0.34415145
row5 0.4146038 -0.08966475 -0.3928490  1.1787448 -1.2532973  0.06020976
           col7      col8     col9      col10      col11      col12
row1  1.3795498 -1.505474 0.673030  0.1766452  0.1007671 -0.5113892
row5 -0.2945637  1.139691 1.949968 -0.9479868 -0.3057076  1.5884797
            col13      col14       col15      col16     col17      col18
row1 -0.003935918  1.3877115 -1.33663498 -0.3892946 0.1609233 -0.9654991
row5 -0.510591313 -0.6581885 -0.02195271 -0.2379535 0.7098194 -1.0663496
         col19    col20
row1  0.423617 1.310215
row5 -2.145838 1.123145
> tmp[,c("col6","col20")]
             col6      col20
row1 -0.344151455  1.3102153
row2  0.009060842 -0.3776812
row3 -1.531214688  0.5153933
row4 -0.082589181  1.2900460
row5  0.060209763  1.1231453
> tmp[c("row1","row5"),c("col6","col20")]
            col6    col20
row1 -0.34415145 1.310215
row5  0.06020976 1.123145
> 
> 
> 
> 
> 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 53.15964 50.55782 49.89925 49.4268 49.81692 104.777 50.20261 49.66529
         col9    col10    col11    col12    col13   col14    col15    col16
row1 50.92457 51.12593 50.83843 50.04005 49.62492 50.9564 50.26107 49.49396
        col17    col18    col19    col20
row1 50.30698 51.32884 49.34038 104.1778
> tmp[,"col10"]
        col10
row1 51.12593
row2 28.77484
row3 29.24263
row4 29.84940
row5 49.43887
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 53.15964 50.55782 49.89925 49.42680 49.81692 104.7770 50.20261 49.66529
row5 51.45179 50.34226 50.62932 49.51221 51.55441 104.2072 49.13637 49.62040
         col9    col10    col11    col12    col13    col14    col15    col16
row1 50.92457 51.12593 50.83843 50.04005 49.62492 50.95640 50.26107 49.49396
row5 46.97583 49.43887 49.50334 48.77445 49.45030 50.95232 49.94314 49.71479
        col17    col18    col19    col20
row1 50.30698 51.32884 49.34038 104.1778
row5 51.67753 47.23469 49.69255 104.7831
> tmp[,c("col6","col20")]
          col6     col20
row1 104.77705 104.17784
row2  76.48596  73.22197
row3  73.52156  75.08714
row4  77.94673  75.31331
row5 104.20718 104.78308
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 104.7770 104.1778
row5 104.2072 104.7831
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 104.7770 104.1778
row5 104.2072 104.7831
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
          col13
[1,] -0.6149523
[2,] -1.1326142
[3,] -1.1091163
[4,]  0.6286703
[5,] -1.0459577
> tmp[,c("col17","col7")]
          col17       col7
[1,] -1.0724286 -1.1647206
[2,]  2.0228266 -0.3151131
[3,] -1.3391979 -0.5703226
[4,] -0.9505233 -1.2562817
[5,]  1.1447380 -1.0864073
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
           col6       col20
[1,] 0.11668330 -0.94528963
[2,] 1.11987969  1.64984812
[3,] 0.71473371 -0.02404135
[4,] 0.02988593 -0.14059388
[5,] 0.61828931  0.06734483
> subBufferedMatrix(tmp,1,c("col6"))[,1]
          col1
[1,] 0.1166833
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
          col6
[1,] 0.1166833
[2,] 1.1198797
> 
> 
> 
> 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 -0.6571456  0.1155856 0.1105827 -0.3559427 -1.227315  0.3396575  0.4551695
row1  0.9208132 -2.6552887 0.6654118 -0.2627671 -1.032098 -0.1810774 -2.1242913
            [,8]      [,9]     [,10]     [,11]      [,12]       [,13]     [,14]
row3 -0.88174996 -2.344373 0.7548949 2.1461812  0.0949916 -0.06529001 -1.077937
row1  0.08015278  1.375172 0.1164961 0.7050818 -0.7571472  1.18730651 -1.438636
        [,15]       [,16]      [,17]      [,18]     [,19]      [,20]
row3 0.565902 -0.06677062 -0.4570516 -0.5276291  1.496103 -0.2673115
row1 1.082389  0.65198250  0.8015855 -1.2241174 -1.610252  0.8921277
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
         [,1]      [,2]    [,3]       [,4]      [,5]        [,6]      [,7]
row2 1.033062 -1.131215 0.26944 -0.9784595 0.5274086 -0.03312922 0.1274462
           [,8]    [,9]     [,10]
row2 -0.1537088 0.97673 0.6580437
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
          [,1]     [,2]     [,3]       [,4]      [,5]      [,6]       [,7]
row5 0.5084831 2.260193 1.318332 -0.3757292 0.5382938 0.7229027 -0.4684596
         [,8]      [,9]    [,10]    [,11]    [,12]       [,13]      [,14]
row5 1.278274 0.1601042 1.169655 0.986265 1.052808 -0.08205919 -0.2304276
         [,15]     [,16]      [,17]      [,18]     [,19]     [,20]
row5 -1.298966 -1.821057 -0.7559656 -0.7784357 0.1349428 0.3144694
> 
> 
> 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: 0x5d5db65fd8c0>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM2ed2a8f788dbd" 
 [2] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM2ed2a8170f0ee5"
 [3] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM2ed2a8105484e9"
 [4] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM2ed2a84e589ff7"
 [5] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM2ed2a874559cc5"
 [6] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM2ed2a8ee84ce9" 
 [7] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM2ed2a86a53d928"
 [8] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM2ed2a820b12d73"
 [9] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM2ed2a866759aa" 
[10] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM2ed2a872de8f7d"
[11] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM2ed2a83b5014b9"
[12] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM2ed2a8637ef232"
[13] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM2ed2a858765e60"
[14] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM2ed2a86a2e84ef"
[15] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM2ed2a8500f9384"
> 
> 
> ### 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: 0x5d5db7fb0990>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x5d5db7fb0990>
Warning message:
In dir.create(new.directory) :
  '/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x5d5db7fb0990>
> rowMedians(tmp)
  [1] -0.056113644  0.334055963  0.206128671 -0.219142824 -0.159420382
  [6]  0.290133621 -0.209628486  0.512356675  0.064088133 -0.151877867
 [11] -0.240052406  0.358300018  0.039714357  0.423288760 -0.118786095
 [16]  0.375458853 -0.361131243 -0.378106224  0.401452870  0.321446139
 [21] -0.479800734  0.052753327 -0.849476474 -0.443007777 -0.172374067
 [26] -0.214448917 -0.037460462  0.160508264 -0.242885219  0.132478104
 [31] -0.141012657 -0.305758237 -0.396331716  0.086081796  0.073128077
 [36]  0.411602621  0.713809541  0.358684298 -0.030487780 -0.947809651
 [41]  0.156430723  0.494211279  0.314144403 -0.075710203 -0.219741798
 [46]  0.197230125 -0.017707489 -0.479894208 -0.088049871 -0.283370108
 [51] -0.177632867 -0.004031748 -0.529076248 -0.569932493 -0.345545070
 [56] -0.283032695  0.454368426  0.346371353  0.196472792  0.250084809
 [61] -0.603661513 -0.229245610 -0.071276491 -0.254282510  0.445380119
 [66]  0.320109142  0.570966918  0.001270877  0.172224361 -0.078222616
 [71] -0.114136410 -0.135621324 -0.030035189  0.173141941  0.060924262
 [76]  0.325873460  0.004041238  0.841586503  0.258095434  0.249399663
 [81] -0.030770427 -0.219396927 -0.239487572  0.402252896 -0.318870663
 [86]  0.392068721  0.024530541 -0.406665124  0.072778658  0.410688696
 [91]  0.336675430 -0.113376780 -0.299172472  0.256749562  0.288573693
 [96]  0.201580043  0.087891142 -0.221226989 -0.122553349  0.016405797
[101]  0.017249513  0.139870952  0.549723430  0.214039897 -0.341402535
[106] -0.017616597  0.314561614 -0.436606873  0.180427336  0.398362871
[111] -0.121587142 -0.401517305 -0.542040812 -0.116834422  0.244389607
[116] -0.136823039 -0.335728722 -0.126549748  0.004276360 -0.182521498
[121] -0.020599224  0.221783176 -0.367137266 -0.324676801 -0.090766167
[126] -0.126720799 -0.744353943  0.113917005  0.254902066  0.445163543
[131]  0.207069159 -0.079468645  0.126732028  0.106800509 -0.474619488
[136] -0.264527087  0.332941809 -0.026171473  0.254253586 -0.113399957
[141]  0.086006377 -0.547239192  0.259856340 -0.437937083  0.269474118
[146] -0.185838460  0.285321778  0.106387463  0.485713778 -0.355397311
[151]  0.102221049  0.753624391 -0.019519756  0.044004402  0.150475916
[156] -0.107474092  0.146288730 -0.320662622 -0.077316444 -0.573848335
[161] -0.012724274 -0.145774057  0.154233533  0.170852567  0.157195717
[166] -0.476811351 -0.432883148  0.272458214  0.231735662 -0.171958796
[171]  0.539635146 -0.246082228  0.263284184  0.105475615  0.102778624
[176] -0.027134837  0.022498716 -0.333026168 -0.227890324  0.300419911
[181]  0.014359397 -0.182976006 -0.090901096  0.465791453 -0.305784726
[186]  0.064085806  0.328113223 -0.329979714  0.028591206 -0.189807783
[191] -0.037144017  0.324963719  0.011003366 -0.271518339  0.228008983
[196] -0.267265426  0.185285285 -0.049574957  0.266772657  0.852550206
[201] -0.164140875 -0.341334799 -0.540945974 -0.094952835  0.632495211
[206]  0.521966499  0.165114412  0.397330750  0.363710236 -0.288427797
[211]  0.422812933  0.373793649  0.032405849 -0.457735368 -0.184454054
[216]  0.302912123  0.308643688 -0.119035252 -0.227045727  0.192590302
[221] -0.239326788 -0.071024737 -0.832038795 -0.545548227 -0.017988228
[226]  0.282089244 -0.175446957 -0.580459587  0.227028330  0.212298854
> 
> proc.time()
   user  system elapsed 
  1.823   1.105   3.082 

BufferedMatrix.Rcheck/tests/rawCalltesting.Rout


R version 4.5.1 Patched (2025-08-23 r88802) -- "Great Square Root"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: x86_64-pc-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: 0x607f592d3c80>
> .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: 0x607f592d3c80>
> .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: 0x607f592d3c80>
> .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: 0x607f592d3c80>
> 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: 0x607f58f6aa00>
> .Call("R_bm_AddColumn",P)
<pointer: 0x607f58f6aa00>
> .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: 0x607f58f6aa00>
> .Call("R_bm_AddColumn",P)
<pointer: 0x607f58f6aa00>
> .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: 0x607f58f6aa00>
> 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: 0x607f59035660>
> .Call("R_bm_AddColumn",P)
<pointer: 0x607f59035660>
> .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: 0x607f59035660>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x607f59035660>
> .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: 0x607f59035660>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x607f59035660>
> .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: 0x607f59035660>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x607f59035660>
> .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: 0x607f59035660>
> 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: 0x607f595573d0>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x607f595573d0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x607f595573d0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x607f595573d0>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile2ed4084507f8e8" "BufferedMatrixFile2ed4087ac35ece"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile2ed4084507f8e8" "BufferedMatrixFile2ed4087ac35ece"
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x607f5b6b4460>
> .Call("R_bm_AddColumn",P)
<pointer: 0x607f5b6b4460>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x607f5b6b4460>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x607f5b6b4460>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x607f5b6b4460>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x607f5b6b4460>
> .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: 0x607f59b396d0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x607f59b396d0>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x607f59b396d0>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x607f59b396d0>
> 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: 0x607f5af7c0c0>
> .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: 0x607f5af7c0c0>
> rm(P)
> 
> proc.time()
   user  system elapsed 
  0.386   0.054   0.465 

BufferedMatrix.Rcheck/tests/Rcodetesting.Rout


R version 4.5.1 Patched (2025-08-23 r88802) -- "Great Square Root"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: x86_64-pc-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.322   0.043   0.354 

Example timings