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

This page was generated on 2025-12-04 11:34 -0500 (Thu, 04 Dec 2025).

HostnameOSArch (*)R versionInstalled pkgs
nebbiolo1Linux (Ubuntu 24.04.3 LTS)x86_64R Under development (unstable) (2025-10-20 r88955) -- "Unsuffered Consequences" 4869
kjohnson3macOS 13.7.7 Venturaarm64R Under development (unstable) (2025-11-04 r88984) -- "Unsuffered Consequences" 4576
Click on any hostname to see more info about the system (e.g. compilers)      (*) as reported by 'uname -p', except on Windows and Mac OS X

Package 253/2331HostnameOS / ArchINSTALLBUILDCHECKBUILD BIN
BufferedMatrix 1.75.0  (landing page)
Ben Bolstad
Snapshot Date: 2025-12-03 13:40 -0500 (Wed, 03 Dec 2025)
git_url: https://git.bioconductor.org/packages/BufferedMatrix
git_branch: devel
git_last_commit: ecdbf23
git_last_commit_date: 2025-10-29 09:58:55 -0500 (Wed, 29 Oct 2025)
nebbiolo1Linux (Ubuntu 24.04.3 LTS) / x86_64  OK    OK    OK  UNNEEDED, same version is already published
kjohnson3macOS 13.7.7 Ventura / arm64  OK    OK    WARNINGS    OK  UNNEEDED, same version is already published


CHECK results for BufferedMatrix on nebbiolo1

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

raw results


Summary

Package: BufferedMatrix
Version: 1.75.0
Command: /home/biocbuild/bbs-3.23-bioc/R/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/home/biocbuild/bbs-3.23-bioc/R/site-library --timings BufferedMatrix_1.75.0.tar.gz
StartedAt: 2025-12-03 22:21:28 -0500 (Wed, 03 Dec 2025)
EndedAt: 2025-12-03 22:27:36 -0500 (Wed, 03 Dec 2025)
EllapsedTime: 367.4 seconds
RetCode: 0
Status:   OK  
CheckDir: BufferedMatrix.Rcheck
Warnings: 0

Command output

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


* using log directory ‘/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck’
* using R Under development (unstable) (2025-10-20 r88955)
* 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.75.0’
* checking package namespace information ... OK
* checking package dependencies ...Warning: unable to access index for repository https://CRAN.R-project.org/src/contrib:
  cannot open URL 'https://CRAN.R-project.org/src/contrib/PACKAGES'
 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 ... INFO
Note: information on .o files is not available
* checking sizes of PDF files under ‘inst/doc’ ...* checking files in ‘vignettes’ ... OK
* checking examples ... NONE
* checking for unstated dependencies in ‘tests’ ... OK
* checking tests ...
  Running ‘Rcodetesting.R’
  Running ‘c_code_level_tests.R’
  Running ‘objectTesting.R’
  Running ‘rawCalltesting.R’
 OK
* checking for unstated dependencies in vignettes ... OK
* checking package vignettes ... OK
* checking re-building of vignette outputs ... OK
* checking PDF version of manual ... OK
* DONE

Status: 1 NOTE
See
  ‘/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/00check.log’
for details.


Installation output

BufferedMatrix.Rcheck/00install.out

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


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

Tests output

BufferedMatrix.Rcheck/tests/c_code_level_tests.Rout


R Under development (unstable) (2025-10-20 r88955) -- "Unsuffered Consequences"
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.218   0.059   0.266 

BufferedMatrix.Rcheck/tests/objectTesting.Rout


R Under development (unstable) (2025-10-20 r88955) -- "Unsuffered Consequences"
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.23-bioc/meat/BufferedMatrix.Rcheck/tests"
> prefix(tmp3)
[1] "BM"
> 
> ## testing if we can remove these objects
> rm(tmp, tmp2, tmp3)
> gc()
         used (Mb) gc trigger (Mb) max used (Mb)
