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

This page was generated on 2026-05-20 11:32 -0400 (Wed, 20 May 2026).

HostnameOSArch (*)R versionInstalled pkgs
nebbiolo1Linux (Ubuntu 24.04.4 LTS)x86_644.6.0 RC (2026-04-17 r89917) -- "Because it was There" 4995
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 262/2418HostnameOS / ArchINSTALLBUILDCHECKBUILD BIN
BufferedMatrix 1.76.0  (landing page)
Ben Bolstad
Snapshot Date: 2026-05-19 13:40 -0400 (Tue, 19 May 2026)
git_url: https://git.bioconductor.org/packages/BufferedMatrix
git_branch: RELEASE_3_23
git_last_commit: 9d72964
git_last_commit_date: 2026-04-28 08:32:08 -0400 (Tue, 28 Apr 2026)
nebbiolo1Linux (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 nebbiolo1

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.76.0
Command: /home/biocbuild/bbs-3.23-bioc/R/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/home/biocbuild/bbs-3.23-bioc/R/site-library --timings BufferedMatrix_1.76.0.tar.gz
StartedAt: 2026-05-19 22:05:04 -0400 (Tue, 19 May 2026)
EndedAt: 2026-05-19 22:05:29 -0400 (Tue, 19 May 2026)
EllapsedTime: 25.0 seconds
RetCode: 0
Status:   OK  
CheckDir: BufferedMatrix.Rcheck
Warnings: 0

Command output

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


* using log directory ‘/home/biocbuild/bbs-3.23-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-20 02:05:05 UTC
* checking for file ‘BufferedMatrix/DESCRIPTION’ ... OK
* this is package ‘BufferedMatrix’ version ‘1.76.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.23-bioc/meat/BufferedMatrix.Rcheck/00check.log’
for details.


Installation output

BufferedMatrix.Rcheck/00install.out

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


* installing to library ‘/home/biocbuild/bbs-3.23-bioc/R/site-library’
* installing *source* package ‘BufferedMatrix’ ...
** this is package ‘BufferedMatrix’ version ‘1.76.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.23-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.23-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.23-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.23-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.23-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.23-bioc/R/lib -lR
installing to /home/biocbuild/bbs-3.23-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.257   0.051   0.297 

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.23-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] "Tue May 19 22:05:20 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] "Tue May 19 22:05:20 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: 0x64ba83343690>
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   which.col <- sample(1:20,1)
+   if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,5,replace=TRUE)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> date()
[1] "Tue May 19 22:05:21 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] "Tue May 19 22:05:21 2026"
> 
> ColMode(tmp2)
<pointer: 0x64ba83343690>
> 
> 
> 
> ### 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.3194841 -0.9027296 -0.71930556  0.62965494
[2,]  0.8285939 -0.3040798  0.05802662 -0.33345151
[3,]  0.8710487 -0.4382926 -1.74925730 -0.07605686
[4,] -0.2770833 -0.7523063  1.25404284 -0.24839761
> ewApply(tmp5,abs)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.23-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.3194841 0.9027296 0.71930556 0.62965494
[2,]  0.8285939 0.3040798 0.05802662 0.33345151
[3,]  0.8710487 0.4382926 1.74925730 0.07605686
[4,]  0.2770833 0.7523063 1.25404284 0.24839761
> ewApply(tmp5,sqrt)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.23-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.9659161 0.9501209 0.8481188 0.7935080
[2,] 0.9102714 0.5514343 0.2408872 0.5774526
[3,] 0.9332999 0.6620367 1.3225949 0.2757841
[4,] 0.5263870 0.8673559 1.1198405 0.4983950
> 
> 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.23-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,] 223.97865 35.40394 34.20049 33.56473
[2,]  34.93131 30.81842 27.46690 31.10798
[3,]  35.20405 32.05866 39.97521 27.83390
[4,]  30.54095 34.42587 37.45245 30.23235
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x64ba82532ff0>
> exp(tmp5)
<pointer: 0x64ba82532ff0>
> log(tmp5,2)
<pointer: 0x64ba82532ff0>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 466.1822
> Min(tmp5)
[1] 52.88073
> mean(tmp5)
[1] 72.14198
> Sum(tmp5)
[1] 14428.4
> Var(tmp5)
[1] 856.2696
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 89.89501 70.78784 68.82730 70.27051 68.54613 70.34649 70.80869 70.60483
 [9] 71.08494 70.24805
> rowSums(tmp5)
 [1] 1797.900 1415.757 1376.546 1405.410 1370.923 1406.930 1416.174 1412.097
 [9] 1421.699 1404.961
> rowVars(tmp5)
 [1] 7893.40256  108.96131   59.52105   77.64113   34.31001   51.95592
 [7]   87.11768   58.26619   91.25818  130.60845
> rowSd(tmp5)
 [1] 88.844823 10.438454  7.714989  8.811420  5.857474  7.208045  9.333685
 [8]  7.633229  9.552915 11.428405
> rowMax(tmp5)
 [1] 466.18220  93.60462  83.20315  94.18467  78.99222  85.01414  81.34755
 [8]  83.25173  87.15812  90.10233
> rowMin(tmp5)
 [1] 56.77238 57.16875 54.81359 55.24448 58.99342 58.76246 54.56547 58.86792
 [9] 52.88073 54.43503
> 
> colMeans(tmp5)
 [1] 109.24718  72.84570  69.80047  66.07111  67.76654  70.17003  65.88931
 [8]  65.51108  66.40297  72.19598  73.06315  71.29475  71.53921  69.69382
[15]  71.97108  71.39870  75.15242  68.42203  70.71306  73.69096
> colSums(tmp5)
 [1] 1092.4718  728.4570  698.0047  660.7111  677.6654  701.7003  658.8931
 [8]  655.1108  664.0297  721.9598  730.6315  712.9475  715.3921  696.9382
[15]  719.7108  713.9870  751.5242  684.2203  707.1306  736.9096
> colVars(tmp5)
 [1] 15782.02695    34.45762    85.28902    80.86613    58.41144    93.67471
 [7]    79.80040    50.79842    61.15043    42.76423    58.84670    77.94139
[13]   115.56093    51.05700   140.47495    88.77694    92.70537    53.72893
[19]    42.46271    70.59686
> colSd(tmp5)
 [1] 125.626538   5.870061   9.235206   8.992560   7.642738   9.678569
 [7]   8.933107   7.127301   7.819874   6.539436   7.671160   8.828442
[13]  10.749927   7.145418  11.852213   9.422151   9.628363   7.330002
[19]   6.516342   8.402194
> colMax(tmp5)
 [1] 466.18220  81.89473  83.20315  85.01414  83.25173  90.10233  76.45275
 [8]  75.58339  79.88865  84.02603  89.26232  83.65518  93.60462  78.99222
[15]  91.96453  82.54755  94.18467  80.56122  80.57912  87.15812
> colMin(tmp5)
 [1] 54.56547 64.14451 57.16875 57.80586 58.27659 58.81203 53.38405 54.69590
 [9] 52.88073 62.82875 60.16340 58.60142 57.96505 56.96733 54.43503 54.66379
[17] 66.30206 56.21353 61.53753 61.60079
> 
> 
> ### 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] 89.89501 70.78784 68.82730       NA 68.54613 70.34649 70.80869 70.60483
 [9] 71.08494 70.24805
> rowSums(tmp5)
 [1] 1797.900 1415.757 1376.546       NA 1370.923 1406.930 1416.174 1412.097
 [9] 1421.699 1404.961
> rowVars(tmp5)
 [1] 7893.40256  108.96131   59.52105   81.49361   34.31001   51.95592
 [7]   87.11768   58.26619   91.25818  130.60845
> rowSd(tmp5)
 [1] 88.844823 10.438454  7.714989  9.027381  5.857474  7.208045  9.333685
 [8]  7.633229  9.552915 11.428405
> rowMax(tmp5)
 [1] 466.18220  93.60462  83.20315        NA  78.99222  85.01414  81.34755
 [8]  83.25173  87.15812  90.10233
