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

This page was generated on 2026-01-15 11:34 -0500 (Thu, 15 Jan 2026).

HostnameOSArch (*)R versionInstalled pkgs
nebbiolo1Linux (Ubuntu 24.04.3 LTS)x86_64R Under development (unstable) (2025-12-22 r89219) -- "Unsuffered Consequences" 4848
kjohnson3macOS 13.7.7 Venturaarm64R Under development (unstable) (2025-11-04 r88984) -- "Unsuffered Consequences" 4628
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 253/2343HostnameOS / ArchINSTALLBUILDCHECKBUILD BIN
BufferedMatrix 1.75.0  (landing page)
Ben Bolstad
Snapshot Date: 2026-01-14 13:40 -0500 (Wed, 14 Jan 2026)
git_url: https://git.bioconductor.org/packages/BufferedMatrix
git_branch: devel
git_last_commit: ecdbf23
git_last_commit_date: 2025-10-29 09:58:55 -0500 (Wed, 29 Oct 2025)
nebbiolo1Linux (Ubuntu 24.04.3 LTS) / x86_64  OK    OK    OK  UNNEEDED, same version is already published
kjohnson3macOS 13.7.7 Ventura / arm64  OK    OK    WARNINGS    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: 2026-01-14 21:47:15 -0500 (Wed, 14 Jan 2026)
EndedAt: 2026-01-14 21:47:40 -0500 (Wed, 14 Jan 2026)
EllapsedTime: 25.0 seconds
RetCode: 0
Status:   OK  
CheckDir: BufferedMatrix.Rcheck
Warnings: 0

Command output

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


* using log directory ‘/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck’
* using R Under development (unstable) (2025-12-22 r89219)
* 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-12-22 r89219) -- "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.251   0.060   0.297 

BufferedMatrix.Rcheck/tests/objectTesting.Rout


R Under development (unstable) (2025-12-22 r89219) -- "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 478851 25.6    1048487   56   639317 34.2
Vcells 885659  6.8    8388608   64  2082734 15.9
> 
> 
> 
> 
> ##
> ## checking reads
> ##
> 
> tmp2 <- createBufferedMatrix(10,20)
> 
> test.sample <- rnorm(10*20)
> 
> tmp2[1:10,1:20] <- test.sample
> 
> test.matrix <- matrix(test.sample,10,20)
> 
> ## testing reads
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   which.col <- sample(1:20,1)
+   if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> date()
[1] "Wed Jan 14 21:47:30 2026"
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> date()
[1] "Wed Jan 14 21:47:30 2026"
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,which.col] == test.matrix[which.row,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> 
> 
> RowMode(tmp2)
<pointer: 0x5929b961e2b0>
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   which.col <- sample(1:20,1)
+   if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,5,replace=TRUE)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> date()
[1] "Wed Jan 14 21:47:31 2026"
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col <- sample(1:20,5,replace=TRUE)
+   if (!all(tmp2[which.row,which.col] == test.matrix[which.row,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> date()
[1] "Wed Jan 14 21:47:31 2026"
> 
> ColMode(tmp2)
<pointer: 0x5929b961e2b0>
> 
> 
> 
> ### 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,] 98.93956229 -1.8156961 -1.6876149 -1.92240083
[2,]  0.08081434 -1.9596927  1.1286478  0.08462404
[3,]  1.30984657  0.5106037 -0.8306336 -1.55096871
[4,] -0.22202923 -1.4253131 -0.8148425  1.46702722
> 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,] 98.93956229 1.8156961 1.6876149 1.92240083
[2,]  0.08081434 1.9596927 1.1286478 0.08462404
[3,]  1.30984657 0.5106037 0.8306336 1.55096871
[4,]  0.22202923 1.4253131 0.8148425 1.46702722
> 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,] 9.9468368 1.3474777 1.2990823 1.3865067
[2,] 0.2842786 1.3998903 1.0623784 0.2909021
[3,] 1.1444853 0.7145654 0.9113911 1.2453789
[4,] 0.4711998 1.1938648 0.9026862 1.2112090
> 
> 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,] 223.40793 40.29047 39.67844 40.78747
[2,]  27.92360 40.95860 36.75243 27.99365
[3,]  37.75470 32.65626 34.94454 39.00476
[4,]  29.93403 38.36396 34.84170 38.57912
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x5929b9d25500>
> exp(tmp5)
<pointer: 0x5929b9d25500>
> log(tmp5,2)
<pointer: 0x5929b9d25500>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 464.9943
> Min(tmp5)
[1] 55.11969
> mean(tmp5)
[1] 72.69042
> Sum(tmp5)
[1] 14538.08
> Var(tmp5)
[1] 853.3565
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 90.70728 67.52219 71.07122 73.06521 71.55043 70.29395 67.29098 70.61734
 [9] 73.87499 70.91064
> rowSums(tmp5)
 [1] 1814.146 1350.444 1421.424 1461.304 1431.009 1405.879 1345.820 1412.347
 [9] 1477.500 1418.213
> rowVars(tmp5)
 [1] 7834.78335   67.19502   60.05346   83.05223  101.07277   85.71088
 [7]   57.76211   73.60053   76.47071   77.93239
> rowSd(tmp5)
 [1] 88.514312  8.197257  7.749417  9.113300 10.053496  9.258017  7.600139
 [8]  8.579075  8.744753  8.827933
> rowMax(tmp5)
 [1] 464.99434  85.24995  85.40378  88.45619  91.03060  88.53700  80.66997
 [8]  83.99956  90.77826  91.84293
> rowMin(tmp5)
 [1] 58.58596 58.11932 58.78911 57.41838 55.11969 55.36396 56.22818 55.32191
 [9] 61.90309 55.46082
> 
> colMeans(tmp5)
 [1] 111.34822  74.17721  74.16690  67.93275  69.37164  69.02384  70.57035
 [8]  73.36743  71.37498  67.80706  70.83816  72.24650  68.87019  67.63518
[15]  70.12943  74.30502  65.88497  70.90768  75.15545  68.69550
> colSums(tmp5)
 [1] 1113.4822  741.7721  741.6690  679.3275  693.7164  690.2384  705.7035
 [8]  733.6743  713.7498  678.0706  708.3816  722.4650  688.7019  676.3518
[15]  701.2943  743.0502  658.8497  709.0768  751.5545  686.9550
> colVars(tmp5)
 [1] 15538.32730    84.59032    77.21395   129.40466    83.60870    62.54662
 [7]    58.19105    63.20916    60.84326    27.96594    74.93523    84.55385
[13]    67.24251   124.28847   103.58429   100.07890    50.44023    40.49915
[19]   104.35443    42.88051
> colSd(tmp5)
 [1] 124.652827   9.197299   8.787147  11.375617   9.143779   7.908642
 [7]   7.628306   7.950419   7.800209   5.288283   8.656514   9.195317
[13]   8.200153  11.148474  10.177637  10.003944   7.102129   6.363894
[19]  10.215402   6.548321
> colMax(tmp5)
 [1] 464.99434  85.24995  91.84293  84.89377  85.40378  80.51704  83.99956
 [8]  84.71253  81.72422  76.69740  81.56283  88.53700  83.84552  85.01580
[15]  90.77826  88.84172  77.23835  82.55815  88.45619  77.34397
> colMin(tmp5)
 [1] 58.11932 58.67210 60.58426 55.32191 56.93134 57.06569 61.87810 61.40918
 [9] 60.11767 57.97779 57.42573 56.48074 58.42753 55.11969 58.58596 55.46082
[17] 57.41838 59.93557 60.66134 56.22818
> 
> 
> ### 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.70728 67.52219 71.07122 73.06521       NA 70.29395 67.29098 70.61734
 [9] 73.87499 70.91064
> rowSums(tmp5)
 [1] 1814.146 1350.444 1421.424 1461.304       NA 1405.879 1345.820 1412.347
 [9] 1477.500 1418.213
