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

This page was generated on 2026-02-05 11:32 -0500 (Thu, 05 Feb 2026).

HostnameOSArch (*)R versionInstalled pkgs
nebbiolo1Linux (Ubuntu 24.04.3 LTS)x86_64R Under development (unstable) (2026-01-15 r89304) -- "Unsuffered Consequences" 4852
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 254/2347HostnameOS / ArchINSTALLBUILDCHECKBUILD BIN
BufferedMatrix 1.75.0  (landing page)
Ben Bolstad
Snapshot Date: 2026-02-04 13:40 -0500 (Wed, 04 Feb 2026)
git_url: https://git.bioconductor.org/packages/BufferedMatrix
git_branch: devel
git_last_commit: ecdbf23
git_last_commit_date: 2025-10-29 09:58:55 -0500 (Wed, 29 Oct 2025)
nebbiolo1Linux (Ubuntu 24.04.3 LTS) / x86_64  OK    OK    OK  UNNEEDED, same version is already published
See other builds for BufferedMatrix in R Universe.


CHECK results for BufferedMatrix on nebbiolo1

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

raw results


Summary

Package: BufferedMatrix
Version: 1.75.0
Command: /home/biocbuild/bbs-3.23-bioc/R/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/home/biocbuild/bbs-3.23-bioc/R/site-library --timings BufferedMatrix_1.75.0.tar.gz
StartedAt: 2026-02-04 21:43:08 -0500 (Wed, 04 Feb 2026)
EndedAt: 2026-02-04 21:43:33 -0500 (Wed, 04 Feb 2026)
EllapsedTime: 25.0 seconds
RetCode: 0
Status:   OK  
CheckDir: BufferedMatrix.Rcheck
Warnings: 0

Command output

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


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

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


Installation output

BufferedMatrix.Rcheck/00install.out

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


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

Tests output

BufferedMatrix.Rcheck/tests/c_code_level_tests.Rout


R Under development (unstable) (2026-01-15 r89304) -- "Unsuffered Consequences"
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.237   0.058   0.282 

BufferedMatrix.Rcheck/tests/objectTesting.Rout


R Under development (unstable) (2026-01-15 r89304) -- "Unsuffered Consequences"
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.23-bioc/meat/BufferedMatrix.Rcheck/tests"
> prefix(tmp3)
[1] "BM"
> 
> ## testing if we can remove these objects
> rm(tmp, tmp2, tmp3)
> gc()
         used (Mb) gc trigger (Mb) max used (Mb)
Ncells 478920 25.6    1048721 56.1   639242 34.2
Vcells 885815  6.8    8388608 64.0  2083259 15.9
> 
> 
> 
> 
> ##
> ## checking reads
> ##
> 
> tmp2 <- createBufferedMatrix(10,20)
> 
> test.sample <- rnorm(10*20)
> 
> tmp2[1:10,1:20] <- test.sample
> 
> test.matrix <- matrix(test.sample,10,20)
> 
> ## testing reads
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   which.col <- sample(1:20,1)
+   if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> date()
[1] "Wed Feb  4 21:43:23 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] "Wed Feb  4 21:43:23 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: 0x5b3ef9b01c10>
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   which.col <- sample(1:20,1)
+   if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,5,replace=TRUE)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> date()
[1] "Wed Feb  4 21:43:24 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] "Wed Feb  4 21:43:24 2026"
> 
> ColMode(tmp2)
<pointer: 0x5b3ef9b01c10>
> 
> 
> 
> ### 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.1016318  0.1155236  0.9510660  1.3852732
[2,]  -0.2560048  0.7132336 -0.3180515  0.3391389
[3,]  -0.4645860  1.7493484 -0.2027227 -0.7736820
[4,]   1.9477943 -0.4440624 -0.9911463  0.2808703
> ewApply(tmp5,abs)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
            [,1]      [,2]      [,3]      [,4]
[1,] 100.1016318 0.1155236 0.9510660 1.3852732
[2,]   0.2560048 0.7132336 0.3180515 0.3391389
[3,]   0.4645860 1.7493484 0.2027227 0.7736820
[4,]   1.9477943 0.4440624 0.9911463 0.2808703
> ewApply(tmp5,sqrt)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
           [,1]      [,2]      [,3]      [,4]
[1,] 10.0050803 0.3398876 0.9752261 1.1769763
[2,]  0.5059692 0.8445316 0.5639606 0.5823563
[3,]  0.6816055 1.3226294 0.4502473 0.8795919
[4,]  1.3956340 0.6663801 0.9955633 0.5299720
> 
> my.function <- function(x,power){
+   (x+5)^power
+ }
> 
> ewApply(tmp5,my.function,power=2)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
          [,1]     [,2]     [,3]     [,4]
[1,] 225.15243 28.51440 35.70333 38.15504
[2,]  30.31570 34.15855 30.95766 31.16270
[3,]  32.28064 39.97564 29.70520 34.56960
[4,]  40.90413 32.10786 35.94678 30.58059
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x5b3efa958ff0>
> exp(tmp5)
<pointer: 0x5b3efa958ff0>
> log(tmp5,2)
<pointer: 0x5b3efa958ff0>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 468.6253
> Min(tmp5)
[1] 53.85927
> mean(tmp5)
[1] 72.7656
> Sum(tmp5)
[1] 14553.12
> Var(tmp5)
[1] 859.1928
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 90.56313 71.45422 70.12345 71.75490 71.22059 70.26074 72.01527 70.97183
 [9] 69.88014 69.41175
> rowSums(tmp5)
 [1] 1811.263 1429.084 1402.469 1435.098 1424.412 1405.215 1440.305 1419.437
 [9] 1397.603 1388.235
> rowVars(tmp5)
 [1] 8007.67528   78.02522   64.74047   63.74678   59.48149   47.23254
 [7]   73.57062   52.86803  109.04495   65.17002
> rowSd(tmp5)
 [1] 89.485615  8.833188  8.046146  7.984158  7.712424  6.872594  8.577332
 [8]  7.271041 10.442459  8.072795
> rowMax(tmp5)
 [1] 468.62529  86.20468  83.20406  85.13660  88.26814  81.65907  86.28033
 [8]  89.64214  87.77676  85.04639
> rowMin(tmp5)
 [1] 54.17818 55.71191 54.71047 54.38663 56.97795 59.63208 54.20157 59.49617
 [9] 53.85927 53.88176
> 
> colMeans(tmp5)
 [1] 114.18390  69.08618  71.21574  68.99682  72.74874  70.99999  68.12894
 [8]  74.20246  69.92830  74.17144  69.06818  68.58956  71.31207  68.16577
[15]  72.01111  69.06654  73.94786  68.50389  67.23180  73.75276
> colSums(tmp5)
 [1] 1141.8390  690.8618  712.1574  689.9682  727.4874  709.9999  681.2894
 [8]  742.0246  699.2830  741.7144  690.6818  685.8956  713.1207  681.6577
[15]  720.1111  690.6654  739.4786  685.0389  672.3180  737.5276
> colVars(tmp5)
 [1] 15582.04532    56.37864    81.78820    34.70462    44.71497    69.38044
 [7]    57.61444    78.91369    93.53615    65.07886    98.45321    66.19739
[13]   110.63770    81.60085    66.45040    43.75394    33.83904    64.82882
[19]    50.28091   104.04479
> colSd(tmp5)
 [1] 124.828063   7.508571   9.043683   5.891063   6.686926   8.329492
 [7]   7.590418   8.883338   9.671409   8.067147   9.922359   8.136178