> rowMin(tmp5)
 [1] 56.77238 57.16875 54.81359       NA 58.99342 58.76246 54.56547 58.86792
 [9] 52.88073 54.43503
> 
> colMeans(tmp5)
 [1] 109.24718  72.84570  69.80047  66.07111  67.76654  70.17003  65.88931
 [8]  65.51108  66.40297  72.19598  73.06315  71.29475        NA  69.69382
[15]  71.97108  71.39870  75.15242  68.42203  70.71306  73.69096
> colSums(tmp5)
 [1] 1092.4718  728.4570  698.0047  660.7111  677.6654  701.7003  658.8931
 [8]  655.1108  664.0297  721.9598  730.6315  712.9475        NA  696.9382
[15]  719.7108  713.9870  751.5242  684.2203  707.1306  736.9096
> colVars(tmp5)
 [1] 15782.02695    34.45762    85.28902    80.86613    58.41144    93.67471
 [7]    79.80040    50.79842    61.15043    42.76423    58.84670    77.94139
[13]          NA    51.05700   140.47495    88.77694    92.70537    53.72893
[19]    42.46271    70.59686
> colSd(tmp5)
 [1] 125.626538   5.870061   9.235206   8.992560   7.642738   9.678569
 [7]   8.933107   7.127301   7.819874   6.539436   7.671160   8.828442
[13]         NA   7.145418  11.852213   9.422151   9.628363   7.330002
[19]   6.516342   8.402194
> colMax(tmp5)
 [1] 466.18220  81.89473  83.20315  85.01414  83.25173  90.10233  76.45275
 [8]  75.58339  79.88865  84.02603  89.26232  83.65518        NA  78.99222
[15]  91.96453  82.54755  94.18467  80.56122  80.57912  87.15812
> colMin(tmp5)
 [1] 54.56547 64.14451 57.16875 57.80586 58.27659 58.81203 53.38405 54.69590
 [9] 52.88073 62.82875 60.16340 58.60142       NA 56.96733 54.43503 54.66379
[17] 66.30206 56.21353 61.53753 61.60079
> 
> Max(tmp5,na.rm=TRUE)
[1] 466.1822
> Min(tmp5,na.rm=TRUE)
[1] 52.88073
> mean(tmp5,na.rm=TRUE)
[1] 72.16549
> Sum(tmp5,na.rm=TRUE)
[1] 14360.93
> Var(tmp5,na.rm=TRUE)
[1] 860.4831
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 89.89501 70.78784 68.82730 70.41827 68.54613 70.34649 70.80869 70.60483
 [9] 71.08494 70.24805
> rowSums(tmp5,na.rm=TRUE)
 [1] 1797.900 1415.757 1376.546 1337.947 1370.923 1406.930 1416.174 1412.097
 [9] 1421.699 1404.961
> rowVars(tmp5,na.rm=TRUE)
 [1] 7893.40256  108.96131   59.52105   81.49361   34.31001   51.95592
 [7]   87.11768   58.26619   91.25818  130.60845
> rowSd(tmp5,na.rm=TRUE)
 [1] 88.844823 10.438454  7.714989  9.027381  5.857474  7.208045  9.333685
 [8]  7.633229  9.552915 11.428405
> rowMax(tmp5,na.rm=TRUE)
 [1] 466.18220  93.60462  83.20315  94.18467  78.99222  85.01414  81.34755
 [8]  83.25173  87.15812  90.10233
> rowMin(tmp5,na.rm=TRUE)
 [1] 56.77238 57.16875 54.81359 55.24448 58.99342 58.76246 54.56547 58.86792
 [9] 52.88073 54.43503
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 109.24718  72.84570  69.80047  66.07111  67.76654  70.17003  65.88931
 [8]  65.51108  66.40297  72.19598  73.06315  71.29475  71.99211  69.69382
[15]  71.97108  71.39870  75.15242  68.42203  70.71306  73.69096
> colSums(tmp5,na.rm=TRUE)
 [1] 1092.4718  728.4570  698.0047  660.7111  677.6654  701.7003  658.8931
 [8]  655.1108  664.0297  721.9598  730.6315  712.9475  647.9290  696.9382
[15]  719.7108  713.9870  751.5242  684.2203  707.1306  736.9096
> colVars(tmp5,na.rm=TRUE)
 [1] 15782.02695    34.45762    85.28902    80.86613    58.41144    93.67471
 [7]    79.80040    50.79842    61.15043    42.76423    58.84670    77.94139
[13]   127.69845    51.05700   140.47495    88.77694    92.70537    53.72893
[19]    42.46271    70.59686
> colSd(tmp5,na.rm=TRUE)
 [1] 125.626538   5.870061   9.235206   8.992560   7.642738   9.678569
 [7]   8.933107   7.127301   7.819874   6.539436   7.671160   8.828442
[13]  11.300374   7.145418  11.852213   9.422151   9.628363   7.330002
[19]   6.516342   8.402194
> colMax(tmp5,na.rm=TRUE)
 [1] 466.18220  81.89473  83.20315  85.01414  83.25173  90.10233  76.45275
 [8]  75.58339  79.88865  84.02603  89.26232  83.65518  93.60462  78.99222
[15]  91.96453  82.54755  94.18467  80.56122  80.57912  87.15812
> colMin(tmp5,na.rm=TRUE)
 [1] 54.56547 64.14451 57.16875 57.80586 58.27659 58.81203 53.38405 54.69590
 [9] 52.88073 62.82875 60.16340 58.60142 57.96505 56.96733 54.43503 54.66379
[17] 66.30206 56.21353 61.53753 61.60079
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1] 89.89501 70.78784 68.82730      NaN 68.54613 70.34649 70.80869 70.60483
 [9] 71.08494 70.24805
> rowSums(tmp5,na.rm=TRUE)
 [1] 1797.900 1415.757 1376.546    0.000 1370.923 1406.930 1416.174 1412.097
 [9] 1421.699 1404.961
> rowVars(tmp5,na.rm=TRUE)
 [1] 7893.40256  108.96131   59.52105         NA   34.31001   51.95592
 [7]   87.11768   58.26619   91.25818  130.60845
> rowSd(tmp5,na.rm=TRUE)
 [1] 88.844823 10.438454  7.714989        NA  5.857474  7.208045  9.333685
 [8]  7.633229  9.552915 11.428405
> rowMax(tmp5,na.rm=TRUE)
 [1] 466.18220  93.60462  83.20315        NA  78.99222  85.01414  81.34755
 [8]  83.25173  87.15812  90.10233
> rowMin(tmp5,na.rm=TRUE)
 [1] 56.77238 57.16875 54.81359       NA 58.99342 58.76246 54.56547 58.86792
 [9] 52.88073 54.43503
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1] 114.32275  72.97823  68.89470  66.42071  67.85812  69.01805  67.07207
 [8]  65.01206  66.75756  70.88153  73.35629  71.52867       NaN  69.15096
[15]  72.44084  71.24676  73.03773  68.52022  71.53754  74.97144
> colSums(tmp5,na.rm=TRUE)
 [1] 1028.9048  656.8041  620.0523  597.7864  610.7231  621.1624  603.6486
 [8]  585.1086  600.8181  637.9338  660.2066  643.7581    0.0000  622.3586
[15]  651.9676  641.2209  657.3396  616.6820  643.8378  674.7430
> colVars(tmp5,na.rm=TRUE)
 [1] 17464.96378    38.56722    86.72051    89.59939    65.61852    90.45470
 [7]    74.03762    54.34680    67.37971    28.67225    65.23582    87.06845
[13]          NA    54.12378   155.55173    99.61434    53.98431    60.33657
[19]    40.12318    60.97570
> colSd(tmp5,na.rm=TRUE)
 [1] 132.155075   6.210251   9.312385   9.465695   8.100526   9.510767
 [7]   8.604512   7.372028   8.208514   5.354648   8.076869   9.331048
