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

This page was generated on 2025-10-18 12:03 -0400 (Sat, 18 Oct 2025).

HostnameOSArch (*)R versionInstalled pkgs
nebbiolo2Linux (Ubuntu 24.04.3 LTS)x86_644.5.1 Patched (2025-08-23 r88802) -- "Great Square Root" 4887
lconwaymacOS 12.7.6 Montereyx86_644.5.1 Patched (2025-09-10 r88807) -- "Great Square Root" 4677
kjohnson3macOS 13.7.7 Venturaarm644.5.1 Patched (2025-09-10 r88807) -- "Great Square Root" 4622
taishanLinux (openEuler 24.03 LTS)aarch644.5.0 (2025-04-11) -- "How About a Twenty-Six" 4632
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 256/2353HostnameOS / ArchINSTALLBUILDCHECKBUILD BIN
BufferedMatrix 1.73.0  (landing page)
Ben Bolstad
Snapshot Date: 2025-10-17 13:45 -0400 (Fri, 17 Oct 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.6 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-10-17 21:41:29 -0400 (Fri, 17 Oct 2025)
EndedAt: 2025-10-17 21:41:53 -0400 (Fri, 17 Oct 2025)
EllapsedTime: 24.0 seconds
RetCode: 0
Status:   OK  
CheckDir: BufferedMatrix.Rcheck
Warnings: 0

Command output

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


* using log directory ‘/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck’
* using R version 4.5.1 Patched (2025-08-23 r88802)
* 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 Patched (2025-08-23 r88802) -- "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.248   0.037   0.274 

BufferedMatrix.Rcheck/tests/objectTesting.Rout


R version 4.5.1 Patched (2025-08-23 r88802) -- "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 478419 25.6    1047111   56   639600 34.2
Vcells 885237  6.8    8388608   64  2081604 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] "Fri Oct 17 21:41:43 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] "Fri Oct 17 21:41:43 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: 0x5c7d7771ec80>
> 
> 
> 
> 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] "Fri Oct 17 21:41:44 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] "Fri Oct 17 21:41:44 2025"
> 
> ColMode(tmp2)
<pointer: 0x5c7d7771ec80>
> 
> 
> 
> ### Now testing assignments
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+ 
+   new.data <- rnorm(20)
+   tmp2[which.row,] <- new.data
+   test.matrix[which.row,] <- new.data
+   if (rep > 1){
+     if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+   
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   new.data <- rnorm(10)
+   tmp2[,which.col] <- new.data
+   test.matrix[,which.col]<- new.data
+ 
+   if (rep > 1){
+     if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.col <- which.col
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,5,replace=TRUE)
+   new.data <- matrix(rnorm(50),5,10)
+   tmp2[,which.col] <- new.data
+   test.matrix[,which.col]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.col <- which.col
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   new.data <- matrix(rnorm(50),5,10)
+   tmp2[which.row,] <- new.data
+   test.matrix[which.row,]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col  <- sample(1:20,5,replace=TRUE)
+   new.data <- matrix(rnorm(25),5,5)
+   tmp2[which.row,which.col] <- new.data
+   test.matrix[which.row,which.col]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[prev.row,prev.col] == test.matrix[prev.row,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+   prev.col <- which.col
+ }
> 
> 
> 
> 
> ###
> ###
> ### testing some more functions
> ###
> 
> 
> 
> ## duplication function
> tmp5 <- duplicate(tmp2)
> 
> # making sure really did copy everything.
> tmp5[1,1] <- tmp5[1,1] +100.00
> 
> if (tmp5[1,1] == tmp2[1,1]){
+   stop("Problem with duplication")
+ }
> 
> 
> 
> 
> ### testing elementwise applying of functions
> 
> tmp5[1:4,1:4]
            [,1]       [,2]       [,3]        [,4]
[1,] 101.2852345  0.2394823 -2.5526702 -0.39843337
[2,]  -1.5279200 -0.8513468 -0.1441321 -1.40173083
[3,]  -2.3753347  0.5366954  0.2706726  0.94830338
[4,]  -0.7387676  0.9052837  0.2711534 -0.01089531
> 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,] 101.2852345 0.2394823 2.5526702 0.39843337
[2,]   1.5279200 0.8513468 0.1441321 1.40173083
[3,]   2.3753347 0.5366954 0.2706726 0.94830338
[4,]   0.7387676 0.9052837 0.2711534 0.01089531
> 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.0640566 0.4893692 1.5977078 0.6312158
[2,]  1.2360906 0.9226846 0.3796473 1.1839471
[3,]  1.5412121 0.7325950 0.5202621 0.9738087
[4,]  0.8595159 0.9514640 0.5207240 0.1043806
> 
> 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,] 226.92580 30.13317 43.52975 31.71059
[2,]  38.88883 35.07819 28.94060 38.24120
[3,]  42.78746 32.86264 30.47329 35.68639
[4,]  34.33393 35.41992 30.47839 26.05470
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x5c7d77f5c270>
> exp(tmp5)
<pointer: 0x5c7d77f5c270>
> log(tmp5,2)
<pointer: 0x5c7d77f5c270>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 472.3163
> Min(tmp5)
[1] 53.77898
> mean(tmp5)
[1] 72.64483
> Sum(tmp5)
[1] 14528.97
> Var(tmp5)
[1] 884.834
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 93.45906 74.21586 70.52210 69.15293 69.29293 71.55391 71.99441 68.48129
 [9] 67.20873 70.56704
> rowSums(tmp5)
 [1] 1869.181 1484.317 1410.442 1383.059 1385.859 1431.078 1439.888 1369.626
 [9] 1344.175 1411.341
> rowVars(tmp5)
 [1] 8042.59719   67.32223  110.57326   76.64627   62.14155   35.42052
 [7]   83.81473   61.32543   66.36820  117.62962
> rowSd(tmp5)
 [1] 89.680529  8.205013 10.515382  8.754786  7.882991  5.951514  9.155038
 [8]  7.831055  8.146668 10.845719
> rowMax(tmp5)
 [1] 472.31632  87.48083  92.86980  91.86667  81.92526  80.93622  87.60809
 [8]  79.02094  84.18263  86.03367
> rowMin(tmp5)
 [1] 59.68972 60.23608 53.77898 53.95763 55.78803 61.11684 56.08613 54.21298
 [9] 54.98640 53.90667
> 
> colMeans(tmp5)
 [1] 113.33745  73.80346  70.22879  70.38254  75.31633  72.63573  71.01181
 [8]  72.60368  69.00548  70.90448  69.44557  70.77258  69.23797  69.82040
[15]  70.68260  65.92430  69.89625  67.45510  70.38268  70.04935
> colSums(tmp5)
 [1] 1133.3745  738.0346  702.2879  703.8254  753.1633  726.3573  710.1181
 [8]  726.0368  690.0548  709.0448  694.4557  707.7258  692.3797  698.2040
[15]  706.8260  659.2430  698.9625  674.5510  703.8268  700.4935
> colVars(tmp5)
 [1] 15971.01307    38.92441    92.27194    86.88025   107.87992   117.64681
 [7]    96.06290    54.79796    79.74356    66.40622    72.12160    40.68334
[13]   110.92171   103.48120    88.21234    58.70043    70.69875    87.26903
[19]   114.83601    80.61312
> colSd(tmp5)
 [1] 126.376474   6.238943   9.605829   9.320957  10.386526  10.846512
 [7]   9.801168   7.402564   8.929925   8.149001   8.492444   6.378349
[13]  10.531938  10.172571   9.392142   7.661620   8.408255   9.341789
[19]  10.716156   8.978481
> colMax(tmp5)
 [1] 472.31632  85.63202  90.60147  84.53937  91.86667  87.82468  92.86980
 [8]  81.72706  80.05956  84.14776  84.18263  78.79831  84.79473  85.63842
