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

This page was generated on 2025-11-12 11:58 -0500 (Wed, 12 Nov 2025).

HostnameOSArch (*)R versionInstalled pkgs
nebbiolo2Linux (Ubuntu 24.04.3 LTS)x86_644.5.1 Patched (2025-08-23 r88802) -- "Great Square Root" 4902
taishanLinux (openEuler 24.03 LTS)aarch644.5.0 (2025-04-11) -- "How About a Twenty-Six" 4668
Click on any hostname to see more info about the system (e.g. compilers)      (*) as reported by 'uname -p', except on Windows and Mac OS X

Package 257/2361HostnameOS / ArchINSTALLBUILDCHECKBUILD BIN
BufferedMatrix 1.74.0  (landing page)
Ben Bolstad
Snapshot Date: 2025-11-11 13:45 -0500 (Tue, 11 Nov 2025)
git_url: https://git.bioconductor.org/packages/BufferedMatrix
git_branch: RELEASE_3_22
git_last_commit: d2ce144
git_last_commit_date: 2025-10-29 09:58:55 -0500 (Wed, 29 Oct 2025)
nebbiolo2Linux (Ubuntu 24.04.3 LTS) / x86_64  OK    OK    OK  UNNEEDED, same version is already published
taishanLinux (openEuler 24.03 LTS) / aarch64  OK    OK    OK  


CHECK results for BufferedMatrix on taishan

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.
- See Martin Grigorov's blog post for how to debug Linux ARM64 related issues on a x86_64 host.

raw results


Summary

Package: BufferedMatrix
Version: 1.74.0
Command: /home/biocbuild/R/R/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/home/biocbuild/R/R/site-library --no-vignettes --timings BufferedMatrix_1.74.0.tar.gz
StartedAt: 2025-11-11 07:43:55 -0000 (Tue, 11 Nov 2025)
EndedAt: 2025-11-11 07:44:18 -0000 (Tue, 11 Nov 2025)
EllapsedTime: 23.0 seconds
RetCode: 0
Status:   OK  
CheckDir: BufferedMatrix.Rcheck
Warnings: 0

Command output

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


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

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


Installation output

BufferedMatrix.Rcheck/00install.out

##############################################################################
##############################################################################
###
### Running command:
###
###   /home/biocbuild/R/R/bin/R CMD INSTALL BufferedMatrix
###
##############################################################################
##############################################################################


* installing to library ‘/home/biocbuild/R/R-4.5.0/site-library’
* installing *source* package ‘BufferedMatrix’ ...
** this is package ‘BufferedMatrix’ version ‘1.74.0’
** using staged installation
** libs
using C compiler: ‘aarch64-unknown-linux-gnu-gcc (GCC) 14.2.0’
/opt/ohpc/pub/compiler/gcc/14.2.0/bin/aarch64-unknown-linux-gnu-gcc -std=gnu23 -I"/home/biocbuild/R/R-4.5.0/include" -DNDEBUG   -I/usr/local/include    -fPIC  -g -O2  -Wall -Werror=format-security -c RBufferedMatrix.c -o RBufferedMatrix.o
/opt/ohpc/pub/compiler/gcc/14.2.0/bin/aarch64-unknown-linux-gnu-gcc -std=gnu23 -I"/home/biocbuild/R/R-4.5.0/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){
      |            ^~~~~~~~~~~
/opt/ohpc/pub/compiler/gcc/14.2.0/bin/aarch64-unknown-linux-gnu-gcc -std=gnu23 -I"/home/biocbuild/R/R-4.5.0/include" -DNDEBUG   -I/usr/local/include    -fPIC  -g -O2  -Wall -Werror=format-security -c doubleBufferedMatrix_C_tests.c -o doubleBufferedMatrix_C_tests.o
/opt/ohpc/pub/compiler/gcc/14.2.0/bin/aarch64-unknown-linux-gnu-gcc -std=gnu23 -I"/home/biocbuild/R/R-4.5.0/include" -DNDEBUG   -I/usr/local/include    -fPIC  -g -O2  -Wall -Werror=format-security -c init_package.c -o init_package.o
/opt/ohpc/pub/compiler/gcc/14.2.0/bin/aarch64-unknown-linux-gnu-gcc -std=gnu23 -shared -L/home/biocbuild/R/R-4.5.0/lib -L/usr/local/lib -o BufferedMatrix.so RBufferedMatrix.o doubleBufferedMatrix.o doubleBufferedMatrix_C_tests.o init_package.o -L/home/biocbuild/R/R-4.5.0/lib -lR
installing to /home/biocbuild/R/R-4.5.0/site-library/00LOCK-BufferedMatrix/00new/BufferedMatrix/libs
** R
** inst
** byte-compile and prepare package for lazy loading
Creating a new generic function for ‘rowMeans’ in package ‘BufferedMatrix’
Creating a new generic function for ‘rowSums’ in package ‘BufferedMatrix’
Creating a new generic function for ‘colMeans’ in package ‘BufferedMatrix’
Creating a new generic function for ‘colSums’ in package ‘BufferedMatrix’
Creating a generic function for ‘ncol’ from package ‘base’ in package ‘BufferedMatrix’
Creating a generic function for ‘nrow’ from package ‘base’ in package ‘BufferedMatrix’
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
** checking absolute paths in shared objects and dynamic libraries
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (BufferedMatrix)

Tests output

BufferedMatrix.Rcheck/tests/c_code_level_tests.Rout


R version 4.5.0 (2025-04-11) -- "How About a Twenty-Six"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: aarch64-unknown-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.304   0.069   0.357 

BufferedMatrix.Rcheck/tests/objectTesting.Rout


R version 4.5.0 (2025-04-11) -- "How About a Twenty-Six"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: aarch64-unknown-linux-gnu

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

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

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

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

Attaching package: 'BufferedMatrix'

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

    colMeans, colSums, rowMeans, rowSums

> 
> 
> ### this is used to control how many repetitions in something below
> ### higher values result in more checks.
> nreps <-100 ##20000
> 
> 
> ## test creation and some simple assignments and subsetting operations
> 
> ## first on single elements
> tmp <- createBufferedMatrix(1000,10)
> 
> tmp[10,5]
[1] 0
> tmp[10,5] <- 10
> tmp[10,5]
[1] 10
> tmp[10,5] <- 12.445
> tmp[10,5]
[1] 12.445
> 
> 
> 
> ## now testing accessing multiple elements
> tmp2 <- createBufferedMatrix(10,20)
> 
> 
> tmp2[3,1] <- 51.34
> tmp2[9,2] <- 9.87654
> tmp2[,1:2]
       [,1]    [,2]
 [1,]  0.00 0.00000
 [2,]  0.00 0.00000
 [3,] 51.34 0.00000
 [4,]  0.00 0.00000
 [5,]  0.00 0.00000
 [6,]  0.00 0.00000
 [7,]  0.00 0.00000
 [8,]  0.00 0.00000
 [9,]  0.00 9.87654
[10,]  0.00 0.00000
> tmp2[,-(3:20)]
       [,1]    [,2]
 [1,]  0.00 0.00000
 [2,]  0.00 0.00000
 [3,] 51.34 0.00000
 [4,]  0.00 0.00000
 [5,]  0.00 0.00000
 [6,]  0.00 0.00000
 [7,]  0.00 0.00000
 [8,]  0.00 0.00000
 [9,]  0.00 9.87654
