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

This page was generated on 2025-09-01 11:38 -0400 (Mon, 01 Sep 2025).

HostnameOSArch (*)R versionInstalled pkgs
nebbiolo1Linux (Ubuntu 24.04.3 LTS)x86_644.5.1 (2025-06-13) -- "Great Square Root" 4824
merida1macOS 12.7.5 Montereyx86_644.5.1 RC (2025-06-05 r88288) -- "Great Square Root" 4606
kjohnson1macOS 13.6.6 Venturaarm644.5.1 Patched (2025-06-14 r88325) -- "Great Square Root" 4547
kunpeng2Linux (openEuler 24.03 LTS)aarch64R Under development (unstable) (2025-02-19 r87757) -- "Unsuffered Consequences" 4579
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 252/2341HostnameOS / ArchINSTALLBUILDCHECKBUILD BIN
BufferedMatrix 1.72.0  (landing page)
Ben Bolstad
Snapshot Date: 2025-08-28 13:40 -0400 (Thu, 28 Aug 2025)
git_url: https://git.bioconductor.org/packages/BufferedMatrix
git_branch: RELEASE_3_21
git_last_commit: aa9e634
git_last_commit_date: 2025-04-15 09:39:39 -0400 (Tue, 15 Apr 2025)
nebbiolo1Linux (Ubuntu 24.04.3 LTS) / x86_64  OK    OK    OK  UNNEEDED, same version is already published
merida1macOS 12.7.5 Monterey / x86_64  OK    OK    WARNINGS    OK  UNNEEDED, same version is already published
kjohnson1macOS 13.6.6 Ventura / arm64  OK    OK    WARNINGS    OK  UNNEEDED, same version is already published
kunpeng2Linux (openEuler 24.03 LTS) / aarch64  OK    OK    OK  


CHECK results for BufferedMatrix on nebbiolo1

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

raw results


Summary

Package: BufferedMatrix
Version: 1.72.0
Command: /home/biocbuild/bbs-3.21-bioc/R/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/home/biocbuild/bbs-3.21-bioc/R/site-library --timings BufferedMatrix_1.72.0.tar.gz
StartedAt: 2025-08-31 20:40:08 -0400 (Sun, 31 Aug 2025)
EndedAt: 2025-08-31 20:40:33 -0400 (Sun, 31 Aug 2025)
EllapsedTime: 25.1 seconds
RetCode: 0
Status:   OK  
CheckDir: BufferedMatrix.Rcheck
Warnings: 0

Command output

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


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

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


Installation output

BufferedMatrix.Rcheck/00install.out

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


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

Tests output

BufferedMatrix.Rcheck/tests/c_code_level_tests.Rout


R version 4.5.1 (2025-06-13) -- "Great Square Root"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu

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

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

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

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

Attaching package: 'BufferedMatrix'

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

    colMeans, colSums, rowMeans, rowSums

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

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

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

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

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

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

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

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

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

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

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

[[1]]
[1] 0

> 
> proc.time()
   user  system elapsed 
  0.259   0.054   0.300 

BufferedMatrix.Rcheck/tests/objectTesting.Rout


R version 4.5.1 (2025-06-13) -- "Great Square Root"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu

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

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

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

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

Attaching package: 'BufferedMatrix'

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

    colMeans, colSums, rowMeans, rowSums

> 
> 
> ### this is used to control how many repetitions in something below
> ### higher values result in more checks.
> nreps <-100 ##20000
> 
> 
> ## test creation and some simple assignments and subsetting operations
> 
> ## first on single elements
> tmp <- createBufferedMatrix(1000,10)
> 
> tmp[10,5]
[1] 0
> tmp[10,5] <- 10
> tmp[10,5]
[1] 10
> tmp[10,5] <- 12.445
> tmp[10,5]
[1] 12.445
> 
> 
> 
> ## now testing accessing multiple elements
> tmp2 <- createBufferedMatrix(10,20)
> 
> 
> tmp2[3,1] <- 51.34
> tmp2[9,2] <- 9.87654
> tmp2[,1:2]
       [,1]    [,2]
 [1,]  0.00 0.00000
 [2,]  0.00 0.00000
 [3,] 51.34 0.00000
 [4,]  0.00 0.00000
 [5,]  0.00 0.00000
 [6,]  0.00 0.00000
 [7,]  0.00 0.00000
 [8,]  0.00 0.00000
 [9,]  0.00 9.87654
[10,]  0.00 0.00000
> tmp2[,-(3:20)]
       [,1]    [,2]
 [1,]  0.00 0.00000
 [2,]  0.00 0.00000
 [3,] 51.34 0.00000
 [4,]  0.00 0.00000
 [5,]  0.00 0.00000
 [6,]  0.00 0.00000
 [7,]  0.00 0.00000
 [8,]  0.00 0.00000
 [9,]  0.00 9.87654
