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

This page was generated on 2025-11-05 11:32 -0500 (Wed, 05 Nov 2025).

HostnameOSArch (*)R versionInstalled pkgs
nebbiolo1Linux (Ubuntu 24.04.3 LTS)x86_64R Under development (unstable) (2025-10-20 r88955) -- "Unsuffered Consequences" 4818
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 251/2323HostnameOS / ArchINSTALLBUILDCHECKBUILD BIN
BufferedMatrix 1.75.0  (landing page)
Ben Bolstad
Snapshot Date: 2025-11-04 13:40 -0500 (Tue, 04 Nov 2025)
git_url: https://git.bioconductor.org/packages/BufferedMatrix
git_branch: devel
git_last_commit: ecdbf23
git_last_commit_date: 2025-10-29 09:58:55 -0500 (Wed, 29 Oct 2025)
nebbiolo1Linux (Ubuntu 24.04.3 LTS) / x86_64  OK    OK    OK  UNNEEDED, same version is already published


CHECK results for BufferedMatrix on nebbiolo1

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

raw results


Summary

Package: BufferedMatrix
Version: 1.75.0
Command: /home/biocbuild/bbs-3.23-bioc/R/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/home/biocbuild/bbs-3.23-bioc/R/site-library --timings BufferedMatrix_1.75.0.tar.gz
StartedAt: 2025-11-04 21:30:42 -0500 (Tue, 04 Nov 2025)
EndedAt: 2025-11-04 21:31:07 -0500 (Tue, 04 Nov 2025)
EllapsedTime: 25.0 seconds
RetCode: 0
Status:   OK  
CheckDir: BufferedMatrix.Rcheck
Warnings: 0

Command output

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


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

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


Installation output

BufferedMatrix.Rcheck/00install.out

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


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

Tests output

BufferedMatrix.Rcheck/tests/c_code_level_tests.Rout


R Under development (unstable) (2025-10-20 r88955) -- "Unsuffered Consequences"
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.234   0.062   0.284 

BufferedMatrix.Rcheck/tests/objectTesting.Rout


R Under development (unstable) (2025-10-20 r88955) -- "Unsuffered Consequences"
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.23-bioc/meat/BufferedMatrix.Rcheck/tests"
> prefix(tmp3)
[1] "BM"
> 
> ## testing if we can remove these objects
> rm(tmp, tmp2, tmp3)
> gc()
         used (Mb) gc trigger (Mb) max used (Mb)
