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

This page was generated on 2026-04-11 11:36 -0400 (Sat, 11 Apr 2026).

HostnameOSArch (*)R versionInstalled pkgs
nebbiolo1Linux (Ubuntu 24.04.4 LTS)x86_644.6.0 alpha (2026-04-05 r89794) 4919
kjohnson3macOS 13.7.7 Venturaarm644.6.0 alpha (2026-04-08 r89818) 4631
Click on any hostname to see more info about the system (e.g. compilers)      (*) as reported by 'uname -p', except on Windows and Mac OS X

Package 259/2390HostnameOS / ArchINSTALLBUILDCHECKBUILD BIN
BufferedMatrix 1.75.0  (landing page)
Ben Bolstad
Snapshot Date: 2026-04-10 13:40 -0400 (Fri, 10 Apr 2026)
git_url: https://git.bioconductor.org/packages/BufferedMatrix
git_branch: devel
git_last_commit: ecdbf23
git_last_commit_date: 2025-10-29 09:58:55 -0400 (Wed, 29 Oct 2025)
nebbiolo1Linux (Ubuntu 24.04.4 LTS) / x86_64  OK    OK    OK  UNNEEDED, same version is already published
kjohnson3macOS 13.7.7 Ventura / arm64  OK    OK    WARNINGS    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.75.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.75.0.tar.gz
StartedAt: 2026-04-10 21:53:12 -0400 (Fri, 10 Apr 2026)
EndedAt: 2026-04-10 21:53:37 -0400 (Fri, 10 Apr 2026)
EllapsedTime: 25.1 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.75.0.tar.gz
###
##############################################################################
##############################################################################


* using log directory ‘/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck’
* using R version 4.6.0 alpha (2026-04-05 r89794)
* 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-04-11 01:53:12 UTC
* checking for file ‘BufferedMatrix/DESCRIPTION’ ... OK
* this is package ‘BufferedMatrix’ version ‘1.75.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.75.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 alpha (2026-04-05 r89794)
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.240   0.051   0.283 

BufferedMatrix.Rcheck/tests/objectTesting.Rout


R version 4.6.0 alpha (2026-04-05 r89794)
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 480193 25.7    1053195 56.3   637568 34.1
Vcells 887233  6.8    8388608 64.0  2083868 15.9
> 
> 
> 
> 
> ##
> ## checking reads
> ##
> 
> tmp2 <- createBufferedMatrix(10,20)
> 
> test.sample <- rnorm(10*20)
> 
> tmp2[1:10,1:20] <- test.sample
> 
> test.matrix <- matrix(test.sample,10,20)
> 
> ## testing reads
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   which.col <- sample(1:20,1)
+   if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> date()
[1] "Fri Apr 10 21:53:27 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] "Fri Apr 10 21:53:27 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: 0x55c4f515fa60>
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   which.col <- sample(1:20,1)
+   if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,5,replace=TRUE)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> date()
[1] "Fri Apr 10 21:53:28 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] "Fri Apr 10 21:53:28 2026"
> 
> ColMode(tmp2)
<pointer: 0x55c4f515fa60>
> 
> 
> 
> ### 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.82730655 -0.8660476  1.062396  0.7966277
[2,]  0.08368788 -0.4982609  1.057959  0.2781171
[3,] -2.68476420 -0.3195006 -2.418700  1.3385687
[4,]  0.08444834 -0.5661042  1.051958 -0.8403893
> 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.82730655 0.8660476 1.062396 0.7966277
[2,]  0.08368788 0.4982609 1.057959 0.2781171
[3,]  2.68476420 0.3195006 2.418700 1.3385687
[4,]  0.08444834 0.5661042 1.051958 0.8403893
> 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.9913616 0.9306168 1.030726 0.8925400
[2,] 0.2892886 0.7058760 1.028571 0.5273681
[3,] 1.6385250 0.5652439 1.555217 1.1569653
[4,] 0.2906000 0.7523989 1.025650 0.9167275
> 
> 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,] 224.74092 35.17222 36.36965 34.72203
[2,]  27.97657 32.55702 36.34367 30.55180
[3,]  44.07001 30.97194 42.97087 37.90822
[4,]  27.99045 33.09009 36.30846 35.00766
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x55c4f5e2d5c0>
> exp(tmp5)
<pointer: 0x55c4f5e2d5c0>
> log(tmp5,2)
<pointer: 0x55c4f5e2d5c0>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 467.7688
> Min(tmp5)
[1] 53.44182
> mean(tmp5)
[1] 72.63085
> Sum(tmp5)
[1] 14526.17
> Var(tmp5)
[1] 859.3725
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 97.11045 66.84254 70.60446 70.79947 69.98300 69.99970 70.25680 70.53460
 [9] 70.48105 69.69639
> rowSums(tmp5)
 [1] 1942.209 1336.851 1412.089 1415.989 1399.660 1399.994 1405.136 1410.692
 [9] 1409.621 1393.928
> rowVars(tmp5)
 [1] 7664.39816   29.39638  100.45744  106.73892   58.83303   38.22167
 [7]   59.39114  110.68202   64.16824   55.44371
> rowSd(tmp5)
 [1] 87.546549  5.421842 10.022846 10.331453  7.670269  6.182368  7.706565
 [8] 10.520552  8.010508  7.446053
> rowMax(tmp5)
 [1] 467.76878  75.79481  91.72596  86.85541  86.22563  80.71668  84.05536
 [8]  91.18377  87.73670  86.15086
> rowMin(tmp5)
 [1] 66.72450 57.69780 57.99574 53.89561 57.59949 56.63247 57.42134 53.44182
 [9] 57.44709 56.97660
> 
> colMeans(tmp5)
 [1] 108.56581  67.18030  74.34840  71.91534  69.76994  70.64438  72.92766
 [8]  70.48847  71.79768  68.22332  71.58049  73.19764  68.29981  74.53754
[15]  73.18505  71.12793  68.42097  71.33887  66.71697  68.35038
> colSums(tmp5)
 [1] 1085.6581  671.8030  743.4840  719.1534  697.6994  706.4438  729.2766
 [8]  704.8847  717.9768  682.2332  715.8049  731.9764  682.9981  745.3754
[15]  731.8505  711.2793  684.2097  713.3887  667.1697  683.5038
> colVars(tmp5)
 [1] 16041.63550    62.15939    68.60305    40.94014    92.86762    52.08022
 [7]    45.24961    87.97118    40.82362    36.92184    63.93650    98.06545
[13]    93.08980   156.11905    54.89736    62.43617    86.58166   102.88089
[19]    51.29103    40.36035
> colSd(tmp5)
 [1] 126.655578   7.884123   8.282696   6.398448   9.636785   7.216663
 [7]   6.726783   9.379295   6.389336   6.076334   7.996030   9.902800
[13]   9.648306  12.494761   7.409275   7.901656   9.304927  10.143022
[19]   7.161776   6.352979
> colMax(tmp5)
 [1] 467.76878  84.05536  89.43823  80.14502  81.49887  81.89776  82.39078
 [8]  87.73670  86.21347  76.60310  82.40974  91.18377  86.75846  91.54883
[15]  83.51204  86.22563  87.42291  95.08358  81.49374  80.10382
> colMin(tmp5)
 [1] 57.34120 56.63247 61.48798 60.88694 53.89561 57.42134 63.64177 58.43211
 [9] 63.73525 55.32171 60.36946 57.44709 56.97660 53.44182 59.22595 59.61472
[17] 57.59949 60.08353 57.24487 61.27705
> 
> 
> ### 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] 97.11045 66.84254 70.60446 70.79947       NA 69.99970 70.25680 70.53460
 [9] 70.48105 69.69639
> rowSums(tmp5)
 [1] 1942.209 1336.851 1412.089 1415.989       NA 1399.994 1405.136 1410.692
 [9] 1409.621 1393.928