Ncells 478818 25.6    1048392   56   639317 34.2
Vcells 885623  6.8    8388608   64  2082728 15.9
> 
> 
> 
> 
> ##
> ## checking reads
> ##
> 
> tmp2 <- createBufferedMatrix(10,20)
> 
> test.sample <- rnorm(10*20)
> 
> tmp2[1:10,1:20] <- test.sample
> 
> test.matrix <- matrix(test.sample,10,20)
> 
> ## testing reads
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   which.col <- sample(1:20,1)
+   if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> date()
[1] "Wed Dec  3 22:27:26 2025"
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> date()
[1] "Wed Dec  3 22:27:26 2025"
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,which.col] == test.matrix[which.row,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> 
> 
> RowMode(tmp2)
<pointer: 0x5f2d695305e0>
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   which.col <- sample(1:20,1)
+   if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,5,replace=TRUE)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> date()
[1] "Wed Dec  3 22:27:27 2025"
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col <- sample(1:20,5,replace=TRUE)
+   if (!all(tmp2[which.row,which.col] == test.matrix[which.row,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> date()
[1] "Wed Dec  3 22:27:27 2025"
> 
> ColMode(tmp2)
<pointer: 0x5f2d695305e0>
> 
> 
> 
> ### 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,] 100.406932 -1.946158881 -0.2578467 -0.2048731
[2,]   0.543905  0.007509849  1.4434362  2.3470484
[3,]   1.266334  1.698557283  0.5417278 -1.5157004
[4,]  -1.707623 -0.154157300 -0.6050116 -0.5678576
> ewApply(tmp5,abs)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
           [,1]        [,2]      [,3]      [,4]
[1,] 100.406932 1.946158881 0.2578467 0.2048731
[2,]   0.543905 0.007509849 1.4434362 2.3470484
[3,]   1.266334 1.698557283 0.5417278 1.5157004
[4,]   1.707623 0.154157300 0.6050116 0.5678576
> ewApply(tmp5,sqrt)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
           [,1]       [,2]      [,3]      [,4]
[1,] 10.0203259 1.39504799 0.5077860 0.4526291
[2,]  0.7374992 0.08665938 1.2014309 1.5320080
[3,]  1.1253150 1.30328711 0.7360216 1.2311378
[4,]  1.3067606 0.39262870 0.7778249 0.7535633
> 
> my.function <- function(x,power){
+   (x+5)^power
+ }
> 
> ewApply(tmp5,my.function,power=2)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
          [,1]     [,2]     [,3]     [,4]
[1,] 225.61019 40.89664 30.33571 29.73116
[2,]  32.91890 25.87410 38.45775 42.66713
[3,]  37.51948 39.73143 32.90194 38.82708
[4,]  39.77523 29.08044 33.38326 33.10349
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x5f2d690bb840>
> exp(tmp5)
<pointer: 0x5f2d690bb840>
> log(tmp5,2)
<pointer: 0x5f2d690bb840>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 469.5781
> Min(tmp5)
[1] 53.85356
> mean(tmp5)
[1] 73.71942
> Sum(tmp5)
[1] 14743.88
> Var(tmp5)
[1] 865.0642
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 89.59740 71.97951 74.88866 70.98140 73.78312 75.98319 70.01681 69.43630
 [9] 71.37935 69.14842
> rowSums(tmp5)
 [1] 1791.948 1439.590 1497.773 1419.628 1475.662 1519.664 1400.336 1388.726
 [9] 1427.587 1382.968
> rowVars(tmp5)
 [1] 8084.31974   61.75325   68.39148   54.98308   70.35927   68.04489
 [7]  111.95715   65.04523   58.64954   72.11132
> rowSd(tmp5)
 [1] 89.912845  7.858324  8.269914  7.415058  8.388043  8.248933 10.580981
 [8]  8.065062  7.658299  8.491839
> rowMax(tmp5)
 [1] 469.57805  88.80604  86.60064  82.78693  86.20550  88.17851  96.87657
 [8]  84.75686  87.86089  94.63311
> rowMin(tmp5)
 [1] 55.45011 53.85356 61.36974 57.03832 56.74715 63.30960 54.07706 56.05921
 [9] 59.71095 58.62509
> 
> colMeans(tmp5)
 [1] 112.31894  68.65121  71.61251  73.81668  70.09993  67.37568  75.10406
 [8]  71.12574  71.94213  71.07838  75.80191  68.96716  74.09973  72.52764
[15]  69.23787  73.57367  71.31613  72.89321  70.77911  72.06658
> colSums(tmp5)
 [1] 1123.1894  686.5121  716.1251  738.1668  700.9993  673.7568  751.0406
 [8]  711.2574  719.4213  710.7838  758.0191  689.6716  740.9973  725.2764
[15]  692.3787  735.7367  713.1613  728.9321  707.7911  720.6658
> colVars(tmp5)
 [1] 15851.77911   126.83678    57.69879    77.55467   117.67431    29.25362
 [7]    43.33195    50.61154    84.52969    97.30919    37.85172    37.91076
[13]   136.96237    53.18776    76.43378    66.67704   121.16387    94.49067
[19]    66.03529    57.34038
> colSd(tmp5)
 [1] 125.903849  11.262184   7.595972   8.806513  10.847779   5.408662
 [7]   6.582701   7.114179   9.194003   9.864542   6.152375   6.157172
[13]  11.703092   7.292994   8.742641   8.165601  11.007446   9.720631
[19]   8.126210   7.572343
> colMax(tmp5)
 [1] 469.57805  85.12100  88.17851  88.80604  86.60064  75.14030  85.32782
 [8]  79.03358  85.39455  94.63311  84.40255  76.83163  91.90493  86.20550
[15]  82.43728  85.00304  96.87657  87.93165  84.25811  81.65829
> colMin(tmp5)
 [1] 57.05669 53.85356 63.13980 61.88152 54.07706 59.96333 63.62657 58.70743
 [9] 57.61242 59.13704 66.18322 57.03832 58.17411 62.21324 59.56826 61.95905
[17] 58.62509 55.45011 62.41352 56.05921
> 
> 
> ### setting a random element to NA and then testing with na.rm=TRUE or na.rm=FALSE (The default)
> 
> 
> which.row <- sample(1:10,1,replace=TRUE)
> which.col  <- sample(1:20,1,replace=TRUE)
> 
> tmp5[which.row,which.col] <- NA
> 
> Max(tmp5)
[1] NA
> Min(tmp5)
[1] NA
> mean(tmp5)
[1] NA
> Sum(tmp5)
[1] NA
> Var(tmp5)
[1] NA
> 
> rowMeans(tmp5)
 [1] 89.59740       NA 74.88866 70.98140 73.78312 75.98319 70.01681 69.43630
 [9] 71.37935 69.14842
> rowSums(tmp5)
 [1] 1791.948       NA 1497.773 1419.628 1475.662 1519.664 1400.336 1388.726
 [9] 1427.587 1382.968
> rowVars(tmp5)
 [1] 8084.31974   60.51265   68.39148   54.98308   70.35927   68.04489
 [7]  111.95715   65.04523   58.64954   72.11132
> rowSd(tmp5)
 [1] 89.912845  7.778988  8.269914  7.415058  8.388043  8.248933 10.580981
 [8]  8.065062  7.658299  8.491839
> rowMax(tmp5)
 [1] 469.57805        NA  86.60064  82.78693  86.20550  88.17851  96.87657
 [8]  84.75686  87.86089  94.63311
> rowMin(tmp5)
 [1] 55.45011       NA 61.36974 57.03832 56.74715 63.30960 54.07706 56.05921
 [9] 59.71095 58.62509
> 
> colMeans(tmp5)
 [1] 112.31894  68.65121  71.61251  73.81668  70.09993  67.37568  75.10406
 [8]  71.12574  71.94213  71.07838  75.80191  68.96716        NA  72.52764
[15]  69.23787  73.57367  71.31613  72.89321  70.77911  72.06658
> colSums(tmp5)
 [1] 1123.1894  686.5121  716.1251  738.1668  700.9993  673.7568  751.0406
 [8]  711.2574  719.4213  710.7838  758.0191  689.6716        NA  725.2764
[15]  692.3787  735.7367  713.1613  728.9321  707.7911  720.6658
> colVars(tmp5)
 [1] 15851.77911   126.83678    57.69879    77.55467   117.67431    29.25362
 [7]    43.33195    50.61154    84.52969    97.30919    37.85172    37.91076
[13]          NA    53.18776    76.43378    66.67704   121.16387    94.49067
[19]    66.03529    57.34038
> colSd(tmp5)
 [1] 125.903849  11.262184   7.595972   8.806513  10.847779   5.408662
 [7]   6.582701   7.114179   9.194003   9.864542   6.152375   6.157172
[13]         NA   7.292994   8.742641   8.165601  11.007446   9.720631
[19]   8.126210   7.572343
> colMax(tmp5)
 [1] 469.57805  85.12100  88.17851  88.80604  86.60064  75.14030  85.32782
 [8]  79.03358  85.39455  94.63311  84.40255  76.83163        NA  86.20550
[15]  82.43728  85.00304  96.87657  87.93165  84.25811  81.65829
> colMin(tmp5)
 [1] 57.05669 53.85356 63.13980 61.88152 54.07706 59.96333 63.62657 58.70743
 [9] 57.61242 59.13704 66.18322 57.03832       NA 62.21324 59.56826 61.95905
[17] 58.62509 55.45011 62.41352 56.05921
> 
> Max(tmp5,na.rm=TRUE)
[1] 469.5781
> Min(tmp5,na.rm=TRUE)
[1] 53.85356
> mean(tmp5,na.rm=TRUE)
[1] 73.68325
> Sum(tmp5,na.rm=TRUE)
[1] 14662.97
> Var(tmp5,na.rm=TRUE)
[1] 869.1702
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 89.59740 71.50911 74.88866 70.98140 73.78312 75.98319 70.01681 69.43630
 [9] 71.37935 69.14842
> rowSums(tmp5,na.rm=TRUE)
 [1] 1791.948 1358.673 1497.773 1419.628 1475.662 1519.664 1400.336 1388.726
 [9] 1427.587 1382.968
> rowVars(tmp5,na.rm=TRUE)
 [1] 8084.31974   60.51265   68.39148   54.98308   70.35927   68.04489
 [7]  111.95715   65.04523   58.64954   72.11132
> rowSd(tmp5,na.rm=TRUE)
 [1] 89.912845  7.778988  8.269914  7.415058  8.388043  8.248933 10.580981
 [8]  8.065062  7.658299  8.491839
> rowMax(tmp5,na.rm=TRUE)
 [1] 469.57805  88.80604  86.60064  82.78693  86.20550  88.17851  96.87657
 [8]  84.75686  87.86089  94.63311
> rowMin(tmp5,na.rm=TRUE)
 [1] 55.45011 53.85356 61.36974 57.03832 56.74715 63.30960 54.07706 56.05921
 [9] 59.71095 58.62509
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 112.31894  68.65121  71.61251  73.81668  70.09993  67.37568  75.10406
 [8]  71.12574  71.94213  71.07838  75.80191  68.96716  73.34225  72.52764
[15]  69.23787  73.57367  71.31613  72.89321  70.77911  72.06658
> colSums(tmp5,na.rm=TRUE)
 [1] 1123.1894  686.5121  716.1251  738.1668  700.9993  673.7568  751.0406
 [8]  711.2574  719.4213  710.7838  758.0191  689.6716  660.0802  725.2764
[15]  692.3787  735.7367  713.1613  728.9321  707.7911  720.6658
> colVars(tmp5,na.rm=TRUE)
 [1] 15851.77911   126.83678    57.69879    77.55467   117.67431    29.25362
 [7]    43.33195    50.61154    84.52969    97.30919    37.85172    37.91076
[13]   147.62766    53.18776    76.43378    66.67704   121.16387    94.49067
[19]    66.03529    57.34038
> colSd(tmp5,na.rm=TRUE)
 [1] 125.903849  11.262184   7.595972   8.806513  10.847779   5.408662
 [7]   6.582701   7.114179   9.194003   9.864542   6.152375   6.157172
[13]  12.150212   7.292994   8.742641   8.165601  11.007446   9.720631
[19]   8.126210   7.572343
> colMax(tmp5,na.rm=TRUE)
 [1] 469.57805  85.12100  88.17851  88.80604  86.60064  75.14030  85.32782
 [8]  79.03358  85.39455  94.63311  84.40255  76.83163  91.90493  86.20550
[15]  82.43728  85.00304  96.87657  87.93165  84.25811  81.65829
> colMin(tmp5,na.rm=TRUE)
 [1] 57.05669 53.85356 63.13980 61.88152 54.07706 59.96333 63.62657 58.70743
 [9] 57.61242 59.13704 66.18322 57.03832 58.17411 62.21324 59.56826 61.95905
[17] 58.62509 55.45011 62.41352 56.05921
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1] 89.59740      NaN 74.88866 70.98140 73.78312 75.98319 70.01681 69.43630
 [9] 71.37935 69.14842
> rowSums(tmp5,na.rm=TRUE)
 [1] 1791.948    0.000 1497.773 1419.628 1475.662 1519.664 1400.336 1388.726
 [9] 1427.587 1382.968
> rowVars(tmp5,na.rm=TRUE)
 [1] 8084.31974         NA   68.39148   54.98308   70.35927   68.04489
 [7]  111.95715   65.04523   58.64954   72.11132
> rowSd(tmp5,na.rm=TRUE)
 [1] 89.912845        NA  8.269914  7.415058  8.388043  8.248933 10.580981
 [8]  8.065062  7.658299  8.491839
> rowMax(tmp5,na.rm=TRUE)
 [1] 469.57805        NA  86.60064  82.78693  86.20550  88.17851  96.87657
 [8]  84.75686  87.86089  94.63311
> rowMin(tmp5,na.rm=TRUE)
 [1] 55.45011       NA 61.36974 57.03832 56.74715 63.30960 54.07706 56.05921
 [9] 59.71095 58.62509
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1] 117.18590  70.29540  70.67559  72.15120  69.67436  67.46726  75.35991
 [8]  71.41181  70.68007  70.71916  75.67787  68.09333       NaN  72.79533
[15]  69.34419  74.86418  71.85763  73.21940  71.16756  72.27237
> colSums(tmp5,na.rm=TRUE)
 [1] 1054.6731  632.6586  636.0804  649.3608  627.0692  607.2054  678.2392
 [8]  642.7063  636.1206  636.4724  681.1009  612.8400    0.0000  655.1580
[15]  624.0977  673.7777  646.7186  658.9746  640.5080  650.4513
> colVars(tmp5,na.rm=TRUE)
 [1] 17566.77018   112.27879    55.03575    56.04335   130.34605    32.81597
 [7]    48.01202    56.01732    77.17685   108.02112    42.41010    34.05935
[13]          NA    59.03008    85.86084    56.27565   133.01063   105.10503
[19]    72.59221    64.03151
> colSd(tmp5,na.rm=TRUE)
 [1] 132.539693  10.596169   7.418608   7.486211  11.416920   5.728522
 [7]   6.929070   7.484472   8.785036  10.393321   6.512304   5.836039
[13]         NA   7.683103   9.266113   7.501710  11.533023  10.252075
[19]   8.520106   8.001969
> colMax(tmp5,na.rm=TRUE)
 [1] 469.57805  85.12100  88.17851  83.77858  86.60064  75.14030  85.32782
 [8]  79.03358  85.39455  94.63311  84.40255  74.77328      -Inf  86.20550
[15]  82.43728  85.00304  96.87657  87.93165  84.25811  81.65829
> colMin(tmp5,na.rm=TRUE)
 [1] 57.05669 56.74715 63.13980 61.88152 54.07706 59.96333 63.62657 58.70743
 [9] 57.61242 59.13704 66.18322 57.03832      Inf 62.21324 59.56826 62.78800
[17] 58.62509 55.45011 62.41352 56.05921
> 
> 
> 
> 
> 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] 427.3141 189.8295 213.1093 222.7387 298.1655 448.6719 293.8157 289.4083
 [9] 352.5315 180.5018
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 427.3141 189.8295 213.1093 222.7387 298.1655 448.6719 293.8157 289.4083
 [9] 352.5315 180.5018