Ncells 478818 25.6    1048392   56   639317 34.2
Vcells 885623  6.8    8388608   64  2082728 15.9
> 
> 
> 
> 
> ##
> ## checking reads
> ##
> 
> tmp2 <- createBufferedMatrix(10,20)
> 
> test.sample <- rnorm(10*20)
> 
> tmp2[1:10,1:20] <- test.sample
> 
> test.matrix <- matrix(test.sample,10,20)
> 
> ## testing reads
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   which.col <- sample(1:20,1)
+   if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> date()
[1] "Tue Nov  4 21:30:57 2025"
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> date()
[1] "Tue Nov  4 21:30:57 2025"
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,which.col] == test.matrix[which.row,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> 
> 
> RowMode(tmp2)
<pointer: 0x60e5f07aa5e0>
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   which.col <- sample(1:20,1)
+   if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,5,replace=TRUE)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> date()
[1] "Tue Nov  4 21:30:57 2025"
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col <- sample(1:20,5,replace=TRUE)
+   if (!all(tmp2[which.row,which.col] == test.matrix[which.row,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> date()
[1] "Tue Nov  4 21:30:57 2025"
> 
> ColMode(tmp2)
<pointer: 0x60e5f07aa5e0>
> 
> 
> 
> ### 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,] 101.5697031 -0.27925338  0.7487034  0.004619994
[2,]  -0.9659375 -0.03374995  0.5310231 -1.339036636
[3,]  -1.0008332 -0.67963490 -1.0749717  0.705514448
[4,]  -0.7723975 -0.07815578  0.4376353  0.685691531
> ewApply(tmp5,abs)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
            [,1]       [,2]      [,3]        [,4]
[1,] 101.5697031 0.27925338 0.7487034 0.004619994
[2,]   0.9659375 0.03374995 0.5310231 1.339036636
[3,]   1.0008332 0.67963490 1.0749717 0.705514448
[4,]   0.7723975 0.07815578 0.4376353 0.685691531
> ewApply(tmp5,sqrt)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
           [,1]      [,2]      [,3]       [,4]
[1,] 10.0781796 0.5284443 0.8652765 0.06797054
[2,]  0.9828212 0.1837116 0.7287133 1.15716751
[3,]  1.0004165 0.8243997 1.0368084 0.83994907
[4,]  0.8788615 0.2795635 0.6615401 0.82806493
> 
> my.function <- function(x,power){
+   (x+5)^power
+ }
> 
> ewApply(tmp5,my.function,power=2)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
          [,1]     [,2]     [,3]     [,4]
[1,] 227.35150 30.56370 34.40147 25.68433
[2,]  35.79415 26.87087 32.81816 37.91071
[3,]  36.00500 33.92363 36.44306 34.10501
[4,]  34.56101 27.87379 32.05304 33.96634
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x60e5f0335840>
> exp(tmp5)
<pointer: 0x60e5f0335840>
> log(tmp5,2)
<pointer: 0x60e5f0335840>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 473.2024
> Min(tmp5)
[1] 53.45856
> mean(tmp5)
[1] 72.89204
> Sum(tmp5)
[1] 14578.41
> Var(tmp5)
[1] 877.5618
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 90.09681 72.31393 73.51080 69.18281 70.75161 66.98049 72.76468 69.15089
 [9] 70.63979 73.52859
> rowSums(tmp5)
 [1] 1801.936 1446.279 1470.216 1383.656 1415.032 1339.610 1455.294 1383.018
 [9] 1412.796 1470.572
> rowVars(tmp5)
 [1] 8216.18353   63.88780   46.96335   47.97194   79.83648   45.53856
 [7]   69.32509   52.18725   82.55358   97.91300
> rowSd(tmp5)
 [1] 90.643166  7.992984  6.852981  6.926178  8.935126  6.748226  8.326169
 [8]  7.224074  9.085900  9.895100
> rowMax(tmp5)
 [1] 473.20236  88.08769  87.55190  86.27881  86.18483  79.73367  91.90788
 [8]  83.69894  85.92803  89.10411
> rowMin(tmp5)
 [1] 53.45856 55.92819 60.06682 58.01564 54.22065 54.12369 59.45410 56.07065
 [9] 57.24069 55.68069
> 
> colMeans(tmp5)
 [1] 111.01263  66.44613  70.18830  71.14174  73.73923  66.55385  74.90438
 [8]  71.67798  72.95696  70.69108  73.82782  69.17786  70.70923  67.09845
[15]  74.46309  71.80197  69.22819  72.19874  68.56200  71.46118
> colSums(tmp5)
 [1] 1110.1263  664.4613  701.8830  711.4174  737.3923  665.5385  749.0438
 [8]  716.7798  729.5696  706.9108  738.2782  691.7786  707.0923  670.9845
[15]  744.6309  718.0197  692.2819  721.9874  685.6200  714.6118
> colVars(tmp5)
 [1] 16239.19941    73.83904    52.15426    60.58488    62.77332    80.12492
 [7]    67.59979    69.03701    27.62606    71.91250    70.43789    52.99065
[13]   127.18236    71.84280    48.78537   154.67514    79.86964    84.08043
[19]    55.57392    22.77280
> colSd(tmp5)
 [1] 127.433117   8.592965   7.221791   7.783629   7.922962   8.951252
 [7]   8.221909   8.308852   5.256050   8.480124   8.392728   7.279467
[13]  11.277516   8.476013   6.984653  12.436846   8.936982   9.169538
[19]   7.454792   4.772085
> colMax(tmp5)
 [1] 473.20236  83.17569  84.52247  78.90618  86.27881  82.80536  86.02888
 [8]  85.92803  79.55103  85.28419  89.10411  79.30732  91.90788  79.55607
[15]  86.18483  88.25922  87.55190  88.08769  80.25295  79.73367
> colMin(tmp5)
 [1] 61.40838 55.92819 61.37929 53.45856 64.55185 57.16349 61.27865 57.51223
 [9] 62.93912 57.20714 63.96980 57.39923 56.66763 54.12369 66.03902 54.22065
[17] 56.07065 59.64151 55.68069 65.97676
> 
> 
> ### 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.09681 72.31393 73.51080 69.18281 70.75161 66.98049 72.76468 69.15089
 [9] 70.63979       NA
> rowSums(tmp5)
 [1] 1801.936 1446.279 1470.216 1383.656 1415.032 1339.610 1455.294 1383.018
 [9] 1412.796       NA
> rowVars(tmp5)
 [1] 8216.18353   63.88780   46.96335   47.97194   79.83648   45.53856
 [7]   69.32509   52.18725   82.55358  103.23936
> rowSd(tmp5)
 [1] 90.643166  7.992984  6.852981  6.926178  8.935126  6.748226  8.326169
 [8]  7.224074  9.085900 10.160677
> rowMax(tmp5)
 [1] 473.20236  88.08769  87.55190  86.27881  86.18483  79.73367  91.90788
 [8]  83.69894  85.92803        NA
> rowMin(tmp5)
 [1] 53.45856 55.92819 60.06682 58.01564 54.22065 54.12369 59.45410 56.07065
 [9] 57.24069       NA
> 
> colMeans(tmp5)
 [1] 111.01263  66.44613  70.18830        NA  73.73923  66.55385  74.90438
 [8]  71.67798  72.95696  70.69108  73.82782  69.17786  70.70923  67.09845
[15]  74.46309  71.80197  69.22819  72.19874  68.56200  71.46118
> colSums(tmp5)
 [1] 1110.1263  664.4613  701.8830        NA  737.3923  665.5385  749.0438
 [8]  716.7798  729.5696  706.9108  738.2782  691.7786  707.0923  670.9845
[15]  744.6309  718.0197  692.2819  721.9874  685.6200  714.6118
> colVars(tmp5)
 [1] 16239.19941    73.83904    52.15426          NA    62.77332    80.12492
 [7]    67.59979    69.03701    27.62606    71.91250    70.43789    52.99065
[13]   127.18236    71.84280    48.78537   154.67514    79.86964    84.08043
[19]    55.57392    22.77280
> colSd(tmp5)
 [1] 127.433117   8.592965   7.221791         NA   7.922962   8.951252
 [7]   8.221909   8.308852   5.256050   8.480124   8.392728   7.279467
[13]  11.277516   8.476013   6.984653  12.436846   8.936982   9.169538
[19]   7.454792   4.772085
> colMax(tmp5)
 [1] 473.20236  83.17569  84.52247        NA  86.27881  82.80536  86.02888
 [8]  85.92803  79.55103  85.28419  89.10411  79.30732  91.90788  79.55607
[15]  86.18483  88.25922  87.55190  88.08769  80.25295  79.73367
> colMin(tmp5)
 [1] 61.40838 55.92819 61.37929       NA 64.55185 57.16349 61.27865 57.51223
 [9] 62.93912 57.20714 63.96980 57.39923 56.66763 54.12369 66.03902 54.22065
[17] 56.07065 59.64151 55.68069 65.97676
> 
> Max(tmp5,na.rm=TRUE)
[1] 473.2024
> Min(tmp5,na.rm=TRUE)
[1] 53.45856
> mean(tmp5,na.rm=TRUE)
[1] 72.89583
> Sum(tmp5,na.rm=TRUE)
[1] 14506.27
> Var(tmp5,na.rm=TRUE)
[1] 881.9911
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 90.09681 72.31393 73.51080 69.18281 70.75161 66.98049 72.76468 69.15089
 [9] 70.63979 73.60183
> rowSums(tmp5,na.rm=TRUE)
 [1] 1801.936 1446.279 1470.216 1383.656 1415.032 1339.610 1455.294 1383.018
 [9] 1412.796 1398.435
> rowVars(tmp5,na.rm=TRUE)
 [1] 8216.18353   63.88780   46.96335   47.97194   79.83648   45.53856
 [7]   69.32509   52.18725   82.55358  103.23936
> rowSd(tmp5,na.rm=TRUE)
 [1] 90.643166  7.992984  6.852981  6.926178  8.935126  6.748226  8.326169
 [8]  7.224074  9.085900 10.160677
> rowMax(tmp5,na.rm=TRUE)
 [1] 473.20236  88.08769  87.55190  86.27881  86.18483  79.73367  91.90788
 [8]  83.69894  85.92803  89.10411
> rowMin(tmp5,na.rm=TRUE)
 [1] 53.45856 55.92819 60.06682 58.01564 54.22065 54.12369 59.45410 56.07065
 [9] 57.24069 55.68069
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 111.01263  66.44613  70.18830  71.03116  73.73923  66.55385  74.90438
 [8]  71.67798  72.95696  70.69108  73.82782  69.17786  70.70923  67.09845
[15]  74.46309  71.80197  69.22819  72.19874  68.56200  71.46118
> colSums(tmp5,na.rm=TRUE)
 [1] 1110.1263  664.4613  701.8830  639.2804  737.3923  665.5385  749.0438
 [8]  716.7798  729.5696  706.9108  738.2782  691.7786  707.0923  670.9845
[15]  744.6309  718.0197  692.2819  721.9874  685.6200  714.6118
> colVars(tmp5,na.rm=TRUE)
 [1] 16239.19941    73.83904    52.15426    68.02042    62.77332    80.12492
 [7]    67.59979    69.03701    27.62606    71.91250    70.43789    52.99065
[13]   127.18236    71.84280    48.78537   154.67514    79.86964    84.08043
[19]    55.57392    22.77280
> colSd(tmp5,na.rm=TRUE)
 [1] 127.433117   8.592965   7.221791   8.247449   7.922962   8.951252
 [7]   8.221909   8.308852   5.256050   8.480124   8.392728   7.279467
[13]  11.277516   8.476013   6.984653  12.436846   8.936982   9.169538
[19]   7.454792   4.772085
> colMax(tmp5,na.rm=TRUE)
 [1] 473.20236  83.17569  84.52247  78.90618  86.27881  82.80536  86.02888
 [8]  85.92803  79.55103  85.28419  89.10411  79.30732  91.90788  79.55607
[15]  86.18483  88.25922  87.55190  88.08769  80.25295  79.73367
> colMin(tmp5,na.rm=TRUE)
 [1] 61.40838 55.92819 61.37929 53.45856 64.55185 57.16349 61.27865 57.51223
 [9] 62.93912 57.20714 63.96980 57.39923 56.66763 54.12369 66.03902 54.22065
[17] 56.07065 59.64151 55.68069 65.97676
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1] 90.09681 72.31393 73.51080 69.18281 70.75161 66.98049 72.76468 69.15089
 [9] 70.63979      NaN
> rowSums(tmp5,na.rm=TRUE)
 [1] 1801.936 1446.279 1470.216 1383.656 1415.032 1339.610 1455.294 1383.018
 [9] 1412.796    0.000
> rowVars(tmp5,na.rm=TRUE)
 [1] 8216.18353   63.88780   46.96335   47.97194   79.83648   45.53856
 [7]   69.32509   52.18725   82.55358         NA
> rowSd(tmp5,na.rm=TRUE)
 [1] 90.643166  7.992984  6.852981  6.926178  8.935126  6.748226  8.326169
 [8]  7.224074  9.085900        NA
> rowMax(tmp5,na.rm=TRUE)
 [1] 473.20236  88.08769  87.55190  86.27881  86.18483  79.73367  91.90788
 [8]  83.69894  85.92803        NA
> rowMin(tmp5,na.rm=TRUE)
 [1] 53.45856 55.92819 60.06682 58.01564 54.22065 54.12369 59.45410 56.07065
 [9] 57.24069       NA
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1] 115.97122  65.32029  68.59561       NaN  72.54099  65.46098  73.81705
 [8]  73.25196  72.22428  70.71328  72.13045  69.65460  71.05079  67.95359
[15]  73.51370  71.11042  69.02793  71.03534  69.99326  72.02934
> colSums(tmp5,na.rm=TRUE)
 [1] 1043.7410  587.8826  617.3605    0.0000  652.8689  589.1488  664.3535
 [8]  659.2676  650.0185  636.4195  649.1741  626.8914  639.4571  611.5823
[15]  661.6233  639.9938  621.2514  639.3181  629.9394  648.2641
> colVars(tmp5,na.rm=TRUE)
 [1] 17992.48863    68.80946    30.13624          NA    54.46762    76.70393
 [7]    62.74918    49.79600    25.04018    80.89602    46.83080    57.05754
[13]   141.76767    72.59637    44.74342   168.62931    89.40216    79.36365
[19]    39.47506    21.98781
> colSd(tmp5,na.rm=TRUE)
 [1] 134.136082   8.295147   5.489649         NA   7.380218   8.758078
 [7]   7.921438   7.056628   5.004016   8.994221   6.843303   7.553644
[13]  11.906623   8.520350   6.689052  12.985735   9.455272   8.908628
[19]   6.282918   4.689116
> colMax(tmp5,na.rm=TRUE)
 [1] 473.20236  83.17569  77.23431      -Inf  86.27881  82.80536  86.02888
 [8]  85.92803  78.50144  85.28419  84.14640  79.30732  91.90788  79.55607
[15]  86.18483  88.25922  87.55190  88.08769  80.25295  79.73367
> colMin(tmp5,na.rm=TRUE)
 [1] 61.40838 55.92819 61.37929      Inf 64.55185 57.16349 61.27865 65.39473
 [9] 62.93912 57.20714 63.96980 57.39923 56.66763 54.12369 66.03902 54.22065
[17] 56.07065 59.64151 62.73472 65.97676
> 
> 
> 
> 
> 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] 297.6847 230.8865 267.2199 214.3626 217.8943 112.8482 272.8238 221.9689
 [9] 305.5582 199.5476
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 297.6847 230.8865 267.2199 214.3626 217.8943 112.8482 272.8238 221.9689
 [9] 305.5582 199.5476