[13]  10.518446   9.033319   8.151711   6.614676   5.817133   8.051635
[19]   7.090903  10.200235
> colMax(tmp5)
 [1] 468.62529  83.20406  86.28033  79.41471  86.54628  85.84323  77.28337
 [8]  89.58170  82.97380  84.66895  88.26814  82.55479  86.20468  79.48115
[15]  84.82125  80.58566  81.33057  77.21775  76.67179  89.64214
> colMin(tmp5)
 [1] 63.09815 59.34899 59.49617 63.50780 63.33844 60.01807 57.17553 62.68974
 [9] 53.88176 64.02140 54.17818 56.42992 53.85927 54.38663 60.64464 59.63076
[17] 61.05397 54.20157 54.71047 58.89031
> 
> 
> ### 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] 90.56313 71.45422 70.12345       NA 71.22059 70.26074 72.01527 70.97183
 [9] 69.88014 69.41175
> rowSums(tmp5)
 [1] 1811.263 1429.084 1402.469       NA 1424.412 1405.215 1440.305 1419.437
 [9] 1397.603 1388.235
> rowVars(tmp5)
 [1] 8007.67528   78.02522   64.74047   60.67032   59.48149   47.23254
 [7]   73.57062   52.86803  109.04495   65.17002
> rowSd(tmp5)
 [1] 89.485615  8.833188  8.046146  7.789115  7.712424  6.872594  8.577332
 [8]  7.271041 10.442459  8.072795
> rowMax(tmp5)
 [1] 468.62529  86.20468  83.20406        NA  88.26814  81.65907  86.28033
 [8]  89.64214  87.77676  85.04639
> rowMin(tmp5)
 [1] 54.17818 55.71191 54.71047       NA 56.97795 59.63208 54.20157 59.49617
 [9] 53.85927 53.88176
> 
> colMeans(tmp5)
 [1] 114.18390  69.08618  71.21574  68.99682  72.74874  70.99999  68.12894
 [8]  74.20246  69.92830  74.17144  69.06818  68.58956        NA  68.16577
[15]  72.01111  69.06654  73.94786  68.50389  67.23180  73.75276
> colSums(tmp5)
 [1] 1141.8390  690.8618  712.1574  689.9682  727.4874  709.9999  681.2894
 [8]  742.0246  699.2830  741.7144  690.6818  685.8956        NA  681.6577
[15]  720.1111  690.6654  739.4786  685.0389  672.3180  737.5276
> colVars(tmp5)
 [1] 15582.04532    56.37864    81.78820    34.70462    44.71497    69.38044
 [7]    57.61444    78.91369    93.53615    65.07886    98.45321    66.19739
[13]          NA    81.60085    66.45040    43.75394    33.83904    64.82882
[19]    50.28091   104.04479
> colSd(tmp5)
 [1] 124.828063   7.508571   9.043683   5.891063   6.686926   8.329492
 [7]   7.590418   8.883338   9.671409   8.067147   9.922359   8.136178
[13]         NA   9.033319   8.151711   6.614676   5.817133   8.051635
[19]   7.090903  10.200235
> colMax(tmp5)
 [1] 468.62529  83.20406  86.28033  79.41471  86.54628  85.84323  77.28337
 [8]  89.58170  82.97380  84.66895  88.26814  82.55479        NA  79.48115
[15]  84.82125  80.58566  81.33057  77.21775  76.67179  89.64214
> colMin(tmp5)
 [1] 63.09815 59.34899 59.49617 63.50780 63.33844 60.01807 57.17553 62.68974
 [9] 53.88176 64.02140 54.17818 56.42992       NA 54.38663 60.64464 59.63076
[17] 61.05397 54.20157 54.71047 58.89031
> 
> Max(tmp5,na.rm=TRUE)
[1] 468.6253
> Min(tmp5,na.rm=TRUE)
[1] 53.85927
> mean(tmp5,na.rm=TRUE)
[1] 72.71722
> Sum(tmp5,na.rm=TRUE)
[1] 14470.73
> Var(tmp5,na.rm=TRUE)
[1] 863.0617
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 90.56313 71.45422 70.12345 71.19501 71.22059 70.26074 72.01527 70.97183
 [9] 69.88014 69.41175
> rowSums(tmp5,na.rm=TRUE)
 [1] 1811.263 1429.084 1402.469 1352.705 1424.412 1405.215 1440.305 1419.437
 [9] 1397.603 1388.235
> rowVars(tmp5,na.rm=TRUE)
 [1] 8007.67528   78.02522   64.74047   60.67032   59.48149   47.23254
 [7]   73.57062   52.86803  109.04495   65.17002
> rowSd(tmp5,na.rm=TRUE)
 [1] 89.485615  8.833188  8.046146  7.789115  7.712424  6.872594  8.577332
 [8]  7.271041 10.442459  8.072795
> rowMax(tmp5,na.rm=TRUE)
 [1] 468.62529  86.20468  83.20406  85.13660  88.26814  81.65907  86.28033
 [8]  89.64214  87.77676  85.04639
> rowMin(tmp5,na.rm=TRUE)
 [1] 54.17818 55.71191 54.71047 54.38663 56.97795 59.63208 54.20157 59.49617
 [9] 53.85927 53.88176
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 114.18390  69.08618  71.21574  68.99682  72.74874  70.99999  68.12894
 [8]  74.20246  69.92830  74.17144  69.06818  68.58956  70.08086  68.16577
[15]  72.01111  69.06654  73.94786  68.50389  67.23180  73.75276
> colSums(tmp5,na.rm=TRUE)
 [1] 1141.8390  690.8618  712.1574  689.9682  727.4874  709.9999  681.2894
 [8]  742.0246  699.2830  741.7144  690.6818  685.8956  630.7278  681.6577
[15]  720.1111  690.6654  739.4786  685.0389  672.3180  737.5276
> colVars(tmp5,na.rm=TRUE)
 [1] 15582.04532    56.37864    81.78820    34.70462    44.71497    69.38044
 [7]    57.61444    78.91369    93.53615    65.07886    98.45321    66.19739
[13]   107.41396    81.60085    66.45040    43.75394    33.83904    64.82882
[19]    50.28091   104.04479
> colSd(tmp5,na.rm=TRUE)
 [1] 124.828063   7.508571   9.043683   5.891063   6.686926   8.329492
 [7]   7.590418   8.883338   9.671409   8.067147   9.922359   8.136178
[13]  10.364071   9.033319   8.151711   6.614676   5.817133   8.051635
[19]   7.090903  10.200235
> colMax(tmp5,na.rm=TRUE)
 [1] 468.62529  83.20406  86.28033  79.41471  86.54628  85.84323  77.28337
 [8]  89.58170  82.97380  84.66895  88.26814  82.55479  86.20468  79.48115
[15]  84.82125  80.58566  81.33057  77.21775  76.67179  89.64214
> colMin(tmp5,na.rm=TRUE)
 [1] 63.09815 59.34899 59.49617 63.50780 63.33844 60.01807 57.17553 62.68974
 [9] 53.88176 64.02140 54.17818 56.42992 53.85927 54.38663 60.64464 59.63076
[17] 61.05397 54.20157 54.71047 58.89031
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1] 90.56313 71.45422 70.12345      NaN 71.22059 70.26074 72.01527 70.97183
 [9] 69.88014 69.41175
> rowSums(tmp5,na.rm=TRUE)
 [1] 1811.263 1429.084 1402.469    0.000 1424.412 1405.215 1440.305 1419.437
 [9] 1397.603 1388.235
> rowVars(tmp5,na.rm=TRUE)
 [1] 8007.67528   78.02522   64.74047         NA   59.48149   47.23254
 [7]   73.57062   52.86803  109.04495   65.17002