> 
> 
> 
> 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]  0.000000e+00  1.421085e-13 -5.684342e-14  0.000000e+00  0.000000e+00
 [6]  5.684342e-14 -1.136868e-13  2.842171e-14 -2.842171e-14 -5.684342e-14
[11]  2.842171e-14  1.421085e-14 -5.684342e-14 -2.842171e-14 -5.684342e-14
[16] -8.526513e-14 -2.842171e-14  5.684342e-14  1.136868e-13  1.136868e-13
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> ## 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)
+ }
9   13 
10   20 
1   10 
10   3 
2   10 
3   20 
3   1 
3   15 
8   20 
1   13 
3   17 
10   14 
6   14 
7   1 
1   17 
8   4 
5   15 
1   14 
8   1 
9   1 
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.295762
> Min(tmp)
[1] -1.94776
> mean(tmp)
[1] 0.0618912
> Sum(tmp)
[1] 6.18912
> Var(tmp)
[1] 0.9181538
> 
> rowMeans(tmp)
[1] 0.0618912
> rowSums(tmp)
[1] 6.18912
> rowVars(tmp)
[1] 0.9181538
> rowSd(tmp)
[1] 0.9582034
> rowMax(tmp)
[1] 2.295762
> rowMin(tmp)
[1] -1.94776
> 
> colMeans(tmp)
  [1]  0.887563158  0.590753891 -1.601998770 -1.947760295  0.651947451
  [6]  0.237578568  1.168884044  1.389150551  1.263743384 -0.186013175
 [11]  0.121478856  0.250574298  0.616727085  1.195065792 -0.388301133
 [16]  0.115457154 -1.894119578  0.522438245  1.344209757 -1.428272481
 [21]  0.220404832 -0.858456660 -1.135395495  2.242944353 -0.314613454
 [26] -0.236037614  0.942326109  0.713979026 -1.345150289 -1.757811936
 [31]  0.589913292  0.344259167 -0.149858069  1.937928927 -0.042241567
 [36]  0.376553915  0.510032778  0.247005146  0.736583820  0.565367480
 [41]  1.504850169  1.018111123 -1.466291621  0.452105922  0.508723925
 [46]  1.824071313 -1.249873221 -1.140636943  0.493912048 -1.088940895
 [51] -0.177408133  0.067435664  0.385972059  1.144465947 -0.305042867
 [56] -0.457822800 -0.009359083 -1.090114609 -1.633132176 -1.343828303
 [61]  0.654852142 -0.216381317  0.283696189  0.064199668  0.447011895
 [66]  0.875462650 -1.250031467 -0.075558614  0.665551291  0.117916397
 [71] -1.016939530 -0.245733026 -1.075901695 -0.022733187 -0.056822105
 [76] -0.154464996 -0.470756147 -0.670204803  1.648117525 -0.663077230
 [81]  0.558267895  0.099073417 -0.196049112 -0.643261447  2.295761946
 [86]  0.202959994 -0.357531554 -1.053074792  2.142133142 -0.273022777
 [91]  0.965428893 -0.871578654  1.030135383 -0.525899525 -0.817421425
 [96]  1.025423780 -0.814176329 -0.429475055 -0.040069697  1.119254155