> 
> 
> 
> 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]  1.136868e-13  1.705303e-13  1.705303e-13  5.684342e-14  1.705303e-13
 [6]  0.000000e+00  9.947598e-14 -1.136868e-13 -2.842171e-13  5.684342e-14
[11]  0.000000e+00 -2.842171e-14 -5.684342e-14  2.842171e-13  1.136868e-13
[16]  2.273737e-13  1.136868e-13 -2.842171e-13 -8.526513e-14  1.705303e-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)
+ }
6   15 
9   7 
3   17 
3   10 
10   2 
3   19 
9   12 
5   5 
6   6 
3   12 
8   12 
7   16 
4   10 
9   16 
3   4 
2   6 
7   12 
2   8 
2   15 
6   13 
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.315987
> Min(tmp)
[1] -2.489089
> mean(tmp)
[1] -0.03177517
> Sum(tmp)
[1] -3.177517
> Var(tmp)
[1] 0.9091817
> 
> rowMeans(tmp)
[1] -0.03177517
> rowSums(tmp)
[1] -3.177517
> rowVars(tmp)
[1] 0.9091817
> rowSd(tmp)
[1] 0.9535102
> rowMax(tmp)
[1] 2.315987
> rowMin(tmp)
[1] -2.489089
> 
> colMeans(tmp)
  [1]  0.567427475  0.237790569 -0.396422011 -0.387405120 -0.323672391
  [6] -0.649054242  1.560157651 -0.002063835 -1.622641299  0.556162958
 [11] -1.963009154  0.989208207  1.046529603  0.231532418  0.701760156
 [16] -0.209413324 -1.833177583  0.203414531 -0.909724436  0.008487737
 [21] -0.295412039 -0.209957981 -0.445948543 -0.549860555  0.263837336
 [26] -0.686624267  0.655193131 -1.192218628  0.318606280 -1.148653402
 [31]  1.440322321 -1.901891982  0.009296838  0.407527984 -0.986006047
 [36]  0.200503199 -0.302091700 -0.040494923 -0.692309987 -0.365991278
 [41]  1.285948583 -0.135165003 -2.489088661 -1.050595075  2.149148601
 [46]  0.965330637 -1.475317584  0.109002509 -1.154132000  0.622923346
 [51] -0.460756015  0.828078079 -0.592147755  0.092848575 -0.967738462
 [56]  1.041357483 -0.390103232 -0.774029640  0.066736524  0.334718303
 [61]  0.617484769  1.657325191 -0.355564441 -0.558103987 -0.690023883
 [66] -0.113978648 -0.781240808 -0.637632671  0.030768038  1.065235087
 [71]  1.115749391 -1.040803391  1.703195355 -0.768071394 -0.567494471
 [76] -0.847993079  0.167645515  0.313848165  0.845721170 -0.792089902
 [81]  0.179828018 -0.747131753  0.987059720 -1.422700652 -1.104625906
 [86]  1.426316601 -0.293148173  0.205516441  1.351184062  0.537349526
 [91]  2.115957463 -1.256798882  2.315986768  0.606306533  1.275720451
 [96] -0.587368706  0.229442542  0.748356165 -0.424185578  0.024709853
> colSums(tmp)
  [1]  0.567427475  0.237790569 -0.396422011 -0.387405120 -0.323672391
  [6] -0.649054242  1.560157651 -0.002063835 -1.622641299  0.556162958
 [11] -1.963009154  0.989208207  1.046529603  0.231532418  0.701760156
 [16] -0.209413324 -1.833177583  0.203414531 -0.909724436  0.008487737
 [21] -0.295412039 -0.209957981 -0.445948543 -0.549860555  0.263837336
 [26] -0.686624267  0.655193131 -1.192218628  0.318606280 -1.148653402
 [31]  1.440322321 -1.901891982  0.009296838  0.407527984 -0.986006047
 [36]  0.200503199 -0.302091700 -0.040494923 -0.692309987 -0.365991278
 [41]  1.285948583 -0.135165003 -2.489088661 -1.050595075  2.149148601
 [46]  0.965330637 -1.475317584  0.109002509 -1.154132000  0.622923346
 [51] -0.460756015  0.828078079 -0.592147755  0.092848575 -0.967738462
 [56]  1.041357483 -0.390103232 -0.774029640  0.066736524  0.334718303
 [61]  0.617484769  1.657325191 -0.355564441 -0.558103987 -0.690023883
 [66] -0.113978648 -0.781240808 -0.637632671  0.030768038  1.065235087
 [71]  1.115749391 -1.040803391  1.703195355 -0.768071394 -0.567494471
 [76] -0.847993079  0.167645515  0.313848165  0.845721170 -0.792089902
 [81]  0.179828018 -0.747131753  0.987059720 -1.422700652 -1.104625906
 [86]  1.426316601 -0.293148173  0.205516441  1.351184062  0.537349526
 [91]  2.115957463 -1.256798882  2.315986768  0.606306533  1.275720451
 [96] -0.587368706  0.229442542  0.748356165 -0.424185578  0.024709853
