Back to Build/check report for BioC 3.24:   simplified   long
A[B]CDEFGHIJKLMNOPQRSTUVWXYZ

This page was generated on 2026-05-21 11:33 -0400 (Thu, 21 May 2026).

HostnameOSArch (*)R versionInstalled pkgs
nebbiolo2Linux (Ubuntu 24.04.4 LTS)x86_644.6.0 RC (2026-04-17 r89917) -- "Because it was There" 4936
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 259/2378HostnameOS / ArchINSTALLBUILDCHECKBUILD BIN
BufferedMatrix 1.77.0  (landing page)
Ben Bolstad
Snapshot Date: 2026-05-20 13:45 -0400 (Wed, 20 May 2026)
git_url: https://git.bioconductor.org/packages/BufferedMatrix
git_branch: devel
git_last_commit: 2d99771
git_last_commit_date: 2026-04-28 08:32:08 -0400 (Tue, 28 Apr 2026)
nebbiolo2Linux (Ubuntu 24.04.4 LTS) / x86_64  OK    OK    OK  UNNEEDED, same version is already published
See other builds for BufferedMatrix in R Universe.


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.77.0
Command: /home/biocbuild/bbs-3.24-bioc/R/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/home/biocbuild/bbs-3.24-bioc/R/site-library --timings BufferedMatrix_1.77.0.tar.gz
StartedAt: 2026-05-20 21:58:40 -0400 (Wed, 20 May 2026)
EndedAt: 2026-05-20 21:59:04 -0400 (Wed, 20 May 2026)
EllapsedTime: 24.0 seconds
RetCode: 0
Status:   OK  
CheckDir: BufferedMatrix.Rcheck
Warnings: 0

Command output

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


* using log directory ‘/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck’
* using R version 4.6.0 RC (2026-04-17 r89917)
* using platform: x86_64-pc-linux-gnu
* R was compiled by
    gcc (Ubuntu 13.3.0-6ubuntu2~24.04.1) 13.3.0
    GNU Fortran (Ubuntu 13.3.0-6ubuntu2~24.04.1) 13.3.0
* running under: Ubuntu 24.04.4 LTS
* using session charset: UTF-8
* current time: 2026-05-21 01:58:41 UTC
* checking for file ‘BufferedMatrix/DESCRIPTION’ ... OK
* this is package ‘BufferedMatrix’ version ‘1.77.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.1) 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 ... INFO
Note: information on .o files is not available
* checking sizes of PDF files under ‘inst/doc’ ...* 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: 1 NOTE
See
  ‘/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/00check.log’
for details.


Installation output

BufferedMatrix.Rcheck/00install.out

##############################################################################
##############################################################################
###
### Running command:
###
###   /home/biocbuild/bbs-3.24-bioc/R/bin/R CMD INSTALL BufferedMatrix
###
##############################################################################
##############################################################################


* installing to library ‘/home/biocbuild/bbs-3.24-bioc/R/site-library’
* installing *source* package ‘BufferedMatrix’ ...
** this is package ‘BufferedMatrix’ version ‘1.77.0’
** using staged installation
** libs
using C compiler: ‘gcc (Ubuntu 13.3.0-6ubuntu2~24.04.1) 13.3.0’
gcc -std=gnu2x -I"/home/biocbuild/bbs-3.24-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.24-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.24-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.24-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.24-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.24-bioc/R/lib -lR
installing to /home/biocbuild/bbs-3.24-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.6.0 RC (2026-04-17 r89917) -- "Because it was There"
Copyright (C) 2026 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.245   0.038   0.272 

BufferedMatrix.Rcheck/tests/objectTesting.Rout