> colSums(tmp)
  [1]  0.887563158  0.590753891 -1.601998770 -1.947760295  0.651947451
  [6]  0.237578568  1.168884044  1.389150551  1.263743384 -0.186013175
 [11]  0.121478856  0.250574298  0.616727085  1.195065792 -0.388301133
 [16]  0.115457154 -1.894119578  0.522438245  1.344209757 -1.428272481
 [21]  0.220404832 -0.858456660 -1.135395495  2.242944353 -0.314613454
 [26] -0.236037614  0.942326109  0.713979026 -1.345150289 -1.757811936
 [31]  0.589913292  0.344259167 -0.149858069  1.937928927 -0.042241567
 [36]  0.376553915  0.510032778  0.247005146  0.736583820  0.565367480
 [41]  1.504850169  1.018111123 -1.466291621  0.452105922  0.508723925
 [46]  1.824071313 -1.249873221 -1.140636943  0.493912048 -1.088940895
 [51] -0.177408133  0.067435664  0.385972059  1.144465947 -0.305042867
 [56] -0.457822800 -0.009359083 -1.090114609 -1.633132176 -1.343828303
 [61]  0.654852142 -0.216381317  0.283696189  0.064199668  0.447011895
 [66]  0.875462650 -1.250031467 -0.075558614  0.665551291  0.117916397
 [71] -1.016939530 -0.245733026 -1.075901695 -0.022733187 -0.056822105
 [76] -0.154464996 -0.470756147 -0.670204803  1.648117525 -0.663077230
 [81]  0.558267895  0.099073417 -0.196049112 -0.643261447  2.295761946
 [86]  0.202959994 -0.357531554 -1.053074792  2.142133142 -0.273022777
 [91]  0.965428893 -0.871578654  1.030135383 -0.525899525 -0.817421425
 [96]  1.025423780 -0.814176329 -0.429475055 -0.040069697  1.119254155
> 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.887563158  0.590753891 -1.601998770 -1.947760295  0.651947451
  [6]  0.237578568  1.168884044  1.389150551  1.263743384 -0.186013175
 [11]  0.121478856  0.250574298  0.616727085  1.195065792 -0.388301133
 [16]  0.115457154 -1.894119578  0.522438245  1.344209757 -1.428272481
 [21]  0.220404832 -0.858456660 -1.135395495  2.242944353 -0.314613454
 [26] -0.236037614  0.942326109  0.713979026 -1.345150289 -1.757811936
 [31]  0.589913292  0.344259167 -0.149858069  1.937928927 -0.042241567
 [36]  0.376553915  0.510032778  0.247005146  0.736583820  0.565367480
 [41]  1.504850169  1.018111123 -1.466291621  0.452105922  0.508723925
 [46]  1.824071313 -1.249873221 -1.140636943  0.493912048 -1.088940895
 [51] -0.177408133  0.067435664  0.385972059  1.144465947 -0.305042867
 [56] -0.457822800 -0.009359083 -1.090114609 -1.633132176 -1.343828303
 [61]  0.654852142 -0.216381317  0.283696189  0.064199668  0.447011895
 [66]  0.875462650 -1.250031467 -0.075558614  0.665551291  0.117916397
 [71] -1.016939530 -0.245733026 -1.075901695 -0.022733187 -0.056822105
 [76] -0.154464996 -0.470756147 -0.670204803  1.648117525 -0.663077230
 [81]  0.558267895  0.099073417 -0.196049112 -0.643261447  2.295761946
 [86]  0.202959994 -0.357531554 -1.053074792  2.142133142 -0.273022777
 [91]  0.965428893 -0.871578654  1.030135383 -0.525899525 -0.817421425
 [96]  1.025423780 -0.814176329 -0.429475055 -0.040069697  1.119254155
> colMin(tmp)
  [1]  0.887563158  0.590753891 -1.601998770 -1.947760295  0.651947451
  [6]  0.237578568  1.168884044  1.389150551  1.263743384 -0.186013175
 [11]  0.121478856  0.250574298  0.616727085  1.195065792 -0.388301133
 [16]  0.115457154 -1.894119578  0.522438245  1.344209757 -1.428272481
 [21]  0.220404832 -0.858456660 -1.135395495  2.242944353 -0.314613454
 [26] -0.236037614  0.942326109  0.713979026 -1.345150289 -1.757811936
 [31]  0.589913292  0.344259167 -0.149858069  1.937928927 -0.042241567
 [36]  0.376553915  0.510032778  0.247005146  0.736583820  0.565367480
 [41]  1.504850169  1.018111123 -1.466291621  0.452105922  0.508723925
 [46]  1.824071313 -1.249873221 -1.140636943  0.493912048 -1.088940895
 [51] -0.177408133  0.067435664  0.385972059  1.144465947 -0.305042867
 [56] -0.457822800 -0.009359083 -1.090114609 -1.633132176 -1.343828303
 [61]  0.654852142 -0.216381317  0.283696189  0.064199668  0.447011895
 [66]  0.875462650 -1.250031467 -0.075558614  0.665551291  0.117916397
 [71] -1.016939530 -0.245733026 -1.075901695 -0.022733187 -0.056822105
 [76] -0.154464996 -0.470756147 -0.670204803  1.648117525 -0.663077230
 [81]  0.558267895  0.099073417 -0.196049112 -0.643261447  2.295761946
 [86]  0.202959994 -0.357531554 -1.053074792  2.142133142 -0.273022777
 [91]  0.965428893 -0.871578654  1.030135383 -0.525899525 -0.817421425
 [96]  1.025423780 -0.814176329 -0.429475055 -0.040069697  1.119254155
> colMedians(tmp)
  [1]  0.887563158  0.590753891 -1.601998770 -1.947760295  0.651947451
  [6]  0.237578568  1.168884044  1.389150551  1.263743384 -0.186013175
 [11]  0.121478856  0.250574298  0.616727085  1.195065792 -0.388301133
 [16]  0.115457154 -1.894119578  0.522438245  1.344209757 -1.428272481
 [21]  0.220404832 -0.858456660 -1.135395495  2.242944353 -0.314613454
 [26] -0.236037614  0.942326109  0.713979026 -1.345150289 -1.757811936
 [31]  0.589913292  0.344259167 -0.149858069  1.937928927 -0.042241567
 [36]  0.376553915  0.510032778  0.247005146  0.736583820  0.565367480
 [41]  1.504850169  1.018111123 -1.466291621  0.452105922  0.508723925
 [46]  1.824071313 -1.249873221 -1.140636943  0.493912048 -1.088940895
 [51] -0.177408133  0.067435664  0.385972059  1.144465947 -0.305042867
 [56] -0.457822800 -0.009359083 -1.090114609 -1.633132176 -1.343828303
 [61]  0.654852142 -0.216381317  0.283696189  0.064199668  0.447011895
 [66]  0.875462650 -1.250031467 -0.075558614  0.665551291  0.117916397
 [71] -1.016939530 -0.245733026 -1.075901695 -0.022733187 -0.056822105
 [76] -0.154464996 -0.470756147 -0.670204803  1.648117525 -0.663077230
 [81]  0.558267895  0.099073417 -0.196049112 -0.643261447  2.295761946
 [86]  0.202959994 -0.357531554 -1.053074792  2.142133142 -0.273022777
 [91]  0.965428893 -0.871578654  1.030135383 -0.525899525 -0.817421425
 [96]  1.025423780 -0.814176329 -0.429475055 -0.040069697  1.119254155
> colRanges(tmp)
          [,1]      [,2]      [,3]     [,4]      [,5]      [,6]     [,7]
[1,] 0.8875632 0.5907539 -1.601999 -1.94776 0.6519475 0.2375786 1.168884
[2,] 0.8875632 0.5907539 -1.601999 -1.94776 0.6519475 0.2375786 1.168884
         [,8]     [,9]      [,10]     [,11]     [,12]     [,13]    [,14]
