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

This page was generated on 2025-09-27 12:07 -0400 (Sat, 27 Sep 2025).

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

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


CHECK results for BufferedMatrix on taishan

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.
- See Martin Grigorov's blog post for how to debug Linux ARM64 related issues on a x86_64 host.

raw results


Summary

Package: BufferedMatrix
Version: 1.73.0
Command: /home/biocbuild/R/R/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/home/biocbuild/R/R/site-library --no-vignettes --timings BufferedMatrix_1.73.0.tar.gz
StartedAt: 2025-09-26 05:55:16 -0000 (Fri, 26 Sep 2025)
EndedAt: 2025-09-26 05:55:39 -0000 (Fri, 26 Sep 2025)
EllapsedTime: 23.0 seconds
RetCode: 0
Status:   OK  
CheckDir: BufferedMatrix.Rcheck
Warnings: 0

Command output

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


* using log directory ‘/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck’
* using R version 4.5.0 (2025-04-11)
* using platform: aarch64-unknown-linux-gnu
* R was compiled by
    aarch64-unknown-linux-gnu-gcc (GCC) 14.2.0
    GNU Fortran (GCC) 14.2.0
* running under: openEuler 24.03 (LTS)
* using session charset: UTF-8
* using option ‘--no-vignettes’
* 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: ‘aarch64-unknown-linux-gnu-gcc (GCC) 14.2.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 running R code from vignettes ... SKIPPED
* checking re-building of vignette outputs ... SKIPPED
* 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/R/R/bin/R CMD INSTALL BufferedMatrix
###
##############################################################################
##############################################################################


* installing to library ‘/home/biocbuild/R/R-4.5.0/site-library’
* installing *source* package ‘BufferedMatrix’ ...
** this is package ‘BufferedMatrix’ version ‘1.73.0’
** using staged installation
** libs
using C compiler: ‘aarch64-unknown-linux-gnu-gcc (GCC) 14.2.0’
/opt/ohpc/pub/compiler/gcc/14.2.0/bin/aarch64-unknown-linux-gnu-gcc -std=gnu23 -I"/home/biocbuild/R/R-4.5.0/include" -DNDEBUG   -I/usr/local/include    -fPIC  -g -O2  -Wall -Werror=format-security -c RBufferedMatrix.c -o RBufferedMatrix.o
/opt/ohpc/pub/compiler/gcc/14.2.0/bin/aarch64-unknown-linux-gnu-gcc -std=gnu23 -I"/home/biocbuild/R/R-4.5.0/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){
      |            ^~~~~~~~~~~
/opt/ohpc/pub/compiler/gcc/14.2.0/bin/aarch64-unknown-linux-gnu-gcc -std=gnu23 -I"/home/biocbuild/R/R-4.5.0/include" -DNDEBUG   -I/usr/local/include    -fPIC  -g -O2  -Wall -Werror=format-security -c doubleBufferedMatrix_C_tests.c -o doubleBufferedMatrix_C_tests.o
/opt/ohpc/pub/compiler/gcc/14.2.0/bin/aarch64-unknown-linux-gnu-gcc -std=gnu23 -I"/home/biocbuild/R/R-4.5.0/include" -DNDEBUG   -I/usr/local/include    -fPIC  -g -O2  -Wall -Werror=format-security -c init_package.c -o init_package.o
/opt/ohpc/pub/compiler/gcc/14.2.0/bin/aarch64-unknown-linux-gnu-gcc -std=gnu23 -shared -L/home/biocbuild/R/R-4.5.0/lib -L/usr/local/lib -o BufferedMatrix.so RBufferedMatrix.o doubleBufferedMatrix.o doubleBufferedMatrix_C_tests.o init_package.o -L/home/biocbuild/R/R-4.5.0/lib -lR
installing to /home/biocbuild/R/R-4.5.0/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.0 (2025-04-11) -- "How About a Twenty-Six"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: aarch64-unknown-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.340   0.036   0.359 

BufferedMatrix.Rcheck/tests/objectTesting.Rout


R version 4.5.0 (2025-04-11) -- "How About a Twenty-Six"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: aarch64-unknown-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 478398 25.6    1047041   56   639620 34.2
Vcells 885166  6.8    8388608   64  2080985 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 Sep 26 05:55:33 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 Sep 26 05:55:33 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: 0x41a5cff0>
> 
> 
> 
> 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 Sep 26 05:55:34 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 Sep 26 05:55:34 2025"
> 
> ColMode(tmp2)
<pointer: 0x41a5cff0>
> 
> 
> 
> ### Now testing assignments
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+ 
+   new.data <- rnorm(20)
+   tmp2[which.row,] <- new.data
+   test.matrix[which.row,] <- new.data
+   if (rep > 1){
+     if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+   
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   new.data <- rnorm(10)
+   tmp2[,which.col] <- new.data
+   test.matrix[,which.col]<- new.data
+ 
+   if (rep > 1){
+     if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.col <- which.col
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,5,replace=TRUE)
+   new.data <- matrix(rnorm(50),5,10)
+   tmp2[,which.col] <- new.data
+   test.matrix[,which.col]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.col <- which.col
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   new.data <- matrix(rnorm(50),5,10)
+   tmp2[which.row,] <- new.data
+   test.matrix[which.row,]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col  <- sample(1:20,5,replace=TRUE)
+   new.data <- matrix(rnorm(25),5,5)
+   tmp2[which.row,which.col] <- new.data
+   test.matrix[which.row,which.col]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[prev.row,prev.col] == test.matrix[prev.row,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+   prev.col <- which.col
+ }
> 
> 
> 
> 
> ###
> ###
> ### testing some more functions
> ###
> 
> 
> 
> ## duplication function
> tmp5 <- duplicate(tmp2)
> 
> # making sure really did copy everything.
> tmp5[1,1] <- tmp5[1,1] +100.00
> 
> if (tmp5[1,1] == tmp2[1,1]){
+   stop("Problem with duplication")
+ }
> 
> 
> 
> 
> ### testing elementwise applying of functions
> 
> tmp5[1:4,1:4]
           [,1]        [,2]        [,3]       [,4]
[1,] 99.9075339 -1.62846373 -0.08414151  0.1361665
[2,] -1.5798440  0.01474792  0.25360920  0.0373189
[3,] -0.2725678 -0.44876770  0.76484203 -0.3913036
[4,] -0.1606026 -0.08209723 -2.26250086  0.2673348
> ewApply(tmp5,abs)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
           [,1]       [,2]       [,3]      [,4]
[1,] 99.9075339 1.62846373 0.08414151 0.1361665
[2,]  1.5798440 0.01474792 0.25360920 0.0373189
[3,]  0.2725678 0.44876770 0.76484203 0.3913036
[4,]  0.1606026 0.08209723 2.26250086 0.2673348
> ewApply(tmp5,sqrt)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
          [,1]      [,2]      [,3]      [,4]
[1,] 9.9953756 1.2761127 0.2900716 0.3690074
[2,] 1.2569184 0.1214410 0.5035963 0.1931810
[3,] 0.5220803 0.6699013 0.8745525 0.6255426
[4,] 0.4007526 0.2865261 1.5041612 0.5170443
> 
> 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,] 224.86129 39.38959 27.98486 28.82624
[2,]  39.14903 26.22916 30.28957 26.96913
[3,]  30.49337 32.14778 34.51037 31.64673
[4,]  29.16813 27.94736 42.30411 30.43778
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x42c8c9a0>
> exp(tmp5)
<pointer: 0x42c8c9a0>
> log(tmp5,2)
<pointer: 0x42c8c9a0>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 468.0193
> Min(tmp5)
[1] 52.68346
> mean(tmp5)
[1] 72.12416
> Sum(tmp5)
[1] 14424.83
> Var(tmp5)
[1] 863.7103
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 90.53028 68.52568 68.87145 71.22270 71.20539 70.07781 69.92937 71.64777
 [9] 69.51986 69.71126
