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

This page was generated on 2026-02-24 11:57 -0500 (Tue, 24 Feb 2026).

HostnameOSArch (*)R versionInstalled pkgs
nebbiolo2Linux (Ubuntu 24.04.3 LTS)x86_644.5.2 (2025-10-31) -- "[Not] Part in a Rumble" 4891
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 257/2361HostnameOS / ArchINSTALLBUILDCHECKBUILD BIN
BufferedMatrix 1.74.0  (landing page)
Ben Bolstad
Snapshot Date: 2026-02-23 13:45 -0500 (Mon, 23 Feb 2026)
git_url: https://git.bioconductor.org/packages/BufferedMatrix
git_branch: RELEASE_3_22
git_last_commit: d2ce144
git_last_commit_date: 2025-10-29 09:58:55 -0500 (Wed, 29 Oct 2025)
nebbiolo2Linux (Ubuntu 24.04.3 LTS) / x86_64  OK    OK    OK  UNNEEDED, same version is already published
See other builds for BufferedMatrix in R Universe.


CHECK results for BufferedMatrix on nebbiolo2

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

raw results


Summary

Package: BufferedMatrix
Version: 1.74.0
Command: /home/biocbuild/bbs-3.22-bioc/R/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/home/biocbuild/bbs-3.22-bioc/R/site-library --timings BufferedMatrix_1.74.0.tar.gz
StartedAt: 2026-02-23 21:38:15 -0500 (Mon, 23 Feb 2026)
EndedAt: 2026-02-23 21:38:39 -0500 (Mon, 23 Feb 2026)
EllapsedTime: 24.0 seconds
RetCode: 0
Status:   OK  
CheckDir: BufferedMatrix.Rcheck
Warnings: 0

Command output

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


