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

This page was generated on 2025-12-04 12:02 -0500 (Thu, 04 Dec 2025).

HostnameOSArch (*)R versionInstalled pkgs
nebbiolo2Linux (Ubuntu 24.04.3 LTS)x86_644.5.2 (2025-10-31) -- "[Not] Part in a Rumble" 4878
merida1macOS 12.7.6 Montereyx86_644.5.2 (2025-10-31) -- "[Not] Part in a Rumble" 4624
taishanLinux (openEuler 24.03 LTS)aarch644.5.0 (2025-04-11) -- "How About a Twenty-Six" 4669
Click on any hostname to see more info about the system (e.g. compilers)      (*) as reported by 'uname -p', except on Windows and Mac OS X

Package 257/2361HostnameOS / ArchINSTALLBUILDCHECKBUILD BIN
BufferedMatrix 1.74.0  (landing page)
Ben Bolstad
Snapshot Date: 2025-12-01 13:45 -0500 (Mon, 01 Dec 2025)
git_url: https://git.bioconductor.org/packages/BufferedMatrix
git_branch: RELEASE_3_22
git_last_commit: d2ce144
git_last_commit_date: 2025-10-29 09:58:55 -0500 (Wed, 29 Oct 2025)
nebbiolo2Linux (Ubuntu 24.04.3 LTS) / x86_64  OK    OK    OK  UNNEEDED, same version is already published
merida1macOS 12.7.6 Monterey / x86_64  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.74.0
Command: /home/biocbuild/R/R/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/home/biocbuild/R/R/site-library --no-vignettes --timings BufferedMatrix_1.74.0.tar.gz
StartedAt: 2025-12-02 07:23:37 -0000 (Tue, 02 Dec 2025)
EndedAt: 2025-12-02 07:24:07 -0000 (Tue, 02 Dec 2025)
EllapsedTime: 30.0 seconds
RetCode: 0
Status:   OK  
CheckDir: BufferedMatrix.Rcheck
Warnings: 0

Command output

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


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

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


Installation output

BufferedMatrix.Rcheck/00install.out

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


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

Tests output

BufferedMatrix.Rcheck/tests/c_code_level_tests.Rout


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

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

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

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

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

Attaching package: 'BufferedMatrix'

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

    colMeans, colSums, rowMeans, rowSums

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

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

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

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

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

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

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

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

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

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

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

[[1]]
[1] 0

> 
> proc.time()
   user  system elapsed 
  0.330   0.041   0.356 

BufferedMatrix.Rcheck/tests/objectTesting.Rout


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

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

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

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

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

Attaching package: 'BufferedMatrix'

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

    colMeans, colSums, rowMeans, rowSums

> 
> 
> ### this is used to control how many repetitions in something below
> ### higher values result in more checks.
> nreps <-100 ##20000
> 
> 
> ## test creation and some simple assignments and subsetting operations
> 
> ## first on single elements
> tmp <- createBufferedMatrix(1000,10)
> 
> tmp[10,5]
[1] 0
> tmp[10,5] <- 10
> tmp[10,5]
[1] 10
> tmp[10,5] <- 12.445
> tmp[10,5]
[1] 12.445
> 
> 
> 
> ## now testing accessing multiple elements
> tmp2 <- createBufferedMatrix(10,20)
> 
> 
> tmp2[3,1] <- 51.34
> tmp2[9,2] <- 9.87654
> tmp2[,1:2]
       [,1]    [,2]
 [1,]  0.00 0.00000
 [2,]  0.00 0.00000
 [3,] 51.34 0.00000
 [4,]  0.00 0.00000
 [5,]  0.00 0.00000
 [6,]  0.00 0.00000
 [7,]  0.00 0.00000
 [8,]  0.00 0.00000
 [9,]  0.00 9.87654
[10,]  0.00 0.00000
> tmp2[,-(3:20)]
       [,1]    [,2]
 [1,]  0.00 0.00000
 [2,]  0.00 0.00000
 [3,] 51.34 0.00000
 [4,]  0.00 0.00000
 [5,]  0.00 0.00000
 [6,]  0.00 0.00000
 [7,]  0.00 0.00000
 [8,]  0.00 0.00000
 [9,]  0.00 9.87654
