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

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

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

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


CHECK results for BufferedMatrix on 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-02 04:57:31 -0000 (Tue, 02 Sep 2025)
EndedAt: 2025-09-02 04:57:54 -0000 (Tue, 02 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.325   0.052   0.363 

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] "Tue Sep  2 04:57:48 2025"
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> date()
[1] "Tue Sep  2 04:57:48 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: 0x3ec66ff0>
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   which.col <- sample(1:20,1)
+   if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,5,replace=TRUE)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> date()
[1] "Tue Sep  2 04:57:48 2025"
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col <- sample(1:20,5,replace=TRUE)
+   if (!all(tmp2[which.row,which.col] == test.matrix[which.row,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> date()
[1] "Tue Sep  2 04:57:48 2025"
> 
> ColMode(tmp2)
<pointer: 0x3ec66ff0>
> 
> 
> 
> ### Now testing assignments
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+ 
+   new.data <- rnorm(20)
+   tmp2[which.row,] <- new.data
+   test.matrix[which.row,] <- new.data
+   if (rep > 1){
+     if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+   
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   new.data <- rnorm(10)
+   tmp2[,which.col] <- new.data
+   test.matrix[,which.col]<- new.data
+ 
+   if (rep > 1){
+     if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.col <- which.col
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,5,replace=TRUE)
+   new.data <- matrix(rnorm(50),5,10)
+   tmp2[,which.col] <- new.data
+   test.matrix[,which.col]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.col <- which.col
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   new.data <- matrix(rnorm(50),5,10)
+   tmp2[which.row,] <- new.data
+   test.matrix[which.row,]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col  <- sample(1:20,5,replace=TRUE)
+   new.data <- matrix(rnorm(25),5,5)
+   tmp2[which.row,which.col] <- new.data
+   test.matrix[which.row,which.col]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[prev.row,prev.col] == test.matrix[prev.row,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+   prev.col <- which.col
+ }
> 
> 
> 
> 
> ###
> ###
> ### testing some more functions
> ###
> 
> 
> 
> ## duplication function
> tmp5 <- duplicate(tmp2)
> 
> # making sure really did copy everything.
> tmp5[1,1] <- tmp5[1,1] +100.00
> 
> if (tmp5[1,1] == tmp2[1,1]){
+   stop("Problem with duplication")
+ }
> 
> 
> 
> 
> ### testing elementwise applying of functions
> 
> tmp5[1:4,1:4]
            [,1]       [,2]      [,3]       [,4]
[1,] 101.8365846 -1.0828884  1.102423 -0.4476086
[2,]  -1.1089254  0.1047039 -1.316631  0.3326882
[3,]  -0.5309606 -0.7290781  1.418141  2.0695633
[4,]  -1.4385907  2.0618473  1.689147  0.5621949
> ewApply(tmp5,abs)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
            [,1]      [,2]     [,3]      [,4]
[1,] 101.8365846 1.0828884 1.102423 0.4476086
[2,]   1.1089254 0.1047039 1.316631 0.3326882
[3,]   0.5309606 0.7290781 1.418141 2.0695633
[4,]   1.4385907 2.0618473 1.689147 0.5621949
> ewApply(tmp5,sqrt)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
           [,1]      [,2]     [,3]      [,4]
[1,] 10.0914114 1.0406192 1.049963 0.6690356
[2,]  1.0530553 0.3235798 1.147445 0.5767913
[3,]  0.7286704 0.8538607 1.190857 1.4385977
[4,]  1.1994126 1.4359134 1.299672 0.7497966
> 
> 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,] 227.75070 36.48908 36.60206 32.13796
[2,]  36.63948 28.34050 37.79109 31.10060
[3,]  32.81766 34.26769 38.32671 41.45554
[4,]  38.43272 41.42098 39.68587 33.06016
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x3fe969a0>
> exp(tmp5)
<pointer: 0x3fe969a0>
> log(tmp5,2)
<pointer: 0x3fe969a0>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 474.0332
> Min(tmp5)
[1] 54.5437
> mean(tmp5)
[1] 73.15492
> Sum(tmp5)
[1] 14630.98
> Var(tmp5)
[1] 882.0031
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 92.80782 70.66561 72.05119 69.45227 74.51867 71.03520 70.26589 68.73220
 [9] 70.73588 71.28448
> rowSums(tmp5)
 [1] 1856.156 1413.312 1441.024 1389.045 1490.373 1420.704 1405.318 1374.644
 [9] 1414.718 1425.690
> rowVars(tmp5)
 [1] 8102.05418   56.72302  101.51898   77.01935   69.51319  113.70946
 [7]   64.77023   54.37055   57.75914   65.67769
> rowSd(tmp5)
 [1] 90.011411  7.531469 10.075663  8.776067  8.337457 10.663464  8.047995
 [8]  7.373639  7.599943  8.104178
> rowMax(tmp5)
 [1] 474.03324  85.92648  90.61489  86.21235  89.83466  91.75523  85.67497
 [8]  80.01239  82.79650  85.26531
> rowMin(tmp5)
 [1] 56.77222 58.98704 57.85886 54.54370 57.13715 56.46427 57.09088 56.39168
 [9] 57.26221 59.02311
> 
> colMeans(tmp5)
 [1] 113.49967  69.92635  72.19995  74.98725  69.11882  70.16549  69.15328
 [8]  69.17091  72.78729  70.83100  73.25789  70.54012  70.96391  67.85757
[15]  68.20791  76.29280  74.80150  68.92036  71.18729  69.22908
> colSums(tmp5)
 [1] 1134.9967  699.2635  721.9995  749.8725  691.1882  701.6549  691.5328
 [8]  691.7091  727.8729  708.3100  732.5789  705.4012  709.6391  678.5757
[15]  682.0791  762.9280  748.0150  689.2036  711.8729  692.2908
> colVars(tmp5)
 [1] 16103.37358   104.50579    75.80364    75.86048    55.99561    53.47285
 [7]    27.85201   114.13037    82.32093    50.58391    68.20683   121.09525
[13]    65.85542    65.11800    49.33305    63.03831    82.90240    68.32005
[19]    66.14991    87.04463
> colSd(tmp5)
 [1] 126.899068  10.222807   8.706529   8.709792   7.483021   7.312513
 [7]   5.277500  10.683182   9.073088   7.112237   8.258742  11.004329
[13]   8.115135   8.069572   7.023749   7.939667   9.105076   8.265594
[19]   8.133259   9.329771
> colMax(tmp5)
 [1] 474.03324  86.21235  82.60093  91.75523  78.64947  79.28954  80.81194
 [8]  85.92648  85.67497  79.21988  84.40460  90.61489  79.49282  77.94441
[15]  78.47368  84.91930  88.42336  80.84863  80.38279  85.26531
> colMin(tmp5)
 [1] 63.92228 57.13715 60.35056 64.73183 56.77222 57.49741 62.14415 54.54370
 [9] 60.02824 57.03389 59.29399 57.76426 57.42380 56.39168 57.09088 62.57290
[17] 59.10174 57.26221 56.99512 56.46427
> 
> 
> ### 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] 92.80782 70.66561 72.05119 69.45227       NA 71.03520 70.26589 68.73220
 [9] 70.73588 71.28448
> rowSums(tmp5)
 [1] 1856.156 1413.312 1441.024 1389.045       NA 1420.704 1405.318 1374.644
 [9] 1414.718 1425.690
> rowVars(tmp5)
 [1] 8102.05418   56.72302  101.51898   77.01935   70.34500  113.70946
 [7]   64.77023   54.37055   57.75914   65.67769
> rowSd(tmp5)
 [1] 90.011411  7.531469 10.075663  8.776067  8.387193 10.663464  8.047995
 [8]  7.373639  7.599943  8.104178
> rowMax(tmp5)
 [1] 474.03324  85.92648  90.61489  86.21235        NA  91.75523  85.67497
 [8]  80.01239  82.79650  85.26531
> rowMin(tmp5)
 [1] 56.77222 58.98704 57.85886 54.54370       NA 56.46427 57.09088 56.39168
 [9] 57.26221 59.02311
> 
> colMeans(tmp5)
 [1] 113.49967  69.92635  72.19995  74.98725  69.11882  70.16549  69.15328
 [8]  69.17091  72.78729  70.83100  73.25789        NA  70.96391  67.85757
[15]  68.20791  76.29280  74.80150  68.92036  71.18729  69.22908
> colSums(tmp5)
 [1] 1134.9967  699.2635  721.9995  749.8725  691.1882  701.6549  691.5328
 [8]  691.7091  727.8729  708.3100  732.5789        NA  709.6391  678.5757
[15]  682.0791  762.9280  748.0150  689.2036  711.8729  692.2908
> colVars(tmp5)
 [1] 16103.37358   104.50579    75.80364    75.86048    55.99561    53.47285
 [7]    27.85201   114.13037    82.32093    50.58391    68.20683          NA
[13]    65.85542    65.11800    49.33305    63.03831    82.90240    68.32005
[19]    66.14991    87.04463
> colSd(tmp5)
 [1] 126.899068  10.222807   8.706529   8.709792   7.483021   7.312513
 [7]   5.277500  10.683182   9.073088   7.112237   8.258742         NA
[13]   8.115135   8.069572   7.023749   7.939667   9.105076   8.265594
[19]   8.133259   9.329771
> colMax(tmp5)
 [1] 474.03324  86.21235  82.60093  91.75523  78.64947  79.28954  80.81194
 [8]  85.92648  85.67497  79.21988  84.40460        NA  79.49282  77.94441
[15]  78.47368  84.91930  88.42336  80.84863  80.38279  85.26531
> colMin(tmp5)
 [1] 63.92228 57.13715 60.35056 64.73183 56.77222 57.49741 62.14415 54.54370
 [9] 60.02824 57.03389 59.29399       NA 57.42380 56.39168 57.09088 62.57290
[17] 59.10174 57.26221 56.99512 56.46427
> 
> Max(tmp5,na.rm=TRUE)
[1] 474.0332
> Min(tmp5,na.rm=TRUE)
[1] 54.5437
> mean(tmp5,na.rm=TRUE)
[1] 73.1119
> Sum(tmp5,na.rm=TRUE)
[1] 14549.27
> Var(tmp5,na.rm=TRUE)
[1] 886.0856
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 92.80782 70.66561 72.05119 69.45227 74.13982 71.03520 70.26589 68.73220
 [9] 70.73588 71.28448
> rowSums(tmp5,na.rm=TRUE)
 [1] 1856.156 1413.312 1441.024 1389.045 1408.657 1420.704 1405.318 1374.644
 [9] 1414.718 1425.690
> rowVars(tmp5,na.rm=TRUE)
 [1] 8102.05418   56.72302  101.51898   77.01935   70.34500  113.70946
 [7]   64.77023   54.37055   57.75914   65.67769
> rowSd(tmp5,na.rm=TRUE)
 [1] 90.011411  7.531469 10.075663  8.776067  8.387193 10.663464  8.047995
 [8]  7.373639  7.599943  8.104178
> rowMax(tmp5,na.rm=TRUE)
 [1] 474.03324  85.92648  90.61489  86.21235  89.83466  91.75523  85.67497
 [8]  80.01239  82.79650  85.26531
> rowMin(tmp5,na.rm=TRUE)
 [1] 56.77222 58.98704 57.85886 54.54370 57.13715 56.46427 57.09088 56.39168
 [9] 57.26221 59.02311
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 113.49967  69.92635  72.19995  74.98725  69.11882  70.16549  69.15328
 [8]  69.17091  72.78729  70.83100  73.25789  69.29826  70.96391  67.85757
[15]  68.20791  76.29280  74.80150  68.92036  71.18729  69.22908
> colSums(tmp5,na.rm=TRUE)
 [1] 1134.9967  699.2635  721.9995  749.8725  691.1882  701.6549  691.5328
 [8]  691.7091  727.8729  708.3100  732.5789  623.6843  709.6391  678.5757
[15]  682.0791  762.9280  748.0150  689.2036  711.8729  692.2908
> colVars(tmp5,na.rm=TRUE)
 [1] 16103.37358   104.50579    75.80364    75.86048    55.99561    53.47285
 [7]    27.85201   114.13037    82.32093    50.58391    68.20683   118.88233
[13]    65.85542    65.11800    49.33305    63.03831    82.90240    68.32005
[19]    66.14991    87.04463
> colSd(tmp5,na.rm=TRUE)
 [1] 126.899068  10.222807   8.706529   8.709792   7.483021   7.312513
 [7]   5.277500  10.683182   9.073088   7.112237   8.258742  10.903317
[13]   8.115135   8.069572   7.023749   7.939667   9.105076   8.265594
[19]   8.133259   9.329771
> colMax(tmp5,na.rm=TRUE)
 [1] 474.03324  86.21235  82.60093  91.75523  78.64947  79.28954  80.81194
 [8]  85.92648  85.67497  79.21988  84.40460  90.61489  79.49282  77.94441
[15]  78.47368  84.91930  88.42336  80.84863  80.38279  85.26531
> colMin(tmp5,na.rm=TRUE)
 [1] 63.92228 57.13715 60.35056 64.73183 56.77222 57.49741 62.14415 54.54370
 [9] 60.02824 57.03389 59.29399 57.76426 57.42380 56.39168 57.09088 62.57290
[17] 59.10174 57.26221 56.99512 56.46427
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1] 92.80782 70.66561 72.05119 69.45227      NaN 71.03520 70.26589 68.73220
 [9] 70.73588 71.28448
> rowSums(tmp5,na.rm=TRUE)
 [1] 1856.156 1413.312 1441.024 1389.045    0.000 1420.704 1405.318 1374.644
 [9] 1414.718 1425.690
> rowVars(tmp5,na.rm=TRUE)
 [1] 8102.05418   56.72302  101.51898   77.01935         NA  113.70946
 [7]   64.77023   54.37055   57.75914   65.67769
> rowSd(tmp5,na.rm=TRUE)
 [1] 90.011411  7.531469 10.075663  8.776067        NA 10.663464  8.047995
 [8]  7.373639  7.599943  8.104178
> rowMax(tmp5,na.rm=TRUE)
 [1] 474.03324  85.92648  90.61489  86.21235        NA  91.75523  85.67497
 [8]  80.01239  82.79650  85.26531
> rowMin(tmp5,na.rm=TRUE)
 [1] 56.77222 58.98704 57.85886 54.54370       NA 56.46427 57.09088 56.39168
 [9] 57.26221 59.02311
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1] 116.12911  71.34737  71.75215  74.56525  69.62350  69.89333  67.85787
 [8]  68.03446  74.20496  70.33735  72.72015       NaN  70.07325  67.66131
[15]  68.97746  76.07324  74.81429  68.46870  70.60499  67.63087
> colSums(tmp5,na.rm=TRUE)
 [1] 1045.1620  642.1264  645.7694  671.0873  626.6115  629.0400  610.7208
 [8]  612.3101  667.8446  633.0362  654.4814    0.0000  630.6592  608.9518
[15]  620.7972  684.6592  673.3286  616.2183  635.4449  608.6778
> colVars(tmp5,na.rm=TRUE)
 [1] 18038.51299    94.85183    83.02320    83.33966    60.12959    59.32363
 [7]    12.45513   113.86707    70.00085    54.16540    73.47964          NA
[13]    65.16287    72.82445    48.83740    70.37577    93.26336    74.56507
[19]    70.60402    69.18973
> colSd(tmp5,na.rm=TRUE)
 [1] 134.307531   9.739190   9.111707   9.129056   7.754327   7.702184
 [7]   3.529182  10.670851   8.366651   7.359715   8.572027         NA
[13]   8.072352   8.533724   6.988376   8.389027   9.657296   8.635107
[19]   8.402620   8.318036
> colMax(tmp5,na.rm=TRUE)
 [1] 474.03324  86.21235  82.60093  91.75523  78.64947  79.28954  73.53544
 [8]  85.92648  85.67497  79.21988  84.40460      -Inf  79.49282  77.94441
[15]  78.47368  84.91930  88.42336  80.84863  80.38279  85.26531
> colMin(tmp5,na.rm=TRUE)
 [1] 63.92228 58.98704 60.35056 64.73183 56.77222 57.49741 62.14415 54.54370
 [9] 60.22291 57.03389 59.29399      Inf 57.42380 56.39168 57.09088 62.57290
[17] 59.10174 57.26221 56.99512 56.46427
> 
> 
> 
> 
> 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] 123.9353 247.1449 375.1097 253.5872 261.8499 163.9990 125.5222 229.0322
 [9] 193.7590 139.1237
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 123.9353 247.1449 375.1097 253.5872 261.8499 163.9990 125.5222 229.0322
 [9] 193.7590 139.1237