> rowVars(tmp5)
 [1] 7834.78335   67.19502   60.05346   83.05223   99.43213   85.71088
 [7]   57.76211   73.60053   76.47071   77.93239
> rowSd(tmp5)
 [1] 88.514312  8.197257  7.749417  9.113300  9.971566  9.258017  7.600139
 [8]  8.579075  8.744753  8.827933
> rowMax(tmp5)
 [1] 464.99434  85.24995  85.40378  88.45619        NA  88.53700  80.66997
 [8]  83.99956  90.77826  91.84293
> rowMin(tmp5)
 [1] 58.58596 58.11932 58.78911 57.41838       NA 55.36396 56.22818 55.32191
 [9] 61.90309 55.46082
> 
> colMeans(tmp5)
 [1] 111.34822  74.17721  74.16690  67.93275  69.37164  69.02384  70.57035
 [8]  73.36743  71.37498  67.80706  70.83816  72.24650  68.87019  67.63518
[15]        NA  74.30502  65.88497  70.90768  75.15545  68.69550
> colSums(tmp5)
 [1] 1113.4822  741.7721  741.6690  679.3275  693.7164  690.2384  705.7035
 [8]  733.6743  713.7498  678.0706  708.3816  722.4650  688.7019  676.3518
[15]        NA  743.0502  658.8497  709.0768  751.5545  686.9550
> colVars(tmp5)
 [1] 15538.32730    84.59032    77.21395   129.40466    83.60870    62.54662
 [7]    58.19105    63.20916    60.84326    27.96594    74.93523    84.55385
[13]    67.24251   124.28847          NA   100.07890    50.44023    40.49915
[19]   104.35443    42.88051
> colSd(tmp5)
 [1] 124.652827   9.197299   8.787147  11.375617   9.143779   7.908642
 [7]   7.628306   7.950419   7.800209   5.288283   8.656514   9.195317
[13]   8.200153  11.148474         NA  10.003944   7.102129   6.363894
[19]  10.215402   6.548321
> colMax(tmp5)
 [1] 464.99434  85.24995  91.84293  84.89377  85.40378  80.51704  83.99956
 [8]  84.71253  81.72422  76.69740  81.56283  88.53700  83.84552  85.01580
[15]        NA  88.84172  77.23835  82.55815  88.45619  77.34397
> colMin(tmp5)
 [1] 58.11932 58.67210 60.58426 55.32191 56.93134 57.06569 61.87810 61.40918
 [9] 60.11767 57.97779 57.42573 56.48074 58.42753 55.11969       NA 55.46082
[17] 57.41838 59.93557 60.66134 56.22818
> 
> Max(tmp5,na.rm=TRUE)
[1] 464.9943
> Min(tmp5,na.rm=TRUE)
[1] 55.11969
> mean(tmp5,na.rm=TRUE)
[1] 72.75213
> Sum(tmp5,na.rm=TRUE)
[1] 14477.67
> Var(tmp5,na.rm=TRUE)
[1] 856.9011
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 90.70728 67.52219 71.07122 73.06521 72.13669 70.29395 67.29098 70.61734
 [9] 73.87499 70.91064
> rowSums(tmp5,na.rm=TRUE)
 [1] 1814.146 1350.444 1421.424 1461.304 1370.597 1405.879 1345.820 1412.347
 [9] 1477.500 1418.213
> rowVars(tmp5,na.rm=TRUE)
 [1] 7834.78335   67.19502   60.05346   83.05223   99.43213   85.71088
 [7]   57.76211   73.60053   76.47071   77.93239
> rowSd(tmp5,na.rm=TRUE)
 [1] 88.514312  8.197257  7.749417  9.113300  9.971566  9.258017  7.600139
 [8]  8.579075  8.744753  8.827933
> rowMax(tmp5,na.rm=TRUE)
 [1] 464.99434  85.24995  85.40378  88.45619  91.03060  88.53700  80.66997
 [8]  83.99956  90.77826  91.84293
> rowMin(tmp5,na.rm=TRUE)
 [1] 58.58596 58.11932 58.78911 57.41838 55.11969 55.36396 56.22818 55.32191
 [9] 61.90309 55.46082
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 111.34822  74.17721  74.16690  67.93275  69.37164  69.02384  70.57035
 [8]  73.36743  71.37498  67.80706  70.83816  72.24650  68.87019  67.63518
[15]  71.20919  74.30502  65.88497  70.90768  75.15545  68.69550
> colSums(tmp5,na.rm=TRUE)
 [1] 1113.4822  741.7721  741.6690  679.3275  693.7164  690.2384  705.7035
 [8]  733.6743  713.7498  678.0706  708.3816  722.4650  688.7019  676.3518
[15]  640.8827  743.0502  658.8497  709.0768  751.5545  686.9550
> colVars(tmp5,na.rm=TRUE)
 [1] 15538.32730    84.59032    77.21395   129.40466    83.60870    62.54662
 [7]    58.19105    63.20916    60.84326    27.96594    74.93523    84.55385
[13]    67.24251   124.28847   103.41612   100.07890    50.44023    40.49915
[19]   104.35443    42.88051
> colSd(tmp5,na.rm=TRUE)
 [1] 124.652827   9.197299   8.787147  11.375617   9.143779   7.908642
 [7]   7.628306   7.950419   7.800209   5.288283   8.656514   9.195317
[13]   8.200153  11.148474  10.169372  10.003944   7.102129   6.363894
[19]  10.215402   6.548321
> colMax(tmp5,na.rm=TRUE)
 [1] 464.99434  85.24995  91.84293  84.89377  85.40378  80.51704  83.99956
 [8]  84.71253  81.72422  76.69740  81.56283  88.53700  83.84552  85.01580
[15]  90.77826  88.84172  77.23835  82.55815  88.45619  77.34397
> colMin(tmp5,na.rm=TRUE)
 [1] 58.11932 58.67210 60.58426 55.32191 56.93134 57.06569 61.87810 61.40918
 [9] 60.11767 57.97779 57.42573 56.48074 58.42753 55.11969 58.58596 55.46082
[17] 57.41838 59.93557 60.66134 56.22818
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1] 90.70728 67.52219 71.07122 73.06521      NaN 70.29395 67.29098 70.61734
 [9] 73.87499 70.91064
> rowSums(tmp5,na.rm=TRUE)
 [1] 1814.146 1350.444 1421.424 1461.304    0.000 1405.879 1345.820 1412.347
 [9] 1477.500 1418.213
> rowVars(tmp5,na.rm=TRUE)
 [1] 7834.78335   67.19502   60.05346   83.05223         NA   85.71088
 [7]   57.76211   73.60053   76.47071   77.93239
> rowSd(tmp5,na.rm=TRUE)
 [1] 88.514312  8.197257  7.749417  9.113300        NA  9.258017  7.600139
 [8]  8.579075  8.744753  8.827933
> rowMax(tmp5,na.rm=TRUE)
 [1] 464.99434  85.24995  85.40378  88.45619        NA  88.53700  80.66997
 [8]  83.99956  90.77826  91.84293
> rowMin(tmp5,na.rm=TRUE)
 [1] 58.58596 58.11932 58.78911 57.41838       NA 55.36396 56.22818 55.32191
 [9] 61.90309 55.46082
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1] 113.60574  74.22730  74.40008  69.07048  69.46703  69.87741  71.17600
 [8]  73.57022  70.41926  68.57102  69.84511  71.23416  68.60257  69.02579
[15]       NaN  72.68984  65.81693  70.99051  74.34799  68.19517
> colSums(tmp5,na.rm=TRUE)
 [1] 1022.4516  668.0457  669.6007  621.6343  625.2033  628.8967  640.5840
 [8]  662.1320  633.7733  617.1391  628.6060  641.1074  617.4231  621.2321
[15]    0.0000  654.2085  592.3524  638.9146  669.1319  613.7565
> colVars(tmp5,na.rm=TRUE)
 [1] 17423.28406    95.13588    86.25403   131.01792    93.95741    62.16846
 [7]    61.33840    70.64766    58.17293    24.89584    73.20787    83.59377
