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

This page was generated on 2026-05-02 11:32 -0400 (Sat, 02 May 2026).

HostnameOSArch (*)R versionInstalled pkgs
nebbiolo2Linux (Ubuntu 24.04.4 LTS)x86_644.6.0 RC (2026-04-17 r89917) -- "Because it was There" 4844
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/2366HostnameOS / ArchINSTALLBUILDCHECKBUILD BIN
BufferedMatrix 1.77.0  (landing page)
Ben Bolstad
Snapshot Date: 2026-05-01 13:45 -0400 (Fri, 01 May 2026)
git_url: https://git.bioconductor.org/packages/BufferedMatrix
git_branch: devel
git_last_commit: 2d99771
git_last_commit_date: 2026-04-28 08:32:08 -0400 (Tue, 28 Apr 2026)
nebbiolo2Linux (Ubuntu 24.04.4 LTS) / x86_64  OK    OK    OK  UNNEEDED, same version is already published
See other builds for BufferedMatrix in R Universe.


CHECK results for BufferedMatrix on nebbiolo2

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

raw results


Summary

Package: BufferedMatrix
Version: 1.77.0
Command: /home/biocbuild/bbs-3.24-bioc/R/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/home/biocbuild/bbs-3.24-bioc/R/site-library --timings BufferedMatrix_1.77.0.tar.gz
StartedAt: 2026-05-01 22:01:27 -0400 (Fri, 01 May 2026)
EndedAt: 2026-05-01 22:01:52 -0400 (Fri, 01 May 2026)
EllapsedTime: 24.0 seconds
RetCode: 0
Status:   OK  
CheckDir: BufferedMatrix.Rcheck
Warnings: 0

Command output

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


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

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


Installation output

BufferedMatrix.Rcheck/00install.out

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


* installing to library ‘/home/biocbuild/bbs-3.24-bioc/R/site-library’
* installing *source* package ‘BufferedMatrix’ ...
** this is package ‘BufferedMatrix’ version ‘1.77.0’
** using staged installation
** libs
using C compiler: ‘gcc (Ubuntu 13.3.0-6ubuntu2~24.04.1) 13.3.0’
gcc -std=gnu2x -I"/home/biocbuild/bbs-3.24-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.24-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.24-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.24-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.24-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.24-bioc/R/lib -lR
installing to /home/biocbuild/bbs-3.24-bioc/R/site-library/00LOCK-BufferedMatrix/00new/BufferedMatrix/libs
** R
** inst
** byte-compile and prepare package for lazy loading
Creating a new generic function for ‘rowMeans’ in package ‘BufferedMatrix’
Creating a new generic function for ‘rowSums’ in package ‘BufferedMatrix’
Creating a new generic function for ‘colMeans’ in package ‘BufferedMatrix’
Creating a new generic function for ‘colSums’ in package ‘BufferedMatrix’
Creating a generic function for ‘ncol’ from package ‘base’ in package ‘BufferedMatrix’
Creating a generic function for ‘nrow’ from package ‘base’ in package ‘BufferedMatrix’
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
** checking absolute paths in shared objects and dynamic libraries
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (BufferedMatrix)

Tests output

BufferedMatrix.Rcheck/tests/c_code_level_tests.Rout


R version 4.6.0 RC (2026-04-17 r89917) -- "Because it was There"
Copyright (C) 2026 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu

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

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

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

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

Attaching package: 'BufferedMatrix'

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

    colMeans, colSums, rowMeans, rowSums

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

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

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

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

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

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

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

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

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

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

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

[[1]]
[1] 0

> 
> proc.time()
   user  system elapsed 
  0.244   0.044   0.275 

BufferedMatrix.Rcheck/tests/objectTesting.Rout


R version 4.6.0 RC (2026-04-17 r89917) -- "Because it was There"
Copyright (C) 2026 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu

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

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

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

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

Attaching package: 'BufferedMatrix'

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

    colMeans, colSums, rowMeans, rowSums

> 
> 
> ### this is used to control how many repetitions in something below
> ### higher values result in more checks.
> nreps <-100 ##20000
> 
> 
> ## test creation and some simple assignments and subsetting operations
> 
> ## first on single elements
> tmp <- createBufferedMatrix(1000,10)
> 
> tmp[10,5]
[1] 0
> tmp[10,5] <- 10
> tmp[10,5]
[1] 10
> tmp[10,5] <- 12.445
> tmp[10,5]
[1] 12.445
> 
> 
> 
> ## now testing accessing multiple elements
> tmp2 <- createBufferedMatrix(10,20)
> 
> 
> tmp2[3,1] <- 51.34
> tmp2[9,2] <- 9.87654
> tmp2[,1:2]
       [,1]    [,2]
 [1,]  0.00 0.00000
 [2,]  0.00 0.00000
 [3,] 51.34 0.00000
 [4,]  0.00 0.00000
 [5,]  0.00 0.00000
 [6,]  0.00 0.00000
 [7,]  0.00 0.00000
 [8,]  0.00 0.00000
 [9,]  0.00 9.87654
[10,]  0.00 0.00000
> tmp2[,-(3:20)]
       [,1]    [,2]
 [1,]  0.00 0.00000
 [2,]  0.00 0.00000
 [3,] 51.34 0.00000
 [4,]  0.00 0.00000
 [5,]  0.00 0.00000
 [6,]  0.00 0.00000
 [7,]  0.00 0.00000
 [8,]  0.00 0.00000
 [9,]  0.00 9.87654