> rowSums(tmp5)
 [1] 1810.606 1370.514 1377.429 1424.454 1424.108 1401.556 1398.587 1432.955
 [9] 1390.397 1394.225
> rowVars(tmp5)
 [1] 7985.16012   74.51345   72.60770   74.00856   88.81679   47.26688
 [7]   37.12281  104.19532   84.43737   71.98659
> rowSd(tmp5)
 [1] 89.359723  8.632118  8.521015  8.602823  9.424266  6.875091  6.092849
 [8] 10.207611  9.188981  8.484491
> rowMax(tmp5)
 [1] 468.01931  81.48357  89.23355  88.05047  87.02640  86.15558  79.68507
 [8]  88.00981  84.34541  83.85748
> rowMin(tmp5)
 [1] 54.57154 52.68346 54.79595 58.16877 59.11942 58.81842 54.19199 55.71425
 [9] 53.62410 53.95265
> 
> colMeans(tmp5)
 [1] 111.02105  66.94368  70.58323  68.86614  74.78206  70.86133  69.22990
 [8]  67.40051  68.89546  72.47433  71.81974  71.76182  68.08791  72.69615
[15]  71.80738  72.62248  74.22946  69.98572  62.17336  66.24145
> colSums(tmp5)
 [1] 1110.2105  669.4368  705.8323  688.6614  747.8206  708.6133  692.2990
 [8]  674.0051  688.9546  724.7433  718.1974  717.6182  680.8791  726.9615
[15]  718.0738  726.2248  742.2946  699.8572  621.7336  662.4145
> colVars(tmp5)
 [1] 15830.92740    81.50375   152.19903    79.22429    37.80962    79.06185
 [7]    64.44500    84.09831    77.40855    62.65529    86.16730    61.88716
[13]    77.80797    57.51352    62.78232    53.38388    83.13123    37.70842
[19]    32.95175    36.58077
> colSd(tmp5)
 [1] 125.821013   9.027942  12.336897   8.900803   6.148953   8.891673
 [7]   8.027764   9.170513   8.798213   7.915510   9.282634   7.866840
[13]   8.820883   7.583767   7.923529   7.306427   9.117633   6.140718
[19]   5.740362   6.048204
> colMax(tmp5)
 [1] 468.01931  81.98427  88.05047  84.34541  83.85748  83.03562  84.10441
 [8]  79.98445  82.90362  86.15558  89.23355  83.03180  86.53388  87.02858
[15]  80.37812  83.81767  84.23810  79.98372  69.34167  77.73845
> colMin(tmp5)
 [1] 54.19199 54.59256 58.24681 56.13271 60.72730 53.95265 58.69912 54.79595
 [9] 52.68346 63.16621 57.26394 60.68204 59.11942 58.75889 57.58217 62.13375
[17] 58.94915 61.59690 53.62410 55.15230
> 
> 
> ### setting a random element to NA and then testing with na.rm=TRUE or na.rm=FALSE (The default)
> 
> 
> which.row <- sample(1:10,1,replace=TRUE)
> which.col  <- sample(1:20,1,replace=TRUE)
> 
> tmp5[which.row,which.col] <- NA
> 
> Max(tmp5)
[1] NA
> Min(tmp5)
[1] NA
> mean(tmp5)
[1] NA
> Sum(tmp5)
[1] NA
> Var(tmp5)
[1] NA
> 
> rowMeans(tmp5)
 [1] 90.53028 68.52568 68.87145 71.22270 71.20539 70.07781 69.92937       NA
 [9] 69.51986 69.71126
> rowSums(tmp5)
 [1] 1810.606 1370.514 1377.429 1424.454 1424.108 1401.556 1398.587       NA
 [9] 1390.397 1394.225
> rowVars(tmp5)
 [1] 7985.16012   74.51345   72.60770   74.00856   88.81679   47.26688
 [7]   37.12281  109.38864   84.43737   71.98659
> rowSd(tmp5)
 [1] 89.359723  8.632118  8.521015  8.602823  9.424266  6.875091  6.092849
 [8] 10.458903  9.188981  8.484491
> rowMax(tmp5)
 [1] 468.01931  81.48357  89.23355  88.05047  87.02640  86.15558  79.68507
 [8]        NA  84.34541  83.85748
> rowMin(tmp5)
 [1] 54.57154 52.68346 54.79595 58.16877 59.11942 58.81842 54.19199       NA
 [9] 53.62410 53.95265
> 
> colMeans(tmp5)
 [1]       NA 66.94368 70.58323 68.86614 74.78206 70.86133 69.22990 67.40051
 [9] 68.89546 72.47433 71.81974 71.76182 68.08791 72.69615 71.80738 72.62248
[17] 74.22946 69.98572 62.17336 66.24145
> colSums(tmp5)
 [1]       NA 669.4368 705.8323 688.6614 747.8206 708.6133 692.2990 674.0051
 [9] 688.9546 724.7433 718.1974 717.6182 680.8791 726.9615 718.0738 726.2248
[17] 742.2946 699.8572 621.7336 662.4145
> colVars(tmp5)
 [1]        NA  81.50375 152.19903  79.22429  37.80962  79.06185  64.44500
 [8]  84.09831  77.40855  62.65529  86.16730  61.88716  77.80797  57.51352
[15]  62.78232  53.38388  83.13123  37.70842  32.95175  36.58077
> colSd(tmp5)
 [1]        NA  9.027942 12.336897  8.900803  6.148953  8.891673  8.027764
 [8]  9.170513  8.798213  7.915510  9.282634  7.866840  8.820883  7.583767
[15]  7.923529  7.306427  9.117633  6.140718  5.740362  6.048204
> colMax(tmp5)
 [1]       NA 81.98427 88.05047 84.34541 83.85748 83.03562 84.10441 79.98445
 [9] 82.90362 86.15558 89.23355 83.03180 86.53388 87.02858 80.37812 83.81767
[17] 84.23810 79.98372 69.34167 77.73845
> colMin(tmp5)
 [1]       NA 54.59256 58.24681 56.13271 60.72730 53.95265 58.69912 54.79595
 [9] 52.68346 63.16621 57.26394 60.68204 59.11942 58.75889 57.58217 62.13375
[17] 58.94915 61.59690 53.62410 55.15230
> 
> Max(tmp5,na.rm=TRUE)
[1] 468.0193
> Min(tmp5,na.rm=TRUE)
[1] 52.68346
> mean(tmp5,na.rm=TRUE)
[1] 72.11052
> Sum(tmp5,na.rm=TRUE)
[1] 14349.99
> Var(tmp5,na.rm=TRUE)
[1] 868.0351
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 90.53028 68.52568 68.87145 71.22270 71.20539 70.07781 69.92937 71.47984
 [9] 69.51986 69.71126
> rowSums(tmp5,na.rm=TRUE)
 [1] 1810.606 1370.514 1377.429 1424.454 1424.108 1401.556 1398.587 1358.117
 [9] 1390.397 1394.225
> rowVars(tmp5,na.rm=TRUE)
 [1] 7985.16012   74.51345   72.60770   74.00856   88.81679   47.26688
 [7]   37.12281  109.38864   84.43737   71.98659
> rowSd(tmp5,na.rm=TRUE)
 [1] 89.359723  8.632118  8.521015  8.602823  9.424266  6.875091  6.092849
 [8] 10.458903  9.188981  8.484491
> rowMax(tmp5,na.rm=TRUE)
 [1] 468.01931  81.48357  89.23355  88.05047  87.02640  86.15558  79.68507
 [8]  88.00981  84.34541  83.85748
> rowMin(tmp5,na.rm=TRUE)
 [1] 54.57154 52.68346 54.79595 58.16877 59.11942 58.81842 54.19199 55.71425
 [9] 53.62410 53.95265
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 115.04136  66.94368  70.58323  68.86614  74.78206  70.86133  69.22990
 [8]  67.40051  68.89546  72.47433  71.81974  71.76182  68.08791  72.69615