[13]         NA   7.356887  12.472038   9.980698   7.347402   7.767662
[19]   6.334286   7.808694
> colMax(tmp5,na.rm=TRUE)
 [1] 466.18220  81.89473  83.20315  85.01414  83.25173  90.10233  76.45275
 [8]  75.58339  79.88865  80.23931  89.26232  83.65518      -Inf  78.99222
[15]  91.96453  82.54755  89.62538  80.56122  80.57912  87.15812
> colMin(tmp5,na.rm=TRUE)
 [1] 54.56547 64.14451 57.16875 57.80586 58.27659 58.81203 53.38405 54.69590
 [9] 52.88073 62.82875 60.16340 58.60142      Inf 56.96733 54.43503 54.66379
[17] 66.30206 56.21353 61.53753 61.60079
> 
> 
> 
> 
> 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] 180.5926 268.6114 425.0242 363.9084 313.0108 202.6692 218.6687 313.4548
 [9] 171.4150 288.6275
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 180.5926 268.6114 425.0242 363.9084 313.0108 202.6692 218.6687 313.4548
 [9] 171.4150 288.6275
> 
> 
> 
> copymatrix <- matrix(rnorm(200,150,15),10,20)
> 
> tmp5[1:10,1:20] <- copymatrix
> which.row <- 1
> which.col  <- 3
> cat(which.row," ",which.col,"\n")
1   3 
> tmp5[which.row,which.col] <- NA
> copymatrix[which.row,which.col] <- NA
> 
> colVars(tmp5,na.rm=TRUE)-apply(copymatrix,2,var,na.rm=TRUE)
 [1]  5.684342e-14 -2.557954e-13  7.105427e-14  1.421085e-14  1.136868e-13
 [6]  5.684342e-14  0.000000e+00  0.000000e+00  2.842171e-14  2.842171e-13