[13]    74.84210   118.06931          NA    83.23940    56.69317    45.48436
[19]   110.06380    45.42440
> colSd(tmp5,na.rm=TRUE)
 [1] 131.997288   9.753762   9.287305  11.446306   9.693163   7.884698
 [7]   7.831884   8.405217   7.627118   4.989573   8.556160   9.142963
[13]   8.651133  10.865970         NA   9.123563   7.529487   6.744209
[19]  10.491130   6.739763
> colMax(tmp5,na.rm=TRUE)
 [1] 464.99434  85.24995  91.84293  84.89377  85.40378  80.51704  83.99956
 [8]  84.71253  81.72422  76.69740  81.56283  88.53700  83.84552  85.01580
[15]      -Inf  84.26652  77.23835  82.55815  88.45619  77.34397
> colMin(tmp5,na.rm=TRUE)
 [1] 58.11932 58.67210 60.58426 55.32191 56.93134 57.06569 61.87810 61.40918
 [9] 60.11767 57.97779 57.42573 56.48074 58.42753 55.36396      Inf 55.46082
[17] 57.41838 59.93557 60.66134 56.22818
> 
> 
> 
> 
> 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] 204.0558 204.0838 261.8932 147.9870 161.1941 194.1661 152.6500 219.8944
 [9] 200.4612 229.9148
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 204.0558 204.0838 261.8932 147.9870 161.1941 194.1661 152.6500 219.8944
 [9] 200.4612 229.9148
> 
> 
> 
> copymatrix <- matrix(rnorm(200,150,15),10,20)
> 
> tmp5[1:10,1:20] <- copymatrix
> which.row <- 1
> which.col  <- 3
> cat(which.row," ",which.col,"\n")
1   3 
> tmp5[which.row,which.col] <- NA
> copymatrix[which.row,which.col] <- NA
> 
> colVars(tmp5,na.rm=TRUE)-apply(copymatrix,2,var,na.rm=TRUE)
 [1]  5.684342e-14  0.000000e+00 -8.526513e-14 -5.684342e-14 -5.684342e-14
 [6] -1.136868e-13  0.000000e+00  1.136868e-13 -5.684342e-14 -5.684342e-14