[10,]  0.00 0.00000
> tmp2[3,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
[1,] 51.34    0    0    0    0    0    0    0    0     0     0     0     0
     [,14] [,15] [,16] [,17] [,18] [,19] [,20]
[1,]     0     0     0     0     0     0     0
> tmp2[-3,]
      [,1]    [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [2,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [3,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [4,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [5,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [6,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [7,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [8,]    0 9.87654    0    0    0    0    0    0    0     0     0     0     0
 [9,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
      [,14] [,15] [,16] [,17] [,18] [,19] [,20]
 [1,]     0     0     0     0     0     0     0
 [2,]     0     0     0     0     0     0     0
 [3,]     0     0     0     0     0     0     0
 [4,]     0     0     0     0     0     0     0
 [5,]     0     0     0     0     0     0     0
 [6,]     0     0     0     0     0     0     0
 [7,]     0     0     0     0     0     0     0
 [8,]     0     0     0     0     0     0     0
 [9,]     0     0     0     0     0     0     0
> tmp2[2,1:3]
     [,1] [,2] [,3]
[1,]    0    0    0
> tmp2[3:9,1:3]
      [,1]    [,2] [,3]
[1,] 51.34 0.00000    0
[2,]  0.00 0.00000    0
[3,]  0.00 0.00000    0
[4,]  0.00 0.00000    0
[5,]  0.00 0.00000    0
[6,]  0.00 0.00000    0
[7,]  0.00 9.87654    0
> tmp2[-4,-4]
       [,1]    [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [2,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [3,] 51.34 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [4,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [5,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [6,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [7,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [8,]  0.00 9.87654    0    0    0    0    0    0    0     0     0     0     0
 [9,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
      [,14] [,15] [,16] [,17] [,18] [,19]
 [1,]     0     0     0     0     0     0
 [2,]     0     0     0     0     0     0
 [3,]     0     0     0     0     0     0
 [4,]     0     0     0     0     0     0
 [5,]     0     0     0     0     0     0
 [6,]     0     0     0     0     0     0
 [7,]     0     0     0     0     0     0
 [8,]     0     0     0     0     0     0
 [9,]     0     0     0     0     0     0
> 
> ## now testing accessing/assigning multiple elements
> tmp3 <- createBufferedMatrix(10,10)
> 
> for (i in 1:10){
+   for (j in 1:10){
+     tmp3[i,j] <- (j-1)*10 + i
+   }
+ }
> 
> tmp3[2:4,2:4]
     [,1] [,2] [,3]
[1,]   12   22   32
[2,]   13   23   33
[3,]   14   24   34
> tmp3[c(-10),c(2:4,2:4,10,1,2,1:10,10:1)]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]   11   21   31   11   21   31   91    1   11     1    11    21    31
 [2,]   12   22   32   12   22   32   92    2   12     2    12    22    32
 [3,]   13   23   33   13   23   33   93    3   13     3    13    23    33
 [4,]   14   24   34   14   24   34   94    4   14     4    14    24    34
 [5,]   15   25   35   15   25   35   95    5   15     5    15    25    35
 [6,]   16   26   36   16   26   36   96    6   16     6    16    26    36
 [7,]   17   27   37   17   27   37   97    7   17     7    17    27    37
 [8,]   18   28   38   18   28   38   98    8   18     8    18    28    38
 [9,]   19   29   39   19   29   39   99    9   19     9    19    29    39
      [,14] [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24] [,25]
 [1,]    41    51    61    71    81    91    91    81    71    61    51    41
 [2,]    42    52    62    72    82    92    92    82    72    62    52    42
 [3,]    43    53    63    73    83    93    93    83    73    63    53    43
 [4,]    44    54    64    74    84    94    94    84    74    64    54    44
 [5,]    45    55    65    75    85    95    95    85    75    65    55    45
 [6,]    46    56    66    76    86    96    96    86    76    66    56    46
 [7,]    47    57    67    77    87    97    97    87    77    67    57    47
 [8,]    48    58    68    78    88    98    98    88    78    68    58    48
 [9,]    49    59    69    79    89    99    99    89    79    69    59    49
      [,26] [,27] [,28] [,29]
 [1,]    31    21    11     1
 [2,]    32    22    12     2
 [3,]    33    23    13     3
 [4,]    34    24    14     4
 [5,]    35    25    15     5
 [6,]    36    26    16     6
 [7,]    37    27    17     7
 [8,]    38    28    18     8
 [9,]    39    29    19     9
> tmp3[-c(1:5),-c(6:10)]
     [,1] [,2] [,3] [,4] [,5]
[1,]    6   16   26   36   46
[2,]    7   17   27   37   47
[3,]    8   18   28   38   48
[4,]    9   19   29   39   49
[5,]   10   20   30   40   50
> 
> ## assignment of whole columns
> tmp3[,1] <- c(1:10*100.0)
> tmp3[,1:2] <- tmp3[,1:2]*100
> tmp3[,1:2] <- tmp3[,2:1]
> tmp3[,1:2]
      [,1]  [,2]
 [1,] 1100 1e+04
 [2,] 1200 2e+04
 [3,] 1300 3e+04
 [4,] 1400 4e+04
 [5,] 1500 5e+04
 [6,] 1600 6e+04
 [7,] 1700 7e+04
 [8,] 1800 8e+04
 [9,] 1900 9e+04
[10,] 2000 1e+05
> 
> 
> tmp3[,-1] <- tmp3[,1:9]
> tmp3[,1:10]
      [,1] [,2]  [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,] 1100 1100 1e+04   21   31   41   51   61   71    81
 [2,] 1200 1200 2e+04   22   32   42   52   62   72    82
 [3,] 1300 1300 3e+04   23   33   43   53   63   73    83
 [4,] 1400 1400 4e+04   24   34   44   54   64   74    84
 [5,] 1500 1500 5e+04   25   35   45   55   65   75    85
 [6,] 1600 1600 6e+04   26   36   46   56   66   76    86
 [7,] 1700 1700 7e+04   27   37   47   57   67   77    87
 [8,] 1800 1800 8e+04   28   38   48   58   68   78    88
 [9,] 1900 1900 9e+04   29   39   49   59   69   79    89
[10,] 2000 2000 1e+05   30   40   50   60   70   80    90
> 
> tmp3[,1:2] <- rep(1,10)
> tmp3[,1:2] <- rep(1,20)
> tmp3[,1:2] <- matrix(c(1:5),1,5)
> 
> tmp3[,-c(1:8)] <- matrix(c(1:5),1,5)
> 
> tmp3[1,] <- 1:10
> tmp3[1,]
     [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,]    1    2    3    4    5    6    7    8    9    10
> tmp3[-1,] <- c(1,2)
> tmp3[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    1    2    3    4    5    6    7    8    9    10
 [2,]    1    2    1    2    1    2    1    2    1     2
 [3,]    2    1    2    1    2    1    2    1    2     1
 [4,]    1    2    1    2    1    2    1    2    1     2
 [5,]    2    1    2    1    2    1    2    1    2     1
 [6,]    1    2    1    2    1    2    1    2    1     2
 [7,]    2    1    2    1    2    1    2    1    2     1
 [8,]    1    2    1    2    1    2    1    2    1     2
 [9,]    2    1    2    1    2    1    2    1    2     1
[10,]    1    2    1    2    1    2    1    2    1     2
> tmp3[-c(1:8),] <- matrix(c(1:5),1,5)
> tmp3[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    1    2    3    4    5    6    7    8    9    10
 [2,]    1    2    1    2    1    2    1    2    1     2
 [3,]    2    1    2    1    2    1    2    1    2     1
 [4,]    1    2    1    2    1    2    1    2    1     2
 [5,]    2    1    2    1    2    1    2    1    2     1
 [6,]    1    2    1    2    1    2    1    2    1     2
 [7,]    2    1    2    1    2    1    2    1    2     1
 [8,]    1    2    1    2    1    2    1    2    1     2
 [9,]    1    3    5    2    4    1    3    5    2     4
[10,]    2    4    1    3    5    2    4    1    3     5
> 
> 
> tmp3[1:2,1:2] <- 5555.04
> tmp3[-(1:2),1:2] <- 1234.56789
> 
> 
> 
> ## testing accessors for the directory and prefix
> directory(tmp3)
[1] "/home/biocbuild/bbs-3.21-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 478417 25.6    1047105   56   639600 34.2
Vcells 885231  6.8    8388608   64  2081598 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] "Sun Aug 31 20:40:23 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] "Sun Aug 31 20:40:23 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: 0x6065a7552ad0>
> 
> 
> 
> 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] "Sun Aug 31 20:40:24 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] "Sun Aug 31 20:40:24 2025"
> 
> ColMode(tmp2)
<pointer: 0x6065a7552ad0>
> 
> 
> 
> ### 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,] 101.09519947  0.10307208 1.1209725  0.6660944
[2,]   0.01739696  1.48654485 2.3689864 -1.1421940
[3,]  -1.78312963 -0.01082322 0.8567945  0.3609484
[4,]  -0.27789715 -0.15068666 1.0905238  0.7484635
> ewApply(tmp5,abs)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.21-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,] 101.09519947 0.10307208 1.1209725 0.6660944
[2,]   0.01739696 1.48654485 2.3689864 1.1421940
[3,]   1.78312963 0.01082322 0.8567945 0.3609484
[4,]   0.27789715 0.15068666 1.0905238 0.7484635
> ewApply(tmp5,sqrt)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
           [,1]      [,2]      [,3]      [,4]
[1,] 10.0546109 0.3210484 1.0587599 0.8161461
[2,]  0.1318975 1.2192395 1.5391512 1.0687348
[3,]  1.3353388 0.1040347 0.9256319 0.6007898
[4,]  0.5271595 0.3881838 1.0442815 0.8651379
> 
> 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.21-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,] 226.64131 28.31356 36.70857 33.82756
[2,]  26.33637 38.67894 42.76050 36.82954
[3,]  40.13652 26.05117 35.11311 31.36885
[4,]  30.54949 29.03252 36.53334 34.39984
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x6065a818e960>
> exp(tmp5)
<pointer: 0x6065a818e960>
> log(tmp5,2)
<pointer: 0x6065a818e960>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 471.7242
> Min(tmp5)
[1] 54.0026
> mean(tmp5)
[1] 71.94043
> Sum(tmp5)
[1] 14388.09
> Var(tmp5)
[1] 877.5391
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 91.30255 67.88687 71.56697 69.13849 68.14797 68.72668 67.24538 71.48467
 [9] 73.97242 69.93226
> rowSums(tmp5)
 [1] 1826.051 1357.737 1431.339 1382.770 1362.959 1374.534 1344.908 1429.693
 [9] 1479.448 1398.645
> rowVars(tmp5)
 [1] 8071.20932   81.84358   65.06880   68.11659   46.07373   18.58889
 [7]   34.86348  110.94066  110.17166  105.83578
> rowSd(tmp5)
 [1] 89.839909  9.046744  8.066524  8.253277  6.787764  4.311483  5.904530
 [8] 10.532837 10.496269 10.287652
> rowMax(tmp5)
 [1] 471.72419  89.00038  86.29992  83.75739  79.79061  78.86182  80.03121
 [8]  87.51468  90.93890  89.43641
> rowMin(tmp5)
 [1] 58.93096 54.81571 54.22210 55.49732 54.50357 60.91257 60.24762 54.00260
 [9] 57.13932 54.47079
> 
> colMeans(tmp5)
 [1] 107.24565  69.17083  71.94759  67.37605  67.77238  72.03864  73.88447
 [8]  69.28025  70.27534  70.22738  69.14036  70.37643  71.31445  73.72310
[15]  69.73105  70.00304  71.67336  69.42794  67.17530  67.02489
> colSums(tmp5)
 [1] 1072.4565  691.7083  719.4759  673.7605  677.7238  720.3864  738.8447
 [8]  692.8025  702.7534  702.2738  691.4036  703.7643  713.1445  737.2310
[15]  697.3105  700.0304  716.7336  694.2794  671.7530  670.2489
> colVars(tmp5)
 [1] 16515.18916   107.78215    95.69052    46.70006    13.31004    50.86648
 [7]    71.49344    47.86733    88.08609    29.14565    21.29389    73.40349
[13]   104.97872   130.08874   123.16452    57.32942   130.84973    82.59056
[19]    23.60462    51.42782
> colSd(tmp5)
 [1] 128.511436  10.381818   9.782153   6.833744   3.648293   7.132074
 [7]   8.455380   6.918622   9.385419   5.398671   4.614531   8.567584
[13]  10.245912  11.405645  11.097951   7.571619  11.438957   9.087935
[19]   4.858459   7.171320
> colMax(tmp5)
 [1] 471.72419  86.05036  89.00038  76.65587  74.11611  78.75202  90.93890
 [8]  82.46943  90.78667  81.28117  77.61391  85.33570  86.09045  88.75335
[15]  89.43641  82.29246  90.81167  86.29992  77.28007  77.16901
> colMin(tmp5)
 [1] 54.81571 54.22210 54.00260 54.47079 60.95158 55.49732 62.12255 61.93115
 [9] 60.91257 64.07952 63.58858 55.85156 55.24374 56.11626 57.64568 59.32525
[17] 54.50357 56.34820 60.17268 57.13932
> 
> 
> ### 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.30255 67.88687 71.56697 69.13849 68.14797 68.72668 67.24538 71.48467
 [9]       NA 69.93226
> rowSums(tmp5)
 [1] 1826.051 1357.737 1431.339 1382.770 1362.959 1374.534 1344.908 1429.693
 [9]       NA 1398.645
> rowVars(tmp5)
 [1] 8071.20932   81.84358   65.06880   68.11659   46.07373   18.58889
 [7]   34.86348  110.94066  111.27231  105.83578
> rowSd(tmp5)
 [1] 89.839909  9.046744  8.066524  8.253277  6.787764  4.311483  5.904530
 [8] 10.532837 10.548569 10.287652
> rowMax(tmp5)
 [1] 471.72419  89.00038  86.29992  83.75739  79.79061  78.86182  80.03121
 [8]  87.51468        NA  89.43641
> rowMin(tmp5)
 [1] 58.93096 54.81571 54.22210 55.49732 54.50357 60.91257 60.24762 54.00260
 [9]       NA 54.47079
> 
> colMeans(tmp5)
 [1] 107.24565  69.17083  71.94759  67.37605  67.77238  72.03864  73.88447
 [8]  69.28025  70.27534        NA  69.14036  70.37643  71.31445  73.72310
[15]  69.73105  70.00304  71.67336  69.42794  67.17530  67.02489
> colSums(tmp5)
 [1] 1072.4565  691.7083  719.4759  673.7605  677.7238  720.3864  738.8447
 [8]  692.8025  702.7534        NA  691.4036  703.7643  713.1445  737.2310
[15]  697.3105  700.0304  716.7336  694.2794  671.7530  670.2489
> colVars(tmp5)
 [1] 16515.18916   107.78215    95.69052    46.70006    13.31004    50.86648
 [7]    71.49344    47.86733    88.08609          NA    21.29389    73.40349
[13]   104.97872   130.08874   123.16452    57.32942   130.84973    82.59056
[19]    23.60462    51.42782
> colSd(tmp5)
 [1] 128.511436  10.381818   9.782153   6.833744   3.648293   7.132074
 [7]   8.455380   6.918622   9.385419         NA   4.614531   8.567584
[13]  10.245912  11.405645  11.097951   7.571619  11.438957   9.087935
[19]   4.858459   7.171320
> colMax(tmp5)
 [1] 471.72419  86.05036  89.00038  76.65587  74.11611  78.75202  90.93890
 [8]  82.46943  90.78667        NA  77.61391  85.33570  86.09045  88.75335
[15]  89.43641  82.29246  90.81167  86.29992  77.28007  77.16901
> colMin(tmp5)
 [1] 54.81571 54.22210 54.00260 54.47079 60.95158 55.49732 62.12255 61.93115
 [9] 60.91257       NA 63.58858 55.85156 55.24374 56.11626 57.64568 59.32525
[17] 54.50357 56.34820 60.17268 57.13932
> 
> Max(tmp5,na.rm=TRUE)
[1] 471.7242
> Min(tmp5,na.rm=TRUE)
[1] 54.0026
> mean(tmp5,na.rm=TRUE)
[1] 71.97677
> Sum(tmp5,na.rm=TRUE)
[1] 14323.38
> Var(tmp5,na.rm=TRUE)
[1] 881.7056
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 91.30255 67.88687 71.56697 69.13849 68.14797 68.72668 67.24538 71.48467
 [9] 74.46006 69.93226
> rowSums(tmp5,na.rm=TRUE)
 [1] 1826.051 1357.737 1431.339 1382.770 1362.959 1374.534 1344.908 1429.693
 [9] 1414.741 1398.645
> rowVars(tmp5,na.rm=TRUE)
 [1] 8071.20932   81.84358   65.06880   68.11659   46.07373   18.58889
 [7]   34.86348  110.94066  111.27231  105.83578
> rowSd(tmp5,na.rm=TRUE)
 [1] 89.839909  9.046744  8.066524  8.253277  6.787764  4.311483  5.904530
 [8] 10.532837 10.548569 10.287652
> rowMax(tmp5,na.rm=TRUE)
 [1] 471.72419  89.00038  86.29992  83.75739  79.79061  78.86182  80.03121
 [8]  87.51468  90.93890  89.43641
> rowMin(tmp5,na.rm=TRUE)
 [1] 58.93096 54.81571 54.22210 55.49732 54.50357 60.91257 60.24762 54.00260
 [9] 57.13932 54.47079
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 107.24565  69.17083  71.94759  67.37605  67.77238  72.03864  73.88447
 [8]  69.28025  70.27534  70.84072  69.14036  70.37643  71.31445  73.72310
[15]  69.73105  70.00304  71.67336  69.42794  67.17530  67.02489
> colSums(tmp5,na.rm=TRUE)
 [1] 1072.4565  691.7083  719.4759  673.7605  677.7238  720.3864  738.8447
 [8]  692.8025  702.7534  637.5665  691.4036  703.7643  713.1445  737.2310
[15]  697.3105  700.0304  716.7336  694.2794  671.7530  670.2489
> colVars(tmp5,na.rm=TRUE)
 [1] 16515.18916   107.78215    95.69052    46.70006    13.31004    50.86648
 [7]    71.49344    47.86733    88.08609    28.55677    21.29389    73.40349
[13]   104.97872   130.08874   123.16452    57.32942   130.84973    82.59056
[19]    23.60462    51.42782
> colSd(tmp5,na.rm=TRUE)
 [1] 128.511436  10.381818   9.782153   6.833744   3.648293   7.132074
 [7]   8.455380   6.918622   9.385419   5.343853   4.614531   8.567584
[13]  10.245912  11.405645  11.097951   7.571619  11.438957   9.087935
[19]   4.858459   7.171320
> colMax(tmp5,na.rm=TRUE)
 [1] 471.72419  86.05036  89.00038  76.65587  74.11611  78.75202  90.93890
 [8]  82.46943  90.78667  81.28117  77.61391  85.33570  86.09045  88.75335
[15]  89.43641  82.29246  90.81167  86.29992  77.28007  77.16901
> colMin(tmp5,na.rm=TRUE)
 [1] 54.81571 54.22210 54.00260 54.47079 60.95158 55.49732 62.12255 61.93115
 [9] 60.91257 64.07952 63.58858 55.85156 55.24374 56.11626 57.64568 59.32525
[17] 54.50357 56.34820 60.17268 57.13932
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1] 91.30255 67.88687 71.56697 69.13849 68.14797 68.72668 67.24538 71.48467
 [9]      NaN 69.93226
> rowSums(tmp5,na.rm=TRUE)
 [1] 1826.051 1357.737 1431.339 1382.770 1362.959 1374.534 1344.908 1429.693
 [9]    0.000 1398.645
> rowVars(tmp5,na.rm=TRUE)
 [1] 8071.20932   81.84358   65.06880   68.11659   46.07373   18.58889
 [7]   34.86348  110.94066         NA  105.83578
> rowSd(tmp5,na.rm=TRUE)
 [1] 89.839909  9.046744  8.066524  8.253277  6.787764  4.311483  5.904530
 [8] 10.532837        NA 10.287652
> rowMax(tmp5,na.rm=TRUE)
 [1] 471.72419  89.00038  86.29992  83.75739  79.79061  78.86182  80.03121
 [8]  87.51468        NA  89.43641
> rowMin(tmp5,na.rm=TRUE)
 [1] 58.93096 54.81571 54.22210 55.49732 54.50357 60.91257 60.24762 54.00260
 [9]       NA 54.47079
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1] 109.56400  67.29533  72.93619  66.45960  67.54234  72.47739  71.98954
 [8]  69.21396  69.66941       NaN  69.02331  68.71429  71.48126  72.17552
[15]  70.43856  70.83315  69.54689  68.66796  67.30028  68.12329
> colSums(tmp5,na.rm=TRUE)
 [1] 986.0760 605.6580 656.4257 598.1364 607.8810 652.2965 647.9058 622.9256
 [9] 627.0247   0.0000 621.2098 618.4286 643.3313 649.5797 633.9470 637.4983
[17] 625.9220 618.0116 605.7025 613.1096
> colVars(tmp5,na.rm=TRUE)
 [1] 18519.12197    81.68293    96.65678    43.08882    14.37848    55.05913
 [7]    40.03382    53.80130    94.96648          NA    23.80150    51.49841
[13]   117.78803   119.40608   132.92882    56.74354    96.33446    86.41681
[19]    26.37950    44.28344
> colSd(tmp5,na.rm=TRUE)
 [1] 136.084981   9.037861   9.831418   6.564207   3.791897   7.420184
 [7]   6.327229   7.334937   9.745075         NA   4.878679   7.176239
[13]  10.853020  10.927309  11.529476   7.532831   9.815012   9.296064
[19]   5.136097   6.654581
> colMax(tmp5,na.rm=TRUE)
 [1] 471.72419  80.50514  89.00038  76.65587  74.11611  78.75202  82.03797
 [8]  82.46943  90.78667      -Inf  77.61391  78.86182  86.09045  88.75335
[15]  89.43641  82.29246  84.92583  86.29992  77.28007  77.16901
> colMin(tmp5,na.rm=TRUE)
 [1] 54.81571 54.22210 54.00260 54.47079 60.95158 55.49732 62.12255 61.93115
 [9] 60.91257      Inf 63.58858 55.85156 55.24374 56.11626 57.64568 59.32525
[17] 54.50357 56.34820 60.17268 57.25494
> 
> 
> 
> 
> 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] 174.0327 220.3462 371.3754 173.7669 143.2838 362.1467 242.1788 140.2536
 [9] 175.6078 265.3893
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 174.0327 220.3462 371.3754 173.7669 143.2838 362.1467 242.1788 140.2536
 [9] 175.6078 265.3893
> 
> 
> 
> copymatrix <- matrix(rnorm(200,150,15),10,20)
> 
> tmp5[1:10,1:20] <- copymatrix
> which.row <- 1
> which.col  <- 3
> cat(which.row," ",which.col,"\n")
1   3 
> tmp5[which.row,which.col] <- NA
> copymatrix[which.row,which.col] <- NA
> 
> colVars(tmp5,na.rm=TRUE)-apply(copymatrix,2,var,na.rm=TRUE)
 [1]  5.684342e-14 -2.842171e-14  2.842171e-14  0.000000e+00  2.842171e-14
 [6]  5.684342e-14  5.684342e-14 -2.842171e-13 -5.684342e-14  0.000000e+00
[11]  5.684342e-14  2.842171e-14 -2.842171e-13  0.000000e+00  5.684342e-14
[16]  8.526513e-14  1.136868e-13 -2.842171e-14 -2.557954e-13 -1.705303e-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)
+ }
6   9 
9   7 
6   13 
5   3 
3   9 
10   1 
2   8 
7   3 
10   16 
7   9 
10   14 
9   15 
6   3 
1   18 
1   1 
7   14 
5   14 
6   9 
6   14 
4   16 
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.880643
> Min(tmp)
[1] -2.523519
> mean(tmp)
[1] -0.06514593
> Sum(tmp)
[1] -6.514593
> Var(tmp)
[1] 1.270041
> 
> rowMeans(tmp)
[1] -0.06514593
> rowSums(tmp)
[1] -6.514593
> rowVars(tmp)
[1] 1.270041
> rowSd(tmp)
[1] 1.126961
> rowMax(tmp)
[1] 2.880643
> rowMin(tmp)
[1] -2.523519
> 
> colMeans(tmp)
  [1] -0.16988630 -2.41339441 -0.37808838 -0.69103144 -0.66550308  0.54157393
  [7]  1.83806066 -0.76739783  0.70326992  0.98310396 -0.14255119  0.91352546
 [13]  0.52398701 -0.51117841 -2.49381315  0.25209782  0.07793456  1.10131715
 [19] -0.12912212  0.10425371 -0.75707209 -0.46030928 -1.47824416  0.36085092
 [25] -2.02824768 -1.64795428 -0.33183910  1.89443215  0.46637774 -0.49844420
 [31] -0.64160373  0.25515214  1.10744112 -0.02805720  0.82961077 -1.92953488
 [37] -0.56807789  0.29765206 -0.47966093 -0.52229731 -0.25185029  1.64688453
 [43] -0.88882367  0.13646230 -1.07141946  0.13894158 -0.34200889  0.77765493
 [49] -1.20204368  0.69778682  1.20878205 -0.48935603 -0.79620692 -0.08507150
 [55]  0.52350186  0.31498361 -0.29393884 -1.67420798  1.95466627  0.04043920
 [61]  2.82168799  1.99811812 -0.20708427 -1.94222010 -2.52351881 -2.01586368
 [67] -0.94011374  0.07205329 -1.76511070 -0.17655553  0.76722642 -1.18444448
 [73] -0.50141331  0.37750892  1.33689657 -1.76592367  0.25898456  2.88064271
 [79] -1.08144477 -0.33600389 -0.07168579 -0.47499825 -1.14133350 -2.12890006
 [85]  1.42271299 -0.98800048  0.88680819  0.63621626  0.10626125 -0.38961686
 [91]  0.21448866  0.12663303  0.94437030  1.69321875 -0.18314761  0.92219358
 [97]  0.31150666  0.06879395  0.63489125  1.95906477
> colSums(tmp)
  [1] -0.16988630 -2.41339441 -0.37808838 -0.69103144 -0.66550308  0.54157393
  [7]  1.83806066 -0.76739783  0.70326992  0.98310396 -0.14255119  0.91352546
 [13]  0.52398701 -0.51117841 -2.49381315  0.25209782  0.07793456  1.10131715
 [19] -0.12912212  0.10425371 -0.75707209 -0.46030928 -1.47824416  0.36085092
 [25] -2.02824768 -1.64795428 -0.33183910  1.89443215  0.46637774 -0.49844420
 [31] -0.64160373  0.25515214  1.10744112 -0.02805720  0.82961077 -1.92953488
 [37] -0.56807789  0.29765206 -0.47966093 -0.52229731 -0.25185029  1.64688453
 [43] -0.88882367  0.13646230 -1.07141946  0.13894158 -0.34200889  0.77765493
 [49] -1.20204368  0.69778682  1.20878205 -0.48935603 -0.79620692 -0.08507150
 [55]  0.52350186  0.31498361 -0.29393884 -1.67420798  1.95466627  0.04043920
 [61]  2.82168799  1.99811812 -0.20708427 -1.94222010 -2.52351881 -2.01586368
 [67] -0.94011374  0.07205329 -1.76511070 -0.17655553  0.76722642 -1.18444448
 [73] -0.50141331  0.37750892  1.33689657 -1.76592367  0.25898456  2.88064271
 [79] -1.08144477 -0.33600389 -0.07168579 -0.47499825 -1.14133350 -2.12890006
 [85]  1.42271299 -0.98800048  0.88680819  0.63621626  0.10626125 -0.38961686
 [91]  0.21448866  0.12663303  0.94437030  1.69321875 -0.18314761  0.92219358
 [97]  0.31150666  0.06879395  0.63489125  1.95906477
> 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.16988630 -2.41339441 -0.37808838 -0.69103144 -0.66550308  0.54157393
  [7]  1.83806066 -0.76739783  0.70326992  0.98310396 -0.14255119  0.91352546
 [13]  0.52398701 -0.51117841 -2.49381315  0.25209782  0.07793456  1.10131715
 [19] -0.12912212  0.10425371 -0.75707209 -0.46030928 -1.47824416  0.36085092
 [25] -2.02824768 -1.64795428 -0.33183910  1.89443215  0.46637774 -0.49844420
 [31] -0.64160373  0.25515214  1.10744112 -0.02805720  0.82961077 -1.92953488
 [37] -0.56807789  0.29765206 -0.47966093 -0.52229731 -0.25185029  1.64688453
 [43] -0.88882367  0.13646230 -1.07141946  0.13894158 -0.34200889  0.77765493
 [49] -1.20204368  0.69778682  1.20878205 -0.48935603 -0.79620692 -0.08507150
 [55]  0.52350186  0.31498361 -0.29393884 -1.67420798  1.95466627  0.04043920
 [61]  2.82168799  1.99811812 -0.20708427 -1.94222010 -2.52351881 -2.01586368
 [67] -0.94011374  0.07205329 -1.76511070 -0.17655553  0.76722642 -1.18444448
 [73] -0.50141331  0.37750892  1.33689657 -1.76592367  0.25898456  2.88064271
 [79] -1.08144477 -0.33600389 -0.07168579 -0.47499825 -1.14133350 -2.12890006
 [85]  1.42271299 -0.98800048  0.88680819  0.63621626  0.10626125 -0.38961686
 [91]  0.21448866  0.12663303  0.94437030  1.69321875 -0.18314761  0.92219358
 [97]  0.31150666  0.06879395  0.63489125  1.95906477
> colMin(tmp)
  [1] -0.16988630 -2.41339441 -0.37808838 -0.69103144 -0.66550308  0.54157393
  [7]  1.83806066 -0.76739783  0.70326992  0.98310396 -0.14255119  0.91352546
 [13]  0.52398701 -0.51117841 -2.49381315  0.25209782  0.07793456  1.10131715
 [19] -0.12912212  0.10425371 -0.75707209 -0.46030928 -1.47824416  0.36085092
 [25] -2.02824768 -1.64795428 -0.33183910  1.89443215  0.46637774 -0.49844420
 [31] -0.64160373  0.25515214  1.10744112 -0.02805720  0.82961077 -1.92953488
 [37] -0.56807789  0.29765206 -0.47966093 -0.52229731 -0.25185029  1.64688453
 [43] -0.88882367  0.13646230 -1.07141946  0.13894158 -0.34200889  0.77765493
 [49] -1.20204368  0.69778682  1.20878205 -0.48935603 -0.79620692 -0.08507150
 [55]  0.52350186  0.31498361 -0.29393884 -1.67420798  1.95466627  0.04043920
 [61]  2.82168799  1.99811812 -0.20708427 -1.94222010 -2.52351881 -2.01586368
 [67] -0.94011374  0.07205329 -1.76511070 -0.17655553  0.76722642 -1.18444448
 [73] -0.50141331  0.37750892  1.33689657 -1.76592367  0.25898456  2.88064271
 [79] -1.08144477 -0.33600389 -0.07168579 -0.47499825 -1.14133350 -2.12890006
 [85]  1.42271299 -0.98800048  0.88680819  0.63621626  0.10626125 -0.38961686
 [91]  0.21448866  0.12663303  0.94437030  1.69321875 -0.18314761  0.92219358
 [97]  0.31150666  0.06879395  0.63489125  1.95906477
> colMedians(tmp)
  [1] -0.16988630 -2.41339441 -0.37808838 -0.69103144 -0.66550308  0.54157393
  [7]  1.83806066 -0.76739783  0.70326992  0.98310396 -0.14255119  0.91352546
 [13]  0.52398701 -0.51117841 -2.49381315  0.25209782  0.07793456  1.10131715
 [19] -0.12912212  0.10425371 -0.75707209 -0.46030928 -1.47824416  0.36085092
 [25] -2.02824768 -1.64795428 -0.33183910  1.89443215  0.46637774 -0.49844420
 [31] -0.64160373  0.25515214  1.10744112 -0.02805720  0.82961077 -1.92953488
 [37] -0.56807789  0.29765206 -0.47966093 -0.52229731 -0.25185029  1.64688453
 [43] -0.88882367  0.13646230 -1.07141946  0.13894158 -0.34200889  0.77765493
 [49] -1.20204368  0.69778682  1.20878205 -0.48935603 -0.79620692 -0.08507150
 [55]  0.52350186  0.31498361 -0.29393884 -1.67420798  1.95466627  0.04043920
 [61]  2.82168799  1.99811812 -0.20708427 -1.94222010 -2.52351881 -2.01586368
 [67] -0.94011374  0.07205329 -1.76511070 -0.17655553  0.76722642 -1.18444448
 [73] -0.50141331  0.37750892  1.33689657 -1.76592367  0.25898456  2.88064271
 [79] -1.08144477 -0.33600389 -0.07168579 -0.47499825 -1.14133350 -2.12890006
 [85]  1.42271299 -0.98800048  0.88680819  0.63621626  0.10626125 -0.38961686
 [91]  0.21448866  0.12663303  0.94437030  1.69321875 -0.18314761  0.92219358
 [97]  0.31150666  0.06879395  0.63489125  1.95906477
> colRanges(tmp)
           [,1]      [,2]       [,3]       [,4]       [,5]      [,6]     [,7]
[1,] -0.1698863 -2.413394 -0.3780884 -0.6910314 -0.6655031 0.5415739 1.838061
[2,] -0.1698863 -2.413394 -0.3780884 -0.6910314 -0.6655031 0.5415739 1.838061
           [,8]      [,9]    [,10]      [,11]     [,12]    [,13]      [,14]
[1,] -0.7673978 0.7032699 0.983104 -0.1425512 0.9135255 0.523987 -0.5111784
[2,] -0.7673978 0.7032699 0.983104 -0.1425512 0.9135255 0.523987 -0.5111784
         [,15]     [,16]      [,17]    [,18]      [,19]     [,20]      [,21]
[1,] -2.493813 0.2520978 0.07793456 1.101317 -0.1291221 0.1042537 -0.7570721
[2,] -2.493813 0.2520978 0.07793456 1.101317 -0.1291221 0.1042537 -0.7570721
          [,22]     [,23]     [,24]     [,25]     [,26]      [,27]    [,28]
[1,] -0.4603093 -1.478244 0.3608509 -2.028248 -1.647954 -0.3318391 1.894432
[2,] -0.4603093 -1.478244 0.3608509 -2.028248 -1.647954 -0.3318391 1.894432
         [,29]      [,30]      [,31]     [,32]    [,33]      [,34]     [,35]
[1,] 0.4663777 -0.4984442 -0.6416037 0.2551521 1.107441 -0.0280572 0.8296108
[2,] 0.4663777 -0.4984442 -0.6416037 0.2551521 1.107441 -0.0280572 0.8296108
         [,36]      [,37]     [,38]      [,39]      [,40]      [,41]    [,42]
[1,] -1.929535 -0.5680779 0.2976521 -0.4796609 -0.5222973 -0.2518503 1.646885
[2,] -1.929535 -0.5680779 0.2976521 -0.4796609 -0.5222973 -0.2518503 1.646885
          [,43]     [,44]     [,45]     [,46]      [,47]     [,48]     [,49]
[1,] -0.8888237 0.1364623 -1.071419 0.1389416 -0.3420089 0.7776549 -1.202044
[2,] -0.8888237 0.1364623 -1.071419 0.1389416 -0.3420089 0.7776549 -1.202044
         [,50]    [,51]     [,52]      [,53]      [,54]     [,55]     [,56]
[1,] 0.6977868 1.208782 -0.489356 -0.7962069 -0.0850715 0.5235019 0.3149836
[2,] 0.6977868 1.208782 -0.489356 -0.7962069 -0.0850715 0.5235019 0.3149836
          [,57]     [,58]    [,59]     [,60]    [,61]    [,62]      [,63]
[1,] -0.2939388 -1.674208 1.954666 0.0404392 2.821688 1.998118 -0.2070843
[2,] -0.2939388 -1.674208 1.954666 0.0404392 2.821688 1.998118 -0.2070843
        [,64]     [,65]     [,66]      [,67]      [,68]     [,69]      [,70]
[1,] -1.94222 -2.523519 -2.015864 -0.9401137 0.07205329 -1.765111 -0.1765555
[2,] -1.94222 -2.523519 -2.015864 -0.9401137 0.07205329 -1.765111 -0.1765555
         [,71]     [,72]      [,73]     [,74]    [,75]     [,76]     [,77]
[1,] 0.7672264 -1.184444 -0.5014133 0.3775089 1.336897 -1.765924 0.2589846
[2,] 0.7672264 -1.184444 -0.5014133 0.3775089 1.336897 -1.765924 0.2589846
        [,78]     [,79]      [,80]       [,81]      [,82]     [,83]   [,84]
[1,] 2.880643 -1.081445 -0.3360039 -0.07168579 -0.4749983 -1.141333 -2.1289
[2,] 2.880643 -1.081445 -0.3360039 -0.07168579 -0.4749983 -1.141333 -2.1289
        [,85]      [,86]     [,87]     [,88]     [,89]      [,90]     [,91]
[1,] 1.422713 -0.9880005 0.8868082 0.6362163 0.1062612 -0.3896169 0.2144887
[2,] 1.422713 -0.9880005 0.8868082 0.6362163 0.1062612 -0.3896169 0.2144887
        [,92]     [,93]    [,94]      [,95]     [,96]     [,97]      [,98]
[1,] 0.126633 0.9443703 1.693219 -0.1831476 0.9221936 0.3115067 0.06879395
[2,] 0.126633 0.9443703 1.693219 -0.1831476 0.9221936 0.3115067 0.06879395
         [,99]   [,100]
[1,] 0.6348913 1.959065
[2,] 0.6348913 1.959065
> 
> 
> Max(tmp2)
[1] 2.909925
> Min(tmp2)
[1] -2.270974
> mean(tmp2)
[1] -0.05571543
> Sum(tmp2)
[1] -5.571543
> Var(tmp2)
[1] 1.331673
> 
> rowMeans(tmp2)
  [1] -1.708804580  0.397379207 -0.568998357 -0.555757683  0.025378660
  [6]  0.048127890 -0.566272555  2.069278091 -1.000789423  2.264040595
 [11]  1.030306246 -0.536511255 -0.735112440 -1.529319046  1.227577574
 [16]  0.201675343 -1.192248872 -1.493927280 -0.366517792  0.214539933
 [21] -0.436203641 -1.499173542 -0.330468431 -0.821892405 -0.025980882
 [26] -1.657994661 -0.989584341 -0.082196840  1.030423783  1.379544258
 [31]  0.416025761 -0.463713548 -0.739952019  0.275329836  1.757781995
 [36]  0.324603678 -1.159266974  0.006493295  0.134783160  0.096130551
 [41]  1.980309540  0.707102001  1.015018774 -0.021810691 -0.432959182
 [46]  0.557847015 -0.916651469 -1.004513747 -0.708527270 -0.820206139
 [51]  0.463004750 -0.964629056  1.226999586 -0.125175617  1.168603734
 [56] -1.269206429 -1.409844831  2.586476750 -2.270973637  0.318458963
 [61] -0.415693961  1.079855284  0.137106730 -0.764029082  0.003062784
 [66] -0.337723545  2.370537039  1.254879264 -1.725087440 -0.504513679
 [71]  1.168019212 -1.087554694 -1.069871878 -0.601579156  1.736435570
 [76] -0.513300313  1.355936818  2.010074942  0.494034078 -0.262437086
 [81] -1.870187776 -1.362658601 -0.462857863  0.379373112 -2.069380229
 [86]  1.419418832  0.337102687 -0.899652425 -1.856193740 -0.275820259
 [91]  1.148168398  0.283015473 -0.709933372  2.381375233  0.276822665
 [96] -0.976188847 -1.708811484 -1.255980997 -0.105286042  2.909925184
> rowSums(tmp2)
  [1] -1.708804580  0.397379207 -0.568998357 -0.555757683  0.025378660
  [6]  0.048127890 -0.566272555  2.069278091 -1.000789423  2.264040595
 [11]  1.030306246 -0.536511255 -0.735112440 -1.529319046  1.227577574
 [16]  0.201675343 -1.192248872 -1.493927280 -0.366517792  0.214539933
 [21] -0.436203641 -1.499173542 -0.330468431 -0.821892405 -0.025980882
 [26] -1.657994661 -0.989584341 -0.082196840  1.030423783  1.379544258
 [31]  0.416025761 -0.463713548 -0.739952019  0.275329836  1.757781995
 [36]  0.324603678 -1.159266974  0.006493295  0.134783160  0.096130551
 [41]  1.980309540  0.707102001  1.015018774 -0.021810691 -0.432959182
 [46]  0.557847015 -0.916651469 -1.004513747 -0.708527270 -0.820206139
 [51]  0.463004750 -0.964629056  1.226999586 -0.125175617  1.168603734
 [56] -1.269206429 -1.409844831  2.586476750 -2.270973637  0.318458963
 [61] -0.415693961  1.079855284  0.137106730 -0.764029082  0.003062784
 [66] -0.337723545  2.370537039  1.254879264 -1.725087440 -0.504513679
 [71]  1.168019212 -1.087554694 -1.069871878 -0.601579156  1.736435570
 [76] -0.513300313  1.355936818  2.010074942  0.494034078 -0.262437086
 [81] -1.870187776 -1.362658601 -0.462857863  0.379373112 -2.069380229
 [86]  1.419418832  0.337102687 -0.899652425 -1.856193740 -0.275820259
 [91]  1.148168398  0.283015473 -0.709933372  2.381375233  0.276822665
 [96] -0.976188847 -1.708811484 -1.255980997 -0.105286042  2.909925184
> rowVars(tmp2)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowSd(tmp2)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowMax(tmp2)
  [1] -1.708804580  0.397379207 -0.568998357 -0.555757683  0.025378660
  [6]  0.048127890 -0.566272555  2.069278091 -1.000789423  2.264040595
 [11]  1.030306246 -0.536511255 -0.735112440 -1.529319046  1.227577574
 [16]  0.201675343 -1.192248872 -1.493927280 -0.366517792  0.214539933
 [21] -0.436203641 -1.499173542 -0.330468431 -0.821892405 -0.025980882
 [26] -1.657994661 -0.989584341 -0.082196840  1.030423783  1.379544258
 [31]  0.416025761 -0.463713548 -0.739952019  0.275329836  1.757781995
 [36]  0.324603678 -1.159266974  0.006493295  0.134783160  0.096130551
 [41]  1.980309540  0.707102001  1.015018774 -0.021810691 -0.432959182
 [46]  0.557847015 -0.916651469 -1.004513747 -0.708527270 -0.820206139
 [51]  0.463004750 -0.964629056  1.226999586 -0.125175617  1.168603734
 [56] -1.269206429 -1.409844831  2.586476750 -2.270973637  0.318458963
 [61] -0.415693961  1.079855284  0.137106730 -0.764029082  0.003062784
 [66] -0.337723545  2.370537039  1.254879264 -1.725087440 -0.504513679
 [71]  1.168019212 -1.087554694 -1.069871878 -0.601579156  1.736435570
 [76] -0.513300313  1.355936818  2.010074942  0.494034078 -0.262437086
 [81] -1.870187776 -1.362658601 -0.462857863  0.379373112 -2.069380229
 [86]  1.419418832  0.337102687 -0.899652425 -1.856193740 -0.275820259
 [91]  1.148168398  0.283015473 -0.709933372  2.381375233  0.276822665
 [96] -0.976188847 -1.708811484 -1.255980997 -0.105286042  2.909925184
> rowMin(tmp2)
  [1] -1.708804580  0.397379207 -0.568998357 -0.555757683  0.025378660
  [6]  0.048127890 -0.566272555  2.069278091 -1.000789423  2.264040595
 [11]  1.030306246 -0.536511255 -0.735112440 -1.529319046  1.227577574
 [16]  0.201675343 -1.192248872 -1.493927280 -0.366517792  0.214539933
 [21] -0.436203641 -1.499173542 -0.330468431 -0.821892405 -0.025980882
 [26] -1.657994661 -0.989584341 -0.082196840  1.030423783  1.379544258
 [31]  0.416025761 -0.463713548 -0.739952019  0.275329836  1.757781995
 [36]  0.324603678 -1.159266974  0.006493295  0.134783160  0.096130551
 [41]  1.980309540  0.707102001  1.015018774 -0.021810691 -0.432959182
 [46]  0.557847015 -0.916651469 -1.004513747 -0.708527270 -0.820206139
 [51]  0.463004750 -0.964629056  1.226999586 -0.125175617  1.168603734
 [56] -1.269206429 -1.409844831  2.586476750 -2.270973637  0.318458963
 [61] -0.415693961  1.079855284  0.137106730 -0.764029082  0.003062784
 [66] -0.337723545  2.370537039  1.254879264 -1.725087440 -0.504513679
 [71]  1.168019212 -1.087554694 -1.069871878 -0.601579156  1.736435570
 [76] -0.513300313  1.355936818  2.010074942  0.494034078 -0.262437086
 [81] -1.870187776 -1.362658601 -0.462857863  0.379373112 -2.069380229
 [86]  1.419418832  0.337102687 -0.899652425 -1.856193740 -0.275820259
 [91]  1.148168398  0.283015473 -0.709933372  2.381375233  0.276822665
 [96] -0.976188847 -1.708811484 -1.255980997 -0.105286042  2.909925184
> 
> colMeans(tmp2)
[1] -0.05571543
> colSums(tmp2)
[1] -5.571543
> colVars(tmp2)
[1] 1.331673
> colSd(tmp2)
[1] 1.153981
> colMax(tmp2)
[1] 2.909925
> colMin(tmp2)
[1] -2.270974
> colMedians(tmp2)
[1] -0.1938064
> colRanges(tmp2)
          [,1]
[1,] -2.270974
[2,]  2.909925
> 
> 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]  1.7570914 -4.5145189 -1.0462635 -2.0209510  2.0144098  2.4009296
 [7]  1.4575884  5.5131028 -0.3560883 -0.5498948
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -0.8414107
[2,] -0.3547066
[3,] -0.2223984
[4,]  0.7016391
[5,]  2.0203478
> 
> rowApply(tmp,sum)
 [1]  8.4497817 -2.2414597  0.8429532  1.6706689  1.4582541 -0.9713410
 [7] -1.3667075  0.4798115 -5.0655360  1.3989802
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    2    9    4    4    9    3    9    5    4     7
 [2,]    3    3    6    3    5    4   10    1    5     2
 [3,]    5    1    1    9    4    5    5    9    6     6
 [4,]    7    4    2    1    3    1    6    7    9     8
 [5,]    6    7    9    8    2    2    3    2   10     9
 [6,]   10    2    5   10   10   10    4    6    2     1
 [7,]    8    6    3    7    8    7    1    3    3    10
 [8,]    9   10    8    2    7    9    7   10    1     5
 [9,]    1    8    7    6    6    6    2    8    8     3
[10,]    4    5   10    5    1    8    8    4    7     4
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1]  2.05978440  0.45645076  3.70885734  0.52988215  0.75291587  2.74766144
 [7]  0.47493262  0.08218977 -1.24969458 -2.74176113 -0.10915419 -0.09467964
[13] -2.19176573 -0.67374401  3.67957769  0.07761050 -2.60055383  4.53035851
[19]  2.00439152 -3.26292174
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -0.1955221
[2,] -0.1259398
[3,]  0.5387216
[4,]  0.8801218
[5,]  0.9624029
> 
> rowApply(tmp,sum)
[1]  8.890104  4.577003 -0.909725 -1.927029 -2.450015
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]   16   12   11   16   12
[2,]   18    8   19    1    6
[3,]    3    6   20    5   20
[4,]    2   18   17    4   14
[5,]   20    7    8   11   13
> 
> 
> as.matrix(tmp)
           [,1]        [,2]        [,3]       [,4]        [,5]       [,6]
[1,]  0.8801218  1.55675243 -0.34688802 -0.4966197  1.74996962  0.4121978
[2,]  0.5387216  0.06171625 -0.08196264  1.2757038 -0.04816822  0.8726623
[3,] -0.1259398  1.56099030  1.96232221  0.6980808 -0.49790621 -0.2030520
[4,]  0.9624029 -1.77709114 -0.75363016 -1.0288084 -0.25884745  1.3207679
[5,] -0.1955221 -0.94591708  2.92901594  0.0815257 -0.19213187  0.3450854
            [,7]       [,8]        [,9]        [,10]       [,11]      [,12]
[1,]  0.05782811  0.8646060  0.29580100 -0.007287439 -0.17074545 -0.2323463
[2,]  0.71667782 -0.4718802 -0.08347926  0.625505424  1.47843668 -1.6581186
[3,] -0.10887055  0.3714180 -1.01210344 -1.227400841 -1.08453018  1.2462263
[4,]  1.07034348  0.1434483 -0.01701246 -0.694575851 -0.01269633 -1.0334012
[5,] -1.26104624 -0.8254024 -0.43290041 -1.438002425 -0.31961891  1.5829601
          [,13]        [,14]     [,15]      [,16]      [,17]      [,18]
[1,]  1.2999639  0.009950275 0.7749342  0.6798604  1.7475862 0.08451988
[2,] -1.8794248  0.089091017 0.5259732  0.1558974 -1.7089117 1.26463546
[3,] -0.2088778  0.440781818 0.4459180 -0.6892292 -1.4700773 0.19921772
[4,] -0.4131447 -0.669818814 0.7934946  1.8892349 -0.4281232 1.18525028
[5,] -0.9902824 -0.543748310 1.1392578 -1.9581531 -0.7410279 1.79673517
          [,19]      [,20]
[1,]  0.6403296 -0.9104307
[2,]  2.1706105  0.7333166
[3,] -0.5429956 -0.6636973
[4,] -1.6720544 -0.5327668
[5,]  1.4085015 -1.8893436
> 
> 
> 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.21-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.21-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.21-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.21-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.218818 -0.2861393 -0.3272472 0.05937129 0.6882563 0.2798448 0.6788428
           col8       col9    col10       col11      col12     col13    col14
row1 0.07010266 0.04581946 1.068981 -0.08266893 -0.1363366 -0.950946 1.193148
        col15     col16     col17    col18      col19     col20
row1 1.431088 0.9399981 0.3708173 1.290708 -0.2572479 0.7791764
> tmp[,"col10"]
          col10
row1  1.0689808
row2  0.5318771
row3 -0.9892383
row4 -1.3909460
row5 -0.2230784
> tmp[c("row1","row5"),]
           col1       col2       col3       col4       col5      col6
row1 -1.2188182 -0.2861393 -0.3272472 0.05937129  0.6882563 0.2798448
row5  0.8769224 -0.2288733 -0.5721597 0.61140508 -0.3672539 1.6444867
           col7       col8        col9      col10       col11      col12
row1  0.6788428 0.07010266  0.04581946  1.0689808 -0.08266893 -0.1363366
row5 -2.3485344 0.46991047 -0.85132886 -0.2230784  1.04030060 -1.6805621
         col13      col14     col15      col16     col17     col18      col19
row1 -0.950946  1.1931481 1.4310876  0.9399981 0.3708173 1.2907083 -0.2572479
row5 -1.235085 -0.5973942 0.5930711 -1.1533127 1.0932180 0.0618595  0.1920286
          col20
row1  0.7791764
row5 -0.2690878
> tmp[,c("col6","col20")]
           col6      col20
row1  0.2798448  0.7791764
row2 -2.5271946 -0.2526699
row3  1.8220441 -0.2776288
row4  0.9686356 -0.6712596
row5  1.6444867 -0.2690878
> tmp[c("row1","row5"),c("col6","col20")]
          col6      col20
row1 0.2798448  0.7791764
row5 1.6444867 -0.2690878
> 
> 
> 
> 
> 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.32671 51.15401 50.48969 50.73536 47.00827 106.0998 51.38286 50.07075
         col9    col10    col11    col12    col13   col14    col15    col16
row1 50.53806 49.87034 49.35523 50.85071 51.67107 50.0753 49.53175 50.88287
        col17    col18    col19    col20
row1 51.40434 48.82125 48.98977 103.1225
> tmp[,"col10"]
        col10
row1 49.87034
row2 31.29195
row3 28.73639
row4 28.38117
row5 51.27613
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 50.32671 51.15401 50.48969 50.73536 47.00827 106.0998 51.38286 50.07075
row5 49.30552 48.14530 51.10435 50.51696 47.74899 104.4251 49.75285 50.04039
         col9    col10    col11    col12    col13    col14    col15    col16
row1 50.53806 49.87034 49.35523 50.85071 51.67107 50.07530 49.53175 50.88287
row5 49.76152 51.27613 49.62924 49.05798 49.56681 48.45991 50.48344 49.62985
        col17    col18    col19    col20
row1 51.40434 48.82125 48.98977 103.1225
row5 50.31752 50.85164 50.40443 105.8247
> tmp[,c("col6","col20")]
          col6     col20
row1 106.09979 103.12247
row2  75.34995  75.38633
row3  74.58702  78.04992
row4  73.71291  76.36834
row5 104.42509 105.82472
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 106.0998 103.1225
row5 104.4251 105.8247
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 106.0998 103.1225
row5 104.4251 105.8247
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
           col13
[1,]  0.07123777
[2,]  0.35644658
[3,] -0.89405818
[4,] -0.01260141
[5,] -0.20208623
> tmp[,c("col17","col7")]
          col17       col7
[1,] -0.7006796 -0.1308120
[2,]  1.7098866 -0.3425989
[3,] -0.3632755  0.1122498
[4,] -0.4261151  0.2214441
[5,]  1.2716417  2.5563799
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
           col6      col20
[1,] -0.2983116  1.5185112
[2,] -0.3018682  0.2922711
[3,]  0.6781263 -0.8147322
[4,] -0.4375996  0.7030780
[5,]  0.1420518 -0.2159104
> subBufferedMatrix(tmp,1,c("col6"))[,1]
           col1
[1,] -0.2983116
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
           col6
[1,] -0.2983116
[2,] -0.3018682
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> 
> 
> 
> subBufferedMatrix(tmp,c("row3","row1"),)[,1:20]
           [,1]      [,2]       [,3]      [,4]       [,5]       [,6]       [,7]
row3  0.4360686 0.5626101  0.9273549 1.3083416 -1.4813910 -0.9967692  0.5313904
row1 -1.1993756 1.1619793 -0.5632926 0.3926133  0.1243122  0.3136326 -0.1901175
           [,8]       [,9]      [,10]     [,11]      [,12]     [,13]
row3 -0.7361673 -0.2771419  0.2973041 -1.696038 -0.2359406 0.9181132
row1 -0.4851599 -0.7170025 -0.9236054 -1.384242  0.2753315 1.4445204
           [,14]       [,15]      [,16]      [,17]      [,18]      [,19]
row3 -0.84591095  1.37722635 -0.3757647 -0.1540679 -0.3503438 -0.2281266
row1  0.04813367 -0.02475185 -0.5585503  1.1426110 -1.0163914  0.4190854
          [,20]
row3 -2.2528375
row1 -0.4984021
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
         [,1]     [,2]      [,3]     [,4]      [,5]      [,6]    [,7]    [,8]
row2 1.662795 1.495066 0.2820967 1.245959 -0.876503 -1.691408 0.30119 1.49053
          [,9]      [,10]
row2 0.7212521 -0.9228534
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
           [,1]     [,2]      [,3]      [,4]      [,5]      [,6]    [,7]
row5 -0.1802822 1.075957 0.3581582 -1.814456 -1.959139 -1.144981 1.97332
           [,8]      [,9]     [,10]      [,11]     [,12]      [,13]     [,14]
row5 -0.5891686 -0.977593 0.6835544 -0.7580822 0.5948913 0.05672898 -1.129393
         [,15]    [,16]    [,17]      [,18]       [,19]      [,20]
row5 0.4059079 1.942285 1.305311 -0.4374693 -0.01429701 -0.0664136
> 
> 
> 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: 0x6065a8362980>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "/home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM27132d5c7ea94d"
 [2] "/home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM27132d14ce7329"
 [3] "/home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM27132d2974d673"
 [4] "/home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM27132d54563029"
 [5] "/home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM27132d21b27fcc"
 [6] "/home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM27132d304217e1"
 [7] "/home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM27132d1809db71"
 [8] "/home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM27132d38ef8a7c"
 [9] "/home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM27132d28cf97b8"
[10] "/home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM27132d15ffbcff"
[11] "/home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM27132dd64a5f5" 
[12] "/home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM27132d6d36d2ad"
[13] "/home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM27132d53b3876a"
[14] "/home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM27132d72c3934b"
[15] "/home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM27132d11130a97"
> 
> 
> ### 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: 0x6065a7e1df60>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x6065a7e1df60>
Warning message:
In dir.create(new.directory) :
  '/home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x6065a7e1df60>
> rowMedians(tmp)
  [1]  0.126371328 -0.782135553 -0.411653985 -0.007243598  0.021588501
  [6]  0.727933252 -0.469745773 -0.537301164  0.055536086 -0.268436829
 [11]  0.448838246  0.153611852  0.001874778 -0.110956426  0.032379866
 [16]  0.144829782  0.125566482 -0.431423622  0.067576355  0.282924578
 [21] -0.435149687 -0.230662516 -0.547225465 -0.738418356  0.052514072
 [26]  0.719584203 -0.073717074 -0.020578130  0.333475027 -0.439799380
 [31] -0.705318881 -0.129721829 -0.681431421  0.064882050 -0.337684464
 [36]  0.125747805 -0.335387123  0.299796272 -0.418851255 -0.092777054
 [41]  0.108608773  0.245954035  0.334433857  0.543229670  0.228857035
 [46]  0.283013138 -0.229333509  0.126315771  0.154473379  0.346474757
 [51] -0.064341992  0.431817597 -0.068426484 -0.312297449  0.365958137
 [56] -0.078786102  0.049468980  0.058192793 -0.049916177 -0.110724515
 [61] -0.136786514  0.177959639  0.259128133 -0.242782344  0.106564043
 [66] -0.475533884 -0.321160138  0.454284294  0.398429375 -0.025651666
 [71]  0.484737372 -0.219388546 -0.136398637 -0.176183277  0.203700746
 [76]  0.611944909  0.399501207  1.010824238 -0.319786674  0.043452248
 [81]  0.211041263 -0.056953976  0.324024114  0.111140446  0.085903012
 [86] -0.187740599  0.186223518  0.098565292  0.630872171 -0.254290294
 [91]  0.104629571 -0.067922332 -0.302998192 -0.197228868 -0.274996761
 [96] -0.179945669  0.127875048  0.425894042 -0.110199060 -0.608223752
[101] -0.058502581 -0.649375185 -0.281903341  0.392098948  0.043967573
[106] -0.069824389  0.095150058  0.570742879 -0.094483547 -0.502049483
[111] -0.133401760 -0.046341623 -0.034778461 -0.023519476 -0.172763490
[116] -0.083288058  0.228419740 -0.326240532 -0.561643144  0.238419569
[121]  0.669974429  0.301662216 -0.451321931  0.083510366 -0.350086489
[126] -0.049652331  0.146282201 -0.040334031  0.045943172  0.028915224
[131] -0.163786409 -0.514588884 -0.229990171 -0.476148693 -0.198146006
[136] -0.070626996  0.024875279  0.140107576 -0.115913167 -0.211297009
[141] -0.296079064  0.269549390 -0.343519830 -0.035566384  0.123830366
[146] -0.163567079  0.141621077 -0.425353088 -0.328937653  0.851382715
[151]  0.295332873 -0.489517926  0.682676631 -0.084666821 -0.356326058
[156]  0.015747417  0.148566655 -0.087465837 -0.419291433 -0.222201541
[161]  0.189971756  0.451666588  0.341794824  0.065641980 -0.021423402
[166] -0.452296809 -0.121617811 -0.887802038 -0.351830363  0.068177310
[171] -0.249795174  0.473235998  0.056398704 -0.135218971  0.059019158
[176]  0.117699901  0.302987369 -0.583022025 -0.004566939  0.247196953
[181] -0.522705688 -0.440106785  0.334432241 -0.424429528  0.476875168
[186]  0.608884719  0.057800913 -0.022943344 -0.332918345  0.211316150
[191] -0.248728633 -0.299687102 -0.075695084  0.427135093 -0.499496336
[196]  0.457258565 -0.097327899 -0.038259632 -0.038375046  0.306588536
[201]  0.502328368 -0.805924957  0.151130480 -0.307874176 -0.219260267
[206]  0.179697529 -0.211130535 -0.280354498  0.087904681 -0.078906332
[211]  0.009118340  0.256194928 -0.200046180  0.138240412  0.282669164
[216]  0.005610789 -0.425638123 -0.560123235 -0.702106897 -0.061224009
[221]  0.038005217  0.128119468 -0.480936344 -0.105298439  0.020505595
[226] -0.211647897  0.183476343  0.103811794  0.497474837 -0.247661346
> 
> proc.time()
   user  system elapsed 
  1.277   1.527   2.794 

BufferedMatrix.Rcheck/tests/rawCalltesting.Rout


R version 4.5.1 (2025-06-13) -- "Great Square Root"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu

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

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

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

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

Attaching package: 'BufferedMatrix'

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

    colMeans, colSums, rowMeans, rowSums

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

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

<pointer: 0x55b5669d4ad0>
> .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: 0x55b5669d4ad0>
> .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: 0x55b5669d4ad0>
> .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: 0x55b5669d4ad0>
> 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: 0x55b5669c6a30>
> .Call("R_bm_AddColumn",P)
<pointer: 0x55b5669c6a30>
> .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: 0x55b5669c6a30>
> .Call("R_bm_AddColumn",P)
<pointer: 0x55b5669c6a30>
> .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: 0x55b5669c6a30>
> 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: 0x55b565792870>
> .Call("R_bm_AddColumn",P)
<pointer: 0x55b565792870>
> .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: 0x55b565792870>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x55b565792870>
> .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: 0x55b565792870>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x55b565792870>
> .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: 0x55b565792870>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x55b565792870>
> .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: 0x55b565792870>
> 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: 0x55b565ba31a0>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x55b565ba31a0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x55b565ba31a0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x55b565ba31a0>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile2715703cf075ef" "BufferedMatrixFile2715707b5862e0"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile2715703cf075ef" "BufferedMatrixFile2715707b5862e0"
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x55b567d4d870>
> .Call("R_bm_AddColumn",P)
<pointer: 0x55b567d4d870>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x55b567d4d870>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x55b567d4d870>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x55b567d4d870>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x55b567d4d870>
> .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: 0x55b5661a1ca0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x55b5661a1ca0>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x55b5661a1ca0>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x55b5661a1ca0>
> 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: 0x55b566954a20>
> .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: 0x55b566954a20>
> rm(P)
> 
> proc.time()
   user  system elapsed 
  0.251   0.048   0.286 

BufferedMatrix.Rcheck/tests/Rcodetesting.Rout


R version 4.5.1 (2025-06-13) -- "Great Square Root"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu

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

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

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

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

Attaching package: 'BufferedMatrix'

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

    colMeans, colSums, rowMeans, rowSums

> 
> Temp <- createBufferedMatrix(100)
> dim(Temp)
[1] 100   0
> buffer.dim(Temp)
[1] 1 1
> 
> 
> proc.time()
   user  system elapsed 
  0.246   0.045   0.280 

Example timings