R version 4.6.0 RC (2026-04-17 r89917) -- "Because it was There"
Copyright (C) 2026 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.24-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 480233 25.7    1053308 56.3   637571 34.1
Vcells 887253  6.8    8388608 64.0  2083896 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] "Wed May 20 21:58:56 2026"
> 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] "Wed May 20 21:58:56 2026"
> 
> 
> 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: 0x587fdd001520>
> 
> 
> 
> 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] "Wed May 20 21:58:56 2026"
> 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] "Wed May 20 21:58:56 2026"
> 
> ColMode(tmp2)
<pointer: 0x587fdd001520>
> 
> 
> 
> ### Now testing assignments
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+ 
+   new.data <- rnorm(20)
+   tmp2[which.row,] <- new.data
+   test.matrix[which.row,] <- new.data
+   if (rep > 1){
+     if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+   
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   new.data <- rnorm(10)
+   tmp2[,which.col] <- new.data
+   test.matrix[,which.col]<- new.data
+ 
+   if (rep > 1){
+     if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.col <- which.col
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,5,replace=TRUE)
+   new.data <- matrix(rnorm(50),5,10)
+   tmp2[,which.col] <- new.data
+   test.matrix[,which.col]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.col <- which.col
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   new.data <- matrix(rnorm(50),5,10)
+   tmp2[which.row,] <- new.data
+   test.matrix[which.row,]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col  <- sample(1:20,5,replace=TRUE)
+   new.data <- matrix(rnorm(25),5,5)
+   tmp2[which.row,which.col] <- new.data
+   test.matrix[which.row,which.col]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[prev.row,prev.col] == test.matrix[prev.row,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+   prev.col <- which.col
+ }
> 
> 
> 
> 
> ###
> ###
> ### testing some more functions
> ###
> 
> 
> 
> ## duplication function
> tmp5 <- duplicate(tmp2)
> 
> # making sure really did copy everything.
> tmp5[1,1] <- tmp5[1,1] +100.00
> 
> if (tmp5[1,1] == tmp2[1,1]){
+   stop("Problem with duplication")
+ }
> 
> 
> 
> 
> ### testing elementwise applying of functions
> 
> tmp5[1:4,1:4]
           [,1]       [,2]       [,3]        [,4]
[1,] 99.9432684 -0.6317843 -0.4256373  0.09090355
[2,]  0.6420287  0.4103068 -0.5630367 -1.03029726
[3,] -0.9759818 -0.5674987 -0.8532136  0.40319947
[4,] -0.8331290 -0.8942566 -0.2161136 -1.08730432
> ewApply(tmp5,abs)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
           [,1]      [,2]      [,3]       [,4]
[1,] 99.9432684 0.6317843 0.4256373 0.09090355
[2,]  0.6420287 0.4103068 0.5630367 1.03029726
[3,]  0.9759818 0.5674987 0.8532136 0.40319947
[4,]  0.8331290 0.8942566 0.2161136 1.08730432
> ewApply(tmp5,sqrt)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
          [,1]      [,2]      [,3]      [,4]
[1,] 9.9971630 0.7948486 0.6524089 0.3015022
[2,] 0.8012669 0.6405520 0.7503577 1.0150356
[3,] 0.9879179 0.7533251 0.9236956 0.6349799
[4,] 0.9127590 0.9456514 0.4648802 1.0427389
> 
> 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.24-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
          [,1]     [,2]     [,3]     [,4]
[1,] 224.91490 33.58027 31.94973 28.10593
[2,]  33.65470 31.81583 33.06661 36.18065
[3,]  35.85516 33.10075 35.09017 31.75300
[4,]  34.96072 35.35077 29.86492 36.51469
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x587fdddec8f0>
> exp(tmp5)
<pointer: 0x587fdddec8f0>
> log(tmp5,2)
<pointer: 0x587fdddec8f0>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 468.1309
> Min(tmp5)
[1] 52.46856
> mean(tmp5)
[1] 72.71088
> Sum(tmp5)
[1] 14542.18
> Var(tmp5)
[1] 861.9454
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 87.54697 70.42192 70.14871 68.52061 70.10895 72.73546 69.27390 72.38558
 [9] 70.25841 75.70829
> rowSums(tmp5)
 [1] 1750.939 1408.438 1402.974 1370.412 1402.179 1454.709 1385.478 1447.712
 [9] 1405.168 1514.166
> rowVars(tmp5)
 [1] 8077.06403   62.64237   70.51021   61.89339  116.47365  103.03569
 [7]   40.77051   58.17556   73.16795   65.94664
> rowSd(tmp5)
 [1] 89.872488  7.914693  8.397036  7.867235 10.792296 10.150650  6.385179
 [8]  7.627291  8.553826  8.120754
> rowMax(tmp5)
 [1] 468.13089  85.88665  88.40725  84.61836  95.91755  88.58263  77.46873
 [8]  88.16974  85.58418  91.96780
> rowMin(tmp5)
 [1] 57.84902 60.02693 54.54617 55.26392 53.96026 54.64938 52.46856 60.59256
 [9] 55.17787 59.13776
> 
> colMeans(tmp5)
 [1] 109.81593  72.35803  67.86300  72.51356  69.28992  73.53120  71.13930
 [8]  76.48207  72.35947  66.14591  66.10715  72.46390  70.59356  72.70727
[15]  70.63081  75.30957  70.11166  69.45144  65.51371  69.83015
> colSums(tmp5)
 [1] 1098.1593  723.5803  678.6300  725.1356  692.8992  735.3120  711.3930
 [8]  764.8207  723.5947  661.4591  661.0715  724.6390  705.9356  727.0727
[15]  706.3081  753.0957  701.1166  694.5144  655.1371  698.3015
> colVars(tmp5)
 [1] 15919.36306    34.12535    48.76204   103.09546    87.66069    28.40591
 [7]    88.58346    70.90075    64.88781    95.26441    35.59082    69.74128
[13]    89.04303    82.04644   172.94537    65.44854    45.71857    68.23343
[19]    46.43274    54.04211
> colSd(tmp5)
 [1] 126.171958   5.841691   6.982982  10.153594   9.362729   5.329719
 [7]   9.411879   8.420258   8.055297   9.760349   5.965804   8.351124
[13]   9.436261   9.057949  13.150870   8.090027   6.761551   8.260353
[19]   6.814157   7.351334
> colMax(tmp5)
 [1] 468.13089  85.00202  79.22740  95.91755  88.40725  81.84043  86.81946
 [8]  88.58263  84.24513  84.61836  77.46873  85.58418  88.16974  83.87933
[15]  91.96780  86.01261  80.70105  81.47373  81.97600  82.77714
> colMin(tmp5)
 [1] 58.78075 65.03275 57.30457 58.49880 54.64938 65.42973 57.84902 64.23576
 [9] 59.84034 53.96026 60.30603 61.57070 58.97462 56.82008 52.46856 61.75691
[17] 61.21756 56.75608 55.26392 60.39528
> 
> 
> ### 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] 87.54697 70.42192 70.14871 68.52061 70.10895 72.73546       NA 72.38558
 [9] 70.25841 75.70829
> rowSums(tmp5)
 [1] 1750.939 1408.438 1402.974 1370.412 1402.179 1454.709       NA 1447.712
 [9] 1405.168 1514.166
> rowVars(tmp5)
 [1] 8077.06403   62.64237   70.51021   61.89339  116.47365  103.03569
 [7]   42.05029   58.17556   73.16795   65.94664
> rowSd(tmp5)
 [1] 89.872488  7.914693  8.397036  7.867235 10.792296 10.150650  6.484620
 [8]  7.627291  8.553826  8.120754
> rowMax(tmp5)
 [1] 468.13089  85.88665  88.40725  84.61836  95.91755  88.58263        NA
 [8]  88.16974  85.58418  91.96780
> rowMin(tmp5)
 [1] 57.84902 60.02693 54.54617 55.26392 53.96026 54.64938       NA 60.59256
 [9] 55.17787 59.13776
> 
> colMeans(tmp5)
 [1] 109.81593  72.35803  67.86300  72.51356  69.28992  73.53120  71.13930
 [8]  76.48207  72.35947  66.14591  66.10715  72.46390  70.59356  72.70727
[15]  70.63081  75.30957        NA  69.45144  65.51371  69.83015
> colSums(tmp5)
 [1] 1098.1593  723.5803  678.6300  725.1356  692.8992  735.3120  711.3930
 [8]  764.8207  723.5947  661.4591  661.0715  724.6390  705.9356  727.0727
[15]  706.3081  753.0957        NA  694.5144  655.1371  698.3015
> colVars(tmp5)
 [1] 15919.36306    34.12535    48.76204   103.09546    87.66069    28.40591
 [7]    88.58346    70.90075    64.88781    95.26441    35.59082    69.74128
[13]    89.04303    82.04644   172.94537    65.44854          NA    68.23343
[19]    46.43274    54.04211
> colSd(tmp5)
 [1] 126.171958   5.841691   6.982982  10.153594   9.362729   5.329719
 [7]   9.411879   8.420258   8.055297   9.760349   5.965804   8.351124
[13]   9.436261   9.057949  13.150870   8.090027         NA   8.260353
[19]   6.814157   7.351334
> colMax(tmp5)
 [1] 468.13089  85.00202  79.22740  95.91755  88.40725  81.84043  86.81946
 [8]  88.58263  84.24513  84.61836  77.46873  85.58418  88.16974  83.87933
[15]  91.96780  86.01261        NA  81.47373  81.97600  82.77714
> colMin(tmp5)
 [1] 58.78075 65.03275 57.30457 58.49880 54.64938 65.42973 57.84902 64.23576
 [9] 59.84034 53.96026 60.30603 61.57070 58.97462 56.82008 52.46856 61.75691
[17]       NA 56.75608 55.26392 60.39528
> 
> Max(tmp5,na.rm=TRUE)
[1] 468.1309
> Min(tmp5,na.rm=TRUE)
[1] 52.46856
> mean(tmp5,na.rm=TRUE)
[1] 72.70753
> Sum(tmp5,na.rm=TRUE)
[1] 14468.8
> Var(tmp5,na.rm=TRUE)
[1] 866.2964
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 87.54697 70.42192 70.14871 68.52061 70.10895 72.73546 69.05787 72.38558
 [9] 70.25841 75.70829
> rowSums(tmp5,na.rm=TRUE)
 [1] 1750.939 1408.438 1402.974 1370.412 1402.179 1454.709 1312.099 1447.712
 [9] 1405.168 1514.166
> rowVars(tmp5,na.rm=TRUE)
 [1] 8077.06403   62.64237   70.51021   61.89339  116.47365  103.03569
 [7]   42.05029   58.17556   73.16795   65.94664
> rowSd(tmp5,na.rm=TRUE)
 [1] 89.872488  7.914693  8.397036  7.867235 10.792296 10.150650  6.484620
 [8]  7.627291  8.553826  8.120754
> rowMax(tmp5,na.rm=TRUE)
 [1] 468.13089  85.88665  88.40725  84.61836  95.91755  88.58263  77.46873
 [8]  88.16974  85.58418  91.96780
> rowMin(tmp5,na.rm=TRUE)
 [1] 57.84902 60.02693 54.54617 55.26392 53.96026 54.64938 52.46856 60.59256
 [9] 55.17787 59.13776
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 109.81593  72.35803  67.86300  72.51356  69.28992  73.53120  71.13930
 [8]  76.48207  72.35947  66.14591  66.10715  72.46390  70.59356  72.70727
[15]  70.63081  75.30957  69.74868  69.45144  65.51371  69.83015
> colSums(tmp5,na.rm=TRUE)
 [1] 1098.1593  723.5803  678.6300  725.1356  692.8992  735.3120  711.3930
 [8]  764.8207  723.5947  661.4591  661.0715  724.6390  705.9356  727.0727
[15]  706.3081  753.0957  627.7381  694.5144  655.1371  698.3015
> colVars(tmp5,na.rm=TRUE)
 [1] 15919.36306    34.12535    48.76204   103.09546    87.66069    28.40591
 [7]    88.58346    70.90075    64.88781    95.26441    35.59082    69.74128
[13]    89.04303    82.04644   172.94537    65.44854    49.95113    68.23343
[19]    46.43274    54.04211
> colSd(tmp5,na.rm=TRUE)
 [1] 126.171958   5.841691   6.982982  10.153594   9.362729   5.329719
 [7]   9.411879   8.420258   8.055297   9.760349   5.965804   8.351124
[13]   9.436261   9.057949  13.150870   8.090027   7.067612   8.260353
[19]   6.814157   7.351334
> colMax(tmp5,na.rm=TRUE)
 [1] 468.13089  85.00202  79.22740  95.91755  88.40725  81.84043  86.81946
 [8]  88.58263  84.24513  84.61836  77.46873  85.58418  88.16974  83.87933
[15]  91.96780  86.01261  80.70105  81.47373  81.97600  82.77714
> colMin(tmp5,na.rm=TRUE)
 [1] 58.78075 65.03275 57.30457 58.49880 54.64938 65.42973 57.84902 64.23576
 [9] 59.84034 53.96026 60.30603 61.57070 58.97462 56.82008 52.46856 61.75691
[17] 61.21756 56.75608 55.26392 60.39528
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1] 87.54697 70.42192 70.14871 68.52061 70.10895 72.73546      NaN 72.38558
 [9] 70.25841 75.70829