[15]  71.80738  72.62248  74.22946  69.98572  62.17336  66.24145
> colSums(tmp5,na.rm=TRUE)
 [1] 1035.3722  669.4368  705.8323  688.6614  747.8206  708.6133  692.2990
 [8]  674.0051  688.9546  724.7433  718.1974  717.6182  680.8791  726.9615
[15]  718.0738  726.2248  742.2946  699.8572  621.7336  662.4145
> colVars(tmp5,na.rm=TRUE)
 [1] 17627.96159    81.50375   152.19903    79.22429    37.80962    79.06185
 [7]    64.44500    84.09831    77.40855    62.65529    86.16730    61.88716
[13]    77.80797    57.51352    62.78232    53.38388    83.13123    37.70842
[19]    32.95175    36.58077
> colSd(tmp5,na.rm=TRUE)
 [1] 132.770334   9.027942  12.336897   8.900803   6.148953   8.891673
 [7]   8.027764   9.170513   8.798213   7.915510   9.282634   7.866840
[13]   8.820883   7.583767   7.923529   7.306427   9.117633   6.140718
[19]   5.740362   6.048204
> colMax(tmp5,na.rm=TRUE)
 [1] 468.01931  81.98427  88.05047  84.34541  83.85748  83.03562  84.10441
 [8]  79.98445  82.90362  86.15558  89.23355  83.03180  86.53388  87.02858
[15]  80.37812  83.81767  84.23810  79.98372  69.34167  77.73845
> colMin(tmp5,na.rm=TRUE)
 [1] 54.19199 54.59256 58.24681 56.13271 60.72730 53.95265 58.69912 54.79595
 [9] 52.68346 63.16621 57.26394 60.68204 59.11942 58.75889 57.58217 62.13375
[17] 58.94915 61.59690 53.62410 55.15230
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1] 90.53028 68.52568 68.87145 71.22270 71.20539 70.07781 69.92937      NaN
 [9] 69.51986 69.71126
> rowSums(tmp5,na.rm=TRUE)
 [1] 1810.606 1370.514 1377.429 1424.454 1424.108 1401.556 1398.587    0.000
 [9] 1390.397 1394.225
> rowVars(tmp5,na.rm=TRUE)
 [1] 7985.16012   74.51345   72.60770   74.00856   88.81679   47.26688
 [7]   37.12281         NA   84.43737   71.98659
> rowSd(tmp5,na.rm=TRUE)
 [1] 89.359723  8.632118  8.521015  8.602823  9.424266  6.875091  6.092849
 [8]        NA  9.188981  8.484491
> rowMax(tmp5,na.rm=TRUE)
 [1] 468.01931  81.48357  89.23355  88.05047  87.02640  86.15558  79.68507
 [8]        NA  84.34541  83.85748
> rowMin(tmp5,na.rm=TRUE)
 [1] 54.57154 52.68346 54.79595 58.16877 59.11942 58.81842 54.19199       NA
 [9] 53.62410 53.95265
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1]      NaN 68.19139 68.64694 67.66293 74.62339 70.99781 69.39805 66.30786
 [9] 67.33900 73.36598 73.43705 72.78356 66.03835 72.69042 73.38796 71.37857
[17] 73.53376 69.92212 62.55396 66.24135
> colSums(tmp5,na.rm=TRUE)
 [1]   0.0000 613.7225 617.8225 608.9664 671.6105 638.9803 624.5824 596.7707
 [9] 606.0510 660.2938 660.9335 655.0520 594.3452 654.2137 660.4916 642.4071
[17] 661.8038 629.2990 562.9856 596.1722
> colVars(tmp5,na.rm=TRUE)
 [1]        NA  74.17782 129.04535  72.84068  42.25260  88.73502  72.18256
 [8]  81.17935  59.83066  61.54302  67.51162  57.87870  40.27645  64.70234
[15]  42.52504  42.64962  88.07764  42.37645  35.44111  41.15336
> colSd(tmp5,na.rm=TRUE)
 [1]        NA  8.612655 11.359813  8.534675  6.500200  9.419927  8.496032
 [8]  9.009958  7.735028  7.844936  8.216546  7.607805  6.346373  8.043777
[15]  6.521123  6.530667  9.384969  6.509720  5.953244  6.415089
> colMax(tmp5,na.rm=TRUE)
 [1]     -Inf 81.98427 88.05047 84.34541 83.85748 83.03562 84.10441 79.98445
 [9] 79.68507 86.15558 89.23355 83.03180 76.72561 87.02858 80.37812 81.70822
[17] 84.23810 79.98372 69.34167 77.73845
> colMin(tmp5,na.rm=TRUE)
 [1]      Inf 54.59256 58.24681 56.13271 60.72730 53.95265 58.69912 54.79595
 [9] 52.68346 63.16621 61.68764 60.68204 59.11942 58.75889 61.79002 62.13375
[17] 58.94915 61.59690 53.62410 55.15230
> 
> 
> 
> 
> 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] 331.3929 304.7343 126.3152 129.2193 216.0933 218.6668 113.5183 324.9254
 [9] 139.5488 206.8028
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 331.3929 304.7343 126.3152 129.2193 216.0933 218.6668 113.5183 324.9254
 [9] 139.5488 206.8028
> 
> 
> 
> copymatrix <- matrix(rnorm(200,150,15),10,20)
> 
> tmp5[1:10,1:20] <- copymatrix
> which.row <- 1
> which.col  <- 3
> cat(which.row," ",which.col,"\n")
1   3 
> tmp5[which.row,which.col] <- NA
> copymatrix[which.row,which.col] <- NA
> 
> colVars(tmp5,na.rm=TRUE)-apply(copymatrix,2,var,na.rm=TRUE)
 [1] -5.684342e-14  5.684342e-14 -2.842171e-14  0.000000e+00 -1.136868e-13
 [6] -4.263256e-14  5.684342e-14  5.684342e-14 -2.842171e-14 -1.563194e-13
[11]  8.526513e-14  8.526513e-14 -1.136868e-13  2.842171e-14  5.684342e-14
[16]  0.000000e+00 -2.842171e-14  1.136868e-13  5.684342e-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)
+ }
9   3 
3   11 
5   11 
4   3 
7   20 
7   2 
1   7 
2   7 
1   16 
2   8 
7   6 
2   12 
4   3 
4   20 
1   1 
6   7 
4   15 
6   18 
5   16 
9   2 
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.264464
> Min(tmp)
[1] -1.881385
> mean(tmp)
[1] 0.02456591
> Sum(tmp)
[1] 2.456591
> Var(tmp)
[1] 0.859734
> 
> rowMeans(tmp)
[1] 0.02456591
> rowSums(tmp)
[1] 2.456591
> rowVars(tmp)
[1] 0.859734
> rowSd(tmp)
[1] 0.9272184
> rowMax(tmp)
[1] 2.264464
> rowMin(tmp)
[1] -1.881385
> 
> colMeans(tmp)
  [1] -0.075201513  0.351844534  0.227190364 -1.345323208 -0.453048810
  [6] -1.785612866 -1.528092439  0.250082851  1.733443506 -0.300049195
 [11]  0.236142617 -0.138915792  0.410389200  0.167816671 -0.995463657
 [16]  0.487766401 -0.673014384 -0.451865553 -0.885307748 -0.188956941
 [21] -1.126947542  0.963028728 -0.723277750  1.407478362 -1.881385434
 [26]  0.233131637 -0.208615235 -0.354444931 -0.060095991  0.332906408
 [31]  1.935867332  1.041888116 -1.874423003 -0.606762846  0.728853261
 [36] -0.247788221 -0.726599079  0.840125028 -0.919732823  0.805888006
 [41] -0.066678153 -0.073020462  1.789116652  0.127044786 -0.519443044
 [46]  0.419049628 -0.908130064 -0.167345582 -0.362707336 -0.860642119
 [51] -0.072735649 -0.676181344 -0.321827467  1.264849570  1.417802039
 [56] -0.397923848 -0.524015532 -0.028826051  0.963889660  0.447536603
 [61]  0.059103940  0.419208093 -1.588796726 -1.318453366  0.661537714
 [66] -0.305153327  0.536449272 -1.352796736  1.969713332  2.264464018
 [71]  0.110235853 -0.437520969  1.776759060  0.990884134 -0.420325471
 [76]  1.225612081  0.088784619 -0.479005528  0.887944326 -0.638443736
 [81]  0.250180128  0.350654129  1.872186084 -0.346792689  0.189464420
 [86]  1.606761619 -0.746300405 -0.001040394  2.160234162 -0.353536066
 [91]  0.294786697 -1.442987712  0.502225682 -0.164835437 -0.154546582
 [96] -0.975351921 -0.397322379  0.328698605 -0.631110024 -0.387708332
