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

This page was generated on 2025-08-30 12:08 -0400 (Sat, 30 Aug 2025).

HostnameOSArch (*)R versionInstalled pkgs
nebbiolo2Linux (Ubuntu 24.04.3 LTS)x86_644.5.1 (2025-06-13) -- "Great Square Root" 4824
lconwaymacOS 12.7.1 Montereyx86_644.5.1 (2025-06-13) -- "Great Square Root" 4615
kjohnson3macOS 13.7.7 Venturaarm644.5.1 Patched (2025-06-14 r88325) -- "Great Square Root" 4562
taishanLinux (openEuler 24.03 LTS)aarch644.5.0 (2025-04-11) -- "How About a Twenty-Six" 4541
Click on any hostname to see more info about the system (e.g. compilers)      (*) as reported by 'uname -p', except on Windows and Mac OS X

Package 252/2320HostnameOS / ArchINSTALLBUILDCHECKBUILD BIN
BufferedMatrix 1.73.0  (landing page)
Ben Bolstad
Snapshot Date: 2025-08-29 13:45 -0400 (Fri, 29 Aug 2025)
git_url: https://git.bioconductor.org/packages/BufferedMatrix
git_branch: devel
git_last_commit: 0147962
git_last_commit_date: 2025-04-15 09:39:39 -0400 (Tue, 15 Apr 2025)
nebbiolo2Linux (Ubuntu 24.04.3 LTS) / x86_64  OK    OK    OK  UNNEEDED, same version is already published
lconwaymacOS 12.7.1 Monterey / x86_64  OK    OK    WARNINGS    OK  UNNEEDED, same version is already published
kjohnson3macOS 13.7.7 Ventura / arm64  OK    OK    WARNINGS    OK  UNNEEDED, same version is already published
taishanLinux (openEuler 24.03 LTS) / aarch64  OK    OK    OK  


CHECK results for BufferedMatrix on taishan

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

raw results


Summary

Package: BufferedMatrix
Version: 1.73.0
Command: /home/biocbuild/R/R/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/home/biocbuild/R/R/site-library --no-vignettes --timings BufferedMatrix_1.73.0.tar.gz
StartedAt: 2025-08-29 05:26:39 -0000 (Fri, 29 Aug 2025)
EndedAt: 2025-08-29 05:27:03 -0000 (Fri, 29 Aug 2025)
EllapsedTime: 24.0 seconds
RetCode: 0
Status:   OK  
CheckDir: BufferedMatrix.Rcheck
Warnings: 0

Command output

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


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

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


Installation output

BufferedMatrix.Rcheck/00install.out

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


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

Tests output

BufferedMatrix.Rcheck/tests/c_code_level_tests.Rout


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

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

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

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

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

Attaching package: 'BufferedMatrix'

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

    colMeans, colSums, rowMeans, rowSums

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

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

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

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

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

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

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

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

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

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

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

[[1]]
[1] 0

> 
> proc.time()
   user  system elapsed 
  0.345   0.025   0.355 

BufferedMatrix.Rcheck/tests/objectTesting.Rout


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

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

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

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

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

Attaching package: 'BufferedMatrix'

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

    colMeans, colSums, rowMeans, rowSums

> 
> 
> ### this is used to control how many repetitions in something below
> ### higher values result in more checks.
> nreps <-100 ##20000
> 
> 
> ## test creation and some simple assignments and subsetting operations
> 
> ## first on single elements
> tmp <- createBufferedMatrix(1000,10)
> 
> tmp[10,5]
[1] 0
> tmp[10,5] <- 10
> tmp[10,5]
[1] 10
> tmp[10,5] <- 12.445
> tmp[10,5]
[1] 12.445
> 
> 
> 
> ## now testing accessing multiple elements
> tmp2 <- createBufferedMatrix(10,20)
> 
> 
> tmp2[3,1] <- 51.34
> tmp2[9,2] <- 9.87654
> tmp2[,1:2]
       [,1]    [,2]
 [1,]  0.00 0.00000
 [2,]  0.00 0.00000
 [3,] 51.34 0.00000
 [4,]  0.00 0.00000
 [5,]  0.00 0.00000
 [6,]  0.00 0.00000
 [7,]  0.00 0.00000
 [8,]  0.00 0.00000
 [9,]  0.00 9.87654
[10,]  0.00 0.00000
> tmp2[,-(3:20)]
       [,1]    [,2]
 [1,]  0.00 0.00000
 [2,]  0.00 0.00000
 [3,] 51.34 0.00000
 [4,]  0.00 0.00000
 [5,]  0.00 0.00000
 [6,]  0.00 0.00000
 [7,]  0.00 0.00000
 [8,]  0.00 0.00000
 [9,]  0.00 9.87654