[1,] 1.389151 1.263743 -0.1860132 0.1214789 0.2505743 0.6167271 1.195066
[2,] 1.389151 1.263743 -0.1860132 0.1214789 0.2505743 0.6167271 1.195066
          [,15]     [,16]    [,17]     [,18]   [,19]     [,20]     [,21]
[1,] -0.3883011 0.1154572 -1.89412 0.5224382 1.34421 -1.428272 0.2204048
[2,] -0.3883011 0.1154572 -1.89412 0.5224382 1.34421 -1.428272 0.2204048
          [,22]     [,23]    [,24]      [,25]      [,26]     [,27]    [,28]
[1,] -0.8584567 -1.135395 2.242944 -0.3146135 -0.2360376 0.9423261 0.713979
[2,] -0.8584567 -1.135395 2.242944 -0.3146135 -0.2360376 0.9423261 0.713979
        [,29]     [,30]     [,31]     [,32]      [,33]    [,34]       [,35]
[1,] -1.34515 -1.757812 0.5899133 0.3442592 -0.1498581 1.937929 -0.04224157
[2,] -1.34515 -1.757812 0.5899133 0.3442592 -0.1498581 1.937929 -0.04224157
         [,36]     [,37]     [,38]     [,39]     [,40]   [,41]    [,42]
[1,] 0.3765539 0.5100328 0.2470051 0.7365838 0.5653675 1.50485 1.018111
[2,] 0.3765539 0.5100328 0.2470051 0.7365838 0.5653675 1.50485 1.018111
         [,43]     [,44]     [,45]    [,46]     [,47]     [,48]    [,49]
[1,] -1.466292 0.4521059 0.5087239 1.824071 -1.249873 -1.140637 0.493912
[2,] -1.466292 0.4521059 0.5087239 1.824071 -1.249873 -1.140637 0.493912
         [,50]      [,51]      [,52]     [,53]    [,54]      [,55]      [,56]
[1,] -1.088941 -0.1774081 0.06743566 0.3859721 1.144466 -0.3050429 -0.4578228
[2,] -1.088941 -0.1774081 0.06743566 0.3859721 1.144466 -0.3050429 -0.4578228
            [,57]     [,58]     [,59]     [,60]     [,61]      [,62]     [,63]
[1,] -0.009359083 -1.090115 -1.633132 -1.343828 0.6548521 -0.2163813 0.2836962
[2,] -0.009359083 -1.090115 -1.633132 -1.343828 0.6548521 -0.2163813 0.2836962
          [,64]     [,65]     [,66]     [,67]       [,68]     [,69]     [,70]
[1,] 0.06419967 0.4470119 0.8754626 -1.250031 -0.07555861 0.6655513 0.1179164
[2,] 0.06419967 0.4470119 0.8754626 -1.250031 -0.07555861 0.6655513 0.1179164
        [,71]     [,72]     [,73]       [,74]       [,75]     [,76]      [,77]
[1,] -1.01694 -0.245733 -1.075902 -0.02273319 -0.05682211 -0.154465 -0.4707561
[2,] -1.01694 -0.245733 -1.075902 -0.02273319 -0.05682211 -0.154465 -0.4707561
          [,78]    [,79]      [,80]     [,81]      [,82]      [,83]      [,84]
[1,] -0.6702048 1.648118 -0.6630772 0.5582679 0.09907342 -0.1960491 -0.6432614
[2,] -0.6702048 1.648118 -0.6630772 0.5582679 0.09907342 -0.1960491 -0.6432614
        [,85]   [,86]      [,87]     [,88]    [,89]      [,90]     [,91]
[1,] 2.295762 0.20296 -0.3575316 -1.053075 2.142133 -0.2730228 0.9654289
[2,] 2.295762 0.20296 -0.3575316 -1.053075 2.142133 -0.2730228 0.9654289
          [,92]    [,93]      [,94]      [,95]    [,96]      [,97]      [,98]
[1,] -0.8715787 1.030135 -0.5258995 -0.8174214 1.025424 -0.8141763 -0.4294751
[2,] -0.8715787 1.030135 -0.5258995 -0.8174214 1.025424 -0.8141763 -0.4294751
          [,99]   [,100]
[1,] -0.0400697 1.119254
[2,] -0.0400697 1.119254
> 
> 
> Max(tmp2)
[1] 2.175428
> Min(tmp2)
[1] -3.283337
> mean(tmp2)
[1] -0.04574249
> Sum(tmp2)
[1] -4.574249
> Var(tmp2)
[1] 1.03764
> 
> rowMeans(tmp2)
  [1] -2.098985575 -1.068107304 -0.040522163 -0.962720102 -1.628424094
  [6]  0.716731253  1.326324986 -1.795253560  0.160578888  1.316005701
 [11] -0.004304676 -0.543550567 -0.970557002 -1.034224769 -1.866277942
 [16]  1.691660585 -0.012626182 -0.424164655 -0.340940255 -1.076337492
 [21]  1.358000122  0.688324172  0.785653217  1.201145503 -0.535169484
 [26]  0.535194968 -0.206800620  0.761806010  0.862604354  0.178437187
 [31]  0.269598676 -0.497648762 -0.958529040  0.530507141  2.175428274
 [36] -0.920857444 -0.560680618  0.835773840  0.577857976  0.588463130
 [41] -0.536340205  1.091406838  1.172851595 -3.283337040 -1.188851636
 [46]  0.217540846 -0.173035297 -0.389401801  0.470931404  0.208099640
 [51]  1.134903752  0.201947520 -1.081145861 -3.073561638 -0.534398377
 [56]  0.799645213  0.385753817  1.349448062  0.512525285 -2.273944471
 [61]  1.230148364 -0.007284796  0.655349121 -0.726892885  0.771667055
 [66]  0.216932204  0.059530675 -0.010567961  0.681749737 -0.830844744
 [71]  0.290014438  0.064788375 -1.524169759 -1.283630790 -0.764343399
 [76] -0.266841767  0.709707352 -1.202076957  0.416825006 -0.106058619
 [81]  0.751703545  0.064143531  0.671290693  0.430703153 -1.409894276
 [86] -0.370744470 -1.566792338 -0.921478381 -0.872250379  1.271436194
 [91]  1.499765725 -0.127540972  0.498983200 -0.551211864  0.427554774
 [96]  0.813178272  0.271116244  0.952791820  0.606553993  0.587990713
> rowSums(tmp2)
  [1] -2.098985575 -1.068107304 -0.040522163 -0.962720102 -1.628424094
  [6]  0.716731253  1.326324986 -1.795253560  0.160578888  1.316005701
 [11] -0.004304676 -0.543550567 -0.970557002 -1.034224769 -1.866277942
 [16]  1.691660585 -0.012626182 -0.424164655 -0.340940255 -1.076337492
 [21]  1.358000122  0.688324172  0.785653217  1.201145503 -0.535169484
 [26]  0.535194968 -0.206800620  0.761806010  0.862604354  0.178437187
 [31]  0.269598676 -0.497648762 -0.958529040  0.530507141  2.175428274
 [36] -0.920857444 -0.560680618  0.835773840  0.577857976  0.588463130
 [41] -0.536340205  1.091406838  1.172851595 -3.283337040 -1.188851636
 [46]  0.217540846 -0.173035297 -0.389401801  0.470931404  0.208099640
 [51]  1.134903752  0.201947520 -1.081145861 -3.073561638 -0.534398377
 [56]  0.799645213  0.385753817  1.349448062  0.512525285 -2.273944471
 [61]  1.230148364 -0.007284796  0.655349121 -0.726892885  0.771667055
 [66]  0.216932204  0.059530675 -0.010567961  0.681749737 -0.830844744
 [71]  0.290014438  0.064788375 -1.524169759 -1.283630790 -0.764343399
 [76] -0.266841767  0.709707352 -1.202076957  0.416825006 -0.106058619
 [81]  0.751703545  0.064143531  0.671290693  0.430703153 -1.409894276
 [86] -0.370744470 -1.566792338 -0.921478381 -0.872250379  1.271436194
 [91]  1.499765725 -0.127540972  0.498983200 -0.551211864  0.427554774
 [96]  0.813178272  0.271116244  0.952791820  0.606553993  0.587990713