> colVars(tmp)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> colSd(tmp)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> colMax(tmp)
  [1]  0.567427475  0.237790569 -0.396422011 -0.387405120 -0.323672391
  [6] -0.649054242  1.560157651 -0.002063835 -1.622641299  0.556162958
 [11] -1.963009154  0.989208207  1.046529603  0.231532418  0.701760156
 [16] -0.209413324 -1.833177583  0.203414531 -0.909724436  0.008487737
 [21] -0.295412039 -0.209957981 -0.445948543 -0.549860555  0.263837336
 [26] -0.686624267  0.655193131 -1.192218628  0.318606280 -1.148653402
 [31]  1.440322321 -1.901891982  0.009296838  0.407527984 -0.986006047
 [36]  0.200503199 -0.302091700 -0.040494923 -0.692309987 -0.365991278
 [41]  1.285948583 -0.135165003 -2.489088661 -1.050595075  2.149148601
 [46]  0.965330637 -1.475317584  0.109002509 -1.154132000  0.622923346
 [51] -0.460756015  0.828078079 -0.592147755  0.092848575 -0.967738462
 [56]  1.041357483 -0.390103232 -0.774029640  0.066736524  0.334718303
 [61]  0.617484769  1.657325191 -0.355564441 -0.558103987 -0.690023883
 [66] -0.113978648 -0.781240808 -0.637632671  0.030768038  1.065235087
 [71]  1.115749391 -1.040803391  1.703195355 -0.768071394 -0.567494471
 [76] -0.847993079  0.167645515  0.313848165  0.845721170 -0.792089902
 [81]  0.179828018 -0.747131753  0.987059720 -1.422700652 -1.104625906
 [86]  1.426316601 -0.293148173  0.205516441  1.351184062  0.537349526
 [91]  2.115957463 -1.256798882  2.315986768  0.606306533  1.275720451
 [96] -0.587368706  0.229442542  0.748356165 -0.424185578  0.024709853
> colMin(tmp)
  [1]  0.567427475  0.237790569 -0.396422011 -0.387405120 -0.323672391
  [6] -0.649054242  1.560157651 -0.002063835 -1.622641299  0.556162958
 [11] -1.963009154  0.989208207  1.046529603  0.231532418  0.701760156
 [16] -0.209413324 -1.833177583  0.203414531 -0.909724436  0.008487737
 [21] -0.295412039 -0.209957981 -0.445948543 -0.549860555  0.263837336
 [26] -0.686624267  0.655193131 -1.192218628  0.318606280 -1.148653402
 [31]  1.440322321 -1.901891982  0.009296838  0.407527984 -0.986006047
 [36]  0.200503199 -0.302091700 -0.040494923 -0.692309987 -0.365991278
 [41]  1.285948583 -0.135165003 -2.489088661 -1.050595075  2.149148601
 [46]  0.965330637 -1.475317584  0.109002509 -1.154132000  0.622923346
 [51] -0.460756015  0.828078079 -0.592147755  0.092848575 -0.967738462
 [56]  1.041357483 -0.390103232 -0.774029640  0.066736524  0.334718303
 [61]  0.617484769  1.657325191 -0.355564441 -0.558103987 -0.690023883
 [66] -0.113978648 -0.781240808 -0.637632671  0.030768038  1.065235087
 [71]  1.115749391 -1.040803391  1.703195355 -0.768071394 -0.567494471
 [76] -0.847993079  0.167645515  0.313848165  0.845721170 -0.792089902
 [81]  0.179828018 -0.747131753  0.987059720 -1.422700652 -1.104625906
 [86]  1.426316601 -0.293148173  0.205516441  1.351184062  0.537349526
 [91]  2.115957463 -1.256798882  2.315986768  0.606306533  1.275720451
 [96] -0.587368706  0.229442542  0.748356165 -0.424185578  0.024709853
> colMedians(tmp)
  [1]  0.567427475  0.237790569 -0.396422011 -0.387405120 -0.323672391
  [6] -0.649054242  1.560157651 -0.002063835 -1.622641299  0.556162958
 [11] -1.963009154  0.989208207  1.046529603  0.231532418  0.701760156
 [16] -0.209413324 -1.833177583  0.203414531 -0.909724436  0.008487737
 [21] -0.295412039 -0.209957981 -0.445948543 -0.549860555  0.263837336
 [26] -0.686624267  0.655193131 -1.192218628  0.318606280 -1.148653402
 [31]  1.440322321 -1.901891982  0.009296838  0.407527984 -0.986006047
 [36]  0.200503199 -0.302091700 -0.040494923 -0.692309987 -0.365991278
 [41]  1.285948583 -0.135165003 -2.489088661 -1.050595075  2.149148601
 [46]  0.965330637 -1.475317584  0.109002509 -1.154132000  0.622923346
 [51] -0.460756015  0.828078079 -0.592147755  0.092848575 -0.967738462
 [56]  1.041357483 -0.390103232 -0.774029640  0.066736524  0.334718303
 [61]  0.617484769  1.657325191 -0.355564441 -0.558103987 -0.690023883
 [66] -0.113978648 -0.781240808 -0.637632671  0.030768038  1.065235087
 [71]  1.115749391 -1.040803391  1.703195355 -0.768071394 -0.567494471
 [76] -0.847993079  0.167645515  0.313848165  0.845721170 -0.792089902
 [81]  0.179828018 -0.747131753  0.987059720 -1.422700652 -1.104625906
 [86]  1.426316601 -0.293148173  0.205516441  1.351184062  0.537349526
 [91]  2.115957463 -1.256798882  2.315986768  0.606306533  1.275720451
 [96] -0.587368706  0.229442542  0.748356165 -0.424185578  0.024709853
> colRanges(tmp)
          [,1]      [,2]      [,3]       [,4]       [,5]       [,6]     [,7]
[1,] 0.5674275 0.2377906 -0.396422 -0.3874051 -0.3236724 -0.6490542 1.560158
[2,] 0.5674275 0.2377906 -0.396422 -0.3874051 -0.3236724 -0.6490542 1.560158
             [,8]      [,9]    [,10]     [,11]     [,12]   [,13]     [,14]
[1,] -0.002063835 -1.622641 0.556163 -1.963009 0.9892082 1.04653 0.2315324
[2,] -0.002063835 -1.622641 0.556163 -1.963009 0.9892082 1.04653 0.2315324
         [,15]      [,16]     [,17]     [,18]      [,19]       [,20]     [,21]
[1,] 0.7017602 -0.2094133 -1.833178 0.2034145 -0.9097244 0.008487737 -0.295412
[2,] 0.7017602 -0.2094133 -1.833178 0.2034145 -0.9097244 0.008487737 -0.295412
         [,22]      [,23]      [,24]     [,25]      [,26]     [,27]     [,28]
[1,] -0.209958 -0.4459485 -0.5498606 0.2638373 -0.6866243 0.6551931 -1.192219
[2,] -0.209958 -0.4459485 -0.5498606 0.2638373 -0.6866243 0.6551931 -1.192219
         [,29]     [,30]    [,31]     [,32]       [,33]    [,34]     [,35]
[1,] 0.3186063 -1.148653 1.440322 -1.901892 0.009296838 0.407528 -0.986006
[2,] 0.3186063 -1.148653 1.440322 -1.901892 0.009296838 0.407528 -0.986006
         [,36]      [,37]       [,38]    [,39]      [,40]    [,41]     [,42]