> rowSd(tmp5,na.rm=TRUE)
 [1] 89.485615  8.833188  8.046146        NA  7.712424  6.872594  8.577332
 [8]  7.271041 10.442459  8.072795
> rowMax(tmp5,na.rm=TRUE)
 [1] 468.62529  86.20468  83.20406        NA  88.26814  81.65907  86.28033
 [8]  89.64214  87.77676  85.04639
> rowMin(tmp5,na.rm=TRUE)
 [1] 54.17818 55.71191 54.71047       NA 56.97795 59.63208 54.20157 59.49617
 [9] 53.85927 53.88176
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1] 117.41138  69.33705  70.81544  69.59097  73.02504  72.09774  67.30195
 [8]  73.75409  69.37742  73.02631  69.84688  68.92163       NaN  69.69678
[15]  71.93673  68.95519  74.28674  68.30123  66.39930  73.39533
> colSums(tmp5,na.rm=TRUE)
 [1] 1056.7024  624.0335  637.3389  626.3187  657.2253  648.8797  605.7176
 [8]  663.7868  624.3968  657.2368  628.6219  620.2947    0.0000  627.2710
[15]  647.4306  620.5967  668.5807  614.7111  597.5937  660.5579
> colVars(tmp5,na.rm=TRUE)
 [1] 17412.61402    62.71792    90.20895    35.07132    49.44553    64.49615
 [7]    57.12222    86.51626   101.81424    58.46127   103.93820    73.23154
[13]          NA    65.43088    74.69445    49.08368    36.77691    72.47036
[19]    48.76897   115.61309
> colSd(tmp5,na.rm=TRUE)
 [1] 131.956864   7.919464   9.497839   5.922105   7.031751   8.030950
 [7]   7.557925   9.301412  10.090304   7.645997  10.195009   8.557543
[13]         NA   8.088935   8.642595   7.005975   6.064397   8.512953
[19]   6.983479  10.752353
> colMax(tmp5,na.rm=TRUE)
 [1] 468.62529  83.20406  86.28033  79.41471  86.54628  85.84323  77.28337
 [8]  89.58170  82.97380  84.66895  88.26814  82.55479      -Inf  79.48115
[15]  84.82125  80.58566  81.33057  77.21775  76.67179  89.64214
> colMin(tmp5,na.rm=TRUE)
 [1] 63.09815 59.34899 59.49617 63.50780 63.33844 60.01807 57.17553 62.68974
 [9] 53.88176 64.02140 54.17818 56.42992      Inf 56.55333 60.64464 59.63076
[17] 61.05397 54.20157 54.71047 58.89031
> 
> 
> 
> 
> 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] 228.5137 309.2314 198.5199 202.9034 211.8947 340.1559 222.8902 202.2895
 [9] 169.9399 239.2206
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 228.5137 309.2314 198.5199 202.9034 211.8947 340.1559 222.8902 202.2895
 [9] 169.9399 239.2206
> 
> 
> 
> 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]  9.947598e-14  1.705303e-13  1.421085e-13 -1.705303e-13 -1.705303e-13
 [6] -4.263256e-14  0.000000e+00 -5.684342e-14  1.421085e-13  1.136868e-13
[11]  0.000000e+00 -1.136868e-13 -5.684342e-14  2.842171e-14  5.684342e-14
[16]  2.842171e-14  0.000000e+00 -5.684342e-14 -1.421085e-14  5.684342e-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)
+ }
4   11 
10   14 
3   9 
1   19 
7   2 
5   15 
3   11 
7   5 
4   17 
7   2 
1   2 
7   11 
9   19 
10   19 
4   9 
8   16 
4   15 
4   11 
3   16 
3   9 
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.493915
> Min(tmp)
[1] -3.191368
> mean(tmp)
[1] -0.05036603
> Sum(tmp)
[1] -5.036603
> Var(tmp)
[1] 1.027819
> 
> rowMeans(tmp)
[1] -0.05036603
> rowSums(tmp)
[1] -5.036603
> rowVars(tmp)
[1] 1.027819
> rowSd(tmp)
[1] 1.013814
> rowMax(tmp)
[1] 2.493915
> rowMin(tmp)
[1] -3.191368
> 
> colMeans(tmp)
  [1] -0.756056610  0.844422311  1.016156240  0.209236272  0.157256644
  [6]  0.299489639 -0.444873368 -0.535227751 -1.395177465 -0.022738729
 [11] -1.852985032  1.295923528  0.362966980  1.977572916  0.295451332
 [16] -1.071104097 -0.105160723  0.446102354  0.272654973 -1.522068865
 [21] -0.993947183  1.115129178  0.797554661  0.130736791  0.433499829
 [26] -0.622131872  0.406064720 -0.801384363 -1.568596817  0.335478651
 [31]  0.491771316  0.986633232  0.977479848  0.951691833 -0.457679077
 [36] -2.523386358  0.636937748 -0.717166791  0.983799946  0.316973145
 [41] -0.928318375 -0.564263337 -0.514722428  0.473948078  0.359292082
 [46]  0.830066409  0.562611383  1.217011625 -1.519744472  0.278852666
 [51]  0.684214859  0.184480688  0.060614709 -0.860934912 -0.508830200
 [56] -0.476292446  0.487226781  0.451609364 -0.008419574 -1.782033876
 [61]  0.533036965 -3.191367887 -0.579005502 -0.315749065 -0.680517375
 [66] -0.554369827  0.383589498 -0.760238517  1.126738090 -0.924812893
 [71] -0.958326176 -1.031830233 -0.498673689  0.079818986  1.995425814
 [76]  1.538421452  1.649912371 -0.846241760  0.957818305  1.290588792
 [81]  1.183432158  1.398766437 -1.555529955 -0.810806658 -0.224193089
 [86] -1.527697817 -0.955795250  0.456737739 -0.789018577  1.022139522
 [91] -0.052649991 -1.371014127  2.493915368 -0.857149089 -0.376557299
 [96] -1.621259184  0.865992916  0.262542697  0.086947756 -0.657292200
> colSums(tmp)
  [1] -0.756056610  0.844422311  1.016156240  0.209236272  0.157256644
  [6]  0.299489639 -0.444873368 -0.535227751 -1.395177465 -0.022738729
 [11] -1.852985032  1.295923528  0.362966980  1.977572916  0.295451332
 [16] -1.071104097 -0.105160723  0.446102354  0.272654973 -1.522068865
 [21] -0.993947183  1.115129178  0.797554661  0.130736791  0.433499829
 [26] -0.622131872  0.406064720 -0.801384363 -1.568596817  0.335478651
 [31]  0.491771316  0.986633232  0.977479848  0.951691833 -0.457679077
 [36] -2.523386358  0.636937748 -0.717166791  0.983799946  0.316973145
 [41] -0.928318375 -0.564263337 -0.514722428  0.473948078  0.359292082
 [46]  0.830066409  0.562611383  1.217011625 -1.519744472  0.278852666
 [51]  0.684214859  0.184480688  0.060614709 -0.860934912 -0.508830200
 [56] -0.476292446  0.487226781  0.451609364 -0.008419574 -1.782033876
 [61]  0.533036965 -3.191367887 -0.579005502 -0.315749065 -0.680517375
 [66] -0.554369827  0.383589498 -0.760238517  1.126738090 -0.924812893
 [71] -0.958326176 -1.031830233 -0.498673689  0.079818986  1.995425814
 [76]  1.538421452  1.649912371 -0.846241760  0.957818305  1.290588792
 [81]  1.183432158  1.398766437 -1.555529955 -0.810806658 -0.224193089
 [86] -1.527697817 -0.955795250  0.456737739 -0.789018577  1.022139522
 [91] -0.052649991 -1.371014127  2.493915368 -0.857149089 -0.376557299
 [96] -1.621259184  0.865992916  0.262542697  0.086947756 -0.657292200