[15]  87.48083  79.16144  80.93622  83.67004  86.03367  85.87884
> colMin(tmp5)
 [1] 61.53656 62.71826 60.23608 54.22945 54.21298 55.78803 58.49458 61.30014
 [9] 55.27868 53.95763 56.08613 61.75153 53.77898 54.40013 57.78410 54.98640
[17] 55.97519 54.33608 54.74036 58.29427
> 
> 
> ### 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] 93.45906       NA 70.52210 69.15293 69.29293 71.55391 71.99441 68.48129
 [9] 67.20873 70.56704
> rowSums(tmp5)
 [1] 1869.181       NA 1410.442 1383.059 1385.859 1431.078 1439.888 1369.626
 [9] 1344.175 1411.341
> rowVars(tmp5)
 [1] 8042.59719   70.98347  110.57326   76.64627   62.14155   35.42052
 [7]   83.81473   61.32543   66.36820  117.62962
> rowSd(tmp5)
 [1] 89.680529  8.425169 10.515382  8.754786  7.882991  5.951514  9.155038
 [8]  7.831055  8.146668 10.845719
> rowMax(tmp5)
 [1] 472.31632        NA  92.86980  91.86667  81.92526  80.93622  87.60809
 [8]  79.02094  84.18263  86.03367
> rowMin(tmp5)
 [1] 59.68972       NA 53.77898 53.95763 55.78803 61.11684 56.08613 54.21298
 [9] 54.98640 53.90667
> 
> colMeans(tmp5)
 [1] 113.33745  73.80346  70.22879  70.38254  75.31633  72.63573  71.01181
 [8]  72.60368  69.00548  70.90448  69.44557  70.77258  69.23797        NA
[15]  70.68260  65.92430  69.89625  67.45510  70.38268  70.04935
> colSums(tmp5)
 [1] 1133.3745  738.0346  702.2879  703.8254  753.1633  726.3573  710.1181
 [8]  726.0368  690.0548  709.0448  694.4557  707.7258  692.3797        NA
[15]  706.8260  659.2430  698.9625  674.5510  703.8268  700.4935
> colVars(tmp5)
 [1] 15971.01307    38.92441    92.27194    86.88025   107.87992   117.64681
 [7]    96.06290    54.79796    79.74356    66.40622    72.12160    40.68334
[13]   110.92171          NA    88.21234    58.70043    70.69875    87.26903
[19]   114.83601    80.61312
> colSd(tmp5)
 [1] 126.376474   6.238943   9.605829   9.320957  10.386526  10.846512
 [7]   9.801168   7.402564   8.929925   8.149001   8.492444   6.378349
[13]  10.531938         NA   9.392142   7.661620   8.408255   9.341789
[19]  10.716156   8.978481
> colMax(tmp5)
 [1] 472.31632  85.63202  90.60147  84.53937  91.86667  87.82468  92.86980
 [8]  81.72706  80.05956  84.14776  84.18263  78.79831  84.79473        NA
[15]  87.48083  79.16144  80.93622  83.67004  86.03367  85.87884
> colMin(tmp5)
 [1] 61.53656 62.71826 60.23608 54.22945 54.21298 55.78803 58.49458 61.30014
 [9] 55.27868 53.95763 56.08613 61.75153 53.77898       NA 57.78410 54.98640
[17] 55.97519 54.33608 54.74036 58.29427
> 
> Max(tmp5,na.rm=TRUE)
[1] 472.3163
> Min(tmp5,na.rm=TRUE)
[1] 53.77898
> mean(tmp5,na.rm=TRUE)
[1] 72.64277
> Sum(tmp5,na.rm=TRUE)
[1] 14455.91
> Var(tmp5,na.rm=TRUE)
[1] 889.302
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 93.45906 74.27699 70.52210 69.15293 69.29293 71.55391 71.99441 68.48129
 [9] 67.20873 70.56704
> rowSums(tmp5,na.rm=TRUE)
 [1] 1869.181 1411.263 1410.442 1383.059 1385.859 1431.078 1439.888 1369.626
 [9] 1344.175 1411.341
> rowVars(tmp5,na.rm=TRUE)
 [1] 8042.59719   70.98347  110.57326   76.64627   62.14155   35.42052
 [7]   83.81473   61.32543   66.36820  117.62962
> rowSd(tmp5,na.rm=TRUE)
 [1] 89.680529  8.425169 10.515382  8.754786  7.882991  5.951514  9.155038
 [8]  7.831055  8.146668 10.845719
> rowMax(tmp5,na.rm=TRUE)
 [1] 472.31632  87.48083  92.86980  91.86667  81.92526  80.93622  87.60809
 [8]  79.02094  84.18263  86.03367
> rowMin(tmp5,na.rm=TRUE)
 [1] 59.68972 60.23608 53.77898 53.95763 55.78803 61.11684 56.08613 54.21298
 [9] 54.98640 53.90667
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 113.33745  73.80346  70.22879  70.38254  75.31633  72.63573  71.01181
 [8]  72.60368  69.00548  70.90448  69.44557  70.77258  69.23797  69.46106
[15]  70.68260  65.92430  69.89625  67.45510  70.38268  70.04935
> colSums(tmp5,na.rm=TRUE)
 [1] 1133.3745  738.0346  702.2879  703.8254  753.1633  726.3573  710.1181
 [8]  726.0368  690.0548  709.0448  694.4557  707.7258  692.3797  625.1495
[15]  706.8260  659.2430  698.9625  674.5510  703.8268  700.4935
> colVars(tmp5,na.rm=TRUE)
 [1] 15971.01307    38.92441    92.27194    86.88025   107.87992   117.64681
 [7]    96.06290    54.79796    79.74356    66.40622    72.12160    40.68334
[13]   110.92171   114.96371    88.21234    58.70043    70.69875    87.26903
[19]   114.83601    80.61312
> colSd(tmp5,na.rm=TRUE)
 [1] 126.376474   6.238943   9.605829   9.320957  10.386526  10.846512
 [7]   9.801168   7.402564   8.929925   8.149001   8.492444   6.378349
[13]  10.531938  10.722113   9.392142   7.661620   8.408255   9.341789
[19]  10.716156   8.978481
> colMax(tmp5,na.rm=TRUE)
 [1] 472.31632  85.63202  90.60147  84.53937  91.86667  87.82468  92.86980
 [8]  81.72706  80.05956  84.14776  84.18263  78.79831  84.79473  85.63842
[15]  87.48083  79.16144  80.93622  83.67004  86.03367  85.87884
> colMin(tmp5,na.rm=TRUE)
 [1] 61.53656 62.71826 60.23608 54.22945 54.21298 55.78803 58.49458 61.30014
 [9] 55.27868 53.95763 56.08613 61.75153 53.77898 54.40013 57.78410 54.98640
[17] 55.97519 54.33608 54.74036 58.29427
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1] 93.45906      NaN 70.52210 69.15293 69.29293 71.55391 71.99441 68.48129
 [9] 67.20873 70.56704
> rowSums(tmp5,na.rm=TRUE)
 [1] 1869.181    0.000 1410.442 1383.059 1385.859 1431.078 1439.888 1369.626
 [9] 1344.175 1411.341
> rowVars(tmp5,na.rm=TRUE)
 [1] 8042.59719         NA  110.57326   76.64627   62.14155   35.42052
 [7]   83.81473   61.32543   66.36820  117.62962
> rowSd(tmp5,na.rm=TRUE)
 [1] 89.680529        NA 10.515382  8.754786  7.882991  5.951514  9.155038
 [8]  7.831055  8.146668 10.845719
> rowMax(tmp5,na.rm=TRUE)
 [1] 472.31632        NA  92.86980  91.86667  81.92526  80.93622  87.60809
 [8]  79.02094  84.18263  86.03367
> rowMin(tmp5,na.rm=TRUE)
 [1] 59.68972       NA 53.77898 53.95763 55.78803 61.11684 56.08613 54.21298
 [9] 54.98640 53.90667
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1] 116.93695  73.89155  71.33909  69.35903  74.39760  71.59677  71.16120
 [8]  71.93378  69.95623  71.56467  68.68127  71.14169  67.50944       NaN