> colSums(tmp)
  [1] -0.075201513  0.351844534  0.227190364 -1.345323208 -0.453048810
  [6] -1.785612866 -1.528092439  0.250082851  1.733443506 -0.300049195
 [11]  0.236142617 -0.138915792  0.410389200  0.167816671 -0.995463657
 [16]  0.487766401 -0.673014384 -0.451865553 -0.885307748 -0.188956941
 [21] -1.126947542  0.963028728 -0.723277750  1.407478362 -1.881385434
 [26]  0.233131637 -0.208615235 -0.354444931 -0.060095991  0.332906408
 [31]  1.935867332  1.041888116 -1.874423003 -0.606762846  0.728853261
 [36] -0.247788221 -0.726599079  0.840125028 -0.919732823  0.805888006
 [41] -0.066678153 -0.073020462  1.789116652  0.127044786 -0.519443044
 [46]  0.419049628 -0.908130064 -0.167345582 -0.362707336 -0.860642119
 [51] -0.072735649 -0.676181344 -0.321827467  1.264849570  1.417802039
 [56] -0.397923848 -0.524015532 -0.028826051  0.963889660  0.447536603
 [61]  0.059103940  0.419208093 -1.588796726 -1.318453366  0.661537714
 [66] -0.305153327  0.536449272 -1.352796736  1.969713332  2.264464018
 [71]  0.110235853 -0.437520969  1.776759060  0.990884134 -0.420325471
 [76]  1.225612081  0.088784619 -0.479005528  0.887944326 -0.638443736
 [81]  0.250180128  0.350654129  1.872186084 -0.346792689  0.189464420
 [86]  1.606761619 -0.746300405 -0.001040394  2.160234162 -0.353536066
 [91]  0.294786697 -1.442987712  0.502225682 -0.164835437 -0.154546582
 [96] -0.975351921 -0.397322379  0.328698605 -0.631110024 -0.387708332
> colVars(tmp)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> colSd(tmp)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> colMax(tmp)
  [1] -0.075201513  0.351844534  0.227190364 -1.345323208 -0.453048810
  [6] -1.785612866 -1.528092439  0.250082851  1.733443506 -0.300049195
 [11]  0.236142617 -0.138915792  0.410389200  0.167816671 -0.995463657
 [16]  0.487766401 -0.673014384 -0.451865553 -0.885307748 -0.188956941
 [21] -1.126947542  0.963028728 -0.723277750  1.407478362 -1.881385434
 [26]  0.233131637 -0.208615235 -0.354444931 -0.060095991  0.332906408
 [31]  1.935867332  1.041888116 -1.874423003 -0.606762846  0.728853261
 [36] -0.247788221 -0.726599079  0.840125028 -0.919732823  0.805888006
 [41] -0.066678153 -0.073020462  1.789116652  0.127044786 -0.519443044
 [46]  0.419049628 -0.908130064 -0.167345582 -0.362707336 -0.860642119
 [51] -0.072735649 -0.676181344 -0.321827467  1.264849570  1.417802039
 [56] -0.397923848 -0.524015532 -0.028826051  0.963889660  0.447536603
 [61]  0.059103940  0.419208093 -1.588796726 -1.318453366  0.661537714
 [66] -0.305153327  0.536449272 -1.352796736  1.969713332  2.264464018
 [71]  0.110235853 -0.437520969  1.776759060  0.990884134 -0.420325471
 [76]  1.225612081  0.088784619 -0.479005528  0.887944326 -0.638443736
 [81]  0.250180128  0.350654129  1.872186084 -0.346792689  0.189464420
 [86]  1.606761619 -0.746300405 -0.001040394  2.160234162 -0.353536066
 [91]  0.294786697 -1.442987712  0.502225682 -0.164835437 -0.154546582
 [96] -0.975351921 -0.397322379  0.328698605 -0.631110024 -0.387708332
> colMin(tmp)
  [1] -0.075201513  0.351844534  0.227190364 -1.345323208 -0.453048810
  [6] -1.785612866 -1.528092439  0.250082851  1.733443506 -0.300049195
 [11]  0.236142617 -0.138915792  0.410389200  0.167816671 -0.995463657
 [16]  0.487766401 -0.673014384 -0.451865553 -0.885307748 -0.188956941
 [21] -1.126947542  0.963028728 -0.723277750  1.407478362 -1.881385434
 [26]  0.233131637 -0.208615235 -0.354444931 -0.060095991  0.332906408
 [31]  1.935867332  1.041888116 -1.874423003 -0.606762846  0.728853261
 [36] -0.247788221 -0.726599079  0.840125028 -0.919732823  0.805888006
 [41] -0.066678153 -0.073020462  1.789116652  0.127044786 -0.519443044
 [46]  0.419049628 -0.908130064 -0.167345582 -0.362707336 -0.860642119
 [51] -0.072735649 -0.676181344 -0.321827467  1.264849570  1.417802039
 [56] -0.397923848 -0.524015532 -0.028826051  0.963889660  0.447536603
 [61]  0.059103940  0.419208093 -1.588796726 -1.318453366  0.661537714
 [66] -0.305153327  0.536449272 -1.352796736  1.969713332  2.264464018
 [71]  0.110235853 -0.437520969  1.776759060  0.990884134 -0.420325471
 [76]  1.225612081  0.088784619 -0.479005528  0.887944326 -0.638443736
 [81]  0.250180128  0.350654129  1.872186084 -0.346792689  0.189464420
 [86]  1.606761619 -0.746300405 -0.001040394  2.160234162 -0.353536066
 [91]  0.294786697 -1.442987712  0.502225682 -0.164835437 -0.154546582
 [96] -0.975351921 -0.397322379  0.328698605 -0.631110024 -0.387708332
> colMedians(tmp)
  [1] -0.075201513  0.351844534  0.227190364 -1.345323208 -0.453048810
  [6] -1.785612866 -1.528092439  0.250082851  1.733443506 -0.300049195
 [11]  0.236142617 -0.138915792  0.410389200  0.167816671 -0.995463657
 [16]  0.487766401 -0.673014384 -0.451865553 -0.885307748 -0.188956941
 [21] -1.126947542  0.963028728 -0.723277750  1.407478362 -1.881385434
 [26]  0.233131637 -0.208615235 -0.354444931 -0.060095991  0.332906408
 [31]  1.935867332  1.041888116 -1.874423003 -0.606762846  0.728853261
 [36] -0.247788221 -0.726599079  0.840125028 -0.919732823  0.805888006
 [41] -0.066678153 -0.073020462  1.789116652  0.127044786 -0.519443044
 [46]  0.419049628 -0.908130064 -0.167345582 -0.362707336 -0.860642119
 [51] -0.072735649 -0.676181344 -0.321827467  1.264849570  1.417802039
 [56] -0.397923848 -0.524015532 -0.028826051  0.963889660  0.447536603
 [61]  0.059103940  0.419208093 -1.588796726 -1.318453366  0.661537714
 [66] -0.305153327  0.536449272 -1.352796736  1.969713332  2.264464018
 [71]  0.110235853 -0.437520969  1.776759060  0.990884134 -0.420325471
 [76]  1.225612081  0.088784619 -0.479005528  0.887944326 -0.638443736
 [81]  0.250180128  0.350654129  1.872186084 -0.346792689  0.189464420
 [86]  1.606761619 -0.746300405 -0.001040394  2.160234162 -0.353536066
 [91]  0.294786697 -1.442987712  0.502225682 -0.164835437 -0.154546582
 [96] -0.975351921 -0.397322379  0.328698605 -0.631110024 -0.387708332