* using log directory ‘/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck’
* using R version 4.5.2 (2025-10-31)
* using platform: x86_64-pc-linux-gnu
* R was compiled by
    gcc (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0
    GNU Fortran (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0
* running under: Ubuntu 24.04.3 LTS
* using session charset: UTF-8
* checking for file ‘BufferedMatrix/DESCRIPTION’ ... OK
* this is package ‘BufferedMatrix’ version ‘1.74.0’
* checking package namespace information ... OK
* checking package dependencies ... OK
* checking if this is a source package ... OK
* checking if there is a namespace ... OK
* checking for hidden files and directories ... OK
* checking for portable file names ... OK
* checking for sufficient/correct file permissions ... OK
* checking whether package ‘BufferedMatrix’ can be installed ... OK
* used C compiler: ‘gcc (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0’
* checking installed package size ... OK
* checking package directory ... OK
* checking ‘build’ directory ... OK
* checking DESCRIPTION meta-information ... OK
* checking top-level files ... OK
* checking for left-over files ... OK
* checking index information ... OK
* checking package subdirectories ... OK
* checking code files for non-ASCII characters ... OK
* checking R files for syntax errors ... OK
* checking whether the package can be loaded ... OK
* checking whether the package can be loaded with stated dependencies ... OK
* checking whether the package can be unloaded cleanly ... OK
* checking whether the namespace can be loaded with stated dependencies ... OK
* checking whether the namespace can be unloaded cleanly ... OK
* checking loading without being on the library search path ... OK
* checking dependencies in R code ... OK
* checking S3 generic/method consistency ... OK
* checking replacement functions ... OK
* checking foreign function calls ... OK
* checking R code for possible problems ... OK
* checking Rd files ... NOTE
checkRd: (-1) BufferedMatrix-class.Rd:209: Lost braces; missing escapes or markup?
   209 |     $x^{power}$ elementwise of the matrix
       |        ^
prepare_Rd: createBufferedMatrix.Rd:26: Dropping empty section \keyword
prepare_Rd: createBufferedMatrix.Rd:17-18: Dropping empty section \details
prepare_Rd: createBufferedMatrix.Rd:15-16: Dropping empty section \value
prepare_Rd: createBufferedMatrix.Rd:19-20: Dropping empty section \references
prepare_Rd: createBufferedMatrix.Rd:21-22: Dropping empty section \seealso
prepare_Rd: createBufferedMatrix.Rd:23-24: Dropping empty section \examples
* checking Rd metadata ... OK
* checking Rd cross-references ... OK
* checking for missing documentation entries ... OK
* checking for code/documentation mismatches ... OK
* checking Rd \usage sections ... OK
* checking Rd contents ... OK
* checking for unstated dependencies in examples ... OK
* checking line endings in C/C++/Fortran sources/headers ... OK
* checking compiled code ... NOTE
Note: information on .o files is not available
* checking files in ‘vignettes’ ... OK
* checking examples ... NONE
* checking for unstated dependencies in ‘tests’ ... OK
* checking tests ...
  Running ‘Rcodetesting.R’
  Running ‘c_code_level_tests.R’
  Running ‘objectTesting.R’
  Running ‘rawCalltesting.R’
 OK
* checking for unstated dependencies in vignettes ... OK
* checking package vignettes ... OK
* checking re-building of vignette outputs ... OK
* checking PDF version of manual ... OK
* DONE

Status: 2 NOTEs
See
  ‘/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/00check.log’
for details.


Installation output

BufferedMatrix.Rcheck/00install.out

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


* installing to library ‘/home/biocbuild/bbs-3.22-bioc/R/site-library’
* installing *source* package ‘BufferedMatrix’ ...
** this is package ‘BufferedMatrix’ version ‘1.74.0’
** using staged installation
** libs
using C compiler: ‘gcc (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0’
gcc -std=gnu2x -I"/home/biocbuild/bbs-3.22-bioc/R/include" -DNDEBUG   -I/usr/local/include    -fpic  -g -O2  -Wall -Werror=format-security -c RBufferedMatrix.c -o RBufferedMatrix.o
gcc -std=gnu2x -I"/home/biocbuild/bbs-3.22-bioc/R/include" -DNDEBUG   -I/usr/local/include    -fpic  -g -O2  -Wall -Werror=format-security -c doubleBufferedMatrix.c -o doubleBufferedMatrix.o
doubleBufferedMatrix.c: In function ‘dbm_ReadOnlyMode’:
doubleBufferedMatrix.c:1580:7: warning: suggest parentheses around operand of ‘!’ or change ‘&’ to ‘&&’ or ‘!’ to ‘~’ [-Wparentheses]
 1580 |   if (!(Matrix->readonly) & setting){
      |       ^~~~~~~~~~~~~~~~~~~
doubleBufferedMatrix.c: At top level:
doubleBufferedMatrix.c:3327:12: warning: ‘sort_double’ defined but not used [-Wunused-function]
 3327 | static int sort_double(const double *a1,const double *a2){
      |            ^~~~~~~~~~~
gcc -std=gnu2x -I"/home/biocbuild/bbs-3.22-bioc/R/include" -DNDEBUG   -I/usr/local/include    -fpic  -g -O2  -Wall -Werror=format-security -c doubleBufferedMatrix_C_tests.c -o doubleBufferedMatrix_C_tests.o
gcc -std=gnu2x -I"/home/biocbuild/bbs-3.22-bioc/R/include" -DNDEBUG   -I/usr/local/include    -fpic  -g -O2  -Wall -Werror=format-security -c init_package.c -o init_package.o
gcc -std=gnu2x -shared -L/home/biocbuild/bbs-3.22-bioc/R/lib -L/usr/local/lib -o BufferedMatrix.so RBufferedMatrix.o doubleBufferedMatrix.o doubleBufferedMatrix_C_tests.o init_package.o -L/home/biocbuild/bbs-3.22-bioc/R/lib -lR
installing to /home/biocbuild/bbs-3.22-bioc/R/site-library/00LOCK-BufferedMatrix/00new/BufferedMatrix/libs
** R
** inst
** byte-compile and prepare package for lazy loading
Creating a new generic function for ‘rowMeans’ in package ‘BufferedMatrix’
Creating a new generic function for ‘rowSums’ in package ‘BufferedMatrix’
Creating a new generic function for ‘colMeans’ in package ‘BufferedMatrix’
Creating a new generic function for ‘colSums’ in package ‘BufferedMatrix’
Creating a generic function for ‘ncol’ from package ‘base’ in package ‘BufferedMatrix’
Creating a generic function for ‘nrow’ from package ‘base’ in package ‘BufferedMatrix’
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
** checking absolute paths in shared objects and dynamic libraries
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (BufferedMatrix)

Tests output

BufferedMatrix.Rcheck/tests/c_code_level_tests.Rout


R version 4.5.2 (2025-10-31) -- "[Not] Part in a Rumble"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(BufferedMatrix);library.dynam("BufferedMatrix", "BufferedMatrix", .libPaths());.C("dbm_c_tester",integer(1))

Attaching package: 'BufferedMatrix'

The following objects are masked from 'package:base':

    colMeans, colSums, rowMeans, rowSums

Checking dimensions
Rows: 5
Cols: 5
Buffer Rows: 1
Buffer Cols: 1

Assigning Values
0.000000 1.000000 2.000000 3.000000 4.000000 
1.000000 2.000000 3.000000 4.000000 5.000000 
2.000000 3.000000 4.000000 5.000000 6.000000 
3.000000 4.000000 5.000000 6.000000 7.000000 
4.000000 5.000000 6.000000 7.000000 8.000000 

Adding Additional Column
Checking dimensions
Rows: 5
Cols: 6
Buffer Rows: 1
Buffer Cols: 1
0.000000 1.000000 2.000000 3.000000 4.000000 0.000000 
1.000000 2.000000 3.000000 4.000000 5.000000 0.000000 
2.000000 3.000000 4.000000 5.000000 6.000000 0.000000 
3.000000 4.000000 5.000000 6.000000 7.000000 0.000000 
4.000000 5.000000 6.000000 7.000000 8.000000 0.000000 

Reassigning values
1.000000 6.000000 11.000000 16.000000 21.000000 26.000000 
2.000000 7.000000 12.000000 17.000000 22.000000 27.000000 
3.000000 8.000000 13.000000 18.000000 23.000000 28.000000 
4.000000 9.000000 14.000000 19.000000 24.000000 29.000000 
5.000000 10.000000 15.000000 20.000000 25.000000 30.000000 

Resizing Buffers
Checking dimensions
Rows: 5
Cols: 6
Buffer Rows: 3
Buffer Cols: 3
1.000000 6.000000 11.000000 16.000000 21.000000 26.000000 
2.000000 7.000000 12.000000 17.000000 22.000000 27.000000 
3.000000 8.000000 13.000000 18.000000 23.000000 28.000000 
4.000000 9.000000 14.000000 19.000000 24.000000 29.000000 
5.000000 10.000000 15.000000 20.000000 25.000000 30.000000 

Activating Row Buffer
In row mode: 1
1.000000 6.000000 11.000000 16.000000 21.000000 26.000000 
2.000000 7.000000 12.000000 17.000000 22.000000 27.000000 
3.000000 8.000000 13.000000 18.000000 23.000000 28.000000 
4.000000 9.000000 14.000000 19.000000 24.000000 29.000000 
5.000000 10.000000 15.000000 20.000000 25.000000 30.000000 

Squaring Last Column
1.000000 6.000000 11.000000 16.000000 21.000000 676.000000 
2.000000 7.000000 12.000000 17.000000 22.000000 729.000000 
3.000000 8.000000 13.000000 18.000000 23.000000 784.000000 
4.000000 9.000000 14.000000 19.000000 24.000000 841.000000 
5.000000 10.000000 15.000000 20.000000 25.000000 900.000000 

Square rooting Last Row, then turing off Row Buffer
In row mode: 0
Checking on value that should be not be in column buffer2.236068 
1.000000 6.000000 11.000000 16.000000 21.000000 676.000000 
2.000000 7.000000 12.000000 17.000000 22.000000 729.000000 
3.000000 8.000000 13.000000 18.000000 23.000000 784.000000 
4.000000 9.000000 14.000000 19.000000 24.000000 841.000000 
2.236068 3.162278 3.872983 4.472136 5.000000 30.000000 

Single Indexing. Assign each value its square
1.000000 36.000000 121.000000 256.000000 441.000000 676.000000 
4.000000 49.000000 144.000000 289.000000 484.000000 729.000000 
9.000000 64.000000 169.000000 324.000000 529.000000 784.000000 
16.000000 81.000000 196.000000 361.000000 576.000000 841.000000 
25.000000 100.000000 225.000000 400.000000 625.000000 900.000000 

Resizing Buffers Smaller
Checking dimensions
Rows: 5
Cols: 6
Buffer Rows: 1
Buffer Cols: 1
1.000000 36.000000 121.000000 256.000000 441.000000 676.000000 
4.000000 49.000000 144.000000 289.000000 484.000000 729.000000 
9.000000 64.000000 169.000000 324.000000 529.000000 784.000000 
16.000000 81.000000 196.000000 361.000000 576.000000 841.000000 
25.000000 100.000000 225.000000 400.000000 625.000000 900.000000 

Activating Row Mode.
Resizing Buffers
Checking dimensions
Rows: 5
Cols: 6
Buffer Rows: 1
Buffer Cols: 1
Activating ReadOnly Mode.
The results of assignment is: 0
Printing matrix reversed.
900.000000 625.000000 400.000000 225.000000 100.000000 25.000000 
841.000000 576.000000 361.000000 196.000000 81.000000 16.000000 
784.000000 529.000000 324.000000 169.000000 64.000000 9.000000 
729.000000 484.000000 289.000000 144.000000 49.000000 -30.000000 
676.000000 441.000000 256.000000 121.000000 -20.000000 -10.000000 

[[1]]
[1] 0

> 
> proc.time()
   user  system elapsed 
  0.238   0.045   0.272 

BufferedMatrix.Rcheck/tests/objectTesting.Rout


R version 4.5.2 (2025-10-31) -- "[Not] Part in a Rumble"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(BufferedMatrix);library.dynam("BufferedMatrix","BufferedMatrix", .libPaths());

Attaching package: 'BufferedMatrix'

The following objects are masked from 'package:base':

    colMeans, colSums, rowMeans, rowSums

> 
> 
> ### this is used to control how many repetitions in something below
> ### higher values result in more checks.
> nreps <-100 ##20000
> 
> 
> ## test creation and some simple assignments and subsetting operations
> 
> ## first on single elements
> tmp <- createBufferedMatrix(1000,10)
> 
> tmp[10,5]
[1] 0
> tmp[10,5] <- 10
> tmp[10,5]
[1] 10
> tmp[10,5] <- 12.445
> tmp[10,5]
[1] 12.445
> 
> 
> 
> ## now testing accessing multiple elements
> tmp2 <- createBufferedMatrix(10,20)
> 
> 
> tmp2[3,1] <- 51.34
> tmp2[9,2] <- 9.87654
> tmp2[,1:2]
       [,1]    [,2]
 [1,]  0.00 0.00000
 [2,]  0.00 0.00000
 [3,] 51.34 0.00000
 [4,]  0.00 0.00000
 [5,]  0.00 0.00000
 [6,]  0.00 0.00000
 [7,]  0.00 0.00000
 [8,]  0.00 0.00000
 [9,]  0.00 9.87654
[10,]  0.00 0.00000
> tmp2[,-(3:20)]
       [,1]    [,2]
 [1,]  0.00 0.00000
 [2,]  0.00 0.00000
 [3,] 51.34 0.00000
 [4,]  0.00 0.00000
 [5,]  0.00 0.00000
 [6,]  0.00 0.00000
 [7,]  0.00 0.00000
 [8,]  0.00 0.00000
 [9,]  0.00 9.87654
[10,]  0.00 0.00000
> tmp2[3,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
[1,] 51.34    0    0    0    0    0    0    0    0     0     0     0     0
     [,14] [,15] [,16] [,17] [,18] [,19] [,20]
[1,]     0     0     0     0     0     0     0
> tmp2[-3,]
      [,1]    [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [2,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [3,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [4,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [5,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [6,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [7,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [8,]    0 9.87654    0    0    0    0    0    0    0     0     0     0     0
 [9,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
      [,14] [,15] [,16] [,17] [,18] [,19] [,20]
 [1,]     0     0     0     0     0     0     0
 [2,]     0     0     0     0     0     0     0
 [3,]     0     0     0     0     0     0     0
 [4,]     0     0     0     0     0     0     0
 [5,]     0     0     0     0     0     0     0
 [6,]     0     0     0     0     0     0     0
 [7,]     0     0     0     0     0     0     0
 [8,]     0     0     0     0     0     0     0
 [9,]     0     0     0     0     0     0     0
> tmp2[2,1:3]
     [,1] [,2] [,3]
[1,]    0    0    0
> tmp2[3:9,1:3]
      [,1]    [,2] [,3]
[1,] 51.34 0.00000    0
[2,]  0.00 0.00000    0
[3,]  0.00 0.00000    0
[4,]  0.00 0.00000    0
[5,]  0.00 0.00000    0
[6,]  0.00 0.00000    0
[7,]  0.00 9.87654    0
> tmp2[-4,-4]
       [,1]    [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [2,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [3,] 51.34 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [4,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [5,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [6,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [7,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [8,]  0.00 9.87654    0    0    0    0    0    0    0     0     0     0     0
 [9,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
      [,14] [,15] [,16] [,17] [,18] [,19]
 [1,]     0     0     0     0     0     0
 [2,]     0     0     0     0     0     0
 [3,]     0     0     0     0     0     0
 [4,]     0     0     0     0     0     0
 [5,]     0     0     0     0     0     0
 [6,]     0     0     0     0     0     0
 [7,]     0     0     0     0     0     0
 [8,]     0     0     0     0     0     0
 [9,]     0     0     0     0     0     0
> 
> ## now testing accessing/assigning multiple elements
> tmp3 <- createBufferedMatrix(10,10)
> 
> for (i in 1:10){
+   for (j in 1:10){
+     tmp3[i,j] <- (j-1)*10 + i
+   }
+ }
> 
> tmp3[2:4,2:4]
     [,1] [,2] [,3]
[1,]   12   22   32
[2,]   13   23   33
[3,]   14   24   34
> tmp3[c(-10),c(2:4,2:4,10,1,2,1:10,10:1)]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]   11   21   31   11   21   31   91    1   11     1    11    21    31
 [2,]   12   22   32   12   22   32   92    2   12     2    12    22    32
 [3,]   13   23   33   13   23   33   93    3   13     3    13    23    33
 [4,]   14   24   34   14   24   34   94    4   14     4    14    24    34
 [5,]   15   25   35   15   25   35   95    5   15     5    15    25    35
 [6,]   16   26   36   16   26   36   96    6   16     6    16    26    36
 [7,]   17   27   37   17   27   37   97    7   17     7    17    27    37
 [8,]   18   28   38   18   28   38   98    8   18     8    18    28    38
 [9,]   19   29   39   19   29   39   99    9   19     9    19    29    39
      [,14] [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24] [,25]
 [1,]    41    51    61    71    81    91    91    81    71    61    51    41
 [2,]    42    52    62    72    82    92    92    82    72    62    52    42
 [3,]    43    53    63    73    83    93    93    83    73    63    53    43
 [4,]    44    54    64    74    84    94    94    84    74    64    54    44
 [5,]    45    55    65    75    85    95    95    85    75    65    55    45
 [6,]    46    56    66    76    86    96    96    86    76    66    56    46
 [7,]    47    57    67    77    87    97    97    87    77    67    57    47
 [8,]    48    58    68    78    88    98    98    88    78    68    58    48
 [9,]    49    59    69    79    89    99    99    89    79    69    59    49
      [,26] [,27] [,28] [,29]
 [1,]    31    21    11     1
 [2,]    32    22    12     2
 [3,]    33    23    13     3
 [4,]    34    24    14     4
 [5,]    35    25    15     5
 [6,]    36    26    16     6
 [7,]    37    27    17     7
 [8,]    38    28    18     8
 [9,]    39    29    19     9
> tmp3[-c(1:5),-c(6:10)]
     [,1] [,2] [,3] [,4] [,5]
[1,]    6   16   26   36   46
[2,]    7   17   27   37   47
[3,]    8   18   28   38   48
[4,]    9   19   29   39   49
[5,]   10   20   30   40   50
> 
> ## assignment of whole columns
> tmp3[,1] <- c(1:10*100.0)
> tmp3[,1:2] <- tmp3[,1:2]*100
> tmp3[,1:2] <- tmp3[,2:1]
> tmp3[,1:2]
      [,1]  [,2]
 [1,] 1100 1e+04
 [2,] 1200 2e+04
 [3,] 1300 3e+04
 [4,] 1400 4e+04
 [5,] 1500 5e+04
 [6,] 1600 6e+04
 [7,] 1700 7e+04
 [8,] 1800 8e+04
 [9,] 1900 9e+04
[10,] 2000 1e+05
> 
> 
> tmp3[,-1] <- tmp3[,1:9]
> tmp3[,1:10]
      [,1] [,2]  [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,] 1100 1100 1e+04   21   31   41   51   61   71    81
 [2,] 1200 1200 2e+04   22   32   42   52   62   72    82
 [3,] 1300 1300 3e+04   23   33   43   53   63   73    83
 [4,] 1400 1400 4e+04   24   34   44   54   64   74    84
 [5,] 1500 1500 5e+04   25   35   45   55   65   75    85
 [6,] 1600 1600 6e+04   26   36   46   56   66   76    86
 [7,] 1700 1700 7e+04   27   37   47   57   67   77    87
 [8,] 1800 1800 8e+04   28   38   48   58   68   78    88
 [9,] 1900 1900 9e+04   29   39   49   59   69   79    89
[10,] 2000 2000 1e+05   30   40   50   60   70   80    90
> 
> tmp3[,1:2] <- rep(1,10)
> tmp3[,1:2] <- rep(1,20)
> tmp3[,1:2] <- matrix(c(1:5),1,5)
> 
> tmp3[,-c(1:8)] <- matrix(c(1:5),1,5)
> 
> tmp3[1,] <- 1:10
> tmp3[1,]
     [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,]    1    2    3    4    5    6    7    8    9    10
> tmp3[-1,] <- c(1,2)
> tmp3[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    1    2    3    4    5    6    7    8    9    10
 [2,]    1    2    1    2    1    2    1    2    1     2
 [3,]    2    1    2    1    2    1    2    1    2     1
 [4,]    1    2    1    2    1    2    1    2    1     2
 [5,]    2    1    2    1    2    1    2    1    2     1
 [6,]    1    2    1    2    1    2    1    2    1     2
 [7,]    2    1    2    1    2    1    2    1    2     1
 [8,]    1    2    1    2    1    2    1    2    1     2
 [9,]    2    1    2    1    2    1    2    1    2     1
[10,]    1    2    1    2    1    2    1    2    1     2
> tmp3[-c(1:8),] <- matrix(c(1:5),1,5)
> tmp3[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    1    2    3    4    5    6    7    8    9    10
 [2,]    1    2    1    2    1    2    1    2    1     2
 [3,]    2    1    2    1    2    1    2    1    2     1
 [4,]    1    2    1    2    1    2    1    2    1     2
 [5,]    2    1    2    1    2    1    2    1    2     1
 [6,]    1    2    1    2    1    2    1    2    1     2
 [7,]    2    1    2    1    2    1    2    1    2     1
 [8,]    1    2    1    2    1    2    1    2    1     2
 [9,]    1    3    5    2    4    1    3    5    2     4
[10,]    2    4    1    3    5    2    4    1    3     5
> 
> 
> tmp3[1:2,1:2] <- 5555.04
> tmp3[-(1:2),1:2] <- 1234.56789
> 
> 
> 
> ## testing accessors for the directory and prefix
> directory(tmp3)
[1] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests"
> prefix(tmp3)
[1] "BM"
> 
> ## testing if we can remove these objects
> rm(tmp, tmp2, tmp3)
> gc()
         used (Mb) gc trigger (Mb) max used (Mb)
Ncells 478284 25.6    1046725   56   639600 34.2
Vcells 884773  6.8    8388608   64  2081613 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] "Mon Feb 23 21:38:30 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] "Mon Feb 23 21:38:30 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: 0x5f7b3fd821c0>
> 
> 
> 
> 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] "Mon Feb 23 21:38:30 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] "Mon Feb 23 21:38:30 2026"
> 
> ColMode(tmp2)
<pointer: 0x5f7b3fd821c0>
> 
> 
> 
> ### 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,] 97.5411231  1.4665956  0.07471315 -1.68423008
[2,]  0.1072961  2.2104728 -0.08852371 -0.06653838
[3,] -1.4435855 -0.4386609  1.33267332  1.23345197
[4,] -1.3768034  0.2221139 -0.55478999  0.05439887
> ewApply(tmp5,abs)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
           [,1]      [,2]       [,3]       [,4]
[1,] 97.5411231 1.4665956 0.07471315 1.68423008
[2,]  0.1072961 2.2104728 0.08852371 0.06653838
[3,]  1.4435855 0.4386609 1.33267332 1.23345197
[4,]  1.3768034 0.2221139 0.55478999 0.05439887
> ewApply(tmp5,sqrt)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
          [,1]      [,2]      [,3]      [,4]
[1,] 9.8762910 1.2110308 0.2733371 1.2977789
[2,] 0.3275608 1.4867659 0.2975294 0.2579503
[3,] 1.2014931 0.6623148 1.1544147 1.1106088
[4,] 1.1733726 0.4712896 0.7448423 0.2332357
> 
> my.function <- function(x,power){
+   (x+5)^power
+ }
> 
> ewApply(tmp5,my.function,power=2)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
          [,1]     [,2]     [,3]     [,4]
[1,] 221.30403 38.57690 27.80808 39.66202
[2,]  28.38290 42.07813 28.06382 27.64604
[3,]  38.45852 32.06181 37.87682 37.33954
[4,]  38.11053 29.93501 33.00321 27.38676
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x5f7b40a513b0>
> exp(tmp5)
<pointer: 0x5f7b40a513b0>
> log(tmp5,2)
<pointer: 0x5f7b40a513b0>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 460.6153
> Min(tmp5)
[1] 53.3087
> mean(tmp5)
[1] 72.41067
> Sum(tmp5)
[1] 14482.13
> Var(tmp5)
[1] 831.4593
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 91.52806 68.42840 69.16865 70.60463 72.43233 68.21924 70.17636 74.66292
 [9] 67.67129 71.21479
> rowSums(tmp5)
 [1] 1830.561 1368.568 1383.373 1412.093 1448.647 1364.385 1403.527 1493.258
 [9] 1353.426 1424.296
> rowVars(tmp5)
 [1] 7606.46791   80.71045   63.59388   56.25432  102.45953   73.46428
 [7]   58.20570   48.89303   80.13333   68.12267
> rowSd(tmp5)
 [1] 87.215067  8.983899  7.974577  7.500288 10.122230  8.571131  7.629266
 [8]  6.992355  8.951722  8.253646
> rowMax(tmp5)
 [1] 460.61535  88.34399  80.66754  82.58818  91.39283  87.77262  84.44604
 [8]  87.71506  86.44419  86.84491
> rowMin(tmp5)
 [1] 57.87888 55.91326 58.35848 56.49891 57.59895 53.30870 55.58826 64.37520
 [9] 55.35055 58.48166
> 
> colMeans(tmp5)
 [1] 111.11491  75.06557  67.45028  67.79983  65.95112  70.14225  68.75186
 [8]  72.07914  71.67166  70.78174  70.09930  68.79195  71.76468  75.12935
[15]  70.79012  68.68259  73.01615  70.49409  68.18867  70.44808
> colSums(tmp5)
 [1] 1111.1491  750.6557  674.5028  677.9983  659.5112  701.4225  687.5186
 [8]  720.7914  716.7166  707.8174  700.9930  687.9195  717.6468  751.2935
[15]  707.9012  686.8259  730.1615  704.9409  681.8867  704.4808
> colVars(tmp5)
 [1] 15121.11110    78.63320    95.86577   129.05713    27.27705    39.19060
 [7]    58.54538   106.78008    50.95290    37.33924   112.23566    98.98215
[13]    26.18524    49.65393    94.00564    57.82344    67.53110    71.46875
[19]    83.15709   108.70803
> colSd(tmp5)
 [1] 122.967927   8.867536   9.791107  11.360331   5.222743   6.260240
 [7]   7.651495  10.333445   7.138130   6.110584  10.594133   9.948978
[13]   5.117151   7.046555   9.695650   7.604172   8.217731   8.453919
[19]   9.119051  10.426314
> colMax(tmp5)
 [1] 460.61535  87.58012  84.42992  82.55130  71.49222  79.38071  84.05783
 [8]  88.34399  82.58818  79.42464  87.71506  91.39283  80.36989  87.77262
[15]  89.80154  79.83346  84.44604  81.16442  86.17683  86.84491
> colMin(tmp5)
 [1] 59.07530 62.30580 56.37216 53.30870 56.21105 62.72268 57.59895 58.94061
 [9] 62.52403 60.77255 55.91326 58.35848 65.16691 64.19483 56.50655 58.41453
[17] 58.97448 58.75954 56.49891 55.58826
> 
> 
> ### setting a random element to NA and then testing with na.rm=TRUE or na.rm=FALSE (The default)
> 
> 
> which.row <- sample(1:10,1,replace=TRUE)
> which.col  <- sample(1:20,1,replace=TRUE)
> 
> tmp5[which.row,which.col] <- NA
> 
> Max(tmp5)
[1] NA
> Min(tmp5)
[1] NA
> mean(tmp5)
[1] NA
> Sum(tmp5)
[1] NA
> Var(tmp5)
[1] NA
> 
> rowMeans(tmp5)
 [1] 91.52806 68.42840       NA 70.60463 72.43233 68.21924 70.17636 74.66292
 [9] 67.67129 71.21479
> rowSums(tmp5)
 [1] 1830.561 1368.568       NA 1412.093 1448.647 1364.385 1403.527 1493.258
 [9] 1353.426 1424.296
> rowVars(tmp5)
 [1] 7606.46791   80.71045   67.11808   56.25432  102.45953   73.46428
 [7]   58.20570   48.89303   80.13333   68.12267
> rowSd(tmp5)
 [1] 87.215067  8.983899  8.192563  7.500288 10.122230  8.571131  7.629266
 [8]  6.992355  8.951722  8.253646
> rowMax(tmp5)
 [1] 460.61535  88.34399        NA  82.58818  91.39283  87.77262  84.44604
 [8]  87.71506  86.44419  86.84491
> rowMin(tmp5)
 [1] 57.87888 55.91326       NA 56.49891 57.59895 53.30870 55.58826 64.37520
 [9] 55.35055 58.48166
> 
> colMeans(tmp5)
 [1] 111.11491  75.06557  67.45028  67.79983  65.95112        NA  68.75186
 [8]  72.07914  71.67166  70.78174  70.09930  68.79195  71.76468  75.12935
[15]  70.79012  68.68259  73.01615  70.49409  68.18867  70.44808
> colSums(tmp5)
 [1] 1111.1491  750.6557  674.5028  677.9983  659.5112        NA  687.5186
 [8]  720.7914  716.7166  707.8174  700.9930  687.9195  717.6468  751.2935
[15]  707.9012  686.8259  730.1615  704.9409  681.8867  704.4808
> colVars(tmp5)
 [1] 15121.11110    78.63320    95.86577   129.05713    27.27705          NA
 [7]    58.54538   106.78008    50.95290    37.33924   112.23566    98.98215
[13]    26.18524    49.65393    94.00564    57.82344    67.53110    71.46875
[19]    83.15709   108.70803
> colSd(tmp5)
 [1] 122.967927   8.867536   9.791107  11.360331   5.222743         NA
 [7]   7.651495  10.333445   7.138130   6.110584  10.594133   9.948978
[13]   5.117151   7.046555   9.695650   7.604172   8.217731   8.453919
[19]   9.119051  10.426314
> colMax(tmp5)
 [1] 460.61535  87.58012  84.42992  82.55130  71.49222        NA  84.05783
 [8]  88.34399  82.58818  79.42464  87.71506  91.39283  80.36989  87.77262
[15]  89.80154  79.83346  84.44604  81.16442  86.17683  86.84491
> colMin(tmp5)
 [1] 59.07530 62.30580 56.37216 53.30870 56.21105       NA 57.59895 58.94061
 [9] 62.52403 60.77255 55.91326 58.35848 65.16691 64.19483 56.50655 58.41453
[17] 58.97448 58.75954 56.49891 55.58826
> 
> Max(tmp5,na.rm=TRUE)
[1] 460.6153
> Min(tmp5,na.rm=TRUE)
[1] 53.3087
> mean(tmp5,na.rm=TRUE)
[1] 72.42501
> Sum(tmp5,na.rm=TRUE)
[1] 14412.58
> Var(tmp5,na.rm=TRUE)
[1] 835.6173
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 91.52806 68.42840 69.14825 70.60463 72.43233 68.21924 70.17636 74.66292
 [9] 67.67129 71.21479
> rowSums(tmp5,na.rm=TRUE)
 [1] 1830.561 1368.568 1313.817 1412.093 1448.647 1364.385 1403.527 1493.258
 [9] 1353.426 1424.296
> rowVars(tmp5,na.rm=TRUE)
 [1] 7606.46791   80.71045   67.11808   56.25432  102.45953   73.46428
 [7]   58.20570   48.89303   80.13333   68.12267
> rowSd(tmp5,na.rm=TRUE)
 [1] 87.215067  8.983899  8.192563  7.500288 10.122230  8.571131  7.629266
 [8]  6.992355  8.951722  8.253646
> rowMax(tmp5,na.rm=TRUE)
 [1] 460.61535  88.34399  80.66754  82.58818  91.39283  87.77262  84.44604
 [8]  87.71506  86.44419  86.84491
> rowMin(tmp5,na.rm=TRUE)
 [1] 57.87888 55.91326 58.35848 56.49891 57.59895 53.30870 55.58826 64.37520
 [9] 55.35055 58.48166
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 111.11491  75.06557  67.45028  67.79983  65.95112  70.20735  68.75186
 [8]  72.07914  71.67166  70.78174  70.09930  68.79195  71.76468  75.12935
[15]  70.79012  68.68259  73.01615  70.49409  68.18867  70.44808
> colSums(tmp5,na.rm=TRUE)
 [1] 1111.1491  750.6557  674.5028  677.9983  659.5112  631.8662  687.5186
 [8]  720.7914  716.7166  707.8174  700.9930  687.9195  717.6468  751.2935
[15]  707.9012  686.8259  730.1615  704.9409  681.8867  704.4808
> colVars(tmp5,na.rm=TRUE)
 [1] 15121.11110    78.63320    95.86577   129.05713    27.27705    44.04174
 [7]    58.54538   106.78008    50.95290    37.33924   112.23566    98.98215
[13]    26.18524    49.65393    94.00564    57.82344    67.53110    71.46875
[19]    83.15709   108.70803
> colSd(tmp5,na.rm=TRUE)
 [1] 122.967927   8.867536   9.791107  11.360331   5.222743   6.636395
 [7]   7.651495  10.333445   7.138130   6.110584  10.594133   9.948978
[13]   5.117151   7.046555   9.695650   7.604172   8.217731   8.453919
[19]   9.119051  10.426314
> colMax(tmp5,na.rm=TRUE)
 [1] 460.61535  87.58012  84.42992  82.55130  71.49222  79.38071  84.05783
 [8]  88.34399  82.58818  79.42464  87.71506  91.39283  80.36989  87.77262
[15]  89.80154  79.83346  84.44604  81.16442  86.17683  86.84491
> colMin(tmp5,na.rm=TRUE)
 [1] 59.07530 62.30580 56.37216 53.30870 56.21105 62.72268 57.59895 58.94061
 [9] 62.52403 60.77255 55.91326 58.35848 65.16691 64.19483 56.50655 58.41453
[17] 58.97448 58.75954 56.49891 55.58826
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1] 91.52806 68.42840      NaN 70.60463 72.43233 68.21924 70.17636 74.66292
 [9] 67.67129 71.21479
> rowSums(tmp5,na.rm=TRUE)
 [1] 1830.561 1368.568    0.000 1412.093 1448.647 1364.385 1403.527 1493.258
 [9] 1353.426 1424.296
> rowVars(tmp5,na.rm=TRUE)
 [1] 7606.46791   80.71045         NA   56.25432  102.45953   73.46428
 [7]   58.20570   48.89303   80.13333   68.12267
> rowSd(tmp5,na.rm=TRUE)
 [1] 87.215067  8.983899        NA  7.500288 10.122230  8.571131  7.629266
 [8]  6.992355  8.951722  8.253646
> rowMax(tmp5,na.rm=TRUE)
 [1] 460.61535  88.34399        NA  82.58818  91.39283  87.77262  84.44604
 [8]  87.71506  86.44419  86.84491
> rowMin(tmp5,na.rm=TRUE)
 [1] 57.87888 55.91326       NA 56.49891 57.59895 53.30870 55.58826 64.37520
 [9] 55.35055 58.48166
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1] 114.56697  75.99147  66.18524  66.69788  66.41296       NaN  69.41668
 [8]  73.53898  71.70878  71.89387  70.24533  69.95123  70.80855  74.51399
[15]  70.85829  68.64381  72.39936  71.79793  69.00771  70.57142
> colSums(tmp5,na.rm=TRUE)
 [1] 1031.1027  683.9232  595.6672  600.2809  597.7167    0.0000  624.7502
 [8]  661.8508  645.3790  647.0448  632.2080  629.5611  637.2770  670.6259
[15]  637.7246  617.7943  651.5942  646.1814  621.0694  635.1428
> colVars(tmp5,na.rm=TRUE)
 [1] 16877.18683    78.81779    89.84533   131.52851    28.28709          NA
 [7]    60.89109    96.15245    57.30651    28.09221   126.02522    96.23583
[13]    19.17373    51.60073   105.70407    65.03446    71.69268    61.27737
[19]    86.00495   122.12538
> colSd(tmp5,na.rm=TRUE)
 [1] 129.912227   8.877938   9.478678  11.468588   5.318561         NA
 [7]   7.803274   9.805735   7.570106   5.300208  11.226096   9.809986
[13]   4.378782   7.183365  10.281248   8.064394   8.467153   7.827987
[19]   9.273886  11.051035
> colMax(tmp5,na.rm=TRUE)
 [1] 460.61535  87.58012  84.42992  82.55130  71.49222      -Inf  84.05783
 [8]  88.34399  82.58818  79.42464  87.71506  91.39283  78.12228  87.77262
[15]  89.80154  79.83346  84.44604  81.16442  86.17683  86.84491
> colMin(tmp5,na.rm=TRUE)
 [1] 59.07530 62.30580 56.37216 53.30870 56.21105      Inf 57.59895 60.77983
 [9] 62.52403 64.51472 55.91326 58.48166 65.16691 64.19483 56.50655 58.41453
[17] 58.97448 60.64209 56.49891 55.58826
> 
> 
> 
> 
> 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] 290.1216 469.1328 168.7182 120.8520 147.9120 199.7711 191.5182 296.9365
 [9] 299.7530 119.2578
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 290.1216 469.1328 168.7182 120.8520 147.9120 199.7711 191.5182 296.9365
 [9] 299.7530 119.2578
> 
> 
> 
> copymatrix <- matrix(rnorm(200,150,15),10,20)
> 
> tmp5[1:10,1:20] <- copymatrix
> which.row <- 1
> which.col  <- 3
> cat(which.row," ",which.col,"\n")
1   3 
> tmp5[which.row,which.col] <- NA
> copymatrix[which.row,which.col] <- NA
> 
> colVars(tmp5,na.rm=TRUE)-apply(copymatrix,2,var,na.rm=TRUE)
 [1] -1.989520e-13 -1.136868e-13  8.526513e-14 -2.842171e-14  5.684342e-14
 [6] -3.410605e-13  5.684342e-14 -5.684342e-14 -9.947598e-14  8.526513e-14
[11]  5.684342e-14  1.136868e-13 -2.842171e-14  0.000000e+00  8.526513e-14
[16]  2.842171e-14 -5.684342e-14  5.684342e-14 -2.842171e-14  0.000000e+00
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> ## making sure these things agree
> ##
> ## first when there is no NA
> 
> 
> 
> agree.checks <- function(buff.matrix,r.matrix,err.tol=1e-10){
+ 
+   if (Max(buff.matrix,na.rm=TRUE) != max(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Max")
+   }
+   
+ 
+   if (Min(buff.matrix,na.rm=TRUE) != min(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Min")
+   }
+ 
+ 
+   if (abs(Sum(buff.matrix,na.rm=TRUE)- sum(r.matrix,na.rm=TRUE)) > err.tol){
+ 
+     cat(Sum(buff.matrix,na.rm=TRUE),"\n")
+     cat(sum(r.matrix,na.rm=TRUE),"\n")
+     cat(Sum(buff.matrix,na.rm=TRUE) - sum(r.matrix,na.rm=TRUE),"\n")
+     
+     stop("No agreement in Sum")
+   }
+   
+   if (abs(mean(buff.matrix,na.rm=TRUE) - mean(r.matrix,na.rm=TRUE)) > err.tol){
+     stop("No agreement in mean")
+   }
+   
+   
+   if(abs(Var(buff.matrix,na.rm=TRUE) - var(as.vector(r.matrix),na.rm=TRUE)) > err.tol){
+     stop("No agreement in Var")
+   }
+   
+   
+ 
+   if(any(abs(rowMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,mean,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowMeans")
+   }
+   
+   
+   if(any(abs(colMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,mean,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colMeans")
+   }
+   
+   
+   if(any(abs(rowSums(buff.matrix,na.rm=TRUE)  -  apply(r.matrix,1,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in rowSums")
+   }
+   
+   
+   if(any(abs(colSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colSums")
+   }
+   
+   ### this is to get around the fact that R doesn't like to compute NA on an entire vector of NA when 
+   ### computing variance
+   my.Var <- function(x,na.rm=FALSE){
+    if (all(is.na(x))){
+      return(NA)
+    } else {
+      var(x,na.rm=na.rm)
+    }
+ 
+   }
+   
+   if(any(abs(rowVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+   
+   
+   if(any(abs(colVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+ 
+ 
+   if(any(abs(rowMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+ 
+   if(any(abs(colMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+   
+   
+   if(any(abs(rowMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+   
+ 
+   if(any(abs(colMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+ 
+   if(any(abs(colMedians(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,median,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMedian")
+   }
+ 
+   if(any(abs(colRanges(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,range,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colRanges")
+   }
+ 
+ 
+   
+ }
> 
> 
> 
> 
> 
> 
> 
> 
> 
> for (rep in 1:20){
+   copymatrix <- matrix(rnorm(200,150,15),10,20)
+   
+   tmp5[1:10,1:20] <- copymatrix
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ## now lets assign some NA values and check agreement
+ 
+   which.row <- sample(1:10,1,replace=TRUE)
+   which.col  <- sample(1:20,1,replace=TRUE)
+   
+   cat(which.row," ",which.col,"\n")
+   
+   tmp5[which.row,which.col] <- NA
+   copymatrix[which.row,which.col] <- NA
+   
+   agree.checks(tmp5,copymatrix)
+ 
+   ## make an entire row NA
+   tmp5[which.row,] <- NA
+   copymatrix[which.row,] <- NA
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ### also make an entire col NA
+   tmp5[,which.col] <- NA
+   copymatrix[,which.col] <- NA
+ 
+   agree.checks(tmp5,copymatrix)
+ 
+   ### now make 1 element non NA with NA in the rest of row and column
+ 
+   tmp5[which.row,which.col] <- rnorm(1,150,15)
+   copymatrix[which.row,which.col] <- tmp5[which.row,which.col]
+ 
+   agree.checks(tmp5,copymatrix)
+ }
3   10 
7   17 
1   7 
5   20 
6   18 
6   7 
1   6 
9   7 
8   14 
10   11 
6   3 
4   8 
4   11 
1   6 
2   17 
4   20 
10   13 
7   6 
8   5 
8   13 
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.232418
> Min(tmp)
[1] -1.997944
> mean(tmp)
[1] 0.03612068
> Sum(tmp)
[1] 3.612068
> Var(tmp)
[1] 0.7630001
> 
> rowMeans(tmp)
[1] 0.03612068
> rowSums(tmp)
[1] 3.612068
> rowVars(tmp)
[1] 0.7630001
> rowSd(tmp)
[1] 0.8734988
> rowMax(tmp)
[1] 2.232418
> rowMin(tmp)
[1] -1.997944
> 
> colMeans(tmp)
  [1] -0.139277248  0.869640906 -0.865209442  1.395075427 -0.277634225
  [6] -0.971107151  0.539849176  0.849652722 -0.437076261  0.707376496
 [11]  1.953045046  1.388433906 -0.358672305  0.541116622  0.287048187
 [16] -0.089375490  0.081452759  1.396827213 -0.646730233  0.373977019
 [21] -0.535892325 -0.769208492 -0.426448041 -0.610095653  2.232417579
 [26]  1.559160805 -0.109953686 -0.912296635 -1.080346898  0.559344737
 [31]  0.007203013 -1.646542975 -0.475777931  1.543842295  0.371359539
 [36]  0.645057299  2.115233578  1.223703590 -0.657405265 -0.470136165
 [41] -0.866384764  0.120087776 -0.271440127 -0.923466529 -0.371312305
 [46]  0.841904838  0.799822526 -1.130340010 -0.292589762  0.071900531
 [51] -1.086916849  0.477378278  0.200220583  0.333817034  1.375624964
 [56]  0.502320975  0.691130967 -0.505445613  0.244307390 -0.943421588
 [61] -1.254106015 -1.514296659 -0.652373014 -0.181836824  1.868315489
 [66] -0.900133932  0.543029854  0.895924440 -0.137805014  0.167567844
 [71] -0.437180223  0.228439404 -0.117654776 -0.152857732  0.312035041
 [76] -0.150211111 -0.094036446 -0.139572810  1.350271083 -0.146553199
 [81]  0.456662335 -1.020620450  0.712174462 -0.169578801  1.120845908
 [86] -0.330102902 -0.953181175  0.076637923 -0.050819524 -1.914128740
 [91] -0.368902943 -0.847952516 -0.278774807 -0.563343818  0.212119249
 [96]  0.675134647  0.036037987 -1.997943876 -0.313528159  1.215537990
> colSums(tmp)
  [1] -0.139277248  0.869640906 -0.865209442  1.395075427 -0.277634225
  [6] -0.971107151  0.539849176  0.849652722 -0.437076261  0.707376496
 [11]  1.953045046  1.388433906 -0.358672305  0.541116622  0.287048187
 [16] -0.089375490  0.081452759  1.396827213 -0.646730233  0.373977019
 [21] -0.535892325 -0.769208492 -0.426448041 -0.610095653  2.232417579
 [26]  1.559160805 -0.109953686 -0.912296635 -1.080346898  0.559344737
 [31]  0.007203013 -1.646542975 -0.475777931  1.543842295  0.371359539
 [36]  0.645057299  2.115233578  1.223703590 -0.657405265 -0.470136165
 [41] -0.866384764  0.120087776 -0.271440127 -0.923466529 -0.371312305
 [46]  0.841904838  0.799822526 -1.130340010 -0.292589762  0.071900531
 [51] -1.086916849  0.477378278  0.200220583  0.333817034  1.375624964
 [56]  0.502320975  0.691130967 -0.505445613  0.244307390 -0.943421588
 [61] -1.254106015 -1.514296659 -0.652373014 -0.181836824  1.868315489
 [66] -0.900133932  0.543029854  0.895924440 -0.137805014  0.167567844
 [71] -0.437180223  0.228439404 -0.117654776 -0.152857732  0.312035041
 [76] -0.150211111 -0.094036446 -0.139572810  1.350271083 -0.146553199
 [81]  0.456662335 -1.020620450  0.712174462 -0.169578801  1.120845908
 [86] -0.330102902 -0.953181175  0.076637923 -0.050819524 -1.914128740
 [91] -0.368902943 -0.847952516 -0.278774807 -0.563343818  0.212119249
 [96]  0.675134647  0.036037987 -1.997943876 -0.313528159  1.215537990
> 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.139277248  0.869640906 -0.865209442  1.395075427 -0.277634225
  [6] -0.971107151  0.539849176  0.849652722 -0.437076261  0.707376496
 [11]  1.953045046  1.388433906 -0.358672305  0.541116622  0.287048187
 [16] -0.089375490  0.081452759  1.396827213 -0.646730233  0.373977019
 [21] -0.535892325 -0.769208492 -0.426448041 -0.610095653  2.232417579
 [26]  1.559160805 -0.109953686 -0.912296635 -1.080346898  0.559344737
 [31]  0.007203013 -1.646542975 -0.475777931  1.543842295  0.371359539
 [36]  0.645057299  2.115233578  1.223703590 -0.657405265 -0.470136165
 [41] -0.866384764  0.120087776 -0.271440127 -0.923466529 -0.371312305
 [46]  0.841904838  0.799822526 -1.130340010 -0.292589762  0.071900531
 [51] -1.086916849  0.477378278  0.200220583  0.333817034  1.375624964
 [56]  0.502320975  0.691130967 -0.505445613  0.244307390 -0.943421588
 [61] -1.254106015 -1.514296659 -0.652373014 -0.181836824  1.868315489
 [66] -0.900133932  0.543029854  0.895924440 -0.137805014  0.167567844
 [71] -0.437180223  0.228439404 -0.117654776 -0.152857732  0.312035041
 [76] -0.150211111 -0.094036446 -0.139572810  1.350271083 -0.146553199
 [81]  0.456662335 -1.020620450  0.712174462 -0.169578801  1.120845908
 [86] -0.330102902 -0.953181175  0.076637923 -0.050819524 -1.914128740
 [91] -0.368902943 -0.847952516 -0.278774807 -0.563343818  0.212119249
 [96]  0.675134647  0.036037987 -1.997943876 -0.313528159  1.215537990
> colMin(tmp)
  [1] -0.139277248  0.869640906 -0.865209442  1.395075427 -0.277634225
  [6] -0.971107151  0.539849176  0.849652722 -0.437076261  0.707376496
 [11]  1.953045046  1.388433906 -0.358672305  0.541116622  0.287048187
 [16] -0.089375490  0.081452759  1.396827213 -0.646730233  0.373977019
 [21] -0.535892325 -0.769208492 -0.426448041 -0.610095653  2.232417579
 [26]  1.559160805 -0.109953686 -0.912296635 -1.080346898  0.559344737
 [31]  0.007203013 -1.646542975 -0.475777931  1.543842295  0.371359539
 [36]  0.645057299  2.115233578  1.223703590 -0.657405265 -0.470136165
 [41] -0.866384764  0.120087776 -0.271440127 -0.923466529 -0.371312305
 [46]  0.841904838  0.799822526 -1.130340010 -0.292589762  0.071900531
 [51] -1.086916849  0.477378278  0.200220583  0.333817034  1.375624964
 [56]  0.502320975  0.691130967 -0.505445613  0.244307390 -0.943421588
 [61] -1.254106015 -1.514296659 -0.652373014 -0.181836824  1.868315489
 [66] -0.900133932  0.543029854  0.895924440 -0.137805014  0.167567844
 [71] -0.437180223  0.228439404 -0.117654776 -0.152857732  0.312035041
 [76] -0.150211111 -0.094036446 -0.139572810  1.350271083 -0.146553199
 [81]  0.456662335 -1.020620450  0.712174462 -0.169578801  1.120845908
 [86] -0.330102902 -0.953181175  0.076637923 -0.050819524 -1.914128740
 [91] -0.368902943 -0.847952516 -0.278774807 -0.563343818  0.212119249
 [96]  0.675134647  0.036037987 -1.997943876 -0.313528159  1.215537990
> colMedians(tmp)
  [1] -0.139277248  0.869640906 -0.865209442  1.395075427 -0.277634225
  [6] -0.971107151  0.539849176  0.849652722 -0.437076261  0.707376496
 [11]  1.953045046  1.388433906 -0.358672305  0.541116622  0.287048187
 [16] -0.089375490  0.081452759  1.396827213 -0.646730233  0.373977019
 [21] -0.535892325 -0.769208492 -0.426448041 -0.610095653  2.232417579
 [26]  1.559160805 -0.109953686 -0.912296635 -1.080346898  0.559344737
 [31]  0.007203013 -1.646542975 -0.475777931  1.543842295  0.371359539
 [36]  0.645057299  2.115233578  1.223703590 -0.657405265 -0.470136165
 [41] -0.866384764  0.120087776 -0.271440127 -0.923466529 -0.371312305
 [46]  0.841904838  0.799822526 -1.130340010 -0.292589762  0.071900531
 [51] -1.086916849  0.477378278  0.200220583  0.333817034  1.375624964
 [56]  0.502320975  0.691130967 -0.505445613  0.244307390 -0.943421588
 [61] -1.254106015 -1.514296659 -0.652373014 -0.181836824  1.868315489
 [66] -0.900133932  0.543029854  0.895924440 -0.137805014  0.167567844
 [71] -0.437180223  0.228439404 -0.117654776 -0.152857732  0.312035041
 [76] -0.150211111 -0.094036446 -0.139572810  1.350271083 -0.146553199
 [81]  0.456662335 -1.020620450  0.712174462 -0.169578801  1.120845908
 [86] -0.330102902 -0.953181175  0.076637923 -0.050819524 -1.914128740
 [91] -0.368902943 -0.847952516 -0.278774807 -0.563343818  0.212119249
 [96]  0.675134647  0.036037987 -1.997943876 -0.313528159  1.215537990
> colRanges(tmp)
           [,1]      [,2]       [,3]     [,4]       [,5]       [,6]      [,7]
[1,] -0.1392772 0.8696409 -0.8652094 1.395075 -0.2776342 -0.9711072 0.5398492
[2,] -0.1392772 0.8696409 -0.8652094 1.395075 -0.2776342 -0.9711072 0.5398492
          [,8]       [,9]     [,10]    [,11]    [,12]      [,13]     [,14]
[1,] 0.8496527 -0.4370763 0.7073765 1.953045 1.388434 -0.3586723 0.5411166
[2,] 0.8496527 -0.4370763 0.7073765 1.953045 1.388434 -0.3586723 0.5411166
         [,15]       [,16]      [,17]    [,18]      [,19]    [,20]      [,21]
[1,] 0.2870482 -0.08937549 0.08145276 1.396827 -0.6467302 0.373977 -0.5358923
[2,] 0.2870482 -0.08937549 0.08145276 1.396827 -0.6467302 0.373977 -0.5358923
          [,22]     [,23]      [,24]    [,25]    [,26]      [,27]      [,28]
[1,] -0.7692085 -0.426448 -0.6100957 2.232418 1.559161 -0.1099537 -0.9122966
[2,] -0.7692085 -0.426448 -0.6100957 2.232418 1.559161 -0.1099537 -0.9122966
         [,29]     [,30]       [,31]     [,32]      [,33]    [,34]     [,35]
[1,] -1.080347 0.5593447 0.007203013 -1.646543 -0.4757779 1.543842 0.3713595
[2,] -1.080347 0.5593447 0.007203013 -1.646543 -0.4757779 1.543842 0.3713595
         [,36]    [,37]    [,38]      [,39]      [,40]      [,41]     [,42]
[1,] 0.6450573 2.115234 1.223704 -0.6574053 -0.4701362 -0.8663848 0.1200878
[2,] 0.6450573 2.115234 1.223704 -0.6574053 -0.4701362 -0.8663848 0.1200878
          [,43]      [,44]      [,45]     [,46]     [,47]    [,48]      [,49]
[1,] -0.2714401 -0.9234665 -0.3713123 0.8419048 0.7998225 -1.13034 -0.2925898
[2,] -0.2714401 -0.9234665 -0.3713123 0.8419048 0.7998225 -1.13034 -0.2925898
          [,50]     [,51]     [,52]     [,53]    [,54]    [,55]    [,56]
[1,] 0.07190053 -1.086917 0.4773783 0.2002206 0.333817 1.375625 0.502321
[2,] 0.07190053 -1.086917 0.4773783 0.2002206 0.333817 1.375625 0.502321
        [,57]      [,58]     [,59]      [,60]     [,61]     [,62]     [,63]
[1,] 0.691131 -0.5054456 0.2443074 -0.9434216 -1.254106 -1.514297 -0.652373
[2,] 0.691131 -0.5054456 0.2443074 -0.9434216 -1.254106 -1.514297 -0.652373
          [,64]    [,65]      [,66]     [,67]     [,68]     [,69]     [,70]
[1,] -0.1818368 1.868315 -0.9001339 0.5430299 0.8959244 -0.137805 0.1675678
[2,] -0.1818368 1.868315 -0.9001339 0.5430299 0.8959244 -0.137805 0.1675678
          [,71]     [,72]      [,73]      [,74]    [,75]      [,76]       [,77]
[1,] -0.4371802 0.2284394 -0.1176548 -0.1528577 0.312035 -0.1502111 -0.09403645
[2,] -0.4371802 0.2284394 -0.1176548 -0.1528577 0.312035 -0.1502111 -0.09403645
          [,78]    [,79]      [,80]     [,81]    [,82]     [,83]      [,84]
[1,] -0.1395728 1.350271 -0.1465532 0.4566623 -1.02062 0.7121745 -0.1695788
[2,] -0.1395728 1.350271 -0.1465532 0.4566623 -1.02062 0.7121745 -0.1695788
        [,85]      [,86]      [,87]      [,88]       [,89]     [,90]      [,91]
[1,] 1.120846 -0.3301029 -0.9531812 0.07663792 -0.05081952 -1.914129 -0.3689029
[2,] 1.120846 -0.3301029 -0.9531812 0.07663792 -0.05081952 -1.914129 -0.3689029
          [,92]      [,93]      [,94]     [,95]     [,96]      [,97]     [,98]
[1,] -0.8479525 -0.2787748 -0.5633438 0.2121192 0.6751346 0.03603799 -1.997944
[2,] -0.8479525 -0.2787748 -0.5633438 0.2121192 0.6751346 0.03603799 -1.997944
          [,99]   [,100]
[1,] -0.3135282 1.215538
[2,] -0.3135282 1.215538
> 
> 
> Max(tmp2)
[1] 2.922859
> Min(tmp2)
[1] -2.321202
> mean(tmp2)
[1] 0.05644518
> Sum(tmp2)
[1] 5.644518
> Var(tmp2)
[1] 1.098938
> 
> rowMeans(tmp2)
  [1] -0.050305167 -0.664702281 -1.969084513  0.248215786  0.100158389
  [6]  0.133033860  0.841048370 -0.317504392  0.462449426 -0.989491145
 [11]  1.060580243  0.417767060 -0.282699340 -1.290716149 -0.348645712
 [16] -1.456925095  0.551019228  0.948501780  0.723999622 -0.273540812
 [21]  0.449826255  0.353412032 -2.074514640  1.704965535  0.253863107
 [26]  0.926126072  0.661938137 -0.016818525  0.799153305 -1.104048855
 [31] -2.144433008  2.922859441  1.931704286  1.044009967 -0.064011297
 [36] -1.152687539  1.213188104 -0.402089308  0.357093927  0.033042343
 [41]  1.649769928 -0.861343861 -0.701021657 -1.246057295  1.303928930
 [46] -0.539500570  0.374720816 -0.137154702  0.269626200 -0.244501543
 [51]  1.454928332  0.577308412 -1.100517167  0.601983025 -2.321202497
 [56]  1.771145145 -1.081379639 -0.456979505  1.497025017  0.318646204
 [61] -0.175746728  2.251982892 -0.076440407 -0.141992505 -0.064604097
 [66] -0.036496744  0.006079139 -1.024490546 -0.286376178  0.318931878
 [71] -0.930761957  1.173767663 -0.036593210 -0.853662949 -2.007833309
 [76] -0.756092794  1.161473193  2.773205774  0.745032907 -0.582048047
 [81]  0.811816889 -1.630797849 -0.609797137  0.061096871  0.573999257
 [86] -1.344763015 -0.385224467  1.229409829  1.826390257 -1.554399311
 [91] -0.102857759  0.037507472 -0.715847818  0.510854301  0.249100002
 [96]  1.081683271  0.301794034 -0.646825539 -0.275821273  0.104703567
> rowSums(tmp2)
  [1] -0.050305167 -0.664702281 -1.969084513  0.248215786  0.100158389
  [6]  0.133033860  0.841048370 -0.317504392  0.462449426 -0.989491145
 [11]  1.060580243  0.417767060 -0.282699340 -1.290716149 -0.348645712
 [16] -1.456925095  0.551019228  0.948501780  0.723999622 -0.273540812
 [21]  0.449826255  0.353412032 -2.074514640  1.704965535  0.253863107
 [26]  0.926126072  0.661938137 -0.016818525  0.799153305 -1.104048855
 [31] -2.144433008  2.922859441  1.931704286  1.044009967 -0.064011297
 [36] -1.152687539  1.213188104 -0.402089308  0.357093927  0.033042343
 [41]  1.649769928 -0.861343861 -0.701021657 -1.246057295  1.303928930
 [46] -0.539500570  0.374720816 -0.137154702  0.269626200 -0.244501543
 [51]  1.454928332  0.577308412 -1.100517167  0.601983025 -2.321202497
 [56]  1.771145145 -1.081379639 -0.456979505  1.497025017  0.318646204
 [61] -0.175746728  2.251982892 -0.076440407 -0.141992505 -0.064604097
 [66] -0.036496744  0.006079139 -1.024490546 -0.286376178  0.318931878
 [71] -0.930761957  1.173767663 -0.036593210 -0.853662949 -2.007833309
 [76] -0.756092794  1.161473193  2.773205774  0.745032907 -0.582048047
 [81]  0.811816889 -1.630797849 -0.609797137  0.061096871  0.573999257
 [86] -1.344763015 -0.385224467  1.229409829  1.826390257 -1.554399311
 [91] -0.102857759  0.037507472 -0.715847818  0.510854301  0.249100002
 [96]  1.081683271  0.301794034 -0.646825539 -0.275821273  0.104703567
> 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.050305167 -0.664702281 -1.969084513  0.248215786  0.100158389
  [6]  0.133033860  0.841048370 -0.317504392  0.462449426 -0.989491145
 [11]  1.060580243  0.417767060 -0.282699340 -1.290716149 -0.348645712
 [16] -1.456925095  0.551019228  0.948501780  0.723999622 -0.273540812
 [21]  0.449826255  0.353412032 -2.074514640  1.704965535  0.253863107
 [26]  0.926126072  0.661938137 -0.016818525  0.799153305 -1.104048855
 [31] -2.144433008  2.922859441  1.931704286  1.044009967 -0.064011297
 [36] -1.152687539  1.213188104 -0.402089308  0.357093927  0.033042343
 [41]  1.649769928 -0.861343861 -0.701021657 -1.246057295  1.303928930
 [46] -0.539500570  0.374720816 -0.137154702  0.269626200 -0.244501543
 [51]  1.454928332  0.577308412 -1.100517167  0.601983025 -2.321202497
 [56]  1.771145145 -1.081379639 -0.456979505  1.497025017  0.318646204
 [61] -0.175746728  2.251982892 -0.076440407 -0.141992505 -0.064604097
 [66] -0.036496744  0.006079139 -1.024490546 -0.286376178  0.318931878
 [71] -0.930761957  1.173767663 -0.036593210 -0.853662949 -2.007833309
 [76] -0.756092794  1.161473193  2.773205774  0.745032907 -0.582048047
 [81]  0.811816889 -1.630797849 -0.609797137  0.061096871  0.573999257
 [86] -1.344763015 -0.385224467  1.229409829  1.826390257 -1.554399311
 [91] -0.102857759  0.037507472 -0.715847818  0.510854301  0.249100002
 [96]  1.081683271  0.301794034 -0.646825539 -0.275821273  0.104703567
> rowMin(tmp2)
  [1] -0.050305167 -0.664702281 -1.969084513  0.248215786  0.100158389
  [6]  0.133033860  0.841048370 -0.317504392  0.462449426 -0.989491145
 [11]  1.060580243  0.417767060 -0.282699340 -1.290716149 -0.348645712
 [16] -1.456925095  0.551019228  0.948501780  0.723999622 -0.273540812
 [21]  0.449826255  0.353412032 -2.074514640  1.704965535  0.253863107
 [26]  0.926126072  0.661938137 -0.016818525  0.799153305 -1.104048855
 [31] -2.144433008  2.922859441  1.931704286  1.044009967 -0.064011297
 [36] -1.152687539  1.213188104 -0.402089308  0.357093927  0.033042343
 [41]  1.649769928 -0.861343861 -0.701021657 -1.246057295  1.303928930
 [46] -0.539500570  0.374720816 -0.137154702  0.269626200 -0.244501543
 [51]  1.454928332  0.577308412 -1.100517167  0.601983025 -2.321202497
 [56]  1.771145145 -1.081379639 -0.456979505  1.497025017  0.318646204
 [61] -0.175746728  2.251982892 -0.076440407 -0.141992505 -0.064604097
 [66] -0.036496744  0.006079139 -1.024490546 -0.286376178  0.318931878
 [71] -0.930761957  1.173767663 -0.036593210 -0.853662949 -2.007833309
 [76] -0.756092794  1.161473193  2.773205774  0.745032907 -0.582048047
 [81]  0.811816889 -1.630797849 -0.609797137  0.061096871  0.573999257
 [86] -1.344763015 -0.385224467  1.229409829  1.826390257 -1.554399311
 [91] -0.102857759  0.037507472 -0.715847818  0.510854301  0.249100002
 [96]  1.081683271  0.301794034 -0.646825539 -0.275821273  0.104703567
> 
> colMeans(tmp2)
[1] 0.05644518
> colSums(tmp2)
[1] 5.644518
> colVars(tmp2)
[1] 1.098938
> colSd(tmp2)
[1] 1.048303
> colMax(tmp2)
[1] 2.922859
> colMin(tmp2)
[1] -2.321202
> colMedians(tmp2)
[1] 0.01956074
> colRanges(tmp2)
          [,1]
[1,] -2.321202
[2,]  2.922859
> 
> 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] -2.5072728  2.0636908 -0.6744742  3.9384684 -6.0452349 -0.3538444
 [7] -2.3563262 -3.8121388 -1.1965234  4.8846375
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -2.1249677
[2,] -0.5410093
[3,] -0.2209863
[4,]  0.5300877
[5,]  0.8356469
> 
> rowApply(tmp,sum)
 [1] -4.7844492 -3.5315679  1.7005382  0.4323156 -0.4289932 -3.2036406
 [7]  1.5698919  2.2469397  2.2063768 -2.2664294
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    9    1    3    6    4    2    8    3    8     7
 [2,]    1    8    5    8    7    8    5    9    9     8
 [3,]    2    6    7    4    2    9    7    7    2     9
 [4,]    3    4    6    2    6   10   10    8   10     6
 [5,]    6    5    9    1    3    1    3    1    3     5
 [6,]    4    7   10   10    8    4    1    2    7     4
 [7,]    5    3    8    7    9    6    4    4    6     1
 [8,]    8    2    2    5    1    3    9    6    4     2
 [9,]    7   10    1    3    5    7    2   10    5     3
[10,]   10    9    4    9   10    5    6    5    1    10
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1] -6.52953199  0.39396369  1.85801982  1.59929040  2.50111247 -1.06211898
 [7]  1.88672017  3.86507917  2.25851661 -1.48879620 -1.64806017  1.74241838
[13]  0.01854339 -0.87083875  2.18966345  1.13231290  0.05992512  0.66939239
[19] -0.06030913 -2.12387309
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -2.5158907
[2,] -1.2887231
[3,] -1.1917955
[4,] -0.8015973
[5,] -0.7315252
> 
> rowApply(tmp,sum)
[1]  0.07796574  2.92884100  6.16271090 -1.79340791 -0.98468011
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]    3    3    4    1    3
[2,]    9    4   15    8   15
[3,]   10   19   20    2    6
[4,]    4   20   16   18    4
[5,]    2   13   18    9   18
> 
> 
> as.matrix(tmp)
           [,1]       [,2]      [,3]       [,4]        [,5]        [,6]
[1,] -1.1917955 -0.1757986 -0.120490 -1.1776311 -1.29775480 -0.46203567
[2,] -0.7315252 -0.6449121  1.631835  1.7349198  0.44669109  0.29169936
[3,] -0.8015973  0.8324218  2.385594  1.2457598  1.86226473 -0.83764631
[4,] -2.5158907 -0.1318610 -1.224368  0.9715822 -0.03875004 -0.02115379
[5,] -1.2887231  0.5141136 -0.814551 -1.1753403  1.52866149 -0.03298258
           [,7]       [,8]       [,9]       [,10]       [,11]      [,12]
[1,]  0.8370719  1.4017998  1.5754299 -1.37395898 -0.76991212  0.9596687
[2,] -0.5013720 -0.3556752 -0.2305048  0.28956184  0.03768352  0.5647445
[3,] -0.5966793  1.2693624 -0.3474125 -1.78901644  0.73171996  0.7329936
[4,]  0.5140472 -0.7110106  0.4639491  1.29751599 -1.05480307 -0.8752631
[5,]  1.6336524  2.2606028  0.7970549  0.08710139 -0.59274847  0.3602747
          [,13]       [,14]      [,15]      [,16]       [,17]      [,18]
[1,] -0.5360281  1.01486728  0.6681033  1.3027540  0.04334185  0.4827726
[2,]  0.7432455 -1.44857838  1.2084716 -0.2475232  0.88484483 -0.2441779
[3,] -0.4470365  0.02991992 -0.4136245  0.3975085  0.45172428  2.2041868
[4,]  1.0995848 -0.98092775  0.6091585 -0.9304228  0.45136860  0.8939743
[5,] -0.8412223  0.51388017  0.1175544  0.6099963 -1.77135444 -2.6673636
           [,19]       [,20]
[1,]  0.05431184 -1.15675051
[2,]  0.54498053 -1.04556748
[3,] -0.86103718  0.11330506
[4,]  0.29760310  0.09225896
[5,] -0.09616742 -0.12711912
> 
> 
> is.BufferedMatrix(tmp)
[1] TRUE
> 
> as.BufferedMatrix(as.matrix(tmp))
BufferedMatrix object
Matrix size:  5 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  800  bytes.
> 
> 
> 
> subBufferedMatrix(tmp,1:5,1:5)
BufferedMatrix object
Matrix size:  5 5 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  643  bytes.
Disk usage :  200  bytes.
> subBufferedMatrix(tmp,,5:8)
BufferedMatrix object
Matrix size:  5 4 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  557  bytes.
Disk usage :  160  bytes.
> subBufferedMatrix(tmp,1:3,)
BufferedMatrix object
Matrix size:  3 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  480  bytes.
> 
> 
> rm(tmp)
> 
> 
> ###
> ### Testing colnames and rownames
> ###
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> 
> 
> colnames(tmp)
NULL
> rownames(tmp)
NULL
> 
> 
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> colnames(tmp)
 [1] "col1"  "col2"  "col3"  "col4"  "col5"  "col6"  "col7"  "col8"  "col9" 
[10] "col10" "col11" "col12" "col13" "col14" "col15" "col16" "col17" "col18"
[19] "col19" "col20"
> rownames(tmp)
[1] "row1" "row2" "row3" "row4" "row5"
> 
> 
> tmp["row1",]
          col1       col2       col3       col4      col5      col6      col7
row1 -1.124355 -0.7223499 -0.3942049 -0.1993776 -0.563167 -0.557186 -0.776869
           col8     col9      col10      col11    col12      col13     col14
row1 -0.9356526 1.316739 -0.1413407 -0.5320777 1.191132 -0.5412265 0.3858552
        col15     col16      col17      col18      col19      col20
row1 -2.14944 0.2257069 -0.3506877 -0.9173196 -0.6444641 -0.3378207
> tmp[,"col10"]
          col10
row1 -0.1413407
row2  1.0104433
row3 -1.2140697
row4  0.4592992
row5 -0.3326569
> tmp[c("row1","row5"),]
          col1        col2       col3       col4       col5       col6
row1 -1.124355 -0.72234993 -0.3942049 -0.1993776 -0.5631670 -0.5571860
row5 -1.300676  0.07963618 -0.9425595 -0.2987314  0.1988613  0.7492138
          col7       col8       col9      col10      col11      col12
row1 -0.776869 -0.9356526  1.3167390 -0.1413407 -0.5320777  1.1911319
row5 -1.315518  1.7476445 -0.3731028 -0.3326569  0.4001910 -0.6339528
          col13     col14     col15      col16      col17      col18      col19
row1 -0.5412265 0.3858552 -2.149440  0.2257069 -0.3506877 -0.9173196 -0.6444641
row5  1.5222625 0.7045815 -1.017501 -0.5367360  0.4688402  1.2625938  2.5070545
          col20
row1 -0.3378207
row5 -0.2563306
> tmp[,c("col6","col20")]
           col6      col20
row1 -0.5571860 -0.3378207
row2 -1.7048383 -0.3227153
row3 -0.9955256  0.5276701
row4  0.5550394  0.5109566
row5  0.7492138 -0.2563306
> tmp[c("row1","row5"),c("col6","col20")]
           col6      col20
row1 -0.5571860 -0.3378207
row5  0.7492138 -0.2563306
> 
> 
> 
> 
> tmp["row1",] <- rnorm(20,mean=10)
> tmp[,"col10"] <- rnorm(5,mean=30)
> tmp[c("row1","row5"),] <- rnorm(40,mean=50)
> tmp[,c("col6","col20")] <- rnorm(10,mean=75)
> tmp[c("row1","row5"),c("col6","col20")]  <- rnorm(4,mean=105)
> 
> tmp["row1",]
        col1     col2     col3    col4     col5     col6     col7     col8
row1 49.8031 48.56854 48.30056 49.7537 48.01079 106.6758 50.20248 50.54553
         col9    col10   col11    col12    col13    col14    col15    col16
row1 48.46929 49.68685 51.6331 52.08455 51.28651 50.33656 49.73559 49.10947
       col17    col18    col19   col20
row1 49.8683 48.72759 50.22862 104.522
> tmp[,"col10"]
        col10
row1 49.68685
row2 31.82095
row3 29.24727
row4 29.27631
row5 50.91855
> tmp[c("row1","row5"),]
        col1     col2     col3    col4     col5     col6     col7     col8
row1 49.8031 48.56854 48.30056 49.7537 48.01079 106.6758 50.20248 50.54553
row5 49.3804 50.58443 49.32294 50.3952 51.92887 105.4694 49.60226 51.10673
         col9    col10   col11    col12    col13    col14    col15    col16
row1 48.46929 49.68685 51.6331 52.08455 51.28651 50.33656 49.73559 49.10947
row5 52.02909 50.91855 49.2275 50.66902 49.61823 49.87552 49.88618 49.57597
        col17    col18    col19    col20
row1 49.86830 48.72759 50.22862 104.5220
row5 49.79019 49.49050 48.10487 107.2063
> tmp[,c("col6","col20")]
          col6     col20
row1 106.67581 104.52201
row2  75.05867  76.30394
row3  75.99646  75.95166
row4  75.64042  75.11842
row5 105.46936 107.20633
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 106.6758 104.5220
row5 105.4694 107.2063
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 106.6758 104.5220
row5 105.4694 107.2063
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
          col13
[1,]  0.8326112
[2,]  1.8358493
[3,]  0.0706478
[4,]  0.6453362
[5,] -1.3994777
> tmp[,c("col17","col7")]
          col17       col7
[1,] -1.6044657 -1.1955506
[2,]  0.7167764 -1.7821292
[3,]  0.6020586  0.7695785
[4,]  0.2248651  0.9965432
[5,] -0.2632400  0.3240544
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
             col6     col20
[1,]  1.754111942 0.8561997
[2,]  0.005677469 0.1878893
[3,] -1.296657818 0.9453322
[4,]  1.119006905 0.7244570
[5,] -0.441107424 0.5649825
> subBufferedMatrix(tmp,1,c("col6"))[,1]
         col1
[1,] 1.754112
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
            col6
[1,] 1.754111942
[2,] 0.005677469
> 
> 
> 
> 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.1876061 -0.1350094 0.6689570 0.4466958971  0.8591724  0.2782339
row1 -1.5376888  0.5492211 0.2876622 0.0006889514 -0.1123719 -1.4761070
          [,7]       [,8]       [,9]      [,10]      [,11]       [,12]
row3 -1.597863 -0.6140711 -0.3966209  1.4558562 -0.2883541  0.08733446
row1  0.242240 -1.2045034  0.1490943 -0.2389452  0.9342745 -1.05428345
          [,13]     [,14]     [,15]      [,16]     [,17]      [,18]     [,19]
row3 -0.3687752 0.7510891 0.3661645  0.4495368 0.1606886 -1.7105193 -2.233922
row1 -0.1046683 0.8233771 1.3266378 -0.2786535 1.0594862 -0.7800989 -2.341111
          [,20]
row3  1.1696903
row1 -0.5243932
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
         [,1]      [,2]       [,3]      [,4]      [,5]       [,6]       [,7]
row2 -1.49378 -1.536147 -0.2587476 -1.310144 -1.328914 -0.1609608 -0.2524601
          [,8]     [,9]     [,10]
row2 0.5363934 2.797868 0.5841025
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
           [,1]     [,2]     [,3]      [,4]      [,5]    [,6]     [,7]
row5 -0.1071045 -1.04031 1.323807 -1.062826 -1.478963 1.09797 0.640395
          [,8]      [,9]       [,10]    [,11]     [,12]     [,13]    [,14]
row5 -1.689891 0.8575996 -0.06636397 1.718144 0.9818964 0.7062615 0.373183
        [,15]     [,16]     [,17]     [,18]    [,19]      [,20]
row5 1.310032 0.2779403 0.6628524 0.7983881 1.624599 -0.1113537
> 
> 
> 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: 0x5f7b4099dd30>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMddaf77db7a30"
 [2] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMddaf4de2f041"
 [3] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMddafb3fd593" 
 [4] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMddaf6df4c5e3"
 [5] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMddaf62cf6eb2"
 [6] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMddaf2f30742d"
 [7] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMddaf52ca7006"
 [8] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMddaf58620ea" 
 [9] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMddaf598c3fcb"
[10] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMddaf1ccba03a"
[11] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMddaf5bd38b2e"
[12] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMddaf69acf109"
[13] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMddaf41bae2da"
[14] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMddaf1c15c568"
[15] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMddaf3cbdad97"
> 
> 
> ### 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: 0x5f7b40845f10>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x5f7b40845f10>
Warning message:
In dir.create(new.directory) :
  '/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x5f7b40845f10>
> rowMedians(tmp)
  [1] -0.4273820856 -0.4673007310  0.1966685489  0.3199084659 -0.1238696670
  [6]  0.3562152076 -0.1585621964 -0.2277955181  0.1668537152 -0.0738243391
 [11] -0.0655309579 -0.3716699286 -0.1388116789 -0.0382084333 -0.2406854426
 [16] -0.2435353019  0.5009185578 -0.0149681548 -0.2275841829 -0.5146352668
 [21]  0.0911871749  0.2137181899  0.2378030684 -0.4337071419 -0.1727492044
 [26]  0.0100629349 -0.3579937630 -0.4499698282  0.0632063104  0.2730285624
 [31] -0.0489083696  0.1329280621 -0.1288006008  0.6094186233  0.2750585032
 [36] -0.2651721487 -0.3242274703 -0.7150310796  0.3614606510  0.2405698763
 [41]  0.7535355685 -0.0929434352 -0.1462516253 -0.2446638716 -0.5027920620
 [46]  0.2434142627 -0.2742288414  0.1076504575  0.7439846545  0.2814304256
 [51] -0.3746757764  0.8656719930 -0.0391460907 -0.3601564239 -0.0833028036
 [56] -0.2017045841  0.3807754156  0.0202428985  0.0713121221  0.4201745081
 [61] -0.0578521980  0.7041063390 -0.3076831763 -0.3284987878  0.0433289180
 [66] -0.3148110865 -0.2908094834 -0.1649592936  0.0647215522 -0.0513304766
 [71]  0.4031962956  0.1192142691 -0.4376337189  0.3917553392  0.8573013919
 [76] -0.0955679020  0.0702318981  0.3701544516 -0.4713220140  0.0257408302
 [81] -0.0668948597 -0.0255725651  0.4286647326  0.0151989851 -0.1816908795
 [86]  0.1131551018  0.3690022810 -0.1248643958  0.1583472680  0.1460113713
 [91]  0.4481274283  0.1775731471 -0.1847927439 -0.1642061842  0.0398651951
 [96]  0.0994617517  0.4594239138  0.5007193512 -0.0840999872 -0.0558803130
[101]  0.2263230229  0.0735070707 -0.0170863329 -0.5091972627  0.0224037668
[106]  0.2635534422 -0.0875491583  0.2642314163 -0.2237667700 -0.2589338618
[111]  0.1232304201  0.4472550198 -0.1569795372  0.5339679126  0.6349053510
[116] -0.1419133553 -0.5135857716 -0.0986260967 -0.4388955223  0.2567900187
[121] -0.5466313370 -0.3361647606  0.0448633552  0.4218627637 -0.3768227743
[126]  0.1518453273  0.2030999503  0.2319020698 -0.2427545665  0.0238351974
[131] -0.1139027898  0.2888027695  0.1457161605 -0.0227549222  0.2392515131
[136]  0.3572999267 -0.0060329638  0.3881889808 -0.8132721514 -0.1092938253
[141] -0.8468950078 -0.2487008323  0.0544630529  0.5123607000 -0.0279637707
[146]  0.0206220981  0.4914041078 -0.0715014213  0.5180446474  0.3660300156
[151] -0.4111744794  0.3133452955  0.0822293391  0.2246715416 -0.2656018804
[156] -0.0475060987  0.4385255411  0.1192404039 -0.4142689791  0.0938920113
[161] -0.1680978824  0.0682824004  0.1108603010 -0.4648276661 -0.2339130838
[166]  0.2763607248  0.2940852694 -0.0050405877 -0.1890100178  0.0354917058
[171] -0.0279588057  0.7475653798 -0.1214374665 -0.1261214454  0.3922759495
[176]  0.2668200026 -0.3745180313 -0.2651671758 -0.3009332491  0.1322212962
[181] -0.2137844090 -0.1340322846 -0.0181348430  0.1754697882 -0.2994416080
[186]  0.1424220365 -0.1943530686 -0.0178003759 -0.6094794489 -0.2854748877
[191]  0.1158695488 -0.1025873999 -0.4167757147  0.2999018627 -0.3088484116
[196] -0.7522137411  0.0276457554  0.3895965008  0.0505241447 -0.3277962904
[201]  0.0362968558 -0.3033333547 -0.1167606424 -0.0199994540 -0.4533403905
[206]  0.1441354563  0.3015043666  0.1482074119  0.5709546519 -0.2333354879
[211] -0.1632346070  0.4493438564 -0.5453243171 -0.3984101517  0.2543989919
[216]  0.4002405545  0.0813201501  0.3576687498 -0.0007244837 -0.4226346483
[221] -0.2412723078  0.5388156509  0.5443679438  0.6223389660 -0.7864013499
[226] -0.0926734280  0.0215266475 -0.6180881467  0.3512023874  0.6982043627
> 
> proc.time()
   user  system elapsed 
  1.225   0.654   1.868 

BufferedMatrix.Rcheck/tests/rawCalltesting.Rout


R version 4.5.2 (2025-10-31) -- "[Not] Part in a Rumble"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(BufferedMatrix);library.dynam("BufferedMatrix","BufferedMatrix", .libPaths());

Attaching package: 'BufferedMatrix'

The following objects are masked from 'package:base':

    colMeans, colSums, rowMeans, rowSums

> 
> prefix <- "dbmtest"
> directory <- getwd()
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_Test_C",P)
RBufferedMatrix
Checking dimensions
Rows: 5
Cols: 5
Buffer Rows: 1
Buffer Cols: 1

Assigning Values
0.000000 1.000000 2.000000 3.000000 4.000000 
1.000000 2.000000 3.000000 4.000000 5.000000 
2.000000 3.000000 4.000000 5.000000 6.000000 
3.000000 4.000000 5.000000 6.000000 7.000000 
4.000000 5.000000 6.000000 7.000000 8.000000 

<pointer: 0x585ede9a71c0>
> .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: 0x585ede9a71c0>
> .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: 0x585ede9a71c0>
> .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: 0x585ede9a71c0>
> 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: 0x585edec8a120>
> .Call("R_bm_AddColumn",P)
<pointer: 0x585edec8a120>
> .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: 0x585edec8a120>
> .Call("R_bm_AddColumn",P)
<pointer: 0x585edec8a120>
> .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: 0x585edec8a120>
> 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: 0x585edd93e4a0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x585edd93e4a0>
> .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: 0x585edd93e4a0>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x585edd93e4a0>
> .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: 0x585edd93e4a0>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x585edd93e4a0>
> .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: 0x585edd93e4a0>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x585edd93e4a0>
> .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: 0x585edd93e4a0>
> 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: 0x585edd9da390>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x585edd9da390>
> .Call("R_bm_AddColumn",P)
<pointer: 0x585edd9da390>
> .Call("R_bm_AddColumn",P)
<pointer: 0x585edd9da390>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFilede4c2befe26e" "BufferedMatrixFilede4c5cf8bfb5"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFilede4c2befe26e" "BufferedMatrixFilede4c5cf8bfb5"
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x585edd8d13d0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x585edd8d13d0>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x585edd8d13d0>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x585edd8d13d0>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x585edd8d13d0>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x585edd8d13d0>
> .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: 0x585edf406fa0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x585edf406fa0>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x585edf406fa0>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x585edf406fa0>
> 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: 0x585edf9805d0>
> .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: 0x585edf9805d0>
> rm(P)
> 
> proc.time()
   user  system elapsed 
  0.242   0.044   0.277 

BufferedMatrix.Rcheck/tests/Rcodetesting.Rout


R version 4.5.2 (2025-10-31) -- "[Not] Part in a Rumble"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(BufferedMatrix);library.dynam("BufferedMatrix","BufferedMatrix", .libPaths());

Attaching package: 'BufferedMatrix'

The following objects are masked from 'package:base':

    colMeans, colSums, rowMeans, rowSums

> 
> Temp <- createBufferedMatrix(100)
> dim(Temp)
[1] 100   0
> buffer.dim(Temp)
[1] 1 1
> 
> 
> proc.time()
   user  system elapsed 
  0.248   0.044   0.281 

Example timings