> rowVars(tmp5)
 [1] 7664.39816   29.39638  100.45744  106.73892   60.64217   38.22167
 [7]   59.39114  110.68202   64.16824   55.44371
> rowSd(tmp5)
 [1] 87.546549  5.421842 10.022846 10.331453  7.787308  6.182368  7.706565
 [8] 10.520552  8.010508  7.446053
> rowMax(tmp5)
 [1] 467.76878  75.79481  91.72596  86.85541        NA  80.71668  84.05536
 [8]  91.18377  87.73670  86.15086
> rowMin(tmp5)
 [1] 66.72450 57.69780 57.99574 53.89561       NA 56.63247 57.42134 53.44182
 [9] 57.44709 56.97660
> 
> colMeans(tmp5)
 [1] 108.56581  67.18030  74.34840  71.91534  69.76994  70.64438  72.92766
 [8]  70.48847  71.79768  68.22332  71.58049  73.19764  68.29981  74.53754
[15]  73.18505  71.12793  68.42097  71.33887        NA  68.35038
> colSums(tmp5)
 [1] 1085.6581  671.8030  743.4840  719.1534  697.6994  706.4438  729.2766
 [8]  704.8847  717.9768  682.2332  715.8049  731.9764  682.9981  745.3754
[15]  731.8505  711.2793  684.2097  713.3887        NA  683.5038
> colVars(tmp5)
 [1] 16041.63550    62.15939    68.60305    40.94014    92.86762    52.08022
 [7]    45.24961    87.97118    40.82362    36.92184    63.93650    98.06545
[13]    93.08980   156.11905    54.89736    62.43617    86.58166   102.88089
[19]          NA    40.36035
> colSd(tmp5)
 [1] 126.655578   7.884123   8.282696   6.398448   9.636785   7.216663
 [7]   6.726783   9.379295   6.389336   6.076334   7.996030   9.902800
[13]   9.648306  12.494761   7.409275   7.901656   9.304927  10.143022
[19]         NA   6.352979
> colMax(tmp5)
 [1] 467.76878  84.05536  89.43823  80.14502  81.49887  81.89776  82.39078
 [8]  87.73670  86.21347  76.60310  82.40974  91.18377  86.75846  91.54883
[15]  83.51204  86.22563  87.42291  95.08358        NA  80.10382
> colMin(tmp5)
 [1] 57.34120 56.63247 61.48798 60.88694 53.89561 57.42134 63.64177 58.43211
 [9] 63.73525 55.32171 60.36946 57.44709 56.97660 53.44182 59.22595 59.61472
[17] 57.59949 60.08353       NA 61.27705
> 
> Max(tmp5,na.rm=TRUE)
[1] 467.7688
> Min(tmp5,na.rm=TRUE)
[1] 53.44182
> mean(tmp5,na.rm=TRUE)
[1] 72.66926
> Sum(tmp5,na.rm=TRUE)
[1] 14461.18
> Var(tmp5,na.rm=TRUE)
[1] 863.4163
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 97.11045 66.84254 70.60446 70.79947 70.24592 69.99970 70.25680 70.53460
 [9] 70.48105 69.69639
> rowSums(tmp5,na.rm=TRUE)
 [1] 1942.209 1336.851 1412.089 1415.989 1334.673 1399.994 1405.136 1410.692
 [9] 1409.621 1393.928
> rowVars(tmp5,na.rm=TRUE)
 [1] 7664.39816   29.39638  100.45744  106.73892   60.64217   38.22167
 [7]   59.39114  110.68202   64.16824   55.44371
> rowSd(tmp5,na.rm=TRUE)
 [1] 87.546549  5.421842 10.022846 10.331453  7.787308  6.182368  7.706565
 [8] 10.520552  8.010508  7.446053
> rowMax(tmp5,na.rm=TRUE)
 [1] 467.76878  75.79481  91.72596  86.85541  86.22563  80.71668  84.05536
 [8]  91.18377  87.73670  86.15086
> rowMin(tmp5,na.rm=TRUE)
 [1] 66.72450 57.69780 57.99574 53.89561 57.59949 56.63247 57.42134 53.44182
 [9] 57.44709 56.97660
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 108.56581  67.18030  74.34840  71.91534  69.76994  70.64438  72.92766
 [8]  70.48847  71.79768  68.22332  71.58049  73.19764  68.29981  74.53754
[15]  73.18505  71.12793  68.42097  71.33887  66.90913  68.35038
> colSums(tmp5,na.rm=TRUE)
 [1] 1085.6581  671.8030  743.4840  719.1534  697.6994  706.4438  729.2766
 [8]  704.8847  717.9768  682.2332  715.8049  731.9764  682.9981  745.3754
[15]  731.8505  711.2793  684.2097  713.3887  602.1822  683.5038
> colVars(tmp5,na.rm=TRUE)
 [1] 16041.63550    62.15939    68.60305    40.94014    92.86762    52.08022
 [7]    45.24961    87.97118    40.82362    36.92184    63.93650    98.06545
[13]    93.08980   156.11905    54.89736    62.43617    86.58166   102.88089
[19]    57.28698    40.36035
> colSd(tmp5,na.rm=TRUE)
 [1] 126.655578   7.884123   8.282696   6.398448   9.636785   7.216663
 [7]   6.726783   9.379295   6.389336   6.076334   7.996030   9.902800
[13]   9.648306  12.494761   7.409275   7.901656   9.304927  10.143022
[19]   7.568816   6.352979
> colMax(tmp5,na.rm=TRUE)
 [1] 467.76878  84.05536  89.43823  80.14502  81.49887  81.89776  82.39078
 [8]  87.73670  86.21347  76.60310  82.40974  91.18377  86.75846  91.54883
[15]  83.51204  86.22563  87.42291  95.08358  81.49374  80.10382
> colMin(tmp5,na.rm=TRUE)
 [1] 57.34120 56.63247 61.48798 60.88694 53.89561 57.42134 63.64177 58.43211
 [9] 63.73525 55.32171 60.36946 57.44709 56.97660 53.44182 59.22595 59.61472
[17] 57.59949 60.08353 57.24487 61.27705
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1] 97.11045 66.84254 70.60446 70.79947      NaN 69.99970 70.25680 70.53460
 [9] 70.48105 69.69639
> rowSums(tmp5,na.rm=TRUE)
 [1] 1942.209 1336.851 1412.089 1415.989    0.000 1399.994 1405.136 1410.692
 [9] 1409.621 1393.928
> rowVars(tmp5,na.rm=TRUE)
 [1] 7664.39816   29.39638  100.45744  106.73892         NA   38.22167
 [7]   59.39114  110.68202   64.16824   55.44371
> rowSd(tmp5,na.rm=TRUE)
 [1] 87.546549  5.421842 10.022846 10.331453        NA  6.182368  7.706565
 [8] 10.520552  8.010508  7.446053
> rowMax(tmp5,na.rm=TRUE)
 [1] 467.76878  75.79481  91.72596  86.85541        NA  80.71668  84.05536
 [8]  91.18377  87.73670  86.15086
> rowMin(tmp5,na.rm=TRUE)
 [1] 66.72450 57.69780 57.99574 53.89561       NA 56.63247 57.42134 53.44182
 [9] 57.44709 56.97660
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1] 111.92566  67.46904  75.05239  71.20847  70.41502  70.79190  71.87620
 [8]  71.06035  71.89081  67.29223  72.29645  73.31876  68.79844  74.17900
[15]  73.57420  69.45040  69.62336  72.23292       NaN  69.13631
> colSums(tmp5,na.rm=TRUE)
 [1] 1007.3310  607.2214  675.4716  640.8762  633.7352  637.1271  646.8858
 [8]  639.5432  647.0173  605.6301  650.6680  659.8688  619.1860  667.6110
[15]  662.1678  625.0536  626.6102  650.0963    0.0000  622.2268
> colVars(tmp5,na.rm=TRUE)
 [1] 17919.84346    68.99137    71.60285    40.43641    99.79454    58.34541
 [7]    38.46823    95.28829    45.82900    31.78418    66.16192   110.15860