> colRanges(tmp)
            [,1]      [,2]      [,3]      [,4]       [,5]      [,6]      [,7]
[1,] -0.07520151 0.3518445 0.2271904 -1.345323 -0.4530488 -1.785613 -1.528092
[2,] -0.07520151 0.3518445 0.2271904 -1.345323 -0.4530488 -1.785613 -1.528092
          [,8]     [,9]      [,10]     [,11]      [,12]     [,13]     [,14]
[1,] 0.2500829 1.733444 -0.3000492 0.2361426 -0.1389158 0.4103892 0.1678167
[2,] 0.2500829 1.733444 -0.3000492 0.2361426 -0.1389158 0.4103892 0.1678167
          [,15]     [,16]      [,17]      [,18]      [,19]      [,20]     [,21]
[1,] -0.9954637 0.4877664 -0.6730144 -0.4518656 -0.8853077 -0.1889569 -1.126948
[2,] -0.9954637 0.4877664 -0.6730144 -0.4518656 -0.8853077 -0.1889569 -1.126948
         [,22]      [,23]    [,24]     [,25]     [,26]      [,27]      [,28]
[1,] 0.9630287 -0.7232778 1.407478 -1.881385 0.2331316 -0.2086152 -0.3544449
[2,] 0.9630287 -0.7232778 1.407478 -1.881385 0.2331316 -0.2086152 -0.3544449
           [,29]     [,30]    [,31]    [,32]     [,33]      [,34]     [,35]
[1,] -0.06009599 0.3329064 1.935867 1.041888 -1.874423 -0.6067628 0.7288533
[2,] -0.06009599 0.3329064 1.935867 1.041888 -1.874423 -0.6067628 0.7288533
          [,36]      [,37]    [,38]      [,39]    [,40]       [,41]       [,42]
[1,] -0.2477882 -0.7265991 0.840125 -0.9197328 0.805888 -0.06667815 -0.07302046
[2,] -0.2477882 -0.7265991 0.840125 -0.9197328 0.805888 -0.06667815 -0.07302046
        [,43]     [,44]     [,45]     [,46]      [,47]      [,48]      [,49]
[1,] 1.789117 0.1270448 -0.519443 0.4190496 -0.9081301 -0.1673456 -0.3627073
[2,] 1.789117 0.1270448 -0.519443 0.4190496 -0.9081301 -0.1673456 -0.3627073
          [,50]       [,51]      [,52]      [,53]   [,54]    [,55]      [,56]
[1,] -0.8606421 -0.07273565 -0.6761813 -0.3218275 1.26485 1.417802 -0.3979238
[2,] -0.8606421 -0.07273565 -0.6761813 -0.3218275 1.26485 1.417802 -0.3979238
          [,57]       [,58]     [,59]     [,60]      [,61]     [,62]     [,63]
[1,] -0.5240155 -0.02882605 0.9638897 0.4475366 0.05910394 0.4192081 -1.588797
[2,] -0.5240155 -0.02882605 0.9638897 0.4475366 0.05910394 0.4192081 -1.588797
         [,64]     [,65]      [,66]     [,67]     [,68]    [,69]    [,70]
[1,] -1.318453 0.6615377 -0.3051533 0.5364493 -1.352797 1.969713 2.264464
[2,] -1.318453 0.6615377 -0.3051533 0.5364493 -1.352797 1.969713 2.264464
         [,71]     [,72]    [,73]     [,74]      [,75]    [,76]      [,77]
[1,] 0.1102359 -0.437521 1.776759 0.9908841 -0.4203255 1.225612 0.08878462
[2,] 0.1102359 -0.437521 1.776759 0.9908841 -0.4203255 1.225612 0.08878462
          [,78]     [,79]      [,80]     [,81]     [,82]    [,83]      [,84]
[1,] -0.4790055 0.8879443 -0.6384437 0.2501801 0.3506541 1.872186 -0.3467927
[2,] -0.4790055 0.8879443 -0.6384437 0.2501801 0.3506541 1.872186 -0.3467927
         [,85]    [,86]      [,87]        [,88]    [,89]      [,90]     [,91]
[1,] 0.1894644 1.606762 -0.7463004 -0.001040394 2.160234 -0.3535361 0.2947867
[2,] 0.1894644 1.606762 -0.7463004 -0.001040394 2.160234 -0.3535361 0.2947867
         [,92]     [,93]      [,94]      [,95]      [,96]      [,97]     [,98]
[1,] -1.442988 0.5022257 -0.1648354 -0.1545466 -0.9753519 -0.3973224 0.3286986
[2,] -1.442988 0.5022257 -0.1648354 -0.1545466 -0.9753519 -0.3973224 0.3286986
        [,99]     [,100]
[1,] -0.63111 -0.3877083
[2,] -0.63111 -0.3877083
> 
> 
> Max(tmp2)
[1] 3.173574
> Min(tmp2)
[1] -2.210899
> mean(tmp2)
[1] 0.08642923
> Sum(tmp2)
[1] 8.642923
> Var(tmp2)
[1] 1.361193
> 
> rowMeans(tmp2)
  [1] -1.508552324  0.238554326  0.598041272 -1.320520661  0.171588723
  [6] -0.513911945  0.293054622 -0.594950266 -1.183891554  0.445361529
 [11]  0.231727751 -0.074679968  1.733618829  0.711464528 -0.964752864
 [16]  1.430417186  0.350467878 -0.006057638  2.266351804 -1.405582228
 [21]  3.007474621 -0.785028620 -1.157354408 -0.066338499 -1.596310689
 [26]  0.765550593  1.982436359  1.177249209  1.810678014 -0.014339259
 [31]  0.489577386 -0.046311560 -0.733915552  1.461606137 -1.228658688
 [36] -0.044992024  0.581695749 -1.589005857 -0.939514006  1.923509025
 [41] -0.589574296  0.355433089 -0.663680413 -0.227196251 -1.315023469
 [46] -0.884501905  0.194622827 -0.202572766 -0.772536764 -0.311336361
 [51]  0.640229260  0.908780288  0.179869933  2.064566255 -1.677974450
 [56]  2.612321464  0.496970286 -0.001118924 -0.252501582  0.016959080
 [61]  0.098741461 -1.225387050 -0.394401622 -1.038831655 -0.067626276
 [66] -1.014120548  2.490387509 -0.803996815  0.185776802  3.173574427
 [71]  1.205054387  0.382831049  0.995054678 -1.649357359 -0.019288777
 [76]  0.264443828 -0.833164609 -2.210898714 -0.226862865  0.054008554
 [81]  1.186960404 -0.733174515  0.105909037  0.797762107 -0.477623108
 [86]  2.692052245 -1.266366048  0.741841367 -1.812320011  0.417021420
 [91] -0.682357138 -0.304262482  0.694698684  2.255683281 -0.981852410
 [96]  0.096975650  1.148852806 -0.269786430 -1.878130919  1.077610783