[10,]  0.00 0.00000
> tmp2[3,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
[1,] 51.34    0    0    0    0    0    0    0    0     0     0     0     0
     [,14] [,15] [,16] [,17] [,18] [,19] [,20]
[1,]     0     0     0     0     0     0     0
> tmp2[-3,]
      [,1]    [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [2,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [3,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [4,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [5,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [6,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [7,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [8,]    0 9.87654    0    0    0    0    0    0    0     0     0     0     0
 [9,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
      [,14] [,15] [,16] [,17] [,18] [,19] [,20]
 [1,]     0     0     0     0     0     0     0
 [2,]     0     0     0     0     0     0     0
 [3,]     0     0     0     0     0     0     0
 [4,]     0     0     0     0     0     0     0
 [5,]     0     0     0     0     0     0     0
 [6,]     0     0     0     0     0     0     0
 [7,]     0     0     0     0     0     0     0
 [8,]     0     0     0     0     0     0     0
 [9,]     0     0     0     0     0     0     0
> tmp2[2,1:3]
     [,1] [,2] [,3]
[1,]    0    0    0
> tmp2[3:9,1:3]
      [,1]    [,2] [,3]
[1,] 51.34 0.00000    0
[2,]  0.00 0.00000    0
[3,]  0.00 0.00000    0
[4,]  0.00 0.00000    0
[5,]  0.00 0.00000    0
[6,]  0.00 0.00000    0
[7,]  0.00 9.87654    0
> tmp2[-4,-4]
       [,1]    [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [2,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [3,] 51.34 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [4,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [5,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [6,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [7,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [8,]  0.00 9.87654    0    0    0    0    0    0    0     0     0     0     0
 [9,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
      [,14] [,15] [,16] [,17] [,18] [,19]
 [1,]     0     0     0     0     0     0
 [2,]     0     0     0     0     0     0
 [3,]     0     0     0     0     0     0
 [4,]     0     0     0     0     0     0
 [5,]     0     0     0     0     0     0
 [6,]     0     0     0     0     0     0
 [7,]     0     0     0     0     0     0
 [8,]     0     0     0     0     0     0
 [9,]     0     0     0     0     0     0
> 
> ## now testing accessing/assigning multiple elements
> tmp3 <- createBufferedMatrix(10,10)
> 
> for (i in 1:10){
+   for (j in 1:10){
+     tmp3[i,j] <- (j-1)*10 + i
+   }
+ }
> 
> tmp3[2:4,2:4]
     [,1] [,2] [,3]
[1,]   12   22   32
[2,]   13   23   33
[3,]   14   24   34
> tmp3[c(-10),c(2:4,2:4,10,1,2,1:10,10:1)]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]   11   21   31   11   21   31   91    1   11     1    11    21    31
 [2,]   12   22   32   12   22   32   92    2   12     2    12    22    32
 [3,]   13   23   33   13   23   33   93    3   13     3    13    23    33
 [4,]   14   24   34   14   24   34   94    4   14     4    14    24    34
 [5,]   15   25   35   15   25   35   95    5   15     5    15    25    35
 [6,]   16   26   36   16   26   36   96    6   16     6    16    26    36
 [7,]   17   27   37   17   27   37   97    7   17     7    17    27    37
 [8,]   18   28   38   18   28   38   98    8   18     8    18    28    38
 [9,]   19   29   39   19   29   39   99    9   19     9    19    29    39
      [,14] [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24] [,25]
 [1,]    41    51    61    71    81    91    91    81    71    61    51    41
 [2,]    42    52    62    72    82    92    92    82    72    62    52    42
 [3,]    43    53    63    73    83    93    93    83    73    63    53    43
 [4,]    44    54    64    74    84    94    94    84    74    64    54    44
 [5,]    45    55    65    75    85    95    95    85    75    65    55    45
 [6,]    46    56    66    76    86    96    96    86    76    66    56    46
 [7,]    47    57    67    77    87    97    97    87    77    67    57    47
 [8,]    48    58    68    78    88    98    98    88    78    68    58    48
 [9,]    49    59    69    79    89    99    99    89    79    69    59    49
      [,26] [,27] [,28] [,29]
 [1,]    31    21    11     1
 [2,]    32    22    12     2
 [3,]    33    23    13     3
 [4,]    34    24    14     4
 [5,]    35    25    15     5
 [6,]    36    26    16     6
 [7,]    37    27    17     7
 [8,]    38    28    18     8
 [9,]    39    29    19     9
> tmp3[-c(1:5),-c(6:10)]
     [,1] [,2] [,3] [,4] [,5]
[1,]    6   16   26   36   46
[2,]    7   17   27   37   47
[3,]    8   18   28   38   48
[4,]    9   19   29   39   49
[5,]   10   20   30   40   50
> 
> ## assignment of whole columns
> tmp3[,1] <- c(1:10*100.0)
> tmp3[,1:2] <- tmp3[,1:2]*100
> tmp3[,1:2] <- tmp3[,2:1]
> tmp3[,1:2]
      [,1]  [,2]
 [1,] 1100 1e+04
 [2,] 1200 2e+04
 [3,] 1300 3e+04
 [4,] 1400 4e+04
 [5,] 1500 5e+04
 [6,] 1600 6e+04
 [7,] 1700 7e+04
 [8,] 1800 8e+04
 [9,] 1900 9e+04
[10,] 2000 1e+05
> 
> 
> tmp3[,-1] <- tmp3[,1:9]
> tmp3[,1:10]
      [,1] [,2]  [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,] 1100 1100 1e+04   21   31   41   51   61   71    81
 [2,] 1200 1200 2e+04   22   32   42   52   62   72    82
 [3,] 1300 1300 3e+04   23   33   43   53   63   73    83
 [4,] 1400 1400 4e+04   24   34   44   54   64   74    84
 [5,] 1500 1500 5e+04   25   35   45   55   65   75    85
 [6,] 1600 1600 6e+04   26   36   46   56   66   76    86
 [7,] 1700 1700 7e+04   27   37   47   57   67   77    87
 [8,] 1800 1800 8e+04   28   38   48   58   68   78    88
 [9,] 1900 1900 9e+04   29   39   49   59   69   79    89
[10,] 2000 2000 1e+05   30   40   50   60   70   80    90
> 
> tmp3[,1:2] <- rep(1,10)
> tmp3[,1:2] <- rep(1,20)
> tmp3[,1:2] <- matrix(c(1:5),1,5)
> 
> tmp3[,-c(1:8)] <- matrix(c(1:5),1,5)
> 
> tmp3[1,] <- 1:10
> tmp3[1,]
     [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,]    1    2    3    4    5    6    7    8    9    10
> tmp3[-1,] <- c(1,2)
> tmp3[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    1    2    3    4    5    6    7    8    9    10
 [2,]    1    2    1    2    1    2    1    2    1     2
 [3,]    2    1    2    1    2    1    2    1    2     1
 [4,]    1    2    1    2    1    2    1    2    1     2
 [5,]    2    1    2    1    2    1    2    1    2     1
 [6,]    1    2    1    2    1    2    1    2    1     2
 [7,]    2    1    2    1    2    1    2    1    2     1
 [8,]    1    2    1    2    1    2    1    2    1     2
 [9,]    2    1    2    1    2    1    2    1    2     1
[10,]    1    2    1    2    1    2    1    2    1     2
> tmp3[-c(1:8),] <- matrix(c(1:5),1,5)
> tmp3[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    1    2    3    4    5    6    7    8    9    10
 [2,]    1    2    1    2    1    2    1    2    1     2
 [3,]    2    1    2    1    2    1    2    1    2     1
 [4,]    1    2    1    2    1    2    1    2    1     2
 [5,]    2    1    2    1    2    1    2    1    2     1
 [6,]    1    2    1    2    1    2    1    2    1     2
 [7,]    2    1    2    1    2    1    2    1    2     1
 [8,]    1    2    1    2    1    2    1    2    1     2
 [9,]    1    3    5    2    4    1    3    5    2     4
[10,]    2    4    1    3    5    2    4    1    3     5
> 
> 
> tmp3[1:2,1:2] <- 5555.04
> tmp3[-(1:2),1:2] <- 1234.56789
> 
> 
> 
> ## testing accessors for the directory and prefix
> directory(tmp3)
[1] "/home/biocbuild/bbs-3.24-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 480233 25.7    1053308 56.3   637571 34.1
Vcells 887253  6.8    8388608 64.0  2083896 15.9
> 
> 
> 
> 
> ##
> ## checking reads
> ##
> 
> tmp2 <- createBufferedMatrix(10,20)
> 
> test.sample <- rnorm(10*20)
> 
> tmp2[1:10,1:20] <- test.sample
> 
> test.matrix <- matrix(test.sample,10,20)
> 
> ## testing reads
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   which.col <- sample(1:20,1)
+   if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> date()
[1] "Fri May  1 22:01:43 2026"
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> date()
[1] "Fri May  1 22:01:43 2026"
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,which.col] == test.matrix[which.row,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> 
> 
> RowMode(tmp2)
<pointer: 0x599523495520>
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   which.col <- sample(1:20,1)
+   if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,5,replace=TRUE)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> date()
[1] "Fri May  1 22:01:43 2026"
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col <- sample(1:20,5,replace=TRUE)
+   if (!all(tmp2[which.row,which.col] == test.matrix[which.row,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> date()
[1] "Fri May  1 22:01:43 2026"
> 
> ColMode(tmp2)
<pointer: 0x599523495520>
> 
> 
> 
> ### Now testing assignments
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+ 
+   new.data <- rnorm(20)
+   tmp2[which.row,] <- new.data
+   test.matrix[which.row,] <- new.data
+   if (rep > 1){
+     if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+   
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   new.data <- rnorm(10)
+   tmp2[,which.col] <- new.data
+   test.matrix[,which.col]<- new.data
+ 
+   if (rep > 1){
+     if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.col <- which.col
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,5,replace=TRUE)
+   new.data <- matrix(rnorm(50),5,10)
+   tmp2[,which.col] <- new.data
+   test.matrix[,which.col]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.col <- which.col
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   new.data <- matrix(rnorm(50),5,10)
+   tmp2[which.row,] <- new.data
+   test.matrix[which.row,]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col  <- sample(1:20,5,replace=TRUE)
+   new.data <- matrix(rnorm(25),5,5)
+   tmp2[which.row,which.col] <- new.data
+   test.matrix[which.row,which.col]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[prev.row,prev.col] == test.matrix[prev.row,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+   prev.col <- which.col
+ }
> 
> 
> 
> 
> ###
> ###
> ### testing some more functions
> ###
> 
> 
> 
> ## duplication function
> tmp5 <- duplicate(tmp2)
> 
> # making sure really did copy everything.
> tmp5[1,1] <- tmp5[1,1] +100.00
> 
> if (tmp5[1,1] == tmp2[1,1]){
+   stop("Problem with duplication")
+ }
> 
> 
> 
> 
> ### testing elementwise applying of functions
> 
> tmp5[1:4,1:4]
             [,1]        [,2]       [,3]       [,4]
[1,] 100.97245432  0.09341549  0.6170159 -1.7194649
[2,]   0.03995258 -0.11340287 -0.6755119 -0.1437946
[3,]   1.11659101 -1.64612082  0.8678471 -1.1101844
[4,]   0.54122999  0.35265651  0.7126903  0.2945198
> ewApply(tmp5,abs)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
             [,1]       [,2]      [,3]      [,4]
[1,] 100.97245432 0.09341549 0.6170159 1.7194649
[2,]   0.03995258 0.11340287 0.6755119 0.1437946
[3,]   1.11659101 1.64612082 0.8678471 1.1101844
[4,]   0.54122999 0.35265651 0.7126903 0.2945198
> ewApply(tmp5,sqrt)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.24-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.0485051 0.3056395 0.7855036 1.3112837
[2,]  0.1998814 0.3367534 0.8218953 0.3792026
[3,]  1.0566887 1.2830124 0.9315831 1.0536529
[4,]  0.7356834 0.5938489 0.8442099 0.5426967
> 
> 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.24-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.45751 28.14981 33.47205 39.83230
[2,]  27.03877 28.48094 33.89447 28.93582
[3,]  36.68348 39.47624 35.18368 36.64671
[4,]  32.89806 31.29115 34.15479 30.72149
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x5995242808f0>
> exp(tmp5)
<pointer: 0x5995242808f0>
> log(tmp5,2)
<pointer: 0x5995242808f0>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 471.3416
> Min(tmp5)
[1] 53.61415
> mean(tmp5)
[1] 71.56707
> Sum(tmp5)
[1] 14313.41
> Var(tmp5)
[1] 875.8947
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 88.77404 69.62186 73.52927 69.90999 68.05871 71.40970 66.30121 69.59319
 [9] 67.60714 70.86560
> rowSums(tmp5)
 [1] 1775.481 1392.437 1470.585 1398.200 1361.174 1428.194 1326.024 1391.864
 [9] 1352.143 1417.312
> rowVars(tmp5)
 [1] 8170.61918   56.02853   51.63158   66.50451   72.00022   75.81990
 [7]   78.85998   64.89585   60.13089   91.46814
> rowSd(tmp5)
 [1] 90.391477  7.485221  7.185512  8.155030  8.485294  8.707462  8.880314
 [8]  8.055796  7.754411  9.563898
> rowMax(tmp5)
 [1] 471.34163  86.14069  88.02266  87.14993  84.16085  87.66003  83.71198
 [8]  82.96761  81.32425  85.07196
> rowMin(tmp5)
 [1] 55.86900 56.27765 59.30708 58.12131 57.17881 55.73022 53.61415 55.22107
 [9] 55.42157 54.73025
> 
> colMeans(tmp5)
 [1] 108.07468  66.95487  70.23791  68.39178  70.26792  65.60174  73.08531
 [8]  67.93321  74.51661  67.39333  67.90158  73.77710  72.39373  70.13332
[15]  70.76237  71.87582  67.34993  69.95341  66.98797  67.74883
> colSums(tmp5)
 [1] 1080.7468  669.5487  702.3791  683.9178  702.6792  656.0174  730.8531
 [8]  679.3321  745.1661  673.9333  679.0158  737.7710  723.9373  701.3332
[15]  707.6237  718.7582  673.4993  699.5341  669.8797  677.4883
> colVars(tmp5)
 [1] 16369.63525    92.56609    58.30299    63.05446    82.69948    51.14104
 [7]    57.62823    74.11092    64.59217    91.24551    38.30826    41.96823
[13]   117.75662    62.36334    45.50261    97.53079    60.06780    45.89993
[19]   120.75596    40.13504
> colSd(tmp5)
 [1] 127.943875   9.621127   7.635640   7.940684   9.093926   7.151297
 [7]   7.591326   8.608770   8.036926   9.552252   6.189366   6.478289
[13]  10.851572   7.897046   6.745563   9.875768   7.750342   6.774948
[19]  10.988902   6.335222
> colMax(tmp5)
 [1] 471.34163  82.16463  83.47214  82.90572  85.07196  76.01185  87.14993
 [8]  81.78230  84.16085  88.02266  79.72972  82.22405  87.66003  83.71198
[15]  77.73491  86.52873  81.38961  85.04582  86.14069  77.15722
> colMin(tmp5)
 [1] 54.73025 58.30238 57.22766 56.10671 54.08829 55.73022 61.74469 55.22107
 [9] 63.40417 56.60578 61.62715 63.49702 57.22630 55.42157 57.17881 53.61415
[17] 58.02784 58.12131 56.51846 56.70293
> 
> 
> ### 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] 88.77404 69.62186 73.52927 69.90999 68.05871 71.40970 66.30121       NA
 [9] 67.60714 70.86560
> rowSums(tmp5)
 [1] 1775.481 1392.437 1470.585 1398.200 1361.174 1428.194 1326.024       NA
 [9] 1352.143 1417.312
> rowVars(tmp5)
 [1] 8170.61918   56.02853   51.63158   66.50451   72.00022   75.81990
 [7]   78.85998   68.49787   60.13089   91.46814
> rowSd(tmp5)
 [1] 90.391477  7.485221  7.185512  8.155030  8.485294  8.707462  8.880314
 [8]  8.276344  7.754411  9.563898
> rowMax(tmp5)
 [1] 471.34163  86.14069  88.02266  87.14993  84.16085  87.66003  83.71198
 [8]        NA  81.32425  85.07196
> rowMin(tmp5)
 [1] 55.86900 56.27765 59.30708 58.12131 57.17881 55.73022 53.61415       NA
 [9] 55.42157 54.73025
> 
> colMeans(tmp5)
 [1] 108.07468  66.95487  70.23791  68.39178  70.26792  65.60174  73.08531
 [8]  67.93321  74.51661  67.39333  67.90158  73.77710        NA  70.13332
[15]  70.76237  71.87582  67.34993  69.95341  66.98797  67.74883
> colSums(tmp5)
 [1] 1080.7468  669.5487  702.3791  683.9178  702.6792  656.0174  730.8531
 [8]  679.3321  745.1661  673.9333  679.0158  737.7710        NA  701.3332
[15]  707.6237  718.7582  673.4993  699.5341  669.8797  677.4883
> colVars(tmp5)
 [1] 16369.63525    92.56609    58.30299    63.05446    82.69948    51.14104
 [7]    57.62823    74.11092    64.59217    91.24551    38.30826    41.96823
[13]          NA    62.36334    45.50261    97.53079    60.06780    45.89993
[19]   120.75596    40.13504
> colSd(tmp5)
 [1] 127.943875   9.621127   7.635640   7.940684   9.093926   7.151297
 [7]   7.591326   8.608770   8.036926   9.552252   6.189366   6.478289
[13]         NA   7.897046   6.745563   9.875768   7.750342   6.774948
[19]  10.988902   6.335222
> colMax(tmp5)
 [1] 471.34163  82.16463  83.47214  82.90572  85.07196  76.01185  87.14993
 [8]  81.78230  84.16085  88.02266  79.72972  82.22405        NA  83.71198
[15]  77.73491  86.52873  81.38961  85.04582  86.14069  77.15722
> colMin(tmp5)
 [1] 54.73025 58.30238 57.22766 56.10671 54.08829 55.73022 61.74469 55.22107
 [9] 63.40417 56.60578 61.62715 63.49702       NA 55.42157 57.17881 53.61415
[17] 58.02784 58.12131 56.51846 56.70293
> 
> Max(tmp5,na.rm=TRUE)
[1] 471.3416
> Min(tmp5,na.rm=TRUE)
[1] 53.61415
> mean(tmp5,na.rm=TRUE)
[1] 71.57818
> Sum(tmp5,na.rm=TRUE)
[1] 14244.06
> Var(tmp5,na.rm=TRUE)
[1] 880.2936
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 88.77404 69.62186 73.52927 69.90999 68.05871 71.40970 66.30121 69.60569
 [9] 67.60714 70.86560
> rowSums(tmp5,na.rm=TRUE)
 [1] 1775.481 1392.437 1470.585 1398.200 1361.174 1428.194 1326.024 1322.508
 [9] 1352.143 1417.312
> rowVars(tmp5,na.rm=TRUE)
 [1] 8170.61918   56.02853   51.63158   66.50451   72.00022   75.81990
 [7]   78.85998   68.49787   60.13089   91.46814
> rowSd(tmp5,na.rm=TRUE)
 [1] 90.391477  7.485221  7.185512  8.155030  8.485294  8.707462  8.880314
 [8]  8.276344  7.754411  9.563898
> rowMax(tmp5,na.rm=TRUE)
 [1] 471.34163  86.14069  88.02266  87.14993  84.16085  87.66003  83.71198
 [8]  82.96761  81.32425  85.07196
> rowMin(tmp5,na.rm=TRUE)
 [1] 55.86900 56.27765 59.30708 58.12131 57.17881 55.73022 53.61415 55.22107
 [9] 55.42157 54.73025
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 108.07468  66.95487  70.23791  68.39178  70.26792  65.60174  73.08531
 [8]  67.93321  74.51661  67.39333  67.90158  73.77710  72.73129  70.13332
[15]  70.76237  71.87582  67.34993  69.95341  66.98797  67.74883
> colSums(tmp5,na.rm=TRUE)
 [1] 1080.7468  669.5487  702.3791  683.9178  702.6792  656.0174  730.8531
 [8]  679.3321  745.1661  673.9333  679.0158  737.7710  654.5816  701.3332
[15]  707.6237  718.7582  673.4993  699.5341  669.8797  677.4883
> colVars(tmp5,na.rm=TRUE)
 [1] 16369.63525    92.56609    58.30299    63.05446    82.69948    51.14104
 [7]    57.62823    74.11092    64.59217    91.24551    38.30826    41.96823
[13]   131.19429    62.36334    45.50261    97.53079    60.06780    45.89993
[19]   120.75596    40.13504
> colSd(tmp5,na.rm=TRUE)
 [1] 127.943875   9.621127   7.635640   7.940684   9.093926   7.151297
 [7]   7.591326   8.608770   8.036926   9.552252   6.189366   6.478289
[13]  11.454008   7.897046   6.745563   9.875768   7.750342   6.774948
[19]  10.988902   6.335222
> colMax(tmp5,na.rm=TRUE)
 [1] 471.34163  82.16463  83.47214  82.90572  85.07196  76.01185  87.14993
 [8]  81.78230  84.16085  88.02266  79.72972  82.22405  87.66003  83.71198
[15]  77.73491  86.52873  81.38961  85.04582  86.14069  77.15722
> colMin(tmp5,na.rm=TRUE)
 [1] 54.73025 58.30238 57.22766 56.10671 54.08829 55.73022 61.74469 55.22107
 [9] 63.40417 56.60578 61.62715 63.49702 57.22630 55.42157 57.17881 53.61415
[17] 58.02784 58.12131 56.51846 56.70293
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1] 88.77404 69.62186 73.52927 69.90999 68.05871 71.40970 66.30121      NaN
 [9] 67.60714 70.86560
> rowSums(tmp5,na.rm=TRUE)
 [1] 1775.481 1392.437 1470.585 1398.200 1361.174 1428.194 1326.024    0.000
 [9] 1352.143 1417.312
> rowVars(tmp5,na.rm=TRUE)
 [1] 8170.61918   56.02853   51.63158   66.50451   72.00022   75.81990
 [7]   78.85998         NA   60.13089   91.46814
> rowSd(tmp5,na.rm=TRUE)
 [1] 90.391477  7.485221  7.185512  8.155030  8.485294  8.707462  8.880314
 [8]        NA  7.754411  9.563898
> rowMax(tmp5,na.rm=TRUE)
 [1] 471.34163  86.14069  88.02266  87.14993  84.16085  87.66003  83.71198
 [8]        NA  81.32425  85.07196
> rowMin(tmp5,na.rm=TRUE)
 [1] 55.86900 56.27765 59.30708 58.12131 57.17881 55.73022 53.61415       NA
 [9] 55.42157 54.73025
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1] 113.41414  65.56767  70.74805  68.71350  69.85134  65.80252  72.96745
 [8]  69.34567  75.24308  68.02312  68.02549  72.83855       NaN  69.97940
[15]  70.34786  70.88917  67.19459  69.85632  65.21246  68.97615
> colSums(tmp5,na.rm=TRUE)
 [1] 1020.7272  590.1090  636.7324  618.4215  628.6621  592.2227  656.7071
 [8]  624.1111  677.1878  612.2081  612.2294  655.5470    0.0000  629.8146
[15]  633.1307  638.0025  604.7514  628.7068  586.9121  620.7854
> colVars(tmp5,na.rm=TRUE)
 [1] 18095.10413    82.48815    62.66315    69.77184    91.08462    57.08012
 [7]    64.67550    60.93054    66.72891    98.18908    42.92406    37.30442
[13]          NA    69.89224    49.25743    98.77051    67.30481    51.53135
[19]   100.38533    28.20582
> colSd(tmp5,na.rm=TRUE)
 [1] 134.518044   9.082299   7.916006   8.352954   9.543826   7.555139
 [7]   8.042108   7.805802   8.168777   9.909040   6.551646   6.107734
[13]         NA   8.360158   7.018364   9.938336   8.203951   7.178534
[19]  10.019248   5.310915
> colMax(tmp5,na.rm=TRUE)
 [1] 471.34163  82.16463  83.47214  82.90572  85.07196  76.01185  87.14993
 [8]  81.78230  84.16085  88.02266  79.72972  80.17478      -Inf  83.71198
[15]  77.73491  86.52873  81.38961  85.04582  86.14069  77.15722
> colMin(tmp5,na.rm=TRUE)
 [1] 54.73025 58.30238 57.22766 56.10671 54.08829 55.73022 61.74469 59.30539
 [9] 63.40417 56.60578 61.62715 63.49702      Inf 55.42157 57.17881 53.61415
[17] 58.02784 58.12131 56.51846 62.32884
> 
> 
> 
> 
> 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] 225.25346 110.70224 207.19824 152.88954 182.54610  96.01261 295.45012
 [8] 167.69703 296.88844 218.89362
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 225.25346 110.70224 207.19824 152.88954 182.54610  96.01261 295.45012
 [8] 167.69703 296.88844 218.89362
> 
> 
> 
> 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]  3.410605e-13  1.705303e-13 -1.421085e-13 -8.526513e-14  5.684342e-14
 [6] -1.136868e-13 -1.136868e-13  5.684342e-14  0.000000e+00 -5.684342e-14
[11] -5.684342e-14 -2.273737e-13  0.000000e+00  0.000000e+00  1.136868e-13
[16]  0.000000e+00  5.684342e-14  2.273737e-13 -9.947598e-14 -8.526513e-14
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> ## making sure these things agree
> ##
> ## first when there is no NA
> 
> 
> 
> agree.checks <- function(buff.matrix,r.matrix,err.tol=1e-10){
+ 
+   if (Max(buff.matrix,na.rm=TRUE) != max(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Max")
+   }
+   
+ 
+   if (Min(buff.matrix,na.rm=TRUE) != min(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Min")
+   }
+ 
+ 
+   if (abs(Sum(buff.matrix,na.rm=TRUE)- sum(r.matrix,na.rm=TRUE)) > err.tol){
+ 
+     cat(Sum(buff.matrix,na.rm=TRUE),"\n")
+     cat(sum(r.matrix,na.rm=TRUE),"\n")
+     cat(Sum(buff.matrix,na.rm=TRUE) - sum(r.matrix,na.rm=TRUE),"\n")
+     
+     stop("No agreement in Sum")
+   }
+   
+   if (abs(mean(buff.matrix,na.rm=TRUE) - mean(r.matrix,na.rm=TRUE)) > err.tol){
+     stop("No agreement in mean")
+   }
+   
+   
+   if(abs(Var(buff.matrix,na.rm=TRUE) - var(as.vector(r.matrix),na.rm=TRUE)) > err.tol){
+     stop("No agreement in Var")
+   }
+   
+   
+ 
+   if(any(abs(rowMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,mean,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowMeans")
+   }
+   
+   
+   if(any(abs(colMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,mean,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colMeans")
+   }
+   
+   
+   if(any(abs(rowSums(buff.matrix,na.rm=TRUE)  -  apply(r.matrix,1,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in rowSums")
+   }
+   
+   
+   if(any(abs(colSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colSums")
+   }
+   
+   ### this is to get around the fact that R doesn't like to compute NA on an entire vector of NA when 
+   ### computing variance
+   my.Var <- function(x,na.rm=FALSE){
+    if (all(is.na(x))){
+      return(NA)
+    } else {
+      var(x,na.rm=na.rm)
+    }
+ 
+   }
+   
+   if(any(abs(rowVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+   
+   
+   if(any(abs(colVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+ 
+ 
+   if(any(abs(rowMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+ 
+   if(any(abs(colMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+   
+   
+   if(any(abs(rowMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+   
+ 
+   if(any(abs(colMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+ 
+   if(any(abs(colMedians(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,median,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMedian")
+   }
+ 
+   if(any(abs(colRanges(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,range,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colRanges")
+   }
+ 
+ 
+   
+ }
> 
> 
> 
> 
> 
> 
> 
> 
> 
> for (rep in 1:20){
+   copymatrix <- matrix(rnorm(200,150,15),10,20)
+   
+   tmp5[1:10,1:20] <- copymatrix
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ## now lets assign some NA values and check agreement
+ 
+   which.row <- sample(1:10,1,replace=TRUE)
+   which.col  <- sample(1:20,1,replace=TRUE)
+   
+   cat(which.row," ",which.col,"\n")
+   
+   tmp5[which.row,which.col] <- NA
+   copymatrix[which.row,which.col] <- NA
+   
+   agree.checks(tmp5,copymatrix)
+ 
+   ## make an entire row NA
+   tmp5[which.row,] <- NA
+   copymatrix[which.row,] <- NA
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ### also make an entire col NA
+   tmp5[,which.col] <- NA
+   copymatrix[,which.col] <- NA
+ 
+   agree.checks(tmp5,copymatrix)
+ 
+   ### now make 1 element non NA with NA in the rest of row and column
+ 
+   tmp5[which.row,which.col] <- rnorm(1,150,15)
+   copymatrix[which.row,which.col] <- tmp5[which.row,which.col]
+ 
+   agree.checks(tmp5,copymatrix)
+ }
2   13 
1   2 
7   4 
1   8 
1   14 
5   9 
4   19 
2   3 
3   15 
2   2 
1   16 
5   11 
4   9 
10   14 
5   5 
5   9 
2   10 
3   9 
7   10 
10   5 
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.421371
> Min(tmp)
[1] -2.483261
> mean(tmp)
[1] -0.09300642
> Sum(tmp)
[1] -9.300642
> Var(tmp)
[1] 1.040747
> 
> rowMeans(tmp)
[1] -0.09300642
> rowSums(tmp)
[1] -9.300642
> rowVars(tmp)
[1] 1.040747
> rowSd(tmp)
[1] 1.02017
> rowMax(tmp)
[1] 2.421371
> rowMin(tmp)
[1] -2.483261
> 
> colMeans(tmp)
  [1] -0.505518596 -1.314011934 -0.382260260 -1.125631563  0.016879197
  [6] -1.164300082  0.277935862  0.250066647 -0.652737894  0.014183032
 [11] -0.372785903  0.940476217 -0.938520624  1.621385645  0.177501658
 [16] -0.465029585 -0.256164853 -0.610580936 -0.157948250  0.154842019
 [21]  0.093907645  0.062232694 -0.484774624  0.986317096  0.026320048
 [26]  0.137152498  0.017157449 -0.165481969 -1.509162913  0.008974782
 [31]  0.175102761 -0.452607739  0.029645502  1.208618637  0.724363673
 [36] -1.453961316 -1.377252629  2.128055968  0.859139332 -1.578845442
 [41] -2.483260853 -1.014669930 -0.126362482 -0.108237865  0.043187509
 [46]  0.524543776 -1.266862555 -0.819308644  0.648575578 -2.273494900
 [51]  0.058598924 -1.454693353 -0.968709614 -2.348159741  1.364971094
 [56]  0.826622667  0.446929553 -0.953789789 -0.320628503 -0.452053351
 [61]  1.549955233  0.069308145 -0.077599320  0.800411624  0.022679704
 [66]  0.727778218 -0.648462412  2.421371079  1.379823205  0.053690910
 [71]  0.656842764 -1.777797808 -0.064591373  1.138749000  0.997824878
 [76] -1.663670796  1.306463513 -1.042642941 -1.089585347 -0.546534607
 [81]  1.278129145 -0.055133992  1.420592803 -0.226058455  0.930802223
 [86]  0.541481875 -2.270675407  0.916372189 -0.439678768  0.274685944
 [91]  0.946444826 -0.265681677  0.609043607 -2.346171288  0.763502743
 [96] -0.449504382  1.447681606  0.578791476 -0.029621049 -1.405537854
> colSums(tmp)
  [1] -0.505518596 -1.314011934 -0.382260260 -1.125631563  0.016879197
  [6] -1.164300082  0.277935862  0.250066647 -0.652737894  0.014183032
 [11] -0.372785903  0.940476217 -0.938520624  1.621385645  0.177501658
 [16] -0.465029585 -0.256164853 -0.610580936 -0.157948250  0.154842019
 [21]  0.093907645  0.062232694 -0.484774624  0.986317096  0.026320048
 [26]  0.137152498  0.017157449 -0.165481969 -1.509162913  0.008974782
 [31]  0.175102761 -0.452607739  0.029645502  1.208618637  0.724363673
 [36] -1.453961316 -1.377252629  2.128055968  0.859139332 -1.578845442
 [41] -2.483260853 -1.014669930 -0.126362482 -0.108237865  0.043187509
 [46]  0.524543776 -1.266862555 -0.819308644  0.648575578 -2.273494900
 [51]  0.058598924 -1.454693353 -0.968709614 -2.348159741  1.364971094
 [56]  0.826622667  0.446929553 -0.953789789 -0.320628503 -0.452053351
 [61]  1.549955233  0.069308145 -0.077599320  0.800411624  0.022679704
 [66]  0.727778218 -0.648462412  2.421371079  1.379823205  0.053690910
 [71]  0.656842764 -1.777797808 -0.064591373  1.138749000  0.997824878
 [76] -1.663670796  1.306463513 -1.042642941 -1.089585347 -0.546534607
 [81]  1.278129145 -0.055133992  1.420592803 -0.226058455  0.930802223
 [86]  0.541481875 -2.270675407  0.916372189 -0.439678768  0.274685944
 [91]  0.946444826 -0.265681677  0.609043607 -2.346171288  0.763502743
 [96] -0.449504382  1.447681606  0.578791476 -0.029621049 -1.405537854
> 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.505518596 -1.314011934 -0.382260260 -1.125631563  0.016879197
  [6] -1.164300082  0.277935862  0.250066647 -0.652737894  0.014183032
 [11] -0.372785903  0.940476217 -0.938520624  1.621385645  0.177501658
 [16] -0.465029585 -0.256164853 -0.610580936 -0.157948250  0.154842019
 [21]  0.093907645  0.062232694 -0.484774624  0.986317096  0.026320048
 [26]  0.137152498  0.017157449 -0.165481969 -1.509162913  0.008974782
 [31]  0.175102761 -0.452607739  0.029645502  1.208618637  0.724363673
 [36] -1.453961316 -1.377252629  2.128055968  0.859139332 -1.578845442
 [41] -2.483260853 -1.014669930 -0.126362482 -0.108237865  0.043187509
 [46]  0.524543776 -1.266862555 -0.819308644  0.648575578 -2.273494900
 [51]  0.058598924 -1.454693353 -0.968709614 -2.348159741  1.364971094
 [56]  0.826622667  0.446929553 -0.953789789 -0.320628503 -0.452053351
 [61]  1.549955233  0.069308145 -0.077599320  0.800411624  0.022679704
 [66]  0.727778218 -0.648462412  2.421371079  1.379823205  0.053690910
 [71]  0.656842764 -1.777797808 -0.064591373  1.138749000  0.997824878
 [76] -1.663670796  1.306463513 -1.042642941 -1.089585347 -0.546534607
 [81]  1.278129145 -0.055133992  1.420592803 -0.226058455  0.930802223
 [86]  0.541481875 -2.270675407  0.916372189 -0.439678768  0.274685944
 [91]  0.946444826 -0.265681677  0.609043607 -2.346171288  0.763502743
 [96] -0.449504382  1.447681606  0.578791476 -0.029621049 -1.405537854
> colMin(tmp)
  [1] -0.505518596 -1.314011934 -0.382260260 -1.125631563  0.016879197
  [6] -1.164300082  0.277935862  0.250066647 -0.652737894  0.014183032
 [11] -0.372785903  0.940476217 -0.938520624  1.621385645  0.177501658
 [16] -0.465029585 -0.256164853 -0.610580936 -0.157948250  0.154842019
 [21]  0.093907645  0.062232694 -0.484774624  0.986317096  0.026320048
 [26]  0.137152498  0.017157449 -0.165481969 -1.509162913  0.008974782
 [31]  0.175102761 -0.452607739  0.029645502  1.208618637  0.724363673
 [36] -1.453961316 -1.377252629  2.128055968  0.859139332 -1.578845442
 [41] -2.483260853 -1.014669930 -0.126362482 -0.108237865  0.043187509
 [46]  0.524543776 -1.266862555 -0.819308644  0.648575578 -2.273494900
 [51]  0.058598924 -1.454693353 -0.968709614 -2.348159741  1.364971094
 [56]  0.826622667  0.446929553 -0.953789789 -0.320628503 -0.452053351
 [61]  1.549955233  0.069308145 -0.077599320  0.800411624  0.022679704
 [66]  0.727778218 -0.648462412  2.421371079  1.379823205  0.053690910
 [71]  0.656842764 -1.777797808 -0.064591373  1.138749000  0.997824878
 [76] -1.663670796  1.306463513 -1.042642941 -1.089585347 -0.546534607
 [81]  1.278129145 -0.055133992  1.420592803 -0.226058455  0.930802223
 [86]  0.541481875 -2.270675407  0.916372189 -0.439678768  0.274685944
 [91]  0.946444826 -0.265681677  0.609043607 -2.346171288  0.763502743
 [96] -0.449504382  1.447681606  0.578791476 -0.029621049 -1.405537854
> colMedians(tmp)
  [1] -0.505518596 -1.314011934 -0.382260260 -1.125631563  0.016879197
  [6] -1.164300082  0.277935862  0.250066647 -0.652737894  0.014183032
 [11] -0.372785903  0.940476217 -0.938520624  1.621385645  0.177501658
 [16] -0.465029585 -0.256164853 -0.610580936 -0.157948250  0.154842019
 [21]  0.093907645  0.062232694 -0.484774624  0.986317096  0.026320048
 [26]  0.137152498  0.017157449 -0.165481969 -1.509162913  0.008974782
 [31]  0.175102761 -0.452607739  0.029645502  1.208618637  0.724363673
 [36] -1.453961316 -1.377252629  2.128055968  0.859139332 -1.578845442
 [41] -2.483260853 -1.014669930 -0.126362482 -0.108237865  0.043187509
 [46]  0.524543776 -1.266862555 -0.819308644  0.648575578 -2.273494900
 [51]  0.058598924 -1.454693353 -0.968709614 -2.348159741  1.364971094
 [56]  0.826622667  0.446929553 -0.953789789 -0.320628503 -0.452053351
 [61]  1.549955233  0.069308145 -0.077599320  0.800411624  0.022679704
 [66]  0.727778218 -0.648462412  2.421371079  1.379823205  0.053690910
 [71]  0.656842764 -1.777797808 -0.064591373  1.138749000  0.997824878
 [76] -1.663670796  1.306463513 -1.042642941 -1.089585347 -0.546534607
 [81]  1.278129145 -0.055133992  1.420592803 -0.226058455  0.930802223
 [86]  0.541481875 -2.270675407  0.916372189 -0.439678768  0.274685944
 [91]  0.946444826 -0.265681677  0.609043607 -2.346171288  0.763502743
 [96] -0.449504382  1.447681606  0.578791476 -0.029621049 -1.405537854
> colRanges(tmp)
           [,1]      [,2]       [,3]      [,4]      [,5]    [,6]      [,7]
[1,] -0.5055186 -1.314012 -0.3822603 -1.125632 0.0168792 -1.1643 0.2779359
[2,] -0.5055186 -1.314012 -0.3822603 -1.125632 0.0168792 -1.1643 0.2779359
          [,8]       [,9]      [,10]      [,11]     [,12]      [,13]    [,14]
[1,] 0.2500666 -0.6527379 0.01418303 -0.3727859 0.9404762 -0.9385206 1.621386
[2,] 0.2500666 -0.6527379 0.01418303 -0.3727859 0.9404762 -0.9385206 1.621386
         [,15]      [,16]      [,17]      [,18]      [,19]    [,20]      [,21]
[1,] 0.1775017 -0.4650296 -0.2561649 -0.6105809 -0.1579483 0.154842 0.09390764
[2,] 0.1775017 -0.4650296 -0.2561649 -0.6105809 -0.1579483 0.154842 0.09390764
          [,22]      [,23]     [,24]      [,25]     [,26]      [,27]     [,28]
[1,] 0.06223269 -0.4847746 0.9863171 0.02632005 0.1371525 0.01715745 -0.165482
[2,] 0.06223269 -0.4847746 0.9863171 0.02632005 0.1371525 0.01715745 -0.165482
         [,29]       [,30]     [,31]      [,32]     [,33]    [,34]     [,35]
[1,] -1.509163 0.008974782 0.1751028 -0.4526077 0.0296455 1.208619 0.7243637
[2,] -1.509163 0.008974782 0.1751028 -0.4526077 0.0296455 1.208619 0.7243637
         [,36]     [,37]    [,38]     [,39]     [,40]     [,41]    [,42]
[1,] -1.453961 -1.377253 2.128056 0.8591393 -1.578845 -2.483261 -1.01467
[2,] -1.453961 -1.377253 2.128056 0.8591393 -1.578845 -2.483261 -1.01467
          [,43]      [,44]      [,45]     [,46]     [,47]      [,48]     [,49]
[1,] -0.1263625 -0.1082379 0.04318751 0.5245438 -1.266863 -0.8193086 0.6485756
[2,] -0.1263625 -0.1082379 0.04318751 0.5245438 -1.266863 -0.8193086 0.6485756
         [,50]      [,51]     [,52]      [,53]    [,54]    [,55]     [,56]
[1,] -2.273495 0.05859892 -1.454693 -0.9687096 -2.34816 1.364971 0.8266227
[2,] -2.273495 0.05859892 -1.454693 -0.9687096 -2.34816 1.364971 0.8266227
         [,57]      [,58]      [,59]      [,60]    [,61]      [,62]       [,63]
[1,] 0.4469296 -0.9537898 -0.3206285 -0.4520534 1.549955 0.06930815 -0.07759932
[2,] 0.4469296 -0.9537898 -0.3206285 -0.4520534 1.549955 0.06930815 -0.07759932
         [,64]     [,65]     [,66]      [,67]    [,68]    [,69]      [,70]
[1,] 0.8004116 0.0226797 0.7277782 -0.6484624 2.421371 1.379823 0.05369091
[2,] 0.8004116 0.0226797 0.7277782 -0.6484624 2.421371 1.379823 0.05369091
         [,71]     [,72]       [,73]    [,74]     [,75]     [,76]    [,77]
[1,] 0.6568428 -1.777798 -0.06459137 1.138749 0.9978249 -1.663671 1.306464
[2,] 0.6568428 -1.777798 -0.06459137 1.138749 0.9978249 -1.663671 1.306464
         [,78]     [,79]      [,80]    [,81]       [,82]    [,83]      [,84]
[1,] -1.042643 -1.089585 -0.5465346 1.278129 -0.05513399 1.420593 -0.2260585
[2,] -1.042643 -1.089585 -0.5465346 1.278129 -0.05513399 1.420593 -0.2260585
         [,85]     [,86]     [,87]     [,88]      [,89]     [,90]     [,91]
[1,] 0.9308022 0.5414819 -2.270675 0.9163722 -0.4396788 0.2746859 0.9464448
[2,] 0.9308022 0.5414819 -2.270675 0.9163722 -0.4396788 0.2746859 0.9464448
          [,92]     [,93]     [,94]     [,95]      [,96]    [,97]     [,98]
[1,] -0.2656817 0.6090436 -2.346171 0.7635027 -0.4495044 1.447682 0.5787915
[2,] -0.2656817 0.6090436 -2.346171 0.7635027 -0.4495044 1.447682 0.5787915
           [,99]    [,100]
[1,] -0.02962105 -1.405538
[2,] -0.02962105 -1.405538
> 
> 
> Max(tmp2)
[1] 2.484248
> Min(tmp2)
[1] -2.302785
> mean(tmp2)
[1] 0.1527969
> Sum(tmp2)
[1] 15.27969
> Var(tmp2)
[1] 0.8899365
> 
> rowMeans(tmp2)
  [1]  0.437365664 -1.914874970  0.305764392 -0.383563976  1.111715311
  [6]  1.157229877 -0.368802940 -0.161178185  1.750465366  0.496744018
 [11] -0.870506853 -0.879120683 -0.265692792 -0.048517083  0.050626912
 [16]  0.365936364  1.000584577  0.089399267 -1.577766509  0.787213317
 [21] -0.086306521 -1.211666685 -0.494065873 -1.355857776  0.247922872
 [26] -0.219793774  1.126035187  1.928582002  0.935654284 -0.570983450
 [31]  1.123549636 -0.045551119  0.418913944 -0.824925229  0.911874092
 [36] -0.477987200  0.826710253  0.859724912  0.024606388  0.029287341
 [41]  1.666440386  0.002892212  0.532124651 -1.286175497  0.804259907
 [46] -0.234445307  0.755158650 -1.902783708 -1.351963374 -0.034851589
 [51] -0.189106172  2.484247703  0.128060900 -0.017395751  0.965239570
 [56] -1.086929893  1.396052238  1.573955275  0.963091508 -0.054889138
 [61]  0.943495500 -0.798825136  0.028225698  0.686809091 -1.223726629
 [66] -0.452004028 -0.481761609  1.285099627  0.761266118  0.709299333
 [71]  0.049922369  1.503012473  0.103160177 -1.171027170 -0.802679302
 [76] -0.032973247 -1.270224119 -0.597780588  1.781564280 -2.302785221
 [81]  0.150022129  0.248377400  0.448670691 -1.054520117  0.731475568
 [86] -0.205053363  0.233415322  0.858696687 -0.351618950  0.646992564
 [91]  2.015960985 -0.106905964  0.905894563  1.429370576 -0.689985295
 [96] -0.084295486 -0.561248316  0.817186946  0.643090304  1.144364530
> rowSums(tmp2)
  [1]  0.437365664 -1.914874970  0.305764392 -0.383563976  1.111715311
  [6]  1.157229877 -0.368802940 -0.161178185  1.750465366  0.496744018
 [11] -0.870506853 -0.879120683 -0.265692792 -0.048517083  0.050626912
 [16]  0.365936364  1.000584577  0.089399267 -1.577766509  0.787213317
 [21] -0.086306521 -1.211666685 -0.494065873 -1.355857776  0.247922872
 [26] -0.219793774  1.126035187  1.928582002  0.935654284 -0.570983450
 [31]  1.123549636 -0.045551119  0.418913944 -0.824925229  0.911874092
 [36] -0.477987200  0.826710253  0.859724912  0.024606388  0.029287341
 [41]  1.666440386  0.002892212  0.532124651 -1.286175497  0.804259907
 [46] -0.234445307  0.755158650 -1.902783708 -1.351963374 -0.034851589
 [51] -0.189106172  2.484247703  0.128060900 -0.017395751  0.965239570
 [56] -1.086929893  1.396052238  1.573955275  0.963091508 -0.054889138
 [61]  0.943495500 -0.798825136  0.028225698  0.686809091 -1.223726629
 [66] -0.452004028 -0.481761609  1.285099627  0.761266118  0.709299333
 [71]  0.049922369  1.503012473  0.103160177 -1.171027170 -0.802679302
 [76] -0.032973247 -1.270224119 -0.597780588  1.781564280 -2.302785221
 [81]  0.150022129  0.248377400  0.448670691 -1.054520117  0.731475568
 [86] -0.205053363  0.233415322  0.858696687 -0.351618950  0.646992564
 [91]  2.015960985 -0.106905964  0.905894563  1.429370576 -0.689985295
 [96] -0.084295486 -0.561248316  0.817186946  0.643090304  1.144364530
> rowVars(tmp2)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowSd(tmp2)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowMax(tmp2)
  [1]  0.437365664 -1.914874970  0.305764392 -0.383563976  1.111715311
  [6]  1.157229877 -0.368802940 -0.161178185  1.750465366  0.496744018
 [11] -0.870506853 -0.879120683 -0.265692792 -0.048517083  0.050626912
 [16]  0.365936364  1.000584577  0.089399267 -1.577766509  0.787213317
 [21] -0.086306521 -1.211666685 -0.494065873 -1.355857776  0.247922872
 [26] -0.219793774  1.126035187  1.928582002  0.935654284 -0.570983450
 [31]  1.123549636 -0.045551119  0.418913944 -0.824925229  0.911874092
 [36] -0.477987200  0.826710253  0.859724912  0.024606388  0.029287341
 [41]  1.666440386  0.002892212  0.532124651 -1.286175497  0.804259907
 [46] -0.234445307  0.755158650 -1.902783708 -1.351963374 -0.034851589
 [51] -0.189106172  2.484247703  0.128060900 -0.017395751  0.965239570
 [56] -1.086929893  1.396052238  1.573955275  0.963091508 -0.054889138
 [61]  0.943495500 -0.798825136  0.028225698  0.686809091 -1.223726629
 [66] -0.452004028 -0.481761609  1.285099627  0.761266118  0.709299333
 [71]  0.049922369  1.503012473  0.103160177 -1.171027170 -0.802679302
 [76] -0.032973247 -1.270224119 -0.597780588  1.781564280 -2.302785221
 [81]  0.150022129  0.248377400  0.448670691 -1.054520117  0.731475568
 [86] -0.205053363  0.233415322  0.858696687 -0.351618950  0.646992564
 [91]  2.015960985 -0.106905964  0.905894563  1.429370576 -0.689985295
 [96] -0.084295486 -0.561248316  0.817186946  0.643090304  1.144364530
> rowMin(tmp2)
  [1]  0.437365664 -1.914874970  0.305764392 -0.383563976  1.111715311
  [6]  1.157229877 -0.368802940 -0.161178185  1.750465366  0.496744018
 [11] -0.870506853 -0.879120683 -0.265692792 -0.048517083  0.050626912
 [16]  0.365936364  1.000584577  0.089399267 -1.577766509  0.787213317
 [21] -0.086306521 -1.211666685 -0.494065873 -1.355857776  0.247922872
 [26] -0.219793774  1.126035187  1.928582002  0.935654284 -0.570983450
 [31]  1.123549636 -0.045551119  0.418913944 -0.824925229  0.911874092
 [36] -0.477987200  0.826710253  0.859724912  0.024606388  0.029287341
 [41]  1.666440386  0.002892212  0.532124651 -1.286175497  0.804259907
 [46] -0.234445307  0.755158650 -1.902783708 -1.351963374 -0.034851589
 [51] -0.189106172  2.484247703  0.128060900 -0.017395751  0.965239570
 [56] -1.086929893  1.396052238  1.573955275  0.963091508 -0.054889138
 [61]  0.943495500 -0.798825136  0.028225698  0.686809091 -1.223726629
 [66] -0.452004028 -0.481761609  1.285099627  0.761266118  0.709299333
 [71]  0.049922369  1.503012473  0.103160177 -1.171027170 -0.802679302
 [76] -0.032973247 -1.270224119 -0.597780588  1.781564280 -2.302785221
 [81]  0.150022129  0.248377400  0.448670691 -1.054520117  0.731475568
 [86] -0.205053363  0.233415322  0.858696687 -0.351618950  0.646992564
 [91]  2.015960985 -0.106905964  0.905894563  1.429370576 -0.689985295
 [96] -0.084295486 -0.561248316  0.817186946  0.643090304  1.144364530
> 
> colMeans(tmp2)
[1] 0.1527969
> colSums(tmp2)
[1] 15.27969
> colVars(tmp2)
[1] 0.8899365
> colSd(tmp2)
[1] 0.9433645
> colMax(tmp2)
[1] 2.484248
> colMin(tmp2)
[1] -2.302785
> colMedians(tmp2)
[1] 0.07001309
> colRanges(tmp2)
          [,1]
[1,] -2.302785
[2,]  2.484248
> 
> 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.4328692  0.6334373 -3.4094247 -4.0605767  3.7249201  4.2526908
 [7]  1.1899616  4.0407327 -1.0760320 -1.5894973
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -1.1148433
[2,] -0.3871703
[3,]  0.2541322
[4,]  0.5046327
[5,]  1.7491930
> 
> rowApply(tmp,sum)
 [1]  2.699235  6.328737  3.478247 -1.721935 -3.580609 -4.472681  0.958152
 [8]  1.560493 -1.314485  1.203927
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    6   10    3    3    3    6    6    7    5     8
 [2,]    5    2    7    7    8    8    5    6    1     6
 [3,]    9    5    1    5    5    1    1    2    6    10
 [4,]    2    7    2    1    6    7    8    4    2     5
 [5,]    3    6    6    8    2   10   10    3    8     4
 [6,]    7    4    8    9    9    5    4    5   10     3
 [7,]   10    1    5   10    1    3    9    9    7     7
 [8,]    8    9    9    6   10    2    7    1    4     9
 [9,]    4    8    4    2    7    4    2   10    9     2
[10,]    1    3   10    4    4    9    3    8    3     1
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1] -2.2020163 -0.8201159  2.0326822  4.0550585  0.5802763 -4.1096007
 [7] -2.9023177 -0.4791937  3.7108076  0.2305955 -1.8853891 -1.0267995
[13]  0.8248661  0.9276986  0.0914522 -0.4444395  0.1295081 -0.5999987
[19] -2.8179617  1.4097911
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -1.0333027
[2,] -0.5501919
[3,] -0.4477500
[4,] -0.3600563
[5,]  0.1892846
> 
> rowApply(tmp,sum)
[1] -2.484568  3.709136 -1.839143 -4.894252  2.213730
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]   13    6    9    8    3
[2,]   20    9    1   20    1
[3,]   15   11   20    2   19
[4,]   11   18   17   19   16
[5,]   10    4   11   14   17
> 
> 
> as.matrix(tmp)
           [,1]       [,2]       [,3]       [,4]        [,5]       [,6]
[1,]  0.1892846  1.2656358  0.3320026 0.06038275  0.05835697 -1.7817966
[2,] -0.5501919 -0.3432069 -0.1447554 1.93767230 -0.80816128 -0.7155538
[3,] -0.4477500 -1.3138169  2.3966244 0.71602057 -0.19731221 -0.8007979
[4,] -0.3600563  0.9464547 -1.7663287 0.75553001  0.35001033 -0.9881146
[5,] -1.0333027 -1.3751827  1.2151392 0.58545284  1.17738250  0.1766621
            [,7]        [,8]         [,9]      [,10]       [,11]      [,12]
[1,] -0.70913363  0.54951574  0.504651561 -1.4286379 -0.07845027 -1.0668022
[2,] -0.43338730  0.02188112  1.364688392 -2.1393816  0.84047675  1.7804023
[3,] -1.06829688 -0.95508588 -0.004661387  1.0244564 -0.29098454 -1.0290720
[4,] -0.07603151 -0.66702547  0.649353712  0.3919713 -2.60355313 -0.4734350
[5,] -0.61546833  0.57152082  1.196775308  2.3821873  0.24712204 -0.2378926
          [,13]       [,14]      [,15]      [,16]      [,17]      [,18]
[1,]  0.1613529 -0.45661777  0.2308309 -0.6221794  0.5267709 -0.3348571
[2,]  1.9707383  1.97469855 -0.8881939  0.6861623 -0.3838731 -0.1490113
[3,] -0.7963626  0.59610470  0.5928171 -0.1617379 -0.5272675 -1.0090141
[4,] -0.2472160 -1.22439089  0.6394702 -0.1022145  0.7078794  0.3146110
[5,] -0.2636464  0.03790405 -0.4834721 -0.2444700 -0.1940015  0.5782727
          [,19]      [,20]
[1,] -0.7955482  0.9106708
[2,] -0.9344049  0.6225375
[3,]  0.1437893  1.2932044
[4,] -0.1465462 -0.9946208
[5,] -1.0852518 -0.4220006
> 
> 
> 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.24-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.24-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  654  bytes.
Disk usage :  200  bytes.
> subBufferedMatrix(tmp,,5:8)
BufferedMatrix object
Matrix size:  5 4 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  566  bytes.
Disk usage :  160  bytes.
> subBufferedMatrix(tmp,1:3,)
BufferedMatrix object
Matrix size:  3 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.24-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.237101 -0.09875794 -1.930764 -0.3861882 -1.228043 -1.348179 -0.475081
       col8     col9      col10     col11       col12     col13     col14
row1 2.1259 -1.38937 -0.4907883 0.4841475 -0.02539275 -1.350419 0.6637154
        col15     col16     col17      col18      col19     col20
row1 0.198439 -1.210852 -1.244435 -0.3921905 -0.6533327 0.5990724
> tmp[,"col10"]
           col10
row1 -0.49078830
row2  1.85950042
row3 -0.75890910
row4  1.01011081
row5 -0.09242809
> tmp[c("row1","row5"),]
          col1        col2      col3       col4      col5       col6       col7
row1 1.2371013 -0.09875794 -1.930764 -0.3861882 -1.228043 -1.3481792 -0.4750810
row5 0.8863605 -0.28797290 -1.716883  1.3461219  2.264558  0.2796782  0.1119766
          col8      col9       col10     col11       col12      col13
row1 2.1258998 -1.389370 -0.49078830 0.4841475 -0.02539275 -1.3504187
row5 0.8314201  1.228801 -0.09242809 0.3417825 -1.12525544 -0.3214206
          col14    col15      col16      col17      col18      col19      col20
row1  0.6637154 0.198439 -1.2108516 -1.2444346 -0.3921905 -0.6533327  0.5990724
row5 -0.1523047 1.275359 -0.8362597  0.5415842 -0.3463746  0.8958906 -1.7212945
> tmp[,c("col6","col20")]
            col6      col20
row1 -1.34817918  0.5990724
row2 -0.04794052  0.5541044
row3  1.02845539 -0.3711954
row4  0.96249288 -0.8828026
row5  0.27967823 -1.7212945
> tmp[c("row1","row5"),c("col6","col20")]
           col6      col20
row1 -1.3481792  0.5990724
row5  0.2796782 -1.7212945
> 
> 
> 
> 
> 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 51.05964 50.03259 50.66768 50.2359 50.54649 106.026 50.55834 49.41406
         col9    col10    col11    col12    col13   col14    col15    col16
row1 48.62305 49.59621 48.93092 50.21307 49.65356 48.6873 49.95363 50.22045
        col17    col18    col19    col20
row1 50.39283 51.77292 50.46818 104.3625
> tmp[,"col10"]
        col10
row1 49.59621
row2 30.24494
row3 31.32233
row4 28.87622
row5 48.44571
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 51.05964 50.03259 50.66768 50.23590 50.54649 106.0260 50.55834 49.41406
row5 49.20580 51.00572 50.37705 51.98086 49.88029 106.0113 50.43299 50.48501
         col9    col10    col11    col12    col13    col14    col15    col16
row1 48.62305 49.59621 48.93092 50.21307 49.65356 48.68730 49.95363 50.22045
row5 50.36761 48.44571 50.31659 50.02384 51.26789 50.68061 48.56309 50.36681
        col17    col18    col19    col20
row1 50.39283 51.77292 50.46818 104.3625
row5 50.82133 50.35955 50.08835 104.2718
> tmp[,c("col6","col20")]
          col6     col20
row1 106.02605 104.36254
row2  75.79512  75.09595
row3  75.56180  74.26027
row4  75.09878  77.76861
row5 106.01133 104.27184
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 106.0260 104.3625
row5 106.0113 104.2718
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 106.0260 104.3625
row5 106.0113 104.2718
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
          col13
[1,] -1.6347178
[2,]  0.9506235
[3,] -0.4944339
[4,] -1.8006078
[5,]  0.5698086
> tmp[,c("col17","col7")]
           col17          col7
[1,] -0.09850408  0.3542522158
[2,]  0.06876731 -0.1291286639
[3,] -1.06249245 -0.0002257324
[4,]  1.22545115  1.5335326270
[5,] -0.07017088 -0.7742334697
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
           col6      col20
[1,] -0.9220179 -1.4581242
[2,] -1.0350319  1.5346835
[3,]  0.0194618 -0.3570020
[4,]  2.3931328  1.3799433
[5,] -0.3887139 -0.3214503
> subBufferedMatrix(tmp,1,c("col6"))[,1]
           col1
[1,] -0.9220179
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
           col6
[1,] -0.9220179
[2,] -1.0350319
> 
> 
> 
> 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.2005650  0.7320891 -1.239445  2.0810876 -1.225054 -0.2022624 1.8914455
row1 -0.6699626 -1.3213936  1.089610 -0.3150624  1.075691  0.2052969 0.8160139
           [,8]      [,9]      [,10]      [,11]      [,12]     [,13]      [,14]
row3 -0.4310556 1.1189601 -0.8018432  0.1364444  0.3697321 -1.900184 -0.6001941
row1 -0.5840590 0.2891091  0.3960856 -2.6262968 -0.2846070  1.001281  2.3343678
        [,15]      [,16]      [,17]     [,18]      [,19]     [,20]
row3 3.313591 -0.3482994 -0.2635911 -1.838072 -0.4149728 0.3283678
row1 0.487892 -0.9688211  0.7597606  1.847613 -1.1269803 0.7410412
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
           [,1]      [,2]      [,3]      [,4]         [,5]       [,6]      [,7]
row2 -0.5128621 0.7566864 -0.565056 0.3056905 0.0005971756 0.01530624 0.5399635
          [,8]      [,9]      [,10]
row2 -2.091834 -1.309719 -0.6082702
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
           [,1]      [,2]     [,3]      [,4]       [,5]      [,6]      [,7]
row5 -0.7504852 0.7634022 1.185054 -1.319052 -0.6148559 0.2897168 0.5282409
        [,8]       [,9]      [,10]      [,11]      [,12]      [,13]      [,14]
row5 1.63207 -0.5578261 -0.8181023 -0.1251341 -0.9250965 -0.7348039 -0.4000377
          [,15]     [,16]     [,17]      [,18]     [,19]      [,20]
row5 -0.9378088 0.2586928 0.7100421 -0.2593295 -0.762124 -0.5689137
> 
> 
> 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: 0x599523a3aed0>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BM2a62246cb2c592"
 [2] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BM2a62246e835952"
 [3] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BM2a6224287e056c"
 [4] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BM2a62245273097f"
 [5] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BM2a62248c757db" 
 [6] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BM2a62243f724153"
 [7] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BM2a6224644e4ab3"
 [8] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BM2a62246b4bfdcb"
 [9] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BM2a62245a4b5caf"
[10] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BM2a62242c6b160a"
[11] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BM2a622449336077"
[12] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BM2a62246e10d5f0"
[13] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BM2a622434d04121"
[14] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BM2a622454affa52"
[15] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BM2a62242c3871b5"
> 
> 
> ### 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: 0x5995255a7b60>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x5995255a7b60>
Warning message:
In dir.create(new.directory) :
  '/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x5995255a7b60>
> rowMedians(tmp)
  [1] -0.5119456455  0.3109239020  0.2087235072  0.1192420451  0.1436383370
  [6]  0.0172861831  0.1377507236  0.0478851211  0.1453303600 -0.4737756335
 [11]  0.0784236628  0.3888955953 -0.4047670639  0.3259309480  0.2050381573
 [16] -0.4121361044  0.3322894957 -0.1133533803  0.5147716959  0.5870545098
 [21]  0.3400560429 -0.1061556259 -0.0602587044 -0.0293479078  0.0279500336
 [26]  0.3225871582  0.1538502822 -0.3898278102 -0.0938392238 -0.3223490473
 [31]  0.0438600190  0.1997469655  0.3925750482 -0.2513978870 -0.4486092610
 [36]  0.3358610781  0.3461464844  0.3675439880  0.2045115319 -0.3986971284
 [41] -0.4079782519  0.0575429551  0.0067771377 -0.7786923300  0.1327688736
 [46]  0.5943240871  0.2800177510 -0.0165359300 -0.1040528796  0.0339786364
 [51] -0.0669621753 -0.0586973758  0.0910170857  0.3460800296 -0.4075084712
 [56]  0.3627578567 -0.7779946004  0.2095518523 -0.2305244338 -0.3331413426
 [61] -0.2752778581  0.6459613253 -0.2218814264  0.1345846752  0.2258582901
 [66] -0.3677047097 -0.1732374444  0.1891978890  0.1910012220 -0.5947001005
 [71]  0.3623166969  0.4860196895  0.2547787274 -0.2738021824 -1.0140128743
 [76] -0.0969997390  0.3893053731 -0.3821754785 -0.2352030817 -0.0757945746
 [81] -0.5479336449  0.2136629493 -0.1752669071 -0.1283690706  0.0117159951
 [86] -0.0739667503  0.3053105365 -0.0462569662  0.0861186925  0.2610408904
 [91]  0.2272951093 -0.6311262213 -0.3267884328  0.4088203958  0.0353497664
 [96]  0.1771690045 -0.2979258912 -0.2063040093  0.5570045888 -0.2379047273
[101] -0.5292924799  0.0390679374  0.2443150831  0.0780196071  0.0391822374
[106] -0.2965390227 -0.3430411060  0.2877229374  0.6557711066 -0.1835442516
[111]  0.1142726874  0.1342664515 -0.1029789978  0.2927620349 -0.2974224349
[116]  0.3083303359  0.2646756018 -0.2343695342 -0.1059585933  0.1251703702
[121] -0.2756189084 -0.0879983390  0.0069936153  0.2735404500  0.6148868821
[126]  0.3754369143  0.3770986305  0.2468058519  0.3101908977  0.6860478331
[131] -0.0199148010 -0.3965158090 -0.4725870826  0.8477634977  0.3408755641
[136] -0.2473143063 -0.4410060225 -0.6326751119 -0.2945086823  0.0003177534
[141] -0.1106664339  0.0036455689  0.2623801254  0.0266198861 -0.3308784853
[146]  0.1399565487  0.8621151658 -0.0697751623  0.2036111274 -0.0942234334
[151]  0.1557394614  0.1246540484 -0.1452548670 -0.1962307610 -0.7949370073
[156]  0.1861325188  0.3199776022  0.4691320567  0.9724631917 -0.2188274436
[161]  0.3785894693 -0.2200398614  0.2131107449 -0.1738313248  0.2117416052
[166]  0.1227551003  0.0837309095  0.1278219747  0.4222465336  0.2588487562
[171] -0.2185697209  0.0900563149 -0.1843422156 -0.2125946642  0.3797033033
[176]  0.0005416873 -0.7106134282  0.5020516663 -0.2334880306 -0.3388169253
[181] -0.3442371381 -0.2928016665 -0.5648038877  0.0519087032  0.0821471083
[186]  0.0056199492 -0.0398308104  0.0139158707  0.4604448300  0.3758521952
[191]  0.1197085508  0.0535346775 -0.4510938631 -0.0302338481 -0.0652379315
[196]  0.0325945370 -0.3718757101  0.1583093820 -0.3645523625 -0.1706987506
[201] -0.1216430046 -0.1615024616  0.5433348232 -0.0148468030  0.5060424580
[206]  0.2072411336  0.2556750978 -0.1421335964 -0.4502519688  0.0618731470
[211]  0.2655721066 -0.0406477879 -0.8225464349  0.2379837178  0.2089642648
[216]  0.1547107332  0.1380398048 -0.2708066726 -0.1719349304  0.0544019952
[221] -0.0168937108 -0.4448990860  0.1682385397 -0.1373588889  0.0428756866
[226] -0.0731942007  0.3230685005  0.6865645831 -0.4079654719  0.4248963061
> 
> proc.time()
   user  system elapsed 
  1.225   0.716   1.930 

BufferedMatrix.Rcheck/tests/rawCalltesting.Rout


R version 4.6.0 RC (2026-04-17 r89917) -- "Because it was There"
Copyright (C) 2026 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu

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

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

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

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

Attaching package: 'BufferedMatrix'

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

    colMeans, colSums, rowMeans, rowSums

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

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

<pointer: 0x5645cf764520>
> .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: 0x5645cf764520>
> .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: 0x5645cf764520>
> .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: 0x5645cf764520>
> 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: 0x5645cf30df60>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5645cf30df60>
> .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: 0x5645cf30df60>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5645cf30df60>
> .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: 0x5645cf30df60>
> 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: 0x5645cfeb7b40>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5645cfeb7b40>
> .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: 0x5645cfeb7b40>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x5645cfeb7b40>
> .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: 0x5645cfeb7b40>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x5645cfeb7b40>
> .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: 0x5645cfeb7b40>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x5645cfeb7b40>
> .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: 0x5645cfeb7b40>
> 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: 0x5645cfef4bc0>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x5645cfef4bc0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5645cfef4bc0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5645cfef4bc0>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile2a63c8144b9b26" "BufferedMatrixFile2a63c835ecddee"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile2a63c8144b9b26" "BufferedMatrixFile2a63c835ecddee"
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x5645cfe8e000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5645cfe8e000>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x5645cfe8e000>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x5645cfe8e000>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x5645cfe8e000>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x5645cfe8e000>
> .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: 0x5645cefc1e30>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5645cefc1e30>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x5645cefc1e30>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x5645cefc1e30>
> 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: 0x5645cf5eba50>
> .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: 0x5645cf5eba50>
> rm(P)
> 
> proc.time()
   user  system elapsed 
  0.263   0.045   0.296 

BufferedMatrix.Rcheck/tests/Rcodetesting.Rout


R version 4.6.0 RC (2026-04-17 r89917) -- "Because it was There"
Copyright (C) 2026 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu

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

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

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

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

Attaching package: 'BufferedMatrix'

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

    colMeans, colSums, rowMeans, rowSums

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

Example timings