> rowSums(tmp5,na.rm=TRUE)
 [1] 1750.939 1408.438 1402.974 1370.412 1402.179 1454.709    0.000 1447.712
 [9] 1405.168 1514.166
> rowVars(tmp5,na.rm=TRUE)
 [1] 8077.06403   62.64237   70.51021   61.89339  116.47365  103.03569
 [7]         NA   58.17556   73.16795   65.94664
> rowSd(tmp5,na.rm=TRUE)
 [1] 89.872488  7.914693  8.397036  7.867235 10.792296 10.150650        NA
 [8]  7.627291  8.553826  8.120754
> rowMax(tmp5,na.rm=TRUE)
 [1] 468.13089  85.88665  88.40725  84.61836  95.91755  88.58263        NA
 [8]  88.16974  85.58418  91.96780
> rowMin(tmp5,na.rm=TRUE)
 [1] 57.84902 60.02693 54.54617 55.26392 53.96026 54.64938       NA 60.59256
 [9] 55.17787 59.13776
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1] 114.32336  73.17195  67.60104  72.27365  69.75362  73.16641  71.06865
 [8]  77.74360  72.59121  65.13908  64.84475  73.42118  70.92121  72.17956
[15]  72.64884  75.93039       NaN  68.85768  66.05431  70.41616
> colSums(tmp5,na.rm=TRUE)
 [1] 1028.9103  658.5476  608.4093  650.4628  627.7826  658.4977  639.6178
 [8]  699.6924  653.3209  586.2517  583.6028  660.7906  638.2909  649.6161
[15]  653.8395  683.3735    0.0000  619.7191  594.4888  633.7455
> colVars(tmp5,na.rm=TRUE)
 [1] 17680.71733    30.93827    54.08528   115.33487    96.19928    30.45959
 [7]    99.60023    61.85938    72.39459    95.76811    22.11113    68.14952
[13]    98.96568    89.16935   148.74864    69.29367          NA    72.79647
[19]    48.94900    56.93399
> colSd(tmp5,na.rm=TRUE)
 [1] 132.968858   5.562218   7.354270  10.739407   9.808123   5.519021
 [7]   9.979991   7.865074   8.508501   9.786118   4.702248   8.255272
[13]   9.948149   9.442952  12.196255   8.324282         NA   8.532085
[19]   6.996356   7.545462
> colMax(tmp5,na.rm=TRUE)
 [1] 468.13089  85.00202  79.22740  95.91755  88.40725  81.84043  86.81946
 [8]  88.58263  84.24513  84.61836  72.06917  85.58418  88.16974  83.87933
[15]  91.96780  86.01261      -Inf  81.47373  81.97600  82.77714
> colMin(tmp5,na.rm=TRUE)
 [1] 58.78075 66.22047 57.30457 58.49880 54.64938 65.42973 57.84902 64.23576
 [9] 59.84034 53.96026 60.30603 61.57070 58.97462 56.82008 55.17787 61.75691
[17]      Inf 56.75608 55.26392 60.39528
> 
> 
> 
> 
> 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] 171.1175 307.0238 149.4534 151.7881 250.2487 295.2757 164.7263 288.8294
 [9] 355.9944 462.0359
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 171.1175 307.0238 149.4534 151.7881 250.2487 295.2757 164.7263 288.8294
 [9] 355.9944 462.0359
> 
> 
> 
> 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] -1.136868e-13 -3.126388e-13  0.000000e+00 -2.842171e-13  5.684342e-14
 [6]  1.705303e-13 -2.842171e-14  0.000000e+00  1.705303e-13 -2.842171e-14
[11]  2.273737e-13 -1.705303e-13  1.705303e-13  2.842171e-14  0.000000e+00
[16] -1.136868e-13  5.684342e-14  1.421085e-13  1.136868e-13 -5.684342e-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   9 
4   5 
2   11 
6   16 
6   6 
6   3 
4   12 
6   2 
2   13 
4   2 
7   10 
6   17 
3   10 
2   18 
9   18 
9   6 
10   20 
10   17 
4   3 
7   12 
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.388635
> Min(tmp)
[1] -2.623331
> mean(tmp)
[1] -0.05669824
> Sum(tmp)
[1] -5.669824
> Var(tmp)
[1] 0.9527887
> 
> rowMeans(tmp)
[1] -0.05669824
> rowSums(tmp)
[1] -5.669824
> rowVars(tmp)
[1] 0.9527887
> rowSd(tmp)
[1] 0.976109
> rowMax(tmp)
[1] 2.388635
> rowMin(tmp)
[1] -2.623331
> 
> colMeans(tmp)
  [1] -0.071370154 -0.097286024  1.756243345  0.192031762 -0.451501480
  [6] -1.448053669 -0.102987642 -0.084906969  0.391735163 -0.553810734
 [11] -0.099004537 -0.309514531 -0.248807134  1.153196833  0.970144207
 [16] -0.396177715 -0.235425887  0.630470746  0.533419778 -0.171259188
 [21]  0.186589198 -0.326224772 -1.372379646 -0.693697654  0.077018275
 [26] -0.293952806 -1.286861584  1.394214698  0.363999284 -0.992281368
 [31] -1.718509599  0.716475993 -0.568243844 -0.645038679 -0.618546061
 [36]  0.239763706 -2.623331118 -1.420421770  0.235252664  1.105258325
 [41] -1.203347179  0.772193916  0.699983753  0.898863128 -0.026422586
 [46] -0.962345136  0.952130496  1.210759150  0.340965070 -0.933151394
 [51] -1.630226058 -0.020429566 -0.626371299 -0.813733276  0.130431311
 [56] -0.180373963  1.707895264 -0.603058723  0.652369529 -0.601588693
 [61]  2.081192078  0.496876679 -1.541153522  1.579068586  0.569082256
 [66] -0.409077064 -0.398221892 -1.558330391 -0.610943869  1.417856959
 [71] -1.318516775 -1.252594919  0.009302059 -1.903505535 -2.022239027
 [76] -0.098900184  1.767696769 -0.888331433  0.634316371 -1.263522656
 [81]  0.027048324 -0.025518853  0.774812105 -0.829780266 -0.836974583
 [86] -0.445643303 -0.135506479  1.084923557  2.388634904  1.214617209
 [91] -1.446941215  0.250908867  0.487739765  0.303911782  0.469414457
 [96]  0.926038539  1.046660606 -0.111816545  0.798119014  0.218710107