> 
> 
> 
> copymatrix <- matrix(rnorm(200,150,15),10,20)
> 
> tmp5[1:10,1:20] <- copymatrix
> which.row <- 1
> which.col  <- 3
> cat(which.row," ",which.col,"\n")
1   3 
> tmp5[which.row,which.col] <- NA
> copymatrix[which.row,which.col] <- NA
> 
> colVars(tmp5,na.rm=TRUE)-apply(copymatrix,2,var,na.rm=TRUE)
 [1] -1.705303e-13 -2.273737e-13 -2.842171e-14 -1.421085e-13  0.000000e+00
 [6]  1.136868e-13  5.684342e-14 -1.136868e-13 -2.842171e-13  8.526513e-14
[11] -2.842171e-14 -2.842171e-14 -8.526513e-14  8.526513e-14  1.136868e-13
[16]  1.136868e-13 -5.684342e-14  5.684342e-14 -5.684342e-14 -2.273737e-13
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> ## making sure these things agree
> ##
> ## first when there is no NA
> 
> 
> 
> agree.checks <- function(buff.matrix,r.matrix,err.tol=1e-10){
+ 
+   if (Max(buff.matrix,na.rm=TRUE) != max(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Max")
+   }
+   
+ 
+   if (Min(buff.matrix,na.rm=TRUE) != min(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Min")
+   }
+ 
+ 
+   if (abs(Sum(buff.matrix,na.rm=TRUE)- sum(r.matrix,na.rm=TRUE)) > err.tol){
+ 
+     cat(Sum(buff.matrix,na.rm=TRUE),"\n")
+     cat(sum(r.matrix,na.rm=TRUE),"\n")
+     cat(Sum(buff.matrix,na.rm=TRUE) - sum(r.matrix,na.rm=TRUE),"\n")
+     
+     stop("No agreement in Sum")
+   }
+   
+   if (abs(mean(buff.matrix,na.rm=TRUE) - mean(r.matrix,na.rm=TRUE)) > err.tol){
+     stop("No agreement in mean")
+   }
+   
+   
+   if(abs(Var(buff.matrix,na.rm=TRUE) - var(as.vector(r.matrix),na.rm=TRUE)) > err.tol){
+     stop("No agreement in Var")
+   }
+   
+   
+ 
+   if(any(abs(rowMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,mean,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowMeans")
+   }
+   
+   
+   if(any(abs(colMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,mean,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colMeans")
+   }
+   
+   
+   if(any(abs(rowSums(buff.matrix,na.rm=TRUE)  -  apply(r.matrix,1,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in rowSums")
+   }
+   
+   
+   if(any(abs(colSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colSums")
+   }
+   
+   ### this is to get around the fact that R doesn't like to compute NA on an entire vector of NA when 
+   ### computing variance
+   my.Var <- function(x,na.rm=FALSE){
+    if (all(is.na(x))){
+      return(NA)
+    } else {
+      var(x,na.rm=na.rm)
+    }
+ 
+   }
+   
+   if(any(abs(rowVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+   
+   
+   if(any(abs(colVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+ 
+ 
+   if(any(abs(rowMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+ 
+   if(any(abs(colMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+   
+   
+   if(any(abs(rowMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+   
+ 
+   if(any(abs(colMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+ 
+   if(any(abs(colMedians(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,median,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMedian")
+   }
+ 
+   if(any(abs(colRanges(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,range,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colRanges")
+   }
+ 
+ 
+   
+ }
> 
> 
> 
> 
> 
> 
> 
> 
> 
> for (rep in 1:20){
+   copymatrix <- matrix(rnorm(200,150,15),10,20)
+   
+   tmp5[1:10,1:20] <- copymatrix
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ## now lets assign some NA values and check agreement
+ 
+   which.row <- sample(1:10,1,replace=TRUE)
+   which.col  <- sample(1:20,1,replace=TRUE)
+   
+   cat(which.row," ",which.col,"\n")
+   
+   tmp5[which.row,which.col] <- NA
+   copymatrix[which.row,which.col] <- NA
+   
+   agree.checks(tmp5,copymatrix)
+ 
+   ## make an entire row NA
+   tmp5[which.row,] <- NA
+   copymatrix[which.row,] <- NA
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ### also make an entire col NA
+   tmp5[,which.col] <- NA
+   copymatrix[,which.col] <- NA
+ 
+   agree.checks(tmp5,copymatrix)
+ 
+   ### now make 1 element non NA with NA in the rest of row and column
+ 
+   tmp5[which.row,which.col] <- rnorm(1,150,15)
+   copymatrix[which.row,which.col] <- tmp5[which.row,which.col]
+ 
+   agree.checks(tmp5,copymatrix)
+ }
2   11 
6   15 
4   16 
5   7 
8   15 
10   13 
6   17 
8   13 
8   8 
6   4 
1   4 
4   16 
4   16 
7   12 
7   10 
2   9 
7   2 
5   4 
1   2 
7   13 
There were 50 or more warnings (use warnings() to see the first 50)
> 
> 
> ### now test 1 by n and n by 1 matrix
> 
> 
> err.tol <- 1e-12
> 
> rm(tmp5)
> 
> dataset1 <- rnorm(100)
> dataset2 <- rnorm(100)
> 
> tmp <- createBufferedMatrix(1,100)
> tmp[1,] <- dataset1
> 
> tmp2 <- createBufferedMatrix(100,1)
> tmp2[,1] <- dataset2
> 
> 
> 
> 
> 
> Max(tmp)
[1] 2.434906
> Min(tmp)
[1] -3.019138
> mean(tmp)
[1] 0.0201035
> Sum(tmp)
[1] 2.01035
> Var(tmp)
[1] 1.106098
> 
> rowMeans(tmp)
[1] 0.0201035
> rowSums(tmp)
[1] 2.01035
> rowVars(tmp)
[1] 1.106098
> rowSd(tmp)
[1] 1.051712
> rowMax(tmp)
[1] 2.434906
> rowMin(tmp)
[1] -3.019138
> 
> colMeans(tmp)
  [1] -0.061302974 -0.781344261  0.588254526 -0.578629084 -0.294903059
  [6] -1.640753396 -0.099469153  0.179703158  0.292597096  1.110596026
 [11]  0.038654873  1.227231050  1.564108129  0.065594523  0.369996152
 [16] -0.485421348 -1.804948830  1.396547109 -0.001594486  0.532972974
 [21]  1.229089499 -0.337294322  0.484052591  0.882448729 -0.373897317
 [26]  2.205923286  0.040783864  0.443720868  0.742438276  1.214092631
 [31] -1.708489410 -1.130895866  1.949223695 -0.437422577  0.874828442
 [36]  1.972181091  0.118044926 -0.718233296 -1.306333021 -0.614809843
 [41]  1.672036522 -1.207367389 -0.085159717  2.434906120 -0.048970051
 [46] -0.585912093  0.587753757 -1.766716058  2.271601190  1.096892635
 [51] -0.076980207  0.073996541  0.662539452  0.944730350  1.038686050
 [56] -0.241034985  1.194450657 -1.207966769 -0.200282243 -0.681306765
 [61] -1.306813513  0.007791649  0.130673423  0.070111881  0.244040096
 [66] -0.979520436  0.969018154  0.577976542 -1.071309057  1.299595061
 [71] -0.100019483  1.810929571 -0.824704138  0.955945732  0.935011887
 [76]  0.107068740  0.577348981 -0.357756341 -1.248387066 -1.045736893
 [81] -1.308203092 -1.305659472 -0.264692136 -0.897091890 -1.376503832
 [86]  0.814632900 -0.458132721 -0.127002451 -3.019138408 -1.452857217
 [91]  0.193507861  0.195833430  0.793622380 -0.111976466 -1.811904293
 [96] -2.009608130  0.308623250  0.327301691  0.324500343 -0.579404403
> colSums(tmp)
  [1] -0.061302974 -0.781344261  0.588254526 -0.578629084 -0.294903059
  [6] -1.640753396 -0.099469153  0.179703158  0.292597096  1.110596026
 [11]  0.038654873  1.227231050  1.564108129  0.065594523  0.369996152
 [16] -0.485421348 -1.804948830  1.396547109 -0.001594486  0.532972974
 [21]  1.229089499 -0.337294322  0.484052591  0.882448729 -0.373897317
 [26]  2.205923286  0.040783864  0.443720868  0.742438276  1.214092631
 [31] -1.708489410 -1.130895866  1.949223695 -0.437422577  0.874828442
 [36]  1.972181091  0.118044926 -0.718233296 -1.306333021 -0.614809843
 [41]  1.672036522 -1.207367389 -0.085159717  2.434906120 -0.048970051
 [46] -0.585912093  0.587753757 -1.766716058  2.271601190  1.096892635
 [51] -0.076980207  0.073996541  0.662539452  0.944730350  1.038686050
 [56] -0.241034985  1.194450657 -1.207966769 -0.200282243 -0.681306765
 [61] -1.306813513  0.007791649  0.130673423  0.070111881  0.244040096
 [66] -0.979520436  0.969018154  0.577976542 -1.071309057  1.299595061
 [71] -0.100019483  1.810929571 -0.824704138  0.955945732  0.935011887
 [76]  0.107068740  0.577348981 -0.357756341 -1.248387066 -1.045736893
 [81] -1.308203092 -1.305659472 -0.264692136 -0.897091890 -1.376503832
 [86]  0.814632900 -0.458132721 -0.127002451 -3.019138408 -1.452857217
 [91]  0.193507861  0.195833430  0.793622380 -0.111976466 -1.811904293
 [96] -2.009608130  0.308623250  0.327301691  0.324500343 -0.579404403
> 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.061302974 -0.781344261  0.588254526 -0.578629084 -0.294903059
  [6] -1.640753396 -0.099469153  0.179703158  0.292597096  1.110596026
 [11]  0.038654873  1.227231050  1.564108129  0.065594523  0.369996152
 [16] -0.485421348 -1.804948830  1.396547109 -0.001594486  0.532972974
 [21]  1.229089499 -0.337294322  0.484052591  0.882448729 -0.373897317
 [26]  2.205923286  0.040783864  0.443720868  0.742438276  1.214092631
 [31] -1.708489410 -1.130895866  1.949223695 -0.437422577  0.874828442
 [36]  1.972181091  0.118044926 -0.718233296 -1.306333021 -0.614809843
 [41]  1.672036522 -1.207367389 -0.085159717  2.434906120 -0.048970051
 [46] -0.585912093  0.587753757 -1.766716058  2.271601190  1.096892635
 [51] -0.076980207  0.073996541  0.662539452  0.944730350  1.038686050
 [56] -0.241034985  1.194450657 -1.207966769 -0.200282243 -0.681306765
 [61] -1.306813513  0.007791649  0.130673423  0.070111881  0.244040096
 [66] -0.979520436  0.969018154  0.577976542 -1.071309057  1.299595061
 [71] -0.100019483  1.810929571 -0.824704138  0.955945732  0.935011887
 [76]  0.107068740  0.577348981 -0.357756341 -1.248387066 -1.045736893
 [81] -1.308203092 -1.305659472 -0.264692136 -0.897091890 -1.376503832
 [86]  0.814632900 -0.458132721 -0.127002451 -3.019138408 -1.452857217
 [91]  0.193507861  0.195833430  0.793622380 -0.111976466 -1.811904293
 [96] -2.009608130  0.308623250  0.327301691  0.324500343 -0.579404403
> colMin(tmp)
  [1] -0.061302974 -0.781344261  0.588254526 -0.578629084 -0.294903059
  [6] -1.640753396 -0.099469153  0.179703158  0.292597096  1.110596026
 [11]  0.038654873  1.227231050  1.564108129  0.065594523  0.369996152
 [16] -0.485421348 -1.804948830  1.396547109 -0.001594486  0.532972974
 [21]  1.229089499 -0.337294322  0.484052591  0.882448729 -0.373897317
 [26]  2.205923286  0.040783864  0.443720868  0.742438276  1.214092631
 [31] -1.708489410 -1.130895866  1.949223695 -0.437422577  0.874828442
 [36]  1.972181091  0.118044926 -0.718233296 -1.306333021 -0.614809843
 [41]  1.672036522 -1.207367389 -0.085159717  2.434906120 -0.048970051
 [46] -0.585912093  0.587753757 -1.766716058  2.271601190  1.096892635
 [51] -0.076980207  0.073996541  0.662539452  0.944730350  1.038686050
 [56] -0.241034985  1.194450657 -1.207966769 -0.200282243 -0.681306765
 [61] -1.306813513  0.007791649  0.130673423  0.070111881  0.244040096
 [66] -0.979520436  0.969018154  0.577976542 -1.071309057  1.299595061
 [71] -0.100019483  1.810929571 -0.824704138  0.955945732  0.935011887
 [76]  0.107068740  0.577348981 -0.357756341 -1.248387066 -1.045736893
 [81] -1.308203092 -1.305659472 -0.264692136 -0.897091890 -1.376503832
 [86]  0.814632900 -0.458132721 -0.127002451 -3.019138408 -1.452857217
 [91]  0.193507861  0.195833430  0.793622380 -0.111976466 -1.811904293
 [96] -2.009608130  0.308623250  0.327301691  0.324500343 -0.579404403
> colMedians(tmp)
  [1] -0.061302974 -0.781344261  0.588254526 -0.578629084 -0.294903059
  [6] -1.640753396 -0.099469153  0.179703158  0.292597096  1.110596026
 [11]  0.038654873  1.227231050  1.564108129  0.065594523  0.369996152
 [16] -0.485421348 -1.804948830  1.396547109 -0.001594486  0.532972974
 [21]  1.229089499 -0.337294322  0.484052591  0.882448729 -0.373897317
 [26]  2.205923286  0.040783864  0.443720868  0.742438276  1.214092631
 [31] -1.708489410 -1.130895866  1.949223695 -0.437422577  0.874828442
 [36]  1.972181091  0.118044926 -0.718233296 -1.306333021 -0.614809843
 [41]  1.672036522 -1.207367389 -0.085159717  2.434906120 -0.048970051
 [46] -0.585912093  0.587753757 -1.766716058  2.271601190  1.096892635
 [51] -0.076980207  0.073996541  0.662539452  0.944730350  1.038686050
 [56] -0.241034985  1.194450657 -1.207966769 -0.200282243 -0.681306765
 [61] -1.306813513  0.007791649  0.130673423  0.070111881  0.244040096
 [66] -0.979520436  0.969018154  0.577976542 -1.071309057  1.299595061
 [71] -0.100019483  1.810929571 -0.824704138  0.955945732  0.935011887
 [76]  0.107068740  0.577348981 -0.357756341 -1.248387066 -1.045736893
 [81] -1.308203092 -1.305659472 -0.264692136 -0.897091890 -1.376503832
 [86]  0.814632900 -0.458132721 -0.127002451 -3.019138408 -1.452857217
 [91]  0.193507861  0.195833430  0.793622380 -0.111976466 -1.811904293
 [96] -2.009608130  0.308623250  0.327301691  0.324500343 -0.579404403
> colRanges(tmp)
            [,1]       [,2]      [,3]       [,4]       [,5]      [,6]
[1,] -0.06130297 -0.7813443 0.5882545 -0.5786291 -0.2949031 -1.640753
[2,] -0.06130297 -0.7813443 0.5882545 -0.5786291 -0.2949031 -1.640753
            [,7]      [,8]      [,9]    [,10]      [,11]    [,12]    [,13]
[1,] -0.09946915 0.1797032 0.2925971 1.110596 0.03865487 1.227231 1.564108
[2,] -0.09946915 0.1797032 0.2925971 1.110596 0.03865487 1.227231 1.564108
          [,14]     [,15]      [,16]     [,17]    [,18]        [,19]    [,20]
[1,] 0.06559452 0.3699962 -0.4854213 -1.804949 1.396547 -0.001594486 0.532973
[2,] 0.06559452 0.3699962 -0.4854213 -1.804949 1.396547 -0.001594486 0.532973
        [,21]      [,22]     [,23]     [,24]      [,25]    [,26]      [,27]
[1,] 1.229089 -0.3372943 0.4840526 0.8824487 -0.3738973 2.205923 0.04078386
[2,] 1.229089 -0.3372943 0.4840526 0.8824487 -0.3738973 2.205923 0.04078386
         [,28]     [,29]    [,30]     [,31]     [,32]    [,33]      [,34]
[1,] 0.4437209 0.7424383 1.214093 -1.708489 -1.130896 1.949224 -0.4374226
[2,] 0.4437209 0.7424383 1.214093 -1.708489 -1.130896 1.949224 -0.4374226
         [,35]    [,36]     [,37]      [,38]     [,39]      [,40]    [,41]
[1,] 0.8748284 1.972181 0.1180449 -0.7182333 -1.306333 -0.6148098 1.672037
[2,] 0.8748284 1.972181 0.1180449 -0.7182333 -1.306333 -0.6148098 1.672037
         [,42]       [,43]    [,44]       [,45]      [,46]     [,47]     [,48]
[1,] -1.207367 -0.08515972 2.434906 -0.04897005 -0.5859121 0.5877538 -1.766716
[2,] -1.207367 -0.08515972 2.434906 -0.04897005 -0.5859121 0.5877538 -1.766716
        [,49]    [,50]       [,51]      [,52]     [,53]     [,54]    [,55]
[1,] 2.271601 1.096893 -0.07698021 0.07399654 0.6625395 0.9447304 1.038686
[2,] 2.271601 1.096893 -0.07698021 0.07399654 0.6625395 0.9447304 1.038686
         [,56]    [,57]     [,58]      [,59]      [,60]     [,61]       [,62]
[1,] -0.241035 1.194451 -1.207967 -0.2002822 -0.6813068 -1.306814 0.007791649
[2,] -0.241035 1.194451 -1.207967 -0.2002822 -0.6813068 -1.306814 0.007791649
         [,63]      [,64]     [,65]      [,66]     [,67]     [,68]     [,69]
[1,] 0.1306734 0.07011188 0.2440401 -0.9795204 0.9690182 0.5779765 -1.071309
[2,] 0.1306734 0.07011188 0.2440401 -0.9795204 0.9690182 0.5779765 -1.071309
        [,70]      [,71]   [,72]      [,73]     [,74]     [,75]     [,76]
[1,] 1.299595 -0.1000195 1.81093 -0.8247041 0.9559457 0.9350119 0.1070687
[2,] 1.299595 -0.1000195 1.81093 -0.8247041 0.9559457 0.9350119 0.1070687
        [,77]      [,78]     [,79]     [,80]     [,81]     [,82]      [,83]
[1,] 0.577349 -0.3577563 -1.248387 -1.045737 -1.308203 -1.305659 -0.2646921
[2,] 0.577349 -0.3577563 -1.248387 -1.045737 -1.308203 -1.305659 -0.2646921
          [,84]     [,85]     [,86]      [,87]      [,88]     [,89]     [,90]
[1,] -0.8970919 -1.376504 0.8146329 -0.4581327 -0.1270025 -3.019138 -1.452857
[2,] -0.8970919 -1.376504 0.8146329 -0.4581327 -0.1270025 -3.019138 -1.452857
         [,91]     [,92]     [,93]      [,94]     [,95]     [,96]     [,97]
[1,] 0.1935079 0.1958334 0.7936224 -0.1119765 -1.811904 -2.009608 0.3086232
[2,] 0.1935079 0.1958334 0.7936224 -0.1119765 -1.811904 -2.009608 0.3086232
         [,98]     [,99]     [,100]
[1,] 0.3273017 0.3245003 -0.5794044
[2,] 0.3273017 0.3245003 -0.5794044
> 
> 
> Max(tmp2)
[1] 3.056873
> Min(tmp2)
[1] -1.96935
> mean(tmp2)
[1] -0.1684881
> Sum(tmp2)
[1] -16.84881
> Var(tmp2)
[1] 0.9073726
> 
> rowMeans(tmp2)
  [1] -0.635655763  0.042681220 -1.798185236 -0.929705704 -1.305554036
  [6] -0.501741428 -0.499706642 -1.266138869 -1.969350473  2.739840921
 [11] -0.737439700  0.082668462 -0.474981128 -0.086946873  1.222068861
 [16]  0.483264730  0.281642000 -1.017480964 -0.175770619 -1.295870073
 [21]  1.325655097  0.211499713 -0.045018648 -0.175860829 -1.500245110
 [26]  0.132117722  3.056872633 -0.191079014 -1.633610122 -1.022293075
 [31] -0.983670154  0.137986893 -0.018017646 -0.712619919  0.045413708
 [36] -0.491021038  0.540193249 -0.071423861  1.207173070 -1.115458396
 [41] -1.662407482  0.488186077 -0.325649250  0.036396456 -0.010187965
 [46]  1.052102794  0.053176151 -1.433764254 -0.999374503  0.940556650
 [51] -1.036105939 -0.668809263  0.301702628  0.041952019  0.203698482
 [56]  0.582436717 -1.687873400 -0.547771643  1.548341358  0.698644278
 [61] -1.520205005 -1.095587221 -0.571902367 -1.606914210  0.374751066
 [66] -0.522886428 -0.360541376  0.319626623  0.996351903 -0.022214170
 [71]  0.070645519 -0.167392245 -0.621295227 -0.281721018  0.715431062
 [76]  0.922566120 -1.043065581 -1.521346257  0.065864438 -0.126284990
 [81]  0.043539783 -0.597810510 -1.055394702  1.224284089  0.313552634
 [86] -0.990580011 -0.323561387 -1.450735766  0.088760761 -0.868788369
 [91]  0.335748937 -0.011132869  1.895680589 -0.907784158 -0.527983682
 [96]  0.058251140  0.951054740  0.957024225  1.585369176 -0.001664174
> rowSums(tmp2)
  [1] -0.635655763  0.042681220 -1.798185236 -0.929705704 -1.305554036
  [6] -0.501741428 -0.499706642 -1.266138869 -1.969350473  2.739840921
 [11] -0.737439700  0.082668462 -0.474981128 -0.086946873  1.222068861
 [16]  0.483264730  0.281642000 -1.017480964 -0.175770619 -1.295870073
 [21]  1.325655097  0.211499713 -0.045018648 -0.175860829 -1.500245110
 [26]  0.132117722  3.056872633 -0.191079014 -1.633610122 -1.022293075
 [31] -0.983670154  0.137986893 -0.018017646 -0.712619919  0.045413708
 [36] -0.491021038  0.540193249 -0.071423861  1.207173070 -1.115458396
 [41] -1.662407482  0.488186077 -0.325649250  0.036396456 -0.010187965
 [46]  1.052102794  0.053176151 -1.433764254 -0.999374503  0.940556650
 [51] -1.036105939 -0.668809263  0.301702628  0.041952019  0.203698482
 [56]  0.582436717 -1.687873400 -0.547771643  1.548341358  0.698644278
 [61] -1.520205005 -1.095587221 -0.571902367 -1.606914210  0.374751066
 [66] -0.522886428 -0.360541376  0.319626623  0.996351903 -0.022214170
 [71]  0.070645519 -0.167392245 -0.621295227 -0.281721018  0.715431062
 [76]  0.922566120 -1.043065581 -1.521346257  0.065864438 -0.126284990
 [81]  0.043539783 -0.597810510 -1.055394702  1.224284089  0.313552634
 [86] -0.990580011 -0.323561387 -1.450735766  0.088760761 -0.868788369
 [91]  0.335748937 -0.011132869  1.895680589 -0.907784158 -0.527983682
 [96]  0.058251140  0.951054740  0.957024225  1.585369176 -0.001664174
> rowVars(tmp2)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowSd(tmp2)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowMax(tmp2)
  [1] -0.635655763  0.042681220 -1.798185236 -0.929705704 -1.305554036
  [6] -0.501741428 -0.499706642 -1.266138869 -1.969350473  2.739840921
 [11] -0.737439700  0.082668462 -0.474981128 -0.086946873  1.222068861
 [16]  0.483264730  0.281642000 -1.017480964 -0.175770619 -1.295870073
 [21]  1.325655097  0.211499713 -0.045018648 -0.175860829 -1.500245110
 [26]  0.132117722  3.056872633 -0.191079014 -1.633610122 -1.022293075
 [31] -0.983670154  0.137986893 -0.018017646 -0.712619919  0.045413708
 [36] -0.491021038  0.540193249 -0.071423861  1.207173070 -1.115458396
 [41] -1.662407482  0.488186077 -0.325649250  0.036396456 -0.010187965
 [46]  1.052102794  0.053176151 -1.433764254 -0.999374503  0.940556650
 [51] -1.036105939 -0.668809263  0.301702628  0.041952019  0.203698482
 [56]  0.582436717 -1.687873400 -0.547771643  1.548341358  0.698644278
 [61] -1.520205005 -1.095587221 -0.571902367 -1.606914210  0.374751066
 [66] -0.522886428 -0.360541376  0.319626623  0.996351903 -0.022214170
 [71]  0.070645519 -0.167392245 -0.621295227 -0.281721018  0.715431062
 [76]  0.922566120 -1.043065581 -1.521346257  0.065864438 -0.126284990
 [81]  0.043539783 -0.597810510 -1.055394702  1.224284089  0.313552634
 [86] -0.990580011 -0.323561387 -1.450735766  0.088760761 -0.868788369
 [91]  0.335748937 -0.011132869  1.895680589 -0.907784158 -0.527983682
 [96]  0.058251140  0.951054740  0.957024225  1.585369176 -0.001664174
> rowMin(tmp2)
  [1] -0.635655763  0.042681220 -1.798185236 -0.929705704 -1.305554036
  [6] -0.501741428 -0.499706642 -1.266138869 -1.969350473  2.739840921
 [11] -0.737439700  0.082668462 -0.474981128 -0.086946873  1.222068861
 [16]  0.483264730  0.281642000 -1.017480964 -0.175770619 -1.295870073
 [21]  1.325655097  0.211499713 -0.045018648 -0.175860829 -1.500245110
 [26]  0.132117722  3.056872633 -0.191079014 -1.633610122 -1.022293075
 [31] -0.983670154  0.137986893 -0.018017646 -0.712619919  0.045413708
 [36] -0.491021038  0.540193249 -0.071423861  1.207173070 -1.115458396
 [41] -1.662407482  0.488186077 -0.325649250  0.036396456 -0.010187965
 [46]  1.052102794  0.053176151 -1.433764254 -0.999374503  0.940556650
 [51] -1.036105939 -0.668809263  0.301702628  0.041952019  0.203698482
 [56]  0.582436717 -1.687873400 -0.547771643  1.548341358  0.698644278
 [61] -1.520205005 -1.095587221 -0.571902367 -1.606914210  0.374751066
 [66] -0.522886428 -0.360541376  0.319626623  0.996351903 -0.022214170
 [71]  0.070645519 -0.167392245 -0.621295227 -0.281721018  0.715431062
 [76]  0.922566120 -1.043065581 -1.521346257  0.065864438 -0.126284990
 [81]  0.043539783 -0.597810510 -1.055394702  1.224284089  0.313552634
 [86] -0.990580011 -0.323561387 -1.450735766  0.088760761 -0.868788369
 [91]  0.335748937 -0.011132869  1.895680589 -0.907784158 -0.527983682
 [96]  0.058251140  0.951054740  0.957024225  1.585369176 -0.001664174
> 
> colMeans(tmp2)
[1] -0.1684881
> colSums(tmp2)
[1] -16.84881
> colVars(tmp2)
[1] 0.9073726
> colSd(tmp2)
[1] 0.9525611
> colMax(tmp2)
[1] 3.056873
> colMin(tmp2)
[1] -1.96935
> colMedians(tmp2)
[1] -0.1066159
> colRanges(tmp2)
          [,1]
[1,] -1.969350
[2,]  3.056873
> 
> 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] -5.219142 -2.471906  1.760490 -3.273434 -6.027397  3.349625 -2.286177
 [8] -2.637590 -3.754205 -4.633749
> colApply(tmp,quantile)[,1]
            [,1]
[1,] -1.64585684
[2,] -0.99915713
[3,] -0.58537630
[4,] -0.07683203
[5,]  0.99174873
> 
> rowApply(tmp,sum)
 [1]  0.3603470 -7.7052274 -1.0570303  0.1356095  2.6925185  0.3421963
 [7] -3.2369474 -5.6943222 -8.5707810 -2.4598496
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    3    9    8    4    1    2    7    7    2     1
 [2,]    2    6    6    5    6    8    5    2    5    10
 [3,]    7   10    2    9    9    7    6    8    7     8
 [4,]    1    4    7    8    7    1    8    5    4     5
 [5,]   10    7    1    2    3    3    2    4    9     2
 [6,]    6    8    9   10    8    9    9    1    8     7
 [7,]    4    1    5    6    5   10    1   10   10     3
 [8,]    8    3    4    3    4    6   10    9    6     4
 [9,]    5    2    3    7   10    4    3    6    3     6
[10,]    9    5   10    1    2    5    4    3    1     9
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1]  1.4307785  2.2812357 -1.4989281  1.0682766 -0.4175877 -0.6251746
 [7] -1.2792156 -1.6684723 -3.2747447  1.2819196 -1.8197586 -0.7829300
[13] -1.7502629 -0.1657341 -4.9881010 -0.2795653 -0.4437590 -1.9512493
[19] -0.9017444 -0.4899375
> colApply(tmp,quantile)[,1]
            [,1]
[1,] -0.32558676
[2,] -0.25670826
[3,] -0.08344346
[4,]  0.73891406
[5,]  1.35760293
> 
> rowApply(tmp,sum)
[1] -3.4455899 -4.7910440 -3.7223507 -0.9058824 -3.4100878
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]   20   14   15   10   10
[2,]   16   20   13   15    5
[3,]   17   13    3   14    6
[4,]    8   12   20   20    1
[5,]   12    3   14    7   19
> 
> 
> as.matrix(tmp)
            [,1]       [,2]       [,3]       [,4]        [,5]         [,6]
[1,]  1.35760293  0.6782175  0.6818844 -0.6336489 -0.03217306  0.418821314
[2,] -0.08344346  1.6843335 -0.1410173 -0.2033160 -1.41464373  0.372468913
[3,]  0.73891406  0.3215636 -1.4295844  1.2632551  0.49563070 -0.235803138
[4,] -0.25670826  0.7572645  0.5147239  2.1235499 -0.75739361 -0.001175775
[5,] -0.32558676 -1.1601435 -1.1249347 -1.4815636  1.29099205 -1.179485864
           [,7]        [,8]       [,9]      [,10]       [,11]      [,12]
[1,]  0.3221900 -0.06833163 -1.2740726 -0.1297442 -0.20585787  1.1474099
[2,]  1.1041248 -0.29817175  0.1610981 -1.1026698 -0.96563261 -0.8166964
[3,] -1.5035106 -2.43513655 -0.5398733  1.1091233  0.77941989 -0.6936170
[4,] -0.6050101 -0.32363135 -1.0372053  0.7982298 -1.46935268 -1.0880006
[5,] -0.5970097  1.45679893 -0.5846917  0.6069805  0.04166468  0.6679741
          [,13]      [,14]      [,15]      [,16]      [,17]      [,18]
[1,] -0.8732164 -2.0367011 -0.7892374  0.2069750  1.3436952 -1.1830086
[2,] -0.3925085  1.4591872 -0.8413885 -1.5956495  1.2995547 -0.5370721
[3,] -1.2882876  0.9307117 -0.3602630  1.0638841 -0.9008694 -0.9733995
[4,]  0.3662990 -1.0309391 -1.5670332  0.8175743 -0.9336856  0.1144399
[5,]  0.4374507  0.5120071 -1.4301789 -0.7723491 -1.2524539  0.6277911
          [,19]      [,20]
[1,] -0.7264093 -1.6499852
[2,] -1.4867924 -0.9928091
[3,]  0.2706115 -0.3351201
[4,]  1.2442180  1.4279540
[5,] -0.2033722  1.0600229
> 
> 
> 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 :  654  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 :  564  bytes.
Disk usage :  160  bytes.
> subBufferedMatrix(tmp,1:3,)
BufferedMatrix object
Matrix size:  3 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  480  bytes.
> 
> 
> rm(tmp)
> 
> 
> ###
> ### Testing colnames and rownames
> ###
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> 
> 
> colnames(tmp)
NULL
> rownames(tmp)
NULL
> 
> 
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> colnames(tmp)
 [1] "col1"  "col2"  "col3"  "col4"  "col5"  "col6"  "col7"  "col8"  "col9" 
[10] "col10" "col11" "col12" "col13" "col14" "col15" "col16" "col17" "col18"
[19] "col19" "col20"
> rownames(tmp)
[1] "row1" "row2" "row3" "row4" "row5"
> 
> 
> tmp["row1",]
          col1      col2       col3       col4       col5       col6       col7
row1 -1.158496 -1.005852 0.02004561 -0.5922405 -0.5700888 -0.7311548 -0.1535277
           col8      col9      col10      col11      col12    col13      col14
row1 0.01240561 0.7359256 -0.6048394 -0.3932125 -0.4386314 1.587639 -0.8667347
         col15    col16    col17    col18      col19     col20
row1 0.8452362 1.398396 1.195164 1.292579 -0.1921184 0.6825519
> tmp[,"col10"]
          col10
row1 -0.6048394
row2  1.8933846
row3 -0.4207072
row4  0.1279097
row5 -0.2088059
> tmp[c("row1","row5"),]
          col1       col2       col3       col4       col5       col6
row1 -1.158496 -1.0058523 0.02004561 -0.5922405 -0.5700888 -0.7311548
row5 -1.315140 -0.2661128 1.47065630  1.7470481  2.4425618 -1.0064577
           col7       col8       col9      col10      col11      col12    col13
row1 -0.1535277 0.01240561  0.7359256 -0.6048394 -0.3932125 -0.4386314 1.587639
row5 -1.0816342 0.35065449 -1.4558539 -0.2088059  0.4658908  0.2678983 1.416689
          col14      col15     col16     col17     col18      col19     col20
row1 -0.8667347  0.8452362 1.3983955 1.1951643 1.2925792 -0.1921184 0.6825519
row5 -0.2232446 -0.6909793 0.3533953 0.4727225 0.2953723 -1.3826497 0.3379500
> tmp[,c("col6","col20")]
            col6      col20
row1 -0.73115480  0.6825519
row2 -0.04855142 -0.9206290
row3 -0.67456993 -1.0043782
row4 -0.15585273 -1.1024783
row5 -1.00645769  0.3379500
> tmp[c("row1","row5"),c("col6","col20")]
           col6     col20
row1 -0.7311548 0.6825519
row5 -1.0064577 0.3379500
> 
> 
> 
> 
> tmp["row1",] <- rnorm(20,mean=10)
> tmp[,"col10"] <- rnorm(5,mean=30)
> tmp[c("row1","row5"),] <- rnorm(40,mean=50)
> tmp[,c("col6","col20")] <- rnorm(10,mean=75)
> tmp[c("row1","row5"),c("col6","col20")]  <- rnorm(4,mean=105)
> 
> tmp["row1",]
       col1     col2     col3     col4     col5     col6     col7     col8
row1 48.866 49.45581 50.16218 50.56652 50.69791 105.5616 48.80575 50.52647
         col9    col10    col11    col12    col13    col14    col15    col16
row1 49.41538 49.86678 51.05572 51.81418 50.23561 50.00231 50.60648 50.52046
        col17    col18    col19   col20
row1 49.56297 49.71425 50.52953 104.226
> tmp[,"col10"]
        col10
row1 49.86678
row2 30.64079
row3 31.23554
row4 29.90842
row5 49.68383
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 48.86600 49.45581 50.16218 50.56652 50.69791 105.5616 48.80575 50.52647
row5 49.08637 51.19422 50.59122 49.09991 50.11247 105.1761 50.24550 50.35220
         col9    col10    col11    col12    col13    col14    col15    col16
row1 49.41538 49.86678 51.05572 51.81418 50.23561 50.00231 50.60648 50.52046
row5 49.56607 49.68383 50.62171 50.26745 47.83696 51.51442 50.43602 51.52114
        col17    col18    col19   col20
row1 49.56297 49.71425 50.52953 104.226
row5 50.10156 50.61419 49.27142 103.434
> tmp[,c("col6","col20")]
          col6     col20
row1 105.56165 104.22604
row2  76.21619  73.96348
row3  75.66159  75.84136
row4  74.53363  73.28154
row5 105.17608 103.43402
> tmp[c("row1","row5"),c("col6","col20")]
         col6   col20
row1 105.5616 104.226
row5 105.1761 103.434
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6   col20
row1 105.5616 104.226
row5 105.1761 103.434
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
          col13
[1,] -0.9055056
[2,] -1.0179759
[3,] -1.8379796
[4,] -1.2207159
[5,]  0.1594340
> tmp[,c("col17","col7")]
           col17       col7
[1,]  1.00937304 -0.1698601
[2,] -0.91174728  0.2909300
[3,] -0.08156446  0.7907662
[4,]  0.29749362 -1.7891461
[5,] -0.10328648 -0.9442885
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
            col6      col20
[1,]  0.02636831  0.9457825
[2,]  3.53343685 -0.7396442
[3,]  2.80812623 -0.1697623
[4,]  0.11430980 -0.3985627
[5,] -0.80511231  1.1336480
> subBufferedMatrix(tmp,1,c("col6"))[,1]
           col1
[1,] 0.02636831
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
           col6
[1,] 0.02636831
[2,] 3.53343685
> 
> 
> 
> 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]       [,7]
row3 -0.3315647 -0.7302665 0.03670421 0.3832400 -1.163813  0.5973715 -0.9439597
row1 -0.4329656  0.9908705 1.09398692 0.3406831  0.117316 -1.0521894 -0.1551609
           [,8]      [,9]       [,10]    [,11]      [,12]     [,13]     [,14]
row3  0.4575223 -1.945104 -0.09544851 1.623853  0.4169268 -1.789613 0.6044078
row1 -0.2723546 -1.002342 -0.11752076 1.247555 -0.4926320 -1.295398 0.2576084
          [,15]     [,16]      [,17]      [,18]      [,19]     [,20]
row3 -0.9938799 0.3423694  0.1754527 -0.7361531  0.9905513  1.998188
row1  1.2606260 0.2691382 -0.3901188 -2.0970617 -0.3188014 -1.382292
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
         [,1]      [,2]      [,3]      [,4]      [,5]      [,6]     [,7]
row2 1.273644 -1.355544 0.1672424 0.2312206 0.3730965 0.2450922 -1.25215
         [,8]     [,9]     [,10]
row2 -1.99766 2.110799 0.7580616
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
           [,1]     [,2]     [,3]      [,4]       [,5]      [,6]      [,7]
row5 -0.1169278 1.487027 -1.54883 0.4931968 -0.4788949 0.7336074 0.6365377
           [,8]      [,9]    [,10]     [,11]   [,12]    [,13]     [,14]
row5 -0.5524715 0.8560842 1.210674 -1.152749 0.69072 1.439479 -1.822884
        [,15]    [,16]      [,17]     [,18]      [,19]     [,20]
row5 0.884344 1.126785 0.06604708 0.7390954 -0.3631645 0.7607908
> 
> 
> 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: 0x3fee2c00>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM31525f11612b0e"
 [2] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM31525f4861b9c7"
 [3] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM31525f6725c7c7"
 [4] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM31525f2dcb4c1b"
 [5] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM31525f2ede3fd5"
 [6] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM31525f390bc39c"
 [7] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM31525f52aab995"
 [8] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM31525f2ebee9a3"
 [9] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM31525f5868f46e"
[10] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM31525f58d4067a"
[11] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM31525f1732b691"
[12] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM31525f532b86d5"
[13] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM31525f663f4efa"
[14] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM31525f712f4c33"
[15] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM31525f402bc2c6"
> 
> 
> ### 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: 0x3d705e50>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x3d705e50>
Warning message:
In dir.create(new.directory) :
  '/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x3d705e50>
> rowMedians(tmp)
  [1] -0.237131404  0.282798112  0.279834992  0.096498894  0.039514263
  [6] -0.047050894 -0.059429211 -0.109953623 -0.104555021  0.530656450
 [11]  0.100791797  0.570295718 -0.355355816 -0.265278376  0.067425783
 [16]  0.419123627  0.277065926 -0.242089539  0.377535541  0.222202439
 [21]  0.754662746  0.061693617  0.276241957 -0.273043806 -0.441040141
 [26]  0.500494108 -0.122328601 -0.034762323  0.230224102  0.025549402
 [31] -0.086055534 -0.478469540 -0.037190080 -0.692513095  0.270742970
 [36]  0.397909531  0.334954465  0.109439793  0.459763833 -0.248024952
 [41]  0.883292816  0.255347261  0.654101620 -0.247367913 -0.535045494
 [46]  0.339403208 -0.205695811  0.015853899  0.104966403  0.047154021
 [51]  0.026646558  0.405623772  0.500054230  0.257577471 -0.443809909
 [56]  0.027369828  0.238332575  0.217017321  0.032699258  0.293263169
 [61]  0.080321100 -0.086202814  0.384125938 -0.265340745 -0.662831590
 [66]  0.320533629  0.086438044 -0.150655737  0.248541606 -0.558059768
 [71]  0.033378250 -0.286759199 -0.239292680  0.152764101 -0.040570957
 [76]  0.496554607 -0.481820363  0.290776717 -0.007260041 -0.200571458
 [81] -0.015210286  0.338171233 -0.068275734 -0.554229296 -0.195165351
 [86]  0.544558302  0.239293523  0.014516355  0.269855799  0.100175499
 [91]  0.076767222  0.161910448 -0.418959395 -0.149819640 -0.176905404
 [96] -0.302358022 -0.365350726  0.186315646 -0.150572118 -0.132112357
[101]  0.149234955 -0.264274050 -0.321332174 -0.154767786  0.217464478
[106]  0.008583891 -0.263021227 -0.175752886  0.168784792 -0.206309016
[111] -0.201277247  0.506448190 -0.191414056 -0.727714711 -0.057679883
[116]  0.255259034 -0.354787645 -0.116365381 -0.222438405 -0.334507574
[121] -0.362057858 -0.029147198 -0.399200198 -0.497446590  0.344839639
[126]  0.179761874  0.364995214 -0.418863182 -0.066775899 -0.239312540
[131] -0.186740665 -0.145737881 -0.109855650 -0.394841306  0.212499198
[136] -0.042186349  0.235183041 -0.152947695 -0.475126930  0.008029912
[141] -0.244178721 -0.042440973  0.181486525  0.696713226  0.380554453
[146]  0.327093103 -0.299694537 -0.332331000 -0.542102741  0.010053113
[151]  0.229746378 -0.017695852 -0.622516426 -0.369844318  0.725319267
[156] -0.119654945 -0.282019724 -0.013961941 -0.467003490  0.258388757
[161] -0.133682059  0.147031464  0.201817711  0.809066326  0.181670764
[166] -0.200041447  0.043300812  0.369357228 -0.639170981 -0.816788910
[171]  0.173622068  0.453825404 -0.036213710  0.055884323 -0.229631017
[176] -0.660545604  0.027614448  0.349195539  0.153745712 -0.372149491
[181]  0.023575094 -0.485875224 -0.668272797 -0.227910559  0.384797616
[186]  0.189059397  0.106560599 -0.429824833 -0.502791070 -0.203682776
[191]  0.116497119  0.217798177 -0.098821254  0.015107818  0.231228406
[196]  0.267032122  0.436758891  0.115362519 -0.093645383  0.253735686
[201] -0.073894977  0.160138072 -0.485986464  0.197467674 -0.052642305
[206]  0.301633533 -0.514557823 -0.292896417 -0.281956433  0.444398697
[211] -0.254305618 -0.074321940 -0.041510884  0.022039489 -0.186984392
[216]  0.247857791  0.377562209  0.097163233  0.361543799  0.579964370
[221]  0.289975530 -0.234613628 -0.020593450  0.439904239 -0.177168275
[226]  0.647477074  0.257166275 -0.515788734  0.644893057 -0.302774193
> 
> proc.time()
   user  system elapsed 
  1.905   0.860   2.802 

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: 0x38e6eff0>
> .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: 0x38e6eff0>
> .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: 0x38e6eff0>
> .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: 0x38e6eff0>
> 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: 0x38d79470>
> .Call("R_bm_AddColumn",P)
<pointer: 0x38d79470>
> .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: 0x38d79470>
> .Call("R_bm_AddColumn",P)
<pointer: 0x38d79470>
> .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: 0x38d79470>
> 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: 0x38d540e0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x38d540e0>
> .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: 0x38d540e0>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x38d540e0>
> .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: 0x38d540e0>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x38d540e0>
> .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: 0x38d540e0>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x38d540e0>
> .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: 0x38d540e0>
> 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: 0x37cdb520>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x37cdb520>
> .Call("R_bm_AddColumn",P)
<pointer: 0x37cdb520>
> .Call("R_bm_AddColumn",P)
<pointer: 0x37cdb520>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile31530c31ad1fd7" "BufferedMatrixFile31530c4f65369f"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile31530c31ad1fd7" "BufferedMatrixFile31530c4f65369f"
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x39c24030>
> .Call("R_bm_AddColumn",P)
<pointer: 0x39c24030>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x39c24030>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x39c24030>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x39c24030>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x39c24030>
> .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: 0x385ef5c0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x385ef5c0>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x385ef5c0>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x385ef5c0>
> 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: 0x396cff30>
> .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: 0x396cff30>
> rm(P)
> 
> proc.time()
   user  system elapsed 
  0.311   0.056   0.354 

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.327   0.042   0.354 

Example timings