[10,]  0.00 0.00000
> tmp2[3,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
[1,] 51.34    0    0    0    0    0    0    0    0     0     0     0     0
     [,14] [,15] [,16] [,17] [,18] [,19] [,20]
[1,]     0     0     0     0     0     0     0
> tmp2[-3,]
      [,1]    [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [2,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [3,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [4,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [5,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [6,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [7,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [8,]    0 9.87654    0    0    0    0    0    0    0     0     0     0     0
 [9,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
      [,14] [,15] [,16] [,17] [,18] [,19] [,20]
 [1,]     0     0     0     0     0     0     0
 [2,]     0     0     0     0     0     0     0
 [3,]     0     0     0     0     0     0     0
 [4,]     0     0     0     0     0     0     0
 [5,]     0     0     0     0     0     0     0
 [6,]     0     0     0     0     0     0     0
 [7,]     0     0     0     0     0     0     0
 [8,]     0     0     0     0     0     0     0
 [9,]     0     0     0     0     0     0     0
> tmp2[2,1:3]
     [,1] [,2] [,3]
[1,]    0    0    0
> tmp2[3:9,1:3]
      [,1]    [,2] [,3]
[1,] 51.34 0.00000    0
[2,]  0.00 0.00000    0
[3,]  0.00 0.00000    0
[4,]  0.00 0.00000    0
[5,]  0.00 0.00000    0
[6,]  0.00 0.00000    0
[7,]  0.00 9.87654    0
> tmp2[-4,-4]
       [,1]    [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [2,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [3,] 51.34 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [4,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [5,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [6,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [7,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [8,]  0.00 9.87654    0    0    0    0    0    0    0     0     0     0     0
 [9,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
      [,14] [,15] [,16] [,17] [,18] [,19]
 [1,]     0     0     0     0     0     0
 [2,]     0     0     0     0     0     0
 [3,]     0     0     0     0     0     0
 [4,]     0     0     0     0     0     0
 [5,]     0     0     0     0     0     0
 [6,]     0     0     0     0     0     0
 [7,]     0     0     0     0     0     0
 [8,]     0     0     0     0     0     0
 [9,]     0     0     0     0     0     0
> 
> ## now testing accessing/assigning multiple elements
> tmp3 <- createBufferedMatrix(10,10)
> 
> for (i in 1:10){
+   for (j in 1:10){
+     tmp3[i,j] <- (j-1)*10 + i
+   }
+ }
> 
> tmp3[2:4,2:4]
     [,1] [,2] [,3]
[1,]   12   22   32
[2,]   13   23   33
[3,]   14   24   34
> tmp3[c(-10),c(2:4,2:4,10,1,2,1:10,10:1)]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]   11   21   31   11   21   31   91    1   11     1    11    21    31
 [2,]   12   22   32   12   22   32   92    2   12     2    12    22    32
 [3,]   13   23   33   13   23   33   93    3   13     3    13    23    33
 [4,]   14   24   34   14   24   34   94    4   14     4    14    24    34
 [5,]   15   25   35   15   25   35   95    5   15     5    15    25    35
 [6,]   16   26   36   16   26   36   96    6   16     6    16    26    36
 [7,]   17   27   37   17   27   37   97    7   17     7    17    27    37
 [8,]   18   28   38   18   28   38   98    8   18     8    18    28    38
 [9,]   19   29   39   19   29   39   99    9   19     9    19    29    39
      [,14] [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24] [,25]
 [1,]    41    51    61    71    81    91    91    81    71    61    51    41
 [2,]    42    52    62    72    82    92    92    82    72    62    52    42
 [3,]    43    53    63    73    83    93    93    83    73    63    53    43
 [4,]    44    54    64    74    84    94    94    84    74    64    54    44
 [5,]    45    55    65    75    85    95    95    85    75    65    55    45
 [6,]    46    56    66    76    86    96    96    86    76    66    56    46
 [7,]    47    57    67    77    87    97    97    87    77    67    57    47
 [8,]    48    58    68    78    88    98    98    88    78    68    58    48
 [9,]    49    59    69    79    89    99    99    89    79    69    59    49
      [,26] [,27] [,28] [,29]
 [1,]    31    21    11     1
 [2,]    32    22    12     2
 [3,]    33    23    13     3
 [4,]    34    24    14     4
 [5,]    35    25    15     5
 [6,]    36    26    16     6
 [7,]    37    27    17     7
 [8,]    38    28    18     8
 [9,]    39    29    19     9
> tmp3[-c(1:5),-c(6:10)]
     [,1] [,2] [,3] [,4] [,5]
[1,]    6   16   26   36   46
[2,]    7   17   27   37   47
[3,]    8   18   28   38   48
[4,]    9   19   29   39   49
[5,]   10   20   30   40   50
> 
> ## assignment of whole columns
> tmp3[,1] <- c(1:10*100.0)
> tmp3[,1:2] <- tmp3[,1:2]*100
> tmp3[,1:2] <- tmp3[,2:1]
> tmp3[,1:2]
      [,1]  [,2]
 [1,] 1100 1e+04
 [2,] 1200 2e+04
 [3,] 1300 3e+04
 [4,] 1400 4e+04
 [5,] 1500 5e+04
 [6,] 1600 6e+04
 [7,] 1700 7e+04
 [8,] 1800 8e+04
 [9,] 1900 9e+04
[10,] 2000 1e+05
> 
> 
> tmp3[,-1] <- tmp3[,1:9]
> tmp3[,1:10]
      [,1] [,2]  [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,] 1100 1100 1e+04   21   31   41   51   61   71    81
 [2,] 1200 1200 2e+04   22   32   42   52   62   72    82
 [3,] 1300 1300 3e+04   23   33   43   53   63   73    83
 [4,] 1400 1400 4e+04   24   34   44   54   64   74    84
 [5,] 1500 1500 5e+04   25   35   45   55   65   75    85
 [6,] 1600 1600 6e+04   26   36   46   56   66   76    86
 [7,] 1700 1700 7e+04   27   37   47   57   67   77    87
 [8,] 1800 1800 8e+04   28   38   48   58   68   78    88
 [9,] 1900 1900 9e+04   29   39   49   59   69   79    89
[10,] 2000 2000 1e+05   30   40   50   60   70   80    90
> 
> tmp3[,1:2] <- rep(1,10)
> tmp3[,1:2] <- rep(1,20)
> tmp3[,1:2] <- matrix(c(1:5),1,5)
> 
> tmp3[,-c(1:8)] <- matrix(c(1:5),1,5)
> 
> tmp3[1,] <- 1:10
> tmp3[1,]
     [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,]    1    2    3    4    5    6    7    8    9    10
> tmp3[-1,] <- c(1,2)
> tmp3[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    1    2    3    4    5    6    7    8    9    10
 [2,]    1    2    1    2    1    2    1    2    1     2
 [3,]    2    1    2    1    2    1    2    1    2     1
 [4,]    1    2    1    2    1    2    1    2    1     2
 [5,]    2    1    2    1    2    1    2    1    2     1
 [6,]    1    2    1    2    1    2    1    2    1     2
 [7,]    2    1    2    1    2    1    2    1    2     1
 [8,]    1    2    1    2    1    2    1    2    1     2
 [9,]    2    1    2    1    2    1    2    1    2     1
[10,]    1    2    1    2    1    2    1    2    1     2
> tmp3[-c(1:8),] <- matrix(c(1:5),1,5)
> tmp3[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    1    2    3    4    5    6    7    8    9    10
 [2,]    1    2    1    2    1    2    1    2    1     2
 [3,]    2    1    2    1    2    1    2    1    2     1
 [4,]    1    2    1    2    1    2    1    2    1     2
 [5,]    2    1    2    1    2    1    2    1    2     1
 [6,]    1    2    1    2    1    2    1    2    1     2
 [7,]    2    1    2    1    2    1    2    1    2     1
 [8,]    1    2    1    2    1    2    1    2    1     2
 [9,]    1    3    5    2    4    1    3    5    2     4
[10,]    2    4    1    3    5    2    4    1    3     5
> 
> 
> tmp3[1:2,1:2] <- 5555.04
> tmp3[-(1:2),1:2] <- 1234.56789
> 
> 
> 
> ## testing accessors for the directory and prefix
> directory(tmp3)
[1] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests"
> prefix(tmp3)
[1] "BM"
> 
> ## testing if we can remove these objects
> rm(tmp, tmp2, tmp3)
> gc()
         used (Mb) gc trigger (Mb) max used (Mb)
Ncells 478398 25.6    1047041   56   639620 34.2
Vcells 885166  6.8    8388608   64  2080985 15.9
> 
> 
> 
> 
> ##
> ## checking reads
> ##
> 
> tmp2 <- createBufferedMatrix(10,20)
> 
> test.sample <- rnorm(10*20)
> 
> tmp2[1:10,1:20] <- test.sample
> 
> test.matrix <- matrix(test.sample,10,20)
> 
> ## testing reads
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   which.col <- sample(1:20,1)
+   if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> date()
[1] "Tue Dec  2 07:24:00 2025"
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> date()
[1] "Tue Dec  2 07:24:00 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: 0x115dbff0>
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   which.col <- sample(1:20,1)
+   if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,5,replace=TRUE)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> date()
[1] "Tue Dec  2 07:24:01 2025"
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col <- sample(1:20,5,replace=TRUE)
+   if (!all(tmp2[which.row,which.col] == test.matrix[which.row,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> date()
[1] "Tue Dec  2 07:24:01 2025"
> 
> ColMode(tmp2)
<pointer: 0x115dbff0>
> 
> 
> 
> ### 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,] 99.3855420 0.19514730 -0.80470592 -0.4952830
[2,]  1.6374773 0.01693108 -1.49656406 -0.5616264
[3,]  0.3892901 0.70643824 -0.03745639  0.7936193
[4,] -0.1763116 0.18776534 -1.60313732  1.5245586
> 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,] 99.3855420 0.19514730 0.80470592 0.4952830
[2,]  1.6374773 0.01693108 1.49656406 0.5616264
[3,]  0.3892901 0.70643824 0.03745639 0.7936193
[4,]  0.1763116 0.18776534 1.60313732 1.5245586
> ewApply(tmp5,sqrt)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
          [,1]      [,2]      [,3]      [,4]
[1,] 9.9692298 0.4417548 0.8970540 0.7037634
[2,] 1.2796395 0.1301195 1.2233413 0.7494174
[3,] 0.6239311 0.8404988 0.1935365 0.8908532
[4,] 0.4198948 0.4333190 1.2661506 1.2347302
> 
> 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,] 224.07784 29.61270 34.77525 32.53292
[2,]  39.43387 26.31813 38.72998 33.05580
[3,]  31.62860 34.11143 26.97282 34.70215
[4,]  29.37526 29.52096 39.26464 38.87186
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x102be6c0>
> exp(tmp5)
<pointer: 0x102be6c0>
> log(tmp5,2)
<pointer: 0x102be6c0>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 466.3887
> Min(tmp5)
[1] 52.5549
> mean(tmp5)
[1] 72.20931
> Sum(tmp5)
[1] 14441.86
> Var(tmp5)
[1] 865.0592
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 90.07758 69.50223 67.35642 70.33606 72.32476 71.45829 71.24537 69.36441
 [9] 71.43889 68.98908
> rowSums(tmp5)
 [1] 1801.552 1390.045 1347.128 1406.721 1446.495 1429.166 1424.907 1387.288
 [9] 1428.778 1379.782
> rowVars(tmp5)
 [1] 7927.91560  111.22579   87.45725   70.59714   76.41258   93.66779
 [7]   77.85585   91.52386   68.56658   61.21171
> rowSd(tmp5)
 [1] 89.038843 10.546364  9.351858  8.402210  8.741429  9.678212  8.823596
 [8]  9.566810  8.280494  7.823792
> rowMax(tmp5)
 [1] 466.38866  87.97250  89.72992  82.79178  91.54853  93.98813  85.87272
 [8]  85.54554  88.99769  87.25766
> rowMin(tmp5)
 [1] 58.28446 54.21402 56.14039 58.05968 52.55490 57.55273 55.80511 54.60350
 [9] 57.74905 54.29994
> 
> colMeans(tmp5)
 [1] 109.03778  69.61175  71.79525  71.30094  69.22760  75.32285  74.80819
 [8]  68.39846  73.70903  68.64955  71.10375  73.71203  71.95144  66.01508
[15]  67.65487  68.79808  67.13806  63.16622  71.30698  71.47828
> colSums(tmp5)
 [1] 1090.3778  696.1175  717.9525  713.0094  692.2760  753.2285  748.0819
 [8]  683.9846  737.0903  686.4955  711.0375  737.1203  719.5144  660.1508
[15]  676.5487  687.9808  671.3806  631.6622  713.0698  714.7828
> colVars(tmp5)
 [1] 15840.70949    84.71050    91.56096    45.58786    81.04978   141.31281
 [7]    25.76968    92.27987   151.72259    50.94313    74.15777    90.63613
[13]    71.05436    42.12477    50.45950    83.66325    88.39658    31.81290
[19]   109.32100   100.14505
> colSd(tmp5)
 [1] 125.859880   9.203831   9.568749   6.751878   9.002765  11.887506
 [7]   5.076385   9.606241  12.317572   7.137446   8.611491   9.520301
[13]   8.429375   6.490360   7.103485   9.146762   9.401945   5.640293
[19]  10.455668  10.007250
> colMax(tmp5)
 [1] 466.38866  86.08906  85.87272  80.90668  82.62410  93.98813  83.54539
 [8]  87.78987  94.57754  81.85952  82.09849  88.99769  83.51775  76.41717
[15]  81.64333  89.72992  80.13159  72.78655  91.54853  87.67982
> colMin(tmp5)
 [1] 52.55490 54.77773 56.14039 60.36841 57.99486 58.27685 66.13645 56.27559
 [9] 57.27951 57.74905 57.99908 58.72437 58.05968 57.59274 56.60213 56.57792
[17] 54.29994 54.21402 55.80511 58.16659
> 
> 
> ### setting a random element to NA and then testing with na.rm=TRUE or na.rm=FALSE (The default)
> 
> 
> which.row <- sample(1:10,1,replace=TRUE)
> which.col  <- sample(1:20,1,replace=TRUE)
> 
> tmp5[which.row,which.col] <- NA
> 
> Max(tmp5)
[1] NA
> Min(tmp5)
[1] NA
> mean(tmp5)
[1] NA
> Sum(tmp5)
[1] NA
> Var(tmp5)
[1] NA
> 
> rowMeans(tmp5)
 [1] 90.07758       NA 67.35642 70.33606 72.32476 71.45829 71.24537 69.36441
 [9] 71.43889 68.98908
> rowSums(tmp5)
 [1] 1801.552       NA 1347.128 1406.721 1446.495 1429.166 1424.907 1387.288
 [9] 1428.778 1379.782
> rowVars(tmp5)
 [1] 7927.91560  110.18786   87.45725   70.59714   76.41258   93.66779
 [7]   77.85585   91.52386   68.56658   61.21171
> rowSd(tmp5)
 [1] 89.038843 10.497040  9.351858  8.402210  8.741429  9.678212  8.823596
 [8]  9.566810  8.280494  7.823792
> rowMax(tmp5)
 [1] 466.38866        NA  89.72992  82.79178  91.54853  93.98813  85.87272
 [8]  85.54554  88.99769  87.25766
> rowMin(tmp5)
 [1] 58.28446       NA 56.14039 58.05968 52.55490 57.55273 55.80511 54.60350
 [9] 57.74905 54.29994
> 
> colMeans(tmp5)
 [1] 109.03778  69.61175        NA  71.30094  69.22760  75.32285  74.80819
 [8]  68.39846  73.70903  68.64955  71.10375  73.71203  71.95144  66.01508
[15]  67.65487  68.79808  67.13806  63.16622  71.30698  71.47828
> colSums(tmp5)
 [1] 1090.3778  696.1175        NA  713.0094  692.2760  753.2285  748.0819
 [8]  683.9846  737.0903  686.4955  711.0375  737.1203  719.5144  660.1508
[15]  676.5487  687.9808  671.3806  631.6622  713.0698  714.7828
> colVars(tmp5)
 [1] 15840.70949    84.71050          NA    45.58786    81.04978   141.31281
 [7]    25.76968    92.27987   151.72259    50.94313    74.15777    90.63613
[13]    71.05436    42.12477    50.45950    83.66325    88.39658    31.81290
[19]   109.32100   100.14505
> colSd(tmp5)
 [1] 125.859880   9.203831         NA   6.751878   9.002765  11.887506
 [7]   5.076385   9.606241  12.317572   7.137446   8.611491   9.520301
[13]   8.429375   6.490360   7.103485   9.146762   9.401945   5.640293
[19]  10.455668  10.007250
> colMax(tmp5)
 [1] 466.38866  86.08906        NA  80.90668  82.62410  93.98813  83.54539
 [8]  87.78987  94.57754  81.85952  82.09849  88.99769  83.51775  76.41717
[15]  81.64333  89.72992  80.13159  72.78655  91.54853  87.67982
> colMin(tmp5)
 [1] 52.55490 54.77773       NA 60.36841 57.99486 58.27685 66.13645 56.27559
 [9] 57.27951 57.74905 57.99908 58.72437 58.05968 57.59274 56.60213 56.57792
[17] 54.29994 54.21402 55.80511 58.16659
> 
> Max(tmp5,na.rm=TRUE)
[1] 466.3887
> Min(tmp5,na.rm=TRUE)
[1] 52.5549
> mean(tmp5,na.rm=TRUE)
[1] 72.16709
> Sum(tmp5,na.rm=TRUE)
[1] 14361.25
> Var(tmp5,na.rm=TRUE)
[1] 869.0698
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 90.07758 68.91754 67.35642 70.33606 72.32476 71.45829 71.24537 69.36441
 [9] 71.43889 68.98908
> rowSums(tmp5,na.rm=TRUE)
 [1] 1801.552 1309.433 1347.128 1406.721 1446.495 1429.166 1424.907 1387.288
 [9] 1428.778 1379.782
> rowVars(tmp5,na.rm=TRUE)
 [1] 7927.91560  110.18786   87.45725   70.59714   76.41258   93.66779
 [7]   77.85585   91.52386   68.56658   61.21171
> rowSd(tmp5,na.rm=TRUE)
 [1] 89.038843 10.497040  9.351858  8.402210  8.741429  9.678212  8.823596
 [8]  9.566810  8.280494  7.823792
> rowMax(tmp5,na.rm=TRUE)
 [1] 466.38866  87.97250  89.72992  82.79178  91.54853  93.98813  85.87272
 [8]  85.54554  88.99769  87.25766
> rowMin(tmp5,na.rm=TRUE)
 [1] 58.28446 54.21402 56.14039 58.05968 52.55490 57.55273 55.80511 54.60350
 [9] 57.74905 54.29994
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 109.03778  69.61175  70.81568  71.30094  69.22760  75.32285  74.80819
 [8]  68.39846  73.70903  68.64955  71.10375  73.71203  71.95144  66.01508
[15]  67.65487  68.79808  67.13806  63.16622  71.30698  71.47828
> colSums(tmp5,na.rm=TRUE)
 [1] 1090.3778  696.1175  637.3411  713.0094  692.2760  753.2285  748.0819
 [8]  683.9846  737.0903  686.4955  711.0375  737.1203  719.5144  660.1508
[15]  676.5487  687.9808  671.3806  631.6622  713.0698  714.7828
> colVars(tmp5,na.rm=TRUE)
 [1] 15840.70949    84.71050    92.21106    45.58786    81.04978   141.31281
 [7]    25.76968    92.27987   151.72259    50.94313    74.15777    90.63613
[13]    71.05436    42.12477    50.45950    83.66325    88.39658    31.81290
[19]   109.32100   100.14505
> colSd(tmp5,na.rm=TRUE)
 [1] 125.859880   9.203831   9.602659   6.751878   9.002765  11.887506
 [7]   5.076385   9.606241  12.317572   7.137446   8.611491   9.520301
[13]   8.429375   6.490360   7.103485   9.146762   9.401945   5.640293
[19]  10.455668  10.007250
> colMax(tmp5,na.rm=TRUE)
 [1] 466.38866  86.08906  85.87272  80.90668  82.62410  93.98813  83.54539
 [8]  87.78987  94.57754  81.85952  82.09849  88.99769  83.51775  76.41717
[15]  81.64333  89.72992  80.13159  72.78655  91.54853  87.67982
> colMin(tmp5,na.rm=TRUE)
 [1] 52.55490 54.77773 56.14039 60.36841 57.99486 58.27685 66.13645 56.27559
 [9] 57.27951 57.74905 57.99908 58.72437 58.05968 57.59274 56.60213 56.57792
[17] 54.29994 54.21402 55.80511 58.16659
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1] 90.07758      NaN 67.35642 70.33606 72.32476 71.45829 71.24537 69.36441
 [9] 71.43889 68.98908
> rowSums(tmp5,na.rm=TRUE)
 [1] 1801.552    0.000 1347.128 1406.721 1446.495 1429.166 1424.907 1387.288
 [9] 1428.778 1379.782
> rowVars(tmp5,na.rm=TRUE)
 [1] 7927.91560         NA   87.45725   70.59714   76.41258   93.66779
 [7]   77.85585   91.52386   68.56658   61.21171
> rowSd(tmp5,na.rm=TRUE)
 [1] 89.038843        NA  9.351858  8.402210  8.741429  9.678212  8.823596
 [8]  9.566810  8.280494  7.823792
> rowMax(tmp5,na.rm=TRUE)
 [1] 466.38866        NA  89.72992  82.79178  91.54853  93.98813  85.87272
 [8]  85.54554  88.99769  87.25766
> rowMin(tmp5,na.rm=TRUE)
 [1] 58.28446       NA 56.14039 58.05968 52.55490 57.55273 55.80511 54.60350
 [9] 57.74905 54.29994
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1] 112.03349  71.25997       NaN  71.57867  70.45388  77.21685  74.69763
 [8]  68.52857  72.12420  67.18177  70.00874  74.35303  71.26491  65.87356
[15]  68.88295  70.15588  67.15820  64.16091  71.40545  71.04756
> colSums(tmp5,na.rm=TRUE)
 [1] 1008.3014  641.3397    0.0000  644.2080  634.0849  694.9517  672.2787
 [8]  616.7571  649.1178  604.6360  630.0786  669.1773  641.3842  592.8621
[15]  619.9466  631.4029  604.4238  577.4482  642.6491  639.4281
> colVars(tmp5,na.rm=TRUE)
 [1] 17719.83789    64.73709          NA    50.41855    74.26350   118.62050
 [7]    28.85339   103.62442   142.43144    33.07444    69.93807    97.34322
[13]    74.63384    47.16506    39.79984    73.38057    99.44158    24.65869
[19]   122.87705   110.57612
> colSd(tmp5,na.rm=TRUE)
 [1] 133.115881   8.045936         NA   7.100602   8.617627  10.891304
 [7]   5.371535  10.179608  11.934464   5.751038   8.362898   9.866267
[13]   8.639088   6.867682   6.308712   8.566246   9.972040   4.965752
[19]  11.084992  10.515518
> colMax(tmp5,na.rm=TRUE)
 [1] 466.38866  86.08906      -Inf  80.90668  82.62410  93.98813  83.54539
 [8]  87.78987  94.57754  74.68259  82.09849  88.99769  83.51775  76.41717
[15]  81.64333  89.72992  80.13159  72.78655  91.54853  87.67982
> colMin(tmp5,na.rm=TRUE)
 [1] 52.55490 61.44400      Inf 60.36841 57.99486 60.72328 66.13645 56.27559
 [9] 57.27951 57.74905 57.99908 58.72437 58.05968 57.59274 63.02472 60.42433
[17] 54.29994 57.74387 55.80511 58.16659
> 
> 
> 
> 
> 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] 206.2699 140.2004 288.4995 210.4448 284.6672 105.5613 170.1272 330.9731
 [9] 178.8794 208.4200
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 206.2699 140.2004 288.4995 210.4448 284.6672 105.5613 170.1272 330.9731
 [9] 178.8794 208.4200
> 
> 
> 
> copymatrix <- matrix(rnorm(200,150,15),10,20)
> 
> tmp5[1:10,1:20] <- copymatrix
> which.row <- 1
> which.col  <- 3
> cat(which.row," ",which.col,"\n")
1   3 
> tmp5[which.row,which.col] <- NA
> copymatrix[which.row,which.col] <- NA
> 
> colVars(tmp5,na.rm=TRUE)-apply(copymatrix,2,var,na.rm=TRUE)
 [1] -5.684342e-14 -2.557954e-13  1.705303e-13  1.136868e-13 -2.842171e-14
 [6] -5.684342e-14 -2.273737e-13  1.136868e-13  5.684342e-14  2.842171e-14
[11]  1.705303e-13  8.526513e-14 -5.684342e-14 -2.842171e-14  0.000000e+00
[16] -2.842171e-14  0.000000e+00  1.705303e-13  1.136868e-13  0.000000e+00
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> ## 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)
+ }
7   7 
4   12 
6   5 
8   9 
5   3 
8   1 
1   18 
5   1 
8   2 
2   14 
8   15 
3   13 
2   7 
3   13 
8   8 
5   6 
4   6 
4   6 
7   5 
5   10 
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.52264
> Min(tmp)
[1] -2.038791
> mean(tmp)
[1] -0.1780683
> Sum(tmp)
[1] -17.80683
> Var(tmp)
[1] 0.9019284
> 
> rowMeans(tmp)
[1] -0.1780683
> rowSums(tmp)
[1] -17.80683
> rowVars(tmp)
[1] 0.9019284
> rowSd(tmp)
[1] 0.9496991
> rowMax(tmp)
[1] 2.52264
> rowMin(tmp)
[1] -2.038791
> 
> colMeans(tmp)
  [1] -0.32429485 -0.95491187  0.47838695 -0.40620077 -1.25774045  0.44508391
  [7] -0.38152309 -0.27434816  0.61887871  1.11505561 -1.75856473 -1.67609804
 [13]  0.67819976  0.81604784 -1.14993267  0.22327575 -0.07923951 -1.60680162
 [19] -0.16903607 -0.48034077 -0.60155561  1.23845604 -0.43133773 -0.82216264
 [25] -0.03230675 -0.93055561 -1.23357425  1.02315649 -0.87538827 -1.85293735
 [31] -1.14757072 -1.38216611  1.74944680 -0.42160462 -0.95814384  0.42323184
 [37] -0.57614428  1.96355026  0.31966361 -0.05892561 -0.02860717 -0.91921481
 [43]  0.56779065 -0.17248608 -0.78965073  1.18972496 -0.54785008  0.16664171
 [49]  1.28419787 -1.43970174  0.21909027  0.62224694 -0.73032337  1.45699806
 [55] -0.97711222 -0.95940427 -1.67464551 -0.87807701  0.11097400  0.71002071
 [61]  0.09532603 -0.14235449 -2.03879117 -1.64649878  0.74053854 -0.75028219
 [67]  1.43495221  0.07371052  0.54607575  0.90607720 -0.37174989  0.63124552
 [73] -1.25058196  2.52264045  0.16840768  0.03800531  0.57424185 -0.92476236
 [79] -0.62194616  0.10866631 -1.85996375  0.44891434 -1.62010327 -0.26548433
 [85]  0.09843831  0.11263790 -0.49903657  0.39579377 -1.59934688  1.88705004
 [91]  0.07239028 -0.71731194 -0.37442088 -0.47471438  0.06116141  0.66020164
 [97] -1.21729389 -0.36920449  0.27633391  0.62456898
> colSums(tmp)
  [1] -0.32429485 -0.95491187  0.47838695 -0.40620077 -1.25774045  0.44508391
  [7] -0.38152309 -0.27434816  0.61887871  1.11505561 -1.75856473 -1.67609804
 [13]  0.67819976  0.81604784 -1.14993267  0.22327575 -0.07923951 -1.60680162
 [19] -0.16903607 -0.48034077 -0.60155561  1.23845604 -0.43133773 -0.82216264
 [25] -0.03230675 -0.93055561 -1.23357425  1.02315649 -0.87538827 -1.85293735
 [31] -1.14757072 -1.38216611  1.74944680 -0.42160462 -0.95814384  0.42323184
 [37] -0.57614428  1.96355026  0.31966361 -0.05892561 -0.02860717 -0.91921481
 [43]  0.56779065 -0.17248608 -0.78965073  1.18972496 -0.54785008  0.16664171
 [49]  1.28419787 -1.43970174  0.21909027  0.62224694 -0.73032337  1.45699806
 [55] -0.97711222 -0.95940427 -1.67464551 -0.87807701  0.11097400  0.71002071
 [61]  0.09532603 -0.14235449 -2.03879117 -1.64649878  0.74053854 -0.75028219
 [67]  1.43495221  0.07371052  0.54607575  0.90607720 -0.37174989  0.63124552
 [73] -1.25058196  2.52264045  0.16840768  0.03800531  0.57424185 -0.92476236
 [79] -0.62194616  0.10866631 -1.85996375  0.44891434 -1.62010327 -0.26548433
 [85]  0.09843831  0.11263790 -0.49903657  0.39579377 -1.59934688  1.88705004
 [91]  0.07239028 -0.71731194 -0.37442088 -0.47471438  0.06116141  0.66020164
 [97] -1.21729389 -0.36920449  0.27633391  0.62456898
> colVars(tmp)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> colSd(tmp)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> colMax(tmp)
  [1] -0.32429485 -0.95491187  0.47838695 -0.40620077 -1.25774045  0.44508391
  [7] -0.38152309 -0.27434816  0.61887871  1.11505561 -1.75856473 -1.67609804
 [13]  0.67819976  0.81604784 -1.14993267  0.22327575 -0.07923951 -1.60680162
 [19] -0.16903607 -0.48034077 -0.60155561  1.23845604 -0.43133773 -0.82216264
 [25] -0.03230675 -0.93055561 -1.23357425  1.02315649 -0.87538827 -1.85293735
 [31] -1.14757072 -1.38216611  1.74944680 -0.42160462 -0.95814384  0.42323184
 [37] -0.57614428  1.96355026  0.31966361 -0.05892561 -0.02860717 -0.91921481
 [43]  0.56779065 -0.17248608 -0.78965073  1.18972496 -0.54785008  0.16664171
 [49]  1.28419787 -1.43970174  0.21909027  0.62224694 -0.73032337  1.45699806
 [55] -0.97711222 -0.95940427 -1.67464551 -0.87807701  0.11097400  0.71002071
 [61]  0.09532603 -0.14235449 -2.03879117 -1.64649878  0.74053854 -0.75028219
 [67]  1.43495221  0.07371052  0.54607575  0.90607720 -0.37174989  0.63124552
 [73] -1.25058196  2.52264045  0.16840768  0.03800531  0.57424185 -0.92476236
 [79] -0.62194616  0.10866631 -1.85996375  0.44891434 -1.62010327 -0.26548433
 [85]  0.09843831  0.11263790 -0.49903657  0.39579377 -1.59934688  1.88705004
 [91]  0.07239028 -0.71731194 -0.37442088 -0.47471438  0.06116141  0.66020164
 [97] -1.21729389 -0.36920449  0.27633391  0.62456898
> colMin(tmp)
  [1] -0.32429485 -0.95491187  0.47838695 -0.40620077 -1.25774045  0.44508391
  [7] -0.38152309 -0.27434816  0.61887871  1.11505561 -1.75856473 -1.67609804
 [13]  0.67819976  0.81604784 -1.14993267  0.22327575 -0.07923951 -1.60680162
 [19] -0.16903607 -0.48034077 -0.60155561  1.23845604 -0.43133773 -0.82216264
 [25] -0.03230675 -0.93055561 -1.23357425  1.02315649 -0.87538827 -1.85293735
 [31] -1.14757072 -1.38216611  1.74944680 -0.42160462 -0.95814384  0.42323184
 [37] -0.57614428  1.96355026  0.31966361 -0.05892561 -0.02860717 -0.91921481
 [43]  0.56779065 -0.17248608 -0.78965073  1.18972496 -0.54785008  0.16664171
 [49]  1.28419787 -1.43970174  0.21909027  0.62224694 -0.73032337  1.45699806
 [55] -0.97711222 -0.95940427 -1.67464551 -0.87807701  0.11097400  0.71002071
 [61]  0.09532603 -0.14235449 -2.03879117 -1.64649878  0.74053854 -0.75028219
 [67]  1.43495221  0.07371052  0.54607575  0.90607720 -0.37174989  0.63124552
 [73] -1.25058196  2.52264045  0.16840768  0.03800531  0.57424185 -0.92476236
 [79] -0.62194616  0.10866631 -1.85996375  0.44891434 -1.62010327 -0.26548433
 [85]  0.09843831  0.11263790 -0.49903657  0.39579377 -1.59934688  1.88705004
 [91]  0.07239028 -0.71731194 -0.37442088 -0.47471438  0.06116141  0.66020164
 [97] -1.21729389 -0.36920449  0.27633391  0.62456898
> colMedians(tmp)
  [1] -0.32429485 -0.95491187  0.47838695 -0.40620077 -1.25774045  0.44508391
  [7] -0.38152309 -0.27434816  0.61887871  1.11505561 -1.75856473 -1.67609804
 [13]  0.67819976  0.81604784 -1.14993267  0.22327575 -0.07923951 -1.60680162
 [19] -0.16903607 -0.48034077 -0.60155561  1.23845604 -0.43133773 -0.82216264
 [25] -0.03230675 -0.93055561 -1.23357425  1.02315649 -0.87538827 -1.85293735
 [31] -1.14757072 -1.38216611  1.74944680 -0.42160462 -0.95814384  0.42323184
 [37] -0.57614428  1.96355026  0.31966361 -0.05892561 -0.02860717 -0.91921481
 [43]  0.56779065 -0.17248608 -0.78965073  1.18972496 -0.54785008  0.16664171
 [49]  1.28419787 -1.43970174  0.21909027  0.62224694 -0.73032337  1.45699806
 [55] -0.97711222 -0.95940427 -1.67464551 -0.87807701  0.11097400  0.71002071
 [61]  0.09532603 -0.14235449 -2.03879117 -1.64649878  0.74053854 -0.75028219
 [67]  1.43495221  0.07371052  0.54607575  0.90607720 -0.37174989  0.63124552
 [73] -1.25058196  2.52264045  0.16840768  0.03800531  0.57424185 -0.92476236
 [79] -0.62194616  0.10866631 -1.85996375  0.44891434 -1.62010327 -0.26548433
 [85]  0.09843831  0.11263790 -0.49903657  0.39579377 -1.59934688  1.88705004
 [91]  0.07239028 -0.71731194 -0.37442088 -0.47471438  0.06116141  0.66020164
 [97] -1.21729389 -0.36920449  0.27633391  0.62456898
> colRanges(tmp)
           [,1]       [,2]      [,3]       [,4]     [,5]      [,6]       [,7]
[1,] -0.3242948 -0.9549119 0.4783869 -0.4062008 -1.25774 0.4450839 -0.3815231
[2,] -0.3242948 -0.9549119 0.4783869 -0.4062008 -1.25774 0.4450839 -0.3815231
           [,8]      [,9]    [,10]     [,11]     [,12]     [,13]     [,14]
[1,] -0.2743482 0.6188787 1.115056 -1.758565 -1.676098 0.6781998 0.8160478
[2,] -0.2743482 0.6188787 1.115056 -1.758565 -1.676098 0.6781998 0.8160478
         [,15]     [,16]       [,17]     [,18]      [,19]      [,20]      [,21]
[1,] -1.149933 0.2232758 -0.07923951 -1.606802 -0.1690361 -0.4803408 -0.6015556
[2,] -1.149933 0.2232758 -0.07923951 -1.606802 -0.1690361 -0.4803408 -0.6015556
        [,22]      [,23]      [,24]       [,25]      [,26]     [,27]    [,28]
[1,] 1.238456 -0.4313377 -0.8221626 -0.03230675 -0.9305556 -1.233574 1.023156
[2,] 1.238456 -0.4313377 -0.8221626 -0.03230675 -0.9305556 -1.233574 1.023156
          [,29]     [,30]     [,31]     [,32]    [,33]      [,34]      [,35]
[1,] -0.8753883 -1.852937 -1.147571 -1.382166 1.749447 -0.4216046 -0.9581438
[2,] -0.8753883 -1.852937 -1.147571 -1.382166 1.749447 -0.4216046 -0.9581438
         [,36]      [,37]   [,38]     [,39]       [,40]       [,41]      [,42]
[1,] 0.4232318 -0.5761443 1.96355 0.3196636 -0.05892561 -0.02860717 -0.9192148
[2,] 0.4232318 -0.5761443 1.96355 0.3196636 -0.05892561 -0.02860717 -0.9192148
         [,43]      [,44]      [,45]    [,46]      [,47]     [,48]    [,49]
[1,] 0.5677907 -0.1724861 -0.7896507 1.189725 -0.5478501 0.1666417 1.284198
[2,] 0.5677907 -0.1724861 -0.7896507 1.189725 -0.5478501 0.1666417 1.284198
         [,50]     [,51]     [,52]      [,53]    [,54]      [,55]      [,56]
[1,] -1.439702 0.2190903 0.6222469 -0.7303234 1.456998 -0.9771122 -0.9594043
[2,] -1.439702 0.2190903 0.6222469 -0.7303234 1.456998 -0.9771122 -0.9594043
         [,57]     [,58]    [,59]     [,60]      [,61]      [,62]     [,63]
[1,] -1.674646 -0.878077 0.110974 0.7100207 0.09532603 -0.1423545 -2.038791
[2,] -1.674646 -0.878077 0.110974 0.7100207 0.09532603 -0.1423545 -2.038791
         [,64]     [,65]      [,66]    [,67]      [,68]     [,69]     [,70]
[1,] -1.646499 0.7405385 -0.7502822 1.434952 0.07371052 0.5460758 0.9060772
[2,] -1.646499 0.7405385 -0.7502822 1.434952 0.07371052 0.5460758 0.9060772
          [,71]     [,72]     [,73]   [,74]     [,75]      [,76]     [,77]
[1,] -0.3717499 0.6312455 -1.250582 2.52264 0.1684077 0.03800531 0.5742418
[2,] -0.3717499 0.6312455 -1.250582 2.52264 0.1684077 0.03800531 0.5742418
          [,78]      [,79]     [,80]     [,81]     [,82]     [,83]      [,84]
[1,] -0.9247624 -0.6219462 0.1086663 -1.859964 0.4489143 -1.620103 -0.2654843
[2,] -0.9247624 -0.6219462 0.1086663 -1.859964 0.4489143 -1.620103 -0.2654843
          [,85]     [,86]      [,87]     [,88]     [,89]   [,90]      [,91]
[1,] 0.09843831 0.1126379 -0.4990366 0.3957938 -1.599347 1.88705 0.07239028
[2,] 0.09843831 0.1126379 -0.4990366 0.3957938 -1.599347 1.88705 0.07239028
          [,92]      [,93]      [,94]      [,95]     [,96]     [,97]      [,98]
[1,] -0.7173119 -0.3744209 -0.4747144 0.06116141 0.6602016 -1.217294 -0.3692045
[2,] -0.7173119 -0.3744209 -0.4747144 0.06116141 0.6602016 -1.217294 -0.3692045
         [,99]   [,100]
[1,] 0.2763339 0.624569
[2,] 0.2763339 0.624569
> 
> 
> Max(tmp2)
[1] 1.839721
> Min(tmp2)
[1] -2.890083
> mean(tmp2)
[1] -0.003578952
> Sum(tmp2)
[1] -0.3578952
> Var(tmp2)
[1] 0.8431405
> 
> rowMeans(tmp2)
  [1]  0.13407878 -1.63340579  0.18500209  0.24719877  0.11844431  1.60023809
  [7] -0.73348511  0.38491935  1.03854878  0.90139525  0.35607312 -1.32540974
 [13] -1.49232741  1.64083996 -0.38836509 -2.89008329  0.72689554  1.51170767
 [19] -0.07238075  0.92539336  1.28971017 -0.41562845 -1.09899894  0.43197121
 [25] -0.26726888  1.00033702  0.99573347 -0.77720135 -0.01908315 -0.90517838
 [31]  0.19765508  0.14793985 -0.74074600  0.83975753 -0.85682721  0.44037762
 [37] -0.04621449 -0.31586029  0.73475008  1.06771631  0.19346608 -0.01160694
 [43]  1.11600456  0.56198785 -0.42263663 -0.60578837 -0.48979209  1.05741620
 [49]  0.46387549  0.25267166  1.03881690 -0.96632407 -1.03157483  1.44970072
 [55]  0.93202260  0.61352227 -0.19041221  0.65532424  0.24360842  1.02383349
 [61]  0.13493283 -0.86003589 -0.42362936 -0.33222406 -1.92037554 -0.62310963
 [67]  0.47661365  1.65612367 -0.97136979  0.14177047 -0.61958847 -0.37975390
 [73]  0.53607808  0.19130351  0.42790666 -0.21306249 -0.27041769  1.25985317
 [79] -0.22449534 -0.60179710  0.35240806  1.83972086 -0.05356392 -1.04886620
 [85] -0.42380071  0.21002699 -1.29540896  0.20788351  1.11834346 -0.71550725
 [91] -0.66382221 -0.07658039 -1.10768672 -2.88884392 -0.74489893  0.29053513
 [97] -0.29617959 -0.35497682  0.59586151 -1.50959625
> rowSums(tmp2)
  [1]  0.13407878 -1.63340579  0.18500209  0.24719877  0.11844431  1.60023809
  [7] -0.73348511  0.38491935  1.03854878  0.90139525  0.35607312 -1.32540974
 [13] -1.49232741  1.64083996 -0.38836509 -2.89008329  0.72689554  1.51170767
 [19] -0.07238075  0.92539336  1.28971017 -0.41562845 -1.09899894  0.43197121
 [25] -0.26726888  1.00033702  0.99573347 -0.77720135 -0.01908315 -0.90517838
 [31]  0.19765508  0.14793985 -0.74074600  0.83975753 -0.85682721  0.44037762
 [37] -0.04621449 -0.31586029  0.73475008  1.06771631  0.19346608 -0.01160694
 [43]  1.11600456  0.56198785 -0.42263663 -0.60578837 -0.48979209  1.05741620
 [49]  0.46387549  0.25267166  1.03881690 -0.96632407 -1.03157483  1.44970072
 [55]  0.93202260  0.61352227 -0.19041221  0.65532424  0.24360842  1.02383349
 [61]  0.13493283 -0.86003589 -0.42362936 -0.33222406 -1.92037554 -0.62310963
 [67]  0.47661365  1.65612367 -0.97136979  0.14177047 -0.61958847 -0.37975390
 [73]  0.53607808  0.19130351  0.42790666 -0.21306249 -0.27041769  1.25985317
 [79] -0.22449534 -0.60179710  0.35240806  1.83972086 -0.05356392 -1.04886620
 [85] -0.42380071  0.21002699 -1.29540896  0.20788351  1.11834346 -0.71550725
 [91] -0.66382221 -0.07658039 -1.10768672 -2.88884392 -0.74489893  0.29053513
 [97] -0.29617959 -0.35497682  0.59586151 -1.50959625
> 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.13407878 -1.63340579  0.18500209  0.24719877  0.11844431  1.60023809
  [7] -0.73348511  0.38491935  1.03854878  0.90139525  0.35607312 -1.32540974
 [13] -1.49232741  1.64083996 -0.38836509 -2.89008329  0.72689554  1.51170767
 [19] -0.07238075  0.92539336  1.28971017 -0.41562845 -1.09899894  0.43197121
 [25] -0.26726888  1.00033702  0.99573347 -0.77720135 -0.01908315 -0.90517838
 [31]  0.19765508  0.14793985 -0.74074600  0.83975753 -0.85682721  0.44037762
 [37] -0.04621449 -0.31586029  0.73475008  1.06771631  0.19346608 -0.01160694
 [43]  1.11600456  0.56198785 -0.42263663 -0.60578837 -0.48979209  1.05741620
 [49]  0.46387549  0.25267166  1.03881690 -0.96632407 -1.03157483  1.44970072
 [55]  0.93202260  0.61352227 -0.19041221  0.65532424  0.24360842  1.02383349
 [61]  0.13493283 -0.86003589 -0.42362936 -0.33222406 -1.92037554 -0.62310963
 [67]  0.47661365  1.65612367 -0.97136979  0.14177047 -0.61958847 -0.37975390
 [73]  0.53607808  0.19130351  0.42790666 -0.21306249 -0.27041769  1.25985317
 [79] -0.22449534 -0.60179710  0.35240806  1.83972086 -0.05356392 -1.04886620
 [85] -0.42380071  0.21002699 -1.29540896  0.20788351  1.11834346 -0.71550725
 [91] -0.66382221 -0.07658039 -1.10768672 -2.88884392 -0.74489893  0.29053513
 [97] -0.29617959 -0.35497682  0.59586151 -1.50959625
> rowMin(tmp2)
  [1]  0.13407878 -1.63340579  0.18500209  0.24719877  0.11844431  1.60023809
  [7] -0.73348511  0.38491935  1.03854878  0.90139525  0.35607312 -1.32540974
 [13] -1.49232741  1.64083996 -0.38836509 -2.89008329  0.72689554  1.51170767
 [19] -0.07238075  0.92539336  1.28971017 -0.41562845 -1.09899894  0.43197121
 [25] -0.26726888  1.00033702  0.99573347 -0.77720135 -0.01908315 -0.90517838
 [31]  0.19765508  0.14793985 -0.74074600  0.83975753 -0.85682721  0.44037762
 [37] -0.04621449 -0.31586029  0.73475008  1.06771631  0.19346608 -0.01160694
 [43]  1.11600456  0.56198785 -0.42263663 -0.60578837 -0.48979209  1.05741620
 [49]  0.46387549  0.25267166  1.03881690 -0.96632407 -1.03157483  1.44970072
 [55]  0.93202260  0.61352227 -0.19041221  0.65532424  0.24360842  1.02383349
 [61]  0.13493283 -0.86003589 -0.42362936 -0.33222406 -1.92037554 -0.62310963
 [67]  0.47661365  1.65612367 -0.97136979  0.14177047 -0.61958847 -0.37975390
 [73]  0.53607808  0.19130351  0.42790666 -0.21306249 -0.27041769  1.25985317
 [79] -0.22449534 -0.60179710  0.35240806  1.83972086 -0.05356392 -1.04886620
 [85] -0.42380071  0.21002699 -1.29540896  0.20788351  1.11834346 -0.71550725
 [91] -0.66382221 -0.07658039 -1.10768672 -2.88884392 -0.74489893  0.29053513
 [97] -0.29617959 -0.35497682  0.59586151 -1.50959625
> 
> colMeans(tmp2)
[1] -0.003578952
> colSums(tmp2)
[1] -0.3578952
> colVars(tmp2)
[1] 0.8431405
> colSd(tmp2)
[1] 0.9182268
> colMax(tmp2)
[1] 1.839721
> colMin(tmp2)
[1] -2.890083
> colMedians(tmp2)
[1] 0.1262615
> colRanges(tmp2)
          [,1]
[1,] -2.890083
[2,]  1.839721
> 
> dataset1 <- matrix(dataset1,1,100)
> 
> agree.checks(tmp,dataset1)
> 
> dataset2 <- matrix(dataset2,100,1)
> agree.checks(tmp2,dataset2)
>   
> 
> tmp <- createBufferedMatrix(10,10)
> 
> tmp[1:10,1:10] <- rnorm(100)
> colApply(tmp,sum)
 [1] -1.07753800  1.37582462  5.28580863  1.78602444 -6.76235138  3.73151371
 [7] -5.16895326 -4.68063399  3.26923339  0.06282262
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -1.4377604
[2,] -0.9742708
[3,] -0.2514991
[4,]  0.6549459
[5,]  1.2914326
> 
> rowApply(tmp,sum)
 [1] -4.3330672 -0.7110282  0.2941481  0.6984979 -1.4217761  0.5941073
 [7] -2.3257876  4.0140160 -0.4464867  1.4591273
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    5   10    5    2    9    3    2    2   10     6
 [2,]   10    2    3    9    6    9    4    3    6     4
 [3,]    9    4    4    8    7    7    7    9    9     8
 [4,]    7    1    1    7   10    2    9    8    8     5
 [5,]    1    8    9    1    3    4    5    1    1    10
 [6,]    8    6   10    4    5    6    6    7    7     9
 [7,]    2    9    2    3    8    5    3    6    3     2
 [8,]    4    3    6    5    2    8    8    4    2     1
 [9,]    3    5    8    6    4   10   10    5    5     7
[10,]    6    7    7   10    1    1    1   10    4     3
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1]  2.1646068  3.1119263 -0.7228249  1.0817543 -1.6536616 -3.9289635
 [7] -2.2089803 -0.4868782  2.1824257 -0.3934438 -0.4257626 -0.1715226
[13] -3.5571304 -1.3910647  0.1888129 -0.1109644  1.4514014 -0.1626225
[19]  1.6546127 -1.0577588
> colApply(tmp,quantile)[,1]
             [,1]
[1,] -0.041513008
[2,] -0.002228265
[3,]  0.184678679
[4,]  0.683584960
[5,]  1.340084407
> 
> rowApply(tmp,sum)
[1]  5.019897  2.018172 -1.340486 -4.537723 -5.595898
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]   13   12   14   18   12
[2,]   14    9   13   17   20
[3,]    2   11   20    5   11
[4,]   16   13    9   13   14
[5,]    4    8   17    4   10
> 
> 
> as.matrix(tmp)
             [,1]        [,2]       [,3]       [,4]       [,5]        [,6]
[1,]  0.683584960  0.74464884 -1.1271990  1.0280016 -0.7580598  0.08918339
[2,]  0.184678679 -0.16623871  0.1313278  0.3368567 -0.1843009 -0.47498523
[3,] -0.002228265 -0.03146862  1.3898275 -0.2102428  0.5423555 -1.24073364
[4,]  1.340084407  0.62277573 -1.0025091 -0.3686420 -1.0443790 -0.86869181
[5,] -0.041513008  1.94220909 -0.1142721  0.2957807 -0.2092775 -1.43373620
           [,7]       [,8]       [,9]       [,10]      [,11]      [,12]
[1,]  2.1056060  1.2540556 -0.4218769  0.66287163  1.9554978 -0.7332342
[2,] -1.3025606 -0.6443711  1.0712860 -0.01419154  0.4667179  0.7582312
[3,] -0.3019193 -0.1212194 -0.1895275 -0.90570826  0.8091221  1.1574839
[4,] -0.6050782 -0.4994860  1.4193529 -0.49205336 -1.3096935 -0.3783798
[5,] -2.1050282 -0.4758572  0.3031912  0.35563776 -2.3474069 -0.9756238
          [,13]      [,14]      [,15]       [,16]       [,17]       [,18]
[1,] -1.4464767 -0.8545657 -0.6876825  0.78301629  0.21003075  1.49134937
[2,]  0.4472752 -0.2033659 -1.2810560  0.66284833  1.38973248 -0.68907949
[3,] -0.2586737  0.1250438 -0.3333222 -1.07892366  0.26363583 -0.04314013
[4,] -0.8625528 -1.1889406  2.0464140 -0.08554009 -0.07420344 -0.40827818
[5,] -1.4367024  0.7307637  0.4444596 -0.39236527 -0.33779419 -0.51347403
          [,19]       [,20]
[1,]  0.3411150 -0.29996978
[2,]  2.1567161 -0.62734889
[3,] -0.2720566 -0.63879093
[4,] -1.2448865  0.46696447
[5,]  0.6737248  0.04138636
> 
> 
> 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 :  566  bytes.
Disk usage :  160  bytes.
> subBufferedMatrix(tmp,1:3,)
BufferedMatrix object
Matrix size:  3 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.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.9043392 -0.335819 1.586257 -0.1391031 -0.5995836 -2.254901 0.6588424
            col8     col9     col10     col11      col12     col13    col14
row1 -0.07166607 2.108504 -1.555365 -1.566584 -0.2529169 0.7337492 0.883597
         col15      col16     col17    col18     col19    col20
row1 -1.116151 -0.7029467 -1.180383 1.959815 0.0435054 0.185266
> tmp[,"col10"]
          col10
row1 -1.5553650
row2 -2.1154921
row3 -0.7916441
row4 -1.1261500
row5  0.6597264
> tmp[c("row1","row5"),]
          col1      col2     col3       col4       col5       col6       col7
row1 0.9043392 -0.335819 1.586257 -0.1391031 -0.5995836 -2.2549014  0.6588424
row5 0.9736894 -1.060038 1.001424 -0.8536967 -0.6599109  0.8079819 -0.1834639
            col8       col9      col10      col11      col12      col13
row1 -0.07166607  2.1085041 -1.5553650 -1.5665840 -0.2529169  0.7337492
row5  0.06344531 -0.1319879  0.6597264  0.5510807  0.9856153 -1.5745344
          col14       col15      col16      col17     col18      col19
row1  0.8835970 -1.11615055 -0.7029467 -1.1803826 1.9598152  0.0435054
row5 -0.1031277  0.03438402  2.2831048  0.3395472 0.4668811 -0.6830420
          col20
row1  0.1852660
row5 -0.1042206
> tmp[,c("col6","col20")]
           col6       col20
row1 -2.2549014  0.18526599
row2 -0.5394201 -1.22094535
row3  0.3280862  0.12875641
row4  0.5280261  0.06270366
row5  0.8079819 -0.10422062
> tmp[c("row1","row5"),c("col6","col20")]
           col6      col20
row1 -2.2549014  0.1852660
row5  0.8079819 -0.1042206
> 
> 
> 
> 
> tmp["row1",] <- rnorm(20,mean=10)
> tmp[,"col10"] <- rnorm(5,mean=30)
> tmp[c("row1","row5"),] <- rnorm(40,mean=50)
> tmp[,c("col6","col20")] <- rnorm(10,mean=75)
> tmp[c("row1","row5"),c("col6","col20")]  <- rnorm(4,mean=105)
> 
> tmp["row1",]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 50.10004 50.07821 49.95662 51.53046 50.11325 106.0219 48.71259 51.35455
         col9    col10    col11    col12    col13    col14    col15    col16
row1 50.17469 51.33642 48.45314 51.26106 48.88783 52.58422 49.43412 49.53441
        col17    col18    col19    col20
row1 48.28359 49.11105 50.67755 106.1019
> tmp[,"col10"]
        col10
row1 51.33642
row2 30.63427
row3 29.67958
row4 29.24886
row5 51.21220
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 50.10004 50.07821 49.95662 51.53046 50.11325 106.0219 48.71259 51.35455
row5 48.49759 49.70692 52.03650 51.50127 49.74759 105.0311 47.90797 51.09762
         col9    col10    col11    col12    col13    col14    col15    col16
row1 50.17469 51.33642 48.45314 51.26106 48.88783 52.58422 49.43412 49.53441
row5 50.34994 51.21220 49.89954 50.27140 48.94273 49.10816 49.75903 49.95022
        col17    col18    col19    col20
row1 48.28359 49.11105 50.67755 106.1019
row5 49.76231 50.65489 50.65736 106.1701
> tmp[,c("col6","col20")]
          col6     col20
row1 106.02190 106.10185
row2  75.59238  75.98669
row3  74.74070  75.76130
row4  75.00486  74.45395
row5 105.03110 106.17008
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 106.0219 106.1019
row5 105.0311 106.1701
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 106.0219 106.1019
row5 105.0311 106.1701
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
          col13
[1,]  1.1039425
[2,] -1.4882482
[3,]  0.3996271
[4,]  0.4439336
[5,]  0.9942750
> tmp[,c("col17","col7")]
          col17        col7
[1,]  0.7683192  1.30592342
[2,] -0.1665449 -0.41958644
[3,]  0.9250239 -0.01728879
[4,]  0.4338614 -1.09231112
[5,]  0.3704553 -0.03648840
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
            col6      col20
[1,] -1.11369403 -0.7805742
[2,] -2.00266803 -0.1440794
[3,]  0.08483975  0.7698697
[4,] -0.70799702  1.1261526
[5,] -1.84211610  0.4895647
> subBufferedMatrix(tmp,1,c("col6"))[,1]
          col1
[1,] -1.113694
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
          col6
[1,] -1.113694
[2,] -2.002668
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> 
> 
> 
> subBufferedMatrix(tmp,c("row3","row1"),)[,1:20]
           [,1]        [,2]       [,3]       [,4]      [,5]       [,6]
row3  0.6619502 -0.95220876  0.5250994 -0.6738060 0.4718010 -0.1407812
row1 -1.7857704  0.08946434 -1.3698169 -0.1136101 0.2261133  0.7035521
           [,7]         [,8]       [,9]      [,10]       [,11]     [,12]
row3 -1.1288473  0.003423928 -1.1589818  0.1016415 -0.02928974 0.8992558
row1 -0.8547055 -1.255812334 -0.1750878 -0.3028425 -1.86017203 0.4390015
          [,13]      [,14]      [,15]       [,16]      [,17]     [,18]
row3  0.7172565  0.6857300  0.7823358  0.06135716  0.6715177 0.4111712
row1 -0.6115598 -0.8195883 -0.8131157 -0.84151462 -0.5642758 0.3900310
         [,19]     [,20]
row3 2.3005933 0.7544677
row1 0.5915858 0.2484858
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
            [,1]       [,2]      [,3]      [,4]      [,5]      [,6]      [,7]
row2 -0.03207266 -0.7140302 0.7773838 0.6501562 -0.357039 -0.161651 0.8209378
          [,8]       [,9]     [,10]
row2 0.9238456 -0.3731973 0.4378045
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
         [,1]      [,2]     [,3]       [,4]       [,5]      [,6]       [,7]
row5 0.795855 -1.144509 1.368733 -0.1287581 0.02267637 -0.390523 -0.8689233
         [,8]       [,9]     [,10]     [,11]     [,12]    [,13]     [,14]
row5 1.852335 -0.2190655 0.2378329 -2.280444 -1.912372 0.708385 0.4525212
          [,15]      [,16]     [,17]       [,18]     [,19]      [,20]
row5 -0.6390926 -0.3160238 0.7067784 -0.04064519 -0.770128 -0.2888313
> 
> 
> 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: 0xfd5f180>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM139ef345e450ab"
 [2] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM139ef3fa9bc2d" 
 [3] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM139ef331a38fbd"
 [4] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM139ef33aae1dbc"
 [5] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM139ef350d7053" 
 [6] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM139ef34f836b13"
 [7] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM139ef336c91273"
 [8] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM139ef3674a88f3"
 [9] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM139ef31b17d10f"
[10] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM139ef37e7c642" 
[11] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM139ef35d838a94"
[12] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM139ef33c86fbc8"
[13] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM139ef36bc4ed88"
[14] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM139ef323b413a" 
[15] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM139ef3432a634a"
> 
> 
> ### 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: 0x1007ae50>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x1007ae50>
Warning message:
In dir.create(new.directory) :
  '/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x1007ae50>
> rowMedians(tmp)
  [1] -0.049628690  0.004445360 -0.311950145  0.275175042  0.152673547
  [6]  0.170871488  0.088396193 -0.450603319  0.047318207 -0.059749149
 [11]  0.176998942 -0.595423305 -0.105338866  0.575447128  0.047055431
 [16] -0.122811010  0.936626370  0.136585066 -0.071778971 -0.381917766
 [21] -0.312402203 -0.183923126  0.301540168 -0.480257631 -0.500562180
 [26]  0.257513211 -0.148162464  0.284284641  0.219429050  0.261351701
 [31] -0.227134870 -0.545542593 -0.553345564  0.007412609 -0.461685703
 [36] -0.570958427  0.085150997  0.208415199  0.375897129 -0.124719382
 [41] -0.020442081 -0.458904375 -0.103956597 -0.005909395  0.248609712
 [46]  0.006331935 -0.185554019 -0.087775656  0.448019604 -0.212511533
 [51] -0.338378222  0.255361913  0.381555781  0.234006184 -0.148102068
 [56]  0.349028734 -0.334887936 -0.054135579  0.276437727 -0.053523020
 [61]  0.355536058 -0.237570604 -0.121610248  0.078015677  0.088418151
 [66]  0.431592011 -0.049333730 -0.634886625 -0.505139187 -0.282803759
 [71]  0.285469947  0.128692825 -0.068120470  0.012853079  0.209543719
 [76] -0.180200971 -0.054310301  0.079766138  0.090976839  0.099734629
 [81]  0.198491111  0.365899059 -0.092486456 -0.486435533 -0.381768813
 [86]  0.103835188  0.094247608  0.157484908 -0.100518080  0.222171087
 [91]  0.039750630 -0.146491664 -0.026998084  0.055208361 -0.069645332
 [96]  0.358051524 -0.302857141 -0.346879831 -0.018755007  0.172824458
[101] -0.051444432 -0.350320430  0.516000659  0.078246391 -0.227442496
[106] -0.284257930  0.760531560 -0.520329892 -0.364440742 -0.231227655
[111]  0.158993270  0.114409584 -0.186548379  0.097594335  0.612500447
[116] -0.442243217  0.309673314 -0.035941531 -0.248808010  0.103583413
[121]  0.110202895  0.041436532 -0.014844670 -0.277254499  0.473891226
[126] -0.363920002 -0.017917229 -0.181619230 -0.555767168 -0.366361639
[131] -0.211109065  0.151444478  0.691699506 -0.107225244  0.080434601
[136]  0.031001439  0.349384270 -0.087045198 -0.314389099  0.187962335
[141] -0.006769434  0.102995366  0.584253547 -0.230159499 -0.615640722
[146]  0.096843377 -0.063536626 -0.310660238 -0.007949599 -0.049958901
[151]  0.322279223 -0.269026652  0.040928948  0.192060216  0.102049602
[156]  0.362211824  0.104612023  0.229431059  0.073595389 -0.167828301
[161] -0.429878885 -0.100999146  0.400075574 -0.348875046  0.096546048
[166]  0.024978740 -0.104509010 -0.469133641  0.610886467  0.358230699
[171] -0.147187225  0.353465864 -0.127513805 -0.048873597  0.207673603
[176] -0.284720582  0.613980783  0.064575299  0.118827589  0.266335560
[181] -0.037801024  0.120512025 -0.156638623 -0.167558873 -0.181063001
[186]  0.565837577 -0.529624047  0.180334283 -0.391379651  0.130153661
[191]  0.326641159  0.350433367  0.284873637  0.473581600 -0.029491609
[196]  0.421685743  0.082847662 -0.332866431 -0.016755084 -0.246072077
[201]  0.032572496 -0.321819232  0.316263046  0.096299716 -0.370099537
[206]  0.052626194  0.165691763 -0.277476451 -0.394186183  0.054268454
[211] -0.082299174  0.323051135  0.233918287  0.376227318 -0.952030383
[216] -0.141787157  0.265149928  0.278712289  0.075986700  0.177323743
[221] -0.113465920  0.579314509 -0.203510095  0.224112684 -0.341075769
[226] -0.027566270  0.403652621  0.109858778 -0.183106710 -0.750610881
> 
> proc.time()
   user  system elapsed 
  1.925   0.893   2.849 

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: 0x1e9aaff0>
> .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: 0x1e9aaff0>
> .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: 0x1e9aaff0>
> .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: 0x1e9aaff0>
> 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: 0x1e8900e0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x1e8900e0>
> .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: 0x1e8900e0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x1e8900e0>
> .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: 0x1e8900e0>
> 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: 0x1d817520>
> .Call("R_bm_AddColumn",P)
<pointer: 0x1d817520>
> .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: 0x1d817520>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x1d817520>
> .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: 0x1d817520>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x1d817520>
> .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: 0x1d817520>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x1d817520>
> .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: 0x1d817520>
> 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: 0x1d21b720>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x1d21b720>
> .Call("R_bm_AddColumn",P)
<pointer: 0x1d21b720>
> .Call("R_bm_AddColumn",P)
<pointer: 0x1d21b720>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile139f3b15a390b6" "BufferedMatrixFile139f3b596fc792"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile139f3b15a390b6" "BufferedMatrixFile139f3b596fc792"
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x1e10b7d0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x1e10b7d0>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x1e10b7d0>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x1e10b7d0>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x1e10b7d0>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x1e10b7d0>
> .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: 0x1e212c90>
> .Call("R_bm_AddColumn",P)
<pointer: 0x1e212c90>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x1e212c90>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x1e212c90>
> 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: 0x1f4bb110>
> .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: 0x1f4bb110>
> rm(P)
> 
> proc.time()
   user  system elapsed 
  0.341   0.035   0.362 

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.332   0.027   0.345 

Example timings