> colSums(tmp)
  [1] -0.071370154 -0.097286024  1.756243345  0.192031762 -0.451501480
  [6] -1.448053669 -0.102987642 -0.084906969  0.391735163 -0.553810734
 [11] -0.099004537 -0.309514531 -0.248807134  1.153196833  0.970144207
 [16] -0.396177715 -0.235425887  0.630470746  0.533419778 -0.171259188
 [21]  0.186589198 -0.326224772 -1.372379646 -0.693697654  0.077018275
 [26] -0.293952806 -1.286861584  1.394214698  0.363999284 -0.992281368
 [31] -1.718509599  0.716475993 -0.568243844 -0.645038679 -0.618546061
 [36]  0.239763706 -2.623331118 -1.420421770  0.235252664  1.105258325
 [41] -1.203347179  0.772193916  0.699983753  0.898863128 -0.026422586
 [46] -0.962345136  0.952130496  1.210759150  0.340965070 -0.933151394
 [51] -1.630226058 -0.020429566 -0.626371299 -0.813733276  0.130431311
 [56] -0.180373963  1.707895264 -0.603058723  0.652369529 -0.601588693
 [61]  2.081192078  0.496876679 -1.541153522  1.579068586  0.569082256
 [66] -0.409077064 -0.398221892 -1.558330391 -0.610943869  1.417856959
 [71] -1.318516775 -1.252594919  0.009302059 -1.903505535 -2.022239027
 [76] -0.098900184  1.767696769 -0.888331433  0.634316371 -1.263522656
 [81]  0.027048324 -0.025518853  0.774812105 -0.829780266 -0.836974583
 [86] -0.445643303 -0.135506479  1.084923557  2.388634904  1.214617209
 [91] -1.446941215  0.250908867  0.487739765  0.303911782  0.469414457
 [96]  0.926038539  1.046660606 -0.111816545  0.798119014  0.218710107
> 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.071370154 -0.097286024  1.756243345  0.192031762 -0.451501480
  [6] -1.448053669 -0.102987642 -0.084906969  0.391735163 -0.553810734
 [11] -0.099004537 -0.309514531 -0.248807134  1.153196833  0.970144207
 [16] -0.396177715 -0.235425887  0.630470746  0.533419778 -0.171259188
 [21]  0.186589198 -0.326224772 -1.372379646 -0.693697654  0.077018275
 [26] -0.293952806 -1.286861584  1.394214698  0.363999284 -0.992281368
 [31] -1.718509599  0.716475993 -0.568243844 -0.645038679 -0.618546061
 [36]  0.239763706 -2.623331118 -1.420421770  0.235252664  1.105258325
 [41] -1.203347179  0.772193916  0.699983753  0.898863128 -0.026422586
 [46] -0.962345136  0.952130496  1.210759150  0.340965070 -0.933151394
 [51] -1.630226058 -0.020429566 -0.626371299 -0.813733276  0.130431311
 [56] -0.180373963  1.707895264 -0.603058723  0.652369529 -0.601588693
 [61]  2.081192078  0.496876679 -1.541153522  1.579068586  0.569082256
 [66] -0.409077064 -0.398221892 -1.558330391 -0.610943869  1.417856959
 [71] -1.318516775 -1.252594919  0.009302059 -1.903505535 -2.022239027
 [76] -0.098900184  1.767696769 -0.888331433  0.634316371 -1.263522656
 [81]  0.027048324 -0.025518853  0.774812105 -0.829780266 -0.836974583
 [86] -0.445643303 -0.135506479  1.084923557  2.388634904  1.214617209
 [91] -1.446941215  0.250908867  0.487739765  0.303911782  0.469414457
 [96]  0.926038539  1.046660606 -0.111816545  0.798119014  0.218710107
> colMin(tmp)
  [1] -0.071370154 -0.097286024  1.756243345  0.192031762 -0.451501480
  [6] -1.448053669 -0.102987642 -0.084906969  0.391735163 -0.553810734
 [11] -0.099004537 -0.309514531 -0.248807134  1.153196833  0.970144207
 [16] -0.396177715 -0.235425887  0.630470746  0.533419778 -0.171259188
 [21]  0.186589198 -0.326224772 -1.372379646 -0.693697654  0.077018275
 [26] -0.293952806 -1.286861584  1.394214698  0.363999284 -0.992281368
 [31] -1.718509599  0.716475993 -0.568243844 -0.645038679 -0.618546061
 [36]  0.239763706 -2.623331118 -1.420421770  0.235252664  1.105258325
 [41] -1.203347179  0.772193916  0.699983753  0.898863128 -0.026422586
 [46] -0.962345136  0.952130496  1.210759150  0.340965070 -0.933151394
 [51] -1.630226058 -0.020429566 -0.626371299 -0.813733276  0.130431311
 [56] -0.180373963  1.707895264 -0.603058723  0.652369529 -0.601588693
 [61]  2.081192078  0.496876679 -1.541153522  1.579068586  0.569082256
 [66] -0.409077064 -0.398221892 -1.558330391 -0.610943869  1.417856959
 [71] -1.318516775 -1.252594919  0.009302059 -1.903505535 -2.022239027
 [76] -0.098900184  1.767696769 -0.888331433  0.634316371 -1.263522656
 [81]  0.027048324 -0.025518853  0.774812105 -0.829780266 -0.836974583
 [86] -0.445643303 -0.135506479  1.084923557  2.388634904  1.214617209
 [91] -1.446941215  0.250908867  0.487739765  0.303911782  0.469414457
 [96]  0.926038539  1.046660606 -0.111816545  0.798119014  0.218710107
> colMedians(tmp)
  [1] -0.071370154 -0.097286024  1.756243345  0.192031762 -0.451501480
  [6] -1.448053669 -0.102987642 -0.084906969  0.391735163 -0.553810734
 [11] -0.099004537 -0.309514531 -0.248807134  1.153196833  0.970144207
 [16] -0.396177715 -0.235425887  0.630470746  0.533419778 -0.171259188
 [21]  0.186589198 -0.326224772 -1.372379646 -0.693697654  0.077018275
 [26] -0.293952806 -1.286861584  1.394214698  0.363999284 -0.992281368
 [31] -1.718509599  0.716475993 -0.568243844 -0.645038679 -0.618546061
 [36]  0.239763706 -2.623331118 -1.420421770  0.235252664  1.105258325
 [41] -1.203347179  0.772193916  0.699983753  0.898863128 -0.026422586
 [46] -0.962345136  0.952130496  1.210759150  0.340965070 -0.933151394
 [51] -1.630226058 -0.020429566 -0.626371299 -0.813733276  0.130431311
 [56] -0.180373963  1.707895264 -0.603058723  0.652369529 -0.601588693
 [61]  2.081192078  0.496876679 -1.541153522  1.579068586  0.569082256
 [66] -0.409077064 -0.398221892 -1.558330391 -0.610943869  1.417856959
 [71] -1.318516775 -1.252594919  0.009302059 -1.903505535 -2.022239027
 [76] -0.098900184  1.767696769 -0.888331433  0.634316371 -1.263522656
 [81]  0.027048324 -0.025518853  0.774812105 -0.829780266 -0.836974583
 [86] -0.445643303 -0.135506479  1.084923557  2.388634904  1.214617209
 [91] -1.446941215  0.250908867  0.487739765  0.303911782  0.469414457
 [96]  0.926038539  1.046660606 -0.111816545  0.798119014  0.218710107
> colRanges(tmp)
            [,1]        [,2]     [,3]      [,4]       [,5]      [,6]       [,7]
[1,] -0.07137015 -0.09728602 1.756243 0.1920318 -0.4515015 -1.448054 -0.1029876
[2,] -0.07137015 -0.09728602 1.756243 0.1920318 -0.4515015 -1.448054 -0.1029876
            [,8]      [,9]      [,10]       [,11]      [,12]      [,13]