[10,]  0.00 0.00000
> tmp2[3,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
[1,] 51.34    0    0    0    0    0    0    0    0     0     0     0     0
     [,14] [,15] [,16] [,17] [,18] [,19] [,20]
[1,]     0     0     0     0     0     0     0
> tmp2[-3,]
      [,1]    [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [2,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [3,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [4,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [5,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [6,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [7,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [8,]    0 9.87654    0    0    0    0    0    0    0     0     0     0     0
 [9,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
      [,14] [,15] [,16] [,17] [,18] [,19] [,20]
 [1,]     0     0     0     0     0     0     0
 [2,]     0     0     0     0     0     0     0
 [3,]     0     0     0     0     0     0     0
 [4,]     0     0     0     0     0     0     0
 [5,]     0     0     0     0     0     0     0
 [6,]     0     0     0     0     0     0     0
 [7,]     0     0     0     0     0     0     0
 [8,]     0     0     0     0     0     0     0
 [9,]     0     0     0     0     0     0     0
> tmp2[2,1:3]
     [,1] [,2] [,3]
[1,]    0    0    0
> tmp2[3:9,1:3]
      [,1]    [,2] [,3]
[1,] 51.34 0.00000    0
[2,]  0.00 0.00000    0
[3,]  0.00 0.00000    0
[4,]  0.00 0.00000    0
[5,]  0.00 0.00000    0
[6,]  0.00 0.00000    0
[7,]  0.00 9.87654    0
> tmp2[-4,-4]
       [,1]    [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [2,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [3,] 51.34 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [4,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [5,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [6,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [7,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [8,]  0.00 9.87654    0    0    0    0    0    0    0     0     0     0     0
 [9,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
      [,14] [,15] [,16] [,17] [,18] [,19]
 [1,]     0     0     0     0     0     0
 [2,]     0     0     0     0     0     0
 [3,]     0     0     0     0     0     0
 [4,]     0     0     0     0     0     0
 [5,]     0     0     0     0     0     0
 [6,]     0     0     0     0     0     0
 [7,]     0     0     0     0     0     0
 [8,]     0     0     0     0     0     0
 [9,]     0     0     0     0     0     0
> 
> ## now testing accessing/assigning multiple elements
> tmp3 <- createBufferedMatrix(10,10)
> 
> for (i in 1:10){
+   for (j in 1:10){
+     tmp3[i,j] <- (j-1)*10 + i
+   }
+ }
> 
> tmp3[2:4,2:4]
     [,1] [,2] [,3]
[1,]   12   22   32
[2,]   13   23   33
[3,]   14   24   34
> tmp3[c(-10),c(2:4,2:4,10,1,2,1:10,10:1)]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]   11   21   31   11   21   31   91    1   11     1    11    21    31
 [2,]   12   22   32   12   22   32   92    2   12     2    12    22    32
 [3,]   13   23   33   13   23   33   93    3   13     3    13    23    33
 [4,]   14   24   34   14   24   34   94    4   14     4    14    24    34
 [5,]   15   25   35   15   25   35   95    5   15     5    15    25    35
 [6,]   16   26   36   16   26   36   96    6   16     6    16    26    36
 [7,]   17   27   37   17   27   37   97    7   17     7    17    27    37
 [8,]   18   28   38   18   28   38   98    8   18     8    18    28    38
 [9,]   19   29   39   19   29   39   99    9   19     9    19    29    39
      [,14] [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24] [,25]
 [1,]    41    51    61    71    81    91    91    81    71    61    51    41
 [2,]    42    52    62    72    82    92    92    82    72    62    52    42
 [3,]    43    53    63    73    83    93    93    83    73    63    53    43
 [4,]    44    54    64    74    84    94    94    84    74    64    54    44
 [5,]    45    55    65    75    85    95    95    85    75    65    55    45
 [6,]    46    56    66    76    86    96    96    86    76    66    56    46
 [7,]    47    57    67    77    87    97    97    87    77    67    57    47
 [8,]    48    58    68    78    88    98    98    88    78    68    58    48
 [9,]    49    59    69    79    89    99    99    89    79    69    59    49
      [,26] [,27] [,28] [,29]
 [1,]    31    21    11     1
 [2,]    32    22    12     2
 [3,]    33    23    13     3
 [4,]    34    24    14     4
 [5,]    35    25    15     5
 [6,]    36    26    16     6
 [7,]    37    27    17     7
 [8,]    38    28    18     8
 [9,]    39    29    19     9
> tmp3[-c(1:5),-c(6:10)]
     [,1] [,2] [,3] [,4] [,5]
[1,]    6   16   26   36   46
[2,]    7   17   27   37   47
[3,]    8   18   28   38   48
[4,]    9   19   29   39   49
[5,]   10   20   30   40   50
> 
> ## assignment of whole columns
> tmp3[,1] <- c(1:10*100.0)
> tmp3[,1:2] <- tmp3[,1:2]*100
> tmp3[,1:2] <- tmp3[,2:1]
> tmp3[,1:2]
      [,1]  [,2]
 [1,] 1100 1e+04
 [2,] 1200 2e+04
 [3,] 1300 3e+04
 [4,] 1400 4e+04
 [5,] 1500 5e+04
 [6,] 1600 6e+04
 [7,] 1700 7e+04
 [8,] 1800 8e+04
 [9,] 1900 9e+04
[10,] 2000 1e+05
> 
> 
> tmp3[,-1] <- tmp3[,1:9]
> tmp3[,1:10]
      [,1] [,2]  [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,] 1100 1100 1e+04   21   31   41   51   61   71    81
 [2,] 1200 1200 2e+04   22   32   42   52   62   72    82
 [3,] 1300 1300 3e+04   23   33   43   53   63   73    83
 [4,] 1400 1400 4e+04   24   34   44   54   64   74    84
 [5,] 1500 1500 5e+04   25   35   45   55   65   75    85
 [6,] 1600 1600 6e+04   26   36   46   56   66   76    86
 [7,] 1700 1700 7e+04   27   37   47   57   67   77    87
 [8,] 1800 1800 8e+04   28   38   48   58   68   78    88
 [9,] 1900 1900 9e+04   29   39   49   59   69   79    89
[10,] 2000 2000 1e+05   30   40   50   60   70   80    90
> 
> tmp3[,1:2] <- rep(1,10)
> tmp3[,1:2] <- rep(1,20)
> tmp3[,1:2] <- matrix(c(1:5),1,5)
> 
> tmp3[,-c(1:8)] <- matrix(c(1:5),1,5)
> 
> tmp3[1,] <- 1:10
> tmp3[1,]
     [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,]    1    2    3    4    5    6    7    8    9    10
> tmp3[-1,] <- c(1,2)
> tmp3[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    1    2    3    4    5    6    7    8    9    10
 [2,]    1    2    1    2    1    2    1    2    1     2
 [3,]    2    1    2    1    2    1    2    1    2     1
 [4,]    1    2    1    2    1    2    1    2    1     2
 [5,]    2    1    2    1    2    1    2    1    2     1
 [6,]    1    2    1    2    1    2    1    2    1     2
 [7,]    2    1    2    1    2    1    2    1    2     1
 [8,]    1    2    1    2    1    2    1    2    1     2
 [9,]    2    1    2    1    2    1    2    1    2     1
[10,]    1    2    1    2    1    2    1    2    1     2
> tmp3[-c(1:8),] <- matrix(c(1:5),1,5)
> tmp3[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    1    2    3    4    5    6    7    8    9    10
 [2,]    1    2    1    2    1    2    1    2    1     2
 [3,]    2    1    2    1    2    1    2    1    2     1
 [4,]    1    2    1    2    1    2    1    2    1     2
 [5,]    2    1    2    1    2    1    2    1    2     1
 [6,]    1    2    1    2    1    2    1    2    1     2
 [7,]    2    1    2    1    2    1    2    1    2     1
 [8,]    1    2    1    2    1    2    1    2    1     2
 [9,]    1    3    5    2    4    1    3    5    2     4
[10,]    2    4    1    3    5    2    4    1    3     5
> 
> 
> tmp3[1:2,1:2] <- 5555.04
> tmp3[-(1:2),1:2] <- 1234.56789
> 
> 
> 
> ## testing accessors for the directory and prefix
> directory(tmp3)
[1] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests"
> prefix(tmp3)
[1] "BM"
> 
> ## testing if we can remove these objects
> rm(tmp, tmp2, tmp3)
> gc()
         used (Mb) gc trigger (Mb) max used (Mb)
Ncells 478398 25.6    1047041   56   639620 34.2
Vcells 885166  6.8    8388608   64  2080985 15.9
> 
> 
> 
> 
> ##
> ## checking reads
> ##
> 
> tmp2 <- createBufferedMatrix(10,20)
> 
> test.sample <- rnorm(10*20)
> 
> tmp2[1:10,1:20] <- test.sample
> 
> test.matrix <- matrix(test.sample,10,20)
> 
> ## testing reads
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   which.col <- sample(1:20,1)
+   if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> date()
[1] "Tue Nov 11 07:44:13 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] "Tue Nov 11 07:44:13 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: 0x2e3e8ff0>
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   which.col <- sample(1:20,1)
+   if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,5,replace=TRUE)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> date()
[1] "Tue Nov 11 07:44:13 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] "Tue Nov 11 07:44:13 2025"
> 
> ColMode(tmp2)
<pointer: 0x2e3e8ff0>
> 
> 
> 
> ### Now testing assignments
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+ 
+   new.data <- rnorm(20)
+   tmp2[which.row,] <- new.data
+   test.matrix[which.row,] <- new.data
+   if (rep > 1){
+     if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+   
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   new.data <- rnorm(10)
+   tmp2[,which.col] <- new.data
+   test.matrix[,which.col]<- new.data
+ 
+   if (rep > 1){
+     if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.col <- which.col
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,5,replace=TRUE)
+   new.data <- matrix(rnorm(50),5,10)
+   tmp2[,which.col] <- new.data
+   test.matrix[,which.col]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.col <- which.col
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   new.data <- matrix(rnorm(50),5,10)
+   tmp2[which.row,] <- new.data
+   test.matrix[which.row,]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col  <- sample(1:20,5,replace=TRUE)
+   new.data <- matrix(rnorm(25),5,5)
+   tmp2[which.row,which.col] <- new.data
+   test.matrix[which.row,which.col]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[prev.row,prev.col] == test.matrix[prev.row,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+   prev.col <- which.col
+ }
> 
> 
> 
> 
> ###
> ###
> ### testing some more functions
> ###
> 
> 
> 
> ## duplication function
> tmp5 <- duplicate(tmp2)
> 
> # making sure really did copy everything.
> tmp5[1,1] <- tmp5[1,1] +100.00
> 
> if (tmp5[1,1] == tmp2[1,1]){
+   stop("Problem with duplication")
+ }
> 
> 
> 
> 
> ### testing elementwise applying of functions
> 
> tmp5[1:4,1:4]
           [,1]       [,2]       [,3]       [,4]
[1,] 97.9341658  0.7357290  0.6604947 -1.4202283
[2,] -0.1099645 -0.3472249  0.3400510 -1.0241125
[3,] -0.5773988  1.0659786 -1.3896402  1.3468535
[4,]  2.5061612  1.9878151 -0.2100075 -0.4134135
> ewApply(tmp5,abs)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
           [,1]      [,2]      [,3]      [,4]
[1,] 97.9341658 0.7357290 0.6604947 1.4202283
[2,]  0.1099645 0.3472249 0.3400510 1.0241125
[3,]  0.5773988 1.0659786 1.3896402 1.3468535
[4,]  2.5061612 1.9878151 0.2100075 0.4134135
> ewApply(tmp5,sqrt)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
          [,1]      [,2]      [,3]      [,4]
[1,] 9.8961692 0.8577465 0.8127082 1.1917333
[2,] 0.3316090 0.5892579 0.5831389 1.0119844
[3,] 0.7598676 1.0324624 1.1788300 1.1605402
[4,] 1.5830860 1.4098990 0.4582657 0.6429724
> 
> my.function <- function(x,power){
+   (x+5)^power
+ }
> 
> ewApply(tmp5,my.function,power=2)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
          [,1]     [,2]     [,3]     [,4]
[1,] 221.89586 34.31319 33.78758 38.33756
[2,]  28.42605 31.23980 31.17144 36.14396
[3,]  33.17608 36.39060 38.17794 37.95226
[4,]  43.33702 41.08680 29.79266 31.84314
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x2d0cb6c0>
> exp(tmp5)
<pointer: 0x2d0cb6c0>
> log(tmp5,2)
<pointer: 0x2d0cb6c0>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 461.8472
> Min(tmp5)
[1] 53.90864
> mean(tmp5)
[1] 72.79336
> Sum(tmp5)
[1] 14558.67
> Var(tmp5)
[1] 833.9864
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 91.82732 68.56688 71.83287 70.85601 71.76803 68.35275 70.33809 73.38328
 [9] 68.29806 72.71029
> rowSums(tmp5)
 [1] 1836.546 1371.338 1436.657 1417.120 1435.361 1367.055 1406.762 1467.666
 [9] 1365.961 1454.206
> rowVars(tmp5)
 [1] 7651.44055   30.44858   71.00069   90.40302   69.01895   73.73381
 [7]   45.61938   98.20428   55.34472   94.75740
> rowSd(tmp5)
 [1] 87.472513  5.518024  8.426190  9.508051  8.307764  8.586840  6.754212
 [8]  9.909807  7.439403  9.734341
> rowMax(tmp5)
 [1] 461.84716  77.87741  86.11454  90.20033  90.64650  85.95312  87.24925
 [8]  87.03460  81.40322  94.25024
> rowMin(tmp5)
 [1] 58.59916 58.21689 57.38774 54.55436 55.26292 55.99499 58.63176 58.69072
 [9] 53.90864 57.91493
> 
> colMeans(tmp5)
 [1] 111.45537  71.43881  71.40273  74.00919  68.20595  70.56293  68.51213
 [8]  66.02802  71.38653  71.75622  70.63410  74.26216  71.88111  71.05822
[15]  72.67192  74.25330  67.60411  72.37217  69.10636  67.26582
> colSums(tmp5)
 [1] 1114.5537  714.3881  714.0273  740.0919  682.0595  705.6293  685.1213
 [8]  660.2802  713.8653  717.5622  706.3410  742.6216  718.8111  710.5822
[15]  726.7192  742.5330  676.0411  723.7217  691.0636  672.6582
> colVars(tmp5)
 [1] 15243.63075    76.44940    42.22940    87.63880    64.61296    88.99633
 [7]    42.00669    76.04536    69.01893    86.52064    60.89313   150.53359
[13]    44.78934    60.78708    65.77058    53.40198    37.09116   113.06228
[19]    92.50703    20.78868
> colSd(tmp5)
 [1] 123.465099   8.743535   6.498416   9.361560   8.038218   9.433787
 [7]   6.481257   8.720399   8.307763   9.301647   7.803405  12.269213
[13]   6.692484   7.796607   8.109906   7.307665   6.090251  10.633075
[19]   9.618057   4.559460
> colMax(tmp5)
 [1] 461.84716  85.51680  81.46932  82.91846  84.29575  90.64650  79.05086
 [8]  80.78709  85.39300  85.95018  87.24925  94.25024  85.95312  82.19368
[15]  85.90629  87.31173  75.42287  91.80790  87.03460  75.46127
> colMin(tmp5)
 [1] 59.16511 60.82103 62.00953 55.26292 57.90644 58.21689 58.63176 54.55436
 [9] 59.48954 55.99499 59.94198 58.38196 63.56039 58.92710 63.19176 66.45926
[17] 59.45311 57.38774 53.90864 57.91493
> 
> 
> ### setting a random element to NA and then testing with na.rm=TRUE or na.rm=FALSE (The default)
> 
> 
> which.row <- sample(1:10,1,replace=TRUE)
> which.col  <- sample(1:20,1,replace=TRUE)
> 
> tmp5[which.row,which.col] <- NA
> 
> Max(tmp5)
[1] NA
> Min(tmp5)
[1] NA
> mean(tmp5)
[1] NA
> Sum(tmp5)
[1] NA
> Var(tmp5)
[1] NA
> 
> rowMeans(tmp5)
 [1] 91.82732 68.56688 71.83287 70.85601 71.76803 68.35275 70.33809 73.38328
 [9]       NA 72.71029
> rowSums(tmp5)
 [1] 1836.546 1371.338 1436.657 1417.120 1435.361 1367.055 1406.762 1467.666
 [9]       NA 1454.206
> rowVars(tmp5)
 [1] 7651.44055   30.44858   71.00069   90.40302   69.01895   73.73381
 [7]   45.61938   98.20428   56.17977   94.75740
> rowSd(tmp5)
 [1] 87.472513  5.518024  8.426190  9.508051  8.307764  8.586840  6.754212
 [8]  9.909807  7.495317  9.734341
> rowMax(tmp5)
 [1] 461.84716  77.87741  86.11454  90.20033  90.64650  85.95312  87.24925
 [8]  87.03460        NA  94.25024
> rowMin(tmp5)
 [1] 58.59916 58.21689 57.38774 54.55436 55.26292 55.99499 58.63176 58.69072
 [9]       NA 57.91493
> 
> colMeans(tmp5)
 [1] 111.45537  71.43881  71.40273  74.00919  68.20595  70.56293  68.51213
 [8]        NA  71.38653  71.75622  70.63410  74.26216  71.88111  71.05822
[15]  72.67192  74.25330  67.60411  72.37217  69.10636  67.26582
> colSums(tmp5)
 [1] 1114.5537  714.3881  714.0273  740.0919  682.0595  705.6293  685.1213
 [8]        NA  713.8653  717.5622  706.3410  742.6216  718.8111  710.5822
[15]  726.7192  742.5330  676.0411  723.7217  691.0636  672.6582
> colVars(tmp5)
 [1] 15243.63075    76.44940    42.22940    87.63880    64.61296    88.99633
 [7]    42.00669          NA    69.01893    86.52064    60.89313   150.53359
[13]    44.78934    60.78708    65.77058    53.40198    37.09116   113.06228
[19]    92.50703    20.78868
> colSd(tmp5)
 [1] 123.465099   8.743535   6.498416   9.361560   8.038218   9.433787
 [7]   6.481257         NA   8.307763   9.301647   7.803405  12.269213
[13]   6.692484   7.796607   8.109906   7.307665   6.090251  10.633075
[19]   9.618057   4.559460
> colMax(tmp5)
 [1] 461.84716  85.51680  81.46932  82.91846  84.29575  90.64650  79.05086
 [8]        NA  85.39300  85.95018  87.24925  94.25024  85.95312  82.19368
[15]  85.90629  87.31173  75.42287  91.80790  87.03460  75.46127
> colMin(tmp5)
 [1] 59.16511 60.82103 62.00953 55.26292 57.90644 58.21689 58.63176       NA
 [9] 59.48954 55.99499 59.94198 58.38196 63.56039 58.92710 63.19176 66.45926
[17] 59.45311 57.38774 53.90864 57.91493
> 
> Max(tmp5,na.rm=TRUE)
[1] 461.8472
> Min(tmp5,na.rm=TRUE)
[1] 53.90864
> mean(tmp5,na.rm=TRUE)
[1] 72.84705
> Sum(tmp5,na.rm=TRUE)
[1] 14496.56
> Var(tmp5,na.rm=TRUE)
[1] 837.6191
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 91.82732 68.56688 71.83287 70.85601 71.76803 68.35275 70.33809 73.38328
 [9] 68.62378 72.71029
> rowSums(tmp5,na.rm=TRUE)
 [1] 1836.546 1371.338 1436.657 1417.120 1435.361 1367.055 1406.762 1467.666
 [9] 1303.852 1454.206
> rowVars(tmp5,na.rm=TRUE)
 [1] 7651.44055   30.44858   71.00069   90.40302   69.01895   73.73381
 [7]   45.61938   98.20428   56.17977   94.75740
> rowSd(tmp5,na.rm=TRUE)
 [1] 87.472513  5.518024  8.426190  9.508051  8.307764  8.586840  6.754212
 [8]  9.909807  7.495317  9.734341
> rowMax(tmp5,na.rm=TRUE)
 [1] 461.84716  77.87741  86.11454  90.20033  90.64650  85.95312  87.24925
 [8]  87.03460  81.40322  94.25024
> rowMin(tmp5,na.rm=TRUE)
 [1] 58.59916 58.21689 57.38774 54.55436 55.26292 55.99499 58.63176 58.69072
 [9] 53.90864 57.91493
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 111.45537  71.43881  71.40273  74.00919  68.20595  70.56293  68.51213
 [8]  66.46341  71.38653  71.75622  70.63410  74.26216  71.88111  71.05822
[15]  72.67192  74.25330  67.60411  72.37217  69.10636  67.26582
> colSums(tmp5,na.rm=TRUE)
 [1] 1114.5537  714.3881  714.0273  740.0919  682.0595  705.6293  685.1213
 [8]  598.1707  713.8653  717.5622  706.3410  742.6216  718.8111  710.5822
[15]  726.7192  742.5330  676.0411  723.7217  691.0636  672.6582
> colVars(tmp5,na.rm=TRUE)
 [1] 15243.63075    76.44940    42.22940    87.63880    64.61296    88.99633
 [7]    42.00669    83.41844    69.01893    86.52064    60.89313   150.53359
[13]    44.78934    60.78708    65.77058    53.40198    37.09116   113.06228
[19]    92.50703    20.78868
> colSd(tmp5,na.rm=TRUE)
 [1] 123.465099   8.743535   6.498416   9.361560   8.038218   9.433787
 [7]   6.481257   9.133369   8.307763   9.301647   7.803405  12.269213
[13]   6.692484   7.796607   8.109906   7.307665   6.090251  10.633075
[19]   9.618057   4.559460
> colMax(tmp5,na.rm=TRUE)
 [1] 461.84716  85.51680  81.46932  82.91846  84.29575  90.64650  79.05086
 [8]  80.78709  85.39300  85.95018  87.24925  94.25024  85.95312  82.19368
[15]  85.90629  87.31173  75.42287  91.80790  87.03460  75.46127
> colMin(tmp5,na.rm=TRUE)
 [1] 59.16511 60.82103 62.00953 55.26292 57.90644 58.21689 58.63176 54.55436
 [9] 59.48954 55.99499 59.94198 58.38196 63.56039 58.92710 63.19176 66.45926
[17] 59.45311 57.38774 53.90864 57.91493
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1] 91.82732 68.56688 71.83287 70.85601 71.76803 68.35275 70.33809 73.38328
 [9]      NaN 72.71029
> rowSums(tmp5,na.rm=TRUE)
 [1] 1836.546 1371.338 1436.657 1417.120 1435.361 1367.055 1406.762 1467.666
 [9]    0.000 1454.206
> rowVars(tmp5,na.rm=TRUE)
 [1] 7651.44055   30.44858   71.00069   90.40302   69.01895   73.73381
 [7]   45.61938   98.20428         NA   94.75740
> rowSd(tmp5,na.rm=TRUE)
 [1] 87.472513  5.518024  8.426190  9.508051  8.307764  8.586840  6.754212
 [8]  9.909807        NA  9.734341
> rowMax(tmp5,na.rm=TRUE)
 [1] 461.84716  77.87741  86.11454  90.20033  90.64650  85.95312  87.24925
 [8]  87.03460        NA  94.25024
> rowMin(tmp5,na.rm=TRUE)
 [1] 58.59916 58.21689 57.38774 54.55436 55.26292 55.99499 58.63176 58.69072
 [9]       NA 57.91493
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1] 116.10123  71.57092  71.01032  73.27161  68.41854  71.35023  68.74662
 [8]       NaN  72.56773  72.88821  69.84135  75.96919  71.44062  71.51289
[15]  71.70178  75.11931  67.82594  72.90659  70.79500  66.35521
> colSums(tmp5,na.rm=TRUE)
 [1] 1044.9111  644.1383  639.0929  659.4445  615.7668  642.1520  618.7196
 [8]    0.0000  653.1096  655.9939  628.5722  683.7227  642.9656  643.6160
[15]  645.3160  676.0738  610.4335  656.1593  637.1550  597.1969
> colVars(tmp5,na.rm=TRUE)
 [1] 16906.26433    85.80924    45.77580    92.47327    72.18116    93.14768
 [7]    46.63894          NA    61.94975    82.92004    61.43468   136.56832
[13]    48.20519    66.05976    63.40363    51.64012    41.17395   123.98202
[19]    71.99113    14.05873
> colSd(tmp5,na.rm=TRUE)
 [1] 130.024091   9.263328   6.765781   9.616302   8.495950   9.651305
 [7]   6.829271         NA   7.870817   9.106044   7.838028  11.686245
[13]   6.942996   8.127715   7.962640   7.186106   6.416693  11.134721
[19]   8.484759   3.749497
> colMax(tmp5,na.rm=TRUE)
 [1] 461.84716  85.51680  81.46932  82.91846  84.29575  90.64650  79.05086
 [8]      -Inf  85.39300  85.95018  87.24925  94.25024  85.95312  82.19368
[15]  85.90629  87.31173  75.42287  91.80790  87.03460  70.92180
> colMin(tmp5,na.rm=TRUE)
 [1] 59.16511 60.82103 62.00953 55.26292 57.90644 58.21689 58.63176      Inf
 [9] 59.48954 55.99499 59.94198 58.38196 63.56039 58.92710 63.19176 69.06762
[17] 59.45311 57.38774 56.53063 57.91493
> 
> 
> 
> 
> 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] 210.7794 223.3877 216.6114 231.1309 254.4857 206.6923 260.2668 235.1892
 [9] 276.2247 300.7858
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 210.7794 223.3877 216.6114 231.1309 254.4857 206.6923 260.2668 235.1892
 [9] 276.2247 300.7858
> 
> 
> 
> 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.563194e-13 -1.705303e-13 -3.410605e-13 -1.136868e-13
 [6]  0.000000e+00 -1.136868e-13  0.000000e+00  5.684342e-14  0.000000e+00
[11]  5.684342e-14  5.684342e-14  0.000000e+00  2.842171e-14  4.263256e-14
[16] -8.526513e-14 -7.105427e-14 -5.684342e-14  5.684342e-14  1.421085e-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)
+ }
3   16 
3   18 
2   17 
4   1 
2   7 
9   16 
5   1 
10   10 
3   11 
1   3 
8   14 
8   9 
5   18 
7   19 
9   5 
9   3 
7   5 
5   14 
4   2 
2   4 
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.949475
> Min(tmp)
[1] -2.634398
> mean(tmp)
[1] -0.07528536
> Sum(tmp)
[1] -7.528536
> Var(tmp)
[1] 1.00842
> 
> rowMeans(tmp)
[1] -0.07528536
> rowSums(tmp)
[1] -7.528536
> rowVars(tmp)
[1] 1.00842
> rowSd(tmp)
[1] 1.004201
> rowMax(tmp)
[1] 2.949475
> rowMin(tmp)
[1] -2.634398
> 
> colMeans(tmp)
  [1] -0.54766421  0.83137016 -0.73763805  0.08490261  0.48570490  1.05049291
  [7]  2.65358680 -0.09919624 -0.31063605  0.40023011 -0.93253221  2.94947516
 [13] -0.26158794 -0.63785572 -0.70985084 -1.53086312 -0.61259020  0.85843509
 [19] -1.45369842 -0.99585260  0.01441412  0.84344811 -0.06769866  1.06498162
 [25]  0.76253976  0.65758416  0.73223791 -0.06311575  0.03394751  0.06113435
 [31] -0.63503555  2.46013896 -2.63439758 -0.98796452  0.86195488 -1.68657342
 [37]  0.81480962 -0.16253649 -1.55826472  0.69811026  0.18202107 -0.74574805
 [43] -0.47365845  0.86994128 -0.68066782  0.97149487  0.92852196 -0.39452160
 [49] -0.75628374 -0.10822601 -2.55795939 -0.22310300 -0.78332693  1.31241750
 [55] -0.17716600  0.79607423 -2.37297509  0.28940231 -1.13591589 -1.08100351
 [61] -0.18943668  0.24460771  0.08545279 -0.89475400 -0.52225305  0.99870118
 [67]  0.48099777 -0.24674806  0.85763414  0.09344192 -0.53942430  0.15373438
 [73]  0.80951616  1.94232723  0.89984386 -0.33912939 -0.80528499  0.60056087
 [79]  0.20769506 -1.62850573 -0.52794791 -0.42748182 -0.83487388 -1.37141482
 [85]  0.10445430  0.21841351 -0.88834469 -0.16439059 -0.38735263  0.16772263
 [91] -0.16745962  0.19911992  0.98977522  1.24802876  0.31016128 -0.80982065
 [97] -2.01287563 -1.21004131  0.44990164 -0.17635101
> colSums(tmp)
  [1] -0.54766421  0.83137016 -0.73763805  0.08490261  0.48570490  1.05049291
  [7]  2.65358680 -0.09919624 -0.31063605  0.40023011 -0.93253221  2.94947516
 [13] -0.26158794 -0.63785572 -0.70985084 -1.53086312 -0.61259020  0.85843509
 [19] -1.45369842 -0.99585260  0.01441412  0.84344811 -0.06769866  1.06498162
 [25]  0.76253976  0.65758416  0.73223791 -0.06311575  0.03394751  0.06113435
 [31] -0.63503555  2.46013896 -2.63439758 -0.98796452  0.86195488 -1.68657342
 [37]  0.81480962 -0.16253649 -1.55826472  0.69811026  0.18202107 -0.74574805
 [43] -0.47365845  0.86994128 -0.68066782  0.97149487  0.92852196 -0.39452160
 [49] -0.75628374 -0.10822601 -2.55795939 -0.22310300 -0.78332693  1.31241750
 [55] -0.17716600  0.79607423 -2.37297509  0.28940231 -1.13591589 -1.08100351
 [61] -0.18943668  0.24460771  0.08545279 -0.89475400 -0.52225305  0.99870118
 [67]  0.48099777 -0.24674806  0.85763414  0.09344192 -0.53942430  0.15373438
 [73]  0.80951616  1.94232723  0.89984386 -0.33912939 -0.80528499  0.60056087
 [79]  0.20769506 -1.62850573 -0.52794791 -0.42748182 -0.83487388 -1.37141482
 [85]  0.10445430  0.21841351 -0.88834469 -0.16439059 -0.38735263  0.16772263
 [91] -0.16745962  0.19911992  0.98977522  1.24802876  0.31016128 -0.80982065
 [97] -2.01287563 -1.21004131  0.44990164 -0.17635101
> 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.54766421  0.83137016 -0.73763805  0.08490261  0.48570490  1.05049291
  [7]  2.65358680 -0.09919624 -0.31063605  0.40023011 -0.93253221  2.94947516
 [13] -0.26158794 -0.63785572 -0.70985084 -1.53086312 -0.61259020  0.85843509
 [19] -1.45369842 -0.99585260  0.01441412  0.84344811 -0.06769866  1.06498162
 [25]  0.76253976  0.65758416  0.73223791 -0.06311575  0.03394751  0.06113435
 [31] -0.63503555  2.46013896 -2.63439758 -0.98796452  0.86195488 -1.68657342
 [37]  0.81480962 -0.16253649 -1.55826472  0.69811026  0.18202107 -0.74574805
 [43] -0.47365845  0.86994128 -0.68066782  0.97149487  0.92852196 -0.39452160
 [49] -0.75628374 -0.10822601 -2.55795939 -0.22310300 -0.78332693  1.31241750
 [55] -0.17716600  0.79607423 -2.37297509  0.28940231 -1.13591589 -1.08100351
 [61] -0.18943668  0.24460771  0.08545279 -0.89475400 -0.52225305  0.99870118
 [67]  0.48099777 -0.24674806  0.85763414  0.09344192 -0.53942430  0.15373438
 [73]  0.80951616  1.94232723  0.89984386 -0.33912939 -0.80528499  0.60056087
 [79]  0.20769506 -1.62850573 -0.52794791 -0.42748182 -0.83487388 -1.37141482
 [85]  0.10445430  0.21841351 -0.88834469 -0.16439059 -0.38735263  0.16772263
 [91] -0.16745962  0.19911992  0.98977522  1.24802876  0.31016128 -0.80982065
 [97] -2.01287563 -1.21004131  0.44990164 -0.17635101
> colMin(tmp)
  [1] -0.54766421  0.83137016 -0.73763805  0.08490261  0.48570490  1.05049291
  [7]  2.65358680 -0.09919624 -0.31063605  0.40023011 -0.93253221  2.94947516
 [13] -0.26158794 -0.63785572 -0.70985084 -1.53086312 -0.61259020  0.85843509
 [19] -1.45369842 -0.99585260  0.01441412  0.84344811 -0.06769866  1.06498162
 [25]  0.76253976  0.65758416  0.73223791 -0.06311575  0.03394751  0.06113435
 [31] -0.63503555  2.46013896 -2.63439758 -0.98796452  0.86195488 -1.68657342
 [37]  0.81480962 -0.16253649 -1.55826472  0.69811026  0.18202107 -0.74574805
 [43] -0.47365845  0.86994128 -0.68066782  0.97149487  0.92852196 -0.39452160
 [49] -0.75628374 -0.10822601 -2.55795939 -0.22310300 -0.78332693  1.31241750
 [55] -0.17716600  0.79607423 -2.37297509  0.28940231 -1.13591589 -1.08100351
 [61] -0.18943668  0.24460771  0.08545279 -0.89475400 -0.52225305  0.99870118
 [67]  0.48099777 -0.24674806  0.85763414  0.09344192 -0.53942430  0.15373438
 [73]  0.80951616  1.94232723  0.89984386 -0.33912939 -0.80528499  0.60056087
 [79]  0.20769506 -1.62850573 -0.52794791 -0.42748182 -0.83487388 -1.37141482
 [85]  0.10445430  0.21841351 -0.88834469 -0.16439059 -0.38735263  0.16772263
 [91] -0.16745962  0.19911992  0.98977522  1.24802876  0.31016128 -0.80982065
 [97] -2.01287563 -1.21004131  0.44990164 -0.17635101
> colMedians(tmp)
  [1] -0.54766421  0.83137016 -0.73763805  0.08490261  0.48570490  1.05049291
  [7]  2.65358680 -0.09919624 -0.31063605  0.40023011 -0.93253221  2.94947516
 [13] -0.26158794 -0.63785572 -0.70985084 -1.53086312 -0.61259020  0.85843509
 [19] -1.45369842 -0.99585260  0.01441412  0.84344811 -0.06769866  1.06498162
 [25]  0.76253976  0.65758416  0.73223791 -0.06311575  0.03394751  0.06113435
 [31] -0.63503555  2.46013896 -2.63439758 -0.98796452  0.86195488 -1.68657342
 [37]  0.81480962 -0.16253649 -1.55826472  0.69811026  0.18202107 -0.74574805
 [43] -0.47365845  0.86994128 -0.68066782  0.97149487  0.92852196 -0.39452160
 [49] -0.75628374 -0.10822601 -2.55795939 -0.22310300 -0.78332693  1.31241750
 [55] -0.17716600  0.79607423 -2.37297509  0.28940231 -1.13591589 -1.08100351
 [61] -0.18943668  0.24460771  0.08545279 -0.89475400 -0.52225305  0.99870118
 [67]  0.48099777 -0.24674806  0.85763414  0.09344192 -0.53942430  0.15373438
 [73]  0.80951616  1.94232723  0.89984386 -0.33912939 -0.80528499  0.60056087
 [79]  0.20769506 -1.62850573 -0.52794791 -0.42748182 -0.83487388 -1.37141482
 [85]  0.10445430  0.21841351 -0.88834469 -0.16439059 -0.38735263  0.16772263
 [91] -0.16745962  0.19911992  0.98977522  1.24802876  0.31016128 -0.80982065
 [97] -2.01287563 -1.21004131  0.44990164 -0.17635101
> colRanges(tmp)
           [,1]      [,2]       [,3]       [,4]      [,5]     [,6]     [,7]
[1,] -0.5476642 0.8313702 -0.7376381 0.08490261 0.4857049 1.050493 2.653587
[2,] -0.5476642 0.8313702 -0.7376381 0.08490261 0.4857049 1.050493 2.653587
            [,8]      [,9]     [,10]      [,11]    [,12]      [,13]      [,14]
[1,] -0.09919624 -0.310636 0.4002301 -0.9325322 2.949475 -0.2615879 -0.6378557
[2,] -0.09919624 -0.310636 0.4002301 -0.9325322 2.949475 -0.2615879 -0.6378557
          [,15]     [,16]      [,17]     [,18]     [,19]      [,20]      [,21]
[1,] -0.7098508 -1.530863 -0.6125902 0.8584351 -1.453698 -0.9958526 0.01441412
[2,] -0.7098508 -1.530863 -0.6125902 0.8584351 -1.453698 -0.9958526 0.01441412
         [,22]       [,23]    [,24]     [,25]     [,26]     [,27]       [,28]
[1,] 0.8434481 -0.06769866 1.064982 0.7625398 0.6575842 0.7322379 -0.06311575
[2,] 0.8434481 -0.06769866 1.064982 0.7625398 0.6575842 0.7322379 -0.06311575
          [,29]      [,30]      [,31]    [,32]     [,33]      [,34]     [,35]
[1,] 0.03394751 0.06113435 -0.6350356 2.460139 -2.634398 -0.9879645 0.8619549
[2,] 0.03394751 0.06113435 -0.6350356 2.460139 -2.634398 -0.9879645 0.8619549
         [,36]     [,37]      [,38]     [,39]     [,40]     [,41]      [,42]
[1,] -1.686573 0.8148096 -0.1625365 -1.558265 0.6981103 0.1820211 -0.7457481
[2,] -1.686573 0.8148096 -0.1625365 -1.558265 0.6981103 0.1820211 -0.7457481
          [,43]     [,44]      [,45]     [,46]    [,47]      [,48]      [,49]
[1,] -0.4736584 0.8699413 -0.6806678 0.9714949 0.928522 -0.3945216 -0.7562837
[2,] -0.4736584 0.8699413 -0.6806678 0.9714949 0.928522 -0.3945216 -0.7562837
         [,50]     [,51]     [,52]      [,53]    [,54]     [,55]     [,56]
[1,] -0.108226 -2.557959 -0.223103 -0.7833269 1.312418 -0.177166 0.7960742
[2,] -0.108226 -2.557959 -0.223103 -0.7833269 1.312418 -0.177166 0.7960742
         [,57]     [,58]     [,59]     [,60]      [,61]     [,62]      [,63]
[1,] -2.372975 0.2894023 -1.135916 -1.081004 -0.1894367 0.2446077 0.08545279
[2,] -2.372975 0.2894023 -1.135916 -1.081004 -0.1894367 0.2446077 0.08545279
         [,64]     [,65]     [,66]     [,67]      [,68]     [,69]      [,70]
[1,] -0.894754 -0.522253 0.9987012 0.4809978 -0.2467481 0.8576341 0.09344192
[2,] -0.894754 -0.522253 0.9987012 0.4809978 -0.2467481 0.8576341 0.09344192
          [,71]     [,72]     [,73]    [,74]     [,75]      [,76]     [,77]
[1,] -0.5394243 0.1537344 0.8095162 1.942327 0.8998439 -0.3391294 -0.805285
[2,] -0.5394243 0.1537344 0.8095162 1.942327 0.8998439 -0.3391294 -0.805285
         [,78]     [,79]     [,80]      [,81]      [,82]      [,83]     [,84]
[1,] 0.6005609 0.2076951 -1.628506 -0.5279479 -0.4274818 -0.8348739 -1.371415
[2,] 0.6005609 0.2076951 -1.628506 -0.5279479 -0.4274818 -0.8348739 -1.371415
         [,85]     [,86]      [,87]      [,88]      [,89]     [,90]      [,91]
[1,] 0.1044543 0.2184135 -0.8883447 -0.1643906 -0.3873526 0.1677226 -0.1674596
[2,] 0.1044543 0.2184135 -0.8883447 -0.1643906 -0.3873526 0.1677226 -0.1674596
         [,92]     [,93]    [,94]     [,95]      [,96]     [,97]     [,98]
[1,] 0.1991199 0.9897752 1.248029 0.3101613 -0.8098206 -2.012876 -1.210041
[2,] 0.1991199 0.9897752 1.248029 0.3101613 -0.8098206 -2.012876 -1.210041
         [,99]    [,100]
[1,] 0.4499016 -0.176351
[2,] 0.4499016 -0.176351
> 
> 
> Max(tmp2)
[1] 3.506565
> Min(tmp2)
[1] -2.054367
> mean(tmp2)
[1] 0.04719301
> Sum(tmp2)
[1] 4.719301
> Var(tmp2)
[1] 0.8679658
> 
> rowMeans(tmp2)
  [1] -0.029225940 -0.236040936  0.806035894 -0.489103741 -1.191678397
  [6] -0.280075442 -0.299853400  1.295738844 -1.293259195 -0.282703069
 [11]  1.389578337  0.711734193 -0.031091997 -0.644394228 -0.192572206
 [16]  0.615766022  0.486770223  0.195129743  0.851619242  0.763210284
 [21]  0.356321734 -0.935491285 -0.372827578  0.645847763 -0.848528901
 [26] -0.736363322 -0.015210339 -0.339872218 -1.236018194 -0.405250110
 [31]  0.213584931  0.360406568  0.245586828 -0.415616780 -0.038707339
 [36]  1.100776124 -0.917845823  0.905780326 -0.222794042 -0.688014089
 [41]  0.482033301 -0.067070583  0.702484137 -1.297408808 -0.845192243
 [46] -0.524284859  0.598460739  0.520009550  0.329569477  0.741309639
 [51]  0.300024989 -0.101102802  1.045247761  0.006985369 -2.054367436
 [56] -0.628967784 -0.027093991 -1.000515429  0.708662479  0.146891001
 [61] -0.209840898 -0.211957162  0.221635486 -0.810245804  2.534195070
 [66] -0.984191618  0.514985631 -1.748930860 -0.714582758 -0.095946045
 [71]  1.326765994 -1.296640398  0.636665881 -0.774672639 -0.258005716
 [76] -1.705386123  2.345276056 -0.096261388  0.500488853  0.730753308
 [81]  0.203534094  1.731247023  1.183255725 -1.150353311  3.506565085
 [86] -0.262948525 -1.035770982  0.971262483 -0.306967849 -0.541680591
 [91]  0.655918068 -1.195001026 -0.564807610  1.591753375  0.066899250
 [96]  0.047395754 -0.497196323  0.643863684  1.788133468  0.143071440
> rowSums(tmp2)
  [1] -0.029225940 -0.236040936  0.806035894 -0.489103741 -1.191678397
  [6] -0.280075442 -0.299853400  1.295738844 -1.293259195 -0.282703069
 [11]  1.389578337  0.711734193 -0.031091997 -0.644394228 -0.192572206
 [16]  0.615766022  0.486770223  0.195129743  0.851619242  0.763210284
 [21]  0.356321734 -0.935491285 -0.372827578  0.645847763 -0.848528901
 [26] -0.736363322 -0.015210339 -0.339872218 -1.236018194 -0.405250110
 [31]  0.213584931  0.360406568  0.245586828 -0.415616780 -0.038707339
 [36]  1.100776124 -0.917845823  0.905780326 -0.222794042 -0.688014089
 [41]  0.482033301 -0.067070583  0.702484137 -1.297408808 -0.845192243
 [46] -0.524284859  0.598460739  0.520009550  0.329569477  0.741309639
 [51]  0.300024989 -0.101102802  1.045247761  0.006985369 -2.054367436
 [56] -0.628967784 -0.027093991 -1.000515429  0.708662479  0.146891001
 [61] -0.209840898 -0.211957162  0.221635486 -0.810245804  2.534195070
 [66] -0.984191618  0.514985631 -1.748930860 -0.714582758 -0.095946045
 [71]  1.326765994 -1.296640398  0.636665881 -0.774672639 -0.258005716
 [76] -1.705386123  2.345276056 -0.096261388  0.500488853  0.730753308
 [81]  0.203534094  1.731247023  1.183255725 -1.150353311  3.506565085
 [86] -0.262948525 -1.035770982  0.971262483 -0.306967849 -0.541680591
 [91]  0.655918068 -1.195001026 -0.564807610  1.591753375  0.066899250
 [96]  0.047395754 -0.497196323  0.643863684  1.788133468  0.143071440
> rowVars(tmp2)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowSd(tmp2)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowMax(tmp2)
  [1] -0.029225940 -0.236040936  0.806035894 -0.489103741 -1.191678397
  [6] -0.280075442 -0.299853400  1.295738844 -1.293259195 -0.282703069
 [11]  1.389578337  0.711734193 -0.031091997 -0.644394228 -0.192572206
 [16]  0.615766022  0.486770223  0.195129743  0.851619242  0.763210284
 [21]  0.356321734 -0.935491285 -0.372827578  0.645847763 -0.848528901
 [26] -0.736363322 -0.015210339 -0.339872218 -1.236018194 -0.405250110
 [31]  0.213584931  0.360406568  0.245586828 -0.415616780 -0.038707339
 [36]  1.100776124 -0.917845823  0.905780326 -0.222794042 -0.688014089
 [41]  0.482033301 -0.067070583  0.702484137 -1.297408808 -0.845192243
 [46] -0.524284859  0.598460739  0.520009550  0.329569477  0.741309639
 [51]  0.300024989 -0.101102802  1.045247761  0.006985369 -2.054367436
 [56] -0.628967784 -0.027093991 -1.000515429  0.708662479  0.146891001
 [61] -0.209840898 -0.211957162  0.221635486 -0.810245804  2.534195070
 [66] -0.984191618  0.514985631 -1.748930860 -0.714582758 -0.095946045
 [71]  1.326765994 -1.296640398  0.636665881 -0.774672639 -0.258005716
 [76] -1.705386123  2.345276056 -0.096261388  0.500488853  0.730753308
 [81]  0.203534094  1.731247023  1.183255725 -1.150353311  3.506565085
 [86] -0.262948525 -1.035770982  0.971262483 -0.306967849 -0.541680591
 [91]  0.655918068 -1.195001026 -0.564807610  1.591753375  0.066899250
 [96]  0.047395754 -0.497196323  0.643863684  1.788133468  0.143071440
> rowMin(tmp2)
  [1] -0.029225940 -0.236040936  0.806035894 -0.489103741 -1.191678397
  [6] -0.280075442 -0.299853400  1.295738844 -1.293259195 -0.282703069
 [11]  1.389578337  0.711734193 -0.031091997 -0.644394228 -0.192572206
 [16]  0.615766022  0.486770223  0.195129743  0.851619242  0.763210284
 [21]  0.356321734 -0.935491285 -0.372827578  0.645847763 -0.848528901
 [26] -0.736363322 -0.015210339 -0.339872218 -1.236018194 -0.405250110
 [31]  0.213584931  0.360406568  0.245586828 -0.415616780 -0.038707339
 [36]  1.100776124 -0.917845823  0.905780326 -0.222794042 -0.688014089
 [41]  0.482033301 -0.067070583  0.702484137 -1.297408808 -0.845192243
 [46] -0.524284859  0.598460739  0.520009550  0.329569477  0.741309639
 [51]  0.300024989 -0.101102802  1.045247761  0.006985369 -2.054367436
 [56] -0.628967784 -0.027093991 -1.000515429  0.708662479  0.146891001
 [61] -0.209840898 -0.211957162  0.221635486 -0.810245804  2.534195070
 [66] -0.984191618  0.514985631 -1.748930860 -0.714582758 -0.095946045
 [71]  1.326765994 -1.296640398  0.636665881 -0.774672639 -0.258005716
 [76] -1.705386123  2.345276056 -0.096261388  0.500488853  0.730753308
 [81]  0.203534094  1.731247023  1.183255725 -1.150353311  3.506565085
 [86] -0.262948525 -1.035770982  0.971262483 -0.306967849 -0.541680591
 [91]  0.655918068 -1.195001026 -0.564807610  1.591753375  0.066899250
 [96]  0.047395754 -0.497196323  0.643863684  1.788133468  0.143071440
> 
> colMeans(tmp2)
[1] 0.04719301
> colSums(tmp2)
[1] 4.719301
> colVars(tmp2)
[1] 0.8679658
> colSd(tmp2)
[1] 0.9316468
> colMax(tmp2)
[1] 3.506565
> colMin(tmp2)
[1] -2.054367
> colMedians(tmp2)
[1] -0.03015897
> colRanges(tmp2)
          [,1]
[1,] -2.054367
[2,]  3.506565
> 
> dataset1 <- matrix(dataset1,1,100)
> 
> agree.checks(tmp,dataset1)
> 
> dataset2 <- matrix(dataset2,100,1)
> agree.checks(tmp2,dataset2)
>   
> 
> tmp <- createBufferedMatrix(10,10)
> 
> tmp[1:10,1:10] <- rnorm(100)
> colApply(tmp,sum)
 [1] -2.6852221 -3.5123413  4.5101162  2.8841053 -0.5055319  0.2984685
 [7]  0.6263562 -6.2773569 -4.1308423  2.4285314
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -1.6331093
[2,] -1.3256364
[3,] -0.2887796
[4,]  0.6820880
[5,]  1.4732753
> 
> rowApply(tmp,sum)
 [1] -1.5207979 -2.6685012  0.5923065 -8.5555078  4.3616686  2.9000000
 [7]  1.6855165 -4.3314877  2.2976021 -1.1245159
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    2   10    1    4    3    6    6   10    7     1
 [2,]    4    8    5    2    5    1    7    8    4     3
 [3,]    3    3    9    9   10    9    5    9    6     5
 [4,]    1    7    7    6    7   10   10    7    8     4
 [5,]    5    6    4    5    8    8    3    4    5     8
 [6,]    7    1    8    8    6    5    2    6    3    10
 [7,]    6    5    6   10    4    7    9    2   10     2
 [8,]    8    9    2    1    1    3    1    5    2     7
 [9,]    9    4    3    3    2    4    8    3    1     6
[10,]   10    2   10    7    9    2    4    1    9     9
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1] -1.6162107 -0.7067806 -2.2254591  4.4667423 -2.7439955 -1.5719335
 [7]  1.9919966 -3.9288521  5.6087685 -3.5358852  3.5096332  2.1860799
[13]  0.9932990 -1.8588254 -1.7956197  0.7952642 -0.5590971  2.4081313
[19]  4.3325053  1.4998166
> colApply(tmp,quantile)[,1]
            [,1]
[1,] -1.33339805
[2,] -0.73522067
[3,] -0.05153047
[4,]  0.18206862
[5,]  0.32186984
> 
> rowApply(tmp,sum)
[1]  3.4706385  7.0217894  0.9436081 -0.5708596 -3.6155986
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]    6    2   13   12   12
[2,]   10    6    9   17    4
[3,]    9   14    1   10   11
[4,]   17   18    7   19   16
[5,]    4    5   10    2   13
> 
> 
> as.matrix(tmp)
            [,1]        [,2]        [,3]        [,4]        [,5]       [,6]
[1,] -0.73522067  0.16808697 -0.03037946  1.02547781 -0.92622355 -1.2550700
[2,] -1.33339805 -0.37041109  0.79568077  1.54761656 -0.43135638  0.9006842
[3,]  0.32186984  0.05280659 -2.85033474 -0.07426961  0.08683344  0.6103176
[4,]  0.18206862  0.62532487  0.06986169  1.27251837 -1.66037381  0.2966201
[5,] -0.05153047 -1.18258799 -0.21028734  0.69539914  0.18712479 -2.1244854
           [,7]       [,8]      [,9]      [,10]      [,11]      [,12]
[1,]  1.4669702 -1.2155125  2.353068  0.5735320  1.1448882  0.7163146
[2,]  1.5423226 -1.9198575  1.485614 -1.1424824  2.1335896  0.4800735
[3,] -0.4647771  0.7044298  1.701724 -0.1554495 -0.4876131  0.8263038
[4,]  0.1626113  0.1937743  1.421978 -2.1616250 -0.3863084 -0.1302845
[5,] -0.7151304 -1.6916863 -1.353616 -0.6498603  1.1050769  0.2936724
           [,13]      [,14]       [,15]      [,16]      [,17]       [,18]
[1,] -0.05509216 -1.2697675 -0.82913950  0.2392993  0.6011503 -0.11556065
[2,] -0.25365364  0.6922967 -0.03231966  0.7452751  0.5790151  0.03456514
[3,]  0.26573741  0.2488751 -1.56053302  0.3623995 -1.1297576  1.23183174
[4,]  0.26259743 -1.1203934 -0.22933195 -0.3141322 -0.3454367  0.02506032
[5,]  0.77370992 -0.4098363  0.85570447 -0.2375775 -0.2640682  1.23223476
           [,19]      [,20]
[1,]  0.79427921  0.8195378
[2,]  2.06645522 -0.4979207
[3,] -0.00328829  1.2565024
[4,]  0.88344447  0.3811666
[5,]  0.59161465 -0.4594696
> 
> 
> is.BufferedMatrix(tmp)
[1] TRUE
> 
> as.BufferedMatrix(as.matrix(tmp))
BufferedMatrix object
Matrix size:  5 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  800  bytes.
> 
> 
> 
> subBufferedMatrix(tmp,1:5,1:5)
BufferedMatrix object
Matrix size:  5 5 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  653  bytes.
Disk usage :  200  bytes.
> subBufferedMatrix(tmp,,5:8)
BufferedMatrix object
Matrix size:  5 4 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  565  bytes.
Disk usage :  160  bytes.
> subBufferedMatrix(tmp,1:3,)
BufferedMatrix object
Matrix size:  3 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  480  bytes.
> 
> 
> rm(tmp)
> 
> 
> ###
> ### Testing colnames and rownames
> ###
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> 
> 
> colnames(tmp)
NULL
> rownames(tmp)
NULL
> 
> 
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> colnames(tmp)
 [1] "col1"  "col2"  "col3"  "col4"  "col5"  "col6"  "col7"  "col8"  "col9" 
[10] "col10" "col11" "col12" "col13" "col14" "col15" "col16" "col17" "col18"
[19] "col19" "col20"
> rownames(tmp)
[1] "row1" "row2" "row3" "row4" "row5"
> 
> 
> tmp["row1",]
         col1       col2      col3       col4       col5     col6       col7
row1 1.657201 -0.4852663 0.5928942 -0.3479973 -0.4498446 1.209066 -0.2744235
          col8       col9     col10      col11     col12      col13     col14
row1 0.8793397 -0.6465412 0.3395428 -0.9503208 0.9974307 -0.7740555 0.8153249
          col15      col16      col17     col18    col19      col20
row1 -0.4974729 -0.2969137 -0.7534366 -1.348207 -0.34719 -0.2457591
> tmp[,"col10"]
          col10
row1  0.3395428
row2  0.6271461
row3  1.5153614
row4  0.1682191
row5 -0.2854076
> tmp[c("row1","row5"),]
           col1       col2       col3       col4       col5      col6
row1  1.6572012 -0.4852663  0.5928942 -0.3479973 -0.4498446 1.2090661
row5 -0.2949942 -2.2119814 -0.8161395 -0.4948439  0.1573544 0.3866217
           col7      col8       col9      col10      col11      col12
row1 -0.2744235 0.8793397 -0.6465412  0.3395428 -0.9503208 0.99743069
row5 -0.2788412 1.5807783  0.4562956 -0.2854076  0.4239054 0.02466946
          col13      col14      col15      col16      col17      col18
row1 -0.7740555  0.8153249 -0.4974729 -0.2969137 -0.7534366 -1.3482066
row5  0.4273826 -0.8370304 -1.6269612 -0.1295914 -1.5869197  0.7518598
          col19       col20
row1 -0.3471900 -0.24575908
row5 -0.2666134  0.06178087
> tmp[,c("col6","col20")]
            col6       col20
row1  1.20906605 -0.24575908
row2 -0.85376597 -0.22535793
row3  0.08157172  1.57650003
row4 -0.37092315  0.56553278
row5  0.38662167  0.06178087
> tmp[c("row1","row5"),c("col6","col20")]
          col6       col20
row1 1.2090661 -0.24575908
row5 0.3866217  0.06178087
> 
> 
> 
> 
> 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 50.19641 50.07147 49.73319 50.86 48.52089 104.4266 47.43453 50.102
         col9    col10    col11    col12    col13    col14    col15    col16
row1 50.33024 50.54556 49.45093 48.25714 50.02011 49.79185 51.10961 49.04337
        col17   col18    col19    col20
row1 49.33396 48.3033 50.45623 105.5024
> tmp[,"col10"]
        col10
row1 50.54556
row2 30.05612
row3 30.52828
row4 30.33382
row5 50.45649
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 50.19641 50.07147 49.73319 50.86000 48.52089 104.4266 47.43453 50.10200
row5 51.98181 49.81700 49.77157 52.15725 50.42558 103.9127 49.74033 50.92579
         col9    col10    col11    col12    col13    col14    col15    col16
row1 50.33024 50.54556 49.45093 48.25714 50.02011 49.79185 51.10961 49.04337
row5 48.87669 50.45649 51.88381 49.92246 50.78227 48.56496 49.70673 48.04322
        col17    col18    col19    col20
row1 49.33396 48.30330 50.45623 105.5024
row5 49.34549 49.98154 50.12873 103.1057
> tmp[,c("col6","col20")]
          col6     col20
row1 104.42658 105.50244
row2  74.82737  74.89943
row3  74.52620  76.02124
row4  75.24535  76.55143
row5 103.91272 103.10567
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 104.4266 105.5024
row5 103.9127 103.1057
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 104.4266 105.5024
row5 103.9127 103.1057
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
           col13
[1,]  1.35155449
[2,] -0.70801114
[3,]  0.85242147
[4,] -0.46364535
[5,]  0.07335349
> tmp[,c("col17","col7")]
          col17        col7
[1,]  0.1209475  0.04706898
[2,]  1.1438021 -2.31377958
[3,]  0.4595337  1.63403086
[4,] -0.6334983  0.67939944
[5,]  0.6373118 -0.22699262
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
            col6      col20
[1,] -0.76912495  0.9413168
[2,]  1.69723506  1.3065980
[3,]  0.02424555 -0.4933154
[4,] -0.85730109 -0.7574883
[5,]  1.25546400 -0.1423217
> subBufferedMatrix(tmp,1,c("col6"))[,1]
          col1
[1,] -0.769125
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
          col6
[1,] -0.769125
[2,]  1.697235
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> 
> 
> 
> subBufferedMatrix(tmp,c("row3","row1"),)[,1:20]
           [,1]       [,2]       [,3]       [,4]        [,5]      [,6]
row3  0.4206648 0.09074227 -1.0026471 -0.6731617 -0.02900406 0.9491517
row1 -0.1069188 1.51820159 -0.9540459 -0.1579290 -1.18050104 0.2299676
           [,7]      [,8]      [,9]       [,10]      [,11]     [,12]      [,13]
row3  0.2004055 -0.187907 -0.427251  0.48945049  0.8301043 -0.922640 -0.9080199
row1 -0.6417455 -1.556132 -1.636011 -0.09565804 -1.1523215  1.639589  1.9658160
           [,14]      [,15]      [,16]     [,17]      [,18]      [,19]
row3 -0.79900176 -0.1009259 -1.1327208 0.7077924 -0.6833599 -0.2085422
row1  0.03620607  0.5700573 -0.6720269 0.8963566  0.6111853  0.6008651
          [,20]
row3 -1.2226934
row1  0.9378874
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
          [,1]     [,2]       [,3]        [,4]       [,5]      [,6]      [,7]
row2 -1.633253 1.049936 -0.5094249 -0.04592207 -0.2104276 0.6309547 0.1113828
         [,8]      [,9]   [,10]
row2 1.805978 -1.583401 1.15981
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
           [,1]      [,2]       [,3]      [,4]       [,5]      [,6]     [,7]
row5 -0.5894288 0.7650777 -0.3087594 -1.073463 -0.6817247 -0.854294 1.792186
           [,8]      [,9]     [,10]     [,11]      [,12]     [,13]   [,14]
row5 -0.5117747 0.6539438 -1.414691 0.8926792 -0.5136855 0.2803762 2.94752
          [,15]     [,16]      [,17]      [,18]     [,19]    [,20]
row5 -0.4754738 0.1985501 -0.8238967 -0.2105768 0.4299898 1.884089
> 
> 
> 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: 0x2df6dbd0>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM12fd6d628e1af" 
 [2] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM12fd6d6abd86d7"
 [3] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM12fd6d73f2a42e"
 [4] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM12fd6d8783853" 
 [5] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM12fd6d696a6fa4"
 [6] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM12fd6d18de087d"
 [7] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM12fd6d46eb32f9"
 [8] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM12fd6d2683dc9" 
 [9] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM12fd6d3547dfe4"
[10] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM12fd6d323ac614"
[11] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM12fd6d391806e6"
[12] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM12fd6d7b9f13ba"
[13] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM12fd6d7e83c00b"
[14] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM12fd6d53386c61"
[15] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM12fd6d24f12e8b"
> 
> 
> ### 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: 0x2d293a30>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x2d293a30>
Warning message:
In dir.create(new.directory) :
  '/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x2d293a30>
> rowMedians(tmp)
  [1]  0.045716137 -0.145922842 -0.086219435  0.500703399  0.260619210
  [6]  0.018815345 -0.279521758  0.410970012  0.630055114 -0.098532860
 [11]  1.081060182 -0.126214265  0.190806259  0.193171982 -0.103760819
 [16] -0.196291004  0.117008722 -0.265425059 -0.368366552  0.142961850
 [21] -0.041704733 -0.127231548 -0.161305127  0.251385441  0.161854905
 [26] -0.449743489 -0.404033269 -0.048985065  0.225948963  0.308329272
 [31]  0.414594331  0.223526289 -0.220562608 -0.342445890 -0.124215547
 [36] -0.050432339  0.420922936  0.036980670 -0.101011989  0.375877118
 [41] -0.072232353  0.273993021 -0.226517802  0.034528934 -0.305308090
 [46]  0.152877054  0.593199107  0.257853246  0.194969991  0.265894796
 [51] -0.022425186 -0.766103265  0.843934842 -0.110538359 -0.191653513
 [56] -0.166865973 -0.230210098  0.404196851 -0.006416793 -0.052917890
 [61]  0.393429383 -0.073103637  0.324771865  0.356941669  0.066214417
 [66] -0.168161760 -0.583583273 -0.041461700  0.093134542  0.113563316
 [71]  0.419840928 -0.620769860 -0.237576195  0.393004863 -0.375108515
 [76] -0.065165022  0.194999001 -0.330565551  0.049579498  0.754087865
 [81]  0.320486700  0.164990879 -0.475620880  0.114321359 -0.177806153
 [86] -0.248182872 -0.167544065  0.220186708  0.156998130 -0.162738727
 [91] -0.053273179  0.385080349  0.147657256  0.504227592  0.289692147
 [96]  0.098636079  0.400944282  0.174247351  0.453176422 -0.009342419
[101]  0.275661661 -0.244252550  0.153526954 -0.389183833  0.426690601
[106] -0.471477209 -0.332690693 -0.394315086 -0.428094176 -0.079936051
[111] -0.053957725  0.152894537  0.062954523 -0.377045159  0.255644737
[116] -0.463583764 -0.007019993 -0.273880403  0.296860267 -0.196254370
[121]  0.112076157  0.242057882 -1.462318167  0.381263428  0.281463576
[126]  0.542879452 -0.129101701 -0.013905109  0.473473435  0.363668434
[131]  0.420202331  0.231509053  0.019116774 -0.635695553  0.174669182
[136] -0.352801737 -0.471055914 -0.121186408  0.314017755  0.176657111
[141] -0.391027251  0.108354759  0.308266157 -0.353002574  0.291570162
[146]  0.069222112  0.035725178  0.425271827 -0.081163785  0.022039502
[151] -0.056393754  0.106334129  0.009785904 -0.183235061  0.342888981
[156]  0.412732250  0.117971257  0.070618714  0.113306370  0.323271986
[161] -0.151345807 -0.024857363 -0.675815419 -0.355751809  0.136208953
[166]  0.058524602 -0.389671308  0.508327375  0.133795909 -0.128719475
[171] -0.322794095  0.097283919  0.324814746  0.656171253  0.280235746
[176]  0.304963370  0.126688022 -0.256150680 -0.047812407 -0.084630338
[181] -0.236263049  0.450197638 -0.085073901  0.408396564 -0.384247270
[186]  0.272516044  0.558106295  0.110589498 -0.187335490  0.055268802
[191] -0.293047000 -0.021939178 -0.240938083  0.181984391  0.149630845
[196]  0.353270353  0.347244465 -0.508119103  0.148384459  0.011307253
[201] -0.232392549 -0.016231715  0.267344369 -0.634615370 -0.014839985
[206] -0.012545604 -0.243423183  0.249356722  0.131702085  0.430013731
[211] -0.113429183  0.421752560 -0.248880407 -0.316263652 -0.197633981
[216]  0.044353696 -0.260657167  0.127063813 -0.186821911  0.364556676
[221] -0.409062154 -0.434397239 -0.049246791 -0.668043422  0.288741254
[226]  0.075519804 -0.055583336  0.029735349  0.424879800 -0.038110502
> 
> proc.time()
   user  system elapsed 
  1.953   0.817   2.796 

BufferedMatrix.Rcheck/tests/rawCalltesting.Rout


R version 4.5.0 (2025-04-11) -- "How About a Twenty-Six"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: aarch64-unknown-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: 0xe143ff0>
> .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: 0xe143ff0>
> .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: 0xe143ff0>
> .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: 0xe143ff0>
> 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: 0xe0290e0>
> .Call("R_bm_AddColumn",P)
<pointer: 0xe0290e0>
> .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: 0xe0290e0>
> .Call("R_bm_AddColumn",P)
<pointer: 0xe0290e0>
> .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: 0xe0290e0>
> 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: 0xcfb0520>
> .Call("R_bm_AddColumn",P)
<pointer: 0xcfb0520>
> .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: 0xcfb0520>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0xcfb0520>
> .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: 0xcfb0520>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0xcfb0520>
> .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: 0xcfb0520>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0xcfb0520>
> .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: 0xcfb0520>
> 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: 0xc9b4720>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0xc9b4720>
> .Call("R_bm_AddColumn",P)
<pointer: 0xc9b4720>
> .Call("R_bm_AddColumn",P)
<pointer: 0xc9b4720>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile12fda7641ff4a5" "BufferedMatrixFile12fda79bce04a" 
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile12fda7641ff4a5" "BufferedMatrixFile12fda79bce04a" 
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0xd8a47d0>
> .Call("R_bm_AddColumn",P)
<pointer: 0xd8a47d0>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0xd8a47d0>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0xd8a47d0>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0xd8a47d0>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0xd8a47d0>
> .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: 0xd9abc90>
> .Call("R_bm_AddColumn",P)
<pointer: 0xd9abc90>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0xd9abc90>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0xd9abc90>
> 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: 0xec54110>
> .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: 0xec54110>
> rm(P)
> 
> proc.time()
   user  system elapsed 
  0.328   0.038   0.352 

BufferedMatrix.Rcheck/tests/Rcodetesting.Rout


R version 4.5.0 (2025-04-11) -- "How About a Twenty-Six"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: aarch64-unknown-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.367   0.021   0.374 

Example timings