> 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.756056610  0.844422311  1.016156240  0.209236272  0.157256644
  [6]  0.299489639 -0.444873368 -0.535227751 -1.395177465 -0.022738729
 [11] -1.852985032  1.295923528  0.362966980  1.977572916  0.295451332
 [16] -1.071104097 -0.105160723  0.446102354  0.272654973 -1.522068865
 [21] -0.993947183  1.115129178  0.797554661  0.130736791  0.433499829
 [26] -0.622131872  0.406064720 -0.801384363 -1.568596817  0.335478651
 [31]  0.491771316  0.986633232  0.977479848  0.951691833 -0.457679077
 [36] -2.523386358  0.636937748 -0.717166791  0.983799946  0.316973145
 [41] -0.928318375 -0.564263337 -0.514722428  0.473948078  0.359292082
 [46]  0.830066409  0.562611383  1.217011625 -1.519744472  0.278852666
 [51]  0.684214859  0.184480688  0.060614709 -0.860934912 -0.508830200
 [56] -0.476292446  0.487226781  0.451609364 -0.008419574 -1.782033876
 [61]  0.533036965 -3.191367887 -0.579005502 -0.315749065 -0.680517375
 [66] -0.554369827  0.383589498 -0.760238517  1.126738090 -0.924812893
 [71] -0.958326176 -1.031830233 -0.498673689  0.079818986  1.995425814
 [76]  1.538421452  1.649912371 -0.846241760  0.957818305  1.290588792
 [81]  1.183432158  1.398766437 -1.555529955 -0.810806658 -0.224193089
 [86] -1.527697817 -0.955795250  0.456737739 -0.789018577  1.022139522
 [91] -0.052649991 -1.371014127  2.493915368 -0.857149089 -0.376557299
 [96] -1.621259184  0.865992916  0.262542697  0.086947756 -0.657292200
> colMin(tmp)
  [1] -0.756056610  0.844422311  1.016156240  0.209236272  0.157256644
  [6]  0.299489639 -0.444873368 -0.535227751 -1.395177465 -0.022738729
 [11] -1.852985032  1.295923528  0.362966980  1.977572916  0.295451332
 [16] -1.071104097 -0.105160723  0.446102354  0.272654973 -1.522068865
 [21] -0.993947183  1.115129178  0.797554661  0.130736791  0.433499829
 [26] -0.622131872  0.406064720 -0.801384363 -1.568596817  0.335478651
 [31]  0.491771316  0.986633232  0.977479848  0.951691833 -0.457679077
 [36] -2.523386358  0.636937748 -0.717166791  0.983799946  0.316973145
 [41] -0.928318375 -0.564263337 -0.514722428  0.473948078  0.359292082
 [46]  0.830066409  0.562611383  1.217011625 -1.519744472  0.278852666
 [51]  0.684214859  0.184480688  0.060614709 -0.860934912 -0.508830200
 [56] -0.476292446  0.487226781  0.451609364 -0.008419574 -1.782033876
 [61]  0.533036965 -3.191367887 -0.579005502 -0.315749065 -0.680517375
 [66] -0.554369827  0.383589498 -0.760238517  1.126738090 -0.924812893
 [71] -0.958326176 -1.031830233 -0.498673689  0.079818986  1.995425814
 [76]  1.538421452  1.649912371 -0.846241760  0.957818305  1.290588792
 [81]  1.183432158  1.398766437 -1.555529955 -0.810806658 -0.224193089
 [86] -1.527697817 -0.955795250  0.456737739 -0.789018577  1.022139522
 [91] -0.052649991 -1.371014127  2.493915368 -0.857149089 -0.376557299
 [96] -1.621259184  0.865992916  0.262542697  0.086947756 -0.657292200
> colMedians(tmp)
  [1] -0.756056610  0.844422311  1.016156240  0.209236272  0.157256644
  [6]  0.299489639 -0.444873368 -0.535227751 -1.395177465 -0.022738729
 [11] -1.852985032  1.295923528  0.362966980  1.977572916  0.295451332
 [16] -1.071104097 -0.105160723  0.446102354  0.272654973 -1.522068865
 [21] -0.993947183  1.115129178  0.797554661  0.130736791  0.433499829
 [26] -0.622131872  0.406064720 -0.801384363 -1.568596817  0.335478651
 [31]  0.491771316  0.986633232  0.977479848  0.951691833 -0.457679077
 [36] -2.523386358  0.636937748 -0.717166791  0.983799946  0.316973145
 [41] -0.928318375 -0.564263337 -0.514722428  0.473948078  0.359292082
 [46]  0.830066409  0.562611383  1.217011625 -1.519744472  0.278852666
 [51]  0.684214859  0.184480688  0.060614709 -0.860934912 -0.508830200
 [56] -0.476292446  0.487226781  0.451609364 -0.008419574 -1.782033876
 [61]  0.533036965 -3.191367887 -0.579005502 -0.315749065 -0.680517375
 [66] -0.554369827  0.383589498 -0.760238517  1.126738090 -0.924812893
 [71] -0.958326176 -1.031830233 -0.498673689  0.079818986  1.995425814
 [76]  1.538421452  1.649912371 -0.846241760  0.957818305  1.290588792
 [81]  1.183432158  1.398766437 -1.555529955 -0.810806658 -0.224193089
 [86] -1.527697817 -0.955795250  0.456737739 -0.789018577  1.022139522
 [91] -0.052649991 -1.371014127  2.493915368 -0.857149089 -0.376557299
 [96] -1.621259184  0.865992916  0.262542697  0.086947756 -0.657292200
> colRanges(tmp)
           [,1]      [,2]     [,3]      [,4]      [,5]      [,6]       [,7]
[1,] -0.7560566 0.8444223 1.016156 0.2092363 0.1572566 0.2994896 -0.4448734
[2,] -0.7560566 0.8444223 1.016156 0.2092363 0.1572566 0.2994896 -0.4448734
           [,8]      [,9]       [,10]     [,11]    [,12]    [,13]    [,14]
[1,] -0.5352278 -1.395177 -0.02273873 -1.852985 1.295924 0.362967 1.977573
[2,] -0.5352278 -1.395177 -0.02273873 -1.852985 1.295924 0.362967 1.977573
         [,15]     [,16]      [,17]     [,18]    [,19]     [,20]      [,21]
[1,] 0.2954513 -1.071104 -0.1051607 0.4461024 0.272655 -1.522069 -0.9939472
[2,] 0.2954513 -1.071104 -0.1051607 0.4461024 0.272655 -1.522069 -0.9939472
        [,22]     [,23]     [,24]     [,25]      [,26]     [,27]      [,28]
[1,] 1.115129 0.7975547 0.1307368 0.4334998 -0.6221319 0.4060647 -0.8013844
[2,] 1.115129 0.7975547 0.1307368 0.4334998 -0.6221319 0.4060647 -0.8013844
         [,29]     [,30]     [,31]     [,32]     [,33]     [,34]      [,35]
[1,] -1.568597 0.3354787 0.4917713 0.9866332 0.9774798 0.9516918 -0.4576791
[2,] -1.568597 0.3354787 0.4917713 0.9866332 0.9774798 0.9516918 -0.4576791
         [,36]     [,37]      [,38]     [,39]     [,40]      [,41]      [,42]