[1,] -0.08490697 0.3917352 -0.5538107 -0.09900454 -0.3095145 -0.2488071
[2,] -0.08490697 0.3917352 -0.5538107 -0.09900454 -0.3095145 -0.2488071
        [,14]     [,15]      [,16]      [,17]     [,18]     [,19]      [,20]
[1,] 1.153197 0.9701442 -0.3961777 -0.2354259 0.6304707 0.5334198 -0.1712592
[2,] 1.153197 0.9701442 -0.3961777 -0.2354259 0.6304707 0.5334198 -0.1712592
         [,21]      [,22]    [,23]      [,24]      [,25]      [,26]     [,27]
[1,] 0.1865892 -0.3262248 -1.37238 -0.6936977 0.07701828 -0.2939528 -1.286862
[2,] 0.1865892 -0.3262248 -1.37238 -0.6936977 0.07701828 -0.2939528 -1.286862
        [,28]     [,29]      [,30]    [,31]    [,32]      [,33]      [,34]
[1,] 1.394215 0.3639993 -0.9922814 -1.71851 0.716476 -0.5682438 -0.6450387
[2,] 1.394215 0.3639993 -0.9922814 -1.71851 0.716476 -0.5682438 -0.6450387
          [,35]     [,36]     [,37]     [,38]     [,39]    [,40]     [,41]
[1,] -0.6185461 0.2397637 -2.623331 -1.420422 0.2352527 1.105258 -1.203347
[2,] -0.6185461 0.2397637 -2.623331 -1.420422 0.2352527 1.105258 -1.203347
         [,42]     [,43]     [,44]       [,45]      [,46]     [,47]    [,48]
[1,] 0.7721939 0.6999838 0.8988631 -0.02642259 -0.9623451 0.9521305 1.210759
[2,] 0.7721939 0.6999838 0.8988631 -0.02642259 -0.9623451 0.9521305 1.210759
         [,49]      [,50]     [,51]       [,52]      [,53]      [,54]     [,55]
[1,] 0.3409651 -0.9331514 -1.630226 -0.02042957 -0.6263713 -0.8137333 0.1304313
[2,] 0.3409651 -0.9331514 -1.630226 -0.02042957 -0.6263713 -0.8137333 0.1304313
         [,56]    [,57]      [,58]     [,59]      [,60]    [,61]     [,62]
[1,] -0.180374 1.707895 -0.6030587 0.6523695 -0.6015887 2.081192 0.4968767
[2,] -0.180374 1.707895 -0.6030587 0.6523695 -0.6015887 2.081192 0.4968767
         [,63]    [,64]     [,65]      [,66]      [,67]    [,68]      [,69]
[1,] -1.541154 1.579069 0.5690823 -0.4090771 -0.3982219 -1.55833 -0.6109439
[2,] -1.541154 1.579069 0.5690823 -0.4090771 -0.3982219 -1.55833 -0.6109439
        [,70]     [,71]     [,72]       [,73]     [,74]     [,75]       [,76]
[1,] 1.417857 -1.318517 -1.252595 0.009302059 -1.903506 -2.022239 -0.09890018
[2,] 1.417857 -1.318517 -1.252595 0.009302059 -1.903506 -2.022239 -0.09890018
        [,77]      [,78]     [,79]     [,80]      [,81]       [,82]     [,83]
[1,] 1.767697 -0.8883314 0.6343164 -1.263523 0.02704832 -0.02551885 0.7748121
[2,] 1.767697 -0.8883314 0.6343164 -1.263523 0.02704832 -0.02551885 0.7748121
          [,84]      [,85]      [,86]      [,87]    [,88]    [,89]    [,90]
[1,] -0.8297803 -0.8369746 -0.4456433 -0.1355065 1.084924 2.388635 1.214617
[2,] -0.8297803 -0.8369746 -0.4456433 -0.1355065 1.084924 2.388635 1.214617
         [,91]     [,92]     [,93]     [,94]     [,95]     [,96]    [,97]
[1,] -1.446941 0.2509089 0.4877398 0.3039118 0.4694145 0.9260385 1.046661
[2,] -1.446941 0.2509089 0.4877398 0.3039118 0.4694145 0.9260385 1.046661
          [,98]    [,99]    [,100]
[1,] -0.1118165 0.798119 0.2187101
[2,] -0.1118165 0.798119 0.2187101
> 
> 
> Max(tmp2)
[1] 1.929186
> Min(tmp2)
[1] -2.582259
> mean(tmp2)
[1] 0.02479307
> Sum(tmp2)
[1] 2.479307
> Var(tmp2)
[1] 0.9404489
> 
> rowMeans(tmp2)
  [1]  1.58554623  1.12143609  0.74374564  1.61104029  0.73635449 -0.91373221
  [7]  0.25175487 -0.72876290  0.69090886 -0.17428749 -1.38566630  1.89807017
 [13]  1.21409844  1.57392065  0.61943248  0.72326609  0.16982180  0.13576169
 [19] -1.04073402  0.73053910 -1.71341231 -0.70983375 -0.97428860  1.25683110
 [25] -0.14431161  1.15377923  0.76170621  0.46037206 -0.90497936 -0.64808276
 [31]  0.79873324 -0.40786653  1.23178506 -0.97910414  0.87464549 -1.00185330
 [37] -0.12850838  0.64172839 -1.00325506  0.46827300 -0.28299513 -0.91296341
 [43]  0.05342211 -1.99227633 -0.96227787  0.36852348 -0.87825969 -0.32113783
 [49] -0.25034841 -1.89405989  0.77952594 -0.05002770 -1.59858680  1.81781392
 [55]  1.67663595 -0.56019391 -0.95218222 -1.03644330  0.17162146 -0.52979448
 [61] -0.13320162  1.92918642  0.83638130 -0.26717057  0.61504980 -0.19681763
 [67]  0.11103672  0.79690994 -1.46773681 -0.60231408 -2.58225853  0.10765582
 [73] -1.71182145  0.90156715 -0.02037528  1.12593342 -0.42500932 -0.78138362
 [79]  1.11859623 -0.32902848  0.57491687 -0.50616938 -0.35806753 -1.06487802
 [85] -0.35536159  0.63834005  0.41876226  1.39278960 -0.42056195  1.92145770
 [91] -1.12919206 -0.20320164  0.32629769 -0.05621281 -0.18574017  0.61852440
 [97]  1.02877114 -0.16452137 -0.28197135  0.01925775
> rowSums(tmp2)
  [1]  1.58554623  1.12143609  0.74374564  1.61104029  0.73635449 -0.91373221
  [7]  0.25175487 -0.72876290  0.69090886 -0.17428749 -1.38566630  1.89807017
 [13]  1.21409844  1.57392065  0.61943248  0.72326609  0.16982180  0.13576169
 [19] -1.04073402  0.73053910 -1.71341231 -0.70983375 -0.97428860  1.25683110
 [25] -0.14431161  1.15377923  0.76170621  0.46037206 -0.90497936 -0.64808276
 [31]  0.79873324 -0.40786653  1.23178506 -0.97910414  0.87464549 -1.00185330
 [37] -0.12850838  0.64172839 -1.00325506  0.46827300 -0.28299513 -0.91296341
 [43]  0.05342211 -1.99227633 -0.96227787  0.36852348 -0.87825969 -0.32113783
 [49] -0.25034841 -1.89405989  0.77952594 -0.05002770 -1.59858680  1.81781392
 [55]  1.67663595 -0.56019391 -0.95218222 -1.03644330  0.17162146 -0.52979448
 [61] -0.13320162  1.92918642  0.83638130 -0.26717057  0.61504980 -0.19681763
 [67]  0.11103672  0.79690994 -1.46773681 -0.60231408 -2.58225853  0.10765582
 [73] -1.71182145  0.90156715 -0.02037528  1.12593342 -0.42500932 -0.78138362
 [79]  1.11859623 -0.32902848  0.57491687 -0.50616938 -0.35806753 -1.06487802
 [85] -0.35536159  0.63834005  0.41876226  1.39278960 -0.42056195  1.92145770
 [91] -1.12919206 -0.20320164  0.32629769 -0.05621281 -0.18574017  0.61852440
 [97]  1.02877114 -0.16452137 -0.28197135  0.01925775