[11]  8.526513e-14  2.842171e-14 -5.684342e-14  2.842171e-14 -2.842171e-14
[16] -8.526513e-14 -5.684342e-14 -5.684342e-14  0.000000e+00  0.000000e+00
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> ## making sure these things agree
> ##
> ## first when there is no NA
> 
> 
> 
> agree.checks <- function(buff.matrix,r.matrix,err.tol=1e-10){
+ 
+   if (Max(buff.matrix,na.rm=TRUE) != max(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Max")
+   }
+   
+ 
+   if (Min(buff.matrix,na.rm=TRUE) != min(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Min")
+   }
+ 
+ 
+   if (abs(Sum(buff.matrix,na.rm=TRUE)- sum(r.matrix,na.rm=TRUE)) > err.tol){
+ 
+     cat(Sum(buff.matrix,na.rm=TRUE),"\n")
+     cat(sum(r.matrix,na.rm=TRUE),"\n")
+     cat(Sum(buff.matrix,na.rm=TRUE) - sum(r.matrix,na.rm=TRUE),"\n")
+     
+     stop("No agreement in Sum")
+   }
+   
+   if (abs(mean(buff.matrix,na.rm=TRUE) - mean(r.matrix,na.rm=TRUE)) > err.tol){
+     stop("No agreement in mean")
+   }
+   
+   
+   if(abs(Var(buff.matrix,na.rm=TRUE) - var(as.vector(r.matrix),na.rm=TRUE)) > err.tol){
+     stop("No agreement in Var")
+   }
+   
+   
+ 
+   if(any(abs(rowMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,mean,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowMeans")
+   }
+   
+   
+   if(any(abs(colMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,mean,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colMeans")
+   }
+   
+   
+   if(any(abs(rowSums(buff.matrix,na.rm=TRUE)  -  apply(r.matrix,1,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in rowSums")
+   }
+   
+   
+   if(any(abs(colSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colSums")
+   }
+   
+   ### this is to get around the fact that R doesn't like to compute NA on an entire vector of NA when 
+   ### computing variance
+   my.Var <- function(x,na.rm=FALSE){
+    if (all(is.na(x))){
+      return(NA)
+    } else {
+      var(x,na.rm=na.rm)
+    }
+ 
+   }
+   
+   if(any(abs(rowVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+   
+   
+   if(any(abs(colVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+ 
+ 
+   if(any(abs(rowMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+ 
+   if(any(abs(colMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+   
+   
+   if(any(abs(rowMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+   
+ 
+   if(any(abs(colMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+ 
+   if(any(abs(colMedians(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,median,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMedian")
+   }
+ 
+   if(any(abs(colRanges(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,range,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colRanges")
+   }
+ 
+ 
+   
+ }
> 
> 
> 
> 
> 
> 
> 
> 
> 
> for (rep in 1:20){
+   copymatrix <- matrix(rnorm(200,150,15),10,20)
+   
+   tmp5[1:10,1:20] <- copymatrix
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ## now lets assign some NA values and check agreement
+ 
+   which.row <- sample(1:10,1,replace=TRUE)
+   which.col  <- sample(1:20,1,replace=TRUE)
+   
+   cat(which.row," ",which.col,"\n")
+   
+   tmp5[which.row,which.col] <- NA
+   copymatrix[which.row,which.col] <- NA
+   
+   agree.checks(tmp5,copymatrix)
+ 
+   ## make an entire row NA
+   tmp5[which.row,] <- NA
+   copymatrix[which.row,] <- NA
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ### also make an entire col NA
+   tmp5[,which.col] <- NA
+   copymatrix[,which.col] <- NA
+ 
+   agree.checks(tmp5,copymatrix)
+ 
+   ### now make 1 element non NA with NA in the rest of row and column
+ 
+   tmp5[which.row,which.col] <- rnorm(1,150,15)
+   copymatrix[which.row,which.col] <- tmp5[which.row,which.col]
+ 
+   agree.checks(tmp5,copymatrix)
+ }
1   16 
5   14 
2   16 
8   5 
10   6 
4   17 
8   15 
10   1 
6   4 
10   12 
4   18 
9   10 
4   10 
7   5 
10   19 
1   6 
7   19 
1   16 
3   9 
2   17 
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.267322
> Min(tmp)
[1] -2.400734
> mean(tmp)
[1] -0.04921274
> Sum(tmp)
[1] -4.921274
> Var(tmp)
[1] 0.9915006
> 
> rowMeans(tmp)
[1] -0.04921274
> rowSums(tmp)
[1] -4.921274
> rowVars(tmp)
[1] 0.9915006
> rowSd(tmp)
[1] 0.9957412
> rowMax(tmp)
[1] 2.267322
> rowMin(tmp)
[1] -2.400734
> 
> colMeans(tmp)
  [1] -0.83179686 -0.54055386 -0.59707056  1.07983652  0.09621516  1.15021207
  [7] -0.19699199  0.53954191  0.10346068  0.55968525  0.92754390  0.09007383
 [13] -0.16536371  1.24664015 -2.02302389  0.98310043 -0.93041310  0.85581672
 [19] -0.44629299 -2.07208944  0.02996951  0.92300508  0.48210361  0.19899701
 [25] -0.61637773  0.21563184  1.85926704 -2.12894541  1.02656437  0.33948439
 [31] -0.31017569 -0.28038798 -0.47426164 -0.52625369  0.43350929 -0.98416864
 [37] -0.07313596  1.14103942  1.41507928  0.09302471 -0.06950660 -0.76532256
 [43] -0.08463067 -0.41421564  0.99946222 -0.23031589  0.17482209  1.23910002
 [49] -0.50697145  0.32414079  0.45433279 -0.78153191  1.21314602 -2.08971354
 [55] -0.03558540  2.26732216  0.41681804 -0.58488631 -1.71638398 -1.32899227
 [61] -0.20021034 -1.28817998  1.27411275 -0.81693321 -0.74851390  1.15397164
 [67]  0.78328223  0.04405355  0.88427948  0.97678886 -0.50537961 -0.78528250
 [73] -2.40073373  0.09906508  0.18873473  1.00680945 -2.01092941  0.16770588
 [79] -0.66270798  0.87044045 -0.47708282 -1.88283254 -1.27638673  0.55741600
 [85] -0.05271661 -1.64784185 -0.74001952  0.39610624  0.88836350 -0.20173937
 [91] -0.49745030  0.52501160 -0.01834041 -0.22830268  1.88978491  0.73867806
 [97]  1.41179282 -0.07991884 -2.03483996 -1.29491582
> colSums(tmp)
  [1] -0.83179686 -0.54055386 -0.59707056  1.07983652  0.09621516  1.15021207
  [7] -0.19699199  0.53954191  0.10346068  0.55968525  0.92754390  0.09007383
 [13] -0.16536371  1.24664015 -2.02302389  0.98310043 -0.93041310  0.85581672
 [19] -0.44629299 -2.07208944  0.02996951  0.92300508  0.48210361  0.19899701
 [25] -0.61637773  0.21563184  1.85926704 -2.12894541  1.02656437  0.33948439
 [31] -0.31017569 -0.28038798 -0.47426164 -0.52625369  0.43350929 -0.98416864
 [37] -0.07313596  1.14103942  1.41507928  0.09302471 -0.06950660 -0.76532256
 [43] -0.08463067 -0.41421564  0.99946222 -0.23031589  0.17482209  1.23910002
 [49] -0.50697145  0.32414079  0.45433279 -0.78153191  1.21314602 -2.08971354
 [55] -0.03558540  2.26732216  0.41681804 -0.58488631 -1.71638398 -1.32899227
 [61] -0.20021034 -1.28817998  1.27411275 -0.81693321 -0.74851390  1.15397164
 [67]  0.78328223  0.04405355  0.88427948  0.97678886 -0.50537961 -0.78528250
 [73] -2.40073373  0.09906508  0.18873473  1.00680945 -2.01092941  0.16770588
 [79] -0.66270798  0.87044045 -0.47708282 -1.88283254 -1.27638673  0.55741600
 [85] -0.05271661 -1.64784185 -0.74001952  0.39610624  0.88836350 -0.20173937
 [91] -0.49745030  0.52501160 -0.01834041 -0.22830268  1.88978491  0.73867806
 [97]  1.41179282 -0.07991884 -2.03483996 -1.29491582
> 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.83179686 -0.54055386 -0.59707056  1.07983652  0.09621516  1.15021207
  [7] -0.19699199  0.53954191  0.10346068  0.55968525  0.92754390  0.09007383
 [13] -0.16536371  1.24664015 -2.02302389  0.98310043 -0.93041310  0.85581672
 [19] -0.44629299 -2.07208944  0.02996951  0.92300508  0.48210361  0.19899701
 [25] -0.61637773  0.21563184  1.85926704 -2.12894541  1.02656437  0.33948439
 [31] -0.31017569 -0.28038798 -0.47426164 -0.52625369  0.43350929 -0.98416864
 [37] -0.07313596  1.14103942  1.41507928  0.09302471 -0.06950660 -0.76532256
 [43] -0.08463067 -0.41421564  0.99946222 -0.23031589  0.17482209  1.23910002
 [49] -0.50697145  0.32414079  0.45433279 -0.78153191  1.21314602 -2.08971354
 [55] -0.03558540  2.26732216  0.41681804 -0.58488631 -1.71638398 -1.32899227
 [61] -0.20021034 -1.28817998  1.27411275 -0.81693321 -0.74851390  1.15397164
 [67]  0.78328223  0.04405355  0.88427948  0.97678886 -0.50537961 -0.78528250
 [73] -2.40073373  0.09906508  0.18873473  1.00680945 -2.01092941  0.16770588
 [79] -0.66270798  0.87044045 -0.47708282 -1.88283254 -1.27638673  0.55741600
 [85] -0.05271661 -1.64784185 -0.74001952  0.39610624  0.88836350 -0.20173937
 [91] -0.49745030  0.52501160 -0.01834041 -0.22830268  1.88978491  0.73867806
 [97]  1.41179282 -0.07991884 -2.03483996 -1.29491582
> colMin(tmp)
  [1] -0.83179686 -0.54055386 -0.59707056  1.07983652  0.09621516  1.15021207
  [7] -0.19699199  0.53954191  0.10346068  0.55968525  0.92754390  0.09007383
 [13] -0.16536371  1.24664015 -2.02302389  0.98310043 -0.93041310  0.85581672
 [19] -0.44629299 -2.07208944  0.02996951  0.92300508  0.48210361  0.19899701
 [25] -0.61637773  0.21563184  1.85926704 -2.12894541  1.02656437  0.33948439
 [31] -0.31017569 -0.28038798 -0.47426164 -0.52625369  0.43350929 -0.98416864
 [37] -0.07313596  1.14103942  1.41507928  0.09302471 -0.06950660 -0.76532256
 [43] -0.08463067 -0.41421564  0.99946222 -0.23031589  0.17482209  1.23910002
 [49] -0.50697145  0.32414079  0.45433279 -0.78153191  1.21314602 -2.08971354
 [55] -0.03558540  2.26732216  0.41681804 -0.58488631 -1.71638398 -1.32899227
 [61] -0.20021034 -1.28817998  1.27411275 -0.81693321 -0.74851390  1.15397164
 [67]  0.78328223  0.04405355  0.88427948  0.97678886 -0.50537961 -0.78528250
 [73] -2.40073373  0.09906508  0.18873473  1.00680945 -2.01092941  0.16770588
 [79] -0.66270798  0.87044045 -0.47708282 -1.88283254 -1.27638673  0.55741600
 [85] -0.05271661 -1.64784185 -0.74001952  0.39610624  0.88836350 -0.20173937
 [91] -0.49745030  0.52501160 -0.01834041 -0.22830268  1.88978491  0.73867806
 [97]  1.41179282 -0.07991884 -2.03483996 -1.29491582
> colMedians(tmp)
  [1] -0.83179686 -0.54055386 -0.59707056  1.07983652  0.09621516  1.15021207
  [7] -0.19699199  0.53954191  0.10346068  0.55968525  0.92754390  0.09007383
 [13] -0.16536371  1.24664015 -2.02302389  0.98310043 -0.93041310  0.85581672
 [19] -0.44629299 -2.07208944  0.02996951  0.92300508  0.48210361  0.19899701
 [25] -0.61637773  0.21563184  1.85926704 -2.12894541  1.02656437  0.33948439
 [31] -0.31017569 -0.28038798 -0.47426164 -0.52625369  0.43350929 -0.98416864
 [37] -0.07313596  1.14103942  1.41507928  0.09302471 -0.06950660 -0.76532256
 [43] -0.08463067 -0.41421564  0.99946222 -0.23031589  0.17482209  1.23910002
 [49] -0.50697145  0.32414079  0.45433279 -0.78153191  1.21314602 -2.08971354
 [55] -0.03558540  2.26732216  0.41681804 -0.58488631 -1.71638398 -1.32899227
 [61] -0.20021034 -1.28817998  1.27411275 -0.81693321 -0.74851390  1.15397164
 [67]  0.78328223  0.04405355  0.88427948  0.97678886 -0.50537961 -0.78528250
 [73] -2.40073373  0.09906508  0.18873473  1.00680945 -2.01092941  0.16770588
 [79] -0.66270798  0.87044045 -0.47708282 -1.88283254 -1.27638673  0.55741600
 [85] -0.05271661 -1.64784185 -0.74001952  0.39610624  0.88836350 -0.20173937
 [91] -0.49745030  0.52501160 -0.01834041 -0.22830268  1.88978491  0.73867806
 [97]  1.41179282 -0.07991884 -2.03483996 -1.29491582
> colRanges(tmp)
           [,1]       [,2]       [,3]     [,4]       [,5]     [,6]      [,7]
[1,] -0.8317969 -0.5405539 -0.5970706 1.079837 0.09621516 1.150212 -0.196992
[2,] -0.8317969 -0.5405539 -0.5970706 1.079837 0.09621516 1.150212 -0.196992
          [,8]      [,9]     [,10]     [,11]      [,12]      [,13]   [,14]
[1,] 0.5395419 0.1034607 0.5596853 0.9275439 0.09007383 -0.1653637 1.24664
[2,] 0.5395419 0.1034607 0.5596853 0.9275439 0.09007383 -0.1653637 1.24664
         [,15]     [,16]      [,17]     [,18]     [,19]     [,20]      [,21]
[1,] -2.023024 0.9831004 -0.9304131 0.8558167 -0.446293 -2.072089 0.02996951
[2,] -2.023024 0.9831004 -0.9304131 0.8558167 -0.446293 -2.072089 0.02996951
         [,22]     [,23]    [,24]      [,25]     [,26]    [,27]     [,28]
[1,] 0.9230051 0.4821036 0.198997 -0.6163777 0.2156318 1.859267 -2.128945
[2,] 0.9230051 0.4821036 0.198997 -0.6163777 0.2156318 1.859267 -2.128945
        [,29]     [,30]      [,31]     [,32]      [,33]      [,34]     [,35]
[1,] 1.026564 0.3394844 -0.3101757 -0.280388 -0.4742616 -0.5262537 0.4335093
[2,] 1.026564 0.3394844 -0.3101757 -0.280388 -0.4742616 -0.5262537 0.4335093
          [,36]       [,37]    [,38]    [,39]      [,40]      [,41]      [,42]
[1,] -0.9841686 -0.07313596 1.141039 1.415079 0.09302471 -0.0695066 -0.7653226
[2,] -0.9841686 -0.07313596 1.141039 1.415079 0.09302471 -0.0695066 -0.7653226
           [,43]      [,44]     [,45]      [,46]     [,47]  [,48]      [,49]
[1,] -0.08463067 -0.4142156 0.9994622 -0.2303159 0.1748221 1.2391 -0.5069715
[2,] -0.08463067 -0.4142156 0.9994622 -0.2303159 0.1748221 1.2391 -0.5069715
         [,50]     [,51]      [,52]    [,53]     [,54]      [,55]    [,56]
[1,] 0.3241408 0.4543328 -0.7815319 1.213146 -2.089714 -0.0355854 2.267322
[2,] 0.3241408 0.4543328 -0.7815319 1.213146 -2.089714 -0.0355854 2.267322
        [,57]      [,58]     [,59]     [,60]      [,61]    [,62]    [,63]
[1,] 0.416818 -0.5848863 -1.716384 -1.328992 -0.2002103 -1.28818 1.274113
[2,] 0.416818 -0.5848863 -1.716384 -1.328992 -0.2002103 -1.28818 1.274113
          [,64]      [,65]    [,66]     [,67]      [,68]     [,69]     [,70]
[1,] -0.8169332 -0.7485139 1.153972 0.7832822 0.04405355 0.8842795 0.9767889
[2,] -0.8169332 -0.7485139 1.153972 0.7832822 0.04405355 0.8842795 0.9767889
          [,71]      [,72]     [,73]      [,74]     [,75]    [,76]     [,77]
[1,] -0.5053796 -0.7852825 -2.400734 0.09906508 0.1887347 1.006809 -2.010929
[2,] -0.5053796 -0.7852825 -2.400734 0.09906508 0.1887347 1.006809 -2.010929
         [,78]     [,79]     [,80]      [,81]     [,82]     [,83]    [,84]
[1,] 0.1677059 -0.662708 0.8704405 -0.4770828 -1.882833 -1.276387 0.557416
[2,] 0.1677059 -0.662708 0.8704405 -0.4770828 -1.882833 -1.276387 0.557416
           [,85]     [,86]      [,87]     [,88]     [,89]      [,90]      [,91]
[1,] -0.05271661 -1.647842 -0.7400195 0.3961062 0.8883635 -0.2017394 -0.4974503
[2,] -0.05271661 -1.647842 -0.7400195 0.3961062 0.8883635 -0.2017394 -0.4974503
         [,92]       [,93]      [,94]    [,95]     [,96]    [,97]       [,98]
[1,] 0.5250116 -0.01834041 -0.2283027 1.889785 0.7386781 1.411793 -0.07991884
[2,] 0.5250116 -0.01834041 -0.2283027 1.889785 0.7386781 1.411793 -0.07991884
        [,99]    [,100]
[1,] -2.03484 -1.294916
[2,] -2.03484 -1.294916
> 
> 
> Max(tmp2)
[1] 3.04527
> Min(tmp2)
[1] -3.807674
> mean(tmp2)
[1] 0.008180308
> Sum(tmp2)
[1] 0.8180308
> Var(tmp2)
[1] 1.092559
> 
> rowMeans(tmp2)
  [1]  1.012579764 -0.347497701 -0.393723938 -0.897277349 -0.139994198
  [6] -0.698247902  1.333535698  2.050503723 -0.633955059  0.160058774
 [11]  1.590558001 -0.370503548 -0.696535639 -0.072553936 -0.843052379
 [16] -1.470491911 -1.059720453 -0.447091212 -0.400947866 -0.787052886
 [21]  1.181344334  0.469318870  1.917068006  0.477336508 -1.362253340
 [26] -0.958429505  1.129214315  3.045269905  0.573687285 -0.519859879
 [31]  1.078093629  0.831923091 -0.266535597 -1.379910563  0.782174411
 [36] -0.130663796 -0.160689312 -0.960599801 -0.390446870  1.242946053
 [41] -0.244244572 -3.807673737  1.039780011 -1.319837349 -1.201639545
 [46] -0.271884507 -0.356330013  0.204606122  0.255187298 -0.266529492
 [51]  1.000285022 -0.610594612  1.106218748  0.297758747 -0.424333836
 [56]  1.181807832  0.485934554  1.701367958 -0.170890425 -0.184381720
 [61]  1.310466733  0.253267835 -0.504501469 -0.839337614 -1.328144570
 [66] -0.941774093 -0.784152881 -0.663408639  1.825711293 -0.911698544
 [71]  1.621809579 -1.291670225 -1.259154338 -1.058915479  0.490760808
 [76] -0.250745610  0.018221423  1.354650857  0.420597108 -0.437327080
 [81] -0.635858320 -0.685790359 -0.432248607  0.684575939  1.745075603
 [86]  0.810439209  0.991188164  0.233640477 -0.992031987  0.527198542
 [91]  0.008554408  0.247069193 -2.396739522  0.554534250 -0.844398427
 [96]  0.429432762  1.700589034 -0.367941744 -0.022487361  0.336390291
> rowSums(tmp2)
  [1]  1.012579764 -0.347497701 -0.393723938 -0.897277349 -0.139994198
  [6] -0.698247902  1.333535698  2.050503723 -0.633955059  0.160058774
 [11]  1.590558001 -0.370503548 -0.696535639 -0.072553936 -0.843052379
 [16] -1.470491911 -1.059720453 -0.447091212 -0.400947866 -0.787052886
 [21]  1.181344334  0.469318870  1.917068006  0.477336508 -1.362253340
 [26] -0.958429505  1.129214315  3.045269905  0.573687285 -0.519859879
 [31]  1.078093629  0.831923091 -0.266535597 -1.379910563  0.782174411
 [36] -0.130663796 -0.160689312 -0.960599801 -0.390446870  1.242946053
 [41] -0.244244572 -3.807673737  1.039780011 -1.319837349 -1.201639545
 [46] -0.271884507 -0.356330013  0.204606122  0.255187298 -0.266529492
 [51]  1.000285022 -0.610594612  1.106218748  0.297758747 -0.424333836
 [56]  1.181807832  0.485934554  1.701367958 -0.170890425 -0.184381720
 [61]  1.310466733  0.253267835 -0.504501469 -0.839337614 -1.328144570
 [66] -0.941774093 -0.784152881 -0.663408639  1.825711293 -0.911698544
 [71]  1.621809579 -1.291670225 -1.259154338 -1.058915479  0.490760808
 [76] -0.250745610  0.018221423  1.354650857  0.420597108 -0.437327080
 [81] -0.635858320 -0.685790359 -0.432248607  0.684575939  1.745075603
 [86]  0.810439209  0.991188164  0.233640477 -0.992031987  0.527198542
 [91]  0.008554408  0.247069193 -2.396739522  0.554534250 -0.844398427
 [96]  0.429432762  1.700589034 -0.367941744 -0.022487361  0.336390291
> 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.012579764 -0.347497701 -0.393723938 -0.897277349 -0.139994198
  [6] -0.698247902  1.333535698  2.050503723 -0.633955059  0.160058774
 [11]  1.590558001 -0.370503548 -0.696535639 -0.072553936 -0.843052379
 [16] -1.470491911 -1.059720453 -0.447091212 -0.400947866 -0.787052886
 [21]  1.181344334  0.469318870  1.917068006  0.477336508 -1.362253340
 [26] -0.958429505  1.129214315  3.045269905  0.573687285 -0.519859879
 [31]  1.078093629  0.831923091 -0.266535597 -1.379910563  0.782174411
 [36] -0.130663796 -0.160689312 -0.960599801 -0.390446870  1.242946053
 [41] -0.244244572 -3.807673737  1.039780011 -1.319837349 -1.201639545
 [46] -0.271884507 -0.356330013  0.204606122  0.255187298 -0.266529492
 [51]  1.000285022 -0.610594612  1.106218748  0.297758747 -0.424333836
 [56]  1.181807832  0.485934554  1.701367958 -0.170890425 -0.184381720
 [61]  1.310466733  0.253267835 -0.504501469 -0.839337614 -1.328144570
 [66] -0.941774093 -0.784152881 -0.663408639  1.825711293 -0.911698544
 [71]  1.621809579 -1.291670225 -1.259154338 -1.058915479  0.490760808
 [76] -0.250745610  0.018221423  1.354650857  0.420597108 -0.437327080
 [81] -0.635858320 -0.685790359 -0.432248607  0.684575939  1.745075603
 [86]  0.810439209  0.991188164  0.233640477 -0.992031987  0.527198542
 [91]  0.008554408  0.247069193 -2.396739522  0.554534250 -0.844398427
 [96]  0.429432762  1.700589034 -0.367941744 -0.022487361  0.336390291
> rowMin(tmp2)
  [1]  1.012579764 -0.347497701 -0.393723938 -0.897277349 -0.139994198
  [6] -0.698247902  1.333535698  2.050503723 -0.633955059  0.160058774
 [11]  1.590558001 -0.370503548 -0.696535639 -0.072553936 -0.843052379
 [16] -1.470491911 -1.059720453 -0.447091212 -0.400947866 -0.787052886
 [21]  1.181344334  0.469318870  1.917068006  0.477336508 -1.362253340
 [26] -0.958429505  1.129214315  3.045269905  0.573687285 -0.519859879
 [31]  1.078093629  0.831923091 -0.266535597 -1.379910563  0.782174411
 [36] -0.130663796 -0.160689312 -0.960599801 -0.390446870  1.242946053
 [41] -0.244244572 -3.807673737  1.039780011 -1.319837349 -1.201639545
 [46] -0.271884507 -0.356330013  0.204606122  0.255187298 -0.266529492
 [51]  1.000285022 -0.610594612  1.106218748  0.297758747 -0.424333836
 [56]  1.181807832  0.485934554  1.701367958 -0.170890425 -0.184381720
 [61]  1.310466733  0.253267835 -0.504501469 -0.839337614 -1.328144570
 [66] -0.941774093 -0.784152881 -0.663408639  1.825711293 -0.911698544
 [71]  1.621809579 -1.291670225 -1.259154338 -1.058915479  0.490760808
 [76] -0.250745610  0.018221423  1.354650857  0.420597108 -0.437327080
 [81] -0.635858320 -0.685790359 -0.432248607  0.684575939  1.745075603
 [86]  0.810439209  0.991188164  0.233640477 -0.992031987  0.527198542
 [91]  0.008554408  0.247069193 -2.396739522  0.554534250 -0.844398427
 [96]  0.429432762  1.700589034 -0.367941744 -0.022487361  0.336390291
> 
> colMeans(tmp2)
[1] 0.008180308
> colSums(tmp2)
[1] 0.8180308
> colVars(tmp2)
[1] 1.092559
> colSd(tmp2)
[1] 1.045255
> colMax(tmp2)
[1] 3.04527
> colMin(tmp2)
[1] -3.807674
> colMedians(tmp2)
[1] -0.1657899
> colRanges(tmp2)
          [,1]
[1,] -3.807674
[2,]  3.045270
> 
> 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] -6.9927124  4.5914974 -1.7853413 -0.4241975  0.8786385  2.7455326
 [7] -2.3854958 -0.1631157  0.5803956 -3.7467827
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -2.4137494
[2,] -1.7291368
[3,] -0.2827333
[4,] -0.1826404
[5,]  1.3085627
> 
> rowApply(tmp,sum)
 [1] -2.3230129 -0.5914228  3.5935436 -0.1381303  3.8708705 -1.7059213
 [7] -0.4361810 -1.4972632 -1.4771608 -5.9969030
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    1    1    5   10    3    1    5    5    6     2
 [2,]    9    2   10    7    7    9   10    4   10     3
 [3,]    4    5    4    8    6    2    2    1    8     7
 [4,]    6    8    3    3    8    5    1    6    7     6
 [5,]    3   10    9    2    9    7    7    2    4     5
 [6,]    8    9    6    5    4    8    9    3    5     9
 [7,]    7    7    7    1   10    4    4    9    3     1
 [8,]    2    6    8    6    2    3    8    7    9     8
 [9,]   10    3    2    9    1   10    6    8    1    10
[10,]    5    4    1    4    5    6    3   10    2     4
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1] -0.1690324  5.0980255 -2.7675324 -2.7341115  0.5573663 -1.1109029
 [7]  3.8783913  1.2935907  2.5944363  0.3973470 -0.3976511  2.1235936
[13] -1.6139368  2.1330581  0.8455165 -0.8629884 -2.3349121  2.3475669
[19]  0.5796720 -1.7568684
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -1.2816262
[2,] -0.5348937
[3,] -0.3438739
[4,]  0.5079427
[5,]  1.4834186
> 
> rowApply(tmp,sum)
[1] -0.3074857  2.5025239  3.2587658 -0.2377360  2.8845602
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]   13    5    3    7   18
[2,]   19   19   18    9   13
[3,]   12   14    1   11    1
[4,]    4    2   13   12    2
[5,]    2    7   20   19   10
> 
> 
> as.matrix(tmp)
           [,1]       [,2]        [,3]        [,4]       [,5]       [,6]
[1,]  0.5079427  1.8317051  0.33128769 -1.35934208 -1.7809124 -2.4979199
[2,] -0.5348937  1.5657262  0.34783528 -1.06461356 -0.1117250  0.3701052
[3,] -1.2816262  1.2606454 -1.43908559  0.73657549  1.5285452  0.2128802
[4,] -0.3438739 -0.1257766  0.04573139  0.06925102  1.0397566 -0.3525374
[5,]  1.4834186  0.5657255 -2.05330121 -1.11598240 -0.1182981  1.1565691
           [,7]       [,8]       [,9]      [,10]      [,11]      [,12]
[1,]  0.7286785  0.6180920  2.0362839  0.1300904  0.8019039  0.9584826
[2,]  1.9489409 -0.4385869  0.3414381  0.7904648  0.7298179  0.1717762
[3,] -0.4027378  1.1462668  1.1738250 -0.1863341 -1.0532111  0.3629280
[4,]  1.0001168  0.6244722 -0.2619016  0.5804223 -0.6791455 -0.7787667
[5,]  0.6033929 -0.6566533 -0.6952090 -0.9172963 -0.1970163  1.4091735
          [,13]      [,14]      [,15]      [,16]       [,17]       [,18]
[1,]  0.2543459 -0.1397507 -0.1922024 -1.5936783 -0.48758637  1.22430526
[2,] -0.7864477  1.0583593 -1.3969238 -0.6680486 -0.03325618 -0.02360905
[3,] -1.4036061  1.4006938 -0.7837039  1.0041925  0.24939911  0.11024379
[4,] -0.6577954 -1.8937250  1.2879544  0.5681435 -1.43774969  1.02385285
[5,]  0.9795665  1.7074808  1.9303923 -0.1735975 -0.62571900  0.01277408
           [,19]       [,20]
[1,] -0.72447684 -0.95473443
[2,]  0.01813103  0.21803350
[3,]  1.04138004 -0.41850476
[4,]  0.07796099 -0.02412606
[5,]  0.16667678 -0.57753661
> 
> 
> 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.23-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.23-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  649  bytes.
Disk usage :  200  bytes.
> subBufferedMatrix(tmp,,5:8)
BufferedMatrix object
Matrix size:  5 4 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  562  bytes.
Disk usage :  160  bytes.
> subBufferedMatrix(tmp,1:3,)
BufferedMatrix object
Matrix size:  3 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  480  bytes.
> 
> 
> rm(tmp)
> 
> 
> ###
> ### Testing colnames and rownames
> ###
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> 
> 
> colnames(tmp)
NULL
> rownames(tmp)
NULL
> 
> 
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> colnames(tmp)
 [1] "col1"  "col2"  "col3"  "col4"  "col5"  "col6"  "col7"  "col8"  "col9" 
[10] "col10" "col11" "col12" "col13" "col14" "col15" "col16" "col17" "col18"
[19] "col19" "col20"
> rownames(tmp)
[1] "row1" "row2" "row3" "row4" "row5"
> 
> 
> tmp["row1",]
            col1      col2     col3      col4      col5      col6     col7
row1 -0.03479457 0.8554472 1.313845 0.1339177 -1.071624 -1.294197 1.184474
           col8      col9     col10      col11      col12     col13    col14
row1 -0.7392893 0.8431495 0.9211931 -0.2104672 -0.7657916 -2.019799 0.791896
        col15      col16      col17     col18     col19     col20
row1 1.090739 -0.4878955 -0.7049795 0.8867937 0.5433906 -1.687085
> tmp[,"col10"]
           col10
row1  0.92119305
row2  1.46808791
row3  1.51120409
row4 -0.09457575
row5  0.03560139
> tmp[c("row1","row5"),]
            col1         col2     col3       col4       col5       col6
row1 -0.03479457  0.855447245 1.313845  0.1339177 -1.0716236 -1.2941971
row5  1.23612289 -0.002495617 1.257000 -0.4900096  0.1855672 -0.9469018
          col7       col8       col9      col10      col11      col12
row1 1.1844742 -0.7392893  0.8431495 0.92119305 -0.2104672 -0.7657916
row5 0.4755102 -0.2431737 -1.3078836 0.03560139 -0.3969805  1.3155574
          col13     col14     col15      col16       col17      col18
row1 -2.0197986  0.791896 1.0907389 -0.4878955 -0.70497953  0.8867937
row5 -0.1229237 -1.004685 0.8373966 -0.3374712  0.05057261 -0.2311474
          col19      col20
row1  0.5433906 -1.6870854
row5 -1.2723703 -0.8347727
> tmp[,c("col6","col20")]
           col6       col20
row1 -1.2941971 -1.68708539
row2 -0.3139215 -1.33344928
row3 -1.0140118  0.03200006
row4 -0.1989540  1.71056076
row5 -0.9469018 -0.83477268
> tmp[c("row1","row5"),c("col6","col20")]
           col6      col20
row1 -1.2941971 -1.6870854
row5 -0.9469018 -0.8347727
> 
> 
> 
> 
> 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.08896 50.04377 48.76354 50.35291 50.16737 105.6219 49.83196 48.91361
         col9    col10    col11    col12    col13   col14    col15    col16
row1 50.64137 50.61194 49.79392 51.49995 48.55272 49.9008 49.19953 48.76074
        col17    col18    col19    col20
row1 49.98655 49.88118 49.77495 106.5092
> tmp[,"col10"]
        col10
row1 50.61194
row2 29.18433
row3 31.85603
row4 31.35904
row5 49.74561
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 49.08896 50.04377 48.76354 50.35291 50.16737 105.6219 49.83196 48.91361
row5 48.79695 52.90964 49.90730 50.18631 51.68516 105.9664 49.22541 48.78829
         col9    col10    col11    col12    col13    col14    col15    col16
row1 50.64137 50.61194 49.79392 51.49995 48.55272 49.90080 49.19953 48.76074
row5 50.37965 49.74561 50.83523 51.22166 49.72156 50.51679 50.50213 50.01008
        col17    col18    col19    col20
row1 49.98655 49.88118 49.77495 106.5092
row5 50.84217 48.78241 48.87819 105.5079
> tmp[,c("col6","col20")]
          col6     col20
row1 105.62189 106.50923
row2  74.11137  75.03860
row3  75.25384  75.16085
row4  73.69738  74.13076
row5 105.96640 105.50788
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 105.6219 106.5092
row5 105.9664 105.5079
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 105.6219 106.5092
row5 105.9664 105.5079
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
          col13
[1,]  0.1441533
[2,]  0.4159491
[3,]  2.5414078
[4,] -0.1929271
[5,]  1.0445451
> tmp[,c("col17","col7")]
          col17       col7
[1,]  1.9997300  0.2692890
[2,]  0.6963054  0.2428379
[3,] -1.0882805 -0.3698033
[4,] -1.7082662 -1.1667181
[5,] -1.9328881 -0.7237432
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
           col6      col20
[1,] -0.5187291 -0.8298552
[2,]  1.1839544 -0.8759027
[3,] -0.8199325  0.8183768
[4,]  0.8972008 -2.5069590
[5,] -0.4789288  0.9430348
> subBufferedMatrix(tmp,1,c("col6"))[,1]
           col1
[1,] -0.5187291
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
           col6
[1,] -0.5187291
[2,]  1.1839544
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> 
> 
> 
> subBufferedMatrix(tmp,c("row3","row1"),)[,1:20]
           [,1]     [,2]       [,3]       [,4]       [,5]       [,6]      [,7]
row3 -0.1357323 0.306378 -1.3428040 -0.9998823  0.3592102 -0.9003453 -1.429614
row1  1.1631524 1.541613  0.4212276 -0.6005902 -1.9229632 -1.5178485  1.359923
          [,8]       [,9]      [,10]      [,11]     [,12]      [,13]      [,14]
row3 -1.120913 -0.2191956 -1.4769625 -0.9539495 1.2975961 -0.5642047 -0.4788739
row1  1.019610  1.0966363  0.2049638 -1.5409676 0.7980119  1.9593812  0.4075054
            [,15]      [,16]     [,17]     [,18]      [,19]        [,20]
row3 -0.007733895  0.2845605 1.1886947 0.3968695  1.5563103 -1.890645626
row1  1.243055864 -0.9616050 0.1643325 0.9855837 -0.8500774 -0.009743821
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
           [,1]      [,2]     [,3]      [,4]      [,5]      [,6]      [,7]
row2 -0.2625056 0.3053896 2.682762 0.9089181 -1.577925 0.2550522 -2.782959
         [,8]      [,9]      [,10]
row2 1.278226 0.4170765 -0.3113708
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
           [,1]      [,2]      [,3]       [,4]      [,5]       [,6]      [,7]
row5 -0.2846115 -2.362009 0.6977344 -0.3477348 -1.211417 -0.3514051 -1.064333
         [,8]       [,9]    [,10]    [,11]     [,12]     [,13]      [,14]
row5 1.560171 -0.4925649 1.418756 1.297735 -1.405077 -1.555676 -0.7540807
         [,15]      [,16]    [,17]      [,18]    [,19]     [,20]
row5 -1.159461 -0.1827839 -1.45533 -0.7091497 1.443432 0.6785771
> 
> 
> 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: 0x64ba84666ed0>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM7c56046d70a27"
 [2] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM7c560349a6b48"
 [3] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM7c560383c398c"
 [4] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM7c56064452f55"
 [5] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM7c56013bdf305"
 [6] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM7c56049be3a7" 
 [7] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM7c5603afa8050"
 [8] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM7c5602044361a"
 [9] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM7c5605f3b43c" 
[10] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM7c5606744f5c8"
[11] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM7c5601d6e22d5"
[12] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM7c5601e7e6471"
[13] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM7c5605d5dc944"
[14] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM7c560786274fa"
[15] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM7c5607071b343"
> 
> 
> ### 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: 0x64ba84a59990>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x64ba84a59990>
Warning message:
In dir.create(new.directory) :
  '/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x64ba84a59990>
> rowMedians(tmp)
  [1] -7.279931e-02 -3.735908e-01 -1.339105e-01  3.215767e-01 -3.015060e-01
  [6] -1.239732e-01  3.078352e-01 -2.900589e-01  5.199948e-01  3.328969e-02
 [11] -1.768217e-01  2.286961e-02 -6.040362e-01 -6.123051e-01  8.642932e-02
 [16] -5.605139e-01  7.116550e-02  3.332379e-01 -3.387989e-01 -4.572604e-01
 [21] -2.850483e-01  3.747569e-01  1.493441e-01  1.136391e-01 -2.456458e-01
 [26] -4.002064e-01  2.605858e-01  1.764354e-01  6.564802e-02  1.873461e-01
 [31] -1.659070e-01  4.385686e-01 -4.199744e-01 -6.210168e-01 -8.032610e-02
 [36] -2.086856e-01 -1.070294e-01  5.478865e-01  4.017319e-02 -4.293492e-02
 [41] -4.188055e-01  2.235115e-03 -4.766176e-02 -3.381344e-01 -3.773964e-01
 [46] -1.036944e-01 -1.375869e-01 -8.344581e-01 -7.051391e-02 -1.654222e-01
 [51]  8.626346e-02  4.012052e-01 -4.057714e-01  2.540163e-01 -7.396020e-03
 [56]  2.137520e-01  8.021830e-02 -1.248641e-01  1.503349e-01  1.454913e-01
 [61] -2.454266e-01 -8.870175e-01  4.074731e-02  3.551941e-01  1.858927e-01
 [66]  2.762708e-01  2.688580e-03  1.821526e-01  2.116705e-01 -3.408011e-01
 [71] -2.041505e-01 -4.976028e-01  5.038055e-01 -2.833895e-01  2.482129e-02
 [76]  6.930363e-02 -5.919932e-01 -5.800664e-01 -2.157430e-01 -2.515149e-01
 [81]  2.344901e-01 -2.606980e-01 -6.003364e-02  1.182783e-01  2.270408e-05
 [86]  1.276248e-01  3.134454e-01 -2.526171e-01  3.538455e-01  1.631705e-01
 [91] -5.798015e-01  4.297123e-01 -3.386082e-02 -8.209578e-01 -2.799432e-03
 [96]  3.323951e-01  6.031628e-02  5.409004e-01 -5.443784e-02 -7.149756e-02
[101]  3.487074e-01  4.257349e-01  9.133224e-02 -2.271018e-01 -3.256403e-01
[106]  7.283463e-01 -2.143447e-01  7.366416e-02 -4.427377e-01 -3.071173e-01
[111] -6.904243e-01 -4.477034e-01 -5.719171e-01  6.161236e-01  5.268106e-03
[116] -1.197119e-01 -2.860074e-01 -4.043134e-01 -6.409947e-02 -2.659434e-01
[121]  2.168712e-01 -4.582253e-01 -4.039698e-01  2.557263e-01 -2.239270e-01
[126]  3.304576e-02  2.624932e-01  3.137943e-01  5.141110e-01 -4.148728e-01
[131]  3.293340e-01  1.929670e-01 -1.587362e-02 -7.252967e-02 -4.092713e-02
[136]  3.177800e-01  1.134921e-01 -3.006065e-01 -3.347329e-01  2.194608e-01
[141] -4.585713e-02 -1.428879e-01  1.185712e-01  1.096803e-01  2.531491e-01
[146]  3.078677e-01 -2.495041e-01  3.520382e-01 -3.613506e-01  8.177937e-02
[151]  1.514705e-01 -2.236725e-01  2.040901e-02 -2.401401e-01 -1.293344e-01
[156] -1.707955e-01  1.189236e-01 -2.578626e-01  1.414972e-01 -9.787934e-03
[161] -2.381893e-01 -9.114353e-01  1.286940e-01 -7.556011e-01  4.376934e-02
[166]  8.796434e-02  4.147045e-01  1.446256e-01 -7.319483e-02  2.122565e-01
[171]  6.948569e-01 -3.464085e-01  2.261562e-01 -3.755397e-01 -1.120012e-01
[176] -4.635309e-01  2.499951e-01  1.738869e-01  8.589945e-02  5.106282e-01
[181]  2.184040e-01 -4.564699e-01 -1.337645e-01 -9.145157e-02 -2.770565e-01
[186] -7.391745e-01 -2.313845e-01 -4.120240e-01  2.118423e-02  3.757041e-01
[191] -1.192428e-01  8.414150e-01 -1.185017e-01  2.508346e-01 -2.784204e-01
[196]  1.193928e-01  2.330396e-02  2.729988e-01 -2.314638e-01 -3.888465e-01
[201] -7.411797e-02 -8.172373e-02 -1.890250e-01  7.337006e-01  2.241179e-01
[206] -1.930155e-01 -1.104182e-01  1.829515e-01 -4.393826e-01  1.239486e-01
[211]  6.790506e-03  3.827488e-01  7.378640e-02 -3.258315e-01 -3.129090e-02
[216]  2.649069e-01 -2.681794e-01  3.862290e-01  1.389255e-01  2.617116e-03
[221] -4.738781e-01 -5.793129e-01  4.559663e-01 -2.890825e-01 -1.148834e-01
[226]  4.107031e-01 -3.057267e-01 -2.630927e-01 -2.926377e-01  4.879910e-01
> 
> proc.time()
   user  system elapsed 
  1.338   1.583   2.909 

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: 0x650f9f3d00f0>
> .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: 0x650f9f3d00f0>
> .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: 0x650f9f3d00f0>
> .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: 0x650f9f3d00f0>
> 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: 0x650fa021e690>
> .Call("R_bm_AddColumn",P)
<pointer: 0x650fa021e690>
> .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: 0x650fa021e690>
> .Call("R_bm_AddColumn",P)
<pointer: 0x650fa021e690>
> .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: 0x650fa021e690>
> 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: 0x650fa1c58010>
> .Call("R_bm_AddColumn",P)
<pointer: 0x650fa1c58010>
> .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: 0x650fa1c58010>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x650fa1c58010>
> .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: 0x650fa1c58010>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x650fa1c58010>
> .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: 0x650fa1c58010>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x650fa1c58010>
> .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: 0x650fa1c58010>
> 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: 0x650fa1ca8070>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x650fa1ca8070>
> .Call("R_bm_AddColumn",P)
<pointer: 0x650fa1ca8070>
> .Call("R_bm_AddColumn",P)
<pointer: 0x650fa1ca8070>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile7c66e4fd12810" "BufferedMatrixFile7c66e6b1b1c76"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile7c66e4fd12810" "BufferedMatrixFile7c66e6b1b1c76"
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x650f9fada7d0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x650f9fada7d0>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x650f9fada7d0>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x650f9fada7d0>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x650f9fada7d0>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x650f9fada7d0>
> .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: 0x650fa15de2d0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x650fa15de2d0>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x650fa15de2d0>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x650fa15de2d0>
> 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: 0x650fa08a44a0>
> .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: 0x650fa08a44a0>
> rm(P)
> 
> proc.time()
   user  system elapsed 
  0.260   0.062   0.310 

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.247   0.054   0.288 

Example timings