[1,] -2.523386 0.6369377 -0.7171668 0.9837999 0.3169731 -0.9283184 -0.5642633
[2,] -2.523386 0.6369377 -0.7171668 0.9837999 0.3169731 -0.9283184 -0.5642633
          [,43]     [,44]     [,45]     [,46]     [,47]    [,48]     [,49]
[1,] -0.5147224 0.4739481 0.3592921 0.8300664 0.5626114 1.217012 -1.519744
[2,] -0.5147224 0.4739481 0.3592921 0.8300664 0.5626114 1.217012 -1.519744
         [,50]     [,51]     [,52]      [,53]      [,54]      [,55]      [,56]
[1,] 0.2788527 0.6842149 0.1844807 0.06061471 -0.8609349 -0.5088302 -0.4762924
[2,] 0.2788527 0.6842149 0.1844807 0.06061471 -0.8609349 -0.5088302 -0.4762924
         [,57]     [,58]        [,59]     [,60]    [,61]     [,62]      [,63]
[1,] 0.4872268 0.4516094 -0.008419574 -1.782034 0.533037 -3.191368 -0.5790055
[2,] 0.4872268 0.4516094 -0.008419574 -1.782034 0.533037 -3.191368 -0.5790055
          [,64]      [,65]      [,66]     [,67]      [,68]    [,69]      [,70]
[1,] -0.3157491 -0.6805174 -0.5543698 0.3835895 -0.7602385 1.126738 -0.9248129
[2,] -0.3157491 -0.6805174 -0.5543698 0.3835895 -0.7602385 1.126738 -0.9248129
          [,71]    [,72]      [,73]      [,74]    [,75]    [,76]    [,77]
[1,] -0.9583262 -1.03183 -0.4986737 0.07981899 1.995426 1.538421 1.649912
[2,] -0.9583262 -1.03183 -0.4986737 0.07981899 1.995426 1.538421 1.649912
          [,78]     [,79]    [,80]    [,81]    [,82]    [,83]      [,84]
[1,] -0.8462418 0.9578183 1.290589 1.183432 1.398766 -1.55553 -0.8108067
[2,] -0.8462418 0.9578183 1.290589 1.183432 1.398766 -1.55553 -0.8108067
          [,85]     [,86]      [,87]     [,88]      [,89]   [,90]       [,91]
[1,] -0.2241931 -1.527698 -0.9557952 0.4567377 -0.7890186 1.02214 -0.05264999
[2,] -0.2241931 -1.527698 -0.9557952 0.4567377 -0.7890186 1.02214 -0.05264999
         [,92]    [,93]      [,94]      [,95]     [,96]     [,97]     [,98]
[1,] -1.371014 2.493915 -0.8571491 -0.3765573 -1.621259 0.8659929 0.2625427
[2,] -1.371014 2.493915 -0.8571491 -0.3765573 -1.621259 0.8659929 0.2625427
          [,99]     [,100]
[1,] 0.08694776 -0.6572922
[2,] 0.08694776 -0.6572922
> 
> 
> Max(tmp2)
[1] 2.002593
> Min(tmp2)
[1] -2.251989
> mean(tmp2)
[1] 0.08463915
> Sum(tmp2)
[1] 8.463915
> Var(tmp2)
[1] 0.7653005
> 
> rowMeans(tmp2)
  [1] -1.03558904 -1.69163128  0.75019240  1.55785319  1.14139810  0.57321555
  [7]  1.53210962 -0.31988422 -0.60704217  0.22212544  0.74038069  0.06248429
 [13]  0.77134422  0.76176372  1.27421799 -1.12812913 -0.94818492  1.34935585
 [19] -0.40895216 -1.04144366 -0.04930238 -0.41331761  0.72661489 -0.45413918
 [25] -0.57489637 -1.11886604  0.26841248 -0.29020089 -0.60665668 -2.25198895
 [31]  0.53412333  0.62597233 -0.76450873 -0.45336829  1.17896404  2.00259268
 [37]  0.17952172  0.40548621 -1.16277510 -1.07897375 -0.14626370  0.72142763
 [43]  0.40356831 -0.29532276  0.97701166  0.34877333 -0.22937881  1.00700597
 [49]  1.04409747 -0.15853022  0.34660961  0.20364112 -0.15650587 -0.14641224
 [55]  0.59996318  0.92137479  0.99324784  1.02535295  1.53867808 -0.94047120
 [61] -0.62722318  0.51356354  0.65202607 -1.07102843  0.30658677 -0.43617235
 [67]  0.34364012 -1.17157048  0.73670119  0.52850291  0.44852300 -0.36169227
 [73]  0.19786130  1.74008976 -0.46116193 -1.05570389  0.77165741 -1.12292814
 [79]  0.21303270 -0.04270506 -0.35950307 -0.42949622 -1.12269146 -0.15343319
 [85] -0.36411260  0.43886097  1.28486100  1.23666374 -0.74039077 -0.72170111
 [91]  0.58321589 -1.55991529  0.27902051  0.90927785 -0.21779048  1.00165413
 [97]  1.96249853 -1.23342543 -0.24880210 -0.49901994
> rowSums(tmp2)
  [1] -1.03558904 -1.69163128  0.75019240  1.55785319  1.14139810  0.57321555
  [7]  1.53210962 -0.31988422 -0.60704217  0.22212544  0.74038069  0.06248429
 [13]  0.77134422  0.76176372  1.27421799 -1.12812913 -0.94818492  1.34935585
 [19] -0.40895216 -1.04144366 -0.04930238 -0.41331761  0.72661489 -0.45413918
 [25] -0.57489637 -1.11886604  0.26841248 -0.29020089 -0.60665668 -2.25198895
 [31]  0.53412333  0.62597233 -0.76450873 -0.45336829  1.17896404  2.00259268
 [37]  0.17952172  0.40548621 -1.16277510 -1.07897375 -0.14626370  0.72142763
 [43]  0.40356831 -0.29532276  0.97701166  0.34877333 -0.22937881  1.00700597
 [49]  1.04409747 -0.15853022  0.34660961  0.20364112 -0.15650587 -0.14641224
 [55]  0.59996318  0.92137479  0.99324784  1.02535295  1.53867808 -0.94047120
 [61] -0.62722318  0.51356354  0.65202607 -1.07102843  0.30658677 -0.43617235
 [67]  0.34364012 -1.17157048  0.73670119  0.52850291  0.44852300 -0.36169227
 [73]  0.19786130  1.74008976 -0.46116193 -1.05570389  0.77165741 -1.12292814
 [79]  0.21303270 -0.04270506 -0.35950307 -0.42949622 -1.12269146 -0.15343319
 [85] -0.36411260  0.43886097  1.28486100  1.23666374 -0.74039077 -0.72170111
 [91]  0.58321589 -1.55991529  0.27902051  0.90927785 -0.21779048  1.00165413
 [97]  1.96249853 -1.23342543 -0.24880210 -0.49901994