> rowSums(tmp2)
  [1] -1.508552324  0.238554326  0.598041272 -1.320520661  0.171588723
  [6] -0.513911945  0.293054622 -0.594950266 -1.183891554  0.445361529
 [11]  0.231727751 -0.074679968  1.733618829  0.711464528 -0.964752864
 [16]  1.430417186  0.350467878 -0.006057638  2.266351804 -1.405582228
 [21]  3.007474621 -0.785028620 -1.157354408 -0.066338499 -1.596310689
 [26]  0.765550593  1.982436359  1.177249209  1.810678014 -0.014339259
 [31]  0.489577386 -0.046311560 -0.733915552  1.461606137 -1.228658688
 [36] -0.044992024  0.581695749 -1.589005857 -0.939514006  1.923509025
 [41] -0.589574296  0.355433089 -0.663680413 -0.227196251 -1.315023469
 [46] -0.884501905  0.194622827 -0.202572766 -0.772536764 -0.311336361
 [51]  0.640229260  0.908780288  0.179869933  2.064566255 -1.677974450
 [56]  2.612321464  0.496970286 -0.001118924 -0.252501582  0.016959080
 [61]  0.098741461 -1.225387050 -0.394401622 -1.038831655 -0.067626276
 [66] -1.014120548  2.490387509 -0.803996815  0.185776802  3.173574427
 [71]  1.205054387  0.382831049  0.995054678 -1.649357359 -0.019288777
 [76]  0.264443828 -0.833164609 -2.210898714 -0.226862865  0.054008554
 [81]  1.186960404 -0.733174515  0.105909037  0.797762107 -0.477623108
 [86]  2.692052245 -1.266366048  0.741841367 -1.812320011  0.417021420
 [91] -0.682357138 -0.304262482  0.694698684  2.255683281 -0.981852410
 [96]  0.096975650  1.148852806 -0.269786430 -1.878130919  1.077610783
> rowVars(tmp2)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowSd(tmp2)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowMax(tmp2)
  [1] -1.508552324  0.238554326  0.598041272 -1.320520661  0.171588723
  [6] -0.513911945  0.293054622 -0.594950266 -1.183891554  0.445361529
 [11]  0.231727751 -0.074679968  1.733618829  0.711464528 -0.964752864
 [16]  1.430417186  0.350467878 -0.006057638  2.266351804 -1.405582228
 [21]  3.007474621 -0.785028620 -1.157354408 -0.066338499 -1.596310689
 [26]  0.765550593  1.982436359  1.177249209  1.810678014 -0.014339259
 [31]  0.489577386 -0.046311560 -0.733915552  1.461606137 -1.228658688
 [36] -0.044992024  0.581695749 -1.589005857 -0.939514006  1.923509025
 [41] -0.589574296  0.355433089 -0.663680413 -0.227196251 -1.315023469
 [46] -0.884501905  0.194622827 -0.202572766 -0.772536764 -0.311336361
 [51]  0.640229260  0.908780288  0.179869933  2.064566255 -1.677974450
 [56]  2.612321464  0.496970286 -0.001118924 -0.252501582  0.016959080
 [61]  0.098741461 -1.225387050 -0.394401622 -1.038831655 -0.067626276
 [66] -1.014120548  2.490387509 -0.803996815  0.185776802  3.173574427
 [71]  1.205054387  0.382831049  0.995054678 -1.649357359 -0.019288777
 [76]  0.264443828 -0.833164609 -2.210898714 -0.226862865  0.054008554
 [81]  1.186960404 -0.733174515  0.105909037  0.797762107 -0.477623108
 [86]  2.692052245 -1.266366048  0.741841367 -1.812320011  0.417021420
 [91] -0.682357138 -0.304262482  0.694698684  2.255683281 -0.981852410
 [96]  0.096975650  1.148852806 -0.269786430 -1.878130919  1.077610783
> rowMin(tmp2)
  [1] -1.508552324  0.238554326  0.598041272 -1.320520661  0.171588723
  [6] -0.513911945  0.293054622 -0.594950266 -1.183891554  0.445361529
 [11]  0.231727751 -0.074679968  1.733618829  0.711464528 -0.964752864
 [16]  1.430417186  0.350467878 -0.006057638  2.266351804 -1.405582228
 [21]  3.007474621 -0.785028620 -1.157354408 -0.066338499 -1.596310689
 [26]  0.765550593  1.982436359  1.177249209  1.810678014 -0.014339259
 [31]  0.489577386 -0.046311560 -0.733915552  1.461606137 -1.228658688
 [36] -0.044992024  0.581695749 -1.589005857 -0.939514006  1.923509025
 [41] -0.589574296  0.355433089 -0.663680413 -0.227196251 -1.315023469
 [46] -0.884501905  0.194622827 -0.202572766 -0.772536764 -0.311336361
 [51]  0.640229260  0.908780288  0.179869933  2.064566255 -1.677974450
 [56]  2.612321464  0.496970286 -0.001118924 -0.252501582  0.016959080
 [61]  0.098741461 -1.225387050 -0.394401622 -1.038831655 -0.067626276
 [66] -1.014120548  2.490387509 -0.803996815  0.185776802  3.173574427
 [71]  1.205054387  0.382831049  0.995054678 -1.649357359 -0.019288777
 [76]  0.264443828 -0.833164609 -2.210898714 -0.226862865  0.054008554
 [81]  1.186960404 -0.733174515  0.105909037  0.797762107 -0.477623108
 [86]  2.692052245 -1.266366048  0.741841367 -1.812320011  0.417021420
 [91] -0.682357138 -0.304262482  0.694698684  2.255683281 -0.981852410
 [96]  0.096975650  1.148852806 -0.269786430 -1.878130919  1.077610783
> 
> colMeans(tmp2)
[1] 0.08642923
> colSums(tmp2)
[1] 8.642923
> colVars(tmp2)
[1] 1.361193
> colSd(tmp2)
[1] 1.166702
> colMax(tmp2)
[1] 3.173574
> colMin(tmp2)
[1] -2.210899
> colMedians(tmp2)
[1] -0.003588281
> colRanges(tmp2)
          [,1]
[1,] -2.210899
[2,]  3.173574
> 
> 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] -1.898061  2.349519 -1.065713  4.170507  0.560952  3.630344 -2.244060
 [8]  6.850596 -6.097350 -1.723104
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -1.1281028
[2,] -0.5691787
[3,] -0.2981309
[4,]  0.1550791
[5,]  1.0815201
> 
> rowApply(tmp,sum)
 [1]  1.59099749 -1.36175114  7.42135752  7.38693485 -4.88200563 -0.04771456
 [7] -3.12505151 -1.17421390  0.85896225 -2.13388500
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    1    5    3    2    7   10    5    5    2     7
 [2,]   10    3    5    3   10    7    3    9    7     4
 [3,]    4    1    1    9    4    6    4    1   10    10
 [4,]    6    7    9   10    8    3    9    3    8     9
 [5,]    8    4    8    7    1    5    7    8    3     8
 [6,]    5    8   10    6    3    8    8    7    5     1
 [7,]    7    2    7    8    6    2    2    4    1     6
 [8,]    9   10    2    5    9    9   10    6    6     5
 [9,]    2    6    4    1    2    4    1   10    9     3
[10,]    3    9    6    4    5    1    6    2    4     2
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1] -1.6806383 -2.0756964  3.4219039 -0.9266221 -3.0861778  1.9828898
 [7]  2.7525603 -1.8922382  2.4629628 -0.7143359 -1.8340417  5.0636325
[13] -2.2069592  3.0002970  0.2579734  0.2636729 -0.7723690 -1.0061892
[19] -2.5631995 -4.1240042
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -0.9660392
[2,] -0.6997286
[3,] -0.6278399
[4,] -0.3361099
[5,]  0.9490794
> 
> rowApply(tmp,sum)
[1]  3.272298  2.957088 -0.800432 -4.869628 -4.235905
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]   15    6    7    9    5
[2,]    3    9   11    3   14
[3,]    5   19   20    1   17
[4,]   14    7    5    7   20
[5,]   13    2    3   12    9
> 
> 
> as.matrix(tmp)
           [,1]         [,2]      [,3]       [,4]       [,5]       [,6]
[1,]  0.9490794 -0.904142260 -0.263551  0.4237843  0.4134563  0.9920422
[2,] -0.6997286 -0.328920293  2.007232 -0.5844450 -1.3056969  1.5945018
[3,] -0.6278399  0.007772614  2.590386 -1.1732937 -1.3910376  1.1373486
[4,] -0.3361099 -1.296421680 -1.627553 -0.9927607 -0.2713921 -1.3993826
[5,] -0.9660392  0.446015224  0.715390  1.4000929 -0.5315075 -0.3416202
           [,7]        [,8]       [,9]       [,10]      [,11]      [,12]