[1,] 0.2005032 -0.3020917 -0.04049492 -0.69231 -0.3659913 1.285949 -0.135165
[2,] 0.2005032 -0.3020917 -0.04049492 -0.69231 -0.3659913 1.285949 -0.135165
         [,43]     [,44]    [,45]     [,46]     [,47]     [,48]     [,49]
[1,] -2.489089 -1.050595 2.149149 0.9653306 -1.475318 0.1090025 -1.154132
[2,] -2.489089 -1.050595 2.149149 0.9653306 -1.475318 0.1090025 -1.154132
         [,50]     [,51]     [,52]      [,53]      [,54]      [,55]    [,56]
[1,] 0.6229233 -0.460756 0.8280781 -0.5921478 0.09284857 -0.9677385 1.041357
[2,] 0.6229233 -0.460756 0.8280781 -0.5921478 0.09284857 -0.9677385 1.041357
          [,57]      [,58]      [,59]     [,60]     [,61]    [,62]      [,63]
[1,] -0.3901032 -0.7740296 0.06673652 0.3347183 0.6174848 1.657325 -0.3555644
[2,] -0.3901032 -0.7740296 0.06673652 0.3347183 0.6174848 1.657325 -0.3555644
         [,64]      [,65]      [,66]      [,67]      [,68]      [,69]    [,70]
[1,] -0.558104 -0.6900239 -0.1139786 -0.7812408 -0.6376327 0.03076804 1.065235
[2,] -0.558104 -0.6900239 -0.1139786 -0.7812408 -0.6376327 0.03076804 1.065235
        [,71]     [,72]    [,73]      [,74]      [,75]      [,76]     [,77]
[1,] 1.115749 -1.040803 1.703195 -0.7680714 -0.5674945 -0.8479931 0.1676455
[2,] 1.115749 -1.040803 1.703195 -0.7680714 -0.5674945 -0.8479931 0.1676455
         [,78]     [,79]      [,80]    [,81]      [,82]     [,83]     [,84]
[1,] 0.3138482 0.8457212 -0.7920899 0.179828 -0.7471318 0.9870597 -1.422701
[2,] 0.3138482 0.8457212 -0.7920899 0.179828 -0.7471318 0.9870597 -1.422701
         [,85]    [,86]      [,87]     [,88]    [,89]     [,90]    [,91]
[1,] -1.104626 1.426317 -0.2931482 0.2055164 1.351184 0.5373495 2.115957
[2,] -1.104626 1.426317 -0.2931482 0.2055164 1.351184 0.5373495 2.115957
         [,92]    [,93]     [,94]   [,95]      [,96]     [,97]     [,98]
[1,] -1.256799 2.315987 0.6063065 1.27572 -0.5873687 0.2294425 0.7483562
[2,] -1.256799 2.315987 0.6063065 1.27572 -0.5873687 0.2294425 0.7483562
          [,99]     [,100]
[1,] -0.4241856 0.02470985
[2,] -0.4241856 0.02470985
> 
> 
> Max(tmp2)
[1] 2.933476
> Min(tmp2)
[1] -2.513134
> mean(tmp2)
[1] 0.06293789
> Sum(tmp2)
[1] 6.293789
> Var(tmp2)
[1] 1.124989
> 
> rowMeans(tmp2)
  [1]  0.221963794  0.931059174  1.600807003  1.194026183  1.656749196
  [6] -1.431468107 -0.111112921 -2.513134376  0.811307980  0.555173265
 [11]  0.340382268  0.063679543 -0.691054350  0.021751264  0.634067819
 [16] -1.271373259  0.177710390  2.835817854 -0.097105206  0.602992918
 [21]  1.455474765 -0.534426563  0.742086126 -0.488195456 -0.287892025
 [26]  0.008735225 -2.049599825  2.933476120  1.782515134 -0.022194681
 [31] -1.325124797 -1.096920636 -0.059427332 -0.097426300  0.376209547
 [36] -0.553833930 -0.213881945 -1.006208713 -1.243822091  1.054854815
 [41] -0.273479495 -0.232510917  0.053146513 -0.923058747 -0.564664267
 [46]  0.094523257 -0.977624780 -0.823937011  0.548794660 -1.102194334
 [51] -0.555916710 -0.826848563 -0.580525566 -2.006395772 -0.893500837
 [56]  1.550247770 -0.428518050 -1.435118291  1.024318132  0.001375095
 [61] -0.500081525  1.198160343  0.232054095 -0.009938510  0.350845886
 [66]  1.725963438 -0.695053139  0.794237094 -1.443040891  1.370318265
 [71]  0.619832240 -0.656314763 -0.467108111  1.978084490 -0.584809921
 [76] -0.302129257  1.055426481  0.881756557  0.423297084 -0.421402346
 [81]  0.511381677 -1.846209624  1.174398063 -0.331747523 -0.163380601
 [86]  1.682277946  0.984534538 -0.460743722  0.480844927  0.363090352
 [91]  2.082890808 -0.149602854  0.460537114  0.984729840  1.785966214
 [96] -0.421094666 -0.094145529 -1.045961740 -1.965543395  0.156719846
> rowSums(tmp2)
  [1]  0.221963794  0.931059174  1.600807003  1.194026183  1.656749196
  [6] -1.431468107 -0.111112921 -2.513134376  0.811307980  0.555173265
 [11]  0.340382268  0.063679543 -0.691054350  0.021751264  0.634067819
 [16] -1.271373259  0.177710390  2.835817854 -0.097105206  0.602992918
 [21]  1.455474765 -0.534426563  0.742086126 -0.488195456 -0.287892025
 [26]  0.008735225 -2.049599825  2.933476120  1.782515134 -0.022194681
 [31] -1.325124797 -1.096920636 -0.059427332 -0.097426300  0.376209547
 [36] -0.553833930 -0.213881945 -1.006208713 -1.243822091  1.054854815
 [41] -0.273479495 -0.232510917  0.053146513 -0.923058747 -0.564664267
 [46]  0.094523257 -0.977624780 -0.823937011  0.548794660 -1.102194334
 [51] -0.555916710 -0.826848563 -0.580525566 -2.006395772 -0.893500837
 [56]  1.550247770 -0.428518050 -1.435118291  1.024318132  0.001375095
 [61] -0.500081525  1.198160343  0.232054095 -0.009938510  0.350845886
 [66]  1.725963438 -0.695053139  0.794237094 -1.443040891  1.370318265
 [71]  0.619832240 -0.656314763 -0.467108111  1.978084490 -0.584809921
 [76] -0.302129257  1.055426481  0.881756557  0.423297084 -0.421402346
 [81]  0.511381677 -1.846209624  1.174398063 -0.331747523 -0.163380601
 [86]  1.682277946  0.984534538 -0.460743722  0.480844927  0.363090352
 [91]  2.082890808 -0.149602854  0.460537114  0.984729840  1.785966214
 [96] -0.421094666 -0.094145529 -1.045961740 -1.965543395  0.156719846