> rowVars(tmp2)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowSd(tmp2)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowMax(tmp2)
  [1] -1.03558904 -1.69163128  0.75019240  1.55785319  1.14139810  0.57321555
  [7]  1.53210962 -0.31988422 -0.60704217  0.22212544  0.74038069  0.06248429
 [13]  0.77134422  0.76176372  1.27421799 -1.12812913 -0.94818492  1.34935585
 [19] -0.40895216 -1.04144366 -0.04930238 -0.41331761  0.72661489 -0.45413918
 [25] -0.57489637 -1.11886604  0.26841248 -0.29020089 -0.60665668 -2.25198895
 [31]  0.53412333  0.62597233 -0.76450873 -0.45336829  1.17896404  2.00259268
 [37]  0.17952172  0.40548621 -1.16277510 -1.07897375 -0.14626370  0.72142763
 [43]  0.40356831 -0.29532276  0.97701166  0.34877333 -0.22937881  1.00700597
 [49]  1.04409747 -0.15853022  0.34660961  0.20364112 -0.15650587 -0.14641224
 [55]  0.59996318  0.92137479  0.99324784  1.02535295  1.53867808 -0.94047120
 [61] -0.62722318  0.51356354  0.65202607 -1.07102843  0.30658677 -0.43617235
 [67]  0.34364012 -1.17157048  0.73670119  0.52850291  0.44852300 -0.36169227
 [73]  0.19786130  1.74008976 -0.46116193 -1.05570389  0.77165741 -1.12292814
 [79]  0.21303270 -0.04270506 -0.35950307 -0.42949622 -1.12269146 -0.15343319
 [85] -0.36411260  0.43886097  1.28486100  1.23666374 -0.74039077 -0.72170111
 [91]  0.58321589 -1.55991529  0.27902051  0.90927785 -0.21779048  1.00165413
 [97]  1.96249853 -1.23342543 -0.24880210 -0.49901994
> rowMin(tmp2)
  [1] -1.03558904 -1.69163128  0.75019240  1.55785319  1.14139810  0.57321555
  [7]  1.53210962 -0.31988422 -0.60704217  0.22212544  0.74038069  0.06248429
 [13]  0.77134422  0.76176372  1.27421799 -1.12812913 -0.94818492  1.34935585
 [19] -0.40895216 -1.04144366 -0.04930238 -0.41331761  0.72661489 -0.45413918
 [25] -0.57489637 -1.11886604  0.26841248 -0.29020089 -0.60665668 -2.25198895
 [31]  0.53412333  0.62597233 -0.76450873 -0.45336829  1.17896404  2.00259268
 [37]  0.17952172  0.40548621 -1.16277510 -1.07897375 -0.14626370  0.72142763
 [43]  0.40356831 -0.29532276  0.97701166  0.34877333 -0.22937881  1.00700597
 [49]  1.04409747 -0.15853022  0.34660961  0.20364112 -0.15650587 -0.14641224
 [55]  0.59996318  0.92137479  0.99324784  1.02535295  1.53867808 -0.94047120
 [61] -0.62722318  0.51356354  0.65202607 -1.07102843  0.30658677 -0.43617235
 [67]  0.34364012 -1.17157048  0.73670119  0.52850291  0.44852300 -0.36169227
 [73]  0.19786130  1.74008976 -0.46116193 -1.05570389  0.77165741 -1.12292814
 [79]  0.21303270 -0.04270506 -0.35950307 -0.42949622 -1.12269146 -0.15343319
 [85] -0.36411260  0.43886097  1.28486100  1.23666374 -0.74039077 -0.72170111
 [91]  0.58321589 -1.55991529  0.27902051  0.90927785 -0.21779048  1.00165413
 [97]  1.96249853 -1.23342543 -0.24880210 -0.49901994
> 
> colMeans(tmp2)
[1] 0.08463915
> colSums(tmp2)
[1] 8.463915
> colVars(tmp2)
[1] 0.7653005
> colSd(tmp2)
[1] 0.8748146
> colMax(tmp2)
[1] 2.002593
> colMin(tmp2)
[1] -2.251989
> colMedians(tmp2)
[1] 0.1886915
> colRanges(tmp2)
          [,1]
[1,] -2.251989
[2,]  2.002593
> 
> dataset1 <- matrix(dataset1,1,100)
> 
> agree.checks(tmp,dataset1)
> 
> dataset2 <- matrix(dataset2,100,1)
> agree.checks(tmp2,dataset2)
>   
> 
> tmp <- createBufferedMatrix(10,10)
> 
> tmp[1:10,1:10] <- rnorm(100)
> colApply(tmp,sum)
 [1]  0.5275703042 -1.7136692816 -2.0121791112 -4.7287023520 -0.2457501843
 [6] -0.3253202352 -5.7412407354  0.0002711605 -0.6500315914  2.8718817036
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -1.6384970
[2,] -0.8296441
[3,]  0.0667349
[4,]  0.7073462
[5,]  1.8937163
> 
> rowApply(tmp,sum)
 [1] -3.49315899 -0.83380778 -2.29731381 -4.94123573 -0.62678876 -1.46773192
 [7] -0.02946108  1.70816991 -0.79703146  0.76118930
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    9    3    2    7    2    2   10    9    5     7
 [2,]    4   10    1    5    8    5    5    3    7     5
 [3,]   10    2    5   10    5    3    2    1    9     2
 [4,]    1    8   10    1    3    6    8    2    2     4
 [5,]    3    7    9    6    9    1    1    5   10     6
 [6,]    2    9    8    4    6    7    7    7    3     8
 [7,]    8    6    4    2    1    4    6    8    4     1
 [8,]    7    1    7    9    4   10    9    4    1     9
 [9,]    5    5    6    3   10    9    3    6    6     3
[10,]    6    4    3    8    7    8    4   10    8    10
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1]  0.4063927 -3.7072519 -1.7315123 -0.6708531  0.9913210  0.2956658
 [7]  0.7363168  3.5993952  0.9984391  1.9017465  1.2423098 -0.5078662
[13]  0.7414802  3.5207812 -1.5838360  1.0146485  2.4476737 -1.0749670
[19]  1.2485230  0.2294775
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -1.2114325
[2,] -0.3737213
[3,]  0.5018016
[4,]  0.6863674
[5,]  0.8033775
> 
> rowApply(tmp,sum)
[1]  6.6290393  5.5916251  0.2635441 -2.0940471 -0.2922770
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]   14   17    5    4   14
[2,]    1    1   14   10    4
[3,]   11    5    2   17    1
[4,]    2   15   13   16    2
[5,]    7    2   11   19   13
> 
> 
> as.matrix(tmp)
           [,1]        [,2]       [,3]       [,4]        [,5]        [,6]
[1,]  0.6863674 -1.60085340  0.4153269 -0.7904662  0.15740741  0.46700392
[2,]  0.8033775 -1.37410320 -0.2891609  0.7090934 -0.78295525  0.07334573
[3,] -0.3737213  0.25788826 -1.0805534  0.2188246  0.05908163  0.05671588
[4,] -1.2114325 -0.00886321  0.5971629  0.5360498  1.16551157  0.40930591
[5,]  0.5018016 -0.98132032 -1.3742878 -1.3443548  0.39227563 -0.71070567
           [,7]       [,8]       [,9]      [,10]      [,11]      [,12]
[1,]  0.4403351 1.67455828 0.28940327 -0.1473636  0.2708700  1.5470434
[2,] -0.4519183 0.03824276 0.10611536 -0.5213960  0.0245497  0.1471619
[3,]  1.2050771 1.25887904 0.01927257  0.3266319  0.6662593 -1.0124430
[4,] -1.3142480 0.42068666 0.05829132  0.6999032 -1.2813245 -1.2044453
[5,]  0.8570710 0.20702846 0.52535661  1.5439710  1.5619553  0.0148168
           [,13]      [,14]      [,15]      [,16]       [,17]      [,18]
[1,]  1.36872060  0.9403860  0.2433387 -0.5661570  0.02145164  0.7208152
[2,]  0.11219334  3.1957741  0.6180329  0.5811001  1.14696649 -0.2419163
[3,] -0.02727388 -0.4301871 -1.8498118 -0.3601354  1.14040929 -0.3465004
[4,] -0.26662271  0.4449153  0.2285134  1.5451768 -1.02182751 -0.1740317
[5,] -0.44553716 -0.6301071 -0.8239092 -0.1853361  1.16067376 -1.0333338
          [,19]       [,20]
