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

This page was generated on 2026-03-09 11:57 -0400 (Mon, 09 Mar 2026).

HostnameOSArch (*)R versionInstalled pkgs
nebbiolo2Linux (Ubuntu 24.04.3 LTS)x86_644.5.2 (2025-10-31) -- "[Not] Part in a Rumble" 4892
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: 2026-03-08 13:45 -0400 (Sun, 08 Mar 2026)
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 -0400 (Wed, 29 Oct 2025)
nebbiolo2Linux (Ubuntu 24.04.3 LTS) / x86_64  OK    OK    OK  UNNEEDED, same version is already published
See other builds for BufferedMatrix in R Universe.


CHECK results for BufferedMatrix on nebbiolo2

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

raw results


Summary

Package: BufferedMatrix
Version: 1.74.0
Command: /home/biocbuild/bbs-3.22-bioc/R/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/home/biocbuild/bbs-3.22-bioc/R/site-library --timings BufferedMatrix_1.74.0.tar.gz
StartedAt: 2026-03-08 21:41:00 -0400 (Sun, 08 Mar 2026)
EndedAt: 2026-03-08 21:41:23 -0400 (Sun, 08 Mar 2026)
EllapsedTime: 23.0 seconds
RetCode: 0
Status:   OK  
CheckDir: BufferedMatrix.Rcheck
Warnings: 0

Command output

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


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

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


Installation output

BufferedMatrix.Rcheck/00install.out

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


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

Tests output

BufferedMatrix.Rcheck/tests/c_code_level_tests.Rout


R version 4.5.2 (2025-10-31) -- "[Not] Part in a Rumble"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu

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

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

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

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

Attaching package: 'BufferedMatrix'

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

    colMeans, colSums, rowMeans, rowSums

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

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

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

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

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

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

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

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

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

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

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

[[1]]
[1] 0

> 
> proc.time()
   user  system elapsed 
  0.247   0.049   0.285 

BufferedMatrix.Rcheck/tests/objectTesting.Rout


R version 4.5.2 (2025-10-31) -- "[Not] Part in a Rumble"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu

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

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

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

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

Attaching package: 'BufferedMatrix'

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

    colMeans, colSums, rowMeans, rowSums

> 
> 
> ### this is used to control how many repetitions in something below
> ### higher values result in more checks.
> nreps <-100 ##20000
> 
> 
> ## test creation and some simple assignments and subsetting operations
> 
> ## first on single elements
> tmp <- createBufferedMatrix(1000,10)
> 
> tmp[10,5]
[1] 0
> tmp[10,5] <- 10
> tmp[10,5]
[1] 10
> tmp[10,5] <- 12.445
> tmp[10,5]
[1] 12.445
> 
> 
> 
> ## now testing accessing multiple elements
> tmp2 <- createBufferedMatrix(10,20)
> 
> 
> tmp2[3,1] <- 51.34
> tmp2[9,2] <- 9.87654
> tmp2[,1:2]
       [,1]    [,2]
 [1,]  0.00 0.00000
 [2,]  0.00 0.00000
 [3,] 51.34 0.00000
 [4,]  0.00 0.00000
 [5,]  0.00 0.00000
 [6,]  0.00 0.00000
 [7,]  0.00 0.00000
 [8,]  0.00 0.00000
 [9,]  0.00 9.87654
[10,]  0.00 0.00000
> tmp2[,-(3:20)]
       [,1]    [,2]
 [1,]  0.00 0.00000
 [2,]  0.00 0.00000
 [3,] 51.34 0.00000
 [4,]  0.00 0.00000
 [5,]  0.00 0.00000
 [6,]  0.00 0.00000
 [7,]  0.00 0.00000
 [8,]  0.00 0.00000
 [9,]  0.00 9.87654