> rowVars(tmp2)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowSd(tmp2)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowMax(tmp2)
  [1]  1.58554623  1.12143609  0.74374564  1.61104029  0.73635449 -0.91373221
  [7]  0.25175487 -0.72876290  0.69090886 -0.17428749 -1.38566630  1.89807017
 [13]  1.21409844  1.57392065  0.61943248  0.72326609  0.16982180  0.13576169
 [19] -1.04073402  0.73053910 -1.71341231 -0.70983375 -0.97428860  1.25683110
 [25] -0.14431161  1.15377923  0.76170621  0.46037206 -0.90497936 -0.64808276
 [31]  0.79873324 -0.40786653  1.23178506 -0.97910414  0.87464549 -1.00185330
 [37] -0.12850838  0.64172839 -1.00325506  0.46827300 -0.28299513 -0.91296341
 [43]  0.05342211 -1.99227633 -0.96227787  0.36852348 -0.87825969 -0.32113783
 [49] -0.25034841 -1.89405989  0.77952594 -0.05002770 -1.59858680  1.81781392
 [55]  1.67663595 -0.56019391 -0.95218222 -1.03644330  0.17162146 -0.52979448
 [61] -0.13320162  1.92918642  0.83638130 -0.26717057  0.61504980 -0.19681763
 [67]  0.11103672  0.79690994 -1.46773681 -0.60231408 -2.58225853  0.10765582
 [73] -1.71182145  0.90156715 -0.02037528  1.12593342 -0.42500932 -0.78138362
 [79]  1.11859623 -0.32902848  0.57491687 -0.50616938 -0.35806753 -1.06487802
 [85] -0.35536159  0.63834005  0.41876226  1.39278960 -0.42056195  1.92145770
 [91] -1.12919206 -0.20320164  0.32629769 -0.05621281 -0.18574017  0.61852440
 [97]  1.02877114 -0.16452137 -0.28197135  0.01925775
> rowMin(tmp2)
  [1]  1.58554623  1.12143609  0.74374564  1.61104029  0.73635449 -0.91373221
  [7]  0.25175487 -0.72876290  0.69090886 -0.17428749 -1.38566630  1.89807017
 [13]  1.21409844  1.57392065  0.61943248  0.72326609  0.16982180  0.13576169
 [19] -1.04073402  0.73053910 -1.71341231 -0.70983375 -0.97428860  1.25683110
 [25] -0.14431161  1.15377923  0.76170621  0.46037206 -0.90497936 -0.64808276
 [31]  0.79873324 -0.40786653  1.23178506 -0.97910414  0.87464549 -1.00185330
 [37] -0.12850838  0.64172839 -1.00325506  0.46827300 -0.28299513 -0.91296341
 [43]  0.05342211 -1.99227633 -0.96227787  0.36852348 -0.87825969 -0.32113783
 [49] -0.25034841 -1.89405989  0.77952594 -0.05002770 -1.59858680  1.81781392
 [55]  1.67663595 -0.56019391 -0.95218222 -1.03644330  0.17162146 -0.52979448
 [61] -0.13320162  1.92918642  0.83638130 -0.26717057  0.61504980 -0.19681763
 [67]  0.11103672  0.79690994 -1.46773681 -0.60231408 -2.58225853  0.10765582
 [73] -1.71182145  0.90156715 -0.02037528  1.12593342 -0.42500932 -0.78138362
 [79]  1.11859623 -0.32902848  0.57491687 -0.50616938 -0.35806753 -1.06487802
 [85] -0.35536159  0.63834005  0.41876226  1.39278960 -0.42056195  1.92145770
 [91] -1.12919206 -0.20320164  0.32629769 -0.05621281 -0.18574017  0.61852440
 [97]  1.02877114 -0.16452137 -0.28197135  0.01925775
> 
> colMeans(tmp2)
[1] 0.02479307
> colSums(tmp2)
[1] 2.479307
> colVars(tmp2)
[1] 0.9404489
> colSd(tmp2)
[1] 0.9697674
> colMax(tmp2)
[1] 1.929186
> colMin(tmp2)
[1] -2.582259
> colMedians(tmp2)
[1] -0.05312025
> colRanges(tmp2)
          [,1]
[1,] -2.582259
[2,]  1.929186
> 
> 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.8613256 -2.4587055  1.2130296 -2.5580228 -1.3452758  2.2333010
 [7]  3.9583312 -1.9514949  0.6563882  5.3465323
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -1.8672609
[2,] -0.6452924
[3,] -0.1835633
[4,]  0.7658220
[5,]  1.5053508
> 
> rowApply(tmp,sum)
 [1] -1.4315891  3.9146998 -1.3596244  0.2506319  1.0424042  2.2991939
 [7]  1.3305915  2.5842179 -6.0006371  1.6028692
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    7    1    1    5    6    8    9    9    6     8
 [2,]    5    2    2    9    8    1    1    5    9     6
 [3,]    4    6    6    4    7    7   10    8    1     7
 [4,]    1   10    9    3    2    4    3    2    3     9
 [5,]    9    9    8    1    1    6    6    4    2     4
 [6,]   10    4    5    6    5    9    4    1    8     5
 [7,]    6    7    7    2   10    2    8   10   10     2
 [8,]    2    5    4    8    4    5    7    3    7     3
 [9,]    3    3    3    7    9    3    2    7    5    10
[10,]    8    8   10   10    3   10    5    6    4     1
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1]  2.415402571  0.984914244  4.137296886  2.550942635  0.005689505
 [6]  2.984863205  5.008387435 -1.811138574 -1.443486624  0.109781841
[11] -3.971511731 -1.916013105 -6.914334085  1.268335529 -0.572034865
[16]  3.000039418 -0.870409707 -0.927934406 -2.044567652  1.619129587
> colApply(tmp,quantile)[,1]
           [,1]
[1,] 0.02221191
[2,] 0.24107643
[3,] 0.44521942
[4,] 0.83115790
[5,] 0.87573691
> 
> rowApply(tmp,sum)
[1]  2.3454582 -5.0949569  0.3300646 -1.7773104  7.8100966
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]   12   17   10   16   15
[2,]   13   10    7    3   19
[3,]   18   15    9    6   20
[4,]   17   14   16   13    8
[5,]   10    8   11    9   12
> 
> 
> as.matrix(tmp)
           [,1]       [,2]         [,3]        [,4]        [,5]       [,6]
[1,] 0.24107643  0.4842137  1.204353059  0.96393308  0.06217076  1.5007620
[2,] 0.87573691 -0.2053028  0.638808704  0.29671140 -0.70180855 -0.7286929
[3,] 0.02221191 -0.3726130  0.009397884  0.97942110  0.18861530  1.2236534
[4,] 0.44521942 -1.3378772 -0.815544277  0.32407365 -0.24232667  0.5280070
[5,] 0.83115790  2.4164935  3.100281515 -0.01319659  0.69903865  0.4611337
           [,7]       [,8]        [,9]      [,10]      [,11]      [,12]