> rowVars(tmp2)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowSd(tmp2)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowMax(tmp2)
  [1]  0.221963794  0.931059174  1.600807003  1.194026183  1.656749196
  [6] -1.431468107 -0.111112921 -2.513134376  0.811307980  0.555173265
 [11]  0.340382268  0.063679543 -0.691054350  0.021751264  0.634067819
 [16] -1.271373259  0.177710390  2.835817854 -0.097105206  0.602992918
 [21]  1.455474765 -0.534426563  0.742086126 -0.488195456 -0.287892025
 [26]  0.008735225 -2.049599825  2.933476120  1.782515134 -0.022194681
 [31] -1.325124797 -1.096920636 -0.059427332 -0.097426300  0.376209547
 [36] -0.553833930 -0.213881945 -1.006208713 -1.243822091  1.054854815
 [41] -0.273479495 -0.232510917  0.053146513 -0.923058747 -0.564664267
 [46]  0.094523257 -0.977624780 -0.823937011  0.548794660 -1.102194334
 [51] -0.555916710 -0.826848563 -0.580525566 -2.006395772 -0.893500837
 [56]  1.550247770 -0.428518050 -1.435118291  1.024318132  0.001375095
 [61] -0.500081525  1.198160343  0.232054095 -0.009938510  0.350845886
 [66]  1.725963438 -0.695053139  0.794237094 -1.443040891  1.370318265
 [71]  0.619832240 -0.656314763 -0.467108111  1.978084490 -0.584809921
 [76] -0.302129257  1.055426481  0.881756557  0.423297084 -0.421402346
 [81]  0.511381677 -1.846209624  1.174398063 -0.331747523 -0.163380601
 [86]  1.682277946  0.984534538 -0.460743722  0.480844927  0.363090352
 [91]  2.082890808 -0.149602854  0.460537114  0.984729840  1.785966214
 [96] -0.421094666 -0.094145529 -1.045961740 -1.965543395  0.156719846
> rowMin(tmp2)
  [1]  0.221963794  0.931059174  1.600807003  1.194026183  1.656749196
  [6] -1.431468107 -0.111112921 -2.513134376  0.811307980  0.555173265
 [11]  0.340382268  0.063679543 -0.691054350  0.021751264  0.634067819
 [16] -1.271373259  0.177710390  2.835817854 -0.097105206  0.602992918
 [21]  1.455474765 -0.534426563  0.742086126 -0.488195456 -0.287892025
 [26]  0.008735225 -2.049599825  2.933476120  1.782515134 -0.022194681
 [31] -1.325124797 -1.096920636 -0.059427332 -0.097426300  0.376209547
 [36] -0.553833930 -0.213881945 -1.006208713 -1.243822091  1.054854815
 [41] -0.273479495 -0.232510917  0.053146513 -0.923058747 -0.564664267
 [46]  0.094523257 -0.977624780 -0.823937011  0.548794660 -1.102194334
 [51] -0.555916710 -0.826848563 -0.580525566 -2.006395772 -0.893500837
 [56]  1.550247770 -0.428518050 -1.435118291  1.024318132  0.001375095
 [61] -0.500081525  1.198160343  0.232054095 -0.009938510  0.350845886
 [66]  1.725963438 -0.695053139  0.794237094 -1.443040891  1.370318265
 [71]  0.619832240 -0.656314763 -0.467108111  1.978084490 -0.584809921
 [76] -0.302129257  1.055426481  0.881756557  0.423297084 -0.421402346
 [81]  0.511381677 -1.846209624  1.174398063 -0.331747523 -0.163380601
 [86]  1.682277946  0.984534538 -0.460743722  0.480844927  0.363090352
 [91]  2.082890808 -0.149602854  0.460537114  0.984729840  1.785966214
 [96] -0.421094666 -0.094145529 -1.045961740 -1.965543395  0.156719846
> 
> colMeans(tmp2)
[1] 0.06293789
> colSums(tmp2)
[1] 6.293789
> colVars(tmp2)
[1] 1.124989
> colSd(tmp2)
[1] 1.060655
> colMax(tmp2)
[1] 2.933476
> colMin(tmp2)
[1] -2.513134
> colMedians(tmp2)
[1] -0.0160666
> colRanges(tmp2)
          [,1]
[1,] -2.513134
[2,]  2.933476
> 
> 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] -2.05878430  2.61741261  3.94737590 -0.00175216  1.95568479 -1.07905333
 [7] -2.09912486  0.47451660 -2.23706479  3.25424868
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -1.6402481
[2,] -0.6699741
[3,] -0.3610334
[4,]  0.4436199
[5,]  1.1310048
> 
> rowApply(tmp,sum)
 [1]  3.4960376  1.5544739 -0.9281525  0.2404966  2.5556604  0.3290195
 [7]  0.9498076 -1.9041748  0.9503548 -2.4700640
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    6    2    1    7    1   10    2    4    2     6
 [2,]    8    3    6    9    3    9    3   10    9     4
 [3,]    5   10    8    8    8    4    6    9    1    10
 [4,]    1    4    9    1    9    5    7    7   10     3
 [5,]    7    5    7    6    2    8   10    2    7     2
 [6,]    4    7    4    5    5    1    5    5    6     8
 [7,]    9    9    3    3    6    7    1    1    5     1
 [8,]   10    1    2    2   10    6    8    6    4     9
 [9,]    2    8   10    4    4    2    4    3    3     7
[10,]    3    6    5   10    7    3    9    8    8     5
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1]  1.66954202 -0.06757144 -4.18521586 -0.92126148  0.22499332  3.73420000
 [7]  1.98850633 -2.94290187 -1.90432935  1.92376802 -0.10087491  2.02575264
[13] -1.58922405 -3.06996593  0.65913935 -0.48444699 -1.04529871 -0.33304040
[19] -0.69979108  2.40614796
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -1.6905402
[2,] -0.4836764
[3,]  0.7311017
[4,]  0.8999056
[5,]  2.2127513
> 
> rowApply(tmp,sum)
[1]  4.264121  2.736232 -4.470049 -3.503848 -1.738328
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]    6   20   20    1   17
[2,]    3   14    3   18    7
[3,]    7    1    2    7    3
[4,]   18   17    9    4    2
[5,]   13    9   12   10   12
> 
> 
> as.matrix(tmp)
           [,1]       [,2]       [,3]       [,4]        [,5]        [,6]
[1,] -0.4836764 -0.7634055 -0.1814483  1.6094583  0.50137523  1.09111431
[2,]  2.2127513  0.7014748 -1.4600927  0.8438833  0.07526714  0.31613669
[3,]  0.7311017 -0.9047075 -0.9462563 -0.3166096 -0.12329164  0.01370267
[4,] -1.6905402  1.6344206 -0.4428541 -1.5523393 -0.26734868 -0.10537990
[5,]  0.8999056 -0.7353538 -1.1545645 -1.5056543  0.03899128  2.41862623
             [,7]       [,8]       [,9]       [,10]      [,11]      [,12]
[1,]  1.735051158  0.8116679 -0.5299254  1.22629111 -1.8512024  0.3122226
[2,] -1.168835478 -0.4137450  0.7951925  1.05644566  1.4207441  0.8186518
[3,] -0.005955675 -0.2817346  0.5273527  0.22945881 -0.4826025  0.6002776
[4,]  1.808579893 -1.4751826 -1.5805121  0.07176758 -0.1211654 -0.2557740
[5,] -0.380333568 -1.5839076 -1.1164371 -0.66019514  0.9333513  0.5503746
           [,13]      [,14]       [,15]      [,16]      [,17]       [,18]
[1,] -0.04474777 -1.4742737 -0.17941043  1.6501556 -0.4907703  0.01078636
[2,] -0.62822757 -1.3817093  0.23883834  0.5661225 -0.3107614 -0.27945077
[3,] -0.68626810 -0.7912115  0.09113454 -1.0404301 -0.4613317 -0.18258508
[4,] -1.63313279  1.3228357 -0.25410718 -1.0787726 -0.3203189  1.15969730
[5,]  1.40315218 -0.7456071  0.76268407 -0.5815224  0.5378837 -1.04148820
           [,19]      [,20]