> rowVars(tmp2)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowSd(tmp2)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowMax(tmp2)
  [1] -2.098985575 -1.068107304 -0.040522163 -0.962720102 -1.628424094
  [6]  0.716731253  1.326324986 -1.795253560  0.160578888  1.316005701
 [11] -0.004304676 -0.543550567 -0.970557002 -1.034224769 -1.866277942
 [16]  1.691660585 -0.012626182 -0.424164655 -0.340940255 -1.076337492
 [21]  1.358000122  0.688324172  0.785653217  1.201145503 -0.535169484
 [26]  0.535194968 -0.206800620  0.761806010  0.862604354  0.178437187
 [31]  0.269598676 -0.497648762 -0.958529040  0.530507141  2.175428274
 [36] -0.920857444 -0.560680618  0.835773840  0.577857976  0.588463130
 [41] -0.536340205  1.091406838  1.172851595 -3.283337040 -1.188851636
 [46]  0.217540846 -0.173035297 -0.389401801  0.470931404  0.208099640
 [51]  1.134903752  0.201947520 -1.081145861 -3.073561638 -0.534398377
 [56]  0.799645213  0.385753817  1.349448062  0.512525285 -2.273944471
 [61]  1.230148364 -0.007284796  0.655349121 -0.726892885  0.771667055
 [66]  0.216932204  0.059530675 -0.010567961  0.681749737 -0.830844744
 [71]  0.290014438  0.064788375 -1.524169759 -1.283630790 -0.764343399
 [76] -0.266841767  0.709707352 -1.202076957  0.416825006 -0.106058619
 [81]  0.751703545  0.064143531  0.671290693  0.430703153 -1.409894276
 [86] -0.370744470 -1.566792338 -0.921478381 -0.872250379  1.271436194
 [91]  1.499765725 -0.127540972  0.498983200 -0.551211864  0.427554774
 [96]  0.813178272  0.271116244  0.952791820  0.606553993  0.587990713
> rowMin(tmp2)
  [1] -2.098985575 -1.068107304 -0.040522163 -0.962720102 -1.628424094
  [6]  0.716731253  1.326324986 -1.795253560  0.160578888  1.316005701
 [11] -0.004304676 -0.543550567 -0.970557002 -1.034224769 -1.866277942
 [16]  1.691660585 -0.012626182 -0.424164655 -0.340940255 -1.076337492
 [21]  1.358000122  0.688324172  0.785653217  1.201145503 -0.535169484
 [26]  0.535194968 -0.206800620  0.761806010  0.862604354  0.178437187
 [31]  0.269598676 -0.497648762 -0.958529040  0.530507141  2.175428274
 [36] -0.920857444 -0.560680618  0.835773840  0.577857976  0.588463130
 [41] -0.536340205  1.091406838  1.172851595 -3.283337040 -1.188851636
 [46]  0.217540846 -0.173035297 -0.389401801  0.470931404  0.208099640
 [51]  1.134903752  0.201947520 -1.081145861 -3.073561638 -0.534398377
 [56]  0.799645213  0.385753817  1.349448062  0.512525285 -2.273944471
 [61]  1.230148364 -0.007284796  0.655349121 -0.726892885  0.771667055
 [66]  0.216932204  0.059530675 -0.010567961  0.681749737 -0.830844744
 [71]  0.290014438  0.064788375 -1.524169759 -1.283630790 -0.764343399
 [76] -0.266841767  0.709707352 -1.202076957  0.416825006 -0.106058619
 [81]  0.751703545  0.064143531  0.671290693  0.430703153 -1.409894276
 [86] -0.370744470 -1.566792338 -0.921478381 -0.872250379  1.271436194
 [91]  1.499765725 -0.127540972  0.498983200 -0.551211864  0.427554774
 [96]  0.813178272  0.271116244  0.952791820  0.606553993  0.587990713
> 
> colMeans(tmp2)
[1] -0.04574249
> colSums(tmp2)
[1] -4.574249
> colVars(tmp2)
[1] 1.03764
> colSd(tmp2)
[1] 1.018646
> colMax(tmp2)
[1] 2.175428
> colMin(tmp2)
[1] -3.283337
> colMedians(tmp2)
[1] 0.1126836
> colRanges(tmp2)
          [,1]
[1,] -3.283337
[2,]  2.175428
> 
> dataset1 <- matrix(dataset1,1,100)
> 
> agree.checks(tmp,dataset1)
> 
> dataset2 <- matrix(dataset2,100,1)
> agree.checks(tmp2,dataset2)
>   
> 
> tmp <- createBufferedMatrix(10,10)
> 
> tmp[1:10,1:10] <- rnorm(100)
> colApply(tmp,sum)
 [1] -0.7953404 -5.1595607 -1.9146883  3.8430364  2.0398629  0.9824971
 [7] -2.0726937  3.6871695  3.2842597  2.0560357
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -0.8374553
[2,] -0.5332860
[3,] -0.3746132
[4,]  0.4929790
[5,]  1.1630149
> 
> rowApply(tmp,sum)
 [1] -3.0581868 -0.2571650  5.0477836  6.7438995  1.5129046  0.8371021
 [7] -0.7362609 -2.9497103  3.2103882 -4.4001772
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]   10    9    2    2   10    3    3    3    4     5
 [2,]    9    8    1    3    5    4    1    1    5     1
 [3,]    7    4   10    9    4    1    4    2    1     2
 [4,]    8    6    5    4    8    6   10    7    8     4
 [5,]    1    5    6    8    6    7    2    6    7    10
 [6,]    4    3    3    5    1    8    9    9    9     7
 [7,]    3    1    7   10    3    2    6    5    2     6
 [8,]    5    7    8    7    9    9    7    4    3     8
 [9,]    6    2    9    6    2    5    5   10    6     9
[10,]    2   10    4    1    7   10    8    8   10     3
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1]  3.48180910 -4.81667847 -0.67223281  0.87077862 -2.70110542 -2.16686242
 [7]  3.76310668  1.05920518  0.91179857  0.72325334 -3.19235247 -0.51989608
[13] -1.70000325  2.69166005 -0.39596661 -2.63808303 -0.04398501 -2.71517290
[19]  1.93972738 -1.62950982
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -0.7353198
[2,]  0.8105097
[3,]  0.8253237
[4,]  1.1903927
[5,]  1.3909027
> 
> rowApply(tmp,sum)
[1] -3.676263 -1.674311 -2.095886  2.571396 -2.875446
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]   19   15   17   19    8
[2,]    7    1    8    4    5
[3,]   16    6   19    3    3
[4,]   15   13    3   16   16
[5,]    6   14    9    8    1
> 
> 
> as.matrix(tmp)
           [,1]       [,2]       [,3]       [,4]       [,5]       [,6]
[1,]  1.1903927 -0.5104073  0.5463734  0.1842218 -0.8509842  0.9787302
[2,]  0.8253237 -2.1954372 -0.5664957  0.0109391  0.6837936 -0.1379420
[3,]  0.8105097 -0.5423233  1.6177025 -1.2613590 -0.3858783 -1.1461605
[4,]  1.3909027 -0.4820712 -0.5849645  0.7827029 -0.2269004 -0.7741438
[5,] -0.7353198 -1.0864394 -1.6848484  1.1542739 -1.9211361 -1.0873464
           [,7]        [,8]       [,9]       [,10]      [,11]      [,12]