[15]  68.81612  65.95661  70.09842  66.67593  68.95355  69.97439
> colSums(tmp5,na.rm=TRUE)
 [1] 1052.4325  665.0239  642.0518  624.2313  669.5784  644.3709  640.4508
 [8]  647.4040  629.6060  644.0820  618.1315  640.2752  607.5850    0.0000
[15]  619.3451  593.6095  630.8858  600.0833  620.5820  629.7695
> colVars(tmp5,na.rm=TRUE)
 [1] 17821.63061    43.70266    89.93730    85.95527   111.86925   120.20896
 [7]   107.81969    56.59908    79.54243    69.80377    74.56518    44.23601
[13]    91.17404          NA    60.04713    66.02623    79.07628    91.34764
[19]   106.21350    90.62654
> colSd(tmp5,na.rm=TRUE)
 [1] 133.497680   6.610799   9.483528   9.271207  10.576826  10.963985
 [7]  10.383626   7.523236   8.918656   8.354865   8.635113   6.651016
[13]   9.548510         NA   7.749008   8.125653   8.892484   9.557596
[19]  10.305993   9.519797
> colMax(tmp5,na.rm=TRUE)
 [1] 472.31632  85.63202  90.60147  84.53937  91.86667  87.82468  92.86980
 [8]  81.72706  80.05956  84.14776  84.18263  78.79831  80.54345      -Inf
[15]  80.50688  79.16144  80.93622  83.67004  86.03367  85.87884
> colMin(tmp5,na.rm=TRUE)
 [1] 61.53656 62.71826 63.42617 54.22945 54.21298 55.78803 58.49458 61.30014
 [9] 55.27868 53.95763 56.08613 61.75153 53.77898      Inf 57.78410 54.98640
[17] 55.97519 54.33608 54.74036 58.29427
> 
> 
> 
> 
> 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] 290.1352 198.5957 151.7057 152.7618 289.1754 117.9790 144.6249 250.7010
 [9] 217.6719 315.6168
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 290.1352 198.5957 151.7057 152.7618 289.1754 117.9790 144.6249 250.7010
 [9] 217.6719 315.6168
> 
> 
> 
> 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] -2.842171e-14  0.000000e+00 -2.273737e-13  0.000000e+00  0.000000e+00
 [6]  2.842171e-14  5.684342e-14 -2.842171e-14  2.842171e-14 -1.136868e-13