[1,]  0.29866774  1.0161909
[2,] -0.94790266  0.2814483
[3,]  0.42478997 -0.8648827
[4,] -0.39456366  1.6708422
[5,] -0.08078247  0.3025492
> 
> 
> is.BufferedMatrix(tmp)
[1] TRUE
> 
> as.BufferedMatrix(as.matrix(tmp))
BufferedMatrix object
Matrix size:  5 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  800  bytes.
> 
> 
> 
> subBufferedMatrix(tmp,1:5,1:5)
BufferedMatrix object
Matrix size:  5 5 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  652  bytes.
Disk usage :  200  bytes.
> subBufferedMatrix(tmp,,5:8)
BufferedMatrix object
Matrix size:  5 4 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  565  bytes.
Disk usage :  160  bytes.
> subBufferedMatrix(tmp,1:3,)
BufferedMatrix object
Matrix size:  3 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  480  bytes.
> 
> 
> rm(tmp)
> 
> 
> ###
> ### Testing colnames and rownames
> ###
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> 
> 
> colnames(tmp)
NULL
> rownames(tmp)
NULL
> 
> 
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> colnames(tmp)
 [1] "col1"  "col2"  "col3"  "col4"  "col5"  "col6"  "col7"  "col8"  "col9" 
[10] "col10" "col11" "col12" "col13" "col14" "col15" "col16" "col17" "col18"
[19] "col19" "col20"
> rownames(tmp)
[1] "row1" "row2" "row3" "row4" "row5"
> 
> 
> tmp["row1",]
         col1      col2      col3      col4      col5       col6      col7
row1 0.882015 0.7037565 -1.474278 0.1216807 -2.206401 -0.5566554 0.5735491
           col8      col9     col10      col11     col12      col13     col14
row1 -0.1156908 0.7927286 0.1748872 -0.8619647 -1.780689 -0.8036401 0.2534584
          col15    col16     col17     col18    col19      col20
row1 -0.6798811 1.175636 0.6951786 0.3893865 1.597784 -0.8292514
> tmp[,"col10"]
          col10
row1  0.1748872
row2  0.8027495
row3 -1.0438107
row4 -1.7683477
row5  1.0155509
> tmp[c("row1","row5"),]
          col1      col2       col3      col4       col5       col6       col7
row1  0.882015 0.7037565 -1.4742784 0.1216807 -2.2064006 -0.5566554  0.5735491
row5 -0.332587 0.9551798  0.2003636 0.1272846  0.4334106 -0.8319897 -0.5159378
           col8      col9     col10      col11      col12      col13     col14
row1 -0.1156908 0.7927286 0.1748872 -0.8619647 -1.7806888 -0.8036401 0.2534584
row5 -0.1017641 0.3522037 1.0155509 -0.7367159  0.7093499 -1.5750373 0.7847975
          col15       col16      col17      col18    col19      col20
row1 -0.6798811  1.17563623  0.6951786  0.3893865 1.597784 -0.8292514
row5 -0.6853034 -0.02792892 -0.4358201 -1.2828000 0.796912  1.7079908
> tmp[,c("col6","col20")]
           col6       col20
row1 -0.5566554 -0.82925135
row2 -0.1398194  1.74564469
row3  1.2407992 -0.04444825
row4  0.3069813 -0.04581310
row5 -0.8319897  1.70799078
> tmp[c("row1","row5"),c("col6","col20")]
           col6      col20
row1 -0.5566554 -0.8292514
row5 -0.8319897  1.7079908
> 
> 
> 
> 
> 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.72469 49.44048 48.73923 50.25144 48.81751 104.7924 49.61423 48.70171
         col9    col10    col11    col12    col13    col14    col15    col16
row1 50.90474 48.00845 51.26357 49.67104 50.71907 49.35664 50.75496 52.04769
       col17   col18    col19    col20
row1 50.2628 47.9749 49.35344 105.7779
> tmp[,"col10"]
        col10
row1 48.00845
row2 28.44140
row3 29.58843
row4 29.97890
row5 49.37050
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 49.72469 49.44048 48.73923 50.25144 48.81751 104.7924 49.61423 48.70171
row5 49.56514 50.17351 49.25396 51.41898 51.00699 105.3745 49.58091 51.22299
         col9    col10    col11    col12    col13    col14    col15    col16
row1 50.90474 48.00845 51.26357 49.67104 50.71907 49.35664 50.75496 52.04769
row5 49.87381 49.37050 50.15817 49.67755 46.74431 49.88591 51.32903 48.84555
        col17    col18    col19    col20
row1 50.26280 47.97490 49.35344 105.7779
row5 51.28186 49.83069 47.94524 105.1766
> tmp[,c("col6","col20")]
          col6     col20
row1 104.79240 105.77791
row2  75.39489  76.53316
row3  74.63767  74.54678
row4  76.18507  75.04273
row5 105.37451 105.17655
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 104.7924 105.7779
row5 105.3745 105.1766
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 104.7924 105.7779
row5 105.3745 105.1766
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
           col13
[1,]  1.35715369
[2,]  1.06724306
[3,] -0.09021719
[4,] -0.54692443
[5,]  0.65496496
> tmp[,c("col17","col7")]
          col17       col7
[1,]  1.1338108 -0.7002964
[2,]  0.9657730  0.7299729
[3,]  1.0299353  0.9066856
[4,] -0.6057864 -1.0373074
[5,] -1.7999851  1.8492790
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
           col6      col20
[1,] -0.3300532 -0.5807892
[2,]  0.0124068  0.3381008
[3,]  1.1662621  1.0905322
[4,]  0.4085120 -0.4682030
[5,]  0.3979740  0.1794036
> subBufferedMatrix(tmp,1,c("col6"))[,1]
           col1
[1,] -0.3300532
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
           col6
[1,] -0.3300532
[2,]  0.0124068
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> 
> 
> 
> subBufferedMatrix(tmp,c("row3","row1"),)[,1:20]
            [,1]       [,2]       [,3]      [,4]       [,5]       [,6]
row3 -0.07867782 -0.2901258 -0.7128567 0.2147730 -0.3984314 -1.2317419
row1  0.32853784 -0.8784173  0.4447412 0.3186902  1.8570563  0.7382832
           [,7]       [,8]      [,9]      [,10]       [,11]    [,12]      [,13]
row3 -1.3685220  1.2736994 0.2917756 -0.9232025  1.68208999 1.077982 -2.5116231
row1 -0.9798132 -0.5474345 0.3249205 -0.2251598 -0.04632948 1.396094 -0.6836344
         [,14]      [,15]      [,16]     [,17]      [,18]    [,19]      [,20]
row3 -0.919681  0.9797314 -0.8332691 -1.915390 -2.7252768 1.347601  1.7164102
row1  1.487752 -1.8713231 -0.7593938 -0.419001  0.6869265 0.131488 -0.4536383
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
           [,1]      [,2]      [,3]       [,4]      [,5]     [,6]        [,7]
row2 -0.4693476 0.9891445 0.9796127 -0.7269229 -1.402519 1.372235 -0.04197612
          [,8]     [,9]       [,10]
row2 0.2955601 1.439193 -0.02565466
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
           [,1]     [,2]       [,3]     [,4]      [,5]       [,6]       [,7]
row5 -0.4970338 1.386307 -0.4635299 1.417386 -0.650054 -0.3943007 -0.4572451
            [,8]     [,9]     [,10]      [,11]      [,12]      [,13]     [,14]
row5 -0.05984374 1.751798 0.6545103 -0.5187024 -0.4442943 -0.6740389 0.7603299
         [,15]      [,16]      [,17]     [,18]     [,19]     [,20]
