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

This page was generated on 2025-09-03 12:03 -0400 (Wed, 03 Sep 2025).

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

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


CHECK results for BufferedMatrix on nebbiolo2

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

raw results


Summary

Package: BufferedMatrix
Version: 1.73.0
Command: /home/biocbuild/bbs-3.22-bioc/R/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/home/biocbuild/bbs-3.22-bioc/R/site-library --timings BufferedMatrix_1.73.0.tar.gz
StartedAt: 2025-09-02 21:40:28 -0400 (Tue, 02 Sep 2025)
EndedAt: 2025-09-02 21:41:02 -0400 (Tue, 02 Sep 2025)
EllapsedTime: 34.1 seconds
RetCode: 0
Status:   OK  
CheckDir: BufferedMatrix.Rcheck
Warnings: 0

Command output

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


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

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


Installation output

BufferedMatrix.Rcheck/00install.out

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


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

Tests output

BufferedMatrix.Rcheck/tests/c_code_level_tests.Rout


R version 4.5.1 (2025-06-13) -- "Great Square Root"
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.401   0.045   0.515 

BufferedMatrix.Rcheck/tests/objectTesting.Rout


R version 4.5.1 (2025-06-13) -- "Great Square Root"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu

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

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

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

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

Attaching package: 'BufferedMatrix'

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

    colMeans, colSums, rowMeans, rowSums

> 
> 
> ### this is used to control how many repetitions in something below
> ### higher values result in more checks.
> nreps <-100 ##20000
> 
> 
> ## test creation and some simple assignments and subsetting operations
> 
> ## first on single elements
> tmp <- createBufferedMatrix(1000,10)
> 
> tmp[10,5]
[1] 0
> tmp[10,5] <- 10
> tmp[10,5]
[1] 10
> tmp[10,5] <- 12.445
> tmp[10,5]
[1] 12.445
> 
> 
> 
> ## now testing accessing multiple elements
> tmp2 <- createBufferedMatrix(10,20)
> 
> 
> tmp2[3,1] <- 51.34
> tmp2[9,2] <- 9.87654
> tmp2[,1:2]
       [,1]    [,2]
 [1,]  0.00 0.00000
 [2,]  0.00 0.00000
 [3,] 51.34 0.00000
 [4,]  0.00 0.00000
 [5,]  0.00 0.00000
 [6,]  0.00 0.00000
 [7,]  0.00 0.00000
 [8,]  0.00 0.00000
 [9,]  0.00 9.87654
[10,]  0.00 0.00000
> tmp2[,-(3:20)]
       [,1]    [,2]
 [1,]  0.00 0.00000
 [2,]  0.00 0.00000
 [3,] 51.34 0.00000
 [4,]  0.00 0.00000
 [5,]  0.00 0.00000
 [6,]  0.00 0.00000
 [7,]  0.00 0.00000
 [8,]  0.00 0.00000
 [9,]  0.00 9.87654