[1,] -1.0746821  0.7079964 -1.29232931  0.6436703 -0.3091647 -0.3648297
[2,]  1.6746605 -1.8234711 -1.21045672  0.9165228 -1.0678578 -1.1004623
[3,]  0.9832584  0.2846733  1.26629600  0.3665981 -1.3061172  1.2005498
[4,]  1.7028525 -1.7032558 -0.25681785 -0.7976901  0.1232793 -0.8901500
[5,]  1.7222982  0.7229186  0.04982126 -1.0193192 -1.4116513 -0.7611209
          [,13]       [,14]      [,15]      [,16]      [,17]       [,18]
[1,] -1.0017224  0.01097932 -1.0164285  1.7484109 -0.5083446  0.09256876
[2,] -2.7186761  1.00062638  0.1920694 -0.1924253 -0.2271079 -1.34888492
[3,] -2.0033825 -0.13273098 -0.8915038  0.4933949  0.6418134 -0.77227919
[4,] -0.8983928  0.36024713  0.3345514  1.0926406 -0.1117337  0.24162312
[5,] -0.2921604  0.02921368  0.8092766 -0.1419817 -0.6650368  0.85903782
          [,19]       [,20]
[1,]  0.8407003 -0.58787548
[2,]  0.7079320 -0.07287856
[3,] -1.3437674 -0.50742484
[4,] -1.6990343  1.82301816
[5,] -0.5503983  0.96429031
> 
> 
> 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.24-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.24-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  648  bytes.
Disk usage :  200  bytes.
> subBufferedMatrix(tmp,,5:8)
BufferedMatrix object
Matrix size:  5 4 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  561  bytes.
Disk usage :  160  bytes.
> subBufferedMatrix(tmp,1:3,)
BufferedMatrix object
Matrix size:  3 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.24-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 1.629963 0.9784756 0.1264526 1.758438 -0.7760992 -0.1441366 -0.4726626
          col8      col9    col10    col11     col12    col13      col14
row1 0.5408941 0.4011144 2.094507 1.081973 -1.161585 0.630277 0.03089093
          col15  col16     col17     col18      col19     col20
row1 0.03357393 0.9608 0.6514134 -1.181169 -0.6426526 -1.508182
> tmp[,"col10"]
         col10
row1 2.0945069
row2 0.2197461
row3 0.1052607
row4 1.7051131
row5 0.7413958
> tmp[c("row1","row5"),]
          col1       col2      col3      col4       col5        col6       col7
row1 1.6299633  0.9784756 0.1264526 1.7584379 -0.7760992 -0.14413665 -0.4726626
row5 0.5974029 -0.4136364 0.5619862 0.9143954  0.2592765  0.01579904 -0.3268539
          col8      col9     col10    col11      col12     col13      col14
row1 0.5408941 0.4011144 2.0945069 1.081973 -1.1615851  0.630277 0.03089093
row5 0.1206226 0.6177983 0.7413958 2.081742 -0.1566517 -1.266657 0.71457559
          col15     col16      col17      col18      col19      col20
row1 0.03357393 0.9608000  0.6514134 -1.1811692 -0.6426526 -1.5081820
row5 0.10706351 0.2289014 -0.3337247  0.4019404 -0.7402944  0.4159396
> tmp[,c("col6","col20")]
            col6      col20
row1 -0.14413665 -1.5081820
row2 -0.29705382  0.6100673
row3 -0.67018249  1.1161613
row4 -0.78817568  1.4131762
row5  0.01579904  0.4159396
> tmp[c("row1","row5"),c("col6","col20")]
            col6      col20
row1 -0.14413665 -1.5081820
row5  0.01579904  0.4159396
> 
> 
> 
> 
> tmp["row1",] <- rnorm(20,mean=10)
> tmp[,"col10"] <- rnorm(5,mean=30)
> tmp[c("row1","row5"),] <- rnorm(40,mean=50)
> tmp[,c("col6","col20")] <- rnorm(10,mean=75)
> tmp[c("row1","row5"),c("col6","col20")]  <- rnorm(4,mean=105)
> 
> tmp["row1",]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 49.93939 49.58797 49.92139 48.74946 49.37434 104.2921 50.45109 49.25532
         col9    col10    col11    col12   col13    col14   col15    col16
row1 48.82219 50.06225 48.49189 50.29174 49.3186 49.84161 51.6585 49.87225
        col17    col18    col19    col20
row1 49.88578 50.37455 50.00854 106.0417
> tmp[,"col10"]
        col10
row1 50.06225
row2 30.42364
row3 29.85602
row4 29.94487
row5 50.56703
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 49.93939 49.58797 49.92139 48.74946 49.37434 104.2921 50.45109 49.25532
row5 51.56528 49.92429 51.93356 51.80631 50.49698 104.2841 48.82899 49.22111
         col9    col10    col11    col12    col13    col14   col15    col16
row1 48.82219 50.06225 48.49189 50.29174 49.31860 49.84161 51.6585 49.87225
row5 50.91998 50.56703 49.73403 50.03784 49.18632 49.65013 50.3617 48.25667
        col17    col18    col19    col20
row1 49.88578 50.37455 50.00854 106.0417
row5 49.20782 50.05686 49.49537 105.5579
> tmp[,c("col6","col20")]
          col6     col20
row1 104.29207 106.04172
row2  74.91628  74.55150
row3  73.29510  73.57043
row4  74.02652  75.71669
row5 104.28408 105.55786
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 104.2921 106.0417
row5 104.2841 105.5579
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 104.2921 106.0417
row5 104.2841 105.5579
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
           col13
[1,] -1.83418764
[2,]  0.02966049
[3,]  0.20045602
[4,]  0.93089106
[5,] -1.31900882
> tmp[,c("col17","col7")]
          col17        col7
[1,] -0.8076434 -0.05138926
[2,]  0.4475179  0.52632809
[3,] -1.6925433 -0.86178876
[4,]  1.2651079  0.80535846
[5,] -0.1020957  0.73943323
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
           col6      col20
[1,]  0.9279764  1.3828819
[2,] -0.6030628  0.8017577
[3,]  0.6583753  0.8048131
[4,]  0.1015889 -1.0294342
[5,] -1.4460636  1.0935658
> subBufferedMatrix(tmp,1,c("col6"))[,1]
          col1
[1,] 0.9279764
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
           col6
[1,]  0.9279764
[2,] -0.6030628
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> 
> 
> 
> subBufferedMatrix(tmp,c("row3","row1"),)[,1:20]
          [,1]      [,2]      [,3]      [,4]        [,5]       [,6]       [,7]
row3 1.0588822 -1.387182 -2.143835 0.3768829  1.20741648  0.2215507 -0.9648162
row1 0.6576106  1.340266 -1.922474 1.6267271 -0.07086692 -0.5446877  0.3460042
            [,8]      [,9]      [,10]      [,11]       [,12]      [,13]
row3 -0.03628968 0.5319667  1.0237936 -0.9354238 -0.02744931 -1.1259522
row1 -1.78940115 0.1130967 -0.1781601 -0.1557148  0.13808864  0.3925367
         [,14]      [,15]      [,16]     [,17]      [,18]      [,19]      [,20]
row3 0.2444148 -0.4713148  0.3368165  1.117394 -0.4493712 -1.6020637 -0.6821472
row1 0.8112162  0.4686057 -0.9069406 -1.443194  0.2834440  0.3043883  0.9339873
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
          [,1]      [,2]      [,3]      [,4]     [,5]      [,6]      [,7]
row2 0.5071853 0.6326854 0.2931718 0.5469164 -1.62876 -0.491638 -1.195207
          [,8]     [,9]    [,10]
row2 0.9514897 0.361662 1.479261
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
           [,1]       [,2]       [,3]       [,4]      [,5]     [,6]       [,7]
row5 -0.2473872 -0.2486824 -0.2109174 -0.2231338 0.1936428 1.153904 -0.3045791
           [,8]       [,9]      [,10]     [,11]    [,12]     [,13]     [,14]
row5 -0.3732358 -0.2326381 0.08537395 -0.579318 1.678562 -1.421843 0.5116007
        [,15]     [,16]     [,17]     [,18]     [,19]     [,20]