row5 -0.151453 -0.1517035 -0.4527583 -1.121134 -1.022856 0.2016821
> 
> 
> 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: 0x60e5f1c02f70>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM203ef054fb5821"
 [2] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM203ef0169e1cbd"
 [3] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM203ef0556fd93" 
 [4] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM203ef01f130811"
 [5] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM203ef04fe52048"
 [6] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM203ef04c86e94d"
 [7] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM203ef03f72d721"
 [8] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM203ef013acee96"
 [9] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM203ef01c20a002"
[10] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM203ef07ec4901c"
[11] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM203ef048fd7396"
[12] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM203ef02ab4dfff"
[13] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM203ef02232b8ef"
[14] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM203ef05515cd57"
[15] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM203ef04e6219b5"
> 
> 
> ### 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: 0x60e5f1a78410>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x60e5f1a78410>
Warning message:
In dir.create(new.directory) :
  '/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x60e5f1a78410>
> rowMedians(tmp)
  [1] -0.4534690620 -0.2789227347  0.4066375173  0.2279811409  0.3713333004
  [6] -0.5196354647 -0.4733461511  0.0440568332  0.1005168016 -0.1290050834
 [11]  0.4148821775  0.4683329637 -0.0497295951  0.1851268476 -0.1984458267
 [16] -0.1722829808 -0.0853024120  0.3728401102 -0.0618174003  0.4026763641
 [21] -0.1714847421 -0.2750568796  0.1639239095 -0.0551170049  0.1487860626
 [26] -0.1208254895  0.0694969903 -0.0268221932  0.1666084950  0.0191194891
 [31] -0.0630806586 -0.2733474283  0.2879929934  0.3124072780  0.2335870704
 [36] -0.3219312735 -0.1515489826  0.3670233281  0.2423778566  0.5217411542
 [41]  0.4865601466 -0.8187197579  0.1363817205 -0.0537661642 -0.2555922336
 [46]  0.4200815892 -0.9292094922 -0.2873294349 -0.4449546758  0.0735606129
 [51]  0.2920226010 -0.1518765048  0.7740547399 -0.1539321168 -0.1530164145
 [56] -0.0520228493  0.6149890051 -0.3224704465  0.1390867125 -0.0706103029
 [61]  0.0270869820 -0.0346215179 -0.5046327489  0.5230405749  0.3453849520
 [66]  0.1647673852 -0.6068129507 -0.1037682782  0.5136991615  0.3924696899
 [71]  0.1205757295 -0.1158959251 -0.3094952838 -0.1109199931 -0.4943045595
 [76]  0.2832412157 -0.0814751290 -0.2921680604 -0.1613747340 -0.3784976105
 [81]  0.0499844820 -0.1147868903 -0.4548996448  0.3664128069  0.1188777068
 [86] -0.2085364057  0.0033815433 -0.4984441213 -0.0953923866 -0.3803846517
 [91]  0.3096477622  0.3171426690  0.3831472004  0.4947206420  0.0010144911
 [96] -0.0313120554  0.1193529093 -0.1582892481  0.2278400645  0.0551262790
[101]  0.0367445701  0.1581301065  0.4765498975 -0.7697377044  0.8717145866
[106]  0.1420801056  0.4378678139  0.0550453042  0.4780919239  0.2735502406
[111] -0.2007195519 -0.0193401573 -0.1333041581  0.2033184268  0.0581562282
[116]  0.2257253908 -0.1311929075 -0.6011219564 -0.3184438795  0.0425928486
[121]  0.0438124649 -0.3335358655  0.0161714063 -0.2224623866  0.3540630108
[126] -0.0628261796  0.3194297100 -0.5724667459 -0.0410835032 -0.3779537439
[131]  0.3187267361  0.4722202649  0.7607600841 -0.6687796243 -0.0870860718
[136] -0.2387255250  0.1101379191  0.0107841014  0.2801940997  0.1315604071
[141]  0.0863707461 -0.0726000688 -0.0940148493 -0.3513354713  0.2030822050
[146] -0.1753949083 -0.6244052936  0.3271857446  0.2814975178  0.0757100638
[151] -0.1854454569  0.3964689159 -0.1809050685 -0.0850447404  0.3749961708
[156] -0.0770874163 -0.1611840401  0.1740522139  0.1812139422 -0.1237706104
[161] -0.2439684751  0.4701355295  0.1975573025 -0.5585466709 -0.2994212237
[166]  0.0941768030 -0.0218326453 -0.1224060897  0.0007036165  0.8226849563
[171] -0.2940963623 -0.1603800580  0.1881283674  0.7103374949  0.4871629523
[176] -0.1622697768  0.1344022944 -0.1216451945  0.6696128695 -0.1837187110
[181] -0.3802177226  0.4476782874 -0.3364029433  0.2182848884 -0.0488099252
[186]  0.0377954885 -0.7067048059 -0.3877491883 -0.4798283571  0.1198150603
[191]  0.0729353965  0.4494526192 -0.0002056692  0.6166558709 -0.1560371053
[196] -0.4617639786 -0.7910410475  0.5071704118 -0.5304433523  0.0047261943
[201] -0.2533051143  0.2727334007  0.1749138236 -0.1424989636  0.1376174216
[206]  0.1366204113  0.0352729433 -0.1378637430 -0.4799514801 -0.5151543325
[211]  0.1819316852  0.0097326724 -0.0644438354 -0.1385422930  0.0595155532
[216] -0.0482279344 -0.2461520805 -0.1715796340  0.1558584803 -0.2305050176
[221] -0.1184210506  0.1454765026 -0.0204853923 -0.8503071004  0.0905729459
[226] -0.0343400263  0.0757261643 -0.1525012367 -0.3836490461 -0.0887573928
> 
> proc.time()
   user  system elapsed 
  1.337   1.449   2.775 

BufferedMatrix.Rcheck/tests/rawCalltesting.Rout


R Under development (unstable) (2025-10-20 r88955) -- "Unsuffered Consequences"
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: 0x64064f826b20>
> .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: 0x64064f826b20>
> .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: 0x64064f826b20>
> .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: 0x64064f826b20>
> 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: 0x64064f807410>
> .Call("R_bm_AddColumn",P)
<pointer: 0x64064f807410>
> .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: 0x64064f807410>
> .Call("R_bm_AddColumn",P)
<pointer: 0x64064f807410>
> .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: 0x64064f807410>
> 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: 0x64064e0b47a0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x64064e0b47a0>
> .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: 0x64064e0b47a0>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x64064e0b47a0>
> .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: 0x64064e0b47a0>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x64064e0b47a0>
> .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: 0x64064e0b47a0>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x64064e0b47a0>
> .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: 0x64064e0b47a0>
> 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: 0x64064f086680>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x64064f086680>
> .Call("R_bm_AddColumn",P)
<pointer: 0x64064f086680>
> .Call("R_bm_AddColumn",P)
<pointer: 0x64064f086680>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile203f782d2e8d49" "BufferedMatrixFile203f786a6e021b"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile203f782d2e8d49" "BufferedMatrixFile203f786a6e021b"
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x64064ee1a490>
> .Call("R_bm_AddColumn",P)
<pointer: 0x64064ee1a490>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x64064ee1a490>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x64064ee1a490>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x64064ee1a490>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x64064ee1a490>
> .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: 0x640650476110>
> .Call("R_bm_AddColumn",P)
<pointer: 0x640650476110>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x640650476110>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x640650476110>
> 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: 0x6406505195e0>
> .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: 0x6406505195e0>
> rm(P)
> 
> proc.time()
   user  system elapsed 
  0.258   0.047   0.292 

BufferedMatrix.Rcheck/tests/Rcodetesting.Rout


R Under development (unstable) (2025-10-20 r88955) -- "Unsuffered Consequences"
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.232   0.053   0.271 

Example timings