[1,]  1.2120899 -0.06852899 -0.1889103  0.30717888  0.1113350  1.1382444
[2,] -0.8776791 -1.17379954  1.2328931 -0.05516639 -0.1706130  1.7362257
[3,]  1.4949969  0.46756770 -0.3815187  0.69123607  0.1946813  1.9983663
[4,] -0.3143584  0.22468675  0.7294457  0.29001083 -1.2749731  0.6567531
[5,]  1.2375111 -1.34216415  1.0710531 -1.94759526 -0.6944718 -0.4659569
          [,13]      [,14]      [,15]       [,16]      [,17]       [,18]
[1,]  0.1530950 -0.6129700  0.2943678 -0.07954226 -1.5074303  1.23206225
[2,]  1.0571965  2.0767921 -0.3669969  0.52461979 -0.8380863  0.07525803
[3,] -1.5597948  0.2371565  0.1542741 -1.00452496 -0.1389017 -1.61424252
[4,] -1.2517075  0.8277312 -0.2719863  0.94863890  1.4680769  0.52475154
[5,] -0.6057484  0.4715872  0.4483146 -0.12551860  0.2439724 -1.22401847
          [,19]      [,20]
[1,]  1.5355960 -1.8649586
[2,] -1.3319442  0.3854451
[3,] -0.4965719 -1.3864918
[4,] -1.0844336 -0.4186437
[5,] -1.1858458 -0.8393552
> 
> 
> is.BufferedMatrix(tmp)
[1] TRUE
> 
> as.BufferedMatrix(as.matrix(tmp))
BufferedMatrix object
Matrix size:  5 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  800  bytes.
> 
> 
> 
> subBufferedMatrix(tmp,1:5,1:5)
BufferedMatrix object
Matrix size:  5 5 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  653  bytes.
Disk usage :  200  bytes.
> subBufferedMatrix(tmp,,5:8)
BufferedMatrix object
Matrix size:  5 4 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  566  bytes.
Disk usage :  160  bytes.
> subBufferedMatrix(tmp,1:3,)
BufferedMatrix object
Matrix size:  3 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  480  bytes.
> 
> 
> rm(tmp)
> 
> 
> ###
> ### Testing colnames and rownames
> ###
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> 
> 
> colnames(tmp)
NULL
> rownames(tmp)
NULL
> 
> 
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> colnames(tmp)
 [1] "col1"  "col2"  "col3"  "col4"  "col5"  "col6"  "col7"  "col8"  "col9" 
[10] "col10" "col11" "col12" "col13" "col14" "col15" "col16" "col17" "col18"
[19] "col19" "col20"
> rownames(tmp)
[1] "row1" "row2" "row3" "row4" "row5"
> 
> 
> tmp["row1",]
           col1     col2       col3    col4       col5       col6      col7
row1 0.09215392 2.265263 -0.6581645 1.10232 -0.4172598 -0.8904022 0.6514685
          col8      col9    col10     col11     col12     col13    col14
row1 -1.204765 0.4168155 -1.17195 0.2372958 -0.569435 0.4766135 2.256149
         col15     col16      col17      col18    col19   col20
row1 0.8187527 0.3291678 -0.5193852 -0.2818955 1.476502 1.08949
> tmp[,"col10"]
          col10
row1 -1.1719498
row2 -0.1957246
row3 -0.0901942
row4 -0.2534880
row5  0.1022335
> tmp[c("row1","row5"),]
           col1       col2       col3       col4       col5       col6
row1 0.09215392  2.2652635 -0.6581645  1.1023198 -0.4172598 -0.8904022
row5 2.01751814 -0.4142552 -1.9970335 -0.2751219 -0.2460524  0.7268884
          col7      col8       col9      col10     col11      col12     col13
row1 0.6514685 -1.204765  0.4168155 -1.1719498 0.2372958 -0.5694350 0.4766135
row5 0.5963116 -2.307571 -0.5125481  0.1022335 3.4954002  0.0601832 1.3208932
          col14      col15     col16      col17      col18     col19    col20
row1  2.2561488  0.8187527 0.3291678 -0.5193852 -0.2818955 1.4765016 1.089490
row5 -0.2671816 -0.5119944 1.3114921  0.8218013 -1.9965788 0.1844601 2.435319
> tmp[,c("col6","col20")]
           col6      col20
row1 -0.8904022  1.0894897
row2  0.2744832 -1.9036564
row3 -0.7465927 -0.8656954
row4 -1.8524173 -0.6986836
row5  0.7268884  2.4353187
> tmp[c("row1","row5"),c("col6","col20")]
           col6    col20
row1 -0.8904022 1.089490
row5  0.7268884 2.435319
> 
> 
> 
> 
> tmp["row1",] <- rnorm(20,mean=10)
> tmp[,"col10"] <- rnorm(5,mean=30)
> tmp[c("row1","row5"),] <- rnorm(40,mean=50)
> tmp[,c("col6","col20")] <- rnorm(10,mean=75)
> tmp[c("row1","row5"),c("col6","col20")]  <- rnorm(4,mean=105)
> 
> tmp["row1",]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 49.38343 51.84024 50.33029 49.36218 50.00034 106.2076 50.67315 51.84611
         col9    col10    col11    col12   col13    col14    col15   col16
row1 49.03824 50.14594 50.48312 51.58745 48.3871 49.82089 49.17015 48.8656
        col17    col18    col19    col20
row1 48.83679 50.87541 51.59836 104.8445
> tmp[,"col10"]
        col10
row1 50.14594
row2 30.40720
row3 29.00014
row4 28.69742
row5 49.28283
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 49.38343 51.84024 50.33029 49.36218 50.00034 106.2076 50.67315 51.84611
row5 50.24289 50.33423 50.43624 48.89890 50.83826 106.5681 47.71476 48.75919
         col9    col10    col11    col12    col13    col14    col15    col16
row1 49.03824 50.14594 50.48312 51.58745 48.38710 49.82089 49.17015 48.86560
row5 48.93133 49.28283 49.36445 48.37125 50.41414 49.83795 49.90670 51.26855
        col17    col18    col19    col20
row1 48.83679 50.87541 51.59836 104.8445
row5 50.06973 50.27939 50.42354 104.3880
> tmp[,c("col6","col20")]
          col6     col20
row1 106.20761 104.84450
row2  74.61745  74.19713
row3  75.19553  74.21499
row4  76.33402  75.00223
row5 106.56812 104.38804
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 106.2076 104.8445
row5 106.5681 104.3880
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 106.2076 104.8445
row5 106.5681 104.3880
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
          col13
[1,]  1.3033564
[2,] -0.5417945
[3,] -1.3347916
[4,]  1.6831301
[5,]  0.4317621
> tmp[,c("col17","col7")]
          col17       col7
[1,] -1.6568848 -1.2790016
[2,] -1.1075159  0.8741388
[3,] -3.1462560  0.1641246
[4,] -1.0201710  0.1321023
[5,]  0.1173135  0.7583249
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
            col6        col20
[1,] -0.21911041  0.075548917
[2,] -0.64376594 -0.164004146
[3,]  1.16809604  0.424383269
[4,] -0.62157964  0.837018477
[5,]  0.05041427  0.004577197
> subBufferedMatrix(tmp,1,c("col6"))[,1]
           col1
[1,] -0.2191104
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
           col6
[1,] -0.2191104
[2,] -0.6437659
> 
> 
> 
> 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.8143601 -1.2122068 -0.4837918 -1.0791444 -1.0055284 1.1442230
row1  0.2985648 -0.7140792  0.1383272 -0.8634585  0.3512434 0.8803734
           [,7]       [,8]      [,9]      [,10]      [,11]      [,12]
row3 -0.2473921  0.6589100 2.7131037  0.4208615 0.07157025  0.2388681
row1 -0.3242747 -0.2246178 0.6725674 -1.3268870 0.17066181 -0.8014623
          [,13]     [,14]     [,15]      [,16]     [,17]      [,18]      [,19]