row5 2.268113 0.9938607 -2.921054 -1.930996 0.2061792 0.2765143
> 
> 
> 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: 0x587fdca16350>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BM1e09f3a9c9c71"
 [2] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BM1e09f459d2283"
 [3] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BM1e09f1325fe45"
 [4] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BM1e09f20f87e5f"
 [5] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BM1e09f1ac64d66"
 [6] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BM1e09f19a6bb71"
 [7] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BM1e09f5c10f9fb"
 [8] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BM1e09f2142b626"
 [9] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BM1e09f456e338a"
[10] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BM1e09f2ca06844"
[11] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BM1e09f6acde0af"
[12] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BM1e09f61496396"
[13] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BM1e09f1355fb68"
[14] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BM1e09f45efd156"
[15] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BM1e09fe8d4f82" 
> 
> 
> ### 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: 0x587fdf38d5e0>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x587fdf38d5e0>
Warning message:
In dir.create(new.directory) :
  '/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x587fdf38d5e0>
> rowMedians(tmp)
  [1]  0.1284567204  0.6104314292 -0.2480857843 -0.5927803716  0.0156866786
  [6] -0.1704907018  0.0475434578  0.2091823899 -0.5179928703 -0.1550974643
 [11] -0.1380874985  0.0154175670 -0.0215162956 -0.0128587975 -0.3403660603
 [16] -0.1665040098 -0.0863478213 -0.5938083965  0.2036736102  0.0211207642
 [21]  0.0900095386  0.0439693398  0.2583897993  0.0736097332 -0.3052764925
 [26] -0.5608097729 -0.0996671809 -0.2211877335  0.1068431167 -0.5834458246
 [31]  0.2135474638 -0.1413938753 -0.1587135415 -0.0316314181  0.2120563960
 [36]  0.1108197411 -0.2713033206  0.0469858028 -0.5099343327  0.1730859113
 [41] -0.2020662711  0.1080780864 -0.0943923405  0.0680168948 -0.0694997158
 [46]  0.4119513513 -0.1081173610  0.0828253098 -0.0585832255 -0.3859868620
 [51] -0.6775144384 -0.4056613351 -0.4761641601 -0.0981136414 -0.0865585719
 [56] -0.1866466523 -0.0772671793  0.4235886677  0.0085445652  0.1598019829
 [61] -0.0095413789 -0.0593645772  0.1762966017 -0.0505815392  0.1894747647
 [66] -0.0489756545  0.1059375595 -0.1139058170  0.1818508719  0.3034075406
 [71] -0.0870516978 -0.0390512679  0.2562461441  0.4600029955 -0.1944659767
 [76]  0.1707535002  0.0049320497  0.2909844301 -0.3035795207  0.0954341418
 [81] -0.1837496779  0.3760673728  0.3176597057 -0.0489481783  0.1987390156
 [86]  0.8019198687  0.3536035870 -0.0283731126  0.2617446326 -0.2662037561
 [91] -0.3092749516  0.1203763655  0.2068147271  0.1320814501 -0.0411084426
 [96] -0.5309175920 -0.0667872216  0.1553885645 -0.3140306537  0.4902775741
[101] -0.2344754884  0.1157549777 -0.1274495296  0.2443866670 -0.0026921846
[106] -0.2041384124 -0.1420004632  0.5602907887 -0.4313408887 -0.1343029774
[111] -0.0693034889 -0.0031483061  0.2164516277  0.0259893609 -0.1832080892
[116]  0.2309735273 -0.4875745975 -0.2298023175 -0.4249174802  0.3357096504
[121] -0.8855766052  0.4179645936  0.5102082306 -0.2154533601  0.1017880190
[126]  0.0732853318 -0.3981301768 -0.5096509983 -0.0465835644 -0.0714726511
[131] -0.1366194100 -0.0711865580 -0.2742318461  0.2735380492 -0.2301931233
[136] -0.4257311391  0.4120284370  0.3469767799 -0.4333295453 -0.1104447612
[141]  0.0388710791  0.5031974065 -0.7705177456  0.3691533775 -0.1411578469
[146]  0.3701477564  0.3591012483  0.7220055357 -0.2697284322  0.1438413268
[151] -0.0721871348  0.6301656170 -0.3347015738  0.0234949378 -0.2546191076
[156] -0.1827176243 -0.1684553452  0.2998716319 -0.1033938998 -0.1947298411
[161] -0.5677958257  0.5669872821 -0.4276362624  0.0451741892  0.2082414847
[166] -0.0089466402  0.3851287566 -0.2169946985 -0.0975477170 -0.7141211480
[171]  0.2049581118  0.3504525819  0.2267669403  0.6883663450 -0.2567137517
[176]  0.2435060969 -0.4178668967 -0.2200683104  0.2323738121  0.5112038959
[181] -0.1221911675  0.4610099951 -0.1980871512 -0.3848779699 -0.2115943806
[186]  0.0004644525  0.1064718590 -0.3900041118 -0.0511792499  0.0631059716
[191] -0.3554053222 -0.5030434221  0.3931696072  0.4497938644  0.0016520888
[196]  0.6194644597 -0.0042727273  0.4421380596 -0.0783285199  0.1078646281
[201]  0.0542868148 -0.0270881717  0.2527457396 -0.4958002406 -0.5567232987
[206]  0.2436321122  0.2701247366 -0.0357974925 -0.1894652594 -0.0164823532
[211] -0.0954886606 -0.6894719099 -0.7119712535 -0.4199892179 -0.0269782974
[216]  0.3414337491 -0.0061165069  0.3375494663  0.0890274909 -0.2768485083
[221]  0.4346338409 -0.0101320344 -0.0113777283  0.4229117476 -0.5699546241
[226] -0.1450932489  0.1468990379 -0.0868817613 -0.0944624874 -0.6875603129
> 
> proc.time()
   user  system elapsed 
  1.250   0.701   1.937 

BufferedMatrix.Rcheck/tests/rawCalltesting.Rout


R version 4.6.0 RC (2026-04-17 r89917) -- "Because it was There"
Copyright (C) 2026 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: 0x5bcc12b27520>
> .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: 0x5bcc12b27520>
> .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: 0x5bcc12b27520>
> .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: 0x5bcc12b27520>
> 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: 0x5bcc126d0f60>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5bcc126d0f60>
> .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: 0x5bcc126d0f60>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5bcc126d0f60>
> .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: 0x5bcc126d0f60>
> 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: 0x5bcc1327ab40>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5bcc1327ab40>
> .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: 0x5bcc1327ab40>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x5bcc1327ab40>
> .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: 0x5bcc1327ab40>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x5bcc1327ab40>
> .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: 0x5bcc1327ab40>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x5bcc1327ab40>
> .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: 0x5bcc1327ab40>
> 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: 0x5bcc132b7bc0>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x5bcc132b7bc0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5bcc132b7bc0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5bcc132b7bc0>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile1e15a6918d9f8" "BufferedMatrixFile1e15a69c626fd"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile1e15a6918d9f8" "BufferedMatrixFile1e15a69c626fd"
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x5bcc13251000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5bcc13251000>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x5bcc13251000>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x5bcc13251000>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x5bcc13251000>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x5bcc13251000>
> .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: 0x5bcc12384e30>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5bcc12384e30>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x5bcc12384e30>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x5bcc12384e30>
> 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: 0x5bcc129aea50>
> .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: 0x5bcc129aea50>
> rm(P)
> 
> proc.time()
   user  system elapsed 
  0.249   0.048   0.287 

BufferedMatrix.Rcheck/tests/Rcodetesting.Rout


R version 4.6.0 RC (2026-04-17 r89917) -- "Because it was There"
Copyright (C) 2026 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.245   0.047   0.280 

Example timings