[11]  5.684342e-14  0.000000e+00  5.684342e-14  1.989520e-13 -1.136868e-13
[16]  0.000000e+00 -5.684342e-14  5.684342e-14  2.842171e-14 -8.526513e-14
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> ## making sure these things agree
> ##
> ## first when there is no NA
> 
> 
> 
> agree.checks <- function(buff.matrix,r.matrix,err.tol=1e-10){
+ 
+   if (Max(buff.matrix,na.rm=TRUE) != max(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Max")
+   }
+   
+ 
+   if (Min(buff.matrix,na.rm=TRUE) != min(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Min")
+   }
+ 
+ 
+   if (abs(Sum(buff.matrix,na.rm=TRUE)- sum(r.matrix,na.rm=TRUE)) > err.tol){
+ 
+     cat(Sum(buff.matrix,na.rm=TRUE),"\n")
+     cat(sum(r.matrix,na.rm=TRUE),"\n")
+     cat(Sum(buff.matrix,na.rm=TRUE) - sum(r.matrix,na.rm=TRUE),"\n")
+     
+     stop("No agreement in Sum")
+   }
+   
+   if (abs(mean(buff.matrix,na.rm=TRUE) - mean(r.matrix,na.rm=TRUE)) > err.tol){
+     stop("No agreement in mean")
+   }
+   
+   
+   if(abs(Var(buff.matrix,na.rm=TRUE) - var(as.vector(r.matrix),na.rm=TRUE)) > err.tol){
+     stop("No agreement in Var")
+   }
+   
+   
+ 
+   if(any(abs(rowMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,mean,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowMeans")
+   }
+   
+   
+   if(any(abs(colMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,mean,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colMeans")
+   }
+   
+   
+   if(any(abs(rowSums(buff.matrix,na.rm=TRUE)  -  apply(r.matrix,1,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in rowSums")
+   }
+   
+   
+   if(any(abs(colSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colSums")
+   }
+   
+   ### this is to get around the fact that R doesn't like to compute NA on an entire vector of NA when 
+   ### computing variance
+   my.Var <- function(x,na.rm=FALSE){
+    if (all(is.na(x))){
+      return(NA)
+    } else {
+      var(x,na.rm=na.rm)
+    }
+ 
+   }
+   
+   if(any(abs(rowVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+   
+   
+   if(any(abs(colVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+ 
+ 
+   if(any(abs(rowMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+ 
+   if(any(abs(colMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+   
+   
+   if(any(abs(rowMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+   
+ 
+   if(any(abs(colMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+ 
+   if(any(abs(colMedians(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,median,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMedian")
+   }
+ 
+   if(any(abs(colRanges(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,range,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colRanges")
+   }
+ 
+ 
+   
+ }
> 
> 
> 
> 
> 
> 
> 
> 
> 
> for (rep in 1:20){
+   copymatrix <- matrix(rnorm(200,150,15),10,20)
+   
+   tmp5[1:10,1:20] <- copymatrix
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ## now lets assign some NA values and check agreement
+ 
+   which.row <- sample(1:10,1,replace=TRUE)
+   which.col  <- sample(1:20,1,replace=TRUE)
+   
+   cat(which.row," ",which.col,"\n")
+   
+   tmp5[which.row,which.col] <- NA
+   copymatrix[which.row,which.col] <- NA
+   
+   agree.checks(tmp5,copymatrix)
+ 
+   ## make an entire row NA
+   tmp5[which.row,] <- NA
+   copymatrix[which.row,] <- NA
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ### also make an entire col NA
+   tmp5[,which.col] <- NA
+   copymatrix[,which.col] <- NA
+ 
+   agree.checks(tmp5,copymatrix)
+ 
+   ### now make 1 element non NA with NA in the rest of row and column
+ 
+   tmp5[which.row,which.col] <- rnorm(1,150,15)
+   copymatrix[which.row,which.col] <- tmp5[which.row,which.col]
+ 
+   agree.checks(tmp5,copymatrix)
+ }
1   20 
9   5 
8   16 
5   6 
9   15 
3   9 
2   11 
9   10 
1   10 
8   16 
4   15 
1   10 
10   3 
10   1 
1   1 
2   11 
6   3 
1   9 
4   10 
7   5 
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.441612
> Min(tmp)
[1] -1.6096
> mean(tmp)
[1] 0.1791568
> Sum(tmp)
[1] 17.91568
> Var(tmp)
[1] 0.7810934
> 
> rowMeans(tmp)
[1] 0.1791568
> rowSums(tmp)
[1] 17.91568
> rowVars(tmp)
[1] 0.7810934
> rowSd(tmp)
[1] 0.8837949
> rowMax(tmp)
[1] 2.441612
> rowMin(tmp)
[1] -1.6096
> 
> colMeans(tmp)
  [1] -0.42464459  0.99016255  1.08525230 -0.10625682 -0.32271859 -0.64147094
  [7]  0.73294935 -0.55666225  1.45364617 -0.66749480 -1.20162268  1.13613645
 [13]  0.29086137  0.34714121  0.14182663  0.39035021  2.03654939 -1.25794870
 [19]  0.60338537 -1.45128130  0.27796395 -0.62642875  0.15300882 -0.92967646
 [25] -0.38124110  0.69365233  0.71062409 -0.04264782  0.67434780 -1.60960049
 [31]  0.70830640  0.45755614 -0.65853666  1.35623939  0.09177315 -0.99034480
 [37] -0.66931200  0.69816523  0.19460619  0.62604942  1.61950557  0.92885834
 [43]  2.01548482 -0.52615822  0.25025615  0.47859776  1.13614424 -1.04002674
 [49]  1.33186824  0.21525641 -1.06100694  0.17012015 -0.80601323  1.88225053
 [55] -1.53906088  0.04534964 -0.56125396 -0.48685211 -0.43246677  0.49412882
 [61] -0.42129255 -1.07269568  0.52843487  2.01160540 -0.70292865  0.05916848
 [67] -0.28789387  1.38779182  0.44787583  0.21467208  2.44161178  0.99771084
 [73]  0.37673521 -0.48232660  0.38158423  0.96343145  0.66069493  0.56527591
 [79]  0.38729609  0.05220781 -0.80011532  1.30743011 -0.55059583  1.16496686
 [85] -0.58548807 -0.91154030  0.75890995  1.12063409  0.51995315  0.24466484
 [91]  0.21628320 -0.42056343 -1.36728400  0.64356075 -0.83918854  1.00439004
 [97]  0.18572528  0.54008957  0.71746109 -0.97022477
> colSums(tmp)
  [1] -0.42464459  0.99016255  1.08525230 -0.10625682 -0.32271859 -0.64147094
  [7]  0.73294935 -0.55666225  1.45364617 -0.66749480 -1.20162268  1.13613645
 [13]  0.29086137  0.34714121  0.14182663  0.39035021  2.03654939 -1.25794870
 [19]  0.60338537 -1.45128130  0.27796395 -0.62642875  0.15300882 -0.92967646
 [25] -0.38124110  0.69365233  0.71062409 -0.04264782  0.67434780 -1.60960049
 [31]  0.70830640  0.45755614 -0.65853666  1.35623939  0.09177315 -0.99034480
 [37] -0.66931200  0.69816523  0.19460619  0.62604942  1.61950557  0.92885834
 [43]  2.01548482 -0.52615822  0.25025615  0.47859776  1.13614424 -1.04002674
 [49]  1.33186824  0.21525641 -1.06100694  0.17012015 -0.80601323  1.88225053
 [55] -1.53906088  0.04534964 -0.56125396 -0.48685211 -0.43246677  0.49412882
 [61] -0.42129255 -1.07269568  0.52843487  2.01160540 -0.70292865  0.05916848
 [67] -0.28789387  1.38779182  0.44787583  0.21467208  2.44161178  0.99771084
 [73]  0.37673521 -0.48232660  0.38158423  0.96343145  0.66069493  0.56527591
 [79]  0.38729609  0.05220781 -0.80011532  1.30743011 -0.55059583  1.16496686
 [85] -0.58548807 -0.91154030  0.75890995  1.12063409  0.51995315  0.24466484
 [91]  0.21628320 -0.42056343 -1.36728400  0.64356075 -0.83918854  1.00439004
 [97]  0.18572528  0.54008957  0.71746109 -0.97022477
> 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.42464459  0.99016255  1.08525230 -0.10625682 -0.32271859 -0.64147094
  [7]  0.73294935 -0.55666225  1.45364617 -0.66749480 -1.20162268  1.13613645
 [13]  0.29086137  0.34714121  0.14182663  0.39035021  2.03654939 -1.25794870
 [19]  0.60338537 -1.45128130  0.27796395 -0.62642875  0.15300882 -0.92967646
 [25] -0.38124110  0.69365233  0.71062409 -0.04264782  0.67434780 -1.60960049
 [31]  0.70830640  0.45755614 -0.65853666  1.35623939  0.09177315 -0.99034480
 [37] -0.66931200  0.69816523  0.19460619  0.62604942  1.61950557  0.92885834
 [43]  2.01548482 -0.52615822  0.25025615  0.47859776  1.13614424 -1.04002674
 [49]  1.33186824  0.21525641 -1.06100694  0.17012015 -0.80601323  1.88225053
 [55] -1.53906088  0.04534964 -0.56125396 -0.48685211 -0.43246677  0.49412882
 [61] -0.42129255 -1.07269568  0.52843487  2.01160540 -0.70292865  0.05916848
 [67] -0.28789387  1.38779182  0.44787583  0.21467208  2.44161178  0.99771084
 [73]  0.37673521 -0.48232660  0.38158423  0.96343145  0.66069493  0.56527591
 [79]  0.38729609  0.05220781 -0.80011532  1.30743011 -0.55059583  1.16496686
 [85] -0.58548807 -0.91154030  0.75890995  1.12063409  0.51995315  0.24466484
 [91]  0.21628320 -0.42056343 -1.36728400  0.64356075 -0.83918854  1.00439004
 [97]  0.18572528  0.54008957  0.71746109 -0.97022477
> colMin(tmp)
  [1] -0.42464459  0.99016255  1.08525230 -0.10625682 -0.32271859 -0.64147094
  [7]  0.73294935 -0.55666225  1.45364617 -0.66749480 -1.20162268  1.13613645
 [13]  0.29086137  0.34714121  0.14182663  0.39035021  2.03654939 -1.25794870
 [19]  0.60338537 -1.45128130  0.27796395 -0.62642875  0.15300882 -0.92967646
 [25] -0.38124110  0.69365233  0.71062409 -0.04264782  0.67434780 -1.60960049
 [31]  0.70830640  0.45755614 -0.65853666  1.35623939  0.09177315 -0.99034480
 [37] -0.66931200  0.69816523  0.19460619  0.62604942  1.61950557  0.92885834
 [43]  2.01548482 -0.52615822  0.25025615  0.47859776  1.13614424 -1.04002674
 [49]  1.33186824  0.21525641 -1.06100694  0.17012015 -0.80601323  1.88225053
 [55] -1.53906088  0.04534964 -0.56125396 -0.48685211 -0.43246677  0.49412882
 [61] -0.42129255 -1.07269568  0.52843487  2.01160540 -0.70292865  0.05916848
 [67] -0.28789387  1.38779182  0.44787583  0.21467208  2.44161178  0.99771084
 [73]  0.37673521 -0.48232660  0.38158423  0.96343145  0.66069493  0.56527591
 [79]  0.38729609  0.05220781 -0.80011532  1.30743011 -0.55059583  1.16496686
 [85] -0.58548807 -0.91154030  0.75890995  1.12063409  0.51995315  0.24466484
 [91]  0.21628320 -0.42056343 -1.36728400  0.64356075 -0.83918854  1.00439004
 [97]  0.18572528  0.54008957  0.71746109 -0.97022477
> colMedians(tmp)
  [1] -0.42464459  0.99016255  1.08525230 -0.10625682 -0.32271859 -0.64147094
  [7]  0.73294935 -0.55666225  1.45364617 -0.66749480 -1.20162268  1.13613645
 [13]  0.29086137  0.34714121  0.14182663  0.39035021  2.03654939 -1.25794870
 [19]  0.60338537 -1.45128130  0.27796395 -0.62642875  0.15300882 -0.92967646
 [25] -0.38124110  0.69365233  0.71062409 -0.04264782  0.67434780 -1.60960049
 [31]  0.70830640  0.45755614 -0.65853666  1.35623939  0.09177315 -0.99034480
 [37] -0.66931200  0.69816523  0.19460619  0.62604942  1.61950557  0.92885834
 [43]  2.01548482 -0.52615822  0.25025615  0.47859776  1.13614424 -1.04002674
 [49]  1.33186824  0.21525641 -1.06100694  0.17012015 -0.80601323  1.88225053
 [55] -1.53906088  0.04534964 -0.56125396 -0.48685211 -0.43246677  0.49412882
 [61] -0.42129255 -1.07269568  0.52843487  2.01160540 -0.70292865  0.05916848
 [67] -0.28789387  1.38779182  0.44787583  0.21467208  2.44161178  0.99771084
 [73]  0.37673521 -0.48232660  0.38158423  0.96343145  0.66069493  0.56527591
 [79]  0.38729609  0.05220781 -0.80011532  1.30743011 -0.55059583  1.16496686
 [85] -0.58548807 -0.91154030  0.75890995  1.12063409  0.51995315  0.24466484
 [91]  0.21628320 -0.42056343 -1.36728400  0.64356075 -0.83918854  1.00439004
 [97]  0.18572528  0.54008957  0.71746109 -0.97022477
> colRanges(tmp)
           [,1]      [,2]     [,3]       [,4]       [,5]       [,6]      [,7]
[1,] -0.4246446 0.9901626 1.085252 -0.1062568 -0.3227186 -0.6414709 0.7329494
[2,] -0.4246446 0.9901626 1.085252 -0.1062568 -0.3227186 -0.6414709 0.7329494
           [,8]     [,9]      [,10]     [,11]    [,12]     [,13]     [,14]
[1,] -0.5566622 1.453646 -0.6674948 -1.201623 1.136136 0.2908614 0.3471412
[2,] -0.5566622 1.453646 -0.6674948 -1.201623 1.136136 0.2908614 0.3471412
         [,15]     [,16]    [,17]     [,18]     [,19]     [,20]    [,21]
[1,] 0.1418266 0.3903502 2.036549 -1.257949 0.6033854 -1.451281 0.277964
[2,] 0.1418266 0.3903502 2.036549 -1.257949 0.6033854 -1.451281 0.277964
          [,22]     [,23]      [,24]      [,25]     [,26]     [,27]       [,28]
[1,] -0.6264288 0.1530088 -0.9296765 -0.3812411 0.6936523 0.7106241 -0.04264782
[2,] -0.6264288 0.1530088 -0.9296765 -0.3812411 0.6936523 0.7106241 -0.04264782
         [,29]   [,30]     [,31]     [,32]      [,33]    [,34]      [,35]
[1,] 0.6743478 -1.6096 0.7083064 0.4575561 -0.6585367 1.356239 0.09177315
[2,] 0.6743478 -1.6096 0.7083064 0.4575561 -0.6585367 1.356239 0.09177315
          [,36]     [,37]     [,38]     [,39]     [,40]    [,41]     [,42]
[1,] -0.9903448 -0.669312 0.6981652 0.1946062 0.6260494 1.619506 0.9288583
[2,] -0.9903448 -0.669312 0.6981652 0.1946062 0.6260494 1.619506 0.9288583
        [,43]      [,44]     [,45]     [,46]    [,47]     [,48]    [,49]
[1,] 2.015485 -0.5261582 0.2502561 0.4785978 1.136144 -1.040027 1.331868
[2,] 2.015485 -0.5261582 0.2502561 0.4785978 1.136144 -1.040027 1.331868
         [,50]     [,51]     [,52]      [,53]    [,54]     [,55]      [,56]
[1,] 0.2152564 -1.061007 0.1701202 -0.8060132 1.882251 -1.539061 0.04534964
[2,] 0.2152564 -1.061007 0.1701202 -0.8060132 1.882251 -1.539061 0.04534964
         [,57]      [,58]      [,59]     [,60]      [,61]     [,62]     [,63]
[1,] -0.561254 -0.4868521 -0.4324668 0.4941288 -0.4212926 -1.072696 0.5284349
[2,] -0.561254 -0.4868521 -0.4324668 0.4941288 -0.4212926 -1.072696 0.5284349
        [,64]      [,65]      [,66]      [,67]    [,68]     [,69]     [,70]
[1,] 2.011605 -0.7029286 0.05916848 -0.2878939 1.387792 0.4478758 0.2146721
[2,] 2.011605 -0.7029286 0.05916848 -0.2878939 1.387792 0.4478758 0.2146721
        [,71]     [,72]     [,73]      [,74]     [,75]     [,76]     [,77]
[1,] 2.441612 0.9977108 0.3767352 -0.4823266 0.3815842 0.9634315 0.6606949
[2,] 2.441612 0.9977108 0.3767352 -0.4823266 0.3815842 0.9634315 0.6606949
         [,78]     [,79]      [,80]      [,81]   [,82]      [,83]    [,84]
[1,] 0.5652759 0.3872961 0.05220781 -0.8001153 1.30743 -0.5505958 1.164967
[2,] 0.5652759 0.3872961 0.05220781 -0.8001153 1.30743 -0.5505958 1.164967
          [,85]      [,86]   [,87]    [,88]     [,89]     [,90]     [,91]
[1,] -0.5854881 -0.9115403 0.75891 1.120634 0.5199531 0.2446648 0.2162832
[2,] -0.5854881 -0.9115403 0.75891 1.120634 0.5199531 0.2446648 0.2162832
          [,92]     [,93]     [,94]      [,95]   [,96]     [,97]     [,98]
[1,] -0.4205634 -1.367284 0.6435608 -0.8391885 1.00439 0.1857253 0.5400896
[2,] -0.4205634 -1.367284 0.6435608 -0.8391885 1.00439 0.1857253 0.5400896
         [,99]     [,100]
[1,] 0.7174611 -0.9702248
[2,] 0.7174611 -0.9702248
> 
> 
> Max(tmp2)
[1] 2.15918
> Min(tmp2)
[1] -2.548254
> mean(tmp2)
[1] 0.005402214
> Sum(tmp2)
[1] 0.5402214
> Var(tmp2)
[1] 1.045598
> 
> rowMeans(tmp2)
  [1] -0.573621155  0.206356817  2.055282973  0.797845219 -0.820460849
  [6] -0.564273705  1.587732968  0.346864716 -0.024132813 -1.546744545
 [11]  0.922989238 -1.980902836 -0.190292738  1.426447545 -0.008140772
 [16]  0.040399939  1.519059630 -1.475328834 -0.581614670 -1.122675016
 [21]  0.067155919 -0.172183128 -0.922643172 -0.776063376  0.183435630
 [26]  1.821607289  1.811787613  0.184133927 -0.055988365 -0.851462815
 [31] -1.743596468 -1.800942101  0.784649061 -0.150548553 -0.243114959
 [36]  0.813584784  0.508044172 -0.816747234  0.961470086  0.929038669
 [41]  1.831923473 -0.350473924 -0.773118200  0.514173120 -0.900143186
 [46] -1.191896266  1.580899910 -0.787080301 -1.003623881  0.997958443
 [51]  0.258241957 -0.424976629  0.245803174  0.932051246  0.614963409
 [56] -0.251736546  0.782020574  0.047456531  1.259994363 -1.494509071
 [61]  1.105873488  0.446233567  0.081884944 -0.334785818 -0.591548836
 [66] -0.287680550 -0.299375815 -0.194834218  0.479486045  1.029841088
 [71]  0.123065941 -0.450869793  0.762181067 -0.205776056 -1.121704610
 [76]  0.231355122 -2.548254447  2.159180093 -0.415946428  0.408271439
 [81] -0.282377024 -0.835236260  1.872784042 -1.171898260 -2.022368589
 [86] -0.426563561 -0.174408867 -0.113063451 -1.249589242 -2.234545697
 [91] -0.195352787  0.734221493  1.631300328  1.051520144  0.321571722
 [96] -1.083932597  1.102418183  0.616155786  0.971193292 -0.782539762
> rowSums(tmp2)
  [1] -0.573621155  0.206356817  2.055282973  0.797845219 -0.820460849
  [6] -0.564273705  1.587732968  0.346864716 -0.024132813 -1.546744545
 [11]  0.922989238 -1.980902836 -0.190292738  1.426447545 -0.008140772
 [16]  0.040399939  1.519059630 -1.475328834 -0.581614670 -1.122675016
 [21]  0.067155919 -0.172183128 -0.922643172 -0.776063376  0.183435630
 [26]  1.821607289  1.811787613  0.184133927 -0.055988365 -0.851462815
 [31] -1.743596468 -1.800942101  0.784649061 -0.150548553 -0.243114959
 [36]  0.813584784  0.508044172 -0.816747234  0.961470086  0.929038669
 [41]  1.831923473 -0.350473924 -0.773118200  0.514173120 -0.900143186
 [46] -1.191896266  1.580899910 -0.787080301 -1.003623881  0.997958443
 [51]  0.258241957 -0.424976629  0.245803174  0.932051246  0.614963409
 [56] -0.251736546  0.782020574  0.047456531  1.259994363 -1.494509071
 [61]  1.105873488  0.446233567  0.081884944 -0.334785818 -0.591548836
 [66] -0.287680550 -0.299375815 -0.194834218  0.479486045  1.029841088
 [71]  0.123065941 -0.450869793  0.762181067 -0.205776056 -1.121704610
 [76]  0.231355122 -2.548254447  2.159180093 -0.415946428  0.408271439
 [81] -0.282377024 -0.835236260  1.872784042 -1.171898260 -2.022368589
 [86] -0.426563561 -0.174408867 -0.113063451 -1.249589242 -2.234545697
 [91] -0.195352787  0.734221493  1.631300328  1.051520144  0.321571722
 [96] -1.083932597  1.102418183  0.616155786  0.971193292 -0.782539762
> 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.573621155  0.206356817  2.055282973  0.797845219 -0.820460849
  [6] -0.564273705  1.587732968  0.346864716 -0.024132813 -1.546744545
 [11]  0.922989238 -1.980902836 -0.190292738  1.426447545 -0.008140772
 [16]  0.040399939  1.519059630 -1.475328834 -0.581614670 -1.122675016
 [21]  0.067155919 -0.172183128 -0.922643172 -0.776063376  0.183435630
 [26]  1.821607289  1.811787613  0.184133927 -0.055988365 -0.851462815
 [31] -1.743596468 -1.800942101  0.784649061 -0.150548553 -0.243114959
 [36]  0.813584784  0.508044172 -0.816747234  0.961470086  0.929038669
 [41]  1.831923473 -0.350473924 -0.773118200  0.514173120 -0.900143186
 [46] -1.191896266  1.580899910 -0.787080301 -1.003623881  0.997958443
 [51]  0.258241957 -0.424976629  0.245803174  0.932051246  0.614963409
 [56] -0.251736546  0.782020574  0.047456531  1.259994363 -1.494509071
 [61]  1.105873488  0.446233567  0.081884944 -0.334785818 -0.591548836
 [66] -0.287680550 -0.299375815 -0.194834218  0.479486045  1.029841088
 [71]  0.123065941 -0.450869793  0.762181067 -0.205776056 -1.121704610
 [76]  0.231355122 -2.548254447  2.159180093 -0.415946428  0.408271439
 [81] -0.282377024 -0.835236260  1.872784042 -1.171898260 -2.022368589
 [86] -0.426563561 -0.174408867 -0.113063451 -1.249589242 -2.234545697
 [91] -0.195352787  0.734221493  1.631300328  1.051520144  0.321571722
 [96] -1.083932597  1.102418183  0.616155786  0.971193292 -0.782539762
> rowMin(tmp2)
  [1] -0.573621155  0.206356817  2.055282973  0.797845219 -0.820460849
  [6] -0.564273705  1.587732968  0.346864716 -0.024132813 -1.546744545
 [11]  0.922989238 -1.980902836 -0.190292738  1.426447545 -0.008140772
 [16]  0.040399939  1.519059630 -1.475328834 -0.581614670 -1.122675016
 [21]  0.067155919 -0.172183128 -0.922643172 -0.776063376  0.183435630
 [26]  1.821607289  1.811787613  0.184133927 -0.055988365 -0.851462815
 [31] -1.743596468 -1.800942101  0.784649061 -0.150548553 -0.243114959
 [36]  0.813584784  0.508044172 -0.816747234  0.961470086  0.929038669
 [41]  1.831923473 -0.350473924 -0.773118200  0.514173120 -0.900143186
 [46] -1.191896266  1.580899910 -0.787080301 -1.003623881  0.997958443
 [51]  0.258241957 -0.424976629  0.245803174  0.932051246  0.614963409
 [56] -0.251736546  0.782020574  0.047456531  1.259994363 -1.494509071
 [61]  1.105873488  0.446233567  0.081884944 -0.334785818 -0.591548836
 [66] -0.287680550 -0.299375815 -0.194834218  0.479486045  1.029841088
 [71]  0.123065941 -0.450869793  0.762181067 -0.205776056 -1.121704610
 [76]  0.231355122 -2.548254447  2.159180093 -0.415946428  0.408271439
 [81] -0.282377024 -0.835236260  1.872784042 -1.171898260 -2.022368589
 [86] -0.426563561 -0.174408867 -0.113063451 -1.249589242 -2.234545697
 [91] -0.195352787  0.734221493  1.631300328  1.051520144  0.321571722
 [96] -1.083932597  1.102418183  0.616155786  0.971193292 -0.782539762
> 
> colMeans(tmp2)
[1] 0.005402214
> colSums(tmp2)
[1] 0.5402214
> colVars(tmp2)
[1] 1.045598
> colSd(tmp2)
[1] 1.022545
> colMax(tmp2)
[1] 2.15918
> colMin(tmp2)
[1] -2.548254
> colMedians(tmp2)
[1] -0.04006059
> colRanges(tmp2)
          [,1]
[1,] -2.548254
[2,]  2.159180
> 
> 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] -3.8054290 -0.9128910  0.7994604 -2.7560953 -3.1506105  2.2143124
 [7]  1.4470249 -5.2277862 -0.2586874  0.9519380
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -1.9317544
[2,] -1.0430461
[3,] -0.6104373
[4,]  0.6205877
[5,]  0.9933923
> 
> rowApply(tmp,sum)
 [1]  4.5521841 -3.4144699 -1.7427064  2.4991311 -0.6950528  0.4420584
 [7] -5.4467342  0.9082813 -2.1394404 -5.6620150
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    7    4   10    9    2    4    4    6    1     2
 [2,]    9    6    8    7    6    2    9    5    7     1
 [3,]   10   10    2    3    9    1    6   10    9     6
 [4,]    2    1    1    8    1    7   10    7    3     4
 [5,]    8    5    9    5    5    5    5    2    2     3
 [6,]    1    3    6   10   10    6    8    8    4     8
 [7,]    5    8    5    2    7    9    7    4   10     7
 [8,]    3    2    7    6    8    3    1    3    5     5
 [9,]    4    9    4    4    4   10    2    1    6    10
[10,]    6    7    3    1    3    8    3    9    8     9
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1] -2.9876938  0.5018204 -1.5460037 -2.7696826  0.1807457  2.0068474
 [7] -1.0068284 -3.0872573  1.1216364 -1.6609837 -1.4036598  3.2862530
[13]  0.4724979 -3.3001613  3.6132515 -3.2872148 -2.1902934 -2.1615595
[19] -3.4320122  0.4764875
> colApply(tmp,quantile)[,1]
            [,1]
[1,] -2.23576116
[2,] -1.93086746
[3,] -0.12201672
[4,]  0.01578508
[5,]  1.28516652
> 
> rowApply(tmp,sum)
[1]   3.584063   1.192918 -10.661881  -5.534352  -5.754559
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]   10    1   13   19    2
[2,]    6   18    9   20    7
[3,]   12   13   15   12    1
[4,]    5    8    2   11    9
[5,]   17    2   20    7   16
> 
> 
> as.matrix(tmp)
            [,1]       [,2]        [,3]        [,4]        [,5]       [,6]
[1,]  0.01578508 -0.3669628  0.34709594 -0.44197096  1.30764068  0.4827398
[2,] -2.23576116  0.7932049  0.32550512 -0.02816994 -1.20365646 -0.5546206
[3,] -0.12201672 -0.5982093 -0.01474863 -1.46039922  0.62526709 -0.1091478
[4,]  1.28516652  1.2882630 -0.08394506 -0.27702268 -0.57017034  0.4370530
[5,] -1.93086746 -0.6144754 -2.11991107 -0.56211977  0.02166478  1.7508231
           [,7]       [,8]       [,9]      [,10]       [,11]      [,12]
[1,] -0.2999962  0.5428039  0.1969974  0.3501085  0.74256129  2.0637392
[2,]  1.6243156 -0.2688051  0.4617648  0.2871674  0.45236644  0.2856852
[3,]  0.2358996 -1.3299606  0.2850775 -0.5724086  0.01515964 -0.6556767
[4,] -1.8510524 -1.8249240  0.2886515 -0.5277762 -1.23387414  0.1131119
[5,] -0.7159950 -0.2063715 -0.1108547 -1.1980747 -1.37987300  1.4793934
          [,13]       [,14]      [,15]      [,16]      [,17]      [,18]
[1,]  1.3645783 -0.64030130  1.7403764 -0.8160839 -0.3440465 -1.4519935
[2,]  0.5396474 -0.05828539  1.0188745 -0.7904165 -0.4961532  0.3092677
[3,] -1.6020724 -1.06012880 -0.4907650 -1.0093607 -0.5356017  0.3197927
[4,]  0.7664268 -1.36068254  0.3310693 -0.5357772 -0.4257564 -0.9509299
[5,] -0.5960822 -0.18076323  1.0136963 -0.1355765 -0.3887355 -0.3876966
          [,19]      [,20]
[1,] -0.8892565 -0.3197523
[2,]  0.4309330  0.3000545
[3,] -1.2896169 -1.2929640
[4,] -0.9915154  0.5893323
[5,] -0.6925565  1.1998169
> 
> 
> 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 :  653  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.4114934 0.1953823 1.538321 1.088028 0.006413766 -1.308895 -1.530725
         col8     col9     col10    col11      col12   col13     col14
row1 1.655984 1.849071 0.3939849 1.106586 -0.9146741 3.05522 0.1449153
         col15     col16      col17      col18     col19     col20
row1 -2.079052 -1.249165 -0.4171696 -0.2727197 -1.529551 0.2314724
> tmp[,"col10"]
           col10
row1  0.39398492
row2 -0.15232705
row3  1.33687133
row4  1.41276484
row5 -0.08422925
> tmp[c("row1","row5"),]
           col1      col2     col3     col4         col5      col6      col7
row1 -0.4114934 0.1953823 1.538321 1.088028  0.006413766 -1.308895 -1.530725
row5  3.6848126 0.7362953 1.341923 2.273176 -1.173037148  1.205488 -1.070863
           col8       col9       col10     col11      col12     col13
row1  1.6559845  1.8490708  0.39398492 1.1065865 -0.9146741  3.055220
row5 -0.5729811 -0.5778124 -0.08422925 0.1384729  0.2463048 -0.437222
          col14     col15      col16      col17       col18       col19
row1  0.1449153 -2.079052 -1.2491653 -0.4171696 -0.27271973 -1.52955104
row5 -0.4409244 -1.366208  0.9291727  0.1792004 -0.06377782 -0.05355313
         col20
row1 0.2314724
row5 1.1358474
> tmp[,c("col6","col20")]
             col6       col20
row1 -1.308895144  0.23147244
row2 -1.390327158 -0.02756868
row3  0.024489742 -2.57910831
row4 -0.009139677  0.70385981
row5  1.205487808  1.13584743
> tmp[c("row1","row5"),c("col6","col20")]
          col6     col20
row1 -1.308895 0.2314724
row5  1.205488 1.1358474
> 
> 
> 
> 
> tmp["row1",] <- rnorm(20,mean=10)
> tmp[,"col10"] <- rnorm(5,mean=30)
> tmp[c("row1","row5"),] <- rnorm(40,mean=50)
> tmp[,c("col6","col20")] <- rnorm(10,mean=75)
> tmp[c("row1","row5"),c("col6","col20")]  <- rnorm(4,mean=105)
> 
> tmp["row1",]
         col1    col2     col3     col4     col5     col6     col7     col8
row1 48.58652 50.0365 50.11833 50.75492 49.88697 105.0985 49.23592 48.67574
         col9    col10    col11   col12    col13    col14    col15    col16
row1 49.81434 51.45664 50.43793 50.3876 47.91636 49.45828 49.33172 50.14578
        col17    col18    col19    col20
row1 50.23519 50.97639 50.76956 105.7807
> tmp[,"col10"]
        col10
row1 51.45664
row2 31.38321
row3 30.07554
row4 30.01044
row5 48.43020
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 48.58652 50.03650 50.11833 50.75492 49.88697 105.0985 49.23592 48.67574
row5 51.01502 52.05356 49.47004 52.01470 49.90302 106.4264 49.14135 50.79392
         col9    col10    col11    col12    col13    col14    col15    col16
row1 49.81434 51.45664 50.43793 50.38760 47.91636 49.45828 49.33172 50.14578
row5 51.30887 48.43020 49.66474 50.30448 49.23130 50.55983 49.81163 49.35169
        col17    col18    col19    col20
row1 50.23519 50.97639 50.76956 105.7807
row5 50.02893 51.07376 51.16285 105.7880
> tmp[,c("col6","col20")]
          col6     col20
row1 105.09852 105.78071
row2  75.14604  73.03522
row3  74.34406  76.21901
row4  75.28688  74.74524
row5 106.42636 105.78796
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 105.0985 105.7807
row5 106.4264 105.7880
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 105.0985 105.7807
row5 106.4264 105.7880
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
          col13
[1,] -0.3349800
[2,]  0.7861578
[3,]  0.3895248
[4,]  0.4845344
[5,]  0.9724462
> tmp[,c("col17","col7")]
          col17       col7
[1,] -0.9719844 -0.6690689
[2,] -0.1296653  1.1952084
[3,] -0.7807609 -0.6173395
[4,] -0.2033645  0.8881720
[5,]  0.1722937  0.1612875
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
           col6      col20
[1,] -0.4470602  1.0306895
[2,]  0.7677492  1.2764587
[3,] -0.2933079  1.2167854
[4,]  0.5503691 -0.8313043
[5,]  1.0409527  1.8201302
> subBufferedMatrix(tmp,1,c("col6"))[,1]
           col1
[1,] -0.4470602
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
           col6
[1,] -0.4470602
[2,]  0.7677492
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> 
> 
> 
> subBufferedMatrix(tmp,c("row3","row1"),)[,1:20]
          [,1]       [,2]       [,3]       [,4]        [,5]      [,6]
row3  1.233693  2.9689242 -0.7026380  0.5562776 -0.74375041 0.3277397
row1 -1.338413 -0.2805255  0.9438223 -1.5835875 -0.07814653 0.5769451
             [,7]       [,8]       [,9]      [,10]      [,11]      [,12]
row3 -0.041650481 -0.5090762 -0.7226675 -0.4903325 -0.8803935  0.9777371
row1 -0.009724706  1.3903601 -0.6056021  0.3891552  0.4274170 -0.8684529
         [,13]     [,14]      [,15]       [,16]     [,17]      [,18]      [,19]
row3 0.8946655 0.5319006  1.3716007  0.07393216 0.3452461 -0.8149852  0.3134758
row1 1.2821875 0.5086573 -0.5100772 -0.19275954 0.6052824  0.9892075 -0.3317572
            [,20]
row3  1.129101868
row1 -0.001944388
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
         [,1]       [,2]      [,3]      [,4]      [,5]       [,6]      [,7]
row2 1.972879 -0.7471957 0.5117975 0.4518906 -1.353466 -0.5460005 0.7598199
          [,8]     [,9]      [,10]
row2 0.3323371 2.900095 -0.4828721
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
          [,1]      [,2]      [,3]        [,4]      [,5]      [,6]       [,7]
row5 0.3934736 0.1312192 0.2031722 -0.02913828 0.7786129 0.8640486 -0.5392456
          [,8]      [,9]    [,10]     [,11]     [,12]     [,13]      [,14]
row5 -1.114041 0.5301354 -1.46245 -1.416303 0.5800628 -1.340069 -0.6154528
         [,15]    [,16]     [,17]      [,18]    [,19]      [,20]
row5 0.8854964 1.218311 -1.058175 -0.4277059 1.077756 -0.0764166
> 
> 
> 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: 0x5929b8d23680>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM2c40df2a391f3f"
 [2] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM2c40df43d8bac" 
 [3] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM2c40df52362c4b"
 [4] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM2c40df9b2c2b1" 
 [5] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM2c40df268c02ca"
 [6] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM2c40df3b772b7f"
 [7] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM2c40df746a1b69"
 [8] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM2c40df5d68c730"
 [9] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM2c40df3ef720db"
[10] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM2c40df520aee5c"
[11] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM2c40df6a7f82b1"
[12] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM2c40df460b4f79"
[13] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM2c40df2dc39341"
[14] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM2c40df75ce1c7e"
[15] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM2c40dfd019d65" 
> 
> 
> ### 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: 0x5929bb084170>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x5929bb084170>
Warning message:
In dir.create(new.directory) :
  '/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x5929bb084170>
> rowMedians(tmp)
  [1]  4.316697e-01 -1.224219e-01 -8.662930e-02 -7.368525e-02 -9.313524e-03
  [6] -1.064672e+00  3.510477e-01 -9.102438e-02 -1.679870e-01  6.810925e-02
 [11]  3.065300e-01  2.356547e-01  7.938029e-01  2.831900e-01  3.526037e-01
 [16] -8.240149e-02 -6.399855e-02  1.130506e-01 -1.966855e-01  9.511862e-02
 [21] -2.916617e-02  1.507592e-01  1.593322e-01  3.686343e-01  3.805222e-01
 [26] -1.493972e-01 -2.166231e-01  5.474200e-02 -2.095394e-03  1.342994e-01
 [31]  3.670786e-01 -2.484932e-02  2.871797e-02  2.874867e-01  2.890143e-01
 [36] -1.020325e-01  2.913757e-01 -2.700447e-01 -2.706642e-01  5.668696e-01
 [41]  3.425095e-01 -5.610737e-02 -8.112330e-02 -2.854634e-01  1.952272e-01
 [46]  3.137641e-01  5.735836e-02  1.291684e-01  2.675189e-01  2.204893e-01
 [51]  2.016209e-01  5.963656e-01  3.584538e-01  3.468259e-02  3.567076e-01
 [56]  2.366478e-01  2.586985e-01  2.749528e-01 -5.124607e-02 -4.659773e-01
 [61] -6.093869e-01 -2.709828e-01 -4.128817e-02 -1.476127e-01  3.254470e-01
 [66] -7.552411e-01 -1.962518e-01 -7.384029e-02 -5.068075e-06 -3.114618e-02
 [71] -2.253036e-01 -3.020753e-01  7.410838e-02  1.520186e-01 -2.190678e-02
 [76] -1.060253e-01  2.993994e-02 -4.659003e-02 -6.324923e-02 -1.209951e-01
 [81] -3.798974e-01 -8.762645e-02 -4.949445e-01  6.283276e-01  6.100364e-02
 [86] -1.431841e-01  4.969070e-01  1.661924e-01  6.295860e-02 -5.178830e-02
 [91]  1.787551e-01  5.329148e-02 -5.039956e-01 -2.808473e-01  3.914931e-01
 [96]  3.016267e-01  9.648836e-02 -6.998561e-02 -1.701091e-01 -8.355054e-01
[101] -9.796637e-02  1.367846e-01 -2.433303e-01  1.425492e-01 -2.330942e-01
[106]  1.449533e-01  3.698785e-01 -4.306614e-01  1.994885e-02 -9.673280e-02
[111]  3.374890e-01 -1.176620e-01 -2.577801e-02 -2.140335e-01  1.609282e-01
[116]  3.069954e-02  9.316505e-02 -2.631131e-01 -6.477563e-01  4.467522e-01
[121]  5.703826e-01 -7.225165e-01  1.665712e-01  7.649653e-02  2.030941e-01
[126] -2.503308e-01  1.227347e-01  2.651011e-01  4.283884e-01  1.412389e-01
[131]  1.993960e-01 -2.251722e-01 -2.322055e-01  6.757448e-02  3.059977e-01
[136] -1.909242e-01  1.070466e-01 -5.836420e-01  2.006022e-01  1.198836e-01
[141] -4.538794e-01  6.756539e-01 -4.589707e-01 -6.016586e-02 -1.394911e-01
[146]  1.965764e-01 -3.077010e-01 -4.856638e-01 -4.507951e-01  5.904900e-01
[151]  4.532308e-01  3.342568e-01  2.552000e-01 -4.475304e-01 -2.165299e-01
[156] -4.833769e-02  2.843980e-01 -2.384237e-01 -3.579451e-01  5.236660e-01
[161]  2.062571e-01 -5.145530e-02 -1.325340e-01 -1.803789e-01 -5.421904e-01
[166]  1.030288e-01 -4.025201e-01 -1.682132e-01  4.388082e-01 -2.430683e-01
[171]  4.199331e-03  5.824106e-01  3.432704e-01 -3.491639e-01 -4.273940e-02
[176]  2.657581e-01  3.011207e-01  1.432565e-01  9.551315e-02  2.939365e-01
[181] -3.257248e-01  6.236870e-02 -6.838371e-01  1.785303e-01  1.350145e-02
[186] -6.125039e-01  1.301566e-01 -6.025707e-01  7.690784e-01  1.784073e-01
[191] -1.590526e-01  8.305511e-02 -1.394982e-01 -4.207574e-01 -1.913384e-01
[196] -1.075271e-01  3.626651e-01  2.190046e-01  1.806009e-01  3.064480e-01
[201] -2.777129e-02  8.366592e-02  5.983204e-02 -8.770133e-01 -2.474372e-01
[206] -2.440503e-01  3.839825e-01 -8.054888e-02 -2.011026e-01  7.866139e-01
[211]  1.219517e-01  1.133185e-01 -1.638485e-01  7.333329e-02 -9.473610e-01
[216] -9.515204e-02  4.333669e-01  5.988980e-01 -5.411382e-01 -1.822253e-01
[221] -1.423796e-01  7.524452e-01 -5.697945e-01 -6.634627e-02 -2.872370e-04
[226]  2.403143e-01  2.072799e-01  1.578166e-01 -9.892049e-02  7.253090e-02
> 
> proc.time()
   user  system elapsed 
  1.320   1.451   2.757 

BufferedMatrix.Rcheck/tests/rawCalltesting.Rout


R Under development (unstable) (2025-12-22 r89219) -- "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: 0x604c422c85f0>
> .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: 0x604c422c85f0>
> .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: 0x604c422c85f0>
> .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: 0x604c422c85f0>
> 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: 0x604c42b462b0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x604c42b462b0>
> .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: 0x604c42b462b0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x604c42b462b0>
> .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: 0x604c42b462b0>
> 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: 0x604c42229a20>
> .Call("R_bm_AddColumn",P)
<pointer: 0x604c42229a20>
> .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: 0x604c42229a20>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x604c42229a20>
> .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: 0x604c42229a20>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x604c42229a20>
> .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: 0x604c42229a20>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x604c42229a20>
> .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: 0x604c42229a20>
> 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: 0x604c42a06e00>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x604c42a06e00>
> .Call("R_bm_AddColumn",P)
<pointer: 0x604c42a06e00>
> .Call("R_bm_AddColumn",P)
<pointer: 0x604c42a06e00>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile2c4217331d2ef9" "BufferedMatrixFile2c42173d7f4da2"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile2c4217331d2ef9" "BufferedMatrixFile2c42173d7f4da2"
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x604c4290e4c0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x604c4290e4c0>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x604c4290e4c0>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x604c4290e4c0>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x604c4290e4c0>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x604c4290e4c0>
> .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: 0x604c42cb77e0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x604c42cb77e0>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x604c42cb77e0>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x604c42cb77e0>
> 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: 0x604c43d90520>
> .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: 0x604c43d90520>
> rm(P)
> 
> proc.time()
   user  system elapsed 
  0.258   0.043   0.289 

BufferedMatrix.Rcheck/tests/Rcodetesting.Rout


R Under development (unstable) (2025-12-22 r89219) -- "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.253   0.044   0.284 

Example timings