[10,]  0.00 0.00000
> tmp2[3,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
[1,] 51.34    0    0    0    0    0    0    0    0     0     0     0     0
     [,14] [,15] [,16] [,17] [,18] [,19] [,20]
[1,]     0     0     0     0     0     0     0
> tmp2[-3,]
      [,1]    [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [2,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [3,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [4,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [5,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [6,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [7,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [8,]    0 9.87654    0    0    0    0    0    0    0     0     0     0     0
 [9,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
      [,14] [,15] [,16] [,17] [,18] [,19] [,20]
 [1,]     0     0     0     0     0     0     0
 [2,]     0     0     0     0     0     0     0
 [3,]     0     0     0     0     0     0     0
 [4,]     0     0     0     0     0     0     0
 [5,]     0     0     0     0     0     0     0
 [6,]     0     0     0     0     0     0     0
 [7,]     0     0     0     0     0     0     0
 [8,]     0     0     0     0     0     0     0
 [9,]     0     0     0     0     0     0     0
> tmp2[2,1:3]
     [,1] [,2] [,3]
[1,]    0    0    0
> tmp2[3:9,1:3]
      [,1]    [,2] [,3]
[1,] 51.34 0.00000    0
[2,]  0.00 0.00000    0
[3,]  0.00 0.00000    0
[4,]  0.00 0.00000    0
[5,]  0.00 0.00000    0
[6,]  0.00 0.00000    0
[7,]  0.00 9.87654    0
> tmp2[-4,-4]
       [,1]    [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [2,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [3,] 51.34 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [4,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [5,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [6,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [7,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [8,]  0.00 9.87654    0    0    0    0    0    0    0     0     0     0     0
 [9,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
      [,14] [,15] [,16] [,17] [,18] [,19]
 [1,]     0     0     0     0     0     0
 [2,]     0     0     0     0     0     0
 [3,]     0     0     0     0     0     0
 [4,]     0     0     0     0     0     0
 [5,]     0     0     0     0     0     0
 [6,]     0     0     0     0     0     0
 [7,]     0     0     0     0     0     0
 [8,]     0     0     0     0     0     0
 [9,]     0     0     0     0     0     0
> 
> ## now testing accessing/assigning multiple elements
> tmp3 <- createBufferedMatrix(10,10)
> 
> for (i in 1:10){
+   for (j in 1:10){
+     tmp3[i,j] <- (j-1)*10 + i
+   }
+ }
> 
> tmp3[2:4,2:4]
     [,1] [,2] [,3]
[1,]   12   22   32
[2,]   13   23   33
[3,]   14   24   34
> tmp3[c(-10),c(2:4,2:4,10,1,2,1:10,10:1)]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]   11   21   31   11   21   31   91    1   11     1    11    21    31
 [2,]   12   22   32   12   22   32   92    2   12     2    12    22    32
 [3,]   13   23   33   13   23   33   93    3   13     3    13    23    33
 [4,]   14   24   34   14   24   34   94    4   14     4    14    24    34
 [5,]   15   25   35   15   25   35   95    5   15     5    15    25    35
 [6,]   16   26   36   16   26   36   96    6   16     6    16    26    36
 [7,]   17   27   37   17   27   37   97    7   17     7    17    27    37
 [8,]   18   28   38   18   28   38   98    8   18     8    18    28    38
 [9,]   19   29   39   19   29   39   99    9   19     9    19    29    39
      [,14] [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24] [,25]
 [1,]    41    51    61    71    81    91    91    81    71    61    51    41
 [2,]    42    52    62    72    82    92    92    82    72    62    52    42
 [3,]    43    53    63    73    83    93    93    83    73    63    53    43
 [4,]    44    54    64    74    84    94    94    84    74    64    54    44
 [5,]    45    55    65    75    85    95    95    85    75    65    55    45
 [6,]    46    56    66    76    86    96    96    86    76    66    56    46
 [7,]    47    57    67    77    87    97    97    87    77    67    57    47
 [8,]    48    58    68    78    88    98    98    88    78    68    58    48
 [9,]    49    59    69    79    89    99    99    89    79    69    59    49
      [,26] [,27] [,28] [,29]
 [1,]    31    21    11     1
 [2,]    32    22    12     2
 [3,]    33    23    13     3
 [4,]    34    24    14     4
 [5,]    35    25    15     5
 [6,]    36    26    16     6
 [7,]    37    27    17     7
 [8,]    38    28    18     8
 [9,]    39    29    19     9
> tmp3[-c(1:5),-c(6:10)]
     [,1] [,2] [,3] [,4] [,5]
[1,]    6   16   26   36   46
[2,]    7   17   27   37   47
[3,]    8   18   28   38   48
[4,]    9   19   29   39   49
[5,]   10   20   30   40   50
> 
> ## assignment of whole columns
> tmp3[,1] <- c(1:10*100.0)
> tmp3[,1:2] <- tmp3[,1:2]*100
> tmp3[,1:2] <- tmp3[,2:1]
> tmp3[,1:2]
      [,1]  [,2]
 [1,] 1100 1e+04
 [2,] 1200 2e+04
 [3,] 1300 3e+04
 [4,] 1400 4e+04
 [5,] 1500 5e+04
 [6,] 1600 6e+04
 [7,] 1700 7e+04
 [8,] 1800 8e+04
 [9,] 1900 9e+04
[10,] 2000 1e+05
> 
> 
> tmp3[,-1] <- tmp3[,1:9]
> tmp3[,1:10]
      [,1] [,2]  [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,] 1100 1100 1e+04   21   31   41   51   61   71    81
 [2,] 1200 1200 2e+04   22   32   42   52   62   72    82
 [3,] 1300 1300 3e+04   23   33   43   53   63   73    83
 [4,] 1400 1400 4e+04   24   34   44   54   64   74    84
 [5,] 1500 1500 5e+04   25   35   45   55   65   75    85
 [6,] 1600 1600 6e+04   26   36   46   56   66   76    86
 [7,] 1700 1700 7e+04   27   37   47   57   67   77    87
 [8,] 1800 1800 8e+04   28   38   48   58   68   78    88
 [9,] 1900 1900 9e+04   29   39   49   59   69   79    89
[10,] 2000 2000 1e+05   30   40   50   60   70   80    90
> 
> tmp3[,1:2] <- rep(1,10)
> tmp3[,1:2] <- rep(1,20)
> tmp3[,1:2] <- matrix(c(1:5),1,5)
> 
> tmp3[,-c(1:8)] <- matrix(c(1:5),1,5)
> 
> tmp3[1,] <- 1:10
> tmp3[1,]
     [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,]    1    2    3    4    5    6    7    8    9    10
> tmp3[-1,] <- c(1,2)
> tmp3[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    1    2    3    4    5    6    7    8    9    10
 [2,]    1    2    1    2    1    2    1    2    1     2
 [3,]    2    1    2    1    2    1    2    1    2     1
 [4,]    1    2    1    2    1    2    1    2    1     2
 [5,]    2    1    2    1    2    1    2    1    2     1
 [6,]    1    2    1    2    1    2    1    2    1     2
 [7,]    2    1    2    1    2    1    2    1    2     1
 [8,]    1    2    1    2    1    2    1    2    1     2
 [9,]    2    1    2    1    2    1    2    1    2     1
[10,]    1    2    1    2    1    2    1    2    1     2
> tmp3[-c(1:8),] <- matrix(c(1:5),1,5)
> tmp3[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    1    2    3    4    5    6    7    8    9    10
 [2,]    1    2    1    2    1    2    1    2    1     2
 [3,]    2    1    2    1    2    1    2    1    2     1
 [4,]    1    2    1    2    1    2    1    2    1     2
 [5,]    2    1    2    1    2    1    2    1    2     1
 [6,]    1    2    1    2    1    2    1    2    1     2
 [7,]    2    1    2    1    2    1    2    1    2     1
 [8,]    1    2    1    2    1    2    1    2    1     2
 [9,]    1    3    5    2    4    1    3    5    2     4
[10,]    2    4    1    3    5    2    4    1    3     5
> 
> 
> tmp3[1:2,1:2] <- 5555.04
> tmp3[-(1:2),1:2] <- 1234.56789
> 
> 
> 
> ## testing accessors for the directory and prefix
> directory(tmp3)
[1] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests"
> prefix(tmp3)
[1] "BM"
> 
> ## testing if we can remove these objects
> rm(tmp, tmp2, tmp3)
> gc()
         used (Mb) gc trigger (Mb) max used (Mb)
Ncells 478398 25.6    1047041   56   639620 34.2
Vcells 885166  6.8    8388608   64  2080985 15.9
> 
> 
> 
> 
> ##
> ## checking reads
> ##
> 
> tmp2 <- createBufferedMatrix(10,20)
> 
> test.sample <- rnorm(10*20)
> 
> tmp2[1:10,1:20] <- test.sample
> 
> test.matrix <- matrix(test.sample,10,20)
> 
> ## testing reads
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   which.col <- sample(1:20,1)
+   if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> date()
[1] "Fri Aug 29 05:26:57 2025"
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> date()
[1] "Fri Aug 29 05:26:57 2025"
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,which.col] == test.matrix[which.row,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> 
> 
> RowMode(tmp2)
<pointer: 0x3a106ff0>
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   which.col <- sample(1:20,1)
+   if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,5,replace=TRUE)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> date()
[1] "Fri Aug 29 05:26:57 2025"
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col <- sample(1:20,5,replace=TRUE)
+   if (!all(tmp2[which.row,which.col] == test.matrix[which.row,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> date()
[1] "Fri Aug 29 05:26:57 2025"
> 
> ColMode(tmp2)
<pointer: 0x3a106ff0>
> 
> 
> 
> ### 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.9702852 -0.4027953 -0.3234038 -1.2446754
[2,]   2.4155811 -0.3874013  0.6454979 -0.6663700
[3,]   0.3870901  0.8969128  0.5742729  0.7210089
[4,]  -1.5982790 -0.1927220  0.6108591  1.9504333
> ewApply(tmp5,abs)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
            [,1]      [,2]      [,3]      [,4]
[1,] 100.9702852 0.4027953 0.3234038 1.2446754
[2,]   2.4155811 0.3874013 0.6454979 0.6663700
[3,]   0.3870901 0.8969128 0.5742729 0.7210089
[4,]   1.5982790 0.1927220 0.6108591 1.9504333
> ewApply(tmp5,sqrt)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
           [,1]      [,2]      [,3]      [,4]
[1,] 10.0483971 0.6346615 0.5686861 1.1156502
[2,]  1.5542140 0.6224157 0.8034288 0.8163149
[3,]  0.6221656 0.9470548 0.7578079 0.8491224
[4,]  1.2642306 0.4390011 0.7815747 1.3965792
> 
> my.function <- function(x,power){
+   (x+5)^power
+ }
> 
> ewApply(tmp5,my.function,power=2)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
          [,1]     [,2]     [,3]     [,4]
[1,] 226.45426 31.74941 31.01026 37.40118
[2,]  42.95772 31.61156 33.67979 33.82952
[3,]  31.60875 35.36746 33.15235 34.21223
[4,]  39.24058 29.58273 33.42661 40.91622
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x3b3369a0>
> exp(tmp5)
<pointer: 0x3b3369a0>
> log(tmp5,2)
<pointer: 0x3b3369a0>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 471.3349
> Min(tmp5)
[1] 52.49532
> mean(tmp5)
[1] 73.51759
> Sum(tmp5)
[1] 14703.52
> Var(tmp5)
[1] 877.9336
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 91.30243 71.45179 68.68115 74.52439 71.36956 72.35872 71.96860 69.90738
 [9] 69.57946 74.03245
> rowSums(tmp5)
 [1] 1826.049 1429.036 1373.623 1490.488 1427.391 1447.174 1439.372 1398.148
 [9] 1391.589 1480.649
> rowVars(tmp5)
 [1] 8075.53626   96.17066   83.80865  101.02198   48.81895   81.10969
 [7]   74.51497   74.94071   51.96457  105.06420
> rowSd(tmp5)
 [1] 89.863988  9.806664  9.154706 10.050969  6.987056  9.006092  8.632206
 [8]  8.656830  7.208646 10.250083
> rowMax(tmp5)
 [1] 471.33487  89.41087  88.49328  97.91980  84.39859  86.15215  88.11083
 [8]  87.86748  80.73954  94.33239
> rowMin(tmp5)
 [1] 60.10731 56.07764 52.49532 57.72284 58.99833 53.77603 55.09507 55.80413
 [9] 56.08275 57.53384
> 
> colMeans(tmp5)
 [1] 112.17925  71.48336  69.37917  74.62324  74.07566  77.35994  70.61653
 [8]  68.36632  68.39689  72.33773  74.13039  68.01757  69.71924  69.25088
[15]  71.80931  71.42537  67.50253  73.19692  72.76034  73.72119
> colSums(tmp5)
 [1] 1121.7925  714.8336  693.7917  746.2324  740.7566  773.5994  706.1653
 [8]  683.6632  683.9689  723.3773  741.3039  680.1757  697.1924  692.5088
[15]  718.0931  714.2537  675.0253  731.9692  727.6034  737.2119
> colVars(tmp5)
 [1] 16024.22250    93.42529    25.30914    25.78730    64.32735    45.40166
 [7]    63.30132    73.42014   161.48223    84.58779   119.39490    74.87494
[13]    46.15484    85.43770    79.85927   116.48203   101.43809    70.23779
[19]    60.20654   105.28883
> colSd(tmp5)
 [1] 126.586818   9.665676   5.030819   5.078120   8.020433   6.738075
 [7]   7.956213   8.568556  12.707566   9.197162  10.926797   8.653031
[13]   6.793735   9.243252   8.936402  10.792684  10.071648   8.380799
[19]   7.759287  10.261034
> colMax(tmp5)
 [1] 471.33487  88.11083  81.91237  85.16176  87.86748  94.33239  80.58282
 [8]  82.33909  93.09886  88.65938  97.91980  81.47200  80.53006  80.72317
[15]  88.49328  84.44743  82.36223  86.15215  84.14430  85.41588
> colMin(tmp5)
 [1] 53.77603 57.67716 64.54380 67.86307 59.46039 69.67526 52.49532 56.07764
 [9] 53.40664 57.60766 60.09437 55.80413 60.20907 56.50518 58.20284 56.08275
[17] 55.09507 63.72843 60.10731 54.66515
> 
> 
> ### setting a random element to NA and then testing with na.rm=TRUE or na.rm=FALSE (The default)
> 
> 
> which.row <- sample(1:10,1,replace=TRUE)
> which.col  <- sample(1:20,1,replace=TRUE)
> 
> tmp5[which.row,which.col] <- NA
> 
> Max(tmp5)
[1] NA
> Min(tmp5)
[1] NA
> mean(tmp5)
[1] NA
> Sum(tmp5)
[1] NA
> Var(tmp5)
[1] NA
> 
> rowMeans(tmp5)
 [1] 91.30243 71.45179 68.68115 74.52439 71.36956 72.35872 71.96860       NA
 [9] 69.57946 74.03245
> rowSums(tmp5)
 [1] 1826.049 1429.036 1373.623 1490.488 1427.391 1447.174 1439.372       NA
 [9] 1391.589 1480.649
> rowVars(tmp5)
 [1] 8075.53626   96.17066   83.80865  101.02198   48.81895   81.10969
 [7]   74.51497   77.23670   51.96457  105.06420
> rowSd(tmp5)
 [1] 89.863988  9.806664  9.154706 10.050969  6.987056  9.006092  8.632206
 [8]  8.788441  7.208646 10.250083
> rowMax(tmp5)
 [1] 471.33487  89.41087  88.49328  97.91980  84.39859  86.15215  88.11083
 [8]        NA  80.73954  94.33239
> rowMin(tmp5)
 [1] 60.10731 56.07764 52.49532 57.72284 58.99833 53.77603 55.09507       NA
 [9] 56.08275 57.53384
> 
> colMeans(tmp5)
 [1] 112.17925  71.48336  69.37917  74.62324  74.07566  77.35994  70.61653
 [8]  68.36632  68.39689  72.33773  74.13039  68.01757  69.71924  69.25088
[15]  71.80931  71.42537  67.50253  73.19692        NA  73.72119
> colSums(tmp5)
 [1] 1121.7925  714.8336  693.7917  746.2324  740.7566  773.5994  706.1653
 [8]  683.6632  683.9689  723.3773  741.3039  680.1757  697.1924  692.5088
[15]  718.0931  714.2537  675.0253  731.9692        NA  737.2119
> colVars(tmp5)
 [1] 16024.22250    93.42529    25.30914    25.78730    64.32735    45.40166
 [7]    63.30132    73.42014   161.48223    84.58779   119.39490    74.87494
[13]    46.15484    85.43770    79.85927   116.48203   101.43809    70.23779
[19]          NA   105.28883
> colSd(tmp5)
 [1] 126.586818   9.665676   5.030819   5.078120   8.020433   6.738075
 [7]   7.956213   8.568556  12.707566   9.197162  10.926797   8.653031
[13]   6.793735   9.243252   8.936402  10.792684  10.071648   8.380799
[19]         NA  10.261034
> colMax(tmp5)
 [1] 471.33487  88.11083  81.91237  85.16176  87.86748  94.33239  80.58282
 [8]  82.33909  93.09886  88.65938  97.91980  81.47200  80.53006  80.72317
[15]  88.49328  84.44743  82.36223  86.15215        NA  85.41588
> colMin(tmp5)
 [1] 53.77603 57.67716 64.54380 67.86307 59.46039 69.67526 52.49532 56.07764
 [9] 53.40664 57.60766 60.09437 55.80413 60.20907 56.50518 58.20284 56.08275
[17] 55.09507 63.72843       NA 54.66515
> 
> Max(tmp5,na.rm=TRUE)
[1] 471.3349
> Min(tmp5,na.rm=TRUE)
[1] 52.49532
> mean(tmp5,na.rm=TRUE)
[1] 73.56413
> Sum(tmp5,na.rm=TRUE)
[1] 14639.26
> Var(tmp5,na.rm=TRUE)
[1] 881.9323
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 91.30243 71.45179 68.68115 74.52439 71.36956 72.35872 71.96860 70.20480
 [9] 69.57946 74.03245
> rowSums(tmp5,na.rm=TRUE)
 [1] 1826.049 1429.036 1373.623 1490.488 1427.391 1447.174 1439.372 1333.891
 [9] 1391.589 1480.649
> rowVars(tmp5,na.rm=TRUE)
 [1] 8075.53626   96.17066   83.80865  101.02198   48.81895   81.10969
 [7]   74.51497   77.23670   51.96457  105.06420
> rowSd(tmp5,na.rm=TRUE)
 [1] 89.863988  9.806664  9.154706 10.050969  6.987056  9.006092  8.632206
 [8]  8.788441  7.208646 10.250083
> rowMax(tmp5,na.rm=TRUE)
 [1] 471.33487  89.41087  88.49328  97.91980  84.39859  86.15215  88.11083
 [8]  87.86748  80.73954  94.33239
> rowMin(tmp5,na.rm=TRUE)
 [1] 60.10731 56.07764 52.49532 57.72284 58.99833 53.77603 55.09507 55.80413
 [9] 56.08275 57.53384
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 112.17925  71.48336  69.37917  74.62324  74.07566  77.35994  70.61653
 [8]  68.36632  68.39689  72.33773  74.13039  68.01757  69.71924  69.25088
[15]  71.80931  71.42537  67.50253  73.19692  73.70521  73.72119
> colSums(tmp5,na.rm=TRUE)
 [1] 1121.7925  714.8336  693.7917  746.2324  740.7566  773.5994  706.1653
 [8]  683.6632  683.9689  723.3773  741.3039  680.1757  697.1924  692.5088
[15]  718.0931  714.2537  675.0253  731.9692  663.3469  737.2119
> colVars(tmp5,na.rm=TRUE)
 [1] 16024.22250    93.42529    25.30914    25.78730    64.32735    45.40166
 [7]    63.30132    73.42014   161.48223    84.58779   119.39490    74.87494
[13]    46.15484    85.43770    79.85927   116.48203   101.43809    70.23779
[19]    57.68861   105.28883
> colSd(tmp5,na.rm=TRUE)
 [1] 126.586818   9.665676   5.030819   5.078120   8.020433   6.738075
 [7]   7.956213   8.568556  12.707566   9.197162  10.926797   8.653031
[13]   6.793735   9.243252   8.936402  10.792684  10.071648   8.380799
[19]   7.595302  10.261034
> colMax(tmp5,na.rm=TRUE)
 [1] 471.33487  88.11083  81.91237  85.16176  87.86748  94.33239  80.58282
 [8]  82.33909  93.09886  88.65938  97.91980  81.47200  80.53006  80.72317
[15]  88.49328  84.44743  82.36223  86.15215  84.14430  85.41588
> colMin(tmp5,na.rm=TRUE)
 [1] 53.77603 57.67716 64.54380 67.86307 59.46039 69.67526 52.49532 56.07764
 [9] 53.40664 57.60766 60.09437 55.80413 60.20907 56.50518 58.20284 56.08275
[17] 55.09507 63.72843 60.10731 54.66515
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1] 91.30243 71.45179 68.68115 74.52439 71.36956 72.35872 71.96860      NaN
 [9] 69.57946 74.03245
> rowSums(tmp5,na.rm=TRUE)
 [1] 1826.049 1429.036 1373.623 1490.488 1427.391 1447.174 1439.372    0.000
 [9] 1391.589 1480.649
> rowVars(tmp5,na.rm=TRUE)
 [1] 8075.53626   96.17066   83.80865  101.02198   48.81895   81.10969
 [7]   74.51497         NA   51.96457  105.06420
> rowSd(tmp5,na.rm=TRUE)
 [1] 89.863988  9.806664  9.154706 10.050969  6.987056  9.006092  8.632206
 [8]        NA  7.208646 10.250083
> rowMax(tmp5,na.rm=TRUE)
 [1] 471.33487  89.41087  88.49328  97.91980  84.39859  86.15215  88.11083
 [8]        NA  80.73954  94.33239
> rowMin(tmp5,na.rm=TRUE)
 [1] 60.10731 56.07764 52.49532 57.72284 58.99833 53.77603 55.09507       NA
 [9] 56.08275 57.53384
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1] 117.67606  73.01739  69.77401  75.37437  72.54323  77.53357  69.50916
 [8]  67.44947  69.37858  72.56485  74.28672  69.37462  69.84290  69.18028
[15]  71.63018  70.23836  68.52267  73.30172       NaN  73.47116
> colSums(tmp5,na.rm=TRUE)
 [1] 1059.0845  657.1565  627.9661  678.3693  652.8891  697.8021  625.5824
 [8]  607.0452  624.4072  653.0836  668.5804  624.3716  628.5861  622.6225
[15]  644.6716  632.1453  616.7041  659.7155    0.0000  661.2405
> colVars(tmp5,na.rm=TRUE)
 [1] 17687.33276    78.62964    26.71890    22.66351    45.94961    50.73772
 [7]    57.41858    73.14073   170.82583    94.58098   134.04432    63.51652
[13]    51.75215    96.06135    89.48071   115.19107   102.41014    78.89394
[19]          NA   117.74664
> colSd(tmp5,na.rm=TRUE)
 [1] 132.993732   8.867336   5.169032   4.760621   6.778614   7.123042
 [7]   7.577505   8.552236  13.070036   9.725275  11.577751   7.969725
[13]   7.193897   9.801089   9.459424  10.732710  10.119790   8.882226
[19]         NA  10.851112
> colMax(tmp5,na.rm=TRUE)
 [1] 471.33487  88.11083  81.91237  85.16176  81.65282  94.33239  77.75140
 [8]  82.33909  93.09886  88.65938  97.91980  81.47200  80.53006  80.72317
[15]  88.49328  84.44743  82.36223  86.15215      -Inf  85.41588
> colMin(tmp5,na.rm=TRUE)
 [1] 53.77603 61.57258 64.54380 70.41171 59.46039 69.67526 52.49532 56.07764
 [9] 53.40664 57.60766 60.09437 57.53384 60.20907 56.50518 58.20284 56.08275
[17] 55.09507 63.72843      Inf 54.66515
> 
> 
> 
> 
> 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] 314.6433 234.8660 293.5709 220.5890 182.6216 283.3278 157.0029 345.4982
 [9] 122.5851 171.1696
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 314.6433 234.8660 293.5709 220.5890 182.6216 283.3278 157.0029 345.4982
 [9] 122.5851 171.1696
> 
> 
> 
> 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] -2.842171e-14  1.705303e-13  4.263256e-13 -2.842171e-14  0.000000e+00
 [6]  4.547474e-13  5.684342e-14  4.973799e-14 -8.526513e-14 -1.705303e-13
[11]  5.684342e-14  2.273737e-13 -5.684342e-14 -2.842171e-14 -1.705303e-13
[16] -1.136868e-13 -5.684342e-14  4.263256e-14  2.842171e-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   2 
6   2 
4   7 
4   9 
1   13 
5   9 
5   15 
8   3 
9   8 
7   1 
7   4 
7   17 
6   10 
6   1 
8   10 
2   8 
9   11 
4   20 
1   1 
9   7 
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.602794
> Min(tmp)
[1] -2.717506
> mean(tmp)
[1] 0.03653372
> Sum(tmp)
[1] 3.653372
> Var(tmp)
[1] 1.144036
> 
> rowMeans(tmp)
[1] 0.03653372
> rowSums(tmp)
[1] 3.653372
> rowVars(tmp)
[1] 1.144036
> rowSd(tmp)
[1] 1.069596
> rowMax(tmp)
[1] 2.602794
> rowMin(tmp)
[1] -2.717506
> 
> colMeans(tmp)
  [1]  1.46729786  0.59565999  0.42010065  0.95749302  0.31161915 -0.46401055
  [7] -0.09444092 -0.07049752 -1.19811056 -0.17254514  0.09854990 -1.09944830
 [13] -0.10205499 -2.34623991 -0.87388616  1.80606926  0.00289454 -1.67065407
 [19] -0.20448799 -2.15414701  1.28215098  1.13169323 -0.88767927 -0.62666299
 [25] -0.47126159 -2.57334751  0.83961990  1.47476874  1.00926443 -0.64740862
 [31]  0.06663147  1.07558892  0.97516335 -1.16661224 -0.46366767  0.06453976
 [37] -0.16789814  0.97055468  0.88101762 -1.18879118  1.11761899  0.49239801
 [43]  0.04870263  1.21144733 -0.75307935 -0.56030754  1.20421254 -1.17877590
 [49]  1.00542021  0.80536834 -0.53634449 -1.23320360 -0.61605165  1.23638999
 [55] -0.30917134  0.87697766 -0.43312661  0.39763158  0.22818337  0.66224837
 [61]  0.28015868  1.12241172  1.24880048  0.83123459  0.56082026 -0.45962211
 [67]  0.76710793  0.28889640  1.50293437  0.96026393 -2.44401208 -0.88664115
 [73] -0.11303255 -0.21040855  0.36423757  0.47242135  1.93547246 -0.24972808
 [79] -1.21113690 -1.16018826 -0.15315807 -1.16645457 -0.67881467  0.31994719
 [85]  1.64950621 -0.00680108 -0.80628485  0.18549351  2.60279446 -1.94514682
 [91]  0.19123374  1.63036278  0.64283622  0.86379384 -0.62289733  1.71183458
 [97] -2.71750635 -0.88568816 -0.87002971 -0.34500296
> colSums(tmp)
  [1]  1.46729786  0.59565999  0.42010065  0.95749302  0.31161915 -0.46401055
  [7] -0.09444092 -0.07049752 -1.19811056 -0.17254514  0.09854990 -1.09944830
 [13] -0.10205499 -2.34623991 -0.87388616  1.80606926  0.00289454 -1.67065407
 [19] -0.20448799 -2.15414701  1.28215098  1.13169323 -0.88767927 -0.62666299
 [25] -0.47126159 -2.57334751  0.83961990  1.47476874  1.00926443 -0.64740862
 [31]  0.06663147  1.07558892  0.97516335 -1.16661224 -0.46366767  0.06453976
 [37] -0.16789814  0.97055468  0.88101762 -1.18879118  1.11761899  0.49239801
 [43]  0.04870263  1.21144733 -0.75307935 -0.56030754  1.20421254 -1.17877590
 [49]  1.00542021  0.80536834 -0.53634449 -1.23320360 -0.61605165  1.23638999
 [55] -0.30917134  0.87697766 -0.43312661  0.39763158  0.22818337  0.66224837
 [61]  0.28015868  1.12241172  1.24880048  0.83123459  0.56082026 -0.45962211
 [67]  0.76710793  0.28889640  1.50293437  0.96026393 -2.44401208 -0.88664115
 [73] -0.11303255 -0.21040855  0.36423757  0.47242135  1.93547246 -0.24972808
 [79] -1.21113690 -1.16018826 -0.15315807 -1.16645457 -0.67881467  0.31994719
 [85]  1.64950621 -0.00680108 -0.80628485  0.18549351  2.60279446 -1.94514682
 [91]  0.19123374  1.63036278  0.64283622  0.86379384 -0.62289733  1.71183458
 [97] -2.71750635 -0.88568816 -0.87002971 -0.34500296
> 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]  1.46729786  0.59565999  0.42010065  0.95749302  0.31161915 -0.46401055
  [7] -0.09444092 -0.07049752 -1.19811056 -0.17254514  0.09854990 -1.09944830
 [13] -0.10205499 -2.34623991 -0.87388616  1.80606926  0.00289454 -1.67065407
 [19] -0.20448799 -2.15414701  1.28215098  1.13169323 -0.88767927 -0.62666299
 [25] -0.47126159 -2.57334751  0.83961990  1.47476874  1.00926443 -0.64740862
 [31]  0.06663147  1.07558892  0.97516335 -1.16661224 -0.46366767  0.06453976
 [37] -0.16789814  0.97055468  0.88101762 -1.18879118  1.11761899  0.49239801
 [43]  0.04870263  1.21144733 -0.75307935 -0.56030754  1.20421254 -1.17877590
 [49]  1.00542021  0.80536834 -0.53634449 -1.23320360 -0.61605165  1.23638999
 [55] -0.30917134  0.87697766 -0.43312661  0.39763158  0.22818337  0.66224837
 [61]  0.28015868  1.12241172  1.24880048  0.83123459  0.56082026 -0.45962211
 [67]  0.76710793  0.28889640  1.50293437  0.96026393 -2.44401208 -0.88664115
 [73] -0.11303255 -0.21040855  0.36423757  0.47242135  1.93547246 -0.24972808
 [79] -1.21113690 -1.16018826 -0.15315807 -1.16645457 -0.67881467  0.31994719
 [85]  1.64950621 -0.00680108 -0.80628485  0.18549351  2.60279446 -1.94514682
 [91]  0.19123374  1.63036278  0.64283622  0.86379384 -0.62289733  1.71183458
 [97] -2.71750635 -0.88568816 -0.87002971 -0.34500296
> colMin(tmp)
  [1]  1.46729786  0.59565999  0.42010065  0.95749302  0.31161915 -0.46401055
  [7] -0.09444092 -0.07049752 -1.19811056 -0.17254514  0.09854990 -1.09944830
 [13] -0.10205499 -2.34623991 -0.87388616  1.80606926  0.00289454 -1.67065407
 [19] -0.20448799 -2.15414701  1.28215098  1.13169323 -0.88767927 -0.62666299
 [25] -0.47126159 -2.57334751  0.83961990  1.47476874  1.00926443 -0.64740862
 [31]  0.06663147  1.07558892  0.97516335 -1.16661224 -0.46366767  0.06453976
 [37] -0.16789814  0.97055468  0.88101762 -1.18879118  1.11761899  0.49239801
 [43]  0.04870263  1.21144733 -0.75307935 -0.56030754  1.20421254 -1.17877590
 [49]  1.00542021  0.80536834 -0.53634449 -1.23320360 -0.61605165  1.23638999
 [55] -0.30917134  0.87697766 -0.43312661  0.39763158  0.22818337  0.66224837
 [61]  0.28015868  1.12241172  1.24880048  0.83123459  0.56082026 -0.45962211
 [67]  0.76710793  0.28889640  1.50293437  0.96026393 -2.44401208 -0.88664115
 [73] -0.11303255 -0.21040855  0.36423757  0.47242135  1.93547246 -0.24972808
 [79] -1.21113690 -1.16018826 -0.15315807 -1.16645457 -0.67881467  0.31994719
 [85]  1.64950621 -0.00680108 -0.80628485  0.18549351  2.60279446 -1.94514682
 [91]  0.19123374  1.63036278  0.64283622  0.86379384 -0.62289733  1.71183458
 [97] -2.71750635 -0.88568816 -0.87002971 -0.34500296
> colMedians(tmp)
  [1]  1.46729786  0.59565999  0.42010065  0.95749302  0.31161915 -0.46401055
  [7] -0.09444092 -0.07049752 -1.19811056 -0.17254514  0.09854990 -1.09944830
 [13] -0.10205499 -2.34623991 -0.87388616  1.80606926  0.00289454 -1.67065407
 [19] -0.20448799 -2.15414701  1.28215098  1.13169323 -0.88767927 -0.62666299
 [25] -0.47126159 -2.57334751  0.83961990  1.47476874  1.00926443 -0.64740862
 [31]  0.06663147  1.07558892  0.97516335 -1.16661224 -0.46366767  0.06453976
 [37] -0.16789814  0.97055468  0.88101762 -1.18879118  1.11761899  0.49239801
 [43]  0.04870263  1.21144733 -0.75307935 -0.56030754  1.20421254 -1.17877590
 [49]  1.00542021  0.80536834 -0.53634449 -1.23320360 -0.61605165  1.23638999
 [55] -0.30917134  0.87697766 -0.43312661  0.39763158  0.22818337  0.66224837
 [61]  0.28015868  1.12241172  1.24880048  0.83123459  0.56082026 -0.45962211
 [67]  0.76710793  0.28889640  1.50293437  0.96026393 -2.44401208 -0.88664115
 [73] -0.11303255 -0.21040855  0.36423757  0.47242135  1.93547246 -0.24972808
 [79] -1.21113690 -1.16018826 -0.15315807 -1.16645457 -0.67881467  0.31994719
 [85]  1.64950621 -0.00680108 -0.80628485  0.18549351  2.60279446 -1.94514682
 [91]  0.19123374  1.63036278  0.64283622  0.86379384 -0.62289733  1.71183458
 [97] -2.71750635 -0.88568816 -0.87002971 -0.34500296
> colRanges(tmp)
         [,1]    [,2]      [,3]     [,4]      [,5]       [,6]        [,7]
[1,] 1.467298 0.59566 0.4201006 0.957493 0.3116191 -0.4640105 -0.09444092
[2,] 1.467298 0.59566 0.4201006 0.957493 0.3116191 -0.4640105 -0.09444092
            [,8]      [,9]      [,10]     [,11]     [,12]     [,13]    [,14]
[1,] -0.07049752 -1.198111 -0.1725451 0.0985499 -1.099448 -0.102055 -2.34624
[2,] -0.07049752 -1.198111 -0.1725451 0.0985499 -1.099448 -0.102055 -2.34624
          [,15]    [,16]      [,17]     [,18]     [,19]     [,20]    [,21]
[1,] -0.8738862 1.806069 0.00289454 -1.670654 -0.204488 -2.154147 1.282151
[2,] -0.8738862 1.806069 0.00289454 -1.670654 -0.204488 -2.154147 1.282151
        [,22]      [,23]     [,24]      [,25]     [,26]     [,27]    [,28]
[1,] 1.131693 -0.8876793 -0.626663 -0.4712616 -2.573348 0.8396199 1.474769
[2,] 1.131693 -0.8876793 -0.626663 -0.4712616 -2.573348 0.8396199 1.474769
        [,29]      [,30]      [,31]    [,32]     [,33]     [,34]      [,35]
[1,] 1.009264 -0.6474086 0.06663147 1.075589 0.9751633 -1.166612 -0.4636677
[2,] 1.009264 -0.6474086 0.06663147 1.075589 0.9751633 -1.166612 -0.4636677
          [,36]      [,37]     [,38]     [,39]     [,40]    [,41]    [,42]
[1,] 0.06453976 -0.1678981 0.9705547 0.8810176 -1.188791 1.117619 0.492398
[2,] 0.06453976 -0.1678981 0.9705547 0.8810176 -1.188791 1.117619 0.492398
          [,43]    [,44]      [,45]      [,46]    [,47]     [,48]   [,49]
[1,] 0.04870263 1.211447 -0.7530793 -0.5603075 1.204213 -1.178776 1.00542
[2,] 0.04870263 1.211447 -0.7530793 -0.5603075 1.204213 -1.178776 1.00542
         [,50]      [,51]     [,52]      [,53]   [,54]      [,55]     [,56]
[1,] 0.8053683 -0.5363445 -1.233204 -0.6160517 1.23639 -0.3091713 0.8769777
[2,] 0.8053683 -0.5363445 -1.233204 -0.6160517 1.23639 -0.3091713 0.8769777
          [,57]     [,58]     [,59]     [,60]     [,61]    [,62]  [,63]
[1,] -0.4331266 0.3976316 0.2281834 0.6622484 0.2801587 1.122412 1.2488
[2,] -0.4331266 0.3976316 0.2281834 0.6622484 0.2801587 1.122412 1.2488
         [,64]     [,65]      [,66]     [,67]     [,68]    [,69]     [,70]
[1,] 0.8312346 0.5608203 -0.4596221 0.7671079 0.2888964 1.502934 0.9602639
[2,] 0.8312346 0.5608203 -0.4596221 0.7671079 0.2888964 1.502934 0.9602639
         [,71]      [,72]      [,73]      [,74]     [,75]     [,76]    [,77]
[1,] -2.444012 -0.8866412 -0.1130325 -0.2104086 0.3642376 0.4724214 1.935472
[2,] -2.444012 -0.8866412 -0.1130325 -0.2104086 0.3642376 0.4724214 1.935472
          [,78]     [,79]     [,80]      [,81]     [,82]      [,83]     [,84]
[1,] -0.2497281 -1.211137 -1.160188 -0.1531581 -1.166455 -0.6788147 0.3199472
[2,] -0.2497281 -1.211137 -1.160188 -0.1531581 -1.166455 -0.6788147 0.3199472
        [,85]       [,86]      [,87]     [,88]    [,89]     [,90]     [,91]
[1,] 1.649506 -0.00680108 -0.8062848 0.1854935 2.602794 -1.945147 0.1912337
[2,] 1.649506 -0.00680108 -0.8062848 0.1854935 2.602794 -1.945147 0.1912337
        [,92]     [,93]     [,94]      [,95]    [,96]     [,97]      [,98]
[1,] 1.630363 0.6428362 0.8637938 -0.6228973 1.711835 -2.717506 -0.8856882
[2,] 1.630363 0.6428362 0.8637938 -0.6228973 1.711835 -2.717506 -0.8856882
          [,99]    [,100]
[1,] -0.8700297 -0.345003
[2,] -0.8700297 -0.345003
> 
> 
> Max(tmp2)
[1] 2.735577
> Min(tmp2)
[1] -2.975244
> mean(tmp2)
[1] -0.03351325
> Sum(tmp2)
[1] -3.351325
> Var(tmp2)
[1] 0.9361805
> 
> rowMeans(tmp2)
  [1] -0.70058514 -0.18033264  0.01589911 -0.78643424  0.44191583 -0.32080238
  [7]  1.06247448 -0.12685038 -0.35472300  0.96877695  1.08231302 -0.14714595
 [13] -0.12841099  0.12621273 -0.59605847 -1.57099597 -0.13906765  0.34811725
 [19]  1.02688175 -0.92628932  0.89010204  0.27321614 -2.97524448 -1.67485096
 [25]  0.82980928  0.83134610 -1.14541957 -0.08706863 -1.74969166  1.06750121
 [31]  0.19289805  1.30949834 -0.55196393 -2.28037769  0.04396691  0.30393819
 [37]  0.41015514 -0.36584660  0.64303164 -0.57564595  0.09228936  1.86407208
 [43]  1.25304384  0.92260145 -0.51241473  0.10040434  0.08226978  0.37753930
 [49] -0.93925184 -1.08235708 -1.09472622  0.51438085  0.01190140 -0.64330673
 [55]  1.46526834  0.35501437  0.80420166 -0.26868984 -0.77157576 -1.15022375
 [61]  0.10893927 -1.70987653  1.63111838  0.79379268 -1.14709377  0.62250745
 [67]  0.31901432 -1.58631914 -1.10175183  0.23524455 -0.46517440 -0.16937891
 [73]  0.38619015  1.40322537 -2.26441615 -0.53150377  0.78950118  0.88975967
 [79] -0.27954647 -0.22792956 -0.79826431 -0.89401554  1.75500364 -0.81834731
 [85]  1.62386235  0.39042311 -0.49149314  0.32081761  0.41699789  0.61580680
 [91]  0.08792267 -0.62313241 -0.53839262 -0.06668871  0.78590774 -0.58853840
 [97] -0.28154055  0.31064107  2.73557737 -0.85486466
> rowSums(tmp2)
  [1] -0.70058514 -0.18033264  0.01589911 -0.78643424  0.44191583 -0.32080238
  [7]  1.06247448 -0.12685038 -0.35472300  0.96877695  1.08231302 -0.14714595
 [13] -0.12841099  0.12621273 -0.59605847 -1.57099597 -0.13906765  0.34811725
 [19]  1.02688175 -0.92628932  0.89010204  0.27321614 -2.97524448 -1.67485096
 [25]  0.82980928  0.83134610 -1.14541957 -0.08706863 -1.74969166  1.06750121
 [31]  0.19289805  1.30949834 -0.55196393 -2.28037769  0.04396691  0.30393819
 [37]  0.41015514 -0.36584660  0.64303164 -0.57564595  0.09228936  1.86407208
 [43]  1.25304384  0.92260145 -0.51241473  0.10040434  0.08226978  0.37753930
 [49] -0.93925184 -1.08235708 -1.09472622  0.51438085  0.01190140 -0.64330673
 [55]  1.46526834  0.35501437  0.80420166 -0.26868984 -0.77157576 -1.15022375
 [61]  0.10893927 -1.70987653  1.63111838  0.79379268 -1.14709377  0.62250745
 [67]  0.31901432 -1.58631914 -1.10175183  0.23524455 -0.46517440 -0.16937891
 [73]  0.38619015  1.40322537 -2.26441615 -0.53150377  0.78950118  0.88975967
 [79] -0.27954647 -0.22792956 -0.79826431 -0.89401554  1.75500364 -0.81834731
 [85]  1.62386235  0.39042311 -0.49149314  0.32081761  0.41699789  0.61580680
 [91]  0.08792267 -0.62313241 -0.53839262 -0.06668871  0.78590774 -0.58853840
 [97] -0.28154055  0.31064107  2.73557737 -0.85486466
> rowVars(tmp2)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowSd(tmp2)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowMax(tmp2)
  [1] -0.70058514 -0.18033264  0.01589911 -0.78643424  0.44191583 -0.32080238
  [7]  1.06247448 -0.12685038 -0.35472300  0.96877695  1.08231302 -0.14714595
 [13] -0.12841099  0.12621273 -0.59605847 -1.57099597 -0.13906765  0.34811725
 [19]  1.02688175 -0.92628932  0.89010204  0.27321614 -2.97524448 -1.67485096
 [25]  0.82980928  0.83134610 -1.14541957 -0.08706863 -1.74969166  1.06750121
 [31]  0.19289805  1.30949834 -0.55196393 -2.28037769  0.04396691  0.30393819
 [37]  0.41015514 -0.36584660  0.64303164 -0.57564595  0.09228936  1.86407208
 [43]  1.25304384  0.92260145 -0.51241473  0.10040434  0.08226978  0.37753930
 [49] -0.93925184 -1.08235708 -1.09472622  0.51438085  0.01190140 -0.64330673
 [55]  1.46526834  0.35501437  0.80420166 -0.26868984 -0.77157576 -1.15022375
 [61]  0.10893927 -1.70987653  1.63111838  0.79379268 -1.14709377  0.62250745
 [67]  0.31901432 -1.58631914 -1.10175183  0.23524455 -0.46517440 -0.16937891
 [73]  0.38619015  1.40322537 -2.26441615 -0.53150377  0.78950118  0.88975967
 [79] -0.27954647 -0.22792956 -0.79826431 -0.89401554  1.75500364 -0.81834731
 [85]  1.62386235  0.39042311 -0.49149314  0.32081761  0.41699789  0.61580680
 [91]  0.08792267 -0.62313241 -0.53839262 -0.06668871  0.78590774 -0.58853840
 [97] -0.28154055  0.31064107  2.73557737 -0.85486466
> rowMin(tmp2)
  [1] -0.70058514 -0.18033264  0.01589911 -0.78643424  0.44191583 -0.32080238
  [7]  1.06247448 -0.12685038 -0.35472300  0.96877695  1.08231302 -0.14714595
 [13] -0.12841099  0.12621273 -0.59605847 -1.57099597 -0.13906765  0.34811725
 [19]  1.02688175 -0.92628932  0.89010204  0.27321614 -2.97524448 -1.67485096
 [25]  0.82980928  0.83134610 -1.14541957 -0.08706863 -1.74969166  1.06750121
 [31]  0.19289805  1.30949834 -0.55196393 -2.28037769  0.04396691  0.30393819
 [37]  0.41015514 -0.36584660  0.64303164 -0.57564595  0.09228936  1.86407208
 [43]  1.25304384  0.92260145 -0.51241473  0.10040434  0.08226978  0.37753930
 [49] -0.93925184 -1.08235708 -1.09472622  0.51438085  0.01190140 -0.64330673
 [55]  1.46526834  0.35501437  0.80420166 -0.26868984 -0.77157576 -1.15022375
 [61]  0.10893927 -1.70987653  1.63111838  0.79379268 -1.14709377  0.62250745
 [67]  0.31901432 -1.58631914 -1.10175183  0.23524455 -0.46517440 -0.16937891
 [73]  0.38619015  1.40322537 -2.26441615 -0.53150377  0.78950118  0.88975967
 [79] -0.27954647 -0.22792956 -0.79826431 -0.89401554  1.75500364 -0.81834731
 [85]  1.62386235  0.39042311 -0.49149314  0.32081761  0.41699789  0.61580680
 [91]  0.08792267 -0.62313241 -0.53839262 -0.06668871  0.78590774 -0.58853840
 [97] -0.28154055  0.31064107  2.73557737 -0.85486466
> 
> colMeans(tmp2)
[1] -0.03351325
> colSums(tmp2)
[1] -3.351325
> colVars(tmp2)
[1] 0.9361805
> colSd(tmp2)
[1] 0.9675642
> colMax(tmp2)
[1] 2.735577
> colMin(tmp2)
[1] -2.975244
> colMedians(tmp2)
[1] 0.01390026
> colRanges(tmp2)
          [,1]
[1,] -2.975244
[2,]  2.735577
> 
> 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]  6.4215219 -0.5660499 -2.0951836  6.0940180  4.0196967  1.0290604
 [7]  4.3190710 -3.1071717  1.4886043 -1.1336871
> colApply(tmp,quantile)[,1]
            [,1]
[1,] -0.07632857
[2,]  0.31104423
[3,]  0.55096164
[4,]  0.86775985
[5,]  1.67218260
> 
> rowApply(tmp,sum)
 [1] -2.0151593 -0.1016491  2.9176603  1.0463267  2.2304296  1.3945128
 [7]  3.4278138  0.0935492  2.3334265  5.1429693
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]   10    8   10    6    7    9    9    6    6     5
 [2,]    1    2    8    4    5    3    6   10    9     2
 [3,]    9    3    5    2    9    5    2    1    2     1
 [4,]    5    4    3    7   10    8    5    4   10     8
 [5,]    4    7    6    9    8    6    7    5    8     3
 [6,]    3    1    9    3    4    7   10    9    4     4
 [7,]    8    9    7   10    2    4    8    2    7     9
 [8,]    6   10    2    8    3    1    1    3    1     6
 [9,]    7    6    4    5    1   10    4    8    5     7
[10,]    2    5    1    1    6    2    3    7    3    10
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1] -1.97293693 -0.47727649 -1.07544033  3.85504755 -3.98950132  0.58412468
 [7]  4.36400637 -0.03310739  2.81310018  0.61619970 -0.28710042 -1.84799224
[13]  0.66218092 -0.14870572  1.79415201  0.97972461  0.99244104  0.58634525
[19] -0.41581516 -0.24552663
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -0.9927035
[2,] -0.7786965
[3,] -0.3817191
[4,] -0.1476863
[5,]  0.3278684
> 
> rowApply(tmp,sum)
[1] -2.737749 10.039563 -1.804676 -1.754390  3.011171
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]   10    9    9    1    4
[2,]   20    6    3   19    1
[3,]   12    2    4    5   17
[4,]    9   19   18    7   19
[5,]    1    4    2    2   16
> 
> 
> as.matrix(tmp)
           [,1]       [,2]       [,3]       [,4]       [,5]       [,6]
[1,] -0.1476863  1.0922540  0.1853464 -0.2434026 -2.2494210  0.2758688
[2,]  0.3278684  0.1179886 -0.9631959  1.7089362 -0.3261739  0.9715427
[3,] -0.3817191 -1.4454303 -1.0420363  0.8347395 -1.5082777  0.5416071
[4,] -0.9927035  1.1289524 -0.2968499 -0.2306380 -0.8352992 -0.1491986
[5,] -0.7786965 -1.3710411  1.0412954  1.7854125  0.9296705 -1.0556954
            [,7]        [,8]       [,9]       [,10]      [,11]      [,12]
[1,]  0.83841876 -0.09171255  0.8292494  0.21031810 -1.2274417 -1.0955610
[2,]  2.68411648  0.26058249  1.0075037  0.61200432 -0.9198856 -1.2900819
[3,]  0.58348675  1.13739582  0.7932838  0.41075388  0.8306242 -0.0812122
[4,] -0.05476802 -0.22880801 -0.1617838 -0.64177476 -0.1308486  0.2412311
[5,]  0.31275240 -1.11056514  0.3448471  0.02489816  1.1604513  0.3776318
          [,13]       [,14]       [,15]       [,16]       [,17]      [,18]
[1,]  0.3280142 -0.58747507 -0.62029054 -0.32331667  0.73012023  0.9972240
[2,]  0.5334723  0.30674612  0.81898946 -0.05496417  1.17908830  1.5610934
[3,] -0.2988662 -0.97451369 -0.11623708  2.47455031 -0.98359499 -1.6196670
[4,]  0.5387664  1.17427687 -0.08014647 -0.56489499 -0.06123863 -0.1192282
[5,] -0.4392057 -0.06773996  1.79183664 -0.55164987  0.12806613 -0.2330770
          [,19]        [,20]
[1,] -1.3023564 -0.335898697
[2,]  0.9420337  0.561898296
[3,] -0.5115209 -0.448041664
[4,] -0.2560192 -0.033416716
[5,]  0.7120476  0.009932146
> 
> 
> is.BufferedMatrix(tmp)
[1] TRUE
> 
> as.BufferedMatrix(as.matrix(tmp))
BufferedMatrix object
Matrix size:  5 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  800  bytes.
> 
> 
> 
> subBufferedMatrix(tmp,1:5,1:5)
BufferedMatrix object
Matrix size:  5 5 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  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.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  565  bytes.
Disk usage :  160  bytes.
> subBufferedMatrix(tmp,1:3,)
BufferedMatrix object
Matrix size:  3 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  480  bytes.
> 
> 
> rm(tmp)
> 
> 
> ###
> ### Testing colnames and rownames
> ###
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> 
> 
> colnames(tmp)
NULL
> rownames(tmp)
NULL
> 
> 
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> colnames(tmp)
 [1] "col1"  "col2"  "col3"  "col4"  "col5"  "col6"  "col7"  "col8"  "col9" 
[10] "col10" "col11" "col12" "col13" "col14" "col15" "col16" "col17" "col18"
[19] "col19" "col20"
> rownames(tmp)
[1] "row1" "row2" "row3" "row4" "row5"
> 
> 
> tmp["row1",]
          col1       col2      col3       col4       col5     col6     col7
row1 0.3325849 -0.2842359 0.3160461 -0.5739036 -0.3822972 0.935957 1.254708
          col8      col9      col10     col11       col12     col13      col14
row1 0.3210867 0.8207064 0.06227285 0.2721111 -0.08281743 0.2706837 -0.3611639
      col15      col16     col17     col18     col19      col20
row1 1.6748 -0.2924708 -1.073488 0.3710029 0.4181528 -0.1992174
> tmp[,"col10"]
           col10
row1  0.06227285
row2 -0.65038980
row3  1.00203014
row4 -0.48092665
row5  1.49832634
> tmp[c("row1","row5"),]
           col1       col2      col3       col4       col5      col6       col7
row1  0.3325849 -0.2842359 0.3160461 -0.5739036 -0.3822972 0.9359570  1.2547083
row5 -0.6145867  0.6529094 0.7151734  1.8050495  0.6299923 0.3235279 -0.4706313
          col8      col9      col10       col11       col12     col13
row1 0.3210867 0.8207064 0.06227285  0.27211108 -0.08281743 0.2706837
row5 0.4300846 1.2613597 1.49832634 -0.09815272  0.02933981 0.7931076
          col14      col15      col16      col17      col18     col19
row1 -0.3611639  1.6748005 -0.2924708 -1.0734881  0.3710029 0.4181528
row5 -0.4681429 -0.1217198 -0.4052599  0.3563918 -0.1017191 0.5950378
          col20
row1 -0.1992174
row5  1.7151328
> tmp[,c("col6","col20")]
           col6      col20
row1  0.9359570 -0.1992174
row2  0.8623654  0.3290440
row3 -1.2770921 -0.3302054
row4 -1.2122081 -1.8058867
row5  0.3235279  1.7151328
> tmp[c("row1","row5"),c("col6","col20")]
          col6      col20
row1 0.9359570 -0.1992174
row5 0.3235279  1.7151328
> 
> 
> 
> 
> tmp["row1",] <- rnorm(20,mean=10)
> tmp[,"col10"] <- rnorm(5,mean=30)
> tmp[c("row1","row5"),] <- rnorm(40,mean=50)
> tmp[,c("col6","col20")] <- rnorm(10,mean=75)
> tmp[c("row1","row5"),c("col6","col20")]  <- rnorm(4,mean=105)
> 
> tmp["row1",]
         col1     col2     col3     col4     col5     col6    col7     col8
row1 49.52114 49.39644 49.15843 50.65761 50.32058 104.5439 49.1929 50.08072
         col9    col10    col11    col12    col13    col14    col15    col16
row1 51.39615 50.29222 49.84846 51.10309 49.44564 49.57397 48.93069 50.11581
        col17    col18    col19    col20
row1 49.12062 49.36838 50.18105 103.6609
> tmp[,"col10"]
        col10
row1 50.29222
row2 29.89071
row3 29.78253
row4 30.41803
row5 49.32565
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 49.52114 49.39644 49.15843 50.65761 50.32058 104.5439 49.19290 50.08072
row5 49.94970 49.70330 50.94840 50.88784 50.50040 102.2303 50.64402 48.62044
         col9    col10    col11    col12    col13    col14    col15    col16
row1 51.39615 50.29222 49.84846 51.10309 49.44564 49.57397 48.93069 50.11581
row5 50.44552 49.32565 49.59379 49.54869 48.88437 50.23243 50.02134 50.63632
        col17    col18    col19    col20
row1 49.12062 49.36838 50.18105 103.6609
row5 49.27785 49.78955 50.42796 105.0516
> tmp[,c("col6","col20")]
          col6     col20
row1 104.54386 103.66085
row2  74.61425  75.39309
row3  74.34123  74.83494
row4  74.85261  74.71839
row5 102.23030 105.05162
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 104.5439 103.6609
row5 102.2303 105.0516
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 104.5439 103.6609
row5 102.2303 105.0516
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
          col13
[1,] -0.6268913
[2,] -0.2437221
[3,] -0.5569706
[4,]  1.3591534
[5,] -0.2436493
> tmp[,c("col17","col7")]
          col17       col7
[1,] -0.5071052 -1.7614064
[2,] -1.2361521  0.1529746
[3,] -0.7108869  1.0205634
[4,] -1.0030210 -0.7818975
[5,]  1.5622672 -1.1925079
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
            col6      col20
[1,]  0.19609303 0.81621029
[2,] -0.38640314 3.42284252
[3,] -2.07839740 0.64735977
[4,]  0.02326101 1.69912327
[5,] -1.47432883 0.07798692
> subBufferedMatrix(tmp,1,c("col6"))[,1]
         col1
[1,] 0.196093
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
           col6
[1,]  0.1960930
[2,] -0.3864031
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> 
> 
> 
> subBufferedMatrix(tmp,c("row3","row1"),)[,1:20]
         [,1]       [,2]       [,3]        [,4]      [,5]      [,6]       [,7]
row3 1.339547 -0.7659295  0.4970925 -0.60442961 0.6518789 0.6046569 -0.9201471
row1 1.290080 -0.4420027 -0.1942955 -0.06951758 0.5745636 0.2383278 -0.3340498
         [,8]       [,9]     [,10]      [,11]      [,12]     [,13]      [,14]
row3 1.588237  0.2476225  1.431114 -1.3010433  0.6355337 -1.365278 -0.8662498
row1 1.081355 -1.5474837 -0.493309  0.9988244 -2.0294372  0.674803  2.0603635
         [,15]      [,16]     [,17]     [,18]    [,19]    [,20]
row3 1.2591615 -0.7768507 0.8329201 0.1313285 1.685808 0.192894
row1 0.3479592  0.5746338 0.5442252 0.3395459 1.066896 1.037844
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
         [,1]      [,2]      [,3]      [,4]     [,5]      [,6]     [,7]
row2 1.039134 0.5248676 -1.272618 0.5083873 1.303909 0.7779347 0.607802
          [,8]      [,9]     [,10]
row2 0.9524846 0.1260918 -1.096899
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
          [,1]      [,2]       [,3]        [,4]     [,5]     [,6]      [,7]
row5 0.1425469 -2.575414 -0.2477671 0.009542958 1.951757 1.582184 -1.681715
          [,8]      [,9]     [,10]    [,11]     [,12]        [,13]      [,14]
row5 0.6924007 -2.628185 -1.449376 1.579314 -1.605928 -0.009806254 -0.8397169
          [,15]      [,16]     [,17]      [,18]       [,19]     [,20]
row5 -0.4748132 -0.7825646 -1.883657 -0.4004938 -0.07708344 0.3677472
> 
> 
> 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: 0x3acdcca0>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM296df6515ddb47"
 [2] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM296df6375a615a"
 [3] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM296df66dfb9f5d"
 [4] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM296df67f490c5a"
 [5] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM296df64f8620dd"
 [6] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM296df6453503d7"
 [7] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM296df660f77b44"
 [8] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM296df6155ddef7"
 [9] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM296df64bd2e99f"
[10] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM296df62be27327"
[11] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM296df66d5661ae"
[12] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM296df614062d49"
[13] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM296df6125ceaa4"
[14] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM296df63c858f57"
[15] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM296df644b32bd1"
> 
> 
> ### 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: 0x38ba5d40>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x38ba5d40>
Warning message:
In dir.create(new.directory) :
  '/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x38ba5d40>
> rowMedians(tmp)
  [1] -0.250484711  0.057414698  0.262179336  0.055044335  0.201247829
  [6] -0.320676241 -0.056475005 -0.364445053 -0.205649067  0.497631284
 [11]  0.262451085  0.048274532 -0.254632638  0.218191989  0.422480132
 [16]  0.059889567  0.576462876 -0.315144994 -0.357128170 -0.555449822
 [21]  0.357880951  0.075314673  0.308482210  0.240810419 -0.276017950
 [26]  0.143474928 -0.605411221  0.268397332 -0.460805278 -0.555147786
 [31] -0.475229896 -0.732490079 -0.042894370  0.059415045 -0.075419508
 [36] -0.153671700  0.226357799 -0.154765707  0.066400346  0.143478564
 [41] -0.109747932  0.191671413 -0.634628264 -0.299443974  0.267072232
 [46] -0.184467476  0.199866627  0.331326900  0.196398145  0.098970580
 [51]  0.058395907  0.551950836  0.155851630 -0.216571505 -0.556200574
 [56] -0.155452607  0.469228364  0.256794477 -0.077298982 -0.292109816
 [61] -0.008874688 -0.079043731 -0.226816497  0.040883695 -0.071210108
 [66] -0.173318334 -0.052946570  0.247534492 -0.352100481  0.127793768
 [71] -0.073127984  0.180846195 -0.600312286 -0.507249658  0.251669291
 [76] -0.492312123 -0.157736348 -0.182066790 -0.123863127 -0.270200169
 [81] -0.088343348  0.246626738  0.042662882 -0.620209708  0.173608901
 [86] -0.167744713 -0.535505227 -0.346206888  0.472919038 -0.018384346
 [91]  0.394077575  0.015951912 -0.274312240 -0.098223666 -0.035750270
 [96] -0.036733131  0.187506945  0.621575359  0.168211636  0.316163333
[101]  0.137446199  0.028169337  0.217020357 -0.365414664  0.348740053
[106] -0.318249274 -0.408830748  0.290310524 -0.545199540 -0.168275018
[111] -0.108237584 -0.050457944  0.056121429  0.179460025  0.151113677
[116]  0.641639867  0.138660094  0.292004025  0.115850049  0.013888781
[121] -0.136845352 -0.075088731 -0.112270034  0.468079008  0.189350867
[126]  0.261661527 -0.204108918 -0.074725985 -0.250597977 -0.157674097
[131]  0.375748096  0.030683953 -0.249035699  0.080889042 -0.295631469
[136] -0.580850212  0.090603366  0.163407700  0.574777871 -0.029756562
[141] -0.323664064  0.384428489 -0.084722972  0.300144039 -0.146762980
[146]  0.286828302 -0.258488009 -0.733277452  0.073901030  0.145607875
[151] -0.191579794 -0.484321198  0.312408707 -0.168962542  0.072355840
[156]  0.325892908 -0.210783296  0.148298609  0.145839432 -0.235540991
[161]  0.149394249 -0.192259821  0.314285494 -0.166467252  0.192343595
[166] -0.065446131  0.433052592 -1.019076152 -0.286340776  0.553942715
[171] -0.362711318  0.531751338  0.176088523 -0.182674989  0.524147440
[176]  0.088707104 -0.139504022 -0.134358870 -0.611458963  0.763441607
[181]  0.437402308  0.002840262  0.007759940  0.123926664  0.184767679
[186]  0.008444416 -0.225750271  0.315097600  0.108821350  0.072432235
[191] -0.009454209 -0.043882907 -0.557826016 -0.476897076  0.033316143
[196]  0.103332661 -0.420011425 -0.269352112  0.660878351 -0.159475262
[201] -0.166057059 -0.228366545  0.157553649  0.120171490  0.048995463
[206] -0.196739463 -0.111802124 -0.244695568  0.517171526 -0.014830605
[211]  0.080506480  0.522375158 -0.990037983  0.139978708 -0.144154004
[216]  0.528435749  0.221456843  0.598653664 -0.150098712 -0.193711164
[221] -0.133241017  0.136644121 -0.023767503 -0.100249963  0.476854929
[226]  0.186863502 -0.178753307  0.248772076 -0.059436360  0.184961504
> 
> proc.time()
   user  system elapsed 
  1.900   0.810   2.736 

BufferedMatrix.Rcheck/tests/rawCalltesting.Rout


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

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

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

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

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

Attaching package: 'BufferedMatrix'

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

    colMeans, colSums, rowMeans, rowSums

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

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

<pointer: 0x2b480ff0>
> .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: 0x2b480ff0>
> .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: 0x2b480ff0>
> .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: 0x2b480ff0>
> 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: 0x2b38b470>
> .Call("R_bm_AddColumn",P)
<pointer: 0x2b38b470>
> .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: 0x2b38b470>
> .Call("R_bm_AddColumn",P)
<pointer: 0x2b38b470>
> .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: 0x2b38b470>
> 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: 0x2b3660e0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x2b3660e0>
> .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: 0x2b3660e0>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x2b3660e0>
> .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: 0x2b3660e0>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x2b3660e0>
> .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: 0x2b3660e0>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x2b3660e0>
> .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: 0x2b3660e0>
> 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: 0x2a2ed520>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x2a2ed520>
> .Call("R_bm_AddColumn",P)
<pointer: 0x2a2ed520>
> .Call("R_bm_AddColumn",P)
<pointer: 0x2a2ed520>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile296e2920db255"  "BufferedMatrixFile296e2958e2f608"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile296e2920db255"  "BufferedMatrixFile296e2958e2f608"
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x2c236030>
> .Call("R_bm_AddColumn",P)
<pointer: 0x2c236030>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x2c236030>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x2c236030>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x2c236030>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x2c236030>
> .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: 0x2ac015c0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x2ac015c0>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x2ac015c0>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x2ac015c0>
> 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: 0x2bce1f30>
> .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: 0x2bce1f30>
> rm(P)
> 
> proc.time()
   user  system elapsed 
  0.347   0.045   0.377 

BufferedMatrix.Rcheck/tests/Rcodetesting.Rout


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

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

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

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

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

Attaching package: 'BufferedMatrix'

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

    colMeans, colSums, rowMeans, rowSums

> 
> Temp <- createBufferedMatrix(100)
> dim(Temp)
[1] 100   0
> buffer.dim(Temp)
[1] 1 1
> 
> 
> proc.time()
   user  system elapsed 
  0.330   0.032   0.350 

Example timings