[10,]  0.00 0.00000
> tmp2[3,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
[1,] 51.34    0    0    0    0    0    0    0    0     0     0     0     0
     [,14] [,15] [,16] [,17] [,18] [,19] [,20]
[1,]     0     0     0     0     0     0     0
> tmp2[-3,]
      [,1]    [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [2,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [3,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [4,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [5,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [6,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [7,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [8,]    0 9.87654    0    0    0    0    0    0    0     0     0     0     0
 [9,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
      [,14] [,15] [,16] [,17] [,18] [,19] [,20]
 [1,]     0     0     0     0     0     0     0
 [2,]     0     0     0     0     0     0     0
 [3,]     0     0     0     0     0     0     0
 [4,]     0     0     0     0     0     0     0
 [5,]     0     0     0     0     0     0     0
 [6,]     0     0     0     0     0     0     0
 [7,]     0     0     0     0     0     0     0
 [8,]     0     0     0     0     0     0     0
 [9,]     0     0     0     0     0     0     0
> tmp2[2,1:3]
     [,1] [,2] [,3]
[1,]    0    0    0
> tmp2[3:9,1:3]
      [,1]    [,2] [,3]
[1,] 51.34 0.00000    0
[2,]  0.00 0.00000    0
[3,]  0.00 0.00000    0
[4,]  0.00 0.00000    0
[5,]  0.00 0.00000    0
[6,]  0.00 0.00000    0
[7,]  0.00 9.87654    0
> tmp2[-4,-4]
       [,1]    [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [2,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [3,] 51.34 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [4,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [5,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [6,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [7,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [8,]  0.00 9.87654    0    0    0    0    0    0    0     0     0     0     0
 [9,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
      [,14] [,15] [,16] [,17] [,18] [,19]
 [1,]     0     0     0     0     0     0
 [2,]     0     0     0     0     0     0
 [3,]     0     0     0     0     0     0
 [4,]     0     0     0     0     0     0
 [5,]     0     0     0     0     0     0
 [6,]     0     0     0     0     0     0
 [7,]     0     0     0     0     0     0
 [8,]     0     0     0     0     0     0
 [9,]     0     0     0     0     0     0
> 
> ## now testing accessing/assigning multiple elements
> tmp3 <- createBufferedMatrix(10,10)
> 
> for (i in 1:10){
+   for (j in 1:10){
+     tmp3[i,j] <- (j-1)*10 + i
+   }
+ }
> 
> tmp3[2:4,2:4]
     [,1] [,2] [,3]
[1,]   12   22   32
[2,]   13   23   33
[3,]   14   24   34
> tmp3[c(-10),c(2:4,2:4,10,1,2,1:10,10:1)]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]   11   21   31   11   21   31   91    1   11     1    11    21    31
 [2,]   12   22   32   12   22   32   92    2   12     2    12    22    32
 [3,]   13   23   33   13   23   33   93    3   13     3    13    23    33
 [4,]   14   24   34   14   24   34   94    4   14     4    14    24    34
 [5,]   15   25   35   15   25   35   95    5   15     5    15    25    35
 [6,]   16   26   36   16   26   36   96    6   16     6    16    26    36
 [7,]   17   27   37   17   27   37   97    7   17     7    17    27    37
 [8,]   18   28   38   18   28   38   98    8   18     8    18    28    38
 [9,]   19   29   39   19   29   39   99    9   19     9    19    29    39
      [,14] [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24] [,25]
 [1,]    41    51    61    71    81    91    91    81    71    61    51    41
 [2,]    42    52    62    72    82    92    92    82    72    62    52    42
 [3,]    43    53    63    73    83    93    93    83    73    63    53    43
 [4,]    44    54    64    74    84    94    94    84    74    64    54    44
 [5,]    45    55    65    75    85    95    95    85    75    65    55    45
 [6,]    46    56    66    76    86    96    96    86    76    66    56    46
 [7,]    47    57    67    77    87    97    97    87    77    67    57    47
 [8,]    48    58    68    78    88    98    98    88    78    68    58    48
 [9,]    49    59    69    79    89    99    99    89    79    69    59    49
      [,26] [,27] [,28] [,29]
 [1,]    31    21    11     1
 [2,]    32    22    12     2
 [3,]    33    23    13     3
 [4,]    34    24    14     4
 [5,]    35    25    15     5
 [6,]    36    26    16     6
 [7,]    37    27    17     7
 [8,]    38    28    18     8
 [9,]    39    29    19     9
> tmp3[-c(1:5),-c(6:10)]
     [,1] [,2] [,3] [,4] [,5]
[1,]    6   16   26   36   46
[2,]    7   17   27   37   47
[3,]    8   18   28   38   48
[4,]    9   19   29   39   49
[5,]   10   20   30   40   50
> 
> ## assignment of whole columns
> tmp3[,1] <- c(1:10*100.0)
> tmp3[,1:2] <- tmp3[,1:2]*100
> tmp3[,1:2] <- tmp3[,2:1]
> tmp3[,1:2]
      [,1]  [,2]
 [1,] 1100 1e+04
 [2,] 1200 2e+04
 [3,] 1300 3e+04
 [4,] 1400 4e+04
 [5,] 1500 5e+04
 [6,] 1600 6e+04
 [7,] 1700 7e+04
 [8,] 1800 8e+04
 [9,] 1900 9e+04
[10,] 2000 1e+05
> 
> 
> tmp3[,-1] <- tmp3[,1:9]
> tmp3[,1:10]
      [,1] [,2]  [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,] 1100 1100 1e+04   21   31   41   51   61   71    81
 [2,] 1200 1200 2e+04   22   32   42   52   62   72    82
 [3,] 1300 1300 3e+04   23   33   43   53   63   73    83
 [4,] 1400 1400 4e+04   24   34   44   54   64   74    84
 [5,] 1500 1500 5e+04   25   35   45   55   65   75    85
 [6,] 1600 1600 6e+04   26   36   46   56   66   76    86
 [7,] 1700 1700 7e+04   27   37   47   57   67   77    87
 [8,] 1800 1800 8e+04   28   38   48   58   68   78    88
 [9,] 1900 1900 9e+04   29   39   49   59   69   79    89
[10,] 2000 2000 1e+05   30   40   50   60   70   80    90
> 
> tmp3[,1:2] <- rep(1,10)
> tmp3[,1:2] <- rep(1,20)
> tmp3[,1:2] <- matrix(c(1:5),1,5)
> 
> tmp3[,-c(1:8)] <- matrix(c(1:5),1,5)
> 
> tmp3[1,] <- 1:10
> tmp3[1,]
     [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,]    1    2    3    4    5    6    7    8    9    10
> tmp3[-1,] <- c(1,2)
> tmp3[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    1    2    3    4    5    6    7    8    9    10
 [2,]    1    2    1    2    1    2    1    2    1     2
 [3,]    2    1    2    1    2    1    2    1    2     1
 [4,]    1    2    1    2    1    2    1    2    1     2
 [5,]    2    1    2    1    2    1    2    1    2     1
 [6,]    1    2    1    2    1    2    1    2    1     2
 [7,]    2    1    2    1    2    1    2    1    2     1
 [8,]    1    2    1    2    1    2    1    2    1     2
 [9,]    2    1    2    1    2    1    2    1    2     1
[10,]    1    2    1    2    1    2    1    2    1     2
> tmp3[-c(1:8),] <- matrix(c(1:5),1,5)
> tmp3[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    1    2    3    4    5    6    7    8    9    10
 [2,]    1    2    1    2    1    2    1    2    1     2
 [3,]    2    1    2    1    2    1    2    1    2     1
 [4,]    1    2    1    2    1    2    1    2    1     2
 [5,]    2    1    2    1    2    1    2    1    2     1
 [6,]    1    2    1    2    1    2    1    2    1     2
 [7,]    2    1    2    1    2    1    2    1    2     1
 [8,]    1    2    1    2    1    2    1    2    1     2
 [9,]    1    3    5    2    4    1    3    5    2     4
[10,]    2    4    1    3    5    2    4    1    3     5
> 
> 
> tmp3[1:2,1:2] <- 5555.04
> tmp3[-(1:2),1:2] <- 1234.56789
> 
> 
> 
> ## testing accessors for the directory and prefix
> directory(tmp3)
[1] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests"
> prefix(tmp3)
[1] "BM"
> 
> ## testing if we can remove these objects
> rm(tmp, tmp2, tmp3)
> gc()
         used (Mb) gc trigger (Mb) max used (Mb)
Ncells 478417 25.6    1047105   56   639600 34.2
Vcells 885231  6.8    8388608   64  2081598 15.9
> 
> 
> 
> 
> ##
> ## checking reads
> ##
> 
> tmp2 <- createBufferedMatrix(10,20)
> 
> test.sample <- rnorm(10*20)
> 
> tmp2[1:10,1:20] <- test.sample
> 
> test.matrix <- matrix(test.sample,10,20)
> 
> ## testing reads
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   which.col <- sample(1:20,1)
+   if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> date()
[1] "Tue Sep  2 21:40:49 2025"
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> date()
[1] "Tue Sep  2 21:40:49 2025"
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,which.col] == test.matrix[which.row,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> 
> 
> RowMode(tmp2)
<pointer: 0x5696a8bb2b80>
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   which.col <- sample(1:20,1)
+   if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,5,replace=TRUE)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> date()
[1] "Tue Sep  2 21:40:49 2025"
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col <- sample(1:20,5,replace=TRUE)
+   if (!all(tmp2[which.row,which.col] == test.matrix[which.row,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> date()
[1] "Tue Sep  2 21:40:49 2025"
> 
> ColMode(tmp2)
<pointer: 0x5696a8bb2b80>
> 
> 
> 
> ### Now testing assignments
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+ 
+   new.data <- rnorm(20)
+   tmp2[which.row,] <- new.data
+   test.matrix[which.row,] <- new.data
+   if (rep > 1){
+     if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+   
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   new.data <- rnorm(10)
+   tmp2[,which.col] <- new.data
+   test.matrix[,which.col]<- new.data
+ 
+   if (rep > 1){
+     if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.col <- which.col
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,5,replace=TRUE)
+   new.data <- matrix(rnorm(50),5,10)
+   tmp2[,which.col] <- new.data
+   test.matrix[,which.col]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.col <- which.col
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   new.data <- matrix(rnorm(50),5,10)
+   tmp2[which.row,] <- new.data
+   test.matrix[which.row,]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col  <- sample(1:20,5,replace=TRUE)
+   new.data <- matrix(rnorm(25),5,5)
+   tmp2[which.row,which.col] <- new.data
+   test.matrix[which.row,which.col]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[prev.row,prev.col] == test.matrix[prev.row,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+   prev.col <- which.col
+ }
> 
> 
> 
> 
> ###
> ###
> ### testing some more functions
> ###
> 
> 
> 
> ## duplication function
> tmp5 <- duplicate(tmp2)
> 
> # making sure really did copy everything.
> tmp5[1,1] <- tmp5[1,1] +100.00
> 
> if (tmp5[1,1] == tmp2[1,1]){
+   stop("Problem with duplication")
+ }
> 
> 
> 
> 
> ### testing elementwise applying of functions
> 
> tmp5[1:4,1:4]
            [,1]       [,2]       [,3]       [,4]
[1,] 100.5413322 1.11703283 -0.4049080 -1.7977212
[2,]  -0.7572626 0.42361977 -0.3905176  0.5384011
[3,]  -0.2897292 0.50008914 -0.8384495  0.8364499
[4,]  -0.2141103 0.01844951  0.9456234 -0.2552500
> ewApply(tmp5,abs)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
            [,1]       [,2]      [,3]      [,4]
[1,] 100.5413322 1.11703283 0.4049080 1.7977212
[2,]   0.7572626 0.42361977 0.3905176 0.5384011
[3,]   0.2897292 0.50008914 0.8384495 0.8364499
[4,]   0.2141103 0.01844951 0.9456234 0.2552500
> ewApply(tmp5,sqrt)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
           [,1]      [,2]      [,3]      [,4]
[1,] 10.0270301 1.0568977 0.6363238 1.3407913
[2,]  0.8702084 0.6508608 0.6249140 0.7337582
[3,]  0.5382650 0.7071698 0.9156689 0.9145764
[4,]  0.4627206 0.1358290 0.9724317 0.5052228
> 
> my.function <- function(x,power){
+   (x+5)^power
+ }
> 
> ewApply(tmp5,my.function,power=2)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
          [,1]     [,2]     [,3]     [,4]
[1,] 225.81163 36.68601 31.76815 40.20563
[2,]  34.45935 31.93223 31.63966 32.87598
[3,]  30.67238 32.57179 34.99514 34.98221
[4,]  29.84132 26.37674 35.66994 30.30748
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x5696a760b4b0>
> exp(tmp5)
<pointer: 0x5696a760b4b0>
> log(tmp5,2)
<pointer: 0x5696a760b4b0>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 469.9973
> Min(tmp5)
[1] 53.99029
> mean(tmp5)
[1] 73.0879
> Sum(tmp5)
[1] 14617.58
> Var(tmp5)
[1] 867.183
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 95.49674 68.89147 72.37184 71.38449 71.67770 68.91038 69.99783 68.59636
 [9] 71.64596 71.90622
> rowSums(tmp5)
 [1] 1909.935 1377.829 1447.437 1427.690 1433.554 1378.208 1399.957 1371.927
 [9] 1432.919 1438.124
> rowVars(tmp5)
 [1] 7811.78698   90.01149   54.32853  106.63219   67.77648   50.35252
 [7]   60.80598   76.65785   76.99534   81.12832
> rowSd(tmp5)
 [1] 88.384314  9.487439  7.370789 10.326286  8.232647  7.095951  7.797819
 [8]  8.755447  8.774699  9.007126
> rowMax(tmp5)
 [1] 469.99733  89.41157  85.73426  89.29824  84.94562  90.45498  83.87965
 [8]  86.57050  84.75708  84.37160
> rowMin(tmp5)
 [1] 63.24286 58.25728 59.15555 54.89973 56.39553 60.41354 53.99029 54.71133
 [9] 54.43662 54.13668
> 
> colMeans(tmp5)
 [1] 108.54827  65.60247  70.97447  70.78358  67.72134  78.07849  76.43435
 [8]  73.73314  72.16247  73.17568  72.05875  67.39312  67.13570  70.35064
[15]  73.77278  70.73160  67.40939  73.09981  73.24673  69.34523
> colSums(tmp5)
 [1] 1085.4827  656.0247  709.7447  707.8358  677.2134  780.7849  764.3435
 [8]  737.3314  721.6247  731.7568  720.5875  673.9312  671.3570  703.5064
[15]  737.7278  707.3160  674.0939  730.9981  732.4673  693.4523
> colVars(tmp5)
 [1] 16174.68929    36.82545    21.08793    53.55711    64.46096    80.90193
 [7]    74.24289    87.45164    45.02744   101.32369    88.06671    93.67204
[13]    70.37216   103.93277    72.58969    36.47627    51.23079    61.61883
[19]   131.69196    38.33613
> colSd(tmp5)
 [1] 127.179752   6.068398   4.592160   7.318273   8.028758   8.994550
 [7]   8.616431   9.351558   6.710249  10.065967   9.384386   9.678431
[13]   8.388811  10.194742   8.519958   6.039559   7.157569   7.849766
[19]  11.475712   6.191618
> colMax(tmp5)
 [1] 469.99733  76.35712  77.94298  83.68276  83.87965  90.45498  84.37160
 [8]  89.29824  83.94362  85.73426  86.57050  87.26800  83.42276  86.80069
[15]  84.94562  80.47682  77.48911  83.59104  89.41157  79.11268
> colMin(tmp5)
 [1] 62.11079 54.89973 63.17914 61.71422 56.76984 59.85132 54.71133 58.25728
 [9] 64.63637 55.72006 54.43662 53.99029 54.13668 59.52558 60.17225 63.01383
[17] 58.57167 59.91352 55.05136 60.20491
> 
> 
> ### 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] 95.49674 68.89147 72.37184 71.38449       NA 68.91038 69.99783 68.59636
 [9] 71.64596 71.90622
> rowSums(tmp5)
 [1] 1909.935 1377.829 1447.437 1427.690       NA 1378.208 1399.957 1371.927
 [9] 1432.919 1438.124
> rowVars(tmp5)
 [1] 7811.78698   90.01149   54.32853  106.63219   66.76621   50.35252
 [7]   60.80598   76.65785   76.99534   81.12832
> rowSd(tmp5)
 [1] 88.384314  9.487439  7.370789 10.326286  8.171059  7.095951  7.797819
 [8]  8.755447  8.774699  9.007126
> rowMax(tmp5)
 [1] 469.99733  89.41157  85.73426  89.29824        NA  90.45498  83.87965
 [8]  86.57050  84.75708  84.37160
> rowMin(tmp5)
 [1] 63.24286 58.25728 59.15555 54.89973       NA 60.41354 53.99029 54.71133
 [9] 54.43662 54.13668
> 
> colMeans(tmp5)
 [1] 108.54827  65.60247  70.97447  70.78358  67.72134  78.07849  76.43435
 [8]  73.73314  72.16247  73.17568  72.05875        NA  67.13570  70.35064
[15]  73.77278  70.73160  67.40939  73.09981  73.24673  69.34523
> colSums(tmp5)
 [1] 1085.4827  656.0247  709.7447  707.8358  677.2134  780.7849  764.3435
 [8]  737.3314  721.6247  731.7568  720.5875        NA  671.3570  703.5064
[15]  737.7278  707.3160  674.0939  730.9981  732.4673  693.4523
> colVars(tmp5)
 [1] 16174.68929    36.82545    21.08793    53.55711    64.46096    80.90193
 [7]    74.24289    87.45164    45.02744   101.32369    88.06671          NA
[13]    70.37216   103.93277    72.58969    36.47627    51.23079    61.61883
[19]   131.69196    38.33613
> colSd(tmp5)
 [1] 127.179752   6.068398   4.592160   7.318273   8.028758   8.994550
 [7]   8.616431   9.351558   6.710249  10.065967   9.384386         NA
[13]   8.388811  10.194742   8.519958   6.039559   7.157569   7.849766
[19]  11.475712   6.191618
> colMax(tmp5)
 [1] 469.99733  76.35712  77.94298  83.68276  83.87965  90.45498  84.37160
 [8]  89.29824  83.94362  85.73426  86.57050        NA  83.42276  86.80069
[15]  84.94562  80.47682  77.48911  83.59104  89.41157  79.11268
> colMin(tmp5)
 [1] 62.11079 54.89973 63.17914 61.71422 56.76984 59.85132 54.71133 58.25728
 [9] 64.63637 55.72006 54.43662       NA 54.13668 59.52558 60.17225 63.01383
[17] 58.57167 59.91352 55.05136 60.20491
> 
> Max(tmp5,na.rm=TRUE)
[1] 469.9973
> Min(tmp5,na.rm=TRUE)
[1] 53.99029
> mean(tmp5,na.rm=TRUE)
[1] 73.1404
> Sum(tmp5,na.rm=TRUE)
[1] 14554.94
> Var(tmp5,na.rm=TRUE)
[1] 871.0087
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 95.49674 68.89147 72.37184 71.38449 72.15332 68.91038 69.99783 68.59636
 [9] 71.64596 71.90622
> rowSums(tmp5,na.rm=TRUE)
 [1] 1909.935 1377.829 1447.437 1427.690 1370.913 1378.208 1399.957 1371.927
 [9] 1432.919 1438.124
> rowVars(tmp5,na.rm=TRUE)
 [1] 7811.78698   90.01149   54.32853  106.63219   66.76621   50.35252
 [7]   60.80598   76.65785   76.99534   81.12832
> rowSd(tmp5,na.rm=TRUE)
 [1] 88.384314  9.487439  7.370789 10.326286  8.171059  7.095951  7.797819
 [8]  8.755447  8.774699  9.007126
> rowMax(tmp5,na.rm=TRUE)
 [1] 469.99733  89.41157  85.73426  89.29824  84.94562  90.45498  83.87965
 [8]  86.57050  84.75708  84.37160
> rowMin(tmp5,na.rm=TRUE)
 [1] 63.24286 58.25728 59.15555 54.89973 56.39553 60.41354 53.99029 54.71133
 [9] 54.43662 54.13668
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 108.54827  65.60247  70.97447  70.78358  67.72134  78.07849  76.43435
 [8]  73.73314  72.16247  73.17568  72.05875  67.92114  67.13570  70.35064
[15]  73.77278  70.73160  67.40939  73.09981  73.24673  69.34523
> colSums(tmp5,na.rm=TRUE)
 [1] 1085.4827  656.0247  709.7447  707.8358  677.2134  780.7849  764.3435
 [8]  737.3314  721.6247  731.7568  720.5875  611.2902  671.3570  703.5064
[15]  737.7278  707.3160  674.0939  730.9981  732.4673  693.4523
> colVars(tmp5,na.rm=TRUE)
 [1] 16174.68929    36.82545    21.08793    53.55711    64.46096    80.90193
 [7]    74.24289    87.45164    45.02744   101.32369    88.06671   102.24448
[13]    70.37216   103.93277    72.58969    36.47627    51.23079    61.61883
[19]   131.69196    38.33613
> colSd(tmp5,na.rm=TRUE)
 [1] 127.179752   6.068398   4.592160   7.318273   8.028758   8.994550
 [7]   8.616431   9.351558   6.710249  10.065967   9.384386  10.111601
[13]   8.388811  10.194742   8.519958   6.039559   7.157569   7.849766
[19]  11.475712   6.191618
> colMax(tmp5,na.rm=TRUE)
 [1] 469.99733  76.35712  77.94298  83.68276  83.87965  90.45498  84.37160
 [8]  89.29824  83.94362  85.73426  86.57050  87.26800  83.42276  86.80069
[15]  84.94562  80.47682  77.48911  83.59104  89.41157  79.11268
> colMin(tmp5,na.rm=TRUE)
 [1] 62.11079 54.89973 63.17914 61.71422 56.76984 59.85132 54.71133 58.25728
 [9] 64.63637 55.72006 54.43662 53.99029 54.13668 59.52558 60.17225 63.01383
[17] 58.57167 59.91352 55.05136 60.20491
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1] 95.49674 68.89147 72.37184 71.38449      NaN 68.91038 69.99783 68.59636
 [9] 71.64596 71.90622
> rowSums(tmp5,na.rm=TRUE)
 [1] 1909.935 1377.829 1447.437 1427.690    0.000 1378.208 1399.957 1371.927
 [9] 1432.919 1438.124
> rowVars(tmp5,na.rm=TRUE)
 [1] 7811.78698   90.01149   54.32853  106.63219         NA   50.35252
 [7]   60.80598   76.65785   76.99534   81.12832
> rowSd(tmp5,na.rm=TRUE)
 [1] 88.384314  9.487439  7.370789 10.326286        NA  7.095951  7.797819
 [8]  8.755447  8.774699  9.007126
> rowMax(tmp5,na.rm=TRUE)
 [1] 469.99733  89.41157  85.73426  89.29824        NA  90.45498  83.87965
 [8]  86.57050  84.75708  84.37160
> rowMin(tmp5,na.rm=TRUE)
 [1] 63.24286 58.25728 59.15555 54.89973       NA 60.41354 53.99029 54.71133
 [9] 54.43662 54.13668
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1] 113.53349  65.14630  70.20019  70.59008  66.59161  80.10373  76.48458
 [8]  74.91495  71.80852  72.27965  72.44870       NaN  68.32905  69.46703
[15]  72.53136  70.17905  66.47956  71.93412  74.19186  69.75680
> colSums(tmp5,na.rm=TRUE)
 [1] 1021.8014  586.3167  631.8017  635.3107  599.3245  720.9336  688.3612
 [8]  674.2345  646.2767  650.5169  652.0383    0.0000  614.9614  625.2033
[15]  652.7822  631.6115  598.3161  647.4071  667.7268  627.8112
> colVars(tmp5,na.rm=TRUE)
 [1] 17916.93557    39.08753    16.97945    59.83056    58.16034    44.87165
 [7]    83.49486    82.67045    49.24647   104.95696    97.36435          NA
[13]    63.14768   108.14065    64.32559    37.60111    47.90805    54.03426
[19]   138.10414    41.22249
> colSd(tmp5,na.rm=TRUE)
 [1] 133.854158   6.252002   4.120613   7.735022   7.626293   6.698630
 [7]   9.137552   9.092329   7.017583  10.244850   9.867338         NA
[13]   7.946551  10.399070   8.020324   6.131974   6.921564   7.350800
[19]  11.751772   6.420474
> colMax(tmp5,na.rm=TRUE)
 [1] 469.99733  76.35712  74.25281  83.68276  83.87965  90.45498  84.37160
 [8]  89.29824  83.94362  85.73426  86.57050      -Inf  83.42276  86.80069
[15]  84.75708  80.47682  77.48911  79.56001  89.41157  79.11268
> colMin(tmp5,na.rm=TRUE)
 [1] 62.11079 54.89973 63.17914 61.71422 56.76984 68.29139 54.71133 58.25728
 [9] 64.63637 55.72006 54.43662      Inf 54.13668 59.52558 60.17225 63.01383
[17] 58.57167 59.91352 55.05136 60.20491
> 
> 
> 
> 
> 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] 162.55404 194.27847 210.58165 205.44510 257.02734 107.38321 349.43351
 [8] 184.06920 195.50729  61.51109
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 162.55404 194.27847 210.58165 205.44510 257.02734 107.38321 349.43351
 [8] 184.06920 195.50729  61.51109
> 
> 
> 
> copymatrix <- matrix(rnorm(200,150,15),10,20)
> 
> tmp5[1:10,1:20] <- copymatrix
> which.row <- 1
> which.col  <- 3
> cat(which.row," ",which.col,"\n")
1   3 
> tmp5[which.row,which.col] <- NA
> copymatrix[which.row,which.col] <- NA
> 
> colVars(tmp5,na.rm=TRUE)-apply(copymatrix,2,var,na.rm=TRUE)
 [1]  1.705303e-13 -8.526513e-14  0.000000e+00  1.136868e-13 -2.842171e-14
 [6] -1.421085e-13  0.000000e+00  1.136868e-13  5.684342e-14 -1.136868e-13
[11]  1.136868e-13  5.684342e-14  1.136868e-13 -8.526513e-14 -1.278977e-13
[16] -5.684342e-14  1.136868e-13 -2.842171e-14 -5.684342e-14  2.273737e-13
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> ## making sure these things agree
> ##
> ## first when there is no NA
> 
> 
> 
> agree.checks <- function(buff.matrix,r.matrix,err.tol=1e-10){
+ 
+   if (Max(buff.matrix,na.rm=TRUE) != max(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Max")
+   }
+   
+ 
+   if (Min(buff.matrix,na.rm=TRUE) != min(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Min")
+   }
+ 
+ 
+   if (abs(Sum(buff.matrix,na.rm=TRUE)- sum(r.matrix,na.rm=TRUE)) > err.tol){
+ 
+     cat(Sum(buff.matrix,na.rm=TRUE),"\n")
+     cat(sum(r.matrix,na.rm=TRUE),"\n")
+     cat(Sum(buff.matrix,na.rm=TRUE) - sum(r.matrix,na.rm=TRUE),"\n")
+     
+     stop("No agreement in Sum")
+   }
+   
+   if (abs(mean(buff.matrix,na.rm=TRUE) - mean(r.matrix,na.rm=TRUE)) > err.tol){
+     stop("No agreement in mean")
+   }
+   
+   
+   if(abs(Var(buff.matrix,na.rm=TRUE) - var(as.vector(r.matrix),na.rm=TRUE)) > err.tol){
+     stop("No agreement in Var")
+   }
+   
+   
+ 
+   if(any(abs(rowMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,mean,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowMeans")
+   }
+   
+   
+   if(any(abs(colMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,mean,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colMeans")
+   }
+   
+   
+   if(any(abs(rowSums(buff.matrix,na.rm=TRUE)  -  apply(r.matrix,1,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in rowSums")
+   }
+   
+   
+   if(any(abs(colSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colSums")
+   }
+   
+   ### this is to get around the fact that R doesn't like to compute NA on an entire vector of NA when 
+   ### computing variance
+   my.Var <- function(x,na.rm=FALSE){
+    if (all(is.na(x))){
+      return(NA)
+    } else {
+      var(x,na.rm=na.rm)
+    }
+ 
+   }
+   
+   if(any(abs(rowVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+   
+   
+   if(any(abs(colVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+ 
+ 
+   if(any(abs(rowMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+ 
+   if(any(abs(colMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+   
+   
+   if(any(abs(rowMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+   
+ 
+   if(any(abs(colMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+ 
+   if(any(abs(colMedians(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,median,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMedian")
+   }
+ 
+   if(any(abs(colRanges(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,range,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colRanges")
+   }
+ 
+ 
+   
+ }
> 
> 
> 
> 
> 
> 
> 
> 
> 
> for (rep in 1:20){
+   copymatrix <- matrix(rnorm(200,150,15),10,20)
+   
+   tmp5[1:10,1:20] <- copymatrix
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ## now lets assign some NA values and check agreement
+ 
+   which.row <- sample(1:10,1,replace=TRUE)
+   which.col  <- sample(1:20,1,replace=TRUE)
+   
+   cat(which.row," ",which.col,"\n")
+   
+   tmp5[which.row,which.col] <- NA
+   copymatrix[which.row,which.col] <- NA
+   
+   agree.checks(tmp5,copymatrix)
+ 
+   ## make an entire row NA
+   tmp5[which.row,] <- NA
+   copymatrix[which.row,] <- NA
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ### also make an entire col NA
+   tmp5[,which.col] <- NA
+   copymatrix[,which.col] <- NA
+ 
+   agree.checks(tmp5,copymatrix)
+ 
+   ### now make 1 element non NA with NA in the rest of row and column
+ 
+   tmp5[which.row,which.col] <- rnorm(1,150,15)
+   copymatrix[which.row,which.col] <- tmp5[which.row,which.col]
+ 
+   agree.checks(tmp5,copymatrix)
+ }
3   6 
4   12 
9   13 
8   13 
2   17 
5   6 
4   8 
3   20 
1   10 
8   7 
2   2 
2   10 
8   12 
5   5 
7   6 
2   2 
7   5 
5   19 
7   4 
7   6 
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.290371
> Min(tmp)
[1] -3.010377
> mean(tmp)
[1] -0.01887558
> Sum(tmp)
[1] -1.887558
> Var(tmp)
[1] 1.2547
> 
> rowMeans(tmp)
[1] -0.01887558
> rowSums(tmp)
[1] -1.887558
> rowVars(tmp)
[1] 1.2547
> rowSd(tmp)
[1] 1.120134
> rowMax(tmp)
[1] 2.290371
> rowMin(tmp)
[1] -3.010377
> 
> colMeans(tmp)
  [1] -0.130980264  0.319123202  2.256063695  1.089010902  0.744813802
  [6] -1.103679816  0.770106031 -1.028413665  0.630820210  0.962278457
 [11]  1.308399113 -1.616694719 -1.709483788 -1.065360046 -0.938366455
 [16]  2.242020753 -0.018307775 -1.345081347  0.141479521  0.754858574
 [21] -1.446307544 -0.561185446 -0.101608341 -1.420935359  0.281815250
 [26]  0.805155985 -1.397887576 -0.017408054 -0.002500402 -0.032525204
 [31]  0.338820577 -0.782825053  0.866209086  1.163567053  1.221035463
 [36] -1.857375615 -0.900603996 -0.017899598 -0.465777123 -0.752394341
 [41] -0.544218662  1.762330732 -1.007268122  1.823440764  0.507396362
 [46] -1.243539860 -1.181902768 -0.998775418 -2.594448373  1.555421792
 [51] -0.744217109  0.920184069  2.290371138  0.425361881 -1.316454555
 [56]  0.011840765  0.987056340 -0.051698596  0.569825783  0.190169859
 [61] -0.272848426 -0.072640066 -0.234045290  0.685455484 -1.355477134
 [66]  0.303071408 -1.417888055 -1.821458497  0.764694934  1.298752038
 [71]  0.606535631  1.979529994  0.539753264  1.240840428  0.135752218
 [76]  0.367994541 -0.799214869  1.136729485 -0.950331142  0.168510569
 [81] -1.567806203 -0.274013405 -0.778825175 -3.010377471  1.596290505
 [86] -0.638255584  0.490124785 -1.019929723  0.471274287  0.382333286
 [91]  2.014310837 -0.349604323 -0.737104290  0.431865254  1.062386494
 [96] -0.905761303 -2.010773082  0.647067085  0.241003507  1.221667875
> colSums(tmp)
  [1] -0.130980264  0.319123202  2.256063695  1.089010902  0.744813802
  [6] -1.103679816  0.770106031 -1.028413665  0.630820210  0.962278457
 [11]  1.308399113 -1.616694719 -1.709483788 -1.065360046 -0.938366455
 [16]  2.242020753 -0.018307775 -1.345081347  0.141479521  0.754858574
 [21] -1.446307544 -0.561185446 -0.101608341 -1.420935359  0.281815250
 [26]  0.805155985 -1.397887576 -0.017408054 -0.002500402 -0.032525204
 [31]  0.338820577 -0.782825053  0.866209086  1.163567053  1.221035463
 [36] -1.857375615 -0.900603996 -0.017899598 -0.465777123 -0.752394341
 [41] -0.544218662  1.762330732 -1.007268122  1.823440764  0.507396362
 [46] -1.243539860 -1.181902768 -0.998775418 -2.594448373  1.555421792
 [51] -0.744217109  0.920184069  2.290371138  0.425361881 -1.316454555
 [56]  0.011840765  0.987056340 -0.051698596  0.569825783  0.190169859
 [61] -0.272848426 -0.072640066 -0.234045290  0.685455484 -1.355477134
 [66]  0.303071408 -1.417888055 -1.821458497  0.764694934  1.298752038
 [71]  0.606535631  1.979529994  0.539753264  1.240840428  0.135752218
 [76]  0.367994541 -0.799214869  1.136729485 -0.950331142  0.168510569
 [81] -1.567806203 -0.274013405 -0.778825175 -3.010377471  1.596290505
 [86] -0.638255584  0.490124785 -1.019929723  0.471274287  0.382333286
 [91]  2.014310837 -0.349604323 -0.737104290  0.431865254  1.062386494
 [96] -0.905761303 -2.010773082  0.647067085  0.241003507  1.221667875
> 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.130980264  0.319123202  2.256063695  1.089010902  0.744813802
  [6] -1.103679816  0.770106031 -1.028413665  0.630820210  0.962278457
 [11]  1.308399113 -1.616694719 -1.709483788 -1.065360046 -0.938366455
 [16]  2.242020753 -0.018307775 -1.345081347  0.141479521  0.754858574
 [21] -1.446307544 -0.561185446 -0.101608341 -1.420935359  0.281815250
 [26]  0.805155985 -1.397887576 -0.017408054 -0.002500402 -0.032525204
 [31]  0.338820577 -0.782825053  0.866209086  1.163567053  1.221035463
 [36] -1.857375615 -0.900603996 -0.017899598 -0.465777123 -0.752394341
 [41] -0.544218662  1.762330732 -1.007268122  1.823440764  0.507396362
 [46] -1.243539860 -1.181902768 -0.998775418 -2.594448373  1.555421792
 [51] -0.744217109  0.920184069  2.290371138  0.425361881 -1.316454555
 [56]  0.011840765  0.987056340 -0.051698596  0.569825783  0.190169859
 [61] -0.272848426 -0.072640066 -0.234045290  0.685455484 -1.355477134
 [66]  0.303071408 -1.417888055 -1.821458497  0.764694934  1.298752038
 [71]  0.606535631  1.979529994  0.539753264  1.240840428  0.135752218
 [76]  0.367994541 -0.799214869  1.136729485 -0.950331142  0.168510569
 [81] -1.567806203 -0.274013405 -0.778825175 -3.010377471  1.596290505
 [86] -0.638255584  0.490124785 -1.019929723  0.471274287  0.382333286
 [91]  2.014310837 -0.349604323 -0.737104290  0.431865254  1.062386494
 [96] -0.905761303 -2.010773082  0.647067085  0.241003507  1.221667875
> colMin(tmp)
  [1] -0.130980264  0.319123202  2.256063695  1.089010902  0.744813802
  [6] -1.103679816  0.770106031 -1.028413665  0.630820210  0.962278457
 [11]  1.308399113 -1.616694719 -1.709483788 -1.065360046 -0.938366455
 [16]  2.242020753 -0.018307775 -1.345081347  0.141479521  0.754858574
 [21] -1.446307544 -0.561185446 -0.101608341 -1.420935359  0.281815250
 [26]  0.805155985 -1.397887576 -0.017408054 -0.002500402 -0.032525204
 [31]  0.338820577 -0.782825053  0.866209086  1.163567053  1.221035463
 [36] -1.857375615 -0.900603996 -0.017899598 -0.465777123 -0.752394341
 [41] -0.544218662  1.762330732 -1.007268122  1.823440764  0.507396362
 [46] -1.243539860 -1.181902768 -0.998775418 -2.594448373  1.555421792
 [51] -0.744217109  0.920184069  2.290371138  0.425361881 -1.316454555
 [56]  0.011840765  0.987056340 -0.051698596  0.569825783  0.190169859
 [61] -0.272848426 -0.072640066 -0.234045290  0.685455484 -1.355477134
 [66]  0.303071408 -1.417888055 -1.821458497  0.764694934  1.298752038
 [71]  0.606535631  1.979529994  0.539753264  1.240840428  0.135752218
 [76]  0.367994541 -0.799214869  1.136729485 -0.950331142  0.168510569
 [81] -1.567806203 -0.274013405 -0.778825175 -3.010377471  1.596290505
 [86] -0.638255584  0.490124785 -1.019929723  0.471274287  0.382333286
 [91]  2.014310837 -0.349604323 -0.737104290  0.431865254  1.062386494
 [96] -0.905761303 -2.010773082  0.647067085  0.241003507  1.221667875
> colMedians(tmp)
  [1] -0.130980264  0.319123202  2.256063695  1.089010902  0.744813802
  [6] -1.103679816  0.770106031 -1.028413665  0.630820210  0.962278457
 [11]  1.308399113 -1.616694719 -1.709483788 -1.065360046 -0.938366455
 [16]  2.242020753 -0.018307775 -1.345081347  0.141479521  0.754858574
 [21] -1.446307544 -0.561185446 -0.101608341 -1.420935359  0.281815250
 [26]  0.805155985 -1.397887576 -0.017408054 -0.002500402 -0.032525204
 [31]  0.338820577 -0.782825053  0.866209086  1.163567053  1.221035463
 [36] -1.857375615 -0.900603996 -0.017899598 -0.465777123 -0.752394341
 [41] -0.544218662  1.762330732 -1.007268122  1.823440764  0.507396362
 [46] -1.243539860 -1.181902768 -0.998775418 -2.594448373  1.555421792
 [51] -0.744217109  0.920184069  2.290371138  0.425361881 -1.316454555
 [56]  0.011840765  0.987056340 -0.051698596  0.569825783  0.190169859
 [61] -0.272848426 -0.072640066 -0.234045290  0.685455484 -1.355477134
 [66]  0.303071408 -1.417888055 -1.821458497  0.764694934  1.298752038
 [71]  0.606535631  1.979529994  0.539753264  1.240840428  0.135752218
 [76]  0.367994541 -0.799214869  1.136729485 -0.950331142  0.168510569
 [81] -1.567806203 -0.274013405 -0.778825175 -3.010377471  1.596290505
 [86] -0.638255584  0.490124785 -1.019929723  0.471274287  0.382333286
 [91]  2.014310837 -0.349604323 -0.737104290  0.431865254  1.062386494
 [96] -0.905761303 -2.010773082  0.647067085  0.241003507  1.221667875
> colRanges(tmp)
           [,1]      [,2]     [,3]     [,4]      [,5]     [,6]     [,7]
[1,] -0.1309803 0.3191232 2.256064 1.089011 0.7448138 -1.10368 0.770106
[2,] -0.1309803 0.3191232 2.256064 1.089011 0.7448138 -1.10368 0.770106
          [,8]      [,9]     [,10]    [,11]     [,12]     [,13]    [,14]
[1,] -1.028414 0.6308202 0.9622785 1.308399 -1.616695 -1.709484 -1.06536
[2,] -1.028414 0.6308202 0.9622785 1.308399 -1.616695 -1.709484 -1.06536
          [,15]    [,16]       [,17]     [,18]     [,19]     [,20]     [,21]
[1,] -0.9383665 2.242021 -0.01830777 -1.345081 0.1414795 0.7548586 -1.446308
[2,] -0.9383665 2.242021 -0.01830777 -1.345081 0.1414795 0.7548586 -1.446308
          [,22]      [,23]     [,24]     [,25]    [,26]     [,27]       [,28]
[1,] -0.5611854 -0.1016083 -1.420935 0.2818153 0.805156 -1.397888 -0.01740805
[2,] -0.5611854 -0.1016083 -1.420935 0.2818153 0.805156 -1.397888 -0.01740805
            [,29]      [,30]     [,31]      [,32]     [,33]    [,34]    [,35]
[1,] -0.002500402 -0.0325252 0.3388206 -0.7828251 0.8662091 1.163567 1.221035
[2,] -0.002500402 -0.0325252 0.3388206 -0.7828251 0.8662091 1.163567 1.221035
         [,36]     [,37]      [,38]      [,39]      [,40]      [,41]    [,42]
[1,] -1.857376 -0.900604 -0.0178996 -0.4657771 -0.7523943 -0.5442187 1.762331
[2,] -1.857376 -0.900604 -0.0178996 -0.4657771 -0.7523943 -0.5442187 1.762331
         [,43]    [,44]     [,45]    [,46]     [,47]      [,48]     [,49]
[1,] -1.007268 1.823441 0.5073964 -1.24354 -1.181903 -0.9987754 -2.594448
[2,] -1.007268 1.823441 0.5073964 -1.24354 -1.181903 -0.9987754 -2.594448
        [,50]      [,51]     [,52]    [,53]     [,54]     [,55]      [,56]
[1,] 1.555422 -0.7442171 0.9201841 2.290371 0.4253619 -1.316455 0.01184077
[2,] 1.555422 -0.7442171 0.9201841 2.290371 0.4253619 -1.316455 0.01184077
         [,57]      [,58]     [,59]     [,60]      [,61]       [,62]      [,63]
[1,] 0.9870563 -0.0516986 0.5698258 0.1901699 -0.2728484 -0.07264007 -0.2340453
[2,] 0.9870563 -0.0516986 0.5698258 0.1901699 -0.2728484 -0.07264007 -0.2340453
         [,64]     [,65]     [,66]     [,67]     [,68]     [,69]    [,70]
[1,] 0.6854555 -1.355477 0.3030714 -1.417888 -1.821458 0.7646949 1.298752
[2,] 0.6854555 -1.355477 0.3030714 -1.417888 -1.821458 0.7646949 1.298752
         [,71]   [,72]     [,73]   [,74]     [,75]     [,76]      [,77]
[1,] 0.6065356 1.97953 0.5397533 1.24084 0.1357522 0.3679945 -0.7992149
[2,] 0.6065356 1.97953 0.5397533 1.24084 0.1357522 0.3679945 -0.7992149
        [,78]      [,79]     [,80]     [,81]      [,82]      [,83]     [,84]
[1,] 1.136729 -0.9503311 0.1685106 -1.567806 -0.2740134 -0.7788252 -3.010377
[2,] 1.136729 -0.9503311 0.1685106 -1.567806 -0.2740134 -0.7788252 -3.010377
        [,85]      [,86]     [,87]    [,88]     [,89]     [,90]    [,91]
[1,] 1.596291 -0.6382556 0.4901248 -1.01993 0.4712743 0.3823333 2.014311
[2,] 1.596291 -0.6382556 0.4901248 -1.01993 0.4712743 0.3823333 2.014311
          [,92]      [,93]     [,94]    [,95]      [,96]     [,97]     [,98]
[1,] -0.3496043 -0.7371043 0.4318653 1.062386 -0.9057613 -2.010773 0.6470671
[2,] -0.3496043 -0.7371043 0.4318653 1.062386 -0.9057613 -2.010773 0.6470671
         [,99]   [,100]
[1,] 0.2410035 1.221668
[2,] 0.2410035 1.221668
> 
> 
> Max(tmp2)
[1] 1.914682
> Min(tmp2)
[1] -3.469894
> mean(tmp2)
[1] -0.1554694
> Sum(tmp2)
[1] -15.54694
> Var(tmp2)
[1] 1.095108
> 
> rowMeans(tmp2)
  [1] -1.306545065 -1.146255232 -0.462668488 -0.636624603  0.710200146
  [6] -0.848166478  1.354805345  0.944312023  0.603266649 -0.658957855
 [11] -0.678764609 -1.195143854 -1.148681327 -1.589804451 -1.105447226
 [16]  0.555907895  0.905558722 -1.025413540 -0.276438418  1.055131123
 [21]  0.006046979 -0.481980366 -0.665998120  0.727278614  0.180093458
 [26]  1.186537384  0.601834528  1.536143499  1.074195976  1.256082955
 [31] -1.039206119 -0.330817496  1.664496996 -0.255887952 -0.405321871
 [36]  1.450955287  0.495172318  0.885902213  0.238766448 -2.393480846
 [41] -0.574814782 -1.699179193 -0.959669508 -0.539087764  1.029990267
 [46] -0.909337642  0.364883762  1.485618762 -1.343360708  0.494175715
 [51] -1.201798293 -0.837181295 -2.478794241  0.162011534 -0.532332434
 [56]  0.270259214  1.914682160  0.434617783  0.077230898  0.482557937
 [61]  1.322487420 -0.676412280  0.170519675 -1.356017363 -0.478646946
 [66] -0.526991883 -1.662868363 -1.696207891 -0.338158753 -1.281717760
 [71]  1.260323627  1.291970635  0.683421192  0.001707991 -0.163997519
 [76] -0.911084896  0.896549415 -3.469893559  1.432906822  1.330736254
 [81] -1.013354366 -0.939906760 -0.891819611 -1.590478335 -0.572330817
 [86]  0.305606889 -0.787751918 -0.088027909  0.043097590 -1.492994794
 [91] -0.782896085  1.305765336  0.430473473  0.576644954  0.888459965
 [96] -0.299845238 -0.462417622 -0.882829141 -0.916385800  0.373867901
> rowSums(tmp2)
  [1] -1.306545065 -1.146255232 -0.462668488 -0.636624603  0.710200146
  [6] -0.848166478  1.354805345  0.944312023  0.603266649 -0.658957855
 [11] -0.678764609 -1.195143854 -1.148681327 -1.589804451 -1.105447226
 [16]  0.555907895  0.905558722 -1.025413540 -0.276438418  1.055131123
 [21]  0.006046979 -0.481980366 -0.665998120  0.727278614  0.180093458
 [26]  1.186537384  0.601834528  1.536143499  1.074195976  1.256082955
 [31] -1.039206119 -0.330817496  1.664496996 -0.255887952 -0.405321871
 [36]  1.450955287  0.495172318  0.885902213  0.238766448 -2.393480846
 [41] -0.574814782 -1.699179193 -0.959669508 -0.539087764  1.029990267
 [46] -0.909337642  0.364883762  1.485618762 -1.343360708  0.494175715
 [51] -1.201798293 -0.837181295 -2.478794241  0.162011534 -0.532332434
 [56]  0.270259214  1.914682160  0.434617783  0.077230898  0.482557937
 [61]  1.322487420 -0.676412280  0.170519675 -1.356017363 -0.478646946
 [66] -0.526991883 -1.662868363 -1.696207891 -0.338158753 -1.281717760
 [71]  1.260323627  1.291970635  0.683421192  0.001707991 -0.163997519
 [76] -0.911084896  0.896549415 -3.469893559  1.432906822  1.330736254
 [81] -1.013354366 -0.939906760 -0.891819611 -1.590478335 -0.572330817
 [86]  0.305606889 -0.787751918 -0.088027909  0.043097590 -1.492994794
 [91] -0.782896085  1.305765336  0.430473473  0.576644954  0.888459965
 [96] -0.299845238 -0.462417622 -0.882829141 -0.916385800  0.373867901
> rowVars(tmp2)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowSd(tmp2)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowMax(tmp2)
  [1] -1.306545065 -1.146255232 -0.462668488 -0.636624603  0.710200146
  [6] -0.848166478  1.354805345  0.944312023  0.603266649 -0.658957855
 [11] -0.678764609 -1.195143854 -1.148681327 -1.589804451 -1.105447226
 [16]  0.555907895  0.905558722 -1.025413540 -0.276438418  1.055131123
 [21]  0.006046979 -0.481980366 -0.665998120  0.727278614  0.180093458
 [26]  1.186537384  0.601834528  1.536143499  1.074195976  1.256082955
 [31] -1.039206119 -0.330817496  1.664496996 -0.255887952 -0.405321871
 [36]  1.450955287  0.495172318  0.885902213  0.238766448 -2.393480846
 [41] -0.574814782 -1.699179193 -0.959669508 -0.539087764  1.029990267
 [46] -0.909337642  0.364883762  1.485618762 -1.343360708  0.494175715
 [51] -1.201798293 -0.837181295 -2.478794241  0.162011534 -0.532332434
 [56]  0.270259214  1.914682160  0.434617783  0.077230898  0.482557937
 [61]  1.322487420 -0.676412280  0.170519675 -1.356017363 -0.478646946
 [66] -0.526991883 -1.662868363 -1.696207891 -0.338158753 -1.281717760
 [71]  1.260323627  1.291970635  0.683421192  0.001707991 -0.163997519
 [76] -0.911084896  0.896549415 -3.469893559  1.432906822  1.330736254
 [81] -1.013354366 -0.939906760 -0.891819611 -1.590478335 -0.572330817
 [86]  0.305606889 -0.787751918 -0.088027909  0.043097590 -1.492994794
 [91] -0.782896085  1.305765336  0.430473473  0.576644954  0.888459965
 [96] -0.299845238 -0.462417622 -0.882829141 -0.916385800  0.373867901
> rowMin(tmp2)
  [1] -1.306545065 -1.146255232 -0.462668488 -0.636624603  0.710200146
  [6] -0.848166478  1.354805345  0.944312023  0.603266649 -0.658957855
 [11] -0.678764609 -1.195143854 -1.148681327 -1.589804451 -1.105447226
 [16]  0.555907895  0.905558722 -1.025413540 -0.276438418  1.055131123
 [21]  0.006046979 -0.481980366 -0.665998120  0.727278614  0.180093458
 [26]  1.186537384  0.601834528  1.536143499  1.074195976  1.256082955
 [31] -1.039206119 -0.330817496  1.664496996 -0.255887952 -0.405321871
 [36]  1.450955287  0.495172318  0.885902213  0.238766448 -2.393480846
 [41] -0.574814782 -1.699179193 -0.959669508 -0.539087764  1.029990267
 [46] -0.909337642  0.364883762  1.485618762 -1.343360708  0.494175715
 [51] -1.201798293 -0.837181295 -2.478794241  0.162011534 -0.532332434
 [56]  0.270259214  1.914682160  0.434617783  0.077230898  0.482557937
 [61]  1.322487420 -0.676412280  0.170519675 -1.356017363 -0.478646946
 [66] -0.526991883 -1.662868363 -1.696207891 -0.338158753 -1.281717760
 [71]  1.260323627  1.291970635  0.683421192  0.001707991 -0.163997519
 [76] -0.911084896  0.896549415 -3.469893559  1.432906822  1.330736254
 [81] -1.013354366 -0.939906760 -0.891819611 -1.590478335 -0.572330817
 [86]  0.305606889 -0.787751918 -0.088027909  0.043097590 -1.492994794
 [91] -0.782896085  1.305765336  0.430473473  0.576644954  0.888459965
 [96] -0.299845238 -0.462417622 -0.882829141 -0.916385800  0.373867901
> 
> colMeans(tmp2)
[1] -0.1554694
> colSums(tmp2)
[1] -15.54694
> colVars(tmp2)
[1] 1.095108
> colSd(tmp2)
[1] 1.046474
> colMax(tmp2)
[1] 1.914682
> colMin(tmp2)
[1] -3.469894
> colMedians(tmp2)
[1] -0.2881418
> colRanges(tmp2)
          [,1]
[1,] -3.469894
[2,]  1.914682
> 
> 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] -0.3764154  4.7490618 -0.1264694 -0.7017192 -1.3457497  1.0217257
 [7] -2.1329021 -8.4366895  4.2108168  3.4315332
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -1.0934671
[2,] -0.6371323
[3,]  0.1680122
[4,]  0.4519944
[5,]  0.7582215
> 
> rowApply(tmp,sum)
 [1] -1.129307 -1.859523  1.565398 -1.172186 -2.293823  1.522945 -3.348802
 [8] -1.729637  3.904578  4.833550
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    2    8    7    8    7    1    6    2    6     5
 [2,]    3   10    3    9    9    3   10    7   10     7
 [3,]    7    5    5    7    1    9    4    1    9    10
 [4,]    6    3   10    5    6    7    9    3    1     2
 [5,]    8    7    6    2    4    4    7    8    3     4
 [6,]   10    2    1    3    3    5    3    9    8     9
 [7,]    4    6    2    6    5    6    5    6    4     3
 [8,]    9    1    4    1    2    8    2    5    2     1
 [9,]    1    4    9    4   10    2    8   10    5     6
[10,]    5    9    8   10    8   10    1    4    7     8
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1]  1.3646250  1.5948799  1.6509557  0.7440615 -1.1343197  0.9259334
 [7] -0.7605883  2.2204087  0.4335597  0.4025716 -0.8057329 -0.9494421
[13] -1.8501222  4.3857155  2.9275854 -0.8871826  1.7583426  0.9425335
[19] -2.5182540  1.4593301
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -0.8643694
[2,] -0.2973369
[3,] -0.1240228
[4,]  1.0352244
[5,]  1.6151298
> 
> rowApply(tmp,sum)
[1]  5.9746482  3.3595580 -2.7505879  5.6124672 -0.2912248
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]   20    4    9    6   18
[2,]   18    1   18   18    5
[3,]   11    2   16   15   19
[4,]   12   15    4   13    9
[5,]    2    6   10   10   12
> 
> 
> as.matrix(tmp)
           [,1]       [,2]       [,3]       [,4]        [,5]        [,6]
[1,]  1.6151298  1.2441809  0.4582129  0.6241022 -0.90368661  0.96190903
[2,] -0.8643694 -1.5133274 -1.3300636  0.9332387 -0.60816874  1.05567278
[3,] -0.1240228  0.7250644  0.5976378 -1.0387362  0.01470091  0.09912621
[4,] -0.2973369  1.8289366  0.8319611  0.4161956  0.19347819 -0.51960036
[5,]  1.0352244 -0.6899747  1.0932075 -0.1907388  0.16935651 -0.67117428
           [,7]       [,8]        [,9]       [,10]       [,11]      [,12]
[1,]  1.2620339 -0.9614521 -0.58107931 -0.08576504 -0.08797567  1.2382968
[2,] -0.6854748  0.8866847  0.95362470 -0.04302226  1.62264266  0.4669697
[3,]  0.2338709  1.4112648  0.30121041  0.91269780 -1.24292531 -1.4728832
[4,] -1.8040163 -0.7521038 -0.04224899  0.18320226 -0.96286256 -0.2504675
[5,]  0.2329980  1.6360151 -0.19794714 -0.56454117 -0.13461197 -0.9313579
          [,13]     [,14]      [,15]      [,16]      [,17]        [,18]
[1,] -0.6422921 0.7313527  0.9300314  0.4119553  1.0441287 -0.239737802
[2,]  0.4643485 0.9822590  0.5230795 -0.9069375  1.2011936  0.767281657
[3,] -1.8598215 0.2551023 -0.3534098  0.3851409 -1.0291754 -0.745749420
[4,] -0.6572565 1.8450030  0.9564622  0.7201234  0.3657459  1.169535991
[5,]  0.8448993 0.5719986  0.8714221 -1.4974647  0.1764498 -0.008796902
          [,19]      [,20]
[1,] -0.8134325 -0.2312642
[2,] -0.3985006 -0.1475733
[3,] -0.4628829  0.6432022
[4,]  0.3810655  2.0066504
[5,] -1.2245035 -0.8116849
> 
> 
> is.BufferedMatrix(tmp)
[1] TRUE
> 
> as.BufferedMatrix(as.matrix(tmp))
BufferedMatrix object
Matrix size:  5 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  800  bytes.
> 
> 
> 
> subBufferedMatrix(tmp,1:5,1:5)
BufferedMatrix object
Matrix size:  5 5 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  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.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  566  bytes.
Disk usage :  160  bytes.
> subBufferedMatrix(tmp,1:3,)
BufferedMatrix object
Matrix size:  3 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  480  bytes.
> 
> 
> rm(tmp)
> 
> 
> ###
> ### Testing colnames and rownames
> ###
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> 
> 
> colnames(tmp)
NULL
> rownames(tmp)
NULL
> 
> 
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> colnames(tmp)
 [1] "col1"  "col2"  "col3"  "col4"  "col5"  "col6"  "col7"  "col8"  "col9" 
[10] "col10" "col11" "col12" "col13" "col14" "col15" "col16" "col17" "col18"
[19] "col19" "col20"
> rownames(tmp)
[1] "row1" "row2" "row3" "row4" "row5"
> 
> 
> tmp["row1",]
          col1     col2       col3     col4       col5       col6       col7
row1 -1.307575 2.172306 -0.5463695 2.223598 -0.4349324 -0.1128924 -0.2997118
          col8     col9     col10       col11     col12     col13      col14
row1 -1.138724 3.018479 0.9006871 -0.08827923 0.8229395 -1.961319 -0.8108857
          col15      col16     col17      col18    col19     col20
row1 -0.5048645 0.07136486 0.5010854 -0.4355201 -1.17186 0.2626378
> tmp[,"col10"]
          col10
row1  0.9006871
row2 -1.2418291
row3 -0.5713588
row4 -0.7711222
row5 -0.7716309
> tmp[c("row1","row5"),]
           col1       col2       col3       col4       col5       col6
row1 -1.3075748  2.1723063 -0.5463695  2.2235979 -0.4349324 -0.1128924
row5 -0.1175005 -0.2769772  0.1797852 -0.8935307 -0.3861850 -0.7596808
           col7      col8        col9      col10       col11     col12
row1 -0.2997118 -1.138724  3.01847932  0.9006871 -0.08827923 0.8229395
row5  0.4442306 -1.273913 -0.09186977 -0.7716309 -0.89389770 2.0269907
         col13      col14      col15       col16     col17      col18     col19
row1 -1.961319 -0.8108857 -0.5048645  0.07136486 0.5010854 -0.4355201 -1.171860
row5 -1.291921 -0.5554090 -0.5405091 -1.17102750 0.8268046  2.1942839 -1.226489
         col20
row1 0.2626378
row5 1.4010193
> tmp[,c("col6","col20")]
              col6      col20
row1 -0.1128923799  0.2626378
row2  2.1843896141 -0.9358101
row3 -0.0003007135  1.2006413
row4  0.4900579127  1.0184841
row5 -0.7596808438  1.4010193
> tmp[c("row1","row5"),c("col6","col20")]
           col6     col20
row1 -0.1128924 0.2626378
row5 -0.7596808 1.4010193
> 
> 
> 
> 
> tmp["row1",] <- rnorm(20,mean=10)
> tmp[,"col10"] <- rnorm(5,mean=30)
> tmp[c("row1","row5"),] <- rnorm(40,mean=50)
> tmp[,c("col6","col20")] <- rnorm(10,mean=75)
> tmp[c("row1","row5"),c("col6","col20")]  <- rnorm(4,mean=105)
> 
> tmp["row1",]
         col1     col2    col3     col4     col5     col6    col7    col8
row1 49.55629 49.03612 50.0484 49.85045 49.28273 104.1701 50.4487 50.5056
         col9   col10    col11    col12    col13    col14    col15 col16
row1 49.08018 49.6719 50.53812 49.21682 49.91523 48.95563 48.37275 50.43
        col17    col18    col19    col20
row1 49.75494 51.34112 48.91925 103.5461
> tmp[,"col10"]
        col10
row1 49.67190
row2 31.56973
row3 31.03224
row4 29.66957
row5 51.17359
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 49.55629 49.03612 50.04840 49.85045 49.28273 104.1701 50.44870 50.50560
row5 49.71209 48.94428 50.66186 50.22090 49.24891 104.8248 51.02467 51.99533
         col9    col10    col11    col12    col13    col14    col15    col16
row1 49.08018 49.67190 50.53812 49.21682 49.91523 48.95563 48.37275 50.43000
row5 48.70251 51.17359 50.69786 49.58872 51.04239 50.63428 50.42423 50.71594
        col17    col18    col19    col20
row1 49.75494 51.34112 48.91925 103.5461
row5 48.95636 50.46641 48.75725 103.6997
> tmp[,c("col6","col20")]
          col6     col20
row1 104.17013 103.54610
row2  75.88496  74.85598
row3  73.94671  75.92957
row4  75.35337  74.53352
row5 104.82484 103.69971
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 104.1701 103.5461
row5 104.8248 103.6997
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 104.1701 103.5461
row5 104.8248 103.6997
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
           col13
[1,]  0.28636609
[2,]  0.37025187
[3,]  0.29390442
[4,] -1.03547947
[5,] -0.02978856
> tmp[,c("col17","col7")]
          col17       col7
[1,]  0.2652819 -0.5203128
[2,] -0.3794144 -0.8936351
[3,] -1.0930119  0.8928944
[4,]  0.9496011  1.2690628
[5,] -0.6707118  1.2189083
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
           col6       col20
[1,]  1.0630882 -0.06585759
[2,]  1.6066140 -1.62377758
[3,] -1.6295335 -0.06211983
[4,] -0.9595835 -0.32866014
[5,] -1.5944507 -0.44193579
> subBufferedMatrix(tmp,1,c("col6"))[,1]
         col1
[1,] 1.063088
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
         col6
[1,] 1.063088
[2,] 1.606614
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> 
> 
> 
> subBufferedMatrix(tmp,c("row3","row1"),)[,1:20]
           [,1]        [,2]       [,3]      [,4]        [,5]      [,6]
row3  0.2285566  0.01047013 -0.1255284 0.3350447 -1.07421495 0.1290865
row1 -0.2763788 -0.11781580  0.6313691 2.1323687 -0.01833656 1.2572412
           [,7]       [,8]       [,9]     [,10]     [,11]      [,12]      [,13]
row3 -1.0420440  0.7263095  1.0101097 1.7335203 1.4460723 -1.3841662 -0.8021139
row1  0.4395279 -2.3128000 -0.6885116 0.6022395 0.6673008 -0.4730604  0.5640776
          [,14]     [,15]       [,16]      [,17]     [,18]      [,19]     [,20]
row3 -0.4055960 0.5222606  0.40433569 -1.6183448 0.3998942  0.3899684 -1.721774
row1 -0.7196061 0.2133221 -0.02175707 -0.3558266 0.3683161 -1.2734791  0.459697
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
          [,1]       [,2]       [,3]      [,4]      [,5]      [,6]      [,7]
row2 0.1388131 -0.4579872 -0.3671965 0.8525977 -1.080375 0.2506885 0.2272195
          [,8]       [,9]    [,10]
row2 0.8098278 -0.8058894 0.891761
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
           [,1]      [,2]      [,3]       [,4]      [,5]       [,6]     [,7]
row5 0.05638807 0.2922904 -1.553228 -0.1307265 -1.154651 -0.8304866 1.803647
           [,8]       [,9]      [,10]     [,11]      [,12]     [,13]    [,14]
row5 -0.2779476 -0.3839036 -0.2670982 0.7370659 -0.5272238 0.8552956 2.644658
          [,15]     [,16]     [,17]      [,18]       [,19]      [,20]
row5 -0.2287779 0.2768074 0.5281545 -0.4001867 -0.02869542 -0.4891056
> 
> 
> 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: 0x5696a88f27a0>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM311dd1213112ee"
 [2] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM311dd168729913"
 [3] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM311dd15eee3d45"
 [4] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM311dd1441564c0"
 [5] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM311dd17c00c76a"
 [6] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM311dd173dfd63a"
 [7] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM311dd13b2a3843"
 [8] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM311dd13c24452c"
 [9] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM311dd13b5110d6"
[10] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM311dd1224540e0"
[11] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM311dd13c40c4d9"
[12] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM311dd177e9749d"
[13] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM311dd172e2ac57"
[14] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM311dd1590511e9"
[15] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM311dd1424b6d14"
> 
> 
> ### 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: 0x5696aa0416c0>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x5696aa0416c0>
Warning message:
In dir.create(new.directory) :
  '/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x5696aa0416c0>
> rowMedians(tmp)
  [1]  0.6732919011  0.3717963117  0.3996232682  0.3531916902 -0.2150596425
  [6] -0.1213177520  0.3868889616  0.0638267053 -0.0708981667  0.1930386540
 [11] -0.2134890763 -0.1998576871 -0.3767199783  0.3202052988  0.3807899423
 [16] -0.3937214118 -0.0427315300  0.0284769261  0.1258981408  0.1796887349
 [21] -0.1338973100 -0.7358259561  0.5761117248 -0.0709648243 -0.2984879346
 [26]  0.2619926456 -0.0592076380 -0.6606923334  0.1013922008  0.1009865427
 [31]  0.2953791549 -0.1636588021  0.3092144869  0.1671190070  0.4418797868
 [36] -0.0286887450  0.4340440221  0.2251660449 -0.4095930597 -0.5674436732
 [41] -0.2540754102 -0.6113842483 -0.2674599144  0.1917721180  0.3240223556
 [46]  0.0427344516  0.1036046895  0.5375222637 -0.8699952546  0.2169859762
 [51] -0.0394838817  0.0657786956  0.0027698840 -0.2017412797  0.5764361197
 [56]  0.2769888916  0.4131258421  0.5438713081 -0.6774597033  0.0987236424
 [61] -0.1705342760 -0.1642382089  0.0207712221  0.3392566811 -0.2321343956
 [66]  0.3884196671 -0.1202710311  0.2170810817 -0.0764425193 -0.1185619744
 [71] -0.2435718726  0.2174046008  0.1707914823  0.2752823465 -0.0356552842
 [76]  0.0203518867 -0.2249689860 -0.4150204677 -0.4900550436 -0.0134188169
 [81] -0.2291663746  0.5244190142  0.3920689428  0.1095324212 -0.4334292964
 [86]  0.2783718475  0.2885983884 -0.1613178308  0.0008562942 -0.0143552201
 [91]  0.1500660363  0.2585745247  0.0887023574  0.4095780909 -0.1500985438
 [96] -0.9127613383  0.2103334983  0.6479683771 -0.2515155316 -0.2926034387
[101] -0.4207395212 -0.2879184792  0.0406490782 -0.1859306402 -0.1243171437
[106]  0.0256194614  0.1637646326  0.3317879664 -0.0381361175  0.1121904439
[111] -0.2717894473 -0.4657929467  0.1520941214  0.5513617066  0.0330462158
[116]  0.0702686632 -0.2164182530 -0.3611420504 -0.2959405553 -0.1198511592
[121] -0.3105969872  0.7014089791 -0.0870373524 -0.0036801248 -0.1873222470
[126] -0.0427148422 -0.1699634013  0.1168843276 -0.3188221918  0.2749707378
[131]  0.1882119925 -0.6982799276 -0.3610815375 -0.4322353479 -0.2346971670
[136] -0.1971639518  0.0592825594  0.3027296364 -0.0784923542  0.0069077511
[141] -0.0987252985  0.1390516877 -0.5161212055  0.3111839088 -0.2696976964
[146]  0.4977906443 -0.0809889200  0.0416918532  0.1292679074 -0.6510656742
[151]  0.4399859925  0.5034752128  0.0358841876 -0.4083213752  0.1297187112
[156]  0.7742948996 -0.0682245623 -0.2088001123 -0.2173222306 -0.2077185333
[161] -0.2962274523  0.5901829433 -0.2413524622 -0.2535857089 -0.0641822671
[166] -0.3278054806  0.2416332769  0.1347123149 -0.3322946718 -0.0634664677
[171] -0.2999015383 -0.3149493012 -0.2440197937  0.1778021682  0.5082159306
[176]  0.2187654064  0.3257135648  0.1176869787  0.2759765245  0.1967376145
[181] -0.3172158780  0.1618374128  0.1267965211  0.1730915910  0.3296252650
[186]  0.3369138317 -0.3896653289  0.0296245074 -0.2874002658 -0.0824892976
[191]  0.3918474429 -0.0753397431  0.1572144215  0.0252966150  0.1367082827
[196] -0.7600141893 -0.1210073639 -0.2378623032  0.2847913981 -0.1907896760
[201]  0.4167853810  0.0546199376  0.0146065355  0.1528513108 -0.2082035851
[206]  0.0695594562  0.0125477430 -0.2122799203  0.3231868247  0.5516960495
[211] -0.0433667701 -0.0605692555  0.4203165619  0.2270450735  0.7326039392
[216] -0.0966033835 -0.1153082551 -0.1442631166  0.2459747988 -0.3352778208
[221] -0.1927022359 -0.4799663353 -0.1218346426  0.2290754129 -0.0707535178
[226]  0.1087911544 -0.1668362843 -0.2178753856  0.7998866676  0.2052767718
> 
> proc.time()
   user  system elapsed 
  1.654   0.908   2.614 

BufferedMatrix.Rcheck/tests/rawCalltesting.Rout


R version 4.5.1 (2025-06-13) -- "Great Square Root"
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: 0x56b49516ab80>
> .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: 0x56b49516ab80>
> .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: 0x56b49516ab80>
> .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: 0x56b49516ab80>
> 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: 0x56b49514d390>
> .Call("R_bm_AddColumn",P)
<pointer: 0x56b49514d390>
> .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: 0x56b49514d390>
> .Call("R_bm_AddColumn",P)
<pointer: 0x56b49514d390>
> .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: 0x56b49514d390>
> 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: 0x56b4951351e0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x56b4951351e0>
> .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: 0x56b4951351e0>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x56b4951351e0>
> .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: 0x56b4951351e0>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x56b4951351e0>
> .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: 0x56b4951351e0>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x56b4951351e0>
> .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: 0x56b4951351e0>
> 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: 0x56b4949ba2a0>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x56b4949ba2a0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x56b4949ba2a0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x56b4949ba2a0>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile311f8c25172f47" "BufferedMatrixFile311f8c60ea1bd1"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile311f8c25172f47" "BufferedMatrixFile311f8c60ea1bd1"
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x56b495bbdda0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x56b495bbdda0>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x56b495bbdda0>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x56b495bbdda0>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x56b495bbdda0>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x56b495bbdda0>
> .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: 0x56b495e52470>
> .Call("R_bm_AddColumn",P)
<pointer: 0x56b495e52470>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x56b495e52470>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x56b495e52470>
> 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: 0x56b495033410>
> .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: 0x56b495033410>
> rm(P)
> 
> proc.time()
   user  system elapsed 
  0.334   0.044   0.423 

BufferedMatrix.Rcheck/tests/Rcodetesting.Rout


R version 4.5.1 (2025-06-13) -- "Great Square Root"
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.298   0.062   0.381 

Example timings