[13]   101.92890   174.18775    60.05588    38.58229    81.13985   106.74860
[19]          NA    38.45650
> colSd(tmp5,na.rm=TRUE)
 [1] 133.865020   8.306104   8.461847   6.358963   9.989722   7.638417
 [7]   6.202277   9.761572   6.769712   5.637746   8.133998  10.495647
[13]  10.095984  13.198021   7.749573   6.211464   9.007766  10.331922
[19]         NA   6.201331
> colMax(tmp5,na.rm=TRUE)
 [1] 467.76878  84.05536  89.43823  80.14502  81.49887  81.89776  81.30740
 [8]  87.73670  86.21347  74.31511  82.40974  91.18377  86.75846  91.54883
[15]  83.51204  76.52524  87.42291  95.08358      -Inf  80.10382
> colMin(tmp5,na.rm=TRUE)
 [1] 57.34120 56.63247 61.48798 60.88694 53.89561 57.42134 63.64177 58.43211
 [9] 63.73525 55.32171 60.36946 57.44709 56.97660 53.44182 59.22595 59.61472
[17] 60.77637 60.08353      Inf 61.75204
> 
> 
> 
> 
> 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] 224.6500 256.9155 125.5406 151.5096 310.4845 271.9704 296.0046 314.3688
 [9] 262.9673 297.1223
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 224.6500 256.9155 125.5406 151.5096 310.4845 271.9704 296.0046 314.3688
 [9] 262.9673 297.1223
> 
> 
> 
> copymatrix <- matrix(rnorm(200,150,15),10,20)
> 
> tmp5[1:10,1:20] <- copymatrix
> which.row <- 1
> which.col  <- 3
> cat(which.row," ",which.col,"\n")
1   3 
> tmp5[which.row,which.col] <- NA
> copymatrix[which.row,which.col] <- NA
> 
> colVars(tmp5,na.rm=TRUE)-apply(copymatrix,2,var,na.rm=TRUE)
 [1]  5.684342e-14  5.684342e-14  5.684342e-14 -5.684342e-14 -5.684342e-14
 [6]  0.000000e+00  0.000000e+00  2.273737e-13  4.973799e-14 -1.705303e-13