[1,] -0.2555423 -0.09241965  1.4572282 -0.06754947 -0.2074448 -1.6747644
[2,]  1.5120265  1.02701413 -1.8768260 -0.55159671  1.2754507  0.9885411
[3,]  0.3065631 -1.37598897  0.4700447  1.32912045 -3.1540692 -0.3648634
[4,]  0.8766600  0.17784509 -0.4457157 -0.09173967 -0.3159212  1.2469524
[5,]  1.3233994  1.32275458  1.3070674  0.10501874 -0.7903679 -0.7157618
           [,13]      [,14]       [,15]      [,16]      [,17]      [,18]
[1,] -0.27171339 -1.3383569 -0.06204199 -0.1028349 -0.9525541 -1.2380713
[2,] -0.03713625 -0.2532194 -0.31446121 -1.5476085  1.2074896 -0.2123281
[3,] -0.57975384  1.9454100 -0.85328226  0.7118804 -0.8852812  0.2343434
[4,]  0.11662742  0.6466613  0.68618427 -2.4362521 -0.3546082  0.3697789
[5,] -0.92802718  1.6911650  0.14763458  0.7367320  0.9409689 -1.8688958
          [,19]       [,20]
[1,]  0.6206510 -1.02917573
[2,] -0.6555828 -0.85625547
[3,]  0.6120992  0.41540073
[4,]  2.0703851 -0.08098724
[5,] -0.7078252 -0.07849211
> 
> 
> is.BufferedMatrix(tmp)
[1] TRUE
> 
> as.BufferedMatrix(as.matrix(tmp))
BufferedMatrix object
Matrix size:  5 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  800  bytes.
> 
> 
> 
> subBufferedMatrix(tmp,1:5,1:5)
BufferedMatrix object
Matrix size:  5 5 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  654  bytes.
Disk usage :  200  bytes.
> subBufferedMatrix(tmp,,5:8)
BufferedMatrix object
Matrix size:  5 4 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  566  bytes.
Disk usage :  160  bytes.
> subBufferedMatrix(tmp,1:3,)
BufferedMatrix object
Matrix size:  3 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  480  bytes.
> 
> 
> rm(tmp)
> 
> 
> ###
> ### Testing colnames and rownames
> ###
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> 
> 
> colnames(tmp)
NULL
> rownames(tmp)
NULL
> 
> 
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> colnames(tmp)
 [1] "col1"  "col2"  "col3"  "col4"  "col5"  "col6"  "col7"  "col8"  "col9" 
[10] "col10" "col11" "col12" "col13" "col14" "col15" "col16" "col17" "col18"
[19] "col19" "col20"
> rownames(tmp)
[1] "row1" "row2" "row3" "row4" "row5"
> 
> 
> tmp["row1",]
           col1        col2       col3       col4       col5     col6      col7
row1 -0.1414434 -0.03668644 -0.6631703 -0.8781371 -0.6575889 1.070348 0.8105667
           col8       col9    col10    col11     col12      col13      col14
row1 -0.6451805 -0.1500786 -1.32966 1.228899 -1.097517 -0.1150073 -0.5982894
          col15     col16    col17         col18     col19     col20
row1 -0.7779463 0.1505606 -0.36367 -0.0007735574 0.8594677 0.9384741
> tmp[,"col10"]
          col10
row1 -1.3296603
row2 -0.9452777
row3  1.2941512
row4  1.5519328
row5  0.6537323
> tmp[c("row1","row5"),]
           col1        col2       col3       col4       col5     col6      col7
row1 -0.1414434 -0.03668644 -0.6631703 -0.8781371 -0.6575889 1.070348 0.8105667
row5 -0.2073135  1.62595358 -0.5078929 -0.8765890  1.3779714 1.630242 0.3438737
           col8       col9      col10    col11      col12       col13
row1 -0.6451805 -0.1500786 -1.3296603 1.228899 -1.0975167 -0.11500728
row5  1.3820546  1.5340994  0.6537323 0.832618  0.3900217  0.04045676
          col14      col15      col16      col17         col18      col19
row1 -0.5982894 -0.7779463  0.1505606 -0.3636700 -0.0007735574  0.8594677
row5  1.0755531  0.0531398 -1.3116895 -0.1299685  0.1907978585 -1.1011129
          col20
row1  0.9384741
row5 -0.1135917
> tmp[,c("col6","col20")]
            col6      col20
row1  1.07034816  0.9384741
row2 -0.06866435  0.1782038
row3  1.13921448  0.3432260
row4  1.16959100  0.1625075
row5  1.63024203 -0.1135917
> tmp[c("row1","row5"),c("col6","col20")]
         col6      col20
row1 1.070348  0.9384741
row5 1.630242 -0.1135917
> 
> 
> 
> 
> 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.29758 48.06853 48.50363 50.26184 50.92411 104.9512 49.85496 50.52278
         col9    col10    col11    col12    col13    col14    col15    col16
row1 48.70786 51.03686 50.02318 48.95533 50.01181 50.10347 49.10393 50.73805
     col17   col18    col19    col20
row1 52.23 49.9755 51.02179 104.1276
> tmp[,"col10"]
        col10
row1 51.03686
row2 29.74553
row3 31.02269
row4 31.70822
row5 48.76758
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 49.29758 48.06853 48.50363 50.26184 50.92411 104.9512 49.85496 50.52278
row5 50.89086 51.13716 51.45450 50.73452 51.87993 103.7962 50.84192 49.64186
         col9    col10    col11    col12    col13    col14    col15    col16
row1 48.70786 51.03686 50.02318 48.95533 50.01181 50.10347 49.10393 50.73805
row5 51.40102 48.76758 49.32890 50.77327 49.57804 48.90619 50.13634 52.51403
        col17    col18    col19    col20
row1 52.23000 49.97550 51.02179 104.1276
row5 49.25244 51.02474 49.41243 104.7720
> tmp[,c("col6","col20")]
          col6     col20
row1 104.95120 104.12757
row2  74.58745  74.27166
row3  75.20242  76.17598
row4  73.79944  74.20081
row5 103.79616 104.77196
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 104.9512 104.1276
row5 103.7962 104.7720
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 104.9512 104.1276
row5 103.7962 104.7720
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
          col13
[1,] -0.9163918
[2,]  0.3848818
[3,] -1.2792379
[4,]  0.4524879
[5,] -0.7779449
> tmp[,c("col17","col7")]
          col17       col7
[1,]  0.2631312  1.3952134
[2,]  1.0067402 -2.5666436
[3,] -0.1582003 -0.7297603
[4,]  1.6085967 -0.3898785
[5,]  1.4893619  0.3801547
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
           col6        col20
[1,] -1.1570986  0.002000001
[2,]  1.0107450 -1.122776960
[3,] -0.2834279  0.371832069
[4,]  1.1354806 -0.030719992
[5,] -1.2719085  1.273516250
> subBufferedMatrix(tmp,1,c("col6"))[,1]
          col1
[1,] -1.157099
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
          col6
[1,] -1.157099
[2,]  1.010745
> 
> 
> 
> 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 -1.03941671  0.9030265 -0.3623237  0.7539948  1.1889639 -1.280824
row1  0.07707688 -0.7702556  0.6072011 -1.5431675 -0.8860479  1.007116
           [,7]       [,8]       [,9]     [,10]      [,11]      [,12]     [,13]
row3 -0.8568665  1.5084715  2.6224416 -0.193282  1.4743980 -0.3308464 -1.256157
row1  1.6510066 -0.4891881 -0.4789777 -1.670861 -0.9589315 -1.3485827  1.269623
          [,14]      [,15]     [,16]      [,17]      [,18]     [,19]      [,20]
row3 -3.1145948 -0.9945917 2.0295458  0.7203296 -0.3369095 -1.786626 -0.5412388
row1  0.7332196  2.7341690 0.5470914 -0.3882503  0.5372170  1.283373 -0.7121104
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
          [,1]     [,2]      [,3]      [,4]      [,5]     [,6]       [,7]
row2 0.6864069 1.488645 0.2402086 0.1922335 0.3807147 1.483593 -0.2665075
         [,8]       [,9]      [,10]