row3 -1.5638048 0.4461177 0.5185249  1.0475880  1.506075 -1.0028067  0.2155183
row1  0.2408237 0.3711633 0.5704376 -0.1971436 -1.361038  0.8527398 -0.7042435
          [,20]
row3 -0.4013222
row1  0.4668749
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
         [,1]      [,2]    [,3]      [,4]      [,5]     [,6]       [,7]
row2 1.501615 0.1255166 1.77765 -1.095048 -1.569881 2.057456 -0.7876875
         [,8]      [,9]     [,10]
row2 -3.24301 0.5270802 0.2468365
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
          [,1]       [,2]         [,3]     [,4]     [,5]     [,6]      [,7]
row5 0.7033051 -0.3663884 -0.007608755 1.420168 2.110551 1.233077 0.7196517
           [,8]      [,9]    [,10]    [,11]      [,12]    [,13]    [,14]
row5 -0.4096069 -1.085271 0.530661 1.921481 -0.5665719 1.103388 -1.46153
         [,15]     [,16]    [,17]     [,18]     [,19]      [,20]
row5 0.5854402 -1.263619 0.310312 0.6541336 0.4832333 -0.7827405
> 
> 
> 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: 0x424f3090>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM22af207873f882"
 [2] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM22af204a3a38f5"
 [3] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM22af20175f2cd0"
 [4] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM22af2072dc06f8"
 [5] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM22af2014e86f38"
 [6] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM22af2066386fe2"
 [7] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM22af20680b05bc"
 [8] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM22af203ccde0f0"
 [9] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM22af202f19fe29"
[10] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM22af2035b92646"
[11] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM22af20738b05bf"
[12] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM22af20897a99c" 
[13] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM22af203a9ffc14"
[14] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM22af208bde4e"  
[15] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM22af207651dc8" 
> 
> 
> ### 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: 0x4115f400>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x4115f400>
Warning message:
In dir.create(new.directory) :
  '/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x4115f400>
> rowMedians(tmp)
  [1]  0.284803443 -0.129429896 -0.239382691 -0.164503379 -0.709633065
  [6]  0.386275999  0.356318009 -0.151656640  0.609269801 -0.475107038
 [11] -0.011084365 -0.361251858  0.229261837  0.234310926 -0.162141478
 [16]  0.035945839  0.143074235 -0.415928964  0.274537494 -0.292956220
 [21] -0.352230955  0.059798784 -0.572565297  0.010531051  0.736129956
 [26]  0.123971232 -0.248655020 -0.155720262 -0.076427172 -0.115297371
 [31] -0.018062528  0.163973537  0.396525639  0.132660432 -0.079717701
 [36] -0.319951178  0.546373333  0.450362553  0.243626391 -0.112994737
 [41] -0.343776029  0.078592149  0.186294674  0.137043408  0.395298116
 [46] -0.493199987  0.262488527 -0.211397867  0.473780238 -0.015129606
 [51]  0.010129359  0.382071028 -0.059845815 -0.158287422 -0.073922993
 [56] -0.038466122  0.215629613 -0.651104051 -0.135672685  0.134498612
 [61] -0.510784340 -0.100396491  0.018216071 -0.053444577 -0.294984375
 [66] -0.537767529  0.310712709  0.291880785  0.205545021  0.436952388
 [71]  0.519043028  0.092539911 -0.525744155  0.465392165  0.323373571
 [76]  0.337741630 -0.018013385  0.038005913  0.155037523 -0.237217707
 [81]  0.065114228  0.281714066  0.305495302 -0.207366719  0.283130440
 [86] -0.424191068 -0.007601249  0.063119244 -0.529831928  0.085364847
 [91] -0.096437234  0.088916817 -0.046042835  0.036363158 -0.604656627
 [96] -0.132716779  0.184207488 -0.358539534  0.734958203  0.261767524
[101] -0.404164679 -0.601989726 -0.295466391  0.018849122  0.630139658
[106] -0.251662551  0.132667747 -0.185877413 -0.062964203 -0.005033212
[111] -0.200440903  0.126426524 -0.262827314  0.015665240  0.143680576
[116]  0.128833997 -0.158404379 -0.073511578  0.064852844  0.289613103
[121] -0.246763229 -0.066864031  0.099045960 -0.242643529  0.250037168
[126] -0.294068410  0.039514882 -0.121316317  0.003185366  0.481106617
[131]  0.215827300 -0.125971842 -0.346001077  0.446870712  0.186253890
[136]  0.153036584  0.222342358 -0.327253995 -0.164924873 -0.132859705
[141] -0.083643948  0.116527125 -0.097936038 -0.285195063 -0.156984952
[146] -0.184867387  0.105305353  0.620618610 -0.053312525  0.502561453
[151]  0.244249383 -0.219960885  0.130407510  0.092932718  0.084921903
[156]  0.125586014 -0.964469666  0.128144962  0.190869561  0.064757185
[161] -0.334319080  0.125154724 -0.038160069  0.172720753  1.035805128
[166] -0.037072504  0.057588667 -0.517049280 -0.108241693  0.360089500
[171]  0.290241624  0.083524345  0.324937385 -0.286265435  0.223996829
[176]  0.165546379  0.053383778 -0.064454319 -0.052400857 -0.037675748
[181]  0.132204501 -0.527637959  0.170771443  0.270850682 -0.024482152
[186]  0.125901161  0.229101919  0.305188461  0.516714465 -0.211577004
[191]  0.486011254 -0.516309481 -0.268618143  0.098768432 -0.051614693
[196] -0.356139897  0.525907419 -0.012080748  0.161953699  0.468023988
[201] -0.124060825  0.145122069  0.067859651  0.450284542 -0.089308404
[206]  0.102313609 -0.152464708 -0.060228463  0.453247695  0.145872813
[211]  0.363700964 -0.163895455 -0.550370822  0.089831163 -0.317223509
[216]  0.598332371  0.037895204  0.138376020 -0.170911987  0.084335142
[221] -0.425639723 -0.174718781 -0.453133180  0.007877211  0.167094007
[226] -0.151500885  0.175098193  0.267224685  0.077332117  0.110903364
> 
> proc.time()
   user  system elapsed 
  1.933   0.927   2.885 

BufferedMatrix.Rcheck/tests/rawCalltesting.Rout


R version 4.5.0 (2025-04-11) -- "How About a Twenty-Six"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: aarch64-unknown-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: 0x20f16ff0>
> .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: 0x20f16ff0>
> .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: 0x20f16ff0>
> .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: 0x20f16ff0>
> 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: 0x20e21470>
> .Call("R_bm_AddColumn",P)
<pointer: 0x20e21470>
> .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: 0x20e21470>
> .Call("R_bm_AddColumn",P)
<pointer: 0x20e21470>
> .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: 0x20e21470>
> 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: 0x20dfc0e0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x20dfc0e0>
> .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: 0x20dfc0e0>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x20dfc0e0>
> .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: 0x20dfc0e0>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x20dfc0e0>
> .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: 0x20dfc0e0>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x20dfc0e0>
> .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: 0x20dfc0e0>
> 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: 0x1fd83520>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x1fd83520>
> .Call("R_bm_AddColumn",P)
<pointer: 0x1fd83520>
> .Call("R_bm_AddColumn",P)
<pointer: 0x1fd83520>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile22b0772a5b5ea1" "BufferedMatrixFile22b0773447a54b"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile22b0772a5b5ea1" "BufferedMatrixFile22b0773447a54b"
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x21ccc030>
> .Call("R_bm_AddColumn",P)
<pointer: 0x21ccc030>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x21ccc030>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x21ccc030>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x21ccc030>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x21ccc030>
> .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: 0x206975c0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x206975c0>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x206975c0>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x206975c0>
> 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: 0x21777f30>
> .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: 0x21777f30>
> rm(P)
> 
> proc.time()
   user  system elapsed 
  0.332   0.043   0.361 

BufferedMatrix.Rcheck/tests/Rcodetesting.Rout


R version 4.5.0 (2025-04-11) -- "How About a Twenty-Six"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: aarch64-unknown-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.345   0.037   0.369 

Example timings