[11]  8.526513e-14  0.000000e+00  2.842171e-14  5.684342e-14 -5.684342e-14
[16]  1.136868e-13 -8.526513e-14  1.705303e-13  8.526513e-14 -2.842171e-14
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> ## making sure these things agree
> ##
> ## first when there is no NA
> 
> 
> 
> agree.checks <- function(buff.matrix,r.matrix,err.tol=1e-10){
+ 
+   if (Max(buff.matrix,na.rm=TRUE) != max(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Max")
+   }
+   
+ 
+   if (Min(buff.matrix,na.rm=TRUE) != min(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Min")
+   }
+ 
+ 
+   if (abs(Sum(buff.matrix,na.rm=TRUE)- sum(r.matrix,na.rm=TRUE)) > err.tol){
+ 
+     cat(Sum(buff.matrix,na.rm=TRUE),"\n")
+     cat(sum(r.matrix,na.rm=TRUE),"\n")
+     cat(Sum(buff.matrix,na.rm=TRUE) - sum(r.matrix,na.rm=TRUE),"\n")
+     
+     stop("No agreement in Sum")
+   }
+   
+   if (abs(mean(buff.matrix,na.rm=TRUE) - mean(r.matrix,na.rm=TRUE)) > err.tol){
+     stop("No agreement in mean")
+   }
+   
+   
+   if(abs(Var(buff.matrix,na.rm=TRUE) - var(as.vector(r.matrix),na.rm=TRUE)) > err.tol){
+     stop("No agreement in Var")
+   }
+   
+   
+ 
+   if(any(abs(rowMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,mean,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowMeans")
+   }
+   
+   
+   if(any(abs(colMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,mean,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colMeans")
+   }
+   
+   
+   if(any(abs(rowSums(buff.matrix,na.rm=TRUE)  -  apply(r.matrix,1,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in rowSums")
+   }
+   
+   
+   if(any(abs(colSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colSums")
+   }
+   
+   ### this is to get around the fact that R doesn't like to compute NA on an entire vector of NA when 
+   ### computing variance
+   my.Var <- function(x,na.rm=FALSE){
+    if (all(is.na(x))){
+      return(NA)
+    } else {
+      var(x,na.rm=na.rm)
+    }
+ 
+   }
+   
+   if(any(abs(rowVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+   
+   
+   if(any(abs(colVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+ 
+ 
+   if(any(abs(rowMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+ 
+   if(any(abs(colMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+   
+   
+   if(any(abs(rowMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+   
+ 
+   if(any(abs(colMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+ 
+   if(any(abs(colMedians(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,median,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMedian")
+   }
+ 
+   if(any(abs(colRanges(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,range,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colRanges")
+   }
+ 
+ 
+   
+ }
> 
> 
> 
> 
> 
> 
> 
> 
> 
> for (rep in 1:20){
+   copymatrix <- matrix(rnorm(200,150,15),10,20)
+   
+   tmp5[1:10,1:20] <- copymatrix
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ## now lets assign some NA values and check agreement
+ 
+   which.row <- sample(1:10,1,replace=TRUE)
+   which.col  <- sample(1:20,1,replace=TRUE)
+   
+   cat(which.row," ",which.col,"\n")
+   
+   tmp5[which.row,which.col] <- NA
+   copymatrix[which.row,which.col] <- NA
+   
+   agree.checks(tmp5,copymatrix)
+ 
+   ## make an entire row NA
+   tmp5[which.row,] <- NA
+   copymatrix[which.row,] <- NA
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ### also make an entire col NA
+   tmp5[,which.col] <- NA
+   copymatrix[,which.col] <- NA
+ 
+   agree.checks(tmp5,copymatrix)
+ 
+   ### now make 1 element non NA with NA in the rest of row and column
+ 
+   tmp5[which.row,which.col] <- rnorm(1,150,15)
+   copymatrix[which.row,which.col] <- tmp5[which.row,which.col]
+ 
+   agree.checks(tmp5,copymatrix)
+ }
2   16 
7   8 
4   8 
1   3 
10   4 
3   20 
8   10 
6   12 
2   8 
1   17 
5   13 
10   6 
7   14 
6   12 
10   15 
9   9 
10   6 
2   10 
1   1 
1   14 
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.558567
> Min(tmp)
[1] -2.999348
> mean(tmp)
[1] -0.001303227
> Sum(tmp)
[1] -0.1303227
> Var(tmp)
[1] 1.094587
> 
> rowMeans(tmp)
[1] -0.001303227
> rowSums(tmp)
[1] -0.1303227
> rowVars(tmp)
[1] 1.094587
> rowSd(tmp)
[1] 1.046225
> rowMax(tmp)
[1] 2.558567
> rowMin(tmp)
[1] -2.999348
> 
> colMeans(tmp)
  [1]  0.039910445  1.641970949 -1.077199779  0.356511674 -2.999347844
  [6]  0.223726355  0.228069779  1.055845402  0.761424393 -0.176996640
 [11] -0.258787354 -2.726770776 -0.057583732 -0.033786140 -1.062106361
 [16] -0.303216831 -0.947335573  0.993898872  0.014613443 -0.029750400
 [21] -0.567621518 -0.364301477  0.544281366 -2.109942814 -0.406158352
 [26] -0.838048663  1.099820749  0.016139545 -1.047160494 -0.310717718
 [31] -1.614428595  0.515358648  1.361728788  0.411082099 -0.009720984
 [36] -0.669704579  0.221247338 -1.450947969 -0.494312390 -1.637647424
 [41]  0.094680407 -0.362758372 -1.303619036  0.507357049  1.022017442
 [46]  1.430404464  0.419598968 -0.833318646  0.714108772  2.230847905
 [51]  0.825348199 -0.995178046  0.180172845  1.102969795 -1.756736374
 [56]  0.911813210 -0.048908154  0.774428630  0.777389679  1.047457659
 [61] -0.073469163 -0.039776364  0.019632731  0.064365256 -0.129167197
 [66]  0.906539278 -0.394531062 -1.089377707  1.819507857  0.267806194
 [71] -0.524300456  0.331774498 -0.989440643  2.558566580  1.950986569
 [76]  1.727011364 -0.830817186 -0.706694945 -1.437759778 -0.462005944
 [81]  0.914765289  0.780759439 -1.523456688 -0.146582503  0.192544508
 [86]  1.324196713 -0.767310814  0.748717187 -0.337363173 -0.976368788
 [91]  0.608781588 -1.136398965 -0.722309721  0.527271329  1.553171228
 [96]  0.938930871 -0.085404352  1.886262577 -0.374396717 -1.535093463
> colSums(tmp)
  [1]  0.039910445  1.641970949 -1.077199779  0.356511674 -2.999347844
  [6]  0.223726355  0.228069779  1.055845402  0.761424393 -0.176996640
 [11] -0.258787354 -2.726770776 -0.057583732 -0.033786140 -1.062106361
 [16] -0.303216831 -0.947335573  0.993898872  0.014613443 -0.029750400
 [21] -0.567621518 -0.364301477  0.544281366 -2.109942814 -0.406158352
 [26] -0.838048663  1.099820749  0.016139545 -1.047160494 -0.310717718
 [31] -1.614428595  0.515358648  1.361728788  0.411082099 -0.009720984
 [36] -0.669704579  0.221247338 -1.450947969 -0.494312390 -1.637647424
 [41]  0.094680407 -0.362758372 -1.303619036  0.507357049  1.022017442
 [46]  1.430404464  0.419598968 -0.833318646  0.714108772  2.230847905
 [51]  0.825348199 -0.995178046  0.180172845  1.102969795 -1.756736374
 [56]  0.911813210 -0.048908154  0.774428630  0.777389679  1.047457659
 [61] -0.073469163 -0.039776364  0.019632731  0.064365256 -0.129167197
 [66]  0.906539278 -0.394531062 -1.089377707  1.819507857  0.267806194
 [71] -0.524300456  0.331774498 -0.989440643  2.558566580  1.950986569
 [76]  1.727011364 -0.830817186 -0.706694945 -1.437759778 -0.462005944
 [81]  0.914765289  0.780759439 -1.523456688 -0.146582503  0.192544508
 [86]  1.324196713 -0.767310814  0.748717187 -0.337363173 -0.976368788
 [91]  0.608781588 -1.136398965 -0.722309721  0.527271329  1.553171228
 [96]  0.938930871 -0.085404352  1.886262577 -0.374396717 -1.535093463
> 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.039910445  1.641970949 -1.077199779  0.356511674 -2.999347844
  [6]  0.223726355  0.228069779  1.055845402  0.761424393 -0.176996640
 [11] -0.258787354 -2.726770776 -0.057583732 -0.033786140 -1.062106361
 [16] -0.303216831 -0.947335573  0.993898872  0.014613443 -0.029750400
 [21] -0.567621518 -0.364301477  0.544281366 -2.109942814 -0.406158352
 [26] -0.838048663  1.099820749  0.016139545 -1.047160494 -0.310717718
 [31] -1.614428595  0.515358648  1.361728788  0.411082099 -0.009720984
 [36] -0.669704579  0.221247338 -1.450947969 -0.494312390 -1.637647424
 [41]  0.094680407 -0.362758372 -1.303619036  0.507357049  1.022017442
 [46]  1.430404464  0.419598968 -0.833318646  0.714108772  2.230847905
 [51]  0.825348199 -0.995178046  0.180172845  1.102969795 -1.756736374
 [56]  0.911813210 -0.048908154  0.774428630  0.777389679  1.047457659
 [61] -0.073469163 -0.039776364  0.019632731  0.064365256 -0.129167197
 [66]  0.906539278 -0.394531062 -1.089377707  1.819507857  0.267806194
 [71] -0.524300456  0.331774498 -0.989440643  2.558566580  1.950986569
 [76]  1.727011364 -0.830817186 -0.706694945 -1.437759778 -0.462005944
 [81]  0.914765289  0.780759439 -1.523456688 -0.146582503  0.192544508
 [86]  1.324196713 -0.767310814  0.748717187 -0.337363173 -0.976368788
 [91]  0.608781588 -1.136398965 -0.722309721  0.527271329  1.553171228
 [96]  0.938930871 -0.085404352  1.886262577 -0.374396717 -1.535093463
> colMin(tmp)
  [1]  0.039910445  1.641970949 -1.077199779  0.356511674 -2.999347844
  [6]  0.223726355  0.228069779  1.055845402  0.761424393 -0.176996640
 [11] -0.258787354 -2.726770776 -0.057583732 -0.033786140 -1.062106361
 [16] -0.303216831 -0.947335573  0.993898872  0.014613443 -0.029750400
 [21] -0.567621518 -0.364301477  0.544281366 -2.109942814 -0.406158352
 [26] -0.838048663  1.099820749  0.016139545 -1.047160494 -0.310717718
 [31] -1.614428595  0.515358648  1.361728788  0.411082099 -0.009720984
 [36] -0.669704579  0.221247338 -1.450947969 -0.494312390 -1.637647424
 [41]  0.094680407 -0.362758372 -1.303619036  0.507357049  1.022017442
 [46]  1.430404464  0.419598968 -0.833318646  0.714108772  2.230847905
 [51]  0.825348199 -0.995178046  0.180172845  1.102969795 -1.756736374
 [56]  0.911813210 -0.048908154  0.774428630  0.777389679  1.047457659
 [61] -0.073469163 -0.039776364  0.019632731  0.064365256 -0.129167197
 [66]  0.906539278 -0.394531062 -1.089377707  1.819507857  0.267806194
 [71] -0.524300456  0.331774498 -0.989440643  2.558566580  1.950986569
 [76]  1.727011364 -0.830817186 -0.706694945 -1.437759778 -0.462005944
 [81]  0.914765289  0.780759439 -1.523456688 -0.146582503  0.192544508
 [86]  1.324196713 -0.767310814  0.748717187 -0.337363173 -0.976368788
 [91]  0.608781588 -1.136398965 -0.722309721  0.527271329  1.553171228
 [96]  0.938930871 -0.085404352  1.886262577 -0.374396717 -1.535093463
> colMedians(tmp)
  [1]  0.039910445  1.641970949 -1.077199779  0.356511674 -2.999347844
  [6]  0.223726355  0.228069779  1.055845402  0.761424393 -0.176996640
 [11] -0.258787354 -2.726770776 -0.057583732 -0.033786140 -1.062106361
 [16] -0.303216831 -0.947335573  0.993898872  0.014613443 -0.029750400
 [21] -0.567621518 -0.364301477  0.544281366 -2.109942814 -0.406158352
 [26] -0.838048663  1.099820749  0.016139545 -1.047160494 -0.310717718
 [31] -1.614428595  0.515358648  1.361728788  0.411082099 -0.009720984
 [36] -0.669704579  0.221247338 -1.450947969 -0.494312390 -1.637647424
 [41]  0.094680407 -0.362758372 -1.303619036  0.507357049  1.022017442
 [46]  1.430404464  0.419598968 -0.833318646  0.714108772  2.230847905
 [51]  0.825348199 -0.995178046  0.180172845  1.102969795 -1.756736374
 [56]  0.911813210 -0.048908154  0.774428630  0.777389679  1.047457659
 [61] -0.073469163 -0.039776364  0.019632731  0.064365256 -0.129167197
 [66]  0.906539278 -0.394531062 -1.089377707  1.819507857  0.267806194
 [71] -0.524300456  0.331774498 -0.989440643  2.558566580  1.950986569
 [76]  1.727011364 -0.830817186 -0.706694945 -1.437759778 -0.462005944
 [81]  0.914765289  0.780759439 -1.523456688 -0.146582503  0.192544508
 [86]  1.324196713 -0.767310814  0.748717187 -0.337363173 -0.976368788
 [91]  0.608781588 -1.136398965 -0.722309721  0.527271329  1.553171228
 [96]  0.938930871 -0.085404352  1.886262577 -0.374396717 -1.535093463
> colRanges(tmp)
           [,1]     [,2]    [,3]      [,4]      [,5]      [,6]      [,7]
[1,] 0.03991044 1.641971 -1.0772 0.3565117 -2.999348 0.2237264 0.2280698
[2,] 0.03991044 1.641971 -1.0772 0.3565117 -2.999348 0.2237264 0.2280698
         [,8]      [,9]      [,10]      [,11]     [,12]       [,13]       [,14]
[1,] 1.055845 0.7614244 -0.1769966 -0.2587874 -2.726771 -0.05758373 -0.03378614
[2,] 1.055845 0.7614244 -0.1769966 -0.2587874 -2.726771 -0.05758373 -0.03378614
         [,15]      [,16]      [,17]     [,18]      [,19]      [,20]      [,21]
[1,] -1.062106 -0.3032168 -0.9473356 0.9938989 0.01461344 -0.0297504 -0.5676215
[2,] -1.062106 -0.3032168 -0.9473356 0.9938989 0.01461344 -0.0297504 -0.5676215
          [,22]     [,23]     [,24]      [,25]      [,26]    [,27]      [,28]
[1,] -0.3643015 0.5442814 -2.109943 -0.4061584 -0.8380487 1.099821 0.01613954
[2,] -0.3643015 0.5442814 -2.109943 -0.4061584 -0.8380487 1.099821 0.01613954
        [,29]      [,30]     [,31]     [,32]    [,33]     [,34]        [,35]
[1,] -1.04716 -0.3107177 -1.614429 0.5153586 1.361729 0.4110821 -0.009720984
[2,] -1.04716 -0.3107177 -1.614429 0.5153586 1.361729 0.4110821 -0.009720984
          [,36]     [,37]     [,38]      [,39]     [,40]      [,41]      [,42]
[1,] -0.6697046 0.2212473 -1.450948 -0.4943124 -1.637647 0.09468041 -0.3627584
[2,] -0.6697046 0.2212473 -1.450948 -0.4943124 -1.637647 0.09468041 -0.3627584
         [,43]    [,44]    [,45]    [,46]    [,47]      [,48]     [,49]
[1,] -1.303619 0.507357 1.022017 1.430404 0.419599 -0.8333186 0.7141088
[2,] -1.303619 0.507357 1.022017 1.430404 0.419599 -0.8333186 0.7141088
        [,50]     [,51]     [,52]     [,53]   [,54]     [,55]     [,56]
[1,] 2.230848 0.8253482 -0.995178 0.1801728 1.10297 -1.756736 0.9118132
[2,] 2.230848 0.8253482 -0.995178 0.1801728 1.10297 -1.756736 0.9118132
           [,57]     [,58]     [,59]    [,60]       [,61]       [,62]
[1,] -0.04890815 0.7744286 0.7773897 1.047458 -0.07346916 -0.03977636
[2,] -0.04890815 0.7744286 0.7773897 1.047458 -0.07346916 -0.03977636
          [,63]      [,64]      [,65]     [,66]      [,67]     [,68]    [,69]
[1,] 0.01963273 0.06436526 -0.1291672 0.9065393 -0.3945311 -1.089378 1.819508
[2,] 0.01963273 0.06436526 -0.1291672 0.9065393 -0.3945311 -1.089378 1.819508
         [,70]      [,71]     [,72]      [,73]    [,74]    [,75]    [,76]
[1,] 0.2678062 -0.5243005 0.3317745 -0.9894406 2.558567 1.950987 1.727011
[2,] 0.2678062 -0.5243005 0.3317745 -0.9894406 2.558567 1.950987 1.727011
          [,77]      [,78]    [,79]      [,80]     [,81]     [,82]     [,83]
[1,] -0.8308172 -0.7066949 -1.43776 -0.4620059 0.9147653 0.7807594 -1.523457
[2,] -0.8308172 -0.7066949 -1.43776 -0.4620059 0.9147653 0.7807594 -1.523457
          [,84]     [,85]    [,86]      [,87]     [,88]      [,89]      [,90]
[1,] -0.1465825 0.1925445 1.324197 -0.7673108 0.7487172 -0.3373632 -0.9763688
[2,] -0.1465825 0.1925445 1.324197 -0.7673108 0.7487172 -0.3373632 -0.9763688
         [,91]     [,92]      [,93]     [,94]    [,95]     [,96]       [,97]
[1,] 0.6087816 -1.136399 -0.7223097 0.5272713 1.553171 0.9389309 -0.08540435
[2,] 0.6087816 -1.136399 -0.7223097 0.5272713 1.553171 0.9389309 -0.08540435
        [,98]      [,99]    [,100]
[1,] 1.886263 -0.3743967 -1.535093
[2,] 1.886263 -0.3743967 -1.535093
> 
> 
> Max(tmp2)
[1] 2.521394
> Min(tmp2)
[1] -2.352232
> mean(tmp2)
[1] 0.09795351
> Sum(tmp2)
[1] 9.795351
> Var(tmp2)
[1] 1.244041
> 
> rowMeans(tmp2)
  [1] -0.20444672  0.43459707 -2.03718082  0.64194944  1.14939807  0.03853779
  [7]  0.05387479  0.78545105  0.29413506  0.45344681  0.28279876 -0.18553269
 [13] -1.40677666  1.52442750 -0.89584186 -0.70740566 -0.20093426  1.14858550
 [19] -0.21302393 -0.80154443  0.68821641  0.46623239  1.67775389 -0.83187158
 [25] -0.64105930  0.91939201  1.72787373  2.23717342  0.97190766  0.77256664
 [31]  1.56557907  0.75106869  1.39831465 -0.09983795  0.19571756  0.32794871
 [37]  0.97369666  1.14163839  0.27898220  0.05927078 -0.91416267  1.90399272
 [43] -1.17951904 -2.35223240  1.99499811 -0.52295645  0.92658326 -0.39177141
 [49] -0.90064088  1.42316049 -0.76654105 -1.84928185 -1.13596210 -1.44548258
 [55] -1.72275944 -1.79318718 -1.08893532  0.27603650  0.82671314 -0.29182213
 [61]  0.94160626 -0.27481426  0.19953607  0.46066031 -1.70528687  2.29661042
 [67]  0.38507414  0.87436108  1.74136354 -0.74088947 -1.23566761 -0.29681475
 [73] -0.12628971 -0.00255645  2.52139369 -0.15176592  0.75607306 -0.96766106
 [79] -0.33564840 -0.45622622  1.35758019  2.01591147 -0.45081947 -1.03218568
 [85]  1.82812245 -1.37469976 -0.24039882  0.32837099 -0.20306487 -1.23957841
 [91] -1.93720596 -0.01444010 -0.12146178  0.07770797 -0.32483925  0.56520514
 [97] -1.35763473  1.31588713  2.17459910 -1.18607130
> rowSums(tmp2)
  [1] -0.20444672  0.43459707 -2.03718082  0.64194944  1.14939807  0.03853779
  [7]  0.05387479  0.78545105  0.29413506  0.45344681  0.28279876 -0.18553269
 [13] -1.40677666  1.52442750 -0.89584186 -0.70740566 -0.20093426  1.14858550
 [19] -0.21302393 -0.80154443  0.68821641  0.46623239  1.67775389 -0.83187158
 [25] -0.64105930  0.91939201  1.72787373  2.23717342  0.97190766  0.77256664
 [31]  1.56557907  0.75106869  1.39831465 -0.09983795  0.19571756  0.32794871
 [37]  0.97369666  1.14163839  0.27898220  0.05927078 -0.91416267  1.90399272
 [43] -1.17951904 -2.35223240  1.99499811 -0.52295645  0.92658326 -0.39177141
 [49] -0.90064088  1.42316049 -0.76654105 -1.84928185 -1.13596210 -1.44548258
 [55] -1.72275944 -1.79318718 -1.08893532  0.27603650  0.82671314 -0.29182213
 [61]  0.94160626 -0.27481426  0.19953607  0.46066031 -1.70528687  2.29661042
 [67]  0.38507414  0.87436108  1.74136354 -0.74088947 -1.23566761 -0.29681475
 [73] -0.12628971 -0.00255645  2.52139369 -0.15176592  0.75607306 -0.96766106
 [79] -0.33564840 -0.45622622  1.35758019  2.01591147 -0.45081947 -1.03218568
 [85]  1.82812245 -1.37469976 -0.24039882  0.32837099 -0.20306487 -1.23957841
 [91] -1.93720596 -0.01444010 -0.12146178  0.07770797 -0.32483925  0.56520514
 [97] -1.35763473  1.31588713  2.17459910 -1.18607130
> rowVars(tmp2)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowSd(tmp2)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowMax(tmp2)
  [1] -0.20444672  0.43459707 -2.03718082  0.64194944  1.14939807  0.03853779
  [7]  0.05387479  0.78545105  0.29413506  0.45344681  0.28279876 -0.18553269
 [13] -1.40677666  1.52442750 -0.89584186 -0.70740566 -0.20093426  1.14858550
 [19] -0.21302393 -0.80154443  0.68821641  0.46623239  1.67775389 -0.83187158
 [25] -0.64105930  0.91939201  1.72787373  2.23717342  0.97190766  0.77256664
 [31]  1.56557907  0.75106869  1.39831465 -0.09983795  0.19571756  0.32794871
 [37]  0.97369666  1.14163839  0.27898220  0.05927078 -0.91416267  1.90399272
 [43] -1.17951904 -2.35223240  1.99499811 -0.52295645  0.92658326 -0.39177141
 [49] -0.90064088  1.42316049 -0.76654105 -1.84928185 -1.13596210 -1.44548258
 [55] -1.72275944 -1.79318718 -1.08893532  0.27603650  0.82671314 -0.29182213
 [61]  0.94160626 -0.27481426  0.19953607  0.46066031 -1.70528687  2.29661042
 [67]  0.38507414  0.87436108  1.74136354 -0.74088947 -1.23566761 -0.29681475
 [73] -0.12628971 -0.00255645  2.52139369 -0.15176592  0.75607306 -0.96766106
 [79] -0.33564840 -0.45622622  1.35758019  2.01591147 -0.45081947 -1.03218568
 [85]  1.82812245 -1.37469976 -0.24039882  0.32837099 -0.20306487 -1.23957841
 [91] -1.93720596 -0.01444010 -0.12146178  0.07770797 -0.32483925  0.56520514
 [97] -1.35763473  1.31588713  2.17459910 -1.18607130
> rowMin(tmp2)
  [1] -0.20444672  0.43459707 -2.03718082  0.64194944  1.14939807  0.03853779
  [7]  0.05387479  0.78545105  0.29413506  0.45344681  0.28279876 -0.18553269
 [13] -1.40677666  1.52442750 -0.89584186 -0.70740566 -0.20093426  1.14858550
 [19] -0.21302393 -0.80154443  0.68821641  0.46623239  1.67775389 -0.83187158
 [25] -0.64105930  0.91939201  1.72787373  2.23717342  0.97190766  0.77256664
 [31]  1.56557907  0.75106869  1.39831465 -0.09983795  0.19571756  0.32794871
 [37]  0.97369666  1.14163839  0.27898220  0.05927078 -0.91416267  1.90399272
 [43] -1.17951904 -2.35223240  1.99499811 -0.52295645  0.92658326 -0.39177141
 [49] -0.90064088  1.42316049 -0.76654105 -1.84928185 -1.13596210 -1.44548258
 [55] -1.72275944 -1.79318718 -1.08893532  0.27603650  0.82671314 -0.29182213
 [61]  0.94160626 -0.27481426  0.19953607  0.46066031 -1.70528687  2.29661042
 [67]  0.38507414  0.87436108  1.74136354 -0.74088947 -1.23566761 -0.29681475
 [73] -0.12628971 -0.00255645  2.52139369 -0.15176592  0.75607306 -0.96766106
 [79] -0.33564840 -0.45622622  1.35758019  2.01591147 -0.45081947 -1.03218568
 [85]  1.82812245 -1.37469976 -0.24039882  0.32837099 -0.20306487 -1.23957841
 [91] -1.93720596 -0.01444010 -0.12146178  0.07770797 -0.32483925  0.56520514
 [97] -1.35763473  1.31588713  2.17459910 -1.18607130
> 
> colMeans(tmp2)
[1] 0.09795351
> colSums(tmp2)
[1] 9.795351
> colVars(tmp2)
[1] 1.244041
> colSd(tmp2)
[1] 1.115366
> colMax(tmp2)
[1] 2.521394
> colMin(tmp2)
[1] -2.352232
> colMedians(tmp2)
[1] 0.04620629
> colRanges(tmp2)
          [,1]
[1,] -2.352232
[2,]  2.521394
> 
> 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] -3.3063896  2.4056414 -5.6154466 -1.3880640  2.5712517 -1.0993812
 [7] -0.8104981  4.0394602  2.5680362  2.0803277
> colApply(tmp,quantile)[,1]
             [,1]
[1,] -1.300697363
[2,] -1.030009078
[3,] -0.457433193
[4,]  0.008302311
[5,]  1.321703417
> 
> rowApply(tmp,sum)
 [1] -3.2804096 -0.1444451  3.4965147 -1.9144870 -4.0755825  1.3876825
 [7]  0.9964198 -2.5875578  3.6532227  3.9135799
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    8    2    2    4    5    6    1   10    1     1
 [2,]    5    7    5    2   10    8    4    4    3     9
 [3,]    2    1    3    9    2    4    2    2    7     6
 [4,]    7    4   10   10    4    2    3    1    5     3
 [5,]    6    9    9    7    1   10    6    7    8     2
 [6,]    3   10    7    5    3    5    8    3    2     4
 [7,]    1    5    8    6    8    3   10    5    6     8
 [8,]   10    6    1    3    6    9    7    9   10     5
 [9,]    4    8    4    8    7    1    9    8    4    10
[10,]    9    3    6    1    9    7    5    6    9     7
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1] -0.82564596 -1.11947211 -0.89963347  1.95732389 -0.76481587 -3.36308318
 [7]  1.62557750 -0.69852028 -0.85652243 -0.27830130  1.22346832 -0.58050234
[13] -0.73588157 -1.18047071 -1.12588635 -3.80532830  0.46973150  1.57820163
[19]  0.78023980 -0.02292189
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -1.0420274
[2,] -0.4979955
[3,] -0.2534847
[4,]  0.1859207
[5,]  0.7819410
> 
> rowApply(tmp,sum)
[1] -0.2135229 -7.7127453  1.8965438  1.5139367 -4.1066556
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]    7    5   17   11   14
[2,]    3    9   14    6   17
[3,]   15   16    6    7    3
[4,]   13   19    4   16   19
[5,]    8    6   15   10   16
> 
> 
> as.matrix(tmp)
           [,1]       [,2]       [,3]         [,4]       [,5]       [,6]
[1,] -0.4979955 -0.7922435  0.2260242  0.003689371 -0.3359822  0.1266899
[2,] -1.0420274 -0.5918210  0.6030522  1.035819832 -0.9634109 -1.1547782
[3,]  0.7819410  0.3796649 -0.1698497 -0.851791721  0.4645692 -1.0631973
[4,] -0.2534847 -0.5843234 -0.4466533  0.844047675 -0.2755636 -0.6033691
[5,]  0.1859207  0.4692509 -1.1122069  0.925558731  0.3455715 -0.6684286
           [,7]       [,8]       [,9]       [,10]       [,11]      [,12]
[1,]  0.8699827 -1.9047864  0.8007652 -0.07707281 -0.62969060  1.8827766
[2,] -0.4236565 -0.5100718 -2.2552924  0.60586517 -0.02226246 -1.5891698
[3,]  0.1782773  0.3637915  1.0924006 -0.34789646  1.55115634  0.3212295
[4,]  1.4033161  1.8508443  0.2169158 -0.28482396  0.70926467 -1.2364052
[5,] -0.4023421 -0.4982980 -0.7113116 -0.17437324 -0.38499962  0.0410666
          [,13]      [,14]       [,15]       [,16]     [,17]      [,18]
[1,] -0.2510466  1.3317527 -0.08341961 -0.58416686  1.604080 -0.7918901
[2,] -0.8500018 -0.9366253  0.65105483 -1.28191300  1.047364 -0.5672940
[3,] -0.9424179  0.0432692  0.91716708 -0.07131041 -1.470112  0.1231690
[4,]  1.6263067 -1.1693189 -0.99543775 -0.37803335 -0.966865  1.6436799
[5,] -0.3187220 -0.4495485 -1.61525090 -1.48990469  0.255265  1.1705368
          [,19]        [,20]
[1,] -0.3101724 -0.800817271
[2,]  0.4639316  0.068491968
[3,]  0.5082213  0.088262672
[4,]  0.4086266  0.005213279
[5,] -0.2903673  0.615927466
> 
> 
> 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 :  647  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 :  561  bytes.
Disk usage :  160  bytes.
> subBufferedMatrix(tmp,1:3,)
BufferedMatrix object
Matrix size:  3 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.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.6036594 -1.376268 -2.193193 0.5881531 0.03944998 -0.6236264 1.451595
          col8     col9     col10    col11      col12      col13     col14
row1 -0.137259 0.267864 -0.250041 1.455299 -0.5210189 -0.1616293 0.3630463
         col15     col16      col17    col18     col19      col20
row1 -1.216652 0.1439596 -0.3000133 1.381491 -1.653883 -0.1520449
> tmp[,"col10"]
          col10
row1 -0.2500410
row2  1.3209262
row3  1.1274825
row4 -2.1439111
row5 -0.6074333
> tmp[c("row1","row5"),]
           col1      col2      col3       col4        col5       col6      col7
row1  0.6036594 -1.376268 -2.193193  0.5881531  0.03944998 -0.6236264 1.4515948
row5 -0.3183696 -1.002643  1.144772 -0.3445024 -1.70183241 -0.4641786 0.7340548
          col8      col9      col10     col11      col12      col13       col14
row1 -0.137259  0.267864 -0.2500410 1.4552991 -0.5210189 -0.1616293  0.36304628
row5  1.422120 -1.464666 -0.6074333 0.5165253  0.3194407 -0.1650361 -0.05083534
           col15     col16      col17      col18     col19      col20
row1 -1.21665200 0.1439596 -0.3000133  1.3814909 -1.653883 -0.1520449
row5  0.04160984 0.7258851 -0.9788571 -0.5292029 -0.800253  0.1940746
> tmp[,c("col6","col20")]
            col6      col20
row1 -0.62362643 -0.1520449
row2 -0.12705518 -0.2661587
row3 -1.12687951  0.4546905
row4 -0.09776231  0.8974844
row5 -0.46417860  0.1940746
> tmp[c("row1","row5"),c("col6","col20")]
           col6      col20
row1 -0.6236264 -0.1520449
row5 -0.4641786  0.1940746
> 
> 
> 
> 
> tmp["row1",] <- rnorm(20,mean=10)
> tmp[,"col10"] <- rnorm(5,mean=30)
> tmp[c("row1","row5"),] <- rnorm(40,mean=50)
> tmp[,c("col6","col20")] <- rnorm(10,mean=75)
> tmp[c("row1","row5"),c("col6","col20")]  <- rnorm(4,mean=105)
> 
> tmp["row1",]
         col1     col2    col3     col4     col5     col6     col7     col8
row1 48.05153 51.15313 49.3433 48.68047 50.89336 107.6636 49.87991 50.64804
         col9    col10    col11    col12    col13    col14    col15   col16
row1 50.83111 49.06183 49.56205 49.86213 49.26066 49.01038 48.87791 47.9858
        col17    col18   col19    col20
row1 49.72023 49.17938 51.1791 105.5462
> tmp[,"col10"]
        col10
row1 49.06183
row2 29.19321
row3 30.06804
row4 30.10775
row5 48.31513
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 48.05153 51.15313 49.34330 48.68047 50.89336 107.6636 49.87991 50.64804
row5 48.80719 49.54249 50.46627 49.60960 50.97823 105.9444 51.76388 50.05736
         col9    col10    col11    col12    col13    col14    col15   col16
row1 50.83111 49.06183 49.56205 49.86213 49.26066 49.01038 48.87791 47.9858
row5 48.84847 48.31513 49.64784 50.72273 49.86827 53.09906 50.31634 48.8340
        col17    col18   col19    col20
row1 49.72023 49.17938 51.1791 105.5462
row5 49.45714 50.10217 50.2991 105.3147
> tmp[,c("col6","col20")]
          col6     col20
row1 107.66359 105.54617
row2  76.86717  75.26267
row3  75.34438  73.75968
row4  75.41544  72.45619
row5 105.94441 105.31468
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 107.6636 105.5462
row5 105.9444 105.3147
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 107.6636 105.5462
row5 105.9444 105.3147
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
          col13
[1,] -1.2481226
[2,]  1.4442241
[3,] -0.8945745
[4,] -0.4323777
[5,] -1.3816686
> tmp[,c("col17","col7")]
          col17       col7
[1,] -1.3182090  1.8158705
[2,]  0.6949879 -0.1192570
[3,]  0.3758198  1.4344926
[4,]  0.5562525 -0.9550672
[5,] -0.6906027  0.2924535
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
           col6      col20
[1,]  0.2244440  1.5837388
[2,]  0.8887755 -1.3985307
[3,] -1.7332395 -1.3241482
[4,] -1.4975955  1.0408866
[5,]  0.6097940  0.5103932
> subBufferedMatrix(tmp,1,c("col6"))[,1]
         col1
[1,] 0.224444
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
          col6
[1,] 0.2244440
[2,] 0.8887755
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> 
> 
> 
> subBufferedMatrix(tmp,c("row3","row1"),)[,1:20]
           [,1]       [,2]       [,3]      [,4]       [,5]       [,6]
row3  0.2665782  0.7256644 -0.3713573 -1.170691 -0.8789944 -0.1810273
row1 -0.9985771 -1.5097807 -0.4589095 -0.195061 -1.1645860  1.1210758
           [,7]       [,8]      [,9]      [,10]      [,11]      [,12]
row3 -0.7623367  2.1465818 0.7711573 -0.8879862  0.5344651 -1.1061358
row1 -0.2894521 -0.2875489 1.3441459 -0.5095852 -0.1986639  0.4069773
          [,13]        [,14]      [,15]     [,16]      [,17]      [,18]
row3 -0.4523323 -0.006746692  0.3755927 1.1947895 -0.9132694 -0.4410023
row1 -0.1932041  0.827214599 -0.1444486 0.9631268 -0.1381405  0.5215314
          [,19]      [,20]
row3  0.6183302 -0.5661709
row1 -0.4296681 -1.1293863
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
          [,1]      [,2]       [,3]     [,4]      [,5]      [,6]     [,7]
row2 -0.114873 -1.084747 0.08013785 3.239997 -1.044082 -1.635339 1.375799
          [,8]       [,9]      [,10]
row2 -0.510504 -0.1143795 -0.1842001
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
          [,1]     [,2]      [,3]      [,4]      [,5]      [,6]      [,7]
row5 0.9106096 3.211827 -1.028488 -1.049791 0.1955543 -0.826587 -0.147245
         [,8]       [,9]     [,10]    [,11]       [,12]      [,13]    [,14]
row5 1.111277 -0.7131123 0.2648222 1.117293 -0.02197756 -0.5246328 2.095932
          [,15]      [,16]      [,17]    [,18]      [,19]    [,20]
row5 -0.2802812 -0.2079343 -0.6350064 1.164239 -0.3917756 1.062389
> 
> 
> 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: 0x55c4f663a110>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM5ff822ff49a5d"
 [2] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM5ff82232439fa"
 [3] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM5ff8245c8b921"
 [4] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM5ff8254b94b"  
 [5] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM5ff825212891d"
 [6] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM5ff82d7d53f6" 
 [7] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM5ff827935bf75"
 [8] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM5ff821bc398c7"
 [9] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM5ff8275d38c8f"
[10] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM5ff82351c3c7d"
[11] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM5ff8264e27a77"
[12] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM5ff824558d1be"
[13] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM5ff823eeaca2d"
[14] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM5ff826967823e"
[15] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM5ff8226fa903b"
> 
> 
> ### 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: 0x55c4f6069050>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x55c4f6069050>
Warning message:
In dir.create(new.directory) :
  '/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x55c4f6069050>
> rowMedians(tmp)
  [1]  0.4600094454 -0.0026094142  0.2584444277  0.0135197859  0.1171828607
  [6]  0.4354213576 -0.4983956051  0.1495076568 -0.3017726892 -0.5291708993
 [11] -0.2437748674  0.4787232183  0.1315988023  0.4809581153 -0.3779926646
 [16] -0.4078340765 -0.0718170795 -0.1904814639  0.4280459891  0.3157167853
 [21]  0.0412104684 -0.0602471323 -0.9297847258 -0.1047599735  0.1488761932
 [26]  0.0194294387 -0.2373425969  0.5020217329 -0.2670545275  0.6837695303
 [31]  0.0845244471  0.0377624232  0.1594159207 -0.0535534419 -0.4441874242
 [36] -0.0631106099 -0.1137155472 -0.0706187207 -0.6962235463 -0.0441816027
 [41]  0.1164395333  0.0491523440  0.4537795080 -0.1972381326 -0.0372131264
 [46] -0.1842793052 -0.2687895686 -0.3992201548 -0.1405110647 -0.0813937173
 [51]  0.4035869162  0.1978363603 -0.0363679862 -0.7976030388 -0.1661702347
 [56] -0.0844299378  0.1921632931 -0.2878180180  0.3972258877 -0.1342568713
 [61] -0.2894475251  0.4809974317  1.0091871030 -0.4410964758 -0.2522105318
 [66]  0.1563907346 -0.0455045772  0.1800660910  0.2556304273 -0.2157719319
 [71]  0.1436473818  0.2075258828 -0.3403414481  0.1305962760 -0.0346604529
 [76]  0.2365445024 -0.1197082748  0.4445071429  0.2879605132 -0.1449041061
 [81]  0.2734430618  0.0933472839 -0.5662661783 -0.0144635333  0.0784485302
 [86] -0.0953444966  0.0293552469  0.1440735678 -0.0031075944 -0.0009980077
 [91] -0.5367279570 -0.2319557539  0.1797054456 -0.0264372127  0.0047221141
 [96] -0.1341129846  0.1530881208 -0.4775236657 -0.0923687379  0.2000853939
[101] -0.7383814451 -0.3569371266  0.0602359835  0.0686053026  0.0395746520
[106] -0.4291712584 -0.2246847201 -0.1844369115 -0.4926057450 -0.2203806377
[111] -0.7655837333  0.2724552509 -0.2145108603 -0.1005053414  0.2181951979
[116] -0.5770505398 -0.2063776998  0.0848025862 -0.2031545758 -0.3896822745
[121] -0.2422052497  0.3443260428  0.1920372056 -0.0776690085  0.2215442263
[126] -0.1832468888 -0.0589318910 -0.3378606779 -0.0664940014 -0.3098569155
[131] -0.1058810819 -0.0560766508  0.2119381237  0.1729828006 -0.3980871562
[136]  0.5740084843  0.1750167052  0.0929227144 -0.1311886875 -0.2607104618
[141]  0.7855168423 -0.0246299868  0.0385195489 -0.1425433803 -0.5825975206
[146] -0.4321114506 -0.1443429787 -0.3294913713 -0.7488359754  0.4759643820
[151]  0.3146417479  0.0901283877 -0.1668267851 -0.3650061134  0.1340917287
[156]  0.1961888176  0.1259909831 -0.0797073360 -0.5333150433 -0.2735128898
[161] -0.4834513507  0.3257069883 -0.6595568638  0.0758668046 -0.0075778480
[166]  0.0192543868  0.2069724539  0.3851763214  0.0713241276  0.2576170197
[171]  0.4340860337  0.2737752308 -0.0365023813 -0.0598300631  0.6760935520
[176]  0.1003783200 -0.2724205212 -0.2322429318 -0.1786776076  0.0821978194
[181] -0.2664517631 -0.3536505459 -0.3234316975 -0.4080445403 -0.0636354640
[186] -0.5763905246  0.2489419002  0.4485185907  0.0256329021  0.2800612245
[191]  0.2876484845  0.0188047536  0.0845651086 -0.2116155443 -0.3804037586
[196]  0.2167920948 -0.4172237506 -0.0100350695 -0.1321788067 -0.1360033159
[201] -0.3097191361  0.1422669591 -0.1210531401  0.2435810167 -0.1535712578
[206] -0.0739402462 -0.4741352031 -0.2322286091  0.2053692762  0.5214754294
[211] -0.0691700497 -0.2336875633 -0.4583603581 -0.1345033099 -0.1705652841
[216] -0.4263221415  0.1185498870  0.0787319792  0.2494043015  0.3033263001
[221] -0.4905464360  0.0363780377  0.2824233921 -0.2839798206  0.3940984672
[226]  0.1456802267 -0.1029998284 -0.2715438382  0.0952779551 -0.5394412659
> 
> proc.time()
   user  system elapsed 
  1.314   1.476   2.777 

BufferedMatrix.Rcheck/tests/rawCalltesting.Rout


R version 4.6.0 alpha (2026-04-05 r89794)
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: 0x6177caad9ff0>
> .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: 0x6177caad9ff0>
> .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: 0x6177caad9ff0>
> .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: 0x6177caad9ff0>
> 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: 0x6177ca6f8a60>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6177ca6f8a60>
> .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: 0x6177ca6f8a60>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6177ca6f8a60>
> .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: 0x6177ca6f8a60>
> 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: 0x6177ca45e240>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6177ca45e240>
> .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: 0x6177ca45e240>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x6177ca45e240>
> .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: 0x6177ca45e240>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x6177ca45e240>
> .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: 0x6177ca45e240>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x6177ca45e240>
> .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: 0x6177ca45e240>
> 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: 0x6177cb49f160>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x6177cb49f160>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6177cb49f160>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6177cb49f160>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile601f81a50026e" "BufferedMatrixFile601f83d5b549f"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile601f81a50026e" "BufferedMatrixFile601f83d5b549f"
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x6177cb710d20>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6177cb710d20>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x6177cb710d20>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x6177cb710d20>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x6177cb710d20>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x6177cb710d20>
> .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: 0x6177cacdff50>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6177cacdff50>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x6177cacdff50>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x6177cacdff50>
> 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: 0x6177cc84fbe0>
> .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: 0x6177cc84fbe0>
> rm(P)
> 
> proc.time()
   user  system elapsed 
  0.256   0.051   0.294 

BufferedMatrix.Rcheck/tests/Rcodetesting.Rout


R version 4.6.0 alpha (2026-04-05 r89794)
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.233   0.050   0.272 

Example timings