[10,]  0.00 0.00000
> tmp2[3,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
[1,] 51.34    0    0    0    0    0    0    0    0     0     0     0     0
     [,14] [,15] [,16] [,17] [,18] [,19] [,20]
[1,]     0     0     0     0     0     0     0
> tmp2[-3,]
      [,1]    [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [2,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [3,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [4,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [5,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [6,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [7,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [8,]    0 9.87654    0    0    0    0    0    0    0     0     0     0     0
 [9,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
      [,14] [,15] [,16] [,17] [,18] [,19] [,20]
 [1,]     0     0     0     0     0     0     0
 [2,]     0     0     0     0     0     0     0
 [3,]     0     0     0     0     0     0     0
 [4,]     0     0     0     0     0     0     0
 [5,]     0     0     0     0     0     0     0
 [6,]     0     0     0     0     0     0     0
 [7,]     0     0     0     0     0     0     0
 [8,]     0     0     0     0     0     0     0
 [9,]     0     0     0     0     0     0     0
> tmp2[2,1:3]
     [,1] [,2] [,3]
[1,]    0    0    0
> tmp2[3:9,1:3]
      [,1]    [,2] [,3]
[1,] 51.34 0.00000    0
[2,]  0.00 0.00000    0
[3,]  0.00 0.00000    0
[4,]  0.00 0.00000    0
[5,]  0.00 0.00000    0
[6,]  0.00 0.00000    0
[7,]  0.00 9.87654    0
> tmp2[-4,-4]
       [,1]    [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [2,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [3,] 51.34 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [4,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [5,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [6,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [7,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [8,]  0.00 9.87654    0    0    0    0    0    0    0     0     0     0     0
 [9,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
      [,14] [,15] [,16] [,17] [,18] [,19]
 [1,]     0     0     0     0     0     0
 [2,]     0     0     0     0     0     0
 [3,]     0     0     0     0     0     0
 [4,]     0     0     0     0     0     0
 [5,]     0     0     0     0     0     0
 [6,]     0     0     0     0     0     0
 [7,]     0     0     0     0     0     0
 [8,]     0     0     0     0     0     0
 [9,]     0     0     0     0     0     0
> 
> ## now testing accessing/assigning multiple elements
> tmp3 <- createBufferedMatrix(10,10)
> 
> for (i in 1:10){
+   for (j in 1:10){
+     tmp3[i,j] <- (j-1)*10 + i
+   }
+ }
> 
> tmp3[2:4,2:4]
     [,1] [,2] [,3]
[1,]   12   22   32
[2,]   13   23   33
[3,]   14   24   34
> tmp3[c(-10),c(2:4,2:4,10,1,2,1:10,10:1)]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]   11   21   31   11   21   31   91    1   11     1    11    21    31
 [2,]   12   22   32   12   22   32   92    2   12     2    12    22    32
 [3,]   13   23   33   13   23   33   93    3   13     3    13    23    33
 [4,]   14   24   34   14   24   34   94    4   14     4    14    24    34
 [5,]   15   25   35   15   25   35   95    5   15     5    15    25    35
 [6,]   16   26   36   16   26   36   96    6   16     6    16    26    36
 [7,]   17   27   37   17   27   37   97    7   17     7    17    27    37
 [8,]   18   28   38   18   28   38   98    8   18     8    18    28    38
 [9,]   19   29   39   19   29   39   99    9   19     9    19    29    39
      [,14] [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24] [,25]
 [1,]    41    51    61    71    81    91    91    81    71    61    51    41
 [2,]    42    52    62    72    82    92    92    82    72    62    52    42
 [3,]    43    53    63    73    83    93    93    83    73    63    53    43
 [4,]    44    54    64    74    84    94    94    84    74    64    54    44
 [5,]    45    55    65    75    85    95    95    85    75    65    55    45
 [6,]    46    56    66    76    86    96    96    86    76    66    56    46
 [7,]    47    57    67    77    87    97    97    87    77    67    57    47
 [8,]    48    58    68    78    88    98    98    88    78    68    58    48
 [9,]    49    59    69    79    89    99    99    89    79    69    59    49
      [,26] [,27] [,28] [,29]
 [1,]    31    21    11     1
 [2,]    32    22    12     2
 [3,]    33    23    13     3
 [4,]    34    24    14     4
 [5,]    35    25    15     5
 [6,]    36    26    16     6
 [7,]    37    27    17     7
 [8,]    38    28    18     8
 [9,]    39    29    19     9
> tmp3[-c(1:5),-c(6:10)]
     [,1] [,2] [,3] [,4] [,5]
[1,]    6   16   26   36   46
[2,]    7   17   27   37   47
[3,]    8   18   28   38   48
[4,]    9   19   29   39   49
[5,]   10   20   30   40   50
> 
> ## assignment of whole columns
> tmp3[,1] <- c(1:10*100.0)
> tmp3[,1:2] <- tmp3[,1:2]*100
> tmp3[,1:2] <- tmp3[,2:1]
> tmp3[,1:2]
      [,1]  [,2]
 [1,] 1100 1e+04
 [2,] 1200 2e+04
 [3,] 1300 3e+04
 [4,] 1400 4e+04
 [5,] 1500 5e+04
 [6,] 1600 6e+04
 [7,] 1700 7e+04
 [8,] 1800 8e+04
 [9,] 1900 9e+04
[10,] 2000 1e+05
> 
> 
> tmp3[,-1] <- tmp3[,1:9]
> tmp3[,1:10]
      [,1] [,2]  [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,] 1100 1100 1e+04   21   31   41   51   61   71    81
 [2,] 1200 1200 2e+04   22   32   42   52   62   72    82
 [3,] 1300 1300 3e+04   23   33   43   53   63   73    83
 [4,] 1400 1400 4e+04   24   34   44   54   64   74    84
 [5,] 1500 1500 5e+04   25   35   45   55   65   75    85
 [6,] 1600 1600 6e+04   26   36   46   56   66   76    86
 [7,] 1700 1700 7e+04   27   37   47   57   67   77    87
 [8,] 1800 1800 8e+04   28   38   48   58   68   78    88
 [9,] 1900 1900 9e+04   29   39   49   59   69   79    89
[10,] 2000 2000 1e+05   30   40   50   60   70   80    90
> 
> tmp3[,1:2] <- rep(1,10)
> tmp3[,1:2] <- rep(1,20)
> tmp3[,1:2] <- matrix(c(1:5),1,5)
> 
> tmp3[,-c(1:8)] <- matrix(c(1:5),1,5)
> 
> tmp3[1,] <- 1:10
> tmp3[1,]
     [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,]    1    2    3    4    5    6    7    8    9    10
> tmp3[-1,] <- c(1,2)
> tmp3[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    1    2    3    4    5    6    7    8    9    10
 [2,]    1    2    1    2    1    2    1    2    1     2
 [3,]    2    1    2    1    2    1    2    1    2     1
 [4,]    1    2    1    2    1    2    1    2    1     2
 [5,]    2    1    2    1    2    1    2    1    2     1
 [6,]    1    2    1    2    1    2    1    2    1     2
 [7,]    2    1    2    1    2    1    2    1    2     1
 [8,]    1    2    1    2    1    2    1    2    1     2
 [9,]    2    1    2    1    2    1    2    1    2     1
[10,]    1    2    1    2    1    2    1    2    1     2
> tmp3[-c(1:8),] <- matrix(c(1:5),1,5)
> tmp3[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    1    2    3    4    5    6    7    8    9    10
 [2,]    1    2    1    2    1    2    1    2    1     2
 [3,]    2    1    2    1    2    1    2    1    2     1
 [4,]    1    2    1    2    1    2    1    2    1     2
 [5,]    2    1    2    1    2    1    2    1    2     1
 [6,]    1    2    1    2    1    2    1    2    1     2
 [7,]    2    1    2    1    2    1    2    1    2     1
 [8,]    1    2    1    2    1    2    1    2    1     2
 [9,]    1    3    5    2    4    1    3    5    2     4
[10,]    2    4    1    3    5    2    4    1    3     5
> 
> 
> tmp3[1:2,1:2] <- 5555.04
> tmp3[-(1:2),1:2] <- 1234.56789
> 
> 
> 
> ## testing accessors for the directory and prefix
> directory(tmp3)
[1] "/home/biocbuild/bbs-3.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 478284 25.6    1046725   56   639600 34.2
Vcells 884773  6.8    8388608   64  2081613 15.9
> 
> 
> 
> 
> ##
> ## checking reads
> ##
> 
> tmp2 <- createBufferedMatrix(10,20)
> 
> test.sample <- rnorm(10*20)
> 
> tmp2[1:10,1:20] <- test.sample
> 
> test.matrix <- matrix(test.sample,10,20)
> 
> ## testing reads
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   which.col <- sample(1:20,1)
+   if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> date()
[1] "Sun Mar  8 21:41:15 2026"
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> date()
[1] "Sun Mar  8 21:41:15 2026"
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,which.col] == test.matrix[which.row,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> 
> 
> RowMode(tmp2)
<pointer: 0x5982bde27370>
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   which.col <- sample(1:20,1)
+   if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,5,replace=TRUE)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> date()
[1] "Sun Mar  8 21:41:15 2026"
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col <- sample(1:20,5,replace=TRUE)
+   if (!all(tmp2[which.row,which.col] == test.matrix[which.row,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> date()
[1] "Sun Mar  8 21:41:15 2026"
> 
> ColMode(tmp2)
<pointer: 0x5982bde27370>
> 
> 
> 
> ### 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.1419978 -1.6195369  0.5564979  1.3991086
[2,] -1.4703490 -0.9800818 -0.1168463 -1.2583216
[3,] -0.4513966  2.2753695 -0.1431131  1.1959251
[4,]  0.1571574  0.8505773  0.5548437 -0.4716549
> 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.1419978 1.6195369 0.5564979 1.3991086
[2,]  1.4703490 0.9800818 0.1168463 1.2583216
[3,]  0.4513966 2.2753695 0.1431131 1.1959251
[4,]  0.1571574 0.8505773 0.5548437 0.4716549
> 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.9570075 1.2726103 0.7459878 1.1828392
[2,] 1.2125795 0.9899908 0.3418278 1.1217493
[3,] 0.6718606 1.5084328 0.3783029 1.0935836
[4,] 0.3964308 0.9222675 0.7448783 0.6867714
> 
> 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,] 223.71207 39.34564 33.01638 38.22750
[2,]  38.59614 35.87999 28.53512 37.47581
[3,]  32.17000 42.35970 28.92614 37.13176
[4,]  29.12147 35.07325 33.00363 32.33937
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x5982bee239b0>
> exp(tmp5)
<pointer: 0x5982bee239b0>
> log(tmp5,2)
<pointer: 0x5982bee239b0>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 465.6274
> Min(tmp5)
[1] 53.46898
> mean(tmp5)
[1] 72.45341
> Sum(tmp5)
[1] 14490.68
> Var(tmp5)
[1] 853.3623
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 90.25260 71.29664 71.39278 71.36940 68.30191 68.39233 70.55634 71.37350
 [9] 68.50693 73.09172
> rowSums(tmp5)
 [1] 1805.052 1425.933 1427.856 1427.388 1366.038 1367.847 1411.127 1427.470
 [9] 1370.139 1461.834
> rowVars(tmp5)
 [1] 7876.54858   71.54298  115.67576   43.78984   97.95458   95.94403
 [7]   62.09813   79.70675   55.13486   44.79548
> rowSd(tmp5)
 [1] 88.749922  8.458308 10.755267  6.617390  9.897201  9.795102  7.880237
 [8]  8.927864  7.425285  6.692942
> rowMax(tmp5)
 [1] 465.62737  87.95760  92.08420  84.13704  92.05333  96.16555  87.01276
 [8]  88.81407  84.15874  84.22095
> rowMin(tmp5)
 [1] 58.67054 55.51870 53.98149 60.61251 53.46898 55.28311 58.91808 58.02812
 [9] 55.00388 58.38211
> 
> colMeans(tmp5)
 [1] 109.28666  74.80980  69.30876  71.06228  68.82720  70.54398  66.86197
 [8]  70.24919  73.31246  68.46329  67.27640  73.07194  67.66898  75.23555
[15]  70.97945  76.34472  69.07489  69.06043  64.73129  72.89908
> colSums(tmp5)
 [1] 1092.8666  748.0980  693.0876  710.6228  688.2720  705.4398  668.6197
 [8]  702.4919  733.1246  684.6329  672.7640  730.7194  676.6898  752.3555
[15]  709.7945  763.4472  690.7489  690.6043  647.3129  728.9908
> colVars(tmp5)
 [1] 15721.05215    66.71857   120.58971    66.84811    80.45878    66.85224
 [7]    70.34863    43.32134    67.99185    56.20549    57.92928   104.36291
[13]   135.75781    39.48890    67.06336   123.61829    85.47446    36.19837
[19]    42.02490    37.00825
> colSd(tmp5)
 [1] 125.383620   8.168143  10.981335   8.176069   8.969882   8.176322
 [7]   8.387409   6.581895   8.245717   7.497032   7.611129  10.215817
[13]  11.651516   6.284020   8.189222  11.118376   9.245240   6.016508
[19]   6.482662   6.083440
> colMax(tmp5)
 [1] 465.62737  88.16616  96.16555  79.56553  80.74117  83.02216  87.00778
 [8]  79.45047  92.08420  78.70416  76.15428  88.81407  92.05333  83.18100
[15]  84.22095  90.53765  80.73065  75.54734  76.82315  82.98368
> colMin(tmp5)
 [1] 60.61251 61.68638 56.49565 55.19556 55.00388 58.67054 58.38211 58.85681
 [9] 65.08744 58.02812 53.46898 60.68531 55.60742 61.34465 60.44617 55.28311
[17] 53.98149 59.27540 55.51870 64.02142
> 
> 
> ### 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.25260 71.29664 71.39278       NA 68.30191 68.39233 70.55634 71.37350
 [9] 68.50693 73.09172
> rowSums(tmp5)
 [1] 1805.052 1425.933 1427.856       NA 1366.038 1367.847 1411.127 1427.470
 [9] 1370.139 1461.834
> rowVars(tmp5)
 [1] 7876.54858   71.54298  115.67576   45.25902   97.95458   95.94403
 [7]   62.09813   79.70675   55.13486   44.79548
> rowSd(tmp5)
 [1] 88.749922  8.458308 10.755267  6.727483  9.897201  9.795102  7.880237
 [8]  8.927864  7.425285  6.692942
> rowMax(tmp5)
 [1] 465.62737  87.95760  92.08420        NA  92.05333  96.16555  87.01276
 [8]  88.81407  84.15874  84.22095
> rowMin(tmp5)
 [1] 58.67054 55.51870 53.98149       NA 53.46898 55.28311 58.91808 58.02812
 [9] 55.00388 58.38211
> 
> colMeans(tmp5)
 [1] 109.28666  74.80980  69.30876        NA  68.82720  70.54398  66.86197
 [8]  70.24919  73.31246  68.46329  67.27640  73.07194  67.66898  75.23555
[15]  70.97945  76.34472  69.07489  69.06043  64.73129  72.89908
> colSums(tmp5)
 [1] 1092.8666  748.0980  693.0876        NA  688.2720  705.4398  668.6197
 [8]  702.4919  733.1246  684.6329  672.7640  730.7194  676.6898  752.3555
[15]  709.7945  763.4472  690.7489  690.6043  647.3129  728.9908
> colVars(tmp5)
 [1] 15721.05215    66.71857   120.58971          NA    80.45878    66.85224
 [7]    70.34863    43.32134    67.99185    56.20549    57.92928   104.36291
[13]   135.75781    39.48890    67.06336   123.61829    85.47446    36.19837
[19]    42.02490    37.00825
> colSd(tmp5)
 [1] 125.383620   8.168143  10.981335         NA   8.969882   8.176322
 [7]   8.387409   6.581895   8.245717   7.497032   7.611129  10.215817
[13]  11.651516   6.284020   8.189222  11.118376   9.245240   6.016508
[19]   6.482662   6.083440
> colMax(tmp5)
 [1] 465.62737  88.16616  96.16555        NA  80.74117  83.02216  87.00778
 [8]  79.45047  92.08420  78.70416  76.15428  88.81407  92.05333  83.18100
[15]  84.22095  90.53765  80.73065  75.54734  76.82315  82.98368
> colMin(tmp5)
 [1] 60.61251 61.68638 56.49565       NA 55.00388 58.67054 58.38211 58.85681
 [9] 65.08744 58.02812 53.46898 60.68531 55.60742 61.34465 60.44617 55.28311
[17] 53.98149 59.27540 55.51870 64.02142
> 
> Max(tmp5,na.rm=TRUE)
[1] 465.6274
> Min(tmp5,na.rm=TRUE)
[1] 53.46898
> mean(tmp5,na.rm=TRUE)
[1] 72.47926
> Sum(tmp5,na.rm=TRUE)
[1] 14423.37
> Var(tmp5,na.rm=TRUE)
[1] 857.538
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 90.25260 71.29664 71.39278 71.58304 68.30191 68.39233 70.55634 71.37350
 [9] 68.50693 73.09172
> rowSums(tmp5,na.rm=TRUE)
 [1] 1805.052 1425.933 1427.856 1360.078 1366.038 1367.847 1411.127 1427.470
 [9] 1370.139 1461.834
> rowVars(tmp5,na.rm=TRUE)
 [1] 7876.54858   71.54298  115.67576   45.25902   97.95458   95.94403
 [7]   62.09813   79.70675   55.13486   44.79548
> rowSd(tmp5,na.rm=TRUE)
 [1] 88.749922  8.458308 10.755267  6.727483  9.897201  9.795102  7.880237
 [8]  8.927864  7.425285  6.692942
> rowMax(tmp5,na.rm=TRUE)
 [1] 465.62737  87.95760  92.08420  84.13704  92.05333  96.16555  87.01276
 [8]  88.81407  84.15874  84.22095
> rowMin(tmp5,na.rm=TRUE)
 [1] 58.67054 55.51870 53.98149 60.61251 53.46898 55.28311 58.91808 58.02812
 [9] 55.00388 58.38211
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 109.28666  74.80980  69.30876  71.47918  68.82720  70.54398  66.86197
 [8]  70.24919  73.31246  68.46329  67.27640  73.07194  67.66898  75.23555
[15]  70.97945  76.34472  69.07489  69.06043  64.73129  72.89908
> colSums(tmp5,na.rm=TRUE)
 [1] 1092.8666  748.0980  693.0876  643.3126  688.2720  705.4398  668.6197
 [8]  702.4919  733.1246  684.6329  672.7640  730.7194  676.6898  752.3555
[15]  709.7945  763.4472  690.7489  690.6043  647.3129  728.9908
> colVars(tmp5,na.rm=TRUE)
 [1] 15721.05215    66.71857   120.58971    73.24878    80.45878    66.85224
 [7]    70.34863    43.32134    67.99185    56.20549    57.92928   104.36291
[13]   135.75781    39.48890    67.06336   123.61829    85.47446    36.19837
[19]    42.02490    37.00825
> colSd(tmp5,na.rm=TRUE)
 [1] 125.383620   8.168143  10.981335   8.558550   8.969882   8.176322
 [7]   8.387409   6.581895   8.245717   7.497032   7.611129  10.215817
[13]  11.651516   6.284020   8.189222  11.118376   9.245240   6.016508
[19]   6.482662   6.083440
> colMax(tmp5,na.rm=TRUE)
 [1] 465.62737  88.16616  96.16555  79.56553  80.74117  83.02216  87.00778
 [8]  79.45047  92.08420  78.70416  76.15428  88.81407  92.05333  83.18100
[15]  84.22095  90.53765  80.73065  75.54734  76.82315  82.98368
> colMin(tmp5,na.rm=TRUE)
 [1] 60.61251 61.68638 56.49565 55.19556 55.00388 58.67054 58.38211 58.85681
 [9] 65.08744 58.02812 53.46898 60.68531 55.60742 61.34465 60.44617 55.28311
[17] 53.98149 59.27540 55.51870 64.02142
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1] 90.25260 71.29664 71.39278      NaN 68.30191 68.39233 70.55634 71.37350
 [9] 68.50693 73.09172
> rowSums(tmp5,na.rm=TRUE)
 [1] 1805.052 1425.933 1427.856    0.000 1366.038 1367.847 1411.127 1427.470
 [9] 1370.139 1461.834
> rowVars(tmp5,na.rm=TRUE)
 [1] 7876.54858   71.54298  115.67576         NA   97.95458   95.94403
 [7]   62.09813   79.70675   55.13486   44.79548
> rowSd(tmp5,na.rm=TRUE)
 [1] 88.749922  8.458308 10.755267        NA  9.897201  9.795102  7.880237
 [8]  8.927864  7.425285  6.692942
> rowMax(tmp5,na.rm=TRUE)
 [1] 465.62737  87.95760  92.08420        NA  92.05333  96.16555  87.01276
 [8]  88.81407  84.15874  84.22095
> rowMin(tmp5,na.rm=TRUE)
 [1] 58.67054 55.51870 53.98149       NA 53.46898 55.28311 58.91808 58.02812
 [9] 55.00388 58.38211
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1] 114.69490  75.01085  69.37721       NaN  67.61765  71.23426  66.61654
 [8]  70.54253  73.49126  68.27122  66.37071  74.02945  67.77534  74.74194
[15]  69.51749  75.92341  69.08784  68.41090  65.01654  72.26801
> colSums(tmp5,na.rm=TRUE)
 [1] 1032.2541  675.0977  624.3949    0.0000  608.5589  641.1083  599.5488
 [8]  634.8828  661.4214  614.4410  597.3364  666.2650  609.9781  672.6775
[15]  625.6574  683.3107  621.7905  615.6981  585.1489  650.4121
> colVars(tmp5,na.rm=TRUE)
 [1] 17357.13197    74.60366   135.61072          NA    74.05731    69.84833
 [7]    78.46457    47.76845    76.13115    62.81617    55.94227   107.09411
[13]   152.60027    41.68401    51.40153   137.07369    96.15688    35.97691
[19]    46.36261    37.15400
> colSd(tmp5,na.rm=TRUE)
 [1] 131.746469   8.637341  11.645201         NA   8.605655   8.357531
 [7]   8.858023   6.911472   8.725317   7.925665   7.479457  10.348629
[13]  12.353148   6.456316   7.169486  11.707847   9.805961   5.998075
[19]   6.809009   6.095408
> colMax(tmp5,na.rm=TRUE)
 [1] 465.62737  88.16616  96.16555      -Inf  80.74117  83.02216  87.00778
 [8]  79.45047  92.08420  78.70416  76.15428  88.81407  92.05333  83.18100
[15]  84.22095  90.53765  80.73065  75.54734  76.82315  82.98368
> colMin(tmp5,na.rm=TRUE)
 [1] 63.28194 61.68638 56.49565      Inf 55.00388 58.67054 58.38211 58.85681
 [9] 65.08744 58.02812 53.46898 60.68531 55.60742 61.34465 60.44617 55.28311
[17] 53.98149 59.27540 55.51870 64.02142
> 
> 
> 
> 
> 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] 264.9861 385.5576 166.9294 296.0265 300.6768 353.9893 130.0158 105.1843
 [9] 190.1504 131.6403
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 264.9861 385.5576 166.9294 296.0265 300.6768 353.9893 130.0158 105.1843
 [9] 190.1504 131.6403
> 
> 
> 
> copymatrix <- matrix(rnorm(200,150,15),10,20)
> 
> tmp5[1:10,1:20] <- copymatrix
> which.row <- 1
> which.col  <- 3
> cat(which.row," ",which.col,"\n")
1   3 
> tmp5[which.row,which.col] <- NA
> copymatrix[which.row,which.col] <- NA
> 
> colVars(tmp5,na.rm=TRUE)-apply(copymatrix,2,var,na.rm=TRUE)
 [1]  5.684342e-14  2.842171e-14  5.684342e-14 -5.684342e-14  1.989520e-13
 [6] -2.842171e-13  0.000000e+00  0.000000e+00 -1.421085e-13  1.136868e-13
[11] -5.684342e-14 -5.684342e-14 -1.136868e-13  1.421085e-14 -2.842171e-13
[16]  3.979039e-13 -2.273737e-13  5.684342e-14 -2.842171e-14 -2.557954e-13
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> ## making sure these things agree
> ##
> ## first when there is no NA
> 
> 
> 
> agree.checks <- function(buff.matrix,r.matrix,err.tol=1e-10){
+ 
+   if (Max(buff.matrix,na.rm=TRUE) != max(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Max")
+   }
+   
+ 
+   if (Min(buff.matrix,na.rm=TRUE) != min(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Min")
+   }
+ 
+ 
+   if (abs(Sum(buff.matrix,na.rm=TRUE)- sum(r.matrix,na.rm=TRUE)) > err.tol){
+ 
+     cat(Sum(buff.matrix,na.rm=TRUE),"\n")
+     cat(sum(r.matrix,na.rm=TRUE),"\n")
+     cat(Sum(buff.matrix,na.rm=TRUE) - sum(r.matrix,na.rm=TRUE),"\n")
+     
+     stop("No agreement in Sum")
+   }
+   
+   if (abs(mean(buff.matrix,na.rm=TRUE) - mean(r.matrix,na.rm=TRUE)) > err.tol){
+     stop("No agreement in mean")
+   }
+   
+   
+   if(abs(Var(buff.matrix,na.rm=TRUE) - var(as.vector(r.matrix),na.rm=TRUE)) > err.tol){
+     stop("No agreement in Var")
+   }
+   
+   
+ 
+   if(any(abs(rowMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,mean,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowMeans")
+   }
+   
+   
+   if(any(abs(colMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,mean,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colMeans")
+   }
+   
+   
+   if(any(abs(rowSums(buff.matrix,na.rm=TRUE)  -  apply(r.matrix,1,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in rowSums")
+   }
+   
+   
+   if(any(abs(colSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colSums")
+   }
+   
+   ### this is to get around the fact that R doesn't like to compute NA on an entire vector of NA when 
+   ### computing variance
+   my.Var <- function(x,na.rm=FALSE){
+    if (all(is.na(x))){
+      return(NA)
+    } else {
+      var(x,na.rm=na.rm)
+    }
+ 
+   }
+   
+   if(any(abs(rowVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+   
+   
+   if(any(abs(colVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+ 
+ 
+   if(any(abs(rowMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+ 
+   if(any(abs(colMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+   
+   
+   if(any(abs(rowMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+   
+ 
+   if(any(abs(colMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+ 
+   if(any(abs(colMedians(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,median,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMedian")
+   }
+ 
+   if(any(abs(colRanges(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,range,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colRanges")
+   }
+ 
+ 
+   
+ }
> 
> 
> 
> 
> 
> 
> 
> 
> 
> for (rep in 1:20){
+   copymatrix <- matrix(rnorm(200,150,15),10,20)
+   
+   tmp5[1:10,1:20] <- copymatrix
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ## now lets assign some NA values and check agreement
+ 
+   which.row <- sample(1:10,1,replace=TRUE)
+   which.col  <- sample(1:20,1,replace=TRUE)
+   
+   cat(which.row," ",which.col,"\n")
+   
+   tmp5[which.row,which.col] <- NA
+   copymatrix[which.row,which.col] <- NA
+   
+   agree.checks(tmp5,copymatrix)
+ 
+   ## make an entire row NA
+   tmp5[which.row,] <- NA
+   copymatrix[which.row,] <- NA
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ### also make an entire col NA
+   tmp5[,which.col] <- NA
+   copymatrix[,which.col] <- NA
+ 
+   agree.checks(tmp5,copymatrix)
+ 
+   ### now make 1 element non NA with NA in the rest of row and column
+ 
+   tmp5[which.row,which.col] <- rnorm(1,150,15)
+   copymatrix[which.row,which.col] <- tmp5[which.row,which.col]
+ 
+   agree.checks(tmp5,copymatrix)
+ }
10   8 
1   15 
1   13 
4   3 
6   6 
7   2 
6   20 
8   4 
10   5 
6   12 
1   12 
9   8 
2   16 
5   18 
3   3 
5   3 
9   14 
2   15 
4   18 
3   9 
There were 50 or more warnings (use warnings() to see the first 50)
> 
> 
> ### now test 1 by n and n by 1 matrix
> 
> 
> err.tol <- 1e-12
> 
> rm(tmp5)
> 
> dataset1 <- rnorm(100)
> dataset2 <- rnorm(100)
> 
> tmp <- createBufferedMatrix(1,100)
> tmp[1,] <- dataset1
> 
> tmp2 <- createBufferedMatrix(100,1)
> tmp2[,1] <- dataset2
> 
> 
> 
> 
> 
> Max(tmp)
[1] 2.163112
> Min(tmp)
[1] -2.018632
> mean(tmp)
[1] 0.04138925
> Sum(tmp)
[1] 4.138925
> Var(tmp)
[1] 0.9099395
> 
> rowMeans(tmp)
[1] 0.04138925
> rowSums(tmp)
[1] 4.138925
> rowVars(tmp)
[1] 0.9099395
> rowSd(tmp)
[1] 0.9539075
> rowMax(tmp)
[1] 2.163112
> rowMin(tmp)
[1] -2.018632
> 
> colMeans(tmp)
  [1]  1.80138775 -1.06942766  1.75308399  0.66956459 -1.03619653 -0.17581495
  [7] -2.01863220 -1.15723087 -1.28234341  0.66383447  1.11807221  1.45691847
 [13]  0.08522978 -0.52704447 -0.44675719 -0.59288124 -0.65657534  0.73197872
 [19] -1.06135818 -0.33788146  0.64598448  1.14649886  0.74867244  1.58072504
 [25] -1.12497130  1.01768197  1.19053672  1.76415724 -1.00157388  0.96038831
 [31] -0.09387238  1.91191691 -0.90469601 -0.63320001  0.79726762  0.17921436
 [37] -1.29607580 -0.19492340 -0.47380742  0.69048883 -0.89368740  0.66214712
 [43]  1.91082318  0.45802207  0.46075605 -0.04332248 -1.03744736  0.24474645
 [49]  0.62470706  0.27879836 -0.89710098  0.27734618 -0.30666316 -0.35199777
 [55] -0.05402520 -1.10232974 -0.73709849 -1.20618424  0.12448219 -0.85829886
 [61] -0.45877751  0.36703388  0.08325627  0.17081780 -0.38110554  0.60137828
 [67]  0.32908468  0.87631571 -0.54737953  0.43634580 -0.70047946  0.24892185
 [73]  1.13942016  1.36426794 -1.62992205  0.34628227 -1.88099874  0.53824358
 [79]  0.95598256 -1.19118741 -0.21032756  0.56321198  1.32670241  0.59290934
 [85] -1.33359091 -0.41481183  1.20019987  2.16311229  0.90208316  0.51172951
 [91]  0.38993905 -0.42950918 -1.11527435 -1.10603519 -0.22265455 -0.22168980
 [97]  1.10151666 -0.68770419 -0.30169989 -1.61869470
> colSums(tmp)
  [1]  1.80138775 -1.06942766  1.75308399  0.66956459 -1.03619653 -0.17581495
  [7] -2.01863220 -1.15723087 -1.28234341  0.66383447  1.11807221  1.45691847
 [13]  0.08522978 -0.52704447 -0.44675719 -0.59288124 -0.65657534  0.73197872
 [19] -1.06135818 -0.33788146  0.64598448  1.14649886  0.74867244  1.58072504
 [25] -1.12497130  1.01768197  1.19053672  1.76415724 -1.00157388  0.96038831
 [31] -0.09387238  1.91191691 -0.90469601 -0.63320001  0.79726762  0.17921436
 [37] -1.29607580 -0.19492340 -0.47380742  0.69048883 -0.89368740  0.66214712
 [43]  1.91082318  0.45802207  0.46075605 -0.04332248 -1.03744736  0.24474645
 [49]  0.62470706  0.27879836 -0.89710098  0.27734618 -0.30666316 -0.35199777
 [55] -0.05402520 -1.10232974 -0.73709849 -1.20618424  0.12448219 -0.85829886
 [61] -0.45877751  0.36703388  0.08325627  0.17081780 -0.38110554  0.60137828
 [67]  0.32908468  0.87631571 -0.54737953  0.43634580 -0.70047946  0.24892185
 [73]  1.13942016  1.36426794 -1.62992205  0.34628227 -1.88099874  0.53824358
 [79]  0.95598256 -1.19118741 -0.21032756  0.56321198  1.32670241  0.59290934
 [85] -1.33359091 -0.41481183  1.20019987  2.16311229  0.90208316  0.51172951
 [91]  0.38993905 -0.42950918 -1.11527435 -1.10603519 -0.22265455 -0.22168980
 [97]  1.10151666 -0.68770419 -0.30169989 -1.61869470
> colVars(tmp)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> colSd(tmp)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> colMax(tmp)
  [1]  1.80138775 -1.06942766  1.75308399  0.66956459 -1.03619653 -0.17581495
  [7] -2.01863220 -1.15723087 -1.28234341  0.66383447  1.11807221  1.45691847
 [13]  0.08522978 -0.52704447 -0.44675719 -0.59288124 -0.65657534  0.73197872
 [19] -1.06135818 -0.33788146  0.64598448  1.14649886  0.74867244  1.58072504
 [25] -1.12497130  1.01768197  1.19053672  1.76415724 -1.00157388  0.96038831
 [31] -0.09387238  1.91191691 -0.90469601 -0.63320001  0.79726762  0.17921436
 [37] -1.29607580 -0.19492340 -0.47380742  0.69048883 -0.89368740  0.66214712
 [43]  1.91082318  0.45802207  0.46075605 -0.04332248 -1.03744736  0.24474645
 [49]  0.62470706  0.27879836 -0.89710098  0.27734618 -0.30666316 -0.35199777
 [55] -0.05402520 -1.10232974 -0.73709849 -1.20618424  0.12448219 -0.85829886
 [61] -0.45877751  0.36703388  0.08325627  0.17081780 -0.38110554  0.60137828
 [67]  0.32908468  0.87631571 -0.54737953  0.43634580 -0.70047946  0.24892185
 [73]  1.13942016  1.36426794 -1.62992205  0.34628227 -1.88099874  0.53824358
 [79]  0.95598256 -1.19118741 -0.21032756  0.56321198  1.32670241  0.59290934
 [85] -1.33359091 -0.41481183  1.20019987  2.16311229  0.90208316  0.51172951
 [91]  0.38993905 -0.42950918 -1.11527435 -1.10603519 -0.22265455 -0.22168980
 [97]  1.10151666 -0.68770419 -0.30169989 -1.61869470
> colMin(tmp)
  [1]  1.80138775 -1.06942766  1.75308399  0.66956459 -1.03619653 -0.17581495
  [7] -2.01863220 -1.15723087 -1.28234341  0.66383447  1.11807221  1.45691847
 [13]  0.08522978 -0.52704447 -0.44675719 -0.59288124 -0.65657534  0.73197872
 [19] -1.06135818 -0.33788146  0.64598448  1.14649886  0.74867244  1.58072504
 [25] -1.12497130  1.01768197  1.19053672  1.76415724 -1.00157388  0.96038831
 [31] -0.09387238  1.91191691 -0.90469601 -0.63320001  0.79726762  0.17921436
 [37] -1.29607580 -0.19492340 -0.47380742  0.69048883 -0.89368740  0.66214712
 [43]  1.91082318  0.45802207  0.46075605 -0.04332248 -1.03744736  0.24474645
 [49]  0.62470706  0.27879836 -0.89710098  0.27734618 -0.30666316 -0.35199777
 [55] -0.05402520 -1.10232974 -0.73709849 -1.20618424  0.12448219 -0.85829886
 [61] -0.45877751  0.36703388  0.08325627  0.17081780 -0.38110554  0.60137828
 [67]  0.32908468  0.87631571 -0.54737953  0.43634580 -0.70047946  0.24892185
 [73]  1.13942016  1.36426794 -1.62992205  0.34628227 -1.88099874  0.53824358
 [79]  0.95598256 -1.19118741 -0.21032756  0.56321198  1.32670241  0.59290934
 [85] -1.33359091 -0.41481183  1.20019987  2.16311229  0.90208316  0.51172951
 [91]  0.38993905 -0.42950918 -1.11527435 -1.10603519 -0.22265455 -0.22168980
 [97]  1.10151666 -0.68770419 -0.30169989 -1.61869470
> colMedians(tmp)
  [1]  1.80138775 -1.06942766  1.75308399  0.66956459 -1.03619653 -0.17581495
  [7] -2.01863220 -1.15723087 -1.28234341  0.66383447  1.11807221  1.45691847
 [13]  0.08522978 -0.52704447 -0.44675719 -0.59288124 -0.65657534  0.73197872
 [19] -1.06135818 -0.33788146  0.64598448  1.14649886  0.74867244  1.58072504
 [25] -1.12497130  1.01768197  1.19053672  1.76415724 -1.00157388  0.96038831
 [31] -0.09387238  1.91191691 -0.90469601 -0.63320001  0.79726762  0.17921436
 [37] -1.29607580 -0.19492340 -0.47380742  0.69048883 -0.89368740  0.66214712
 [43]  1.91082318  0.45802207  0.46075605 -0.04332248 -1.03744736  0.24474645
 [49]  0.62470706  0.27879836 -0.89710098  0.27734618 -0.30666316 -0.35199777
 [55] -0.05402520 -1.10232974 -0.73709849 -1.20618424  0.12448219 -0.85829886
 [61] -0.45877751  0.36703388  0.08325627  0.17081780 -0.38110554  0.60137828
 [67]  0.32908468  0.87631571 -0.54737953  0.43634580 -0.70047946  0.24892185
 [73]  1.13942016  1.36426794 -1.62992205  0.34628227 -1.88099874  0.53824358
 [79]  0.95598256 -1.19118741 -0.21032756  0.56321198  1.32670241  0.59290934
 [85] -1.33359091 -0.41481183  1.20019987  2.16311229  0.90208316  0.51172951
 [91]  0.38993905 -0.42950918 -1.11527435 -1.10603519 -0.22265455 -0.22168980
 [97]  1.10151666 -0.68770419 -0.30169989 -1.61869470
> colRanges(tmp)
         [,1]      [,2]     [,3]      [,4]      [,5]      [,6]      [,7]
[1,] 1.801388 -1.069428 1.753084 0.6695646 -1.036197 -0.175815 -2.018632
[2,] 1.801388 -1.069428 1.753084 0.6695646 -1.036197 -0.175815 -2.018632
          [,8]      [,9]     [,10]    [,11]    [,12]      [,13]      [,14]
[1,] -1.157231 -1.282343 0.6638345 1.118072 1.456918 0.08522978 -0.5270445
[2,] -1.157231 -1.282343 0.6638345 1.118072 1.456918 0.08522978 -0.5270445
          [,15]      [,16]      [,17]     [,18]     [,19]      [,20]     [,21]
[1,] -0.4467572 -0.5928812 -0.6565753 0.7319787 -1.061358 -0.3378815 0.6459845
[2,] -0.4467572 -0.5928812 -0.6565753 0.7319787 -1.061358 -0.3378815 0.6459845
        [,22]     [,23]    [,24]     [,25]    [,26]    [,27]    [,28]     [,29]
[1,] 1.146499 0.7486724 1.580725 -1.124971 1.017682 1.190537 1.764157 -1.001574
[2,] 1.146499 0.7486724 1.580725 -1.124971 1.017682 1.190537 1.764157 -1.001574
         [,30]       [,31]    [,32]     [,33]   [,34]     [,35]     [,36]
[1,] 0.9603883 -0.09387238 1.911917 -0.904696 -0.6332 0.7972676 0.1792144
[2,] 0.9603883 -0.09387238 1.911917 -0.904696 -0.6332 0.7972676 0.1792144
         [,37]      [,38]      [,39]     [,40]      [,41]     [,42]    [,43]
[1,] -1.296076 -0.1949234 -0.4738074 0.6904888 -0.8936874 0.6621471 1.910823
[2,] -1.296076 -0.1949234 -0.4738074 0.6904888 -0.8936874 0.6621471 1.910823
         [,44]    [,45]       [,46]     [,47]     [,48]     [,49]     [,50]
[1,] 0.4580221 0.460756 -0.04332248 -1.037447 0.2447465 0.6247071 0.2787984
[2,] 0.4580221 0.460756 -0.04332248 -1.037447 0.2447465 0.6247071 0.2787984
         [,51]     [,52]      [,53]      [,54]      [,55]    [,56]      [,57]
[1,] -0.897101 0.2773462 -0.3066632 -0.3519978 -0.0540252 -1.10233 -0.7370985
[2,] -0.897101 0.2773462 -0.3066632 -0.3519978 -0.0540252 -1.10233 -0.7370985
         [,58]     [,59]      [,60]      [,61]     [,62]      [,63]     [,64]
[1,] -1.206184 0.1244822 -0.8582989 -0.4587775 0.3670339 0.08325627 0.1708178
[2,] -1.206184 0.1244822 -0.8582989 -0.4587775 0.3670339 0.08325627 0.1708178
          [,65]     [,66]     [,67]     [,68]      [,69]     [,70]      [,71]
[1,] -0.3811055 0.6013783 0.3290847 0.8763157 -0.5473795 0.4363458 -0.7004795
[2,] -0.3811055 0.6013783 0.3290847 0.8763157 -0.5473795 0.4363458 -0.7004795
         [,72]   [,73]    [,74]     [,75]     [,76]     [,77]     [,78]
[1,] 0.2489219 1.13942 1.364268 -1.629922 0.3462823 -1.880999 0.5382436
[2,] 0.2489219 1.13942 1.364268 -1.629922 0.3462823 -1.880999 0.5382436
         [,79]     [,80]      [,81]    [,82]    [,83]     [,84]     [,85]
[1,] 0.9559826 -1.191187 -0.2103276 0.563212 1.326702 0.5929093 -1.333591
[2,] 0.9559826 -1.191187 -0.2103276 0.563212 1.326702 0.5929093 -1.333591
          [,86]  [,87]    [,88]     [,89]     [,90]    [,91]      [,92]
[1,] -0.4148118 1.2002 2.163112 0.9020832 0.5117295 0.389939 -0.4295092
[2,] -0.4148118 1.2002 2.163112 0.9020832 0.5117295 0.389939 -0.4295092
         [,93]     [,94]      [,95]      [,96]    [,97]      [,98]      [,99]
[1,] -1.115274 -1.106035 -0.2226545 -0.2216898 1.101517 -0.6877042 -0.3016999
[2,] -1.115274 -1.106035 -0.2226545 -0.2216898 1.101517 -0.6877042 -0.3016999
        [,100]
[1,] -1.618695
[2,] -1.618695
> 
> 
> Max(tmp2)
[1] 1.959548
> Min(tmp2)
[1] -3.399929
> mean(tmp2)
[1] -0.1218033
> Sum(tmp2)
[1] -12.18033
> Var(tmp2)
[1] 0.8037628
> 
> rowMeans(tmp2)
  [1]  1.316016416  1.338948835 -0.789518007 -0.418161627 -0.029045330
  [6] -0.389379556 -0.382320945 -0.947345554  0.895885386 -1.967697238
 [11]  0.197561941 -0.629535663  0.293800419 -0.971255629 -0.729850655
 [16]  0.012597757  1.173595640  0.588709355  0.310246534  0.359102641
 [21] -0.230295234  1.759590148 -0.106063100  0.095582053  1.372068152
 [26] -1.893568676  0.361663646 -0.513036260  0.194412439  0.367010792
 [31] -0.907011625  0.310272496  1.438889973  0.667573872 -0.535790743
 [36] -0.086063126 -0.375296371  0.182467355  0.632450496 -0.235668960
 [41] -0.768139649 -0.027495301  0.330629327 -0.217467037 -0.629970076
 [46] -0.689805193 -0.432512949 -0.839674579  1.244045973 -0.885817367
 [51]  0.398466361 -0.602732555  1.391471713 -1.104997020  0.659293203
 [56] -0.575431884 -0.033791531 -1.534497294 -0.129945872  1.805908387
 [61]  0.567282752 -0.609724702  0.730390278 -1.041796821 -0.006770743
 [66] -0.895085882  1.033818897  0.547429245 -0.423796055  0.646289660
 [71] -0.965046198  0.339804446 -0.881311419 -0.442193992 -0.663514595
 [76] -1.414864824 -1.625821079 -1.200478347 -3.399929192 -0.062784964
 [81] -1.387199944  0.497152603  1.459217432  1.959548343 -0.220827358
 [86] -0.811004788 -0.168085918 -0.264478858 -0.274629042 -0.618257042
 [91] -0.679233802 -0.026258414 -0.615538742 -1.252962889  0.546414478
 [96]  0.434669447  0.298348744  0.555645625 -0.237534565 -0.696290932
> rowSums(tmp2)
  [1]  1.316016416  1.338948835 -0.789518007 -0.418161627 -0.029045330
  [6] -0.389379556 -0.382320945 -0.947345554  0.895885386 -1.967697238
 [11]  0.197561941 -0.629535663  0.293800419 -0.971255629 -0.729850655
 [16]  0.012597757  1.173595640  0.588709355  0.310246534  0.359102641
 [21] -0.230295234  1.759590148 -0.106063100  0.095582053  1.372068152
 [26] -1.893568676  0.361663646 -0.513036260  0.194412439  0.367010792
 [31] -0.907011625  0.310272496  1.438889973  0.667573872 -0.535790743
 [36] -0.086063126 -0.375296371  0.182467355  0.632450496 -0.235668960
 [41] -0.768139649 -0.027495301  0.330629327 -0.217467037 -0.629970076
 [46] -0.689805193 -0.432512949 -0.839674579  1.244045973 -0.885817367
 [51]  0.398466361 -0.602732555  1.391471713 -1.104997020  0.659293203
 [56] -0.575431884 -0.033791531 -1.534497294 -0.129945872  1.805908387
 [61]  0.567282752 -0.609724702  0.730390278 -1.041796821 -0.006770743
 [66] -0.895085882  1.033818897  0.547429245 -0.423796055  0.646289660
 [71] -0.965046198  0.339804446 -0.881311419 -0.442193992 -0.663514595
 [76] -1.414864824 -1.625821079 -1.200478347 -3.399929192 -0.062784964
 [81] -1.387199944  0.497152603  1.459217432  1.959548343 -0.220827358
 [86] -0.811004788 -0.168085918 -0.264478858 -0.274629042 -0.618257042
 [91] -0.679233802 -0.026258414 -0.615538742 -1.252962889  0.546414478
 [96]  0.434669447  0.298348744  0.555645625 -0.237534565 -0.696290932
> rowVars(tmp2)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowSd(tmp2)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowMax(tmp2)
  [1]  1.316016416  1.338948835 -0.789518007 -0.418161627 -0.029045330
  [6] -0.389379556 -0.382320945 -0.947345554  0.895885386 -1.967697238
 [11]  0.197561941 -0.629535663  0.293800419 -0.971255629 -0.729850655
 [16]  0.012597757  1.173595640  0.588709355  0.310246534  0.359102641
 [21] -0.230295234  1.759590148 -0.106063100  0.095582053  1.372068152
 [26] -1.893568676  0.361663646 -0.513036260  0.194412439  0.367010792
 [31] -0.907011625  0.310272496  1.438889973  0.667573872 -0.535790743
 [36] -0.086063126 -0.375296371  0.182467355  0.632450496 -0.235668960
 [41] -0.768139649 -0.027495301  0.330629327 -0.217467037 -0.629970076
 [46] -0.689805193 -0.432512949 -0.839674579  1.244045973 -0.885817367
 [51]  0.398466361 -0.602732555  1.391471713 -1.104997020  0.659293203
 [56] -0.575431884 -0.033791531 -1.534497294 -0.129945872  1.805908387
 [61]  0.567282752 -0.609724702  0.730390278 -1.041796821 -0.006770743
 [66] -0.895085882  1.033818897  0.547429245 -0.423796055  0.646289660
 [71] -0.965046198  0.339804446 -0.881311419 -0.442193992 -0.663514595
 [76] -1.414864824 -1.625821079 -1.200478347 -3.399929192 -0.062784964
 [81] -1.387199944  0.497152603  1.459217432  1.959548343 -0.220827358
 [86] -0.811004788 -0.168085918 -0.264478858 -0.274629042 -0.618257042
 [91] -0.679233802 -0.026258414 -0.615538742 -1.252962889  0.546414478
 [96]  0.434669447  0.298348744  0.555645625 -0.237534565 -0.696290932
> rowMin(tmp2)
  [1]  1.316016416  1.338948835 -0.789518007 -0.418161627 -0.029045330
  [6] -0.389379556 -0.382320945 -0.947345554  0.895885386 -1.967697238
 [11]  0.197561941 -0.629535663  0.293800419 -0.971255629 -0.729850655
 [16]  0.012597757  1.173595640  0.588709355  0.310246534  0.359102641
 [21] -0.230295234  1.759590148 -0.106063100  0.095582053  1.372068152
 [26] -1.893568676  0.361663646 -0.513036260  0.194412439  0.367010792
 [31] -0.907011625  0.310272496  1.438889973  0.667573872 -0.535790743
 [36] -0.086063126 -0.375296371  0.182467355  0.632450496 -0.235668960
 [41] -0.768139649 -0.027495301  0.330629327 -0.217467037 -0.629970076
 [46] -0.689805193 -0.432512949 -0.839674579  1.244045973 -0.885817367
 [51]  0.398466361 -0.602732555  1.391471713 -1.104997020  0.659293203
 [56] -0.575431884 -0.033791531 -1.534497294 -0.129945872  1.805908387
 [61]  0.567282752 -0.609724702  0.730390278 -1.041796821 -0.006770743
 [66] -0.895085882  1.033818897  0.547429245 -0.423796055  0.646289660
 [71] -0.965046198  0.339804446 -0.881311419 -0.442193992 -0.663514595
 [76] -1.414864824 -1.625821079 -1.200478347 -3.399929192 -0.062784964
 [81] -1.387199944  0.497152603  1.459217432  1.959548343 -0.220827358
 [86] -0.811004788 -0.168085918 -0.264478858 -0.274629042 -0.618257042
 [91] -0.679233802 -0.026258414 -0.615538742 -1.252962889  0.546414478
 [96]  0.434669447  0.298348744  0.555645625 -0.237534565 -0.696290932
> 
> colMeans(tmp2)
[1] -0.1218033
> colSums(tmp2)
[1] -12.18033
> colVars(tmp2)
[1] 0.8037628
> colSd(tmp2)
[1] 0.8965282
> colMax(tmp2)
[1] 1.959548
> colMin(tmp2)
[1] -3.399929
> colMedians(tmp2)
[1] -0.1927765
> colRanges(tmp2)
          [,1]
[1,] -3.399929
[2,]  1.959548
> 
> 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] -4.7371581  0.5606035 -0.8073554 -0.2473219 -2.5124981 -0.5170813
 [7] -0.3001659 -2.8068671  0.6746141 -0.5826182
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -2.3968898
[2,] -1.5980188
[3,] -0.2909721
[4,]  0.3314397
[5,]  1.8960722
> 
> rowApply(tmp,sum)
 [1] -1.7951453 -1.5327923 -3.3042721 -3.0333563 -3.0737168 -1.8053761
 [7] -0.3861554 -0.2483923  3.7712590  0.1320992
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    3    1    1   10    2    1    8    8    6     7
 [2,]    8    6    5    5    7    5    6    3    8     8
 [3,]    6    8    4    2    9    9    2    1    9     9
 [4,]   10    7    9    1    8    4    3    7    2     1
 [5,]    1    4    7    3    3    7    7    9    5     4
 [6,]    2   10    8    4    5    6    9    5    3     6
 [7,]    5    3    6    7   10    8    5    2    4     2
 [8,]    9    9    3    9    4   10    1    6    1     3
 [9,]    7    2    2    8    1    3   10   10    7    10
[10,]    4    5   10    6    6    2    4    4   10     5
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1] -0.81431529  1.91905053 -0.86798847  0.56683927  0.02584164 -1.00710082
 [7]  5.36613356 -3.42653485  4.83091580 -1.41063769  1.52047625  1.40715617
[13] -2.14487772  0.86848502  0.02401770  1.37908538 -0.49822514 -0.20085538
[19] -0.25803461 -1.36569187
> colApply(tmp,quantile)[,1]
            [,1]
[1,] -2.35483356
[2,] -0.05821742
[3,]  0.23285628
[4,]  0.41645154
[5,]  0.94942788
> 
> rowApply(tmp,sum)
[1] -2.138772 -2.931053  1.750320  6.291093  2.942153
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]   12   10   11    1   16
[2,]   11   16    8   15   13
[3,]   14   20    2    3    4
[4,]    6   15    4   14   14
[5,]    2    2    6   16   18
> 
> 
> as.matrix(tmp)
            [,1]        [,2]       [,3]       [,4]       [,5]        [,6]
[1,]  0.23285628  0.03700308  0.4530493 -0.8293536 -1.4559764 -2.52168326
[2,] -0.05821742  0.34993899  1.4920261  0.2985175 -1.5167075  1.23366628
[3,]  0.41645154 -0.22111301 -1.0578342 -0.6355389 -0.4937573 -0.95262772
[4,] -2.35483356  1.18435199 -0.5892652  1.0731244  1.4268750  0.02660481
[5,]  0.94942788  0.56886947 -1.1659645  0.6600899  2.0654079  1.20693908
            [,7]        [,8]      [,9]      [,10]      [,11]       [,12]
[1,] -0.84458533 -0.02524778 0.7176200 -1.2528523 -0.9004345 -0.31543527
[2,]  0.07191868 -0.53076540 0.1451703 -0.6937699  0.5994503 -0.31703507
[3,]  0.87143390 -1.81345464 0.9950658  0.2092086  0.9853122  0.09344294
[4,]  2.12812774 -0.36423856 2.1618805  0.7708385  1.5929766 -0.21884574
[5,]  3.13923857 -0.69282848 0.8111791 -0.4440627 -0.7568284  2.16502930
          [,13]      [,14]       [,15]      [,16]      [,17]      [,18]
[1,]  0.4987274  0.3438763 -0.34388229  1.5418823  0.9531222 -0.6017875
[2,] -2.5189094  0.4872170  0.23693879 -0.7687439 -0.4491715 -0.4175691
[3,]  0.8695881  0.7775109  0.58189326  0.5262038  0.7610999  0.8994485
[4,]  0.2021057 -0.2148207 -0.52140960  1.5266856  0.2158478 -0.2807659
[5,] -1.1963896 -0.5252985  0.07047754 -1.4469425 -1.9791235  0.1998186
          [,19]       [,20]
[1,]  1.2796034  0.89472560
[2,] -0.5528179 -0.02219018
[3,] -0.4789522 -0.58306208
[4,] -0.3403791 -1.13376765
[5,] -0.1654889 -0.52139756
> 
> 
> 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.3898071 -0.4923903 0.2976254 0.5804758 0.3419537 0.4318185 1.641888
          col8       col9    col10      col11     col12      col13     col14
row1 0.1974672 -0.3509348 0.149834 -0.7297404 0.7055282 -0.6140049 0.7548232
          col15     col16     col17     col18      col19    col20
row1 -0.9542873 -1.898712 0.9905841 -1.368199 0.03755244 1.496803
> tmp[,"col10"]
          col10
row1  0.1498340
row2 -0.4819209
row3  0.4889822
row4  1.4321917
row5  1.0184534
> tmp[c("row1","row5"),]
           col1       col2        col3       col4      col5       col6
row1  0.3898071 -0.4923903  0.29762543  0.5804758 0.3419537  0.4318185
row5 -0.3490380 -0.5707083 -0.05299974 -0.0518994 1.2178448 -0.4487051
          col7      col8       col9    col10       col11      col12      col13
row1  1.641888 0.1974672 -0.3509348 0.149834 -0.72974040  0.7055282 -0.6140049
row5 -0.382546 0.9458736  0.3381328 1.018453  0.08517635 -0.3407413  1.9672081
         col14      col15      col16      col17      col18      col19
row1 0.7548232 -0.9542873 -1.8987123  0.9905841 -1.3681986 0.03755244
row5 0.8566124 -2.2166519  0.2294728 -1.6967650  0.1545182 0.62007942
          col20
row1  1.4968031
row5 -0.3824135
> tmp[,c("col6","col20")]
           col6      col20
row1  0.4318185  1.4968031
row2  0.4508665 -0.3406970
row3 -0.3063594 -1.3345210
row4  1.7835044  0.2822501
row5 -0.4487051 -0.3824135
> tmp[c("row1","row5"),c("col6","col20")]
           col6      col20
row1  0.4318185  1.4968031
row5 -0.4487051 -0.3824135
> 
> 
> 
> 
> tmp["row1",] <- rnorm(20,mean=10)
> tmp[,"col10"] <- rnorm(5,mean=30)
> tmp[c("row1","row5"),] <- rnorm(40,mean=50)
> tmp[,c("col6","col20")] <- rnorm(10,mean=75)
> tmp[c("row1","row5"),c("col6","col20")]  <- rnorm(4,mean=105)
> 
> tmp["row1",]
         col1     col2    col3    col4     col5     col6     col7     col8
row1 49.49217 48.86397 48.8132 50.8529 48.96841 104.1485 51.31098 49.86407
         col9    col10    col11   col12    col13    col14    col15    col16
row1 50.02072 49.41287 50.91863 50.4176 48.70435 50.13292 50.46801 49.85392
       col17    col18    col19    col20
row1 49.2527 48.38067 51.80335 105.4501
> tmp[,"col10"]
        col10
row1 49.41287
row2 29.91398
row3 29.37871
row4 28.99228
row5 48.65878
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 49.49217 48.86397 48.81320 50.85290 48.96841 104.1485 51.31098 49.86407
row5 50.58422 50.04104 50.40081 48.81693 49.04112 105.7547 49.65236 50.02727
         col9    col10    col11    col12    col13    col14    col15    col16
row1 50.02072 49.41287 50.91863 50.41760 48.70435 50.13292 50.46801 49.85392
row5 49.05711 48.65878 49.51156 49.05868 50.15005 50.32191 49.50625 49.29806
        col17    col18    col19    col20
row1 49.25270 48.38067 51.80335 105.4501
row5 51.80399 48.78340 51.63143 106.1678
> tmp[,c("col6","col20")]
          col6     col20
row1 104.14847 105.45008
row2  75.97192  73.69479
row3  73.92393  73.44810
row4  74.43198  75.35591
row5 105.75470 106.16777
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 104.1485 105.4501
row5 105.7547 106.1678
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 104.1485 105.4501
row5 105.7547 106.1678
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
          col13
[1,] -0.7167915
[2,] -0.9175373
[3,]  0.1515561
[4,] -0.3241560
[5,] -1.1207396
> tmp[,c("col17","col7")]
          col17       col7
[1,]  0.4145229 -0.6861469
[2,]  1.0926116  0.6333241
[3,]  0.8599172 -0.7439911
[4,] -0.2470070  1.6974346
[5,] -0.7125204  1.3133651
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
           col6      col20
[1,] -0.2991593  0.9396108
[2,]  0.6298317 -0.1497850
[3,]  0.5958273  0.2267793
[4,] -0.3413718 -0.3048650
[5,]  0.3569059 -0.5720358
> subBufferedMatrix(tmp,1,c("col6"))[,1]
           col1
[1,] -0.2991593
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
           col6
[1,] -0.2991593
[2,]  0.6298317
> 
> 
> 
> 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 -1.535127 -0.80928753  0.5071230  0.2182529  1.23317617  0.1785814
row1 -0.442251  0.09692426 -0.4073697 -1.0280672 -0.03800219 -0.3422375
            [,7]       [,8]       [,9]     [,10]     [,11]      [,12]
row3 -0.09915518  0.6801458  0.1928565 -1.727412 1.1248235 -0.2324901
row1  0.19021883 -1.1033526 -0.9285662 -1.097524 0.3369994 -2.4322215
          [,13]      [,14]     [,15]       [,16]      [,17]      [,18]
row3 -2.3480254 -1.1910376 0.1837135 -0.02517115 -0.1402788 -1.2826151
row1  0.4120368 -0.1714478 0.9458616 -0.24702001 -0.3392852  0.6765018
          [,19]      [,20]
row3 -1.9017314  0.5147448
row1  0.1551852 -0.7341476
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
           [,1]         [,2]       [,3]       [,4]     [,5]      [,6]      [,7]
row2 -0.4530298 -0.004054083 -0.8656239 -0.7078592 1.269353 0.2924577 0.4029767
           [,8]      [,9]     [,10]
row2 -0.7221859 0.1536933 0.6127935
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
          [,1]      [,2]       [,3]       [,4]       [,5]      [,6]       [,7]
row5 0.4288769 -2.613915 -0.1927355 -0.9104414 -0.8978013 -0.378424 -0.4039386
           [,8]      [,9]    [,10]    [,11]      [,12]     [,13]    [,14]
row5 -0.2151574 -1.915986 0.227061 1.115466 -0.2637249 0.1498198 1.051753
          [,15]     [,16]   [,17]      [,18]     [,19]     [,20]
row5 -0.5091137 -2.168551 1.41557 0.09996851 0.7033041 -1.405428
> 
> 
> 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: 0x5982beaccca0>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM1f89932ab5a1ee"
 [2] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM1f89934fefe89d"
 [3] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM1f89934155b3e9"
 [4] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM1f8993739fe106"
 [5] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM1f899344d4c753"
 [6] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM1f899321fe7433"
 [7] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM1f899327f0d89d"
 [8] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM1f89931e35f4f8"
 [9] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM1f899374fc412c"
[10] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM1f8993527f54bc"
[11] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM1f8993781c3148"
[12] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM1f89936d0beab1"
[13] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM1f899348caef56"
[14] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM1f899361e67a1e"
[15] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM1f8993b074d67" 
> 
> 
> ### 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: 0x5982bf376220>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x5982bf376220>
Warning message:
In dir.create(new.directory) :
  '/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x5982bf376220>
> rowMedians(tmp)
  [1] -0.0861116975 -0.4141867257  0.0751336488  0.3354978352  0.1134560033
  [6] -0.3032579693  0.0752514469 -0.3521578263  0.3728157441  0.2388341920
 [11]  0.0833480567  0.1471051920 -0.2916464724  0.1634694192  0.2842306815
 [16]  0.4107030750  0.0386872070 -0.0539747828  0.0642098230 -0.2473153751
 [21]  0.1153832950 -0.2045306531  0.2521648511  0.2707757472 -0.2600145069
 [26] -0.4136320819  0.1797203807 -0.0909801429  0.1336545667 -0.0339533013
 [31]  0.0421577453  0.5416831939 -0.1632328863  0.0925906389 -0.1560543484
 [36]  0.1671857844  0.0067285957  0.0783975799  0.3082238685  0.3489847674
 [41]  0.0006320546  0.3584994748  0.0913377068  0.7037969282 -0.1185518230
 [46]  0.1416632139 -0.1790154580  0.1281541486  0.0972129546 -0.6474329346
 [51] -0.4915688698  0.4201389728 -0.1101238643 -0.3484040833 -0.3039494336
 [56]  0.1989466473  0.3134139311  0.1968304527 -0.4891054005 -0.3365640026
 [61]  0.0305656438 -0.3338746390 -0.2358547244  0.3137403393 -0.0160159906
 [66]  0.5065136345 -0.0187523782 -0.6332345011  0.5339000981  0.4632967466
 [71]  0.0112892205 -0.2534212903 -0.5017210068 -0.1510006622  0.2382191895
 [76] -0.1943140453  0.4114585319  0.2603172889  0.3427418112  0.0911322141
 [81]  0.3648511435  0.2980544601  0.0172794502  0.0911896680  0.2132608510
 [86] -0.0013684163 -0.1061303953 -0.0835177733  0.3844947029  0.1143568793
 [91] -0.1419709670  0.0458476594 -0.4670169279  0.1309023100 -0.1473392872
 [96] -0.2547026244  0.0148095107  0.6606662529  0.0480680424  0.1431435014
[101] -0.6329447746 -0.1052350024 -0.2343397679  0.1289826267  0.3861968468
[106]  0.2217724039 -0.5014145045  0.1056824361  0.2091664701  0.3849287750
[111] -0.0509499481 -0.3743628120 -0.1443633500 -0.4131300651  0.3329474057
[116] -0.0947422249  0.2697783710  0.1189706149  0.0318828363  0.5545861816
[121] -0.3614707835 -0.3516894180  0.0457538275  0.0748208106 -0.2528506528
[126] -0.2909798445 -0.1740250913  0.0513638821  0.3467382052  0.2287980388
[131] -0.1942097894  0.0530466037 -0.1090993436 -0.0195981867 -0.2009660616
[136] -0.0054980935  0.3866978021 -0.0739088130  0.8172463851 -0.2319867561
[141]  0.2114630356  0.2176293093  0.3771570944  0.2717879928 -0.0362387985
[146]  0.0210628724 -0.6252145221  0.2578806491 -0.0647557377  0.4918856106
[151] -0.3846085046  0.7757176689  0.1228243907  0.0434892862 -0.3765176060
[156]  0.2242658227  0.4343953328 -0.1986745070  0.2044182884 -0.0370793927
[161] -0.3050196134 -0.3493408376  0.1300852027 -0.0557273520 -0.1374689623
[166] -0.3071917071 -0.0551386397 -0.1239186688  0.4377585911 -0.0144519417
[171]  0.8068008862 -0.8018572959  0.0632214643 -0.4118957979 -0.2701441507
[176] -0.2406967352 -0.6825596075 -0.2994225590  0.1219678480  0.2679477838
[181] -0.1505003708  0.0103308573  0.3895123749  0.4951271503 -0.3074995778
[186] -0.0238291966  0.1113822020  0.0847157156 -0.2660768117 -0.0151109591
[191]  0.0822014208  0.1308533821  0.6844735022  0.2601644173 -0.3263773514
[196] -0.1335905907 -0.0042303036 -0.6909151586 -0.4430692319  0.1544206701
[201]  0.2208246936  0.4545428233 -0.4235269004  0.4307913979  0.0417534127
[206]  0.0473867165 -0.3243013101 -0.3574641160  0.0632414214  0.5708479114
[211]  0.6421532169  0.2669870961  0.1261892739  0.3218869023  0.3182601281
[216] -0.3637954798  0.2986719871  0.2752068366 -0.1343521405  0.3674134909
[221]  0.4671335891 -0.4565549363  0.0733523487 -0.3187874901 -0.0585513211
[226] -0.4550451581 -0.5011564452  0.1893626462 -0.2636950847  0.1096048993
> 
> proc.time()
   user  system elapsed 
  1.264   0.678   1.930 

BufferedMatrix.Rcheck/tests/rawCalltesting.Rout


R version 4.5.2 (2025-10-31) -- "[Not] Part in a Rumble"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu

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

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

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

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

Attaching package: 'BufferedMatrix'

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

    colMeans, colSums, rowMeans, rowSums

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

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

<pointer: 0x5e9e85fdf370>
> .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: 0x5e9e85fdf370>
> .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: 0x5e9e85fdf370>
> .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: 0x5e9e85fdf370>
> 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: 0x5e9e85fc71c0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5e9e85fc71c0>
> .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: 0x5e9e85fc71c0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5e9e85fc71c0>
> .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: 0x5e9e85fc71c0>
> 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: 0x5e9e862aa120>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5e9e862aa120>
> .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: 0x5e9e862aa120>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x5e9e862aa120>
> .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: 0x5e9e862aa120>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x5e9e862aa120>
> .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: 0x5e9e862aa120>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x5e9e862aa120>
> .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: 0x5e9e862aa120>
> 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: 0x5e9e84ffa390>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x5e9e84ffa390>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5e9e84ffa390>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5e9e84ffa390>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile1f8b05418c91e7" "BufferedMatrixFile1f8b05545f8c81"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile1f8b05418c91e7" "BufferedMatrixFile1f8b05545f8c81"
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x5e9e84ef13d0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5e9e84ef13d0>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x5e9e84ef13d0>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x5e9e84ef13d0>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x5e9e84ef13d0>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x5e9e84ef13d0>
> .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: 0x5e9e86a26fa0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5e9e86a26fa0>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x5e9e86a26fa0>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x5e9e86a26fa0>
> 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: 0x5e9e851feff0>
> .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: 0x5e9e851feff0>
> rm(P)
> 
> proc.time()
   user  system elapsed 
  0.259   0.043   0.291 

BufferedMatrix.Rcheck/tests/Rcodetesting.Rout


R version 4.5.2 (2025-10-31) -- "[Not] Part in a Rumble"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu

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

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

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

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

Attaching package: 'BufferedMatrix'

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

    colMeans, colSums, rowMeans, rowSums

> 
> Temp <- createBufferedMatrix(100)
> dim(Temp)
[1] 100   0
> buffer.dim(Temp)
[1] 1 1
> 
> 
> proc.time()
   user  system elapsed 
  0.250   0.042   0.282 

Example timings