[1,]  0.7873627 -0.29651108
[2,]  0.7543868  0.94273485
[3,]  0.4600651  0.07506597
[4,] -1.5894027 -0.12736598
[5,]  0.8361111 -0.36444625
> 
> 
> is.BufferedMatrix(tmp)
[1] TRUE
> 
> as.BufferedMatrix(as.matrix(tmp))
BufferedMatrix object
Matrix size:  5 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  800  bytes.
> 
> 
> 
> subBufferedMatrix(tmp,1:5,1:5)
BufferedMatrix object
Matrix size:  5 5 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  654  bytes.
Disk usage :  200  bytes.
> subBufferedMatrix(tmp,,5:8)
BufferedMatrix object
Matrix size:  5 4 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  565  bytes.
Disk usage :  160  bytes.
> subBufferedMatrix(tmp,1:3,)
BufferedMatrix object
Matrix size:  3 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  480  bytes.
> 
> 
> rm(tmp)
> 
> 
> ###
> ### Testing colnames and rownames
> ###
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> 
> 
> colnames(tmp)
NULL
> rownames(tmp)
NULL
> 
> 
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> colnames(tmp)
 [1] "col1"  "col2"  "col3"  "col4"  "col5"  "col6"  "col7"  "col8"  "col9" 
[10] "col10" "col11" "col12" "col13" "col14" "col15" "col16" "col17" "col18"
[19] "col19" "col20"
> rownames(tmp)
[1] "row1" "row2" "row3" "row4" "row5"
> 
> 
> tmp["row1",]
          col1       col2     col3      col4      col5      col6       col7
row1 -1.348857 -0.6497651 1.112249 0.1925831 0.6263365 -1.814196 0.09131447
          col8     col9      col10     col11      col12     col13     col14
row1 0.2795586 1.022697 -0.8431465 0.4729752 -0.7445506 0.8281507 0.4634484
        col15    col16     col17    col18     col19    col20
row1 1.487781 1.342713 0.1171997 -0.80172 0.1057259 1.212708
> tmp[,"col10"]
          col10
row1 -0.8431465
row2  1.0485011
row3 -1.8683211
row4  0.1525355
row5  0.2108168
> tmp[c("row1","row5"),]
           col1       col2     col3      col4      col5       col6       col7
row1 -1.3488571 -0.6497651 1.112249 0.1925831 0.6263365 -1.8141962 0.09131447
row5 -0.2142898 -0.2486107 1.170524 0.8623381 1.2470272  0.6189173 0.66313870
           col8     col9      col10      col11      col12      col13     col14
row1  0.2795586 1.022697 -0.8431465  0.4729752 -0.7445506  0.8281507 0.4634484
row5 -1.2202677 1.575862  0.2108168 -1.1383288  1.2673920 -0.8724801 0.6988435
        col15    col16      col17    col18     col19    col20
row1 1.487781 1.342713  0.1171997 -0.80172 0.1057259 1.212708
row5 1.047133 1.154196 -0.1772889 -0.16546 0.9145042 0.138762
> tmp[,c("col6","col20")]
           col6      col20
row1 -1.8141962  1.2127084
row2 -0.1874134  0.8096419
row3  1.2493620 -0.8461305
row4 -0.9704658 -0.7550543
row5  0.6189173  0.1387620
> tmp[c("row1","row5"),c("col6","col20")]
           col6    col20
row1 -1.8141962 1.212708
row5  0.6189173 0.138762
> 
> 
> 
> 
> 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 48.72907 50.0952 51.64454 49.62489 49.92341 105.217 51.90404 50.6023
         col9    col10    col11    col12   col13    col14    col15    col16
row1 50.22262 50.59466 49.71946 50.61702 49.4972 49.47336 48.05774 49.20863
        col17    col18    col19   col20
row1 48.93562 51.30218 49.18697 104.765
> tmp[,"col10"]
        col10
row1 50.59466
row2 30.98236
row3 29.76052
row4 30.15134
row5 50.43135
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 48.72907 50.09520 51.64454 49.62489 49.92341 105.2170 51.90404 50.60230
row5 51.99169 47.66998 50.50189 48.72509 50.19701 105.6033 49.54463 49.97127
         col9    col10    col11    col12    col13    col14    col15    col16
row1 50.22262 50.59466 49.71946 50.61702 49.49720 49.47336 48.05774 49.20863
row5 50.01191 50.43135 48.56926 49.43388 49.83926 48.85035 48.56986 48.69509
        col17    col18    col19   col20
row1 48.93562 51.30218 49.18697 104.765
row5 48.34529 49.40207 51.90015 105.408
> tmp[,c("col6","col20")]
          col6     col20
row1 105.21699 104.76500
row2  73.75251  76.06754
row3  72.40465  75.62271
row4  74.54439  73.72867
row5 105.60327 105.40802
> tmp[c("row1","row5"),c("col6","col20")]
         col6   col20
row1 105.2170 104.765
row5 105.6033 105.408
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6   col20
row1 105.2170 104.765
row5 105.6033 105.408
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
          col13
[1,]  0.8351296
[2,]  0.1877681
[3,]  0.9763471
[4,] -0.4762933
[5,] -2.8927772
> tmp[,c("col17","col7")]
          col17       col7
[1,]  0.7271373 -0.8394205
[2,] -0.4892603 -0.5495558
[3,]  0.7634799  1.0279212
[4,]  0.6548378 -0.3496966
[5,]  0.1128815  0.4355514
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
            col6      col20
[1,] -1.03745205  1.3495161
[2,] -1.30477783  1.0960251
[3,] -0.29022006  0.4568657
[4,]  0.01446059 -0.4547513
[5,] -0.74885765  0.5254487
> subBufferedMatrix(tmp,1,c("col6"))[,1]
          col1
[1,] -1.037452
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
          col6
[1,] -1.037452
[2,] -1.304778
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> 
> 
> 
> subBufferedMatrix(tmp,c("row3","row1"),)[,1:20]
            [,1]       [,2]      [,3]       [,4]       [,5]       [,6]
row3  0.03028084 -2.0182624 1.2922936 -0.6232322 -0.7525573 0.04307731
row1 -0.45711238  0.4025787 0.5174191  0.5969295 -0.5633884 0.21111082
          [,7]      [,8]      [,9]       [,10]      [,11]      [,12]    [,13]
row3 0.5414028  1.123729 0.7597738 -0.04190868 0.96738642 -0.7245293  1.13287
row1 1.0520956 -1.512985 0.3243556  1.67641147 0.03161294 -0.8807726 -1.32483
         [,14]      [,15]      [,16]    [,17]       [,18]      [,19]      [,20]
row3  2.814550 -1.0320785 -0.4922528 1.007857 -1.24506036 -0.7027986  0.6814865
row1 -2.222017 -0.9986006  0.3780223 1.609034  0.07036529  0.4907062 -0.2109846
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
         [,1]       [,2]      [,3]      [,4]       [,5]      [,6]       [,7]
row2 1.301323 0.06468205 -2.501389 -1.475546 -0.4812255 -2.061037 -0.1678738
           [,8]       [,9]     [,10]
row2 -0.4321814 -0.4039564 0.5386717
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
           [,1]       [,2]     [,3]       [,4]      [,5]     [,6]     [,7]
row5 -0.5966684 0.05748723 1.198114 -0.1964173 0.4725859 1.099303 0.749184
         [,8]      [,9]    [,10]     [,11]    [,12]      [,13]      [,14]
row5 1.909343 -0.349138 1.702192 0.9880846 1.519228 -0.4054065 0.05619322
        [,15]     [,16]     [,17]      [,18]     [,19]     [,20]