[11] -4.263256e-14  1.136868e-13  2.842171e-14 -5.684342e-14  0.000000e+00
[16] -1.136868e-13  5.684342e-14  1.136868e-13  2.842171e-14  0.000000e+00
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> ## making sure these things agree
> ##
> ## first when there is no NA
> 
> 
> 
> agree.checks <- function(buff.matrix,r.matrix,err.tol=1e-10){
+ 
+   if (Max(buff.matrix,na.rm=TRUE) != max(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Max")
+   }
+   
+ 
+   if (Min(buff.matrix,na.rm=TRUE) != min(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Min")
+   }
+ 
+ 
+   if (abs(Sum(buff.matrix,na.rm=TRUE)- sum(r.matrix,na.rm=TRUE)) > err.tol){
+ 
+     cat(Sum(buff.matrix,na.rm=TRUE),"\n")
+     cat(sum(r.matrix,na.rm=TRUE),"\n")
+     cat(Sum(buff.matrix,na.rm=TRUE) - sum(r.matrix,na.rm=TRUE),"\n")
+     
+     stop("No agreement in Sum")
+   }
+   
+   if (abs(mean(buff.matrix,na.rm=TRUE) - mean(r.matrix,na.rm=TRUE)) > err.tol){
+     stop("No agreement in mean")
+   }
+   
+   
+   if(abs(Var(buff.matrix,na.rm=TRUE) - var(as.vector(r.matrix),na.rm=TRUE)) > err.tol){
+     stop("No agreement in Var")
+   }
+   
+   
+ 
+   if(any(abs(rowMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,mean,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowMeans")
+   }
+   
+   
+   if(any(abs(colMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,mean,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colMeans")
+   }
+   
+   
+   if(any(abs(rowSums(buff.matrix,na.rm=TRUE)  -  apply(r.matrix,1,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in rowSums")
+   }
+   
+   
+   if(any(abs(colSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colSums")
+   }
+   
+   ### this is to get around the fact that R doesn't like to compute NA on an entire vector of NA when 
+   ### computing variance
+   my.Var <- function(x,na.rm=FALSE){
+    if (all(is.na(x))){
+      return(NA)
+    } else {
+      var(x,na.rm=na.rm)
+    }
+ 
+   }
+   
+   if(any(abs(rowVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+   
+   
+   if(any(abs(colVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+ 
+ 
+   if(any(abs(rowMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+ 
+   if(any(abs(colMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+   
+   
+   if(any(abs(rowMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+   
+ 
+   if(any(abs(colMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+ 
+   if(any(abs(colMedians(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,median,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMedian")
+   }
+ 
+   if(any(abs(colRanges(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,range,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colRanges")
+   }
+ 
+ 
+   
+ }
> 
> 
> 
> 
> 
> 
> 
> 
> 
> for (rep in 1:20){
+   copymatrix <- matrix(rnorm(200,150,15),10,20)
+   
+   tmp5[1:10,1:20] <- copymatrix
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ## now lets assign some NA values and check agreement
+ 
+   which.row <- sample(1:10,1,replace=TRUE)
+   which.col  <- sample(1:20,1,replace=TRUE)
+   
+   cat(which.row," ",which.col,"\n")
+   
+   tmp5[which.row,which.col] <- NA
+   copymatrix[which.row,which.col] <- NA
+   
+   agree.checks(tmp5,copymatrix)
+ 
+   ## make an entire row NA
+   tmp5[which.row,] <- NA
+   copymatrix[which.row,] <- NA
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ### also make an entire col NA
+   tmp5[,which.col] <- NA
+   copymatrix[,which.col] <- NA
+ 
+   agree.checks(tmp5,copymatrix)
+ 
+   ### now make 1 element non NA with NA in the rest of row and column
+ 
+   tmp5[which.row,which.col] <- rnorm(1,150,15)
+   copymatrix[which.row,which.col] <- tmp5[which.row,which.col]
+ 
+   agree.checks(tmp5,copymatrix)
+ }
3   1 
6   6 
10   16 
2   3 
4   13 
1   13 
10   11 
5   7 
10   10 
7   15 
8   11 
2   2 
6   17 
1   1 
7   16 
4   12 
4   18 
1   15 
3   14 
6   4 
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.635541
> Min(tmp)
[1] -3.061149
> mean(tmp)
[1] -0.05829537
> Sum(tmp)
[1] -5.829537
> Var(tmp)
[1] 1.326098
> 
> rowMeans(tmp)
[1] -0.05829537
> rowSums(tmp)
[1] -5.829537
> rowVars(tmp)
[1] 1.326098
> rowSd(tmp)
[1] 1.151563
> rowMax(tmp)
[1] 2.635541
> rowMin(tmp)
[1] -3.061149
> 
> colMeans(tmp)
  [1] -3.061148640 -0.045069811 -0.325987286 -2.127459023 -0.881716055
  [6] -0.761359578  0.610546183  0.418827343  1.667802837  1.301462937
 [11] -0.524174815 -0.753712773 -0.371976355  0.191457735 -0.890839323
 [16] -0.197710549  1.888471983 -1.954739659  1.402067329  1.711772198
 [21] -0.268612144 -1.764622165  1.609181269  2.635540522  1.148502785
 [26] -0.317068409 -2.698092933 -1.274288928  0.214477018 -1.186666173
 [31]  1.310521183 -1.968744762  0.174950982 -0.617243687  0.304196463
 [36]  0.510702530 -0.456121309 -1.182252344 -0.233297749  0.173696694
 [41] -1.033578509 -0.002292824 -0.061674306 -0.152538721  1.916664478
 [46] -0.018507771  2.508504873  0.276846569  1.131121817 -0.828074330
 [51] -0.499111498 -0.795505049 -1.814744338  0.240014987 -0.651600918
 [56] -1.584224344  0.421986458 -0.184542138 -0.531159769 -0.086286695
 [61]  1.570382278 -1.097707731  0.092468891 -0.041649211  0.627510221
 [66] -0.559527904  1.094738830 -0.337166651 -0.928364527 -0.902209293
 [71]  0.649738651  1.119975312  1.209021161  1.941247248 -0.713184418
 [76] -1.008556719  2.015703922 -1.189399477 -1.335329215  1.158498818
 [81]  0.287445063 -0.680512685  1.227548220 -1.660758616 -0.169950951
 [86] -0.884332199 -0.677711160 -1.103877821 -0.448541150  0.456983427
 [91] -1.771322381  1.294089111  1.314788003  1.506261695  1.035623558
 [96]  0.399998673 -0.615909415 -0.993120157  0.484967281  0.140032360
> colSums(tmp)
  [1] -3.061148640 -0.045069811 -0.325987286 -2.127459023 -0.881716055
  [6] -0.761359578  0.610546183  0.418827343  1.667802837  1.301462937
 [11] -0.524174815 -0.753712773 -0.371976355  0.191457735 -0.890839323
 [16] -0.197710549  1.888471983 -1.954739659  1.402067329  1.711772198
 [21] -0.268612144 -1.764622165  1.609181269  2.635540522  1.148502785
 [26] -0.317068409 -2.698092933 -1.274288928  0.214477018 -1.186666173
 [31]  1.310521183 -1.968744762  0.174950982 -0.617243687  0.304196463
 [36]  0.510702530 -0.456121309 -1.182252344 -0.233297749  0.173696694
 [41] -1.033578509 -0.002292824 -0.061674306 -0.152538721  1.916664478
 [46] -0.018507771  2.508504873  0.276846569  1.131121817 -0.828074330
 [51] -0.499111498 -0.795505049 -1.814744338  0.240014987 -0.651600918
 [56] -1.584224344  0.421986458 -0.184542138 -0.531159769 -0.086286695
 [61]  1.570382278 -1.097707731  0.092468891 -0.041649211  0.627510221
 [66] -0.559527904  1.094738830 -0.337166651 -0.928364527 -0.902209293
 [71]  0.649738651  1.119975312  1.209021161  1.941247248 -0.713184418
 [76] -1.008556719  2.015703922 -1.189399477 -1.335329215  1.158498818
 [81]  0.287445063 -0.680512685  1.227548220 -1.660758616 -0.169950951
 [86] -0.884332199 -0.677711160 -1.103877821 -0.448541150  0.456983427
 [91] -1.771322381  1.294089111  1.314788003  1.506261695  1.035623558
 [96]  0.399998673 -0.615909415 -0.993120157  0.484967281  0.140032360
> 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] -3.061148640 -0.045069811 -0.325987286 -2.127459023 -0.881716055
  [6] -0.761359578  0.610546183  0.418827343  1.667802837  1.301462937
 [11] -0.524174815 -0.753712773 -0.371976355  0.191457735 -0.890839323
 [16] -0.197710549  1.888471983 -1.954739659  1.402067329  1.711772198
 [21] -0.268612144 -1.764622165  1.609181269  2.635540522  1.148502785
 [26] -0.317068409 -2.698092933 -1.274288928  0.214477018 -1.186666173
 [31]  1.310521183 -1.968744762  0.174950982 -0.617243687  0.304196463
 [36]  0.510702530 -0.456121309 -1.182252344 -0.233297749  0.173696694
 [41] -1.033578509 -0.002292824 -0.061674306 -0.152538721  1.916664478
 [46] -0.018507771  2.508504873  0.276846569  1.131121817 -0.828074330
 [51] -0.499111498 -0.795505049 -1.814744338  0.240014987 -0.651600918
 [56] -1.584224344  0.421986458 -0.184542138 -0.531159769 -0.086286695
 [61]  1.570382278 -1.097707731  0.092468891 -0.041649211  0.627510221
 [66] -0.559527904  1.094738830 -0.337166651 -0.928364527 -0.902209293
 [71]  0.649738651  1.119975312  1.209021161  1.941247248 -0.713184418
 [76] -1.008556719  2.015703922 -1.189399477 -1.335329215  1.158498818
 [81]  0.287445063 -0.680512685  1.227548220 -1.660758616 -0.169950951
 [86] -0.884332199 -0.677711160 -1.103877821 -0.448541150  0.456983427
 [91] -1.771322381  1.294089111  1.314788003  1.506261695  1.035623558
 [96]  0.399998673 -0.615909415 -0.993120157  0.484967281  0.140032360
> colMin(tmp)
  [1] -3.061148640 -0.045069811 -0.325987286 -2.127459023 -0.881716055
  [6] -0.761359578  0.610546183  0.418827343  1.667802837  1.301462937
 [11] -0.524174815 -0.753712773 -0.371976355  0.191457735 -0.890839323
 [16] -0.197710549  1.888471983 -1.954739659  1.402067329  1.711772198
 [21] -0.268612144 -1.764622165  1.609181269  2.635540522  1.148502785
 [26] -0.317068409 -2.698092933 -1.274288928  0.214477018 -1.186666173
 [31]  1.310521183 -1.968744762  0.174950982 -0.617243687  0.304196463
 [36]  0.510702530 -0.456121309 -1.182252344 -0.233297749  0.173696694
 [41] -1.033578509 -0.002292824 -0.061674306 -0.152538721  1.916664478
 [46] -0.018507771  2.508504873  0.276846569  1.131121817 -0.828074330
 [51] -0.499111498 -0.795505049 -1.814744338  0.240014987 -0.651600918
 [56] -1.584224344  0.421986458 -0.184542138 -0.531159769 -0.086286695
 [61]  1.570382278 -1.097707731  0.092468891 -0.041649211  0.627510221
 [66] -0.559527904  1.094738830 -0.337166651 -0.928364527 -0.902209293
 [71]  0.649738651  1.119975312  1.209021161  1.941247248 -0.713184418
 [76] -1.008556719  2.015703922 -1.189399477 -1.335329215  1.158498818
 [81]  0.287445063 -0.680512685  1.227548220 -1.660758616 -0.169950951
 [86] -0.884332199 -0.677711160 -1.103877821 -0.448541150  0.456983427
 [91] -1.771322381  1.294089111  1.314788003  1.506261695  1.035623558
 [96]  0.399998673 -0.615909415 -0.993120157  0.484967281  0.140032360
> colMedians(tmp)
  [1] -3.061148640 -0.045069811 -0.325987286 -2.127459023 -0.881716055
  [6] -0.761359578  0.610546183  0.418827343  1.667802837  1.301462937
 [11] -0.524174815 -0.753712773 -0.371976355  0.191457735 -0.890839323
 [16] -0.197710549  1.888471983 -1.954739659  1.402067329  1.711772198
 [21] -0.268612144 -1.764622165  1.609181269  2.635540522  1.148502785
 [26] -0.317068409 -2.698092933 -1.274288928  0.214477018 -1.186666173
 [31]  1.310521183 -1.968744762  0.174950982 -0.617243687  0.304196463
 [36]  0.510702530 -0.456121309 -1.182252344 -0.233297749  0.173696694
 [41] -1.033578509 -0.002292824 -0.061674306 -0.152538721  1.916664478
 [46] -0.018507771  2.508504873  0.276846569  1.131121817 -0.828074330
 [51] -0.499111498 -0.795505049 -1.814744338  0.240014987 -0.651600918
 [56] -1.584224344  0.421986458 -0.184542138 -0.531159769 -0.086286695
 [61]  1.570382278 -1.097707731  0.092468891 -0.041649211  0.627510221
 [66] -0.559527904  1.094738830 -0.337166651 -0.928364527 -0.902209293
 [71]  0.649738651  1.119975312  1.209021161  1.941247248 -0.713184418
 [76] -1.008556719  2.015703922 -1.189399477 -1.335329215  1.158498818
 [81]  0.287445063 -0.680512685  1.227548220 -1.660758616 -0.169950951
 [86] -0.884332199 -0.677711160 -1.103877821 -0.448541150  0.456983427
 [91] -1.771322381  1.294089111  1.314788003  1.506261695  1.035623558
 [96]  0.399998673 -0.615909415 -0.993120157  0.484967281  0.140032360
> colRanges(tmp)
          [,1]        [,2]       [,3]      [,4]       [,5]       [,6]      [,7]
[1,] -3.061149 -0.04506981 -0.3259873 -2.127459 -0.8817161 -0.7613596 0.6105462
[2,] -3.061149 -0.04506981 -0.3259873 -2.127459 -0.8817161 -0.7613596 0.6105462
          [,8]     [,9]    [,10]      [,11]      [,12]      [,13]     [,14]
[1,] 0.4188273 1.667803 1.301463 -0.5241748 -0.7537128 -0.3719764 0.1914577
[2,] 0.4188273 1.667803 1.301463 -0.5241748 -0.7537128 -0.3719764 0.1914577
          [,15]      [,16]    [,17]    [,18]    [,19]    [,20]      [,21]
[1,] -0.8908393 -0.1977105 1.888472 -1.95474 1.402067 1.711772 -0.2686121
[2,] -0.8908393 -0.1977105 1.888472 -1.95474 1.402067 1.711772 -0.2686121
         [,22]    [,23]    [,24]    [,25]      [,26]     [,27]     [,28]
[1,] -1.764622 1.609181 2.635541 1.148503 -0.3170684 -2.698093 -1.274289
[2,] -1.764622 1.609181 2.635541 1.148503 -0.3170684 -2.698093 -1.274289
        [,29]     [,30]    [,31]     [,32]    [,33]      [,34]     [,35]
[1,] 0.214477 -1.186666 1.310521 -1.968745 0.174951 -0.6172437 0.3041965
[2,] 0.214477 -1.186666 1.310521 -1.968745 0.174951 -0.6172437 0.3041965
         [,36]      [,37]     [,38]      [,39]     [,40]     [,41]        [,42]
[1,] 0.5107025 -0.4561213 -1.182252 -0.2332977 0.1736967 -1.033579 -0.002292824
[2,] 0.5107025 -0.4561213 -1.182252 -0.2332977 0.1736967 -1.033579 -0.002292824
           [,43]      [,44]    [,45]       [,46]    [,47]     [,48]    [,49]
[1,] -0.06167431 -0.1525387 1.916664 -0.01850777 2.508505 0.2768466 1.131122
[2,] -0.06167431 -0.1525387 1.916664 -0.01850777 2.508505 0.2768466 1.131122
          [,50]      [,51]     [,52]     [,53]    [,54]      [,55]     [,56]
[1,] -0.8280743 -0.4991115 -0.795505 -1.814744 0.240015 -0.6516009 -1.584224
[2,] -0.8280743 -0.4991115 -0.795505 -1.814744 0.240015 -0.6516009 -1.584224
         [,57]      [,58]      [,59]      [,60]    [,61]     [,62]      [,63]
[1,] 0.4219865 -0.1845421 -0.5311598 -0.0862867 1.570382 -1.097708 0.09246889
[2,] 0.4219865 -0.1845421 -0.5311598 -0.0862867 1.570382 -1.097708 0.09246889
           [,64]     [,65]      [,66]    [,67]      [,68]      [,69]      [,70]
[1,] -0.04164921 0.6275102 -0.5595279 1.094739 -0.3371667 -0.9283645 -0.9022093
[2,] -0.04164921 0.6275102 -0.5595279 1.094739 -0.3371667 -0.9283645 -0.9022093
         [,71]    [,72]    [,73]    [,74]      [,75]     [,76]    [,77]
[1,] 0.6497387 1.119975 1.209021 1.941247 -0.7131844 -1.008557 2.015704
[2,] 0.6497387 1.119975 1.209021 1.941247 -0.7131844 -1.008557 2.015704
         [,78]     [,79]    [,80]     [,81]      [,82]    [,83]     [,84]
[1,] -1.189399 -1.335329 1.158499 0.2874451 -0.6805127 1.227548 -1.660759
[2,] -1.189399 -1.335329 1.158499 0.2874451 -0.6805127 1.227548 -1.660759
         [,85]      [,86]      [,87]     [,88]      [,89]     [,90]     [,91]
[1,] -0.169951 -0.8843322 -0.6777112 -1.103878 -0.4485412 0.4569834 -1.771322
[2,] -0.169951 -0.8843322 -0.6777112 -1.103878 -0.4485412 0.4569834 -1.771322
        [,92]    [,93]    [,94]    [,95]     [,96]      [,97]      [,98]
[1,] 1.294089 1.314788 1.506262 1.035624 0.3999987 -0.6159094 -0.9931202
[2,] 1.294089 1.314788 1.506262 1.035624 0.3999987 -0.6159094 -0.9931202
         [,99]    [,100]
[1,] 0.4849673 0.1400324
[2,] 0.4849673 0.1400324
> 
> 
> Max(tmp2)
[1] 3.477848
> Min(tmp2)
[1] -2.690552
> mean(tmp2)
[1] 0.0399217
> Sum(tmp2)
[1] 3.99217
> Var(tmp2)
[1] 0.8315593
> 
> rowMeans(tmp2)
  [1] -0.396611588  0.496349397  0.871690029  1.055423417  0.647976937
  [6]  0.787220149 -0.723983276  1.821474455 -1.820285061  0.523390862
 [11] -0.891202334 -0.533701664 -0.396213708 -0.006522555  0.174211574
 [16]  1.108193793  0.523569124 -0.868062880  1.357568145  0.358971063
 [21]  0.828328588  0.041096740 -0.242582524  0.217438735 -0.485712309
 [26] -2.690551969  0.432406883 -0.546670041 -0.570931627  0.720012887
 [31] -1.020551350  1.111096357 -0.663580791 -0.303907533  0.395678374
 [36]  0.537256882  0.892768907 -0.885382892  0.498916920  0.429327539
 [41] -0.819594175  0.449420371 -1.278303270  1.087084613  0.923730264
 [46]  0.503564753 -0.249381069 -0.491466715  1.200163619  0.250737074
 [51]  3.477847719  0.889837810 -0.092849351  0.421210406 -0.291836128
 [56] -1.476656167 -0.790340561  0.121891572 -0.681762466  0.593212243
 [61]  0.898031489 -0.881792271  1.671360347 -0.368589913  0.086235325
 [66]  0.000513479 -0.070416629 -0.354333880 -1.268758585  0.317627585
 [71] -0.495280395 -0.733704677  0.657157108  0.170001207 -0.046513495
 [76] -0.314830411 -0.123867712 -0.828540645 -0.152919328 -0.880050782
 [81] -1.366704435 -1.541603930 -0.692326136 -0.152978728  1.817628463
 [86]  1.028649084 -1.102620378 -0.660465021 -0.194077002 -0.689462643
 [91]  0.866783151  0.317401059 -0.165836907  0.773121427  0.640951379
 [96]  1.170180723  1.020396484 -0.004337657  0.742476527 -1.626757634
> rowSums(tmp2)
  [1] -0.396611588  0.496349397  0.871690029  1.055423417  0.647976937
  [6]  0.787220149 -0.723983276  1.821474455 -1.820285061  0.523390862
 [11] -0.891202334 -0.533701664 -0.396213708 -0.006522555  0.174211574
 [16]  1.108193793  0.523569124 -0.868062880  1.357568145  0.358971063
 [21]  0.828328588  0.041096740 -0.242582524  0.217438735 -0.485712309
 [26] -2.690551969  0.432406883 -0.546670041 -0.570931627  0.720012887
 [31] -1.020551350  1.111096357 -0.663580791 -0.303907533  0.395678374
 [36]  0.537256882  0.892768907 -0.885382892  0.498916920  0.429327539
 [41] -0.819594175  0.449420371 -1.278303270  1.087084613  0.923730264
 [46]  0.503564753 -0.249381069 -0.491466715  1.200163619  0.250737074
 [51]  3.477847719  0.889837810 -0.092849351  0.421210406 -0.291836128
 [56] -1.476656167 -0.790340561  0.121891572 -0.681762466  0.593212243
 [61]  0.898031489 -0.881792271  1.671360347 -0.368589913  0.086235325
 [66]  0.000513479 -0.070416629 -0.354333880 -1.268758585  0.317627585
 [71] -0.495280395 -0.733704677  0.657157108  0.170001207 -0.046513495
 [76] -0.314830411 -0.123867712 -0.828540645 -0.152919328 -0.880050782
 [81] -1.366704435 -1.541603930 -0.692326136 -0.152978728  1.817628463
 [86]  1.028649084 -1.102620378 -0.660465021 -0.194077002 -0.689462643
 [91]  0.866783151  0.317401059 -0.165836907  0.773121427  0.640951379
 [96]  1.170180723  1.020396484 -0.004337657  0.742476527 -1.626757634
> rowVars(tmp2)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowSd(tmp2)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowMax(tmp2)
  [1] -0.396611588  0.496349397  0.871690029  1.055423417  0.647976937
  [6]  0.787220149 -0.723983276  1.821474455 -1.820285061  0.523390862
 [11] -0.891202334 -0.533701664 -0.396213708 -0.006522555  0.174211574
 [16]  1.108193793  0.523569124 -0.868062880  1.357568145  0.358971063
 [21]  0.828328588  0.041096740 -0.242582524  0.217438735 -0.485712309
 [26] -2.690551969  0.432406883 -0.546670041 -0.570931627  0.720012887
 [31] -1.020551350  1.111096357 -0.663580791 -0.303907533  0.395678374
 [36]  0.537256882  0.892768907 -0.885382892  0.498916920  0.429327539
 [41] -0.819594175  0.449420371 -1.278303270  1.087084613  0.923730264
 [46]  0.503564753 -0.249381069 -0.491466715  1.200163619  0.250737074
 [51]  3.477847719  0.889837810 -0.092849351  0.421210406 -0.291836128
 [56] -1.476656167 -0.790340561  0.121891572 -0.681762466  0.593212243
 [61]  0.898031489 -0.881792271  1.671360347 -0.368589913  0.086235325
 [66]  0.000513479 -0.070416629 -0.354333880 -1.268758585  0.317627585
 [71] -0.495280395 -0.733704677  0.657157108  0.170001207 -0.046513495
 [76] -0.314830411 -0.123867712 -0.828540645 -0.152919328 -0.880050782
 [81] -1.366704435 -1.541603930 -0.692326136 -0.152978728  1.817628463
 [86]  1.028649084 -1.102620378 -0.660465021 -0.194077002 -0.689462643
 [91]  0.866783151  0.317401059 -0.165836907  0.773121427  0.640951379
 [96]  1.170180723  1.020396484 -0.004337657  0.742476527 -1.626757634
> rowMin(tmp2)
  [1] -0.396611588  0.496349397  0.871690029  1.055423417  0.647976937
  [6]  0.787220149 -0.723983276  1.821474455 -1.820285061  0.523390862
 [11] -0.891202334 -0.533701664 -0.396213708 -0.006522555  0.174211574
 [16]  1.108193793  0.523569124 -0.868062880  1.357568145  0.358971063
 [21]  0.828328588  0.041096740 -0.242582524  0.217438735 -0.485712309
 [26] -2.690551969  0.432406883 -0.546670041 -0.570931627  0.720012887
 [31] -1.020551350  1.111096357 -0.663580791 -0.303907533  0.395678374
 [36]  0.537256882  0.892768907 -0.885382892  0.498916920  0.429327539
 [41] -0.819594175  0.449420371 -1.278303270  1.087084613  0.923730264
 [46]  0.503564753 -0.249381069 -0.491466715  1.200163619  0.250737074
 [51]  3.477847719  0.889837810 -0.092849351  0.421210406 -0.291836128
 [56] -1.476656167 -0.790340561  0.121891572 -0.681762466  0.593212243
 [61]  0.898031489 -0.881792271  1.671360347 -0.368589913  0.086235325
 [66]  0.000513479 -0.070416629 -0.354333880 -1.268758585  0.317627585
 [71] -0.495280395 -0.733704677  0.657157108  0.170001207 -0.046513495
 [76] -0.314830411 -0.123867712 -0.828540645 -0.152919328 -0.880050782
 [81] -1.366704435 -1.541603930 -0.692326136 -0.152978728  1.817628463
 [86]  1.028649084 -1.102620378 -0.660465021 -0.194077002 -0.689462643
 [91]  0.866783151  0.317401059 -0.165836907  0.773121427  0.640951379
 [96]  1.170180723  1.020396484 -0.004337657  0.742476527 -1.626757634
> 
> colMeans(tmp2)
[1] 0.0399217
> colSums(tmp2)
[1] 3.99217
> colVars(tmp2)
[1] 0.8315593
> colSd(tmp2)
[1] 0.9118987
> colMax(tmp2)
[1] 3.477848
> colMin(tmp2)
[1] -2.690552
> colMedians(tmp2)
[1] -0.001912089
> colRanges(tmp2)
          [,1]
[1,] -2.690552
[2,]  3.477848
> 
> 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.2297089  4.4957957 -5.2959312 -4.0486569  4.7181680  0.4261550
 [7]  3.8925397 -0.3168417 -1.7200415  1.3644510
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -1.0295817
[2,] -0.5335203
[3,] -0.0135721
[4,]  0.6894404
[5,]  1.0214581
> 
> rowApply(tmp,sum)
 [1] -2.8990938  2.5677543 -0.8242693 -0.1845929  2.3171922  2.6490458
 [7]  1.5443060 -3.6860985  0.3370263  1.9240770
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    5    8    8   10    2    5    7    6    3     2
 [2,]    6    9    5    3    1    7   10    8    6     9
 [3,]    4    3    1    5    4    6    3    3    4     6
 [4,]    2    7    2    1   10    2    8    2    1     8
 [5,]   10    4    3    4    6    3    9   10   10     7
 [6,]    3   10   10    9    9    4    4    1    2     4
 [7,]    7    5    7    6    7   10    6    4    8     5
 [8,]    1    6    6    7    5    9    2    5    5    10
 [9,]    9    2    4    2    8    1    1    9    9     3
[10,]    8    1    9    8    3    8    5    7    7     1
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1]  2.99424616 -1.04784342 -0.11872751 -1.64061224  0.24829726  0.38800272
 [7]  0.05169226  2.53349629 -3.96722259 -1.28312871 -2.73375792 -1.42494697
[13]  2.92368422 -1.58728904  1.25724525 -0.58099664 -0.16097522  0.34942839
[19] -1.07741862 -1.96213158
> colApply(tmp,quantile)[,1]
            [,1]
[1,] -1.50009522
[2,] -0.38303314
[3,]  0.05735111
[4,]  2.02375263
[5,]  2.79627079
> 
> rowApply(tmp,sum)
[1] -8.674139 -3.414306  3.007420  3.325731 -1.083664
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]    3   12   19   20    8
[2,]   15    9    3   11    3
[3,]    7   13   11   17   11
[4,]    5    6    9    9   16
[5,]   12   15    2   18    7
> 
> 
> as.matrix(tmp)
            [,1]       [,2]        [,3]        [,4]        [,5]        [,6]
[1,] -1.50009522  0.2576017 -0.96269214 -1.45473599 -0.03695729 -0.75280605
[2,]  0.05735111 -0.2423884  0.06433022 -0.42222062  0.40235171  0.61837093
[3,]  2.02375263 -0.6372851 -0.07420701 -0.11977113 -0.89945010 -0.09955165
[4,]  2.79627079  0.2829614  0.92434802 -0.09467996  1.18326194  0.52117917
[5,] -0.38303314 -0.7087332 -0.07050659  0.45079547 -0.40090900  0.10081032
           [,7]       [,8]         [,9]      [,10]      [,11]      [,12]
[1,]  0.4812769  0.9693132 -1.100477468 -0.5347404 -1.4979359  0.1063310
[2,] -0.3341666  2.4238306 -1.415827406 -0.3999469 -1.2146230  0.5689044
[3,] -1.0482754  0.3337353 -0.007501753 -0.6052170 -0.1879516 -0.5474546
[4,]  0.5919154 -0.6283598  0.295254437  0.6743972 -0.2014661  0.5640202
[5,]  0.3609420 -0.5650230 -1.738670402 -0.4176216  0.3682188 -2.1167480
           [,13]      [,14]       [,15]        [,16]      [,17]      [,18]
[1,]  0.04302981 -0.8910696  1.51747279  0.907814865 -2.0119464  0.5178965
[2,]  0.52174979 -0.9575411 -0.05136176 -0.001124057  0.4443915 -2.1533261
[3,]  1.30115782  0.8363866  0.18359652 -0.565222820  0.2714142  2.9480659
[4,]  1.36146090 -1.0493344 -1.52091539 -1.121501318 -0.4198944 -0.2597102
[5,] -0.30371411  0.4742696  1.12845309  0.199036690  1.5550599 -0.7034977
          [,19]       [,20]
[1,] -0.3447004 -2.38671929
[2,] -1.4785909  0.15553111
[3,] -0.5390640  0.44026341
[4,] -0.6243988  0.05092228
[5,]  1.9093355 -0.22212909
> 
> 
> 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 :  652  bytes.
Disk usage :  200  bytes.
> subBufferedMatrix(tmp,,5:8)
BufferedMatrix object
Matrix size:  5 4 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.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.06666 0.7149584 -0.8506583 2.189222 -0.212602 0.2627502 -0.4904441
           col8      col9    col10      col11     col12     col13     col14
row1 -0.8243474 0.9917886 1.570048 -0.7000406 0.3015967 0.8129381 0.3532265
          col15     col16      col17   col18      col19     col20
row1 -0.4114309 0.9345696 -0.4026822 1.59778 -0.2554523 0.6032643
> tmp[,"col10"]
          col10
row1  1.5700483
row2 -1.0828905
row3  0.1446753
row4  2.5882487
row5 -0.2958703
> tmp[c("row1","row5"),]
           col1       col2       col3      col4       col5       col6
row1  1.0666601  0.7149584 -0.8506583  2.189222 -0.2126020 0.26275021
row5 -0.8265537 -0.2986877  1.1001740 -1.998939 -0.7911962 0.01574733
           col7       col8       col9      col10      col11      col12
row1 -0.4904441 -0.8243474  0.9917886  1.5700483 -0.7000406  0.3015967
row5  1.8299710  1.2357326 -1.2607992 -0.2958703 -0.2273298 -0.5078103
         col13     col14      col15     col16      col17      col18      col19
row1 0.8129381 0.3532265 -0.4114309 0.9345696 -0.4026822  1.5977797 -0.2554523
row5 1.2349164 0.8925257  0.4078532 0.6743079  0.3527943 -0.3875686  1.0196153
          col20
row1 0.60326433
row5 0.01595783
> tmp[,c("col6","col20")]
            col6       col20
row1  0.26275021  0.60326433
row2  0.26843535 -0.17123823
row3 -1.03248236  1.94968040
row4 -2.24525527  0.43129972
row5  0.01574733  0.01595783
> tmp[c("row1","row5"),c("col6","col20")]
           col6      col20
row1 0.26275021 0.60326433
row5 0.01574733 0.01595783
> 
> 
> 
> 
> tmp["row1",] <- rnorm(20,mean=10)
> tmp[,"col10"] <- rnorm(5,mean=30)
> tmp[c("row1","row5"),] <- rnorm(40,mean=50)
> tmp[,c("col6","col20")] <- rnorm(10,mean=75)
> tmp[c("row1","row5"),c("col6","col20")]  <- rnorm(4,mean=105)
> 
> tmp["row1",]
         col1     col2     col3     col4     col5     col6     col7   col8
row1 50.14382 50.14246 50.38855 51.16483 49.69399 104.4873 51.03235 47.189
         col9    col10   col11    col12    col13    col14    col15    col16
row1 49.39284 49.50986 48.9503 50.72523 50.38039 52.54743 50.24978 50.52607
        col17    col18    col19    col20
row1 52.16742 49.71101 49.37118 107.3125
> tmp[,"col10"]
        col10
row1 49.50986
row2 29.68663
row3 29.35011
row4 30.89243
row5 50.39457
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6     col7    col8
row1 50.14382 50.14246 50.38855 51.16483 49.69399 104.4873 51.03235 47.1890
row5 49.77165 50.21669 50.42936 49.83308 49.56968 104.9311 48.70116 48.7558
         col9    col10    col11    col12    col13    col14    col15    col16
row1 49.39284 49.50986 48.95030 50.72523 50.38039 52.54743 50.24978 50.52607
row5 50.12743 50.39457 51.04506 50.03188 49.43058 49.82292 50.66954 51.22270
        col17    col18    col19    col20
row1 52.16742 49.71101 49.37118 107.3125
row5 51.36901 50.96252 50.73362 106.2774
> tmp[,c("col6","col20")]
          col6     col20
row1 104.48730 107.31249
row2  74.47140  74.71980
row3  76.56463  76.82907
row4  73.44946  75.47802
row5 104.93107 106.27744
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 104.4873 107.3125
row5 104.9311 106.2774
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 104.4873 107.3125
row5 104.9311 106.2774
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
          col13
[1,]  0.7750832
[2,]  1.1003481
[3,]  0.8792148
[4,] -0.9275811
[5,]  2.0315161
> tmp[,c("col17","col7")]
          col17       col7
[1,]  0.8156990  0.5580084
[2,] -0.7156764  0.5250161
[3,] -0.8922031  0.8418725
[4,] -0.7174707  0.7612131
[5,]  0.4007071 -1.0910714
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
           col6        col20
[1,]  1.7697281  1.467778505
[2,]  0.7006070  0.005972221
[3,]  0.3002305 -2.111769710
[4,] -0.2572332  0.416466966
[5,] -1.5632228  0.512086923
> subBufferedMatrix(tmp,1,c("col6"))[,1]
         col1
[1,] 1.769728
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
         col6
[1,] 1.769728
[2,] 0.700607
> 
> 
> 
> 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.4167193  0.5916507 -1.05755004 -1.17469514 -0.05225103 -1.423174
row1  1.4663268 -1.4340591  0.06273022 -0.07388136 -0.74203571  0.896469
           [,7]       [,8]       [,9]      [,10]     [,11]      [,12]
row3 -1.1108349  0.9134098 -0.1594018  0.8566923 -2.288197  0.3147048
row1 -0.4344789 -3.0722898 -0.2687796 -0.2588710 -0.120490 -1.0468371
          [,13]      [,14]      [,15]       [,16]      [,17]      [,18]
row3  0.6372479  0.3288583  0.1447904  0.03349277  1.6530790 -0.2222845
row1 -1.6201096 -0.1444160 -1.8780463 -0.75758417 -0.3805777 -0.9957158
           [,19]      [,20]
row3 1.464307669  0.1441442
row1 0.005549478 -0.0986902
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
         [,1]      [,2]      [,3]     [,4]       [,5]     [,6]      [,7]
row2 1.958739 0.4912779 -1.777837 1.144222 -0.2981816 0.963193 0.1926963
          [,8]      [,9]     [,10]
row2 0.1074773 -1.151161 -2.261939
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
        [,1]      [,2]      [,3]       [,4]     [,5]     [,6]     [,7]
row5 1.97973 0.1876496 0.3702799 -0.4653538 1.362355 1.239741 -2.16381
          [,8]        [,9]    [,10]      [,11]    [,12]     [,13]     [,14]
row5 -1.322526 -0.07737758 2.034315 -0.8269522 1.455406 0.2969516 0.7155275
         [,15]      [,16]    [,17]     [,18]    [,19]     [,20]
row5 -1.233639 0.08237906 1.055382 0.8488892 1.965155 -1.580945
> 
> 
> 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: 0x5c7d79375d70>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM1b699a3091a398"
 [2] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM1b699a3b100751"
 [3] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM1b699a69450f63"
 [4] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM1b699a3fa37f8a"
 [5] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM1b699a15b368b3"
 [6] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM1b699a2d883430"
 [7] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM1b699a5d71794f"
 [8] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM1b699a3a0cfe05"
 [9] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM1b699a27b7f2bf"
[10] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM1b699a76362861"
[11] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM1b699a6045adac"
[12] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM1b699a339b422c"
[13] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM1b699a510b981b"
[14] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM1b699a3fe1a0ad"
[15] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM1b699a2b845e83"
> 
> 
> ### 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: 0x5c7d77466610>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x5c7d77466610>
Warning message:
In dir.create(new.directory) :
  '/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x5c7d77466610>
> rowMedians(tmp)
  [1]  0.242722185 -0.068867160  0.506530196  0.393195190 -0.162743832
  [6]  0.013527305 -0.628244094 -0.109701993 -0.618555288 -0.208749199
 [11] -0.005941049  0.199115412 -0.363368586 -0.106270172  0.215396403
 [16]  0.407455703 -0.354123362  0.005414443  0.102167068 -0.119354438
 [21]  0.008489038 -0.193127129 -0.656518303  0.078718405  0.143569877
 [26] -0.692351616  0.730858284  0.061499809 -0.141605722  0.168528676
 [31] -0.014895009 -0.389294403 -0.258311009  0.171374313  0.337822769
 [36]  0.194859754  0.111958592  0.545784993  0.020678551  0.489186209
 [41]  0.037528163  0.436861054  0.350450109 -0.064760391 -0.357859468
 [46]  0.316961739 -0.251159744 -0.124733257  0.057986920  0.022070642
 [51]  1.047199604  0.431863922 -0.379177866  0.622082593  0.113726915
 [56]  0.011607946  0.479073335 -0.085013349  0.066700060 -0.208167938
 [61]  0.001752251  0.240532633  0.415586435  0.313471275 -0.129592564
 [66]  0.277188179  0.171938070 -0.662113932  0.464378326  0.325223289
 [71]  0.156894039 -0.437784847  0.725591186 -0.073706248  0.623476454
 [76]  0.247127611 -0.040882410  0.069745890 -0.387022565  0.330128516
 [81]  0.191868408  0.208669098  0.428065129  0.084359683  0.329142595
 [86] -0.285729351  0.340578462 -0.218910912  0.106411551 -0.031485851
 [91]  0.395028905  0.168193669 -0.016431389  0.562366358  0.311636101
 [96] -0.194042134 -0.019173386 -0.493987897 -0.105765519 -0.189532648
[101]  0.283054475 -0.177469140 -0.128566410  0.279804329  0.009229229
[106] -0.114415681  0.309486699  0.094040995 -0.200123313  0.763350868
[111] -0.595549554 -0.278216626  0.247133720  0.031538260  0.146412921
[116]  0.248325692 -0.225414558  0.499985181 -0.723711563 -0.340000459
[121] -0.224377673 -0.019180630  0.239349481 -0.599404100  0.039177185
[126]  0.317112237  0.104519584  0.127273014  0.295118615  0.338216211
[131] -0.022853950 -0.602784930 -0.101839116 -0.128050394  0.024247676
[136]  0.864253638 -0.628268970  0.034028191  0.280238610 -0.076060486
[141] -0.080592367 -0.308279039  0.397941198  0.308903008  0.038973816
[146]  0.358507695 -0.714424638  0.385683932  0.374559731 -0.390551994
[151]  0.128310716  0.260398099  0.065249406 -0.264048342  0.474396834
[156] -0.383260738 -0.040831759  0.355281717 -0.015297395  0.328038929
[161] -0.111289930 -0.083467566  0.077199599 -0.574004857  0.070125051
[166]  0.259380972  0.788749587  0.311912117 -0.129861789  0.098733059
[171] -0.053367117 -0.265383909  0.433195323 -0.020206229  0.179230820
[176]  0.028167945 -0.358058558  0.325506049 -0.013965066 -0.120499066
[181] -0.066834639 -0.022100538  0.182022086  0.148782921 -0.544176546
[186]  0.068738449 -0.020314146  0.030754780 -0.364154040 -0.167405830
[191] -0.249007692  0.093414743  0.140771748  0.497410568  0.521242008
[196]  0.024318610  0.483159559 -0.253608745 -0.300263311  0.450019140
[201] -0.167613752  0.045119958  0.663060761 -0.257144523  0.188274254
[206] -0.225503854  0.202093583 -0.281936485 -0.157671081  0.377619600
[211]  0.310670809  0.114591570  0.470204763  0.344157544  0.016751798
[216] -0.399196774  0.584549590  0.374687283 -0.529487892 -0.213816478
[221] -0.304537134 -0.012680325  0.157066953 -0.207470637 -0.460523372
[226]  0.132099393  0.216339848  0.145984651  0.798798887  0.512286877
> 
> proc.time()
   user  system elapsed 
  1.212   0.669   1.870 

BufferedMatrix.Rcheck/tests/rawCalltesting.Rout


R version 4.5.1 Patched (2025-08-23 r88802) -- "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: 0x62fe89c8fc80>
> .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: 0x62fe89c8fc80>
> .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: 0x62fe89c8fc80>
> .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: 0x62fe89c8fc80>
> 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: 0x62fe89926a00>
> .Call("R_bm_AddColumn",P)
<pointer: 0x62fe89926a00>
> .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: 0x62fe89926a00>
> .Call("R_bm_AddColumn",P)
<pointer: 0x62fe89926a00>
> .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: 0x62fe89926a00>
> 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: 0x62fe899f1660>
> .Call("R_bm_AddColumn",P)
<pointer: 0x62fe899f1660>
> .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: 0x62fe899f1660>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x62fe899f1660>
> .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: 0x62fe899f1660>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x62fe899f1660>
> .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: 0x62fe899f1660>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x62fe899f1660>
> .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: 0x62fe899f1660>
> 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: 0x62fe89f133e0>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x62fe89f133e0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x62fe89f133e0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x62fe89f133e0>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile1b69e54cb33ddb" "BufferedMatrixFile1b69e56e3321a3"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile1b69e54cb33ddb" "BufferedMatrixFile1b69e56e3321a3"
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x62fe8c070470>
> .Call("R_bm_AddColumn",P)
<pointer: 0x62fe8c070470>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x62fe8c070470>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x62fe8c070470>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x62fe8c070470>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x62fe8c070470>
> .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: 0x62fe8a4f56e0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x62fe8a4f56e0>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x62fe8a4f56e0>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x62fe8a4f56e0>
> 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: 0x62fe8b9380d0>
> .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: 0x62fe8b9380d0>
> rm(P)
> 
> proc.time()
   user  system elapsed 
  0.245   0.054   0.285 

BufferedMatrix.Rcheck/tests/Rcodetesting.Rout


R version 4.5.1 Patched (2025-08-23 r88802) -- "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.244   0.040   0.271 

Example timings