row2 1.414848 -0.8679486 -0.9543874
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
         [,1]      [,2]     [,3]      [,4]      [,5]      [,6]       [,7]
row5 0.227172 0.6388331 1.370648 -1.684071 -1.972477 0.8365402 -0.3445972
           [,8]       [,9]     [,10]     [,11]    [,12]      [,13]      [,14]
row5 0.04641846 -0.7938052 -1.593783 0.5108824 1.104322 -0.3286751 -0.3926039
          [,15]    [,16]       [,17]    [,18]    [,19]      [,20]
row5 -0.7845492 1.446251 -0.05561653 -1.14902 1.038386 -0.1327599
> 
> 
> 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: 0x5f2d68b72960>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1405837d11ff8" 
 [2] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1405832e08ece7"
 [3] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM14058314c3cb68"
 [4] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM14058335bf6b2" 
 [5] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1405836072ca29"
 [6] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM14058333aa3ba4"
 [7] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1405835d676988"
 [8] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1405833518b41b"
 [9] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1405833146b6eb"
[10] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM14058313c0131c"
[11] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1405835a7072fc"
[12] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1405831eca331d"
[13] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM14058336ba2711"
[14] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM14058350325ce5"
[15] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1405834da95616"
> 
> 
> ### 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: 0x5f2d6a0354d0>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x5f2d6a0354d0>
Warning message:
In dir.create(new.directory) :
  '/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x5f2d6a0354d0>
> rowMedians(tmp)
  [1] -0.066294746 -0.339110046  0.097846544 -0.337962019  0.406909901
  [6] -0.275519130 -0.634058743  0.002752187 -0.405551174 -0.041875848
 [11] -0.189680786  0.339977692  0.070516612  0.063505109 -0.089016834
 [16] -0.324285922 -0.425221032  0.083708257 -0.377360196 -0.152423965
 [21] -0.167527005 -0.016339482  0.118013227  0.293502039 -0.062147529
 [26] -0.699503128  0.003156414 -0.364654389  0.280992667  0.124692101
 [31] -0.045124622 -0.284639919  0.131719913 -0.060609553 -0.425396698
 [36]  0.470796226 -0.419065474  0.760950624 -0.647759186  0.019079700
 [41] -0.748654707  0.572019991  0.069483509 -0.741879896 -0.500350230
 [46]  0.389926487 -0.235942151  0.326606206 -0.125738909  0.098469497
 [51]  0.080261517 -0.444478884  0.545624972 -0.445442426  0.509752486
 [56]  0.254812494 -0.195893499 -0.102348537  0.296559672 -0.041578799
 [61]  0.042903348 -0.454821997 -0.159222601 -0.162798332 -0.264558066
 [66] -0.046357712 -0.301844450 -0.437175452  0.422682798  0.025341186
 [71]  0.340250956 -0.144886472 -0.196895554 -0.190480479 -0.357748209
 [76] -0.054130762  0.142338516  0.068261546 -0.125661325 -0.106582105
 [81]  0.329059044  0.381534526 -0.066793058  0.082559522 -0.025325155
 [86]  0.211089661  0.043168114 -0.074288451 -0.159158481 -0.440467077
 [91]  0.497923033  0.131087655  0.368317137  0.436881646  0.064453549
 [96]  0.531167881 -0.305742509  0.004214069  0.920904294 -0.064572753
[101] -0.273853829 -0.332229592  0.319980272  0.341559492 -0.293513975
[106]  0.252725684  0.025823457 -0.032714400  0.774909396  0.058070081
[111]  0.249575871 -0.104287794  0.214846960  0.324143925 -0.274670337
[116] -0.216146275  0.283906691 -0.175736008 -0.152949784  0.092727633
[121] -0.452263014 -0.491519959  0.010940317 -0.192057993 -0.305296450
[126] -0.259039213  0.748530011  0.069526522 -0.200602675  0.218307196
[131] -0.340901458 -0.271358840  0.086247975  0.447790861  0.404405553
[136] -0.128979248 -0.092613809  0.159344758  0.317968190 -0.030324638
[141] -0.192250468 -0.422188132  0.158186323  0.426541960  0.268773551
[146] -0.515934721 -0.027278271 -0.410452695 -0.467066270 -0.410353607
[151] -0.125421728 -0.009219806 -0.365398294 -0.582690170  0.549120519
[156]  0.143475355  0.054351027  0.066174077 -0.313677027  0.223012713
[161] -0.470600169  0.288693188  0.548849945  0.095852425 -0.418278102
[166] -0.162873804  0.550045497 -0.031404226  0.512131720 -0.009379130
[171] -0.164806000  0.252466293 -0.740154677  0.403763361  0.315604974
[176] -0.371434190 -0.177197062 -0.005608752 -0.084616501 -0.271645229
[181]  0.273369360  0.119280556 -0.384259738 -0.028174320  0.210171394
[186] -0.317091883  0.305689820  0.142322921 -0.634059703 -0.094204466
[191]  0.338516331 -0.147596061 -0.120821052  0.093183731  0.436480466
[196] -0.005091529  0.634065129  0.126208612  0.315359743 -0.334283142
[201] -0.239428786 -0.362613535  0.253949537  0.156871420 -0.650366076
[206] -0.451077513  0.279555437  0.038162370 -0.167086361 -0.126227751
[211]  0.143955454  0.258062178 -0.221534410  0.496841074 -0.077888457
[216]  0.401988723  0.358217398 -0.044883412 -0.240355544  0.105950918
[221] -0.442729800  0.388780969  0.068958103  0.103168807  0.598603228
[226]  0.327650439  0.451615607  0.048202973 -0.243773323 -0.190833905
> 
> proc.time()
   user  system elapsed 
  1.271   1.383   2.645 

BufferedMatrix.Rcheck/tests/rawCalltesting.Rout


R Under development (unstable) (2025-10-20 r88955) -- "Unsuffered Consequences"
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: 0x60d263f69b20>
> .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: 0x60d263f69b20>
> .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: 0x60d263f69b20>
> .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: 0x60d263f69b20>
> 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: 0x60d263f4a410>
> .Call("R_bm_AddColumn",P)
<pointer: 0x60d263f4a410>
> .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: 0x60d263f4a410>
> .Call("R_bm_AddColumn",P)
<pointer: 0x60d263f4a410>
> .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: 0x60d263f4a410>
> 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: 0x60d2627f77a0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x60d2627f77a0>
> .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: 0x60d2627f77a0>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x60d2627f77a0>
> .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: 0x60d2627f77a0>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x60d2627f77a0>
> .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: 0x60d2627f77a0>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x60d2627f77a0>
> .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: 0x60d2627f77a0>
> 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: 0x60d2637c9680>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x60d2637c9680>
> .Call("R_bm_AddColumn",P)
<pointer: 0x60d2637c9680>
> .Call("R_bm_AddColumn",P)
<pointer: 0x60d2637c9680>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile1406de4f96f438" "BufferedMatrixFile1406def0692c5" 
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile1406de4f96f438" "BufferedMatrixFile1406def0692c5" 
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x60d26355d490>
> .Call("R_bm_AddColumn",P)
<pointer: 0x60d26355d490>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x60d26355d490>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x60d26355d490>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x60d26355d490>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x60d26355d490>
> .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: 0x60d264bb9110>
> .Call("R_bm_AddColumn",P)
<pointer: 0x60d264bb9110>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x60d264bb9110>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x60d264bb9110>
> 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: 0x60d264c5c5e0>
> .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: 0x60d264c5c5e0>
> rm(P)
> 
> proc.time()
   user  system elapsed 
  0.238   0.047   0.274 

BufferedMatrix.Rcheck/tests/Rcodetesting.Rout


R Under development (unstable) (2025-10-20 r88955) -- "Unsuffered Consequences"
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.230   0.046   0.263 

Example timings