row5 1.051446 0.3860881 -0.476734 -0.3313208 0.5927111 0.6744156
> 
> 
> 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: 0x5b3efab0b7d0>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM12fd787f165e3a"
 [2] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM12fd7861b7c2e8"
 [3] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM12fd789a0d449" 
 [4] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM12fd786b25ac12"
 [5] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM12fd7822b7f2b6"
 [6] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM12fd785cbfbdd1"
 [7] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM12fd7877d78c06"
 [8] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM12fd78130d9212"
 [9] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM12fd783c86e4b6"
[10] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM12fd78376531de"
[11] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM12fd785a6dac60"
[12] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM12fd783e8598be"
[13] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM12fd78959b33e" 
[14] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM12fd786cd0dc8" 
[15] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM12fd782289f267"
> 
> 
> ### 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: 0x5b3efc5cd630>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x5b3efc5cd630>
Warning message:
In dir.create(new.directory) :
  '/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x5b3efc5cd630>
> rowMedians(tmp)
  [1] -0.5149098009 -0.1210942107 -0.4524396227 -0.2715774053  0.5965553619
  [6] -0.3838636148  0.1753035756  0.1536179987  0.4318729997 -0.1323253563
 [11]  0.0733937423 -0.4056429867 -0.1355808468  0.0058253095  0.2542183055
 [16] -0.4810101405  0.5534339923 -0.3580899457 -0.2350316188 -0.0977889961
 [21]  0.1098913929 -0.0524691136 -0.2249611427 -0.1390538483 -0.2616715806
 [26] -0.3327616353  0.3289693240  0.3155141172  0.1441215465 -0.0207082432
 [31]  0.4160409541 -0.3209358590 -0.1458776472  0.0226531777  0.3352757091
 [36] -0.5762279490  0.0854983742 -0.5093029711  0.1290281415 -0.1680588615
 [41] -0.1675485859  0.0395019716  0.1127187865  0.0833943139  0.1371168748
 [46] -0.1457243639  0.6144777838 -0.0925674760 -0.7935473485 -0.2303646504
 [51]  0.1103388492 -0.0502807552  0.0773878223 -0.2420411985 -0.2579838602
 [56] -0.0478183048 -0.2213192223  0.6143114690  0.4909886147 -0.0537752042
 [61]  0.1135987703 -0.2027322002  0.2145652019  0.3096707886  0.3517724909
 [66] -0.1744389908  0.7341807547 -0.4599405728  0.0309189310 -0.3667988861
 [71]  0.4319199754  0.3769959629  0.2330952614  0.5266347446  0.3757483473
 [76]  0.1209688154  0.1340987652  0.1010006359 -0.5030034724  0.1956480591
 [81]  0.0590557735  0.5263637543  0.3931712462  0.6679710951 -0.4238314082
 [86]  0.4101101722 -0.4394001310  0.1960087368 -0.2528637942  0.2214660384
 [91]  0.1777379057 -0.8206555576 -0.1049723899 -0.3243958883 -0.5734196891
 [96]  0.0456709116  0.4974909291  0.2499217466 -0.3153297589 -0.2090343797
[101]  0.1058571622 -0.0329978697 -0.2690555434 -0.6018031289 -0.1659471365
[106] -0.6616684252  0.1521974196 -0.1535903668  0.0472205665  0.1586048313
[111]  0.2381508274  0.3043328975 -0.1577661907 -0.0867106414 -0.4428324945
[116]  0.3091549309  0.1626597856  0.3910859933 -0.1272750169  0.3945710487
[121] -0.2323645084 -0.2049764914  0.1077091692  0.1708807237  0.9390379491
[126]  0.1126165707  0.3035987949 -0.1670868089  0.0632454927 -0.0069311696
[131]  0.3196104207  0.0896462757  0.2833284484 -0.1738659013 -0.2198732625
[136] -0.0886844557 -0.1963805345  0.4505043503 -0.1600263142 -0.1154352440
[141]  0.2065549459  0.2235109259 -0.2483722559  0.2747289032 -0.0959509595
[146] -0.1122111886 -0.1476981704  0.0425744051  0.2132502299 -0.2652802762
[151] -0.3534388545  0.1503360161 -0.4740478800 -0.1155757294 -0.0208040638
[156] -0.3847031384 -0.6705185189  0.1762733835 -0.1556607913  0.0091356372
[161] -0.4304901487  0.2428897260  0.1325467945  0.0312745739  0.3282982450
[166]  0.0001455389 -0.3647079359  0.6204717720 -0.2348400918  0.0148272432
[171]  0.0532203504  0.1840667194 -0.4116480430 -0.6836044335 -0.4637003672
[176]  0.6142186917  0.2301993116 -0.0587422003 -0.3696945552 -0.1835188441
[181] -0.0288082994  0.0899482831  0.3659262149  0.3110669810  0.3933777152
[186] -0.2410656432  0.1243802936 -0.2303825398  0.3565962276 -0.1549708104
[191] -0.6294448279 -0.3218910652 -0.4032829194 -0.5640608920 -0.1410308602
[196]  0.4002453745  0.5619994880  0.5071589429 -0.2050112747 -0.5298527735
[201] -0.3356997496 -0.2018902260  0.0076642538  0.3834787568 -0.0052880690
[206]  0.2006888190 -0.6202886241 -0.0482062567  0.4079116115 -0.6256544110
[211] -0.2337890694 -0.2440620883 -0.1688889217 -0.3412830861  0.7669984735
[216] -0.1521294166 -0.0600574868 -0.2329227636  0.1929007874 -0.1591638277
[221]  0.0972907080  0.6791711872  0.2807760473 -0.2939272680  1.1339539244
[226]  0.1275471827 -0.2015529228 -0.8191750081 -0.3089952685  0.2244634231
> 
> proc.time()
   user  system elapsed 
  1.339   1.478   2.805 

BufferedMatrix.Rcheck/tests/rawCalltesting.Rout


R Under development (unstable) (2026-01-15 r89304) -- "Unsuffered Consequences"
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: 0x5bc521f80c10>
> .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: 0x5bc521f80c10>
> .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: 0x5bc521f80c10>
> .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: 0x5bc521f80c10>
> 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: 0x5bc522c432d0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5bc522c432d0>
> .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: 0x5bc522c432d0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5bc522c432d0>
> .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: 0x5bc522c432d0>
> 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: 0x5bc523318d70>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5bc523318d70>
> .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: 0x5bc523318d70>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x5bc523318d70>
> .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: 0x5bc523318d70>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x5bc523318d70>
> .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: 0x5bc523318d70>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x5bc523318d70>
> .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: 0x5bc523318d70>
> 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: 0x5bc522e8c370>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x5bc522e8c370>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5bc522e8c370>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5bc522e8c370>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile12fe3b48a788d1" "BufferedMatrixFile12fe3bb8bbc25" 
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile12fe3b48a788d1" "BufferedMatrixFile12fe3bb8bbc25" 
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x5bc522dd7ff0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5bc522dd7ff0>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x5bc522dd7ff0>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x5bc522dd7ff0>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x5bc522dd7ff0>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x5bc522dd7ff0>
> .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: 0x5bc522fba3d0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5bc522fba3d0>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x5bc522fba3d0>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x5bc522fba3d0>
> 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: 0x5bc52476bfb0>
> .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: 0x5bc52476bfb0>
> rm(P)
> 
> proc.time()
   user  system elapsed 
  0.243   0.049   0.281 

BufferedMatrix.Rcheck/tests/Rcodetesting.Rout


R Under development (unstable) (2026-01-15 r89304) -- "Unsuffered Consequences"
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.244   0.053   0.283 

Example timings