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

This page was generated on 2025-12-15 12:08 -0500 (Mon, 15 Dec 2025).

HostnameOSArch (*)R versionInstalled pkgs
nebbiolo2Linux (Ubuntu 24.04.3 LTS)x86_644.5.2 (2025-10-31) -- "[Not] Part in a Rumble" 4882
merida1macOS 12.7.6 Montereyx86_644.5.2 (2025-10-31) -- "[Not] Part in a Rumble" 4673
kjohnson1macOS 13.7.5 Venturaarm644.5.2 Patched (2025-11-04 r88984) -- "[Not] Part in a Rumble" 4607
taishanLinux (openEuler 24.03 LTS)aarch644.5.0 (2025-04-11) -- "How About a Twenty-Six" 4671
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 257/2361HostnameOS / ArchINSTALLBUILDCHECKBUILD BIN
BufferedMatrix 1.74.0  (landing page)
Ben Bolstad
Snapshot Date: 2025-12-11 13:45 -0500 (Thu, 11 Dec 2025)
git_url: https://git.bioconductor.org/packages/BufferedMatrix
git_branch: RELEASE_3_22
git_last_commit: d2ce144
git_last_commit_date: 2025-10-29 09:58:55 -0500 (Wed, 29 Oct 2025)
nebbiolo2Linux (Ubuntu 24.04.3 LTS) / x86_64  OK    OK    OK  UNNEEDED, same version is already published
merida1macOS 12.7.6 Monterey / x86_64  OK    OK    WARNINGS    OK  UNNEEDED, same version is already published
kjohnson1macOS 13.7.5 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.74.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.74.0.tar.gz
StartedAt: 2025-12-12 08:07:04 -0000 (Fri, 12 Dec 2025)
EndedAt: 2025-12-12 08:07:34 -0000 (Fri, 12 Dec 2025)
EllapsedTime: 30.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.74.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.74.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.74.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.331   0.048   0.364 

BufferedMatrix.Rcheck/tests/objectTesting.Rout


R version 4.5.0 (2025-04-11) -- "How About a Twenty-Six"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: aarch64-unknown-linux-gnu

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

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

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

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

Attaching package: 'BufferedMatrix'

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

    colMeans, colSums, rowMeans, rowSums

> 
> 
> ### this is used to control how many repetitions in something below
> ### higher values result in more checks.
> nreps <-100 ##20000
> 
> 
> ## test creation and some simple assignments and subsetting operations
> 
> ## first on single elements
> tmp <- createBufferedMatrix(1000,10)
> 
> tmp[10,5]
[1] 0
> tmp[10,5] <- 10
> tmp[10,5]
[1] 10
> tmp[10,5] <- 12.445
> tmp[10,5]
[1] 12.445
> 
> 
> 
> ## now testing accessing multiple elements
> tmp2 <- createBufferedMatrix(10,20)
> 
> 
> tmp2[3,1] <- 51.34
> tmp2[9,2] <- 9.87654
> tmp2[,1:2]
       [,1]    [,2]
 [1,]  0.00 0.00000
 [2,]  0.00 0.00000
 [3,] 51.34 0.00000
 [4,]  0.00 0.00000
 [5,]  0.00 0.00000
 [6,]  0.00 0.00000
 [7,]  0.00 0.00000
 [8,]  0.00 0.00000
 [9,]  0.00 9.87654
[10,]  0.00 0.00000
> tmp2[,-(3:20)]
       [,1]    [,2]
 [1,]  0.00 0.00000
 [2,]  0.00 0.00000
 [3,] 51.34 0.00000
 [4,]  0.00 0.00000
 [5,]  0.00 0.00000
 [6,]  0.00 0.00000
 [7,]  0.00 0.00000
 [8,]  0.00 0.00000
 [9,]  0.00 9.87654
[10,]  0.00 0.00000
> tmp2[3,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
[1,] 51.34    0    0    0    0    0    0    0    0     0     0     0     0
     [,14] [,15] [,16] [,17] [,18] [,19] [,20]
[1,]     0     0     0     0     0     0     0
> tmp2[-3,]
      [,1]    [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [2,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [3,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [4,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [5,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [6,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [7,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [8,]    0 9.87654    0    0    0    0    0    0    0     0     0     0     0
 [9,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
      [,14] [,15] [,16] [,17] [,18] [,19] [,20]
 [1,]     0     0     0     0     0     0     0
 [2,]     0     0     0     0     0     0     0
 [3,]     0     0     0     0     0     0     0
 [4,]     0     0     0     0     0     0     0
 [5,]     0     0     0     0     0     0     0
 [6,]     0     0     0     0     0     0     0
 [7,]     0     0     0     0     0     0     0
 [8,]     0     0     0     0     0     0     0
 [9,]     0     0     0     0     0     0     0
> tmp2[2,1:3]
     [,1] [,2] [,3]
[1,]    0    0    0
> tmp2[3:9,1:3]
      [,1]    [,2] [,3]
[1,] 51.34 0.00000    0
[2,]  0.00 0.00000    0
[3,]  0.00 0.00000    0
[4,]  0.00 0.00000    0
[5,]  0.00 0.00000    0
[6,]  0.00 0.00000    0
[7,]  0.00 9.87654    0
> tmp2[-4,-4]
       [,1]    [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [2,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [3,] 51.34 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [4,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [5,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [6,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [7,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [8,]  0.00 9.87654    0    0    0    0    0    0    0     0     0     0     0
 [9,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
      [,14] [,15] [,16] [,17] [,18] [,19]
 [1,]     0     0     0     0     0     0
 [2,]     0     0     0     0     0     0
 [3,]     0     0     0     0     0     0
 [4,]     0     0     0     0     0     0
 [5,]     0     0     0     0     0     0
 [6,]     0     0     0     0     0     0
 [7,]     0     0     0     0     0     0
 [8,]     0     0     0     0     0     0
 [9,]     0     0     0     0     0     0
> 
> ## now testing accessing/assigning multiple elements
> tmp3 <- createBufferedMatrix(10,10)
> 
> for (i in 1:10){
+   for (j in 1:10){
+     tmp3[i,j] <- (j-1)*10 + i
+   }
+ }
> 
> tmp3[2:4,2:4]
     [,1] [,2] [,3]
[1,]   12   22   32
[2,]   13   23   33
[3,]   14   24   34
> tmp3[c(-10),c(2:4,2:4,10,1,2,1:10,10:1)]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]   11   21   31   11   21   31   91    1   11     1    11    21    31
 [2,]   12   22   32   12   22   32   92    2   12     2    12    22    32
 [3,]   13   23   33   13   23   33   93    3   13     3    13    23    33
 [4,]   14   24   34   14   24   34   94    4   14     4    14    24    34
 [5,]   15   25   35   15   25   35   95    5   15     5    15    25    35
 [6,]   16   26   36   16   26   36   96    6   16     6    16    26    36
 [7,]   17   27   37   17   27   37   97    7   17     7    17    27    37
 [8,]   18   28   38   18   28   38   98    8   18     8    18    28    38
 [9,]   19   29   39   19   29   39   99    9   19     9    19    29    39
      [,14] [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24] [,25]
 [1,]    41    51    61    71    81    91    91    81    71    61    51    41
 [2,]    42    52    62    72    82    92    92    82    72    62    52    42
 [3,]    43    53    63    73    83    93    93    83    73    63    53    43
 [4,]    44    54    64    74    84    94    94    84    74    64    54    44
 [5,]    45    55    65    75    85    95    95    85    75    65    55    45
 [6,]    46    56    66    76    86    96    96    86    76    66    56    46
 [7,]    47    57    67    77    87    97    97    87    77    67    57    47
 [8,]    48    58    68    78    88    98    98    88    78    68    58    48
 [9,]    49    59    69    79    89    99    99    89    79    69    59    49
      [,26] [,27] [,28] [,29]
 [1,]    31    21    11     1
 [2,]    32    22    12     2
 [3,]    33    23    13     3
 [4,]    34    24    14     4
 [5,]    35    25    15     5
 [6,]    36    26    16     6
 [7,]    37    27    17     7
 [8,]    38    28    18     8
 [9,]    39    29    19     9
> tmp3[-c(1:5),-c(6:10)]
     [,1] [,2] [,3] [,4] [,5]
[1,]    6   16   26   36   46
[2,]    7   17   27   37   47
[3,]    8   18   28   38   48
[4,]    9   19   29   39   49
[5,]   10   20   30   40   50
> 
> ## assignment of whole columns
> tmp3[,1] <- c(1:10*100.0)
> tmp3[,1:2] <- tmp3[,1:2]*100
> tmp3[,1:2] <- tmp3[,2:1]
> tmp3[,1:2]
      [,1]  [,2]
 [1,] 1100 1e+04
 [2,] 1200 2e+04
 [3,] 1300 3e+04
 [4,] 1400 4e+04
 [5,] 1500 5e+04
 [6,] 1600 6e+04
 [7,] 1700 7e+04
 [8,] 1800 8e+04
 [9,] 1900 9e+04
[10,] 2000 1e+05
> 
> 
> tmp3[,-1] <- tmp3[,1:9]
> tmp3[,1:10]
      [,1] [,2]  [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,] 1100 1100 1e+04   21   31   41   51   61   71    81
 [2,] 1200 1200 2e+04   22   32   42   52   62   72    82
 [3,] 1300 1300 3e+04   23   33   43   53   63   73    83
 [4,] 1400 1400 4e+04   24   34   44   54   64   74    84
 [5,] 1500 1500 5e+04   25   35   45   55   65   75    85
 [6,] 1600 1600 6e+04   26   36   46   56   66   76    86
 [7,] 1700 1700 7e+04   27   37   47   57   67   77    87
 [8,] 1800 1800 8e+04   28   38   48   58   68   78    88
 [9,] 1900 1900 9e+04   29   39   49   59   69   79    89
[10,] 2000 2000 1e+05   30   40   50   60   70   80    90
> 
> tmp3[,1:2] <- rep(1,10)
> tmp3[,1:2] <- rep(1,20)
> tmp3[,1:2] <- matrix(c(1:5),1,5)
> 
> tmp3[,-c(1:8)] <- matrix(c(1:5),1,5)
> 
> tmp3[1,] <- 1:10
> tmp3[1,]
     [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,]    1    2    3    4    5    6    7    8    9    10
> tmp3[-1,] <- c(1,2)
> tmp3[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    1    2    3    4    5    6    7    8    9    10
 [2,]    1    2    1    2    1    2    1    2    1     2
 [3,]    2    1    2    1    2    1    2    1    2     1
 [4,]    1    2    1    2    1    2    1    2    1     2
 [5,]    2    1    2    1    2    1    2    1    2     1
 [6,]    1    2    1    2    1    2    1    2    1     2
 [7,]    2    1    2    1    2    1    2    1    2     1
 [8,]    1    2    1    2    1    2    1    2    1     2
 [9,]    2    1    2    1    2    1    2    1    2     1
[10,]    1    2    1    2    1    2    1    2    1     2
> tmp3[-c(1:8),] <- matrix(c(1:5),1,5)
> tmp3[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    1    2    3    4    5    6    7    8    9    10
 [2,]    1    2    1    2    1    2    1    2    1     2
 [3,]    2    1    2    1    2    1    2    1    2     1
 [4,]    1    2    1    2    1    2    1    2    1     2
 [5,]    2    1    2    1    2    1    2    1    2     1
 [6,]    1    2    1    2    1    2    1    2    1     2
 [7,]    2    1    2    1    2    1    2    1    2     1
 [8,]    1    2    1    2    1    2    1    2    1     2
 [9,]    1    3    5    2    4    1    3    5    2     4
[10,]    2    4    1    3    5    2    4    1    3     5
> 
> 
> tmp3[1:2,1:2] <- 5555.04
> tmp3[-(1:2),1:2] <- 1234.56789
> 
> 
> 
> ## testing accessors for the directory and prefix
> directory(tmp3)
[1] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests"
> prefix(tmp3)
[1] "BM"
> 
> ## testing if we can remove these objects
> rm(tmp, tmp2, tmp3)
> gc()
         used (Mb) gc trigger (Mb) max used (Mb)
Ncells 478398 25.6    1047041   56   639620 34.2
Vcells 885166  6.8    8388608   64  2080985 15.9
> 
> 
> 
> 
> ##
> ## checking reads
> ##
> 
> tmp2 <- createBufferedMatrix(10,20)
> 
> test.sample <- rnorm(10*20)
> 
> tmp2[1:10,1:20] <- test.sample
> 
> test.matrix <- matrix(test.sample,10,20)
> 
> ## testing reads
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   which.col <- sample(1:20,1)
+   if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> date()
[1] "Fri Dec 12 08:07:29 2025"
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> date()
[1] "Fri Dec 12 08:07:29 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: 0x1f3e5ff0>
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   which.col <- sample(1:20,1)
+   if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,5,replace=TRUE)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> date()
[1] "Fri Dec 12 08:07:29 2025"
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col <- sample(1:20,5,replace=TRUE)
+   if (!all(tmp2[which.row,which.col] == test.matrix[which.row,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> date()
[1] "Fri Dec 12 08:07:29 2025"
> 
> ColMode(tmp2)
<pointer: 0x1f3e5ff0>
> 
> 
> 
> ### Now testing assignments
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+ 
+   new.data <- rnorm(20)
+   tmp2[which.row,] <- new.data
+   test.matrix[which.row,] <- new.data
+   if (rep > 1){
+     if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+   
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   new.data <- rnorm(10)
+   tmp2[,which.col] <- new.data
+   test.matrix[,which.col]<- new.data
+ 
+   if (rep > 1){
+     if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.col <- which.col
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,5,replace=TRUE)
+   new.data <- matrix(rnorm(50),5,10)
+   tmp2[,which.col] <- new.data
+   test.matrix[,which.col]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.col <- which.col
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   new.data <- matrix(rnorm(50),5,10)
+   tmp2[which.row,] <- new.data
+   test.matrix[which.row,]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col  <- sample(1:20,5,replace=TRUE)
+   new.data <- matrix(rnorm(25),5,5)
+   tmp2[which.row,which.col] <- new.data
+   test.matrix[which.row,which.col]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[prev.row,prev.col] == test.matrix[prev.row,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+   prev.col <- which.col
+ }
> 
> 
> 
> 
> ###
> ###
> ### testing some more functions
> ###
> 
> 
> 
> ## duplication function
> tmp5 <- duplicate(tmp2)
> 
> # making sure really did copy everything.
> tmp5[1,1] <- tmp5[1,1] +100.00
> 
> if (tmp5[1,1] == tmp2[1,1]){
+   stop("Problem with duplication")
+ }
> 
> 
> 
> 
> ### testing elementwise applying of functions
> 
> tmp5[1:4,1:4]
            [,1]       [,2]       [,3]       [,4]
[1,] 100.0901482  1.4099052  0.2682947 -0.3149959
[2,]  -0.6183250 -1.5640288 -0.8621976 -0.1861504
[3,]  -0.3493194 -0.7287397  0.1940043  1.2633023
[4,]   1.7386625 -1.0515311 -0.2461267  0.8111920
> ewApply(tmp5,abs)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
            [,1]      [,2]      [,3]      [,4]
[1,] 100.0901482 1.4099052 0.2682947 0.3149959
[2,]   0.6183250 1.5640288 0.8621976 0.1861504
[3,]   0.3493194 0.7287397 0.1940043 1.2633023
[4,]   1.7386625 1.0515311 0.2461267 0.8111920
> 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.0045064 1.1873943 0.5179717 0.5612450
[2,]  0.7863365 1.2506114 0.9285460 0.4314515
[3,]  0.5910324 0.8536625 0.4404592 1.1239672
[4,]  1.3185835 1.0254419 0.4961116 0.9006620
> 
> my.function <- function(x,power){
+   (x+5)^power
+ }
> 
> ewApply(tmp5,my.function,power=2)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
          [,1]     [,2]     [,3]     [,4]
[1,] 225.13521 38.28385 30.44801 30.92745
[2,]  33.48169 39.07014 35.14766 29.50067
[3,]  31.25964 34.26536 29.59860 37.50297
[4,]  39.92450 36.30595 30.20724 34.81781
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x1e0c86c0>
> exp(tmp5)
<pointer: 0x1e0c86c0>
> log(tmp5,2)
<pointer: 0x1e0c86c0>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 468.5894
> Min(tmp5)
[1] 53.23968
> mean(tmp5)
[1] 73.70708
> Sum(tmp5)
[1] 14741.42
> Var(tmp5)
[1] 867.2256
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 92.67725 72.31262 69.39100 72.04048 70.68566 68.24811 73.55731 73.53994
 [9] 74.42234 70.19611
> rowSums(tmp5)
 [1] 1853.545 1446.252 1387.820 1440.810 1413.713 1364.962 1471.146 1470.799
 [9] 1488.447 1403.922
> rowVars(tmp5)
 [1] 7937.43927   58.76291   68.39822   84.40792  115.93302   43.22987
 [7]   82.84463   72.87038   94.21956   67.00855
> rowSd(tmp5)
 [1] 89.092308  7.665697  8.270322  9.187378 10.767219  6.574943  9.101903
 [8]  8.536415  9.706676  8.185875
> rowMax(tmp5)
 [1] 468.58945  83.70819  82.07327  89.54769  92.67584  83.90805  94.96690
 [8]  88.01372  92.30599  87.76532
> rowMin(tmp5)
 [1] 55.64139 54.38613 53.64059 57.02722 56.27555 54.49598 58.29203 57.41669
 [9] 53.23968 55.81933
> 
> colMeans(tmp5)
 [1] 109.00192  77.26363  65.97851  68.43860  73.93230  73.45717  74.30468
 [8]  73.29006  66.92427  67.48857  74.55336  75.90495  72.04732  72.64267
[15]  72.33624  75.02101  69.04505  71.55759  71.17740  69.77636
> colSums(tmp5)
 [1] 1090.0192  772.6363  659.7851  684.3860  739.3230  734.5717  743.0468
 [8]  732.9006  669.2427  674.8857  745.5336  759.0495  720.4732  726.4267
[15]  723.3624  750.2101  690.4505  715.5759  711.7740  697.7636
> colVars(tmp5)
 [1] 16022.89932    66.55592    52.18105    29.53028    30.42951    90.97365
 [7]   139.61790    38.66177    68.50622   107.71699    76.08981    28.60739
[13]    97.31907   101.77972   107.17536   131.73417   149.08514    56.86774
[19]    60.24838    61.08909
> colSd(tmp5)
 [1] 126.581592   8.158181   7.223645   5.434177   5.516295   9.538011
 [7]  11.816002   6.217859   8.276848  10.378679   8.722947   5.348587
[13]   9.865043  10.088594  10.352553  11.477551  12.210043   7.541070
[19]   7.761983   7.815951
> colMax(tmp5)
 [1] 468.58945  92.67584  81.37778  78.05753  81.18809  83.70819  94.96690
 [8]  80.48202  79.47163  85.35228  92.27293  82.38188  86.68399  87.15768
[15]  87.47771  89.54769  92.30599  87.76532  81.19182  79.33806
> colMin(tmp5)
 [1] 58.35920 65.46648 57.02555 61.40177 65.02488 55.81933 59.29331 59.62811
 [9] 53.23968 53.64059 61.19543 65.44207 57.41669 58.29203 55.64139 60.78477
[17] 54.38613 59.61844 58.35657 56.27555
> 
> 
> ### 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.67725 72.31262 69.39100 72.04048       NA 68.24811 73.55731 73.53994
 [9] 74.42234 70.19611
> rowSums(tmp5)
 [1] 1853.545 1446.252 1387.820 1440.810       NA 1364.962 1471.146 1470.799
 [9] 1488.447 1403.922
> rowVars(tmp5)
 [1] 7937.43927   58.76291   68.39822   84.40792  121.07236   43.22987
 [7]   82.84463   72.87038   94.21956   67.00855
> rowSd(tmp5)
 [1] 89.092308  7.665697  8.270322  9.187378 11.003289  6.574943  9.101903
 [8]  8.536415  9.706676  8.185875
> rowMax(tmp5)
 [1] 468.58945  83.70819  82.07327  89.54769        NA  83.90805  94.96690
 [8]  88.01372  92.30599  87.76532
> rowMin(tmp5)
 [1] 55.64139 54.38613 53.64059 57.02722       NA 54.49598 58.29203 57.41669
 [9] 53.23968 55.81933
> 
> colMeans(tmp5)
 [1] 109.00192  77.26363  65.97851  68.43860  73.93230  73.45717  74.30468
 [8]  73.29006  66.92427  67.48857  74.55336  75.90495        NA  72.64267
[15]  72.33624  75.02101  69.04505  71.55759  71.17740  69.77636
> colSums(tmp5)
 [1] 1090.0192  772.6363  659.7851  684.3860  739.3230  734.5717  743.0468
 [8]  732.9006  669.2427  674.8857  745.5336  759.0495        NA  726.4267
[15]  723.3624  750.2101  690.4505  715.5759  711.7740  697.7636
> colVars(tmp5)
 [1] 16022.89932    66.55592    52.18105    29.53028    30.42951    90.97365
 [7]   139.61790    38.66177    68.50622   107.71699    76.08981    28.60739
[13]          NA   101.77972   107.17536   131.73417   149.08514    56.86774
[19]    60.24838    61.08909
> colSd(tmp5)
 [1] 126.581592   8.158181   7.223645   5.434177   5.516295   9.538011
 [7]  11.816002   6.217859   8.276848  10.378679   8.722947   5.348587
[13]         NA  10.088594  10.352553  11.477551  12.210043   7.541070
[19]   7.761983   7.815951
> colMax(tmp5)
 [1] 468.58945  92.67584  81.37778  78.05753  81.18809  83.70819  94.96690
 [8]  80.48202  79.47163  85.35228  92.27293  82.38188        NA  87.15768
[15]  87.47771  89.54769  92.30599  87.76532  81.19182  79.33806
> colMin(tmp5)
 [1] 58.35920 65.46648 57.02555 61.40177 65.02488 55.81933 59.29331 59.62811
 [9] 53.23968 53.64059 61.19543 65.44207       NA 58.29203 55.64139 60.78477
[17] 54.38613 59.61844 58.35657 56.27555
> 
> Max(tmp5,na.rm=TRUE)
[1] 468.5894
> Min(tmp5,na.rm=TRUE)
[1] 53.23968
> mean(tmp5,na.rm=TRUE)
[1] 73.74597
> Sum(tmp5,na.rm=TRUE)
[1] 14675.45
> Var(tmp5,na.rm=TRUE)
[1] 871.3015
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 92.67725 72.31262 69.39100 72.04048 70.93395 68.24811 73.55731 73.53994
 [9] 74.42234 70.19611
> rowSums(tmp5,na.rm=TRUE)
 [1] 1853.545 1446.252 1387.820 1440.810 1347.745 1364.962 1471.146 1470.799
 [9] 1488.447 1403.922
> rowVars(tmp5,na.rm=TRUE)
 [1] 7937.43927   58.76291   68.39822   84.40792  121.07236   43.22987
 [7]   82.84463   72.87038   94.21956   67.00855
> rowSd(tmp5,na.rm=TRUE)
 [1] 89.092308  7.665697  8.270322  9.187378 11.003289  6.574943  9.101903
 [8]  8.536415  9.706676  8.185875
> rowMax(tmp5,na.rm=TRUE)
 [1] 468.58945  83.70819  82.07327  89.54769  92.67584  83.90805  94.96690
 [8]  88.01372  92.30599  87.76532
> rowMin(tmp5,na.rm=TRUE)
 [1] 55.64139 54.38613 53.64059 57.02722 56.27555 54.49598 58.29203 57.41669
 [9] 53.23968 55.81933
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 109.00192  77.26363  65.97851  68.43860  73.93230  73.45717  74.30468
 [8]  73.29006  66.92427  67.48857  74.55336  75.90495  72.72277  72.64267
[15]  72.33624  75.02101  69.04505  71.55759  71.17740  69.77636
> colSums(tmp5,na.rm=TRUE)
 [1] 1090.0192  772.6363  659.7851  684.3860  739.3230  734.5717  743.0468
 [8]  732.9006  669.2427  674.8857  745.5336  759.0495  654.5049  726.4267
[15]  723.3624  750.2101  690.4505  715.5759  711.7740  697.7636
> colVars(tmp5,na.rm=TRUE)
 [1] 16022.89932    66.55592    52.18105    29.53028    30.42951    90.97365
 [7]   139.61790    38.66177    68.50622   107.71699    76.08981    28.60739
[13]   104.35137   101.77972   107.17536   131.73417   149.08514    56.86774
[19]    60.24838    61.08909
> colSd(tmp5,na.rm=TRUE)
 [1] 126.581592   8.158181   7.223645   5.434177   5.516295   9.538011
 [7]  11.816002   6.217859   8.276848  10.378679   8.722947   5.348587
[13]  10.215252  10.088594  10.352553  11.477551  12.210043   7.541070
[19]   7.761983   7.815951
> colMax(tmp5,na.rm=TRUE)
 [1] 468.58945  92.67584  81.37778  78.05753  81.18809  83.70819  94.96690
 [8]  80.48202  79.47163  85.35228  92.27293  82.38188  86.68399  87.15768
[15]  87.47771  89.54769  92.30599  87.76532  81.19182  79.33806
> colMin(tmp5,na.rm=TRUE)
 [1] 58.35920 65.46648 57.02555 61.40177 65.02488 55.81933 59.29331 59.62811
 [9] 53.23968 53.64059 61.19543 65.44207 57.41669 58.29203 55.64139 60.78477
[17] 54.38613 59.61844 58.35657 56.27555
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1] 92.67725 72.31262 69.39100 72.04048      NaN 68.24811 73.55731 73.53994
 [9] 74.42234 70.19611
> rowSums(tmp5,na.rm=TRUE)
 [1] 1853.545 1446.252 1387.820 1440.810    0.000 1364.962 1471.146 1470.799
 [9] 1488.447 1403.922
> rowVars(tmp5,na.rm=TRUE)
 [1] 7937.43927   58.76291   68.39822   84.40792         NA   43.22987
 [7]   82.84463   72.87038   94.21956   67.00855
> rowSd(tmp5,na.rm=TRUE)
 [1] 89.092308  7.665697  8.270322  9.187378        NA  6.574943  9.101903
 [8]  8.536415  9.706676  8.185875
> rowMax(tmp5,na.rm=TRUE)
 [1] 468.58945  83.70819  82.07327  89.54769        NA  83.90805  94.96690
 [8]  88.01372  92.30599  87.76532
> rowMin(tmp5,na.rm=TRUE)
 [1] 55.64139 54.38613 53.64059 57.02722       NA 54.49598 58.29203 57.41669
 [9] 53.23968 55.81933
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1] 114.28482  75.55116  66.97328  68.56072  73.52700  73.90534  75.31259
 [8]  73.36411  67.24748  68.54934  74.29165  76.20763       NaN  71.02989
[15]  70.65385  76.60282  69.78679  70.94354  70.06469  71.27645
> colSums(tmp5,na.rm=TRUE)
 [1] 1028.5633  679.9604  602.7596  617.0465  661.7430  665.1481  677.8133
 [8]  660.2770  605.2273  616.9440  668.6248  685.8686    0.0000  639.2690
[15]  635.8847  689.4254  628.0811  638.4919  630.5822  641.4880
> colVars(tmp5,na.rm=TRUE)
 [1] 17711.78531    41.88426    47.57096    33.05380    32.38515   100.08567
 [7]   145.64141    43.43280    75.89427   108.52277    84.83049    31.15264
[13]          NA    85.24028    88.73003   120.05225   161.53121    59.73437
[19]    53.85045    43.40970
> colSd(tmp5,na.rm=TRUE)
 [1] 133.085632   6.471805   6.897171   5.749243   5.690795  10.004283
 [7]  12.068198   6.590357   8.711732  10.417426   9.210347   5.581455
[13]         NA   9.232566   9.419662  10.956836  12.709493   7.728801
[19]   7.338286   6.588604
> colMax(tmp5,na.rm=TRUE)
 [1] 468.58945  83.90805  81.37778  78.05753  81.18809  83.70819  94.96690
 [8]  80.48202  79.47163  85.35228  92.27293  82.38188      -Inf  82.07327
[15]  81.08749  89.54769  92.30599  87.76532  80.27262  79.33806
> colMin(tmp5,na.rm=TRUE)
 [1] 58.35920 65.46648 59.94901 61.40177 65.02488 55.81933 59.29331 59.62811
 [9] 53.23968 53.64059 61.19543 65.44207      Inf 58.29203 55.64139 63.42850
[17] 54.38613 59.61844 58.35657 58.66348
> 
> 
> 
> 
> 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] 376.5379 336.0492 114.3221 143.2956 383.9037 175.6216 293.5692 238.2207
 [9] 291.9050 332.3857
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 376.5379 336.0492 114.3221 143.2956 383.9037 175.6216 293.5692 238.2207
 [9] 291.9050 332.3857
> 
> 
> 
> 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]  7.105427e-14  5.684342e-14  5.684342e-14  5.684342e-14  0.000000e+00
 [6]  0.000000e+00 -1.421085e-14  2.842171e-14 -8.526513e-14 -2.557954e-13
[11] -5.684342e-14  4.263256e-14  2.842171e-14  0.000000e+00 -8.526513e-14
[16] -1.421085e-13 -2.273737e-13 -1.136868e-13  0.000000e+00  5.684342e-14
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> ## making sure these things agree
> ##
> ## first when there is no NA
> 
> 
> 
> agree.checks <- function(buff.matrix,r.matrix,err.tol=1e-10){
+ 
+   if (Max(buff.matrix,na.rm=TRUE) != max(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Max")
+   }
+   
+ 
+   if (Min(buff.matrix,na.rm=TRUE) != min(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Min")
+   }
+ 
+ 
+   if (abs(Sum(buff.matrix,na.rm=TRUE)- sum(r.matrix,na.rm=TRUE)) > err.tol){
+ 
+     cat(Sum(buff.matrix,na.rm=TRUE),"\n")
+     cat(sum(r.matrix,na.rm=TRUE),"\n")
+     cat(Sum(buff.matrix,na.rm=TRUE) - sum(r.matrix,na.rm=TRUE),"\n")
+     
+     stop("No agreement in Sum")
+   }
+   
+   if (abs(mean(buff.matrix,na.rm=TRUE) - mean(r.matrix,na.rm=TRUE)) > err.tol){
+     stop("No agreement in mean")
+   }
+   
+   
+   if(abs(Var(buff.matrix,na.rm=TRUE) - var(as.vector(r.matrix),na.rm=TRUE)) > err.tol){
+     stop("No agreement in Var")
+   }
+   
+   
+ 
+   if(any(abs(rowMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,mean,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowMeans")
+   }
+   
+   
+   if(any(abs(colMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,mean,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colMeans")
+   }
+   
+   
+   if(any(abs(rowSums(buff.matrix,na.rm=TRUE)  -  apply(r.matrix,1,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in rowSums")
+   }
+   
+   
+   if(any(abs(colSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colSums")
+   }
+   
+   ### this is to get around the fact that R doesn't like to compute NA on an entire vector of NA when 
+   ### computing variance
+   my.Var <- function(x,na.rm=FALSE){
+    if (all(is.na(x))){
+      return(NA)
+    } else {
+      var(x,na.rm=na.rm)
+    }
+ 
+   }
+   
+   if(any(abs(rowVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+   
+   
+   if(any(abs(colVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+ 
+ 
+   if(any(abs(rowMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+ 
+   if(any(abs(colMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+   
+   
+   if(any(abs(rowMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+   
+ 
+   if(any(abs(colMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+ 
+   if(any(abs(colMedians(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,median,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMedian")
+   }
+ 
+   if(any(abs(colRanges(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,range,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colRanges")
+   }
+ 
+ 
+   
+ }
> 
> 
> 
> 
> 
> 
> 
> 
> 
> for (rep in 1:20){
+   copymatrix <- matrix(rnorm(200,150,15),10,20)
+   
+   tmp5[1:10,1:20] <- copymatrix
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ## now lets assign some NA values and check agreement
+ 
+   which.row <- sample(1:10,1,replace=TRUE)
+   which.col  <- sample(1:20,1,replace=TRUE)
+   
+   cat(which.row," ",which.col,"\n")
+   
+   tmp5[which.row,which.col] <- NA
+   copymatrix[which.row,which.col] <- NA
+   
+   agree.checks(tmp5,copymatrix)
+ 
+   ## make an entire row NA
+   tmp5[which.row,] <- NA
+   copymatrix[which.row,] <- NA
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ### also make an entire col NA
+   tmp5[,which.col] <- NA
+   copymatrix[,which.col] <- NA
+ 
+   agree.checks(tmp5,copymatrix)
+ 
+   ### now make 1 element non NA with NA in the rest of row and column
+ 
+   tmp5[which.row,which.col] <- rnorm(1,150,15)
+   copymatrix[which.row,which.col] <- tmp5[which.row,which.col]
+ 
+   agree.checks(tmp5,copymatrix)
+ }
6   4 
3   13 
8   9 
2   17 
8   2 
6   8 
6   13 
3   13 
1   10 
8   6 
7   17 
5   2 
10   14 
10   2 
1   3 
2   14 
7   10 
8   2 
8   10 
4   12 
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.251839
> Min(tmp)
[1] -2.203132
> mean(tmp)
[1] 0.08174571
> Sum(tmp)
[1] 8.174571
> Var(tmp)
[1] 0.8447366
> 
> rowMeans(tmp)
[1] 0.08174571
> rowSums(tmp)
[1] 8.174571
> rowVars(tmp)
[1] 0.8447366
> rowSd(tmp)
[1] 0.9190955
> rowMax(tmp)
[1] 2.251839
> rowMin(tmp)
[1] -2.203132
> 
> colMeans(tmp)
  [1]  1.00763917  1.07669726 -0.34136250  0.40301283 -0.70989952  1.48341727
  [7] -1.55470636 -0.06571761 -0.71800569  0.06683039 -0.53810538 -0.02079210
 [13]  0.19624015  0.62847665 -1.22208929 -0.74878391  1.07360793  0.54265635
 [19] -0.80593260  0.93842491  0.52411779 -1.21842526 -0.20617680 -1.55095322
 [25]  0.18689051 -0.38382633 -0.15727626 -0.74461297 -0.72929942 -1.65905462
 [31]  1.49332151  0.89685141  1.28268811 -0.54524809  0.61696234  2.25183910
 [37]  1.40994182  1.39375413  0.09601487 -1.61487952  0.13866345  0.87411732
 [43] -0.09901415 -2.20313226 -0.57256789 -0.04902186 -0.60666961  1.11230875
 [49] -1.16612178 -1.33729130 -0.87377830 -0.34865716 -0.07942622 -0.30052219
 [55]  1.44263328 -0.62942745 -0.23092436  0.05764731  1.11335377  0.36256049
 [61]  0.14552659  0.76497313  0.67630707  1.50083232  0.79904315  0.70417110
 [67]  0.05148723 -0.85181713 -0.22206479  1.31610297  0.09130591  0.13800069
 [73]  0.46770150  0.36193546  0.97051074  0.61398138 -1.04307247 -0.98605070
 [79]  1.21907337  1.89086531 -0.44347310 -0.73289734 -0.17605875  0.19819328
 [85]  0.59045295 -0.20567335 -0.13131869  0.58356694  1.41190236  0.44295669
 [91]  0.74475897 -1.78547088  0.78582048 -0.72826654  1.44667213 -1.08328743
 [97]  0.26696450 -0.56170130 -0.71022971  1.01388047
> colSums(tmp)
  [1]  1.00763917  1.07669726 -0.34136250  0.40301283 -0.70989952  1.48341727
  [7] -1.55470636 -0.06571761 -0.71800569  0.06683039 -0.53810538 -0.02079210
 [13]  0.19624015  0.62847665 -1.22208929 -0.74878391  1.07360793  0.54265635
 [19] -0.80593260  0.93842491  0.52411779 -1.21842526 -0.20617680 -1.55095322
 [25]  0.18689051 -0.38382633 -0.15727626 -0.74461297 -0.72929942 -1.65905462
 [31]  1.49332151  0.89685141  1.28268811 -0.54524809  0.61696234  2.25183910
 [37]  1.40994182  1.39375413  0.09601487 -1.61487952  0.13866345  0.87411732
 [43] -0.09901415 -2.20313226 -0.57256789 -0.04902186 -0.60666961  1.11230875
 [49] -1.16612178 -1.33729130 -0.87377830 -0.34865716 -0.07942622 -0.30052219
 [55]  1.44263328 -0.62942745 -0.23092436  0.05764731  1.11335377  0.36256049
 [61]  0.14552659  0.76497313  0.67630707  1.50083232  0.79904315  0.70417110
 [67]  0.05148723 -0.85181713 -0.22206479  1.31610297  0.09130591  0.13800069
 [73]  0.46770150  0.36193546  0.97051074  0.61398138 -1.04307247 -0.98605070
 [79]  1.21907337  1.89086531 -0.44347310 -0.73289734 -0.17605875  0.19819328
 [85]  0.59045295 -0.20567335 -0.13131869  0.58356694  1.41190236  0.44295669
 [91]  0.74475897 -1.78547088  0.78582048 -0.72826654  1.44667213 -1.08328743
 [97]  0.26696450 -0.56170130 -0.71022971  1.01388047
> 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]  1.00763917  1.07669726 -0.34136250  0.40301283 -0.70989952  1.48341727
  [7] -1.55470636 -0.06571761 -0.71800569  0.06683039 -0.53810538 -0.02079210
 [13]  0.19624015  0.62847665 -1.22208929 -0.74878391  1.07360793  0.54265635
 [19] -0.80593260  0.93842491  0.52411779 -1.21842526 -0.20617680 -1.55095322
 [25]  0.18689051 -0.38382633 -0.15727626 -0.74461297 -0.72929942 -1.65905462
 [31]  1.49332151  0.89685141  1.28268811 -0.54524809  0.61696234  2.25183910
 [37]  1.40994182  1.39375413  0.09601487 -1.61487952  0.13866345  0.87411732
 [43] -0.09901415 -2.20313226 -0.57256789 -0.04902186 -0.60666961  1.11230875
 [49] -1.16612178 -1.33729130 -0.87377830 -0.34865716 -0.07942622 -0.30052219
 [55]  1.44263328 -0.62942745 -0.23092436  0.05764731  1.11335377  0.36256049
 [61]  0.14552659  0.76497313  0.67630707  1.50083232  0.79904315  0.70417110
 [67]  0.05148723 -0.85181713 -0.22206479  1.31610297  0.09130591  0.13800069
 [73]  0.46770150  0.36193546  0.97051074  0.61398138 -1.04307247 -0.98605070
 [79]  1.21907337  1.89086531 -0.44347310 -0.73289734 -0.17605875  0.19819328
 [85]  0.59045295 -0.20567335 -0.13131869  0.58356694  1.41190236  0.44295669
 [91]  0.74475897 -1.78547088  0.78582048 -0.72826654  1.44667213 -1.08328743
 [97]  0.26696450 -0.56170130 -0.71022971  1.01388047
> colMin(tmp)
  [1]  1.00763917  1.07669726 -0.34136250  0.40301283 -0.70989952  1.48341727
  [7] -1.55470636 -0.06571761 -0.71800569  0.06683039 -0.53810538 -0.02079210
 [13]  0.19624015  0.62847665 -1.22208929 -0.74878391  1.07360793  0.54265635
 [19] -0.80593260  0.93842491  0.52411779 -1.21842526 -0.20617680 -1.55095322
 [25]  0.18689051 -0.38382633 -0.15727626 -0.74461297 -0.72929942 -1.65905462
 [31]  1.49332151  0.89685141  1.28268811 -0.54524809  0.61696234  2.25183910
 [37]  1.40994182  1.39375413  0.09601487 -1.61487952  0.13866345  0.87411732
 [43] -0.09901415 -2.20313226 -0.57256789 -0.04902186 -0.60666961  1.11230875
 [49] -1.16612178 -1.33729130 -0.87377830 -0.34865716 -0.07942622 -0.30052219
 [55]  1.44263328 -0.62942745 -0.23092436  0.05764731  1.11335377  0.36256049
 [61]  0.14552659  0.76497313  0.67630707  1.50083232  0.79904315  0.70417110
 [67]  0.05148723 -0.85181713 -0.22206479  1.31610297  0.09130591  0.13800069
 [73]  0.46770150  0.36193546  0.97051074  0.61398138 -1.04307247 -0.98605070
 [79]  1.21907337  1.89086531 -0.44347310 -0.73289734 -0.17605875  0.19819328
 [85]  0.59045295 -0.20567335 -0.13131869  0.58356694  1.41190236  0.44295669
 [91]  0.74475897 -1.78547088  0.78582048 -0.72826654  1.44667213 -1.08328743
 [97]  0.26696450 -0.56170130 -0.71022971  1.01388047
> colMedians(tmp)
  [1]  1.00763917  1.07669726 -0.34136250  0.40301283 -0.70989952  1.48341727
  [7] -1.55470636 -0.06571761 -0.71800569  0.06683039 -0.53810538 -0.02079210
 [13]  0.19624015  0.62847665 -1.22208929 -0.74878391  1.07360793  0.54265635
 [19] -0.80593260  0.93842491  0.52411779 -1.21842526 -0.20617680 -1.55095322
 [25]  0.18689051 -0.38382633 -0.15727626 -0.74461297 -0.72929942 -1.65905462
 [31]  1.49332151  0.89685141  1.28268811 -0.54524809  0.61696234  2.25183910
 [37]  1.40994182  1.39375413  0.09601487 -1.61487952  0.13866345  0.87411732
 [43] -0.09901415 -2.20313226 -0.57256789 -0.04902186 -0.60666961  1.11230875
 [49] -1.16612178 -1.33729130 -0.87377830 -0.34865716 -0.07942622 -0.30052219
 [55]  1.44263328 -0.62942745 -0.23092436  0.05764731  1.11335377  0.36256049
 [61]  0.14552659  0.76497313  0.67630707  1.50083232  0.79904315  0.70417110
 [67]  0.05148723 -0.85181713 -0.22206479  1.31610297  0.09130591  0.13800069
 [73]  0.46770150  0.36193546  0.97051074  0.61398138 -1.04307247 -0.98605070
 [79]  1.21907337  1.89086531 -0.44347310 -0.73289734 -0.17605875  0.19819328
 [85]  0.59045295 -0.20567335 -0.13131869  0.58356694  1.41190236  0.44295669
 [91]  0.74475897 -1.78547088  0.78582048 -0.72826654  1.44667213 -1.08328743
 [97]  0.26696450 -0.56170130 -0.71022971  1.01388047
> colRanges(tmp)
         [,1]     [,2]       [,3]      [,4]       [,5]     [,6]      [,7]
[1,] 1.007639 1.076697 -0.3413625 0.4030128 -0.7098995 1.483417 -1.554706
[2,] 1.007639 1.076697 -0.3413625 0.4030128 -0.7098995 1.483417 -1.554706
            [,8]       [,9]      [,10]      [,11]      [,12]     [,13]
[1,] -0.06571761 -0.7180057 0.06683039 -0.5381054 -0.0207921 0.1962401
[2,] -0.06571761 -0.7180057 0.06683039 -0.5381054 -0.0207921 0.1962401
         [,14]     [,15]      [,16]    [,17]     [,18]      [,19]     [,20]
[1,] 0.6284766 -1.222089 -0.7487839 1.073608 0.5426564 -0.8059326 0.9384249
[2,] 0.6284766 -1.222089 -0.7487839 1.073608 0.5426564 -0.8059326 0.9384249
         [,21]     [,22]      [,23]     [,24]     [,25]      [,26]      [,27]
[1,] 0.5241178 -1.218425 -0.2061768 -1.550953 0.1868905 -0.3838263 -0.1572763
[2,] 0.5241178 -1.218425 -0.2061768 -1.550953 0.1868905 -0.3838263 -0.1572763
         [,28]      [,29]     [,30]    [,31]     [,32]    [,33]      [,34]
[1,] -0.744613 -0.7292994 -1.659055 1.493322 0.8968514 1.282688 -0.5452481
[2,] -0.744613 -0.7292994 -1.659055 1.493322 0.8968514 1.282688 -0.5452481
         [,35]    [,36]    [,37]    [,38]      [,39]    [,40]     [,41]
[1,] 0.6169623 2.251839 1.409942 1.393754 0.09601487 -1.61488 0.1386634
[2,] 0.6169623 2.251839 1.409942 1.393754 0.09601487 -1.61488 0.1386634
         [,42]       [,43]     [,44]      [,45]       [,46]      [,47]    [,48]
[1,] 0.8741173 -0.09901415 -2.203132 -0.5725679 -0.04902186 -0.6066696 1.112309
[2,] 0.8741173 -0.09901415 -2.203132 -0.5725679 -0.04902186 -0.6066696 1.112309
         [,49]     [,50]      [,51]      [,52]       [,53]      [,54]    [,55]
[1,] -1.166122 -1.337291 -0.8737783 -0.3486572 -0.07942622 -0.3005222 1.442633
[2,] -1.166122 -1.337291 -0.8737783 -0.3486572 -0.07942622 -0.3005222 1.442633
          [,56]      [,57]      [,58]    [,59]     [,60]     [,61]     [,62]
[1,] -0.6294274 -0.2309244 0.05764731 1.113354 0.3625605 0.1455266 0.7649731
[2,] -0.6294274 -0.2309244 0.05764731 1.113354 0.3625605 0.1455266 0.7649731
         [,63]    [,64]     [,65]     [,66]      [,67]      [,68]      [,69]
[1,] 0.6763071 1.500832 0.7990431 0.7041711 0.05148723 -0.8518171 -0.2220648
[2,] 0.6763071 1.500832 0.7990431 0.7041711 0.05148723 -0.8518171 -0.2220648
        [,70]      [,71]     [,72]     [,73]     [,74]     [,75]     [,76]
[1,] 1.316103 0.09130591 0.1380007 0.4677015 0.3619355 0.9705107 0.6139814
[2,] 1.316103 0.09130591 0.1380007 0.4677015 0.3619355 0.9705107 0.6139814
         [,77]      [,78]    [,79]    [,80]      [,81]      [,82]      [,83]
[1,] -1.043072 -0.9860507 1.219073 1.890865 -0.4434731 -0.7328973 -0.1760588
[2,] -1.043072 -0.9860507 1.219073 1.890865 -0.4434731 -0.7328973 -0.1760588
         [,84]    [,85]      [,86]      [,87]     [,88]    [,89]     [,90]
[1,] 0.1981933 0.590453 -0.2056734 -0.1313187 0.5835669 1.411902 0.4429567
[2,] 0.1981933 0.590453 -0.2056734 -0.1313187 0.5835669 1.411902 0.4429567
        [,91]     [,92]     [,93]      [,94]    [,95]     [,96]     [,97]
[1,] 0.744759 -1.785471 0.7858205 -0.7282665 1.446672 -1.083287 0.2669645
[2,] 0.744759 -1.785471 0.7858205 -0.7282665 1.446672 -1.083287 0.2669645
          [,98]      [,99]  [,100]
[1,] -0.5617013 -0.7102297 1.01388
[2,] -0.5617013 -0.7102297 1.01388
> 
> 
> Max(tmp2)
[1] 2.70061
> Min(tmp2)
[1] -1.999105
> mean(tmp2)
[1] -0.003165425
> Sum(tmp2)
[1] -0.3165425
> Var(tmp2)
[1] 0.9801988
> 
> rowMeans(tmp2)
  [1]  0.019660721 -1.925379655 -0.491476195  0.181533580  0.674120441
  [6] -0.087523100 -0.907676805  1.874089013  0.753805793  1.145234709
 [11]  0.463751086  1.264700177 -0.691085426 -0.625163075  0.566421617
 [16]  0.428631654 -1.006596573 -0.357319302  1.512887038  0.002342968
 [21]  0.356861985  0.596270355 -0.679671983  2.109319826 -0.402050528
 [26] -0.943817642  1.312445755  0.606281576 -0.220610605 -0.287225968
 [31]  0.118073034  0.392404409  0.793926624  0.933581430  0.766228906
 [36]  0.616371161  1.968019423  0.060222461 -1.602122416  0.468064103
 [41]  2.390125614 -1.999104793 -0.641732144  0.626656768  1.789176310
 [46] -0.530633273 -0.372490266  0.811838347  2.700610468 -0.502531322
 [51] -0.920094532  0.597986028 -0.137000073 -1.201178330  0.715993060
 [56] -1.504572174  0.482601321 -0.335598888  1.045111021 -0.764719076
 [61] -1.699255149  0.573328216 -1.231260353  0.404321264  0.841605364
 [66] -0.071483529  0.870295160 -1.478173707  0.685726515 -0.062282770
 [71] -0.025891006 -0.832126475  1.247890953 -1.253510316 -1.104333220
 [76] -0.623911216 -0.066164782  0.348870138  0.240700956 -1.135729567
 [81] -1.087092640 -0.255659556  0.004314724 -1.342181429  0.249127767
 [86] -1.853678379  0.340922208  1.341634186 -0.256246582 -1.051523613
 [91] -1.593891995 -0.088728386 -1.457343251 -0.168310443 -0.318300303
 [96]  0.611951790  0.057730641 -0.848999859 -0.617773953  0.380915412
> rowSums(tmp2)
  [1]  0.019660721 -1.925379655 -0.491476195  0.181533580  0.674120441
  [6] -0.087523100 -0.907676805  1.874089013  0.753805793  1.145234709
 [11]  0.463751086  1.264700177 -0.691085426 -0.625163075  0.566421617
 [16]  0.428631654 -1.006596573 -0.357319302  1.512887038  0.002342968
 [21]  0.356861985  0.596270355 -0.679671983  2.109319826 -0.402050528
 [26] -0.943817642  1.312445755  0.606281576 -0.220610605 -0.287225968
 [31]  0.118073034  0.392404409  0.793926624  0.933581430  0.766228906
 [36]  0.616371161  1.968019423  0.060222461 -1.602122416  0.468064103
 [41]  2.390125614 -1.999104793 -0.641732144  0.626656768  1.789176310
 [46] -0.530633273 -0.372490266  0.811838347  2.700610468 -0.502531322
 [51] -0.920094532  0.597986028 -0.137000073 -1.201178330  0.715993060
 [56] -1.504572174  0.482601321 -0.335598888  1.045111021 -0.764719076
 [61] -1.699255149  0.573328216 -1.231260353  0.404321264  0.841605364
 [66] -0.071483529  0.870295160 -1.478173707  0.685726515 -0.062282770
 [71] -0.025891006 -0.832126475  1.247890953 -1.253510316 -1.104333220
 [76] -0.623911216 -0.066164782  0.348870138  0.240700956 -1.135729567
 [81] -1.087092640 -0.255659556  0.004314724 -1.342181429  0.249127767
 [86] -1.853678379  0.340922208  1.341634186 -0.256246582 -1.051523613
 [91] -1.593891995 -0.088728386 -1.457343251 -0.168310443 -0.318300303
 [96]  0.611951790  0.057730641 -0.848999859 -0.617773953  0.380915412
> 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.019660721 -1.925379655 -0.491476195  0.181533580  0.674120441
  [6] -0.087523100 -0.907676805  1.874089013  0.753805793  1.145234709
 [11]  0.463751086  1.264700177 -0.691085426 -0.625163075  0.566421617
 [16]  0.428631654 -1.006596573 -0.357319302  1.512887038  0.002342968
 [21]  0.356861985  0.596270355 -0.679671983  2.109319826 -0.402050528
 [26] -0.943817642  1.312445755  0.606281576 -0.220610605 -0.287225968
 [31]  0.118073034  0.392404409  0.793926624  0.933581430  0.766228906
 [36]  0.616371161  1.968019423  0.060222461 -1.602122416  0.468064103
 [41]  2.390125614 -1.999104793 -0.641732144  0.626656768  1.789176310
 [46] -0.530633273 -0.372490266  0.811838347  2.700610468 -0.502531322
 [51] -0.920094532  0.597986028 -0.137000073 -1.201178330  0.715993060
 [56] -1.504572174  0.482601321 -0.335598888  1.045111021 -0.764719076
 [61] -1.699255149  0.573328216 -1.231260353  0.404321264  0.841605364
 [66] -0.071483529  0.870295160 -1.478173707  0.685726515 -0.062282770
 [71] -0.025891006 -0.832126475  1.247890953 -1.253510316 -1.104333220
 [76] -0.623911216 -0.066164782  0.348870138  0.240700956 -1.135729567
 [81] -1.087092640 -0.255659556  0.004314724 -1.342181429  0.249127767
 [86] -1.853678379  0.340922208  1.341634186 -0.256246582 -1.051523613
 [91] -1.593891995 -0.088728386 -1.457343251 -0.168310443 -0.318300303
 [96]  0.611951790  0.057730641 -0.848999859 -0.617773953  0.380915412
> rowMin(tmp2)
  [1]  0.019660721 -1.925379655 -0.491476195  0.181533580  0.674120441
  [6] -0.087523100 -0.907676805  1.874089013  0.753805793  1.145234709
 [11]  0.463751086  1.264700177 -0.691085426 -0.625163075  0.566421617
 [16]  0.428631654 -1.006596573 -0.357319302  1.512887038  0.002342968
 [21]  0.356861985  0.596270355 -0.679671983  2.109319826 -0.402050528
 [26] -0.943817642  1.312445755  0.606281576 -0.220610605 -0.287225968
 [31]  0.118073034  0.392404409  0.793926624  0.933581430  0.766228906
 [36]  0.616371161  1.968019423  0.060222461 -1.602122416  0.468064103
 [41]  2.390125614 -1.999104793 -0.641732144  0.626656768  1.789176310
 [46] -0.530633273 -0.372490266  0.811838347  2.700610468 -0.502531322
 [51] -0.920094532  0.597986028 -0.137000073 -1.201178330  0.715993060
 [56] -1.504572174  0.482601321 -0.335598888  1.045111021 -0.764719076
 [61] -1.699255149  0.573328216 -1.231260353  0.404321264  0.841605364
 [66] -0.071483529  0.870295160 -1.478173707  0.685726515 -0.062282770
 [71] -0.025891006 -0.832126475  1.247890953 -1.253510316 -1.104333220
 [76] -0.623911216 -0.066164782  0.348870138  0.240700956 -1.135729567
 [81] -1.087092640 -0.255659556  0.004314724 -1.342181429  0.249127767
 [86] -1.853678379  0.340922208  1.341634186 -0.256246582 -1.051523613
 [91] -1.593891995 -0.088728386 -1.457343251 -0.168310443 -0.318300303
 [96]  0.611951790  0.057730641 -0.848999859 -0.617773953  0.380915412
> 
> colMeans(tmp2)
[1] -0.003165425
> colSums(tmp2)
[1] -0.3165425
> colVars(tmp2)
[1] 0.9801988
> colSd(tmp2)
[1] 0.9900499
> colMax(tmp2)
[1] 2.70061
> colMin(tmp2)
[1] -1.999105
> colMedians(tmp2)
[1] -0.01177402
> colRanges(tmp2)
          [,1]
[1,] -1.999105
[2,]  2.700610
> 
> 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]  6.2319760 -0.4999891  0.1654278 -3.8042033  3.3222517 -1.4816307
 [7]  7.9532431 -3.0085265  1.5953430 -0.5263907
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -1.5184876
[2,]  0.2816250
[3,]  0.8630321
[4,]  1.1832075
[5,]  1.7645755
> 
> rowApply(tmp,sum)
 [1]  2.4263974 -1.7873189  0.9147226 -1.8331531  1.1344630  4.3840639
 [7] -1.3713852 -0.7627667  4.6545347  2.1879433
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]   10    1    7    9    6   10    8    8    9     6
 [2,]    3    2    4    6    8    3    4    9    6     2
 [3,]    6    5    2    7    3    6    9    7    5     5
 [4,]    1    4    3    5    5    4    2    6    3     7
 [5,]    7   10    8    1   10    8    6    2   10     1
 [6,]    5    7    9    2    1    2    5    4    7     3
 [7,]    8    9    5    8    9    9    3   10    4     8
 [8,]    2    8    1    4    7    1   10    3    2     9
 [9,]    9    3   10   10    4    5    1    5    8     4
[10,]    4    6    6    3    2    7    7    1    1    10
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1]  1.5580459 -0.8103991  2.2633556 -1.4475412 -7.6385708  1.9263003
 [7] -0.7367413  2.3384540  0.9271905  1.1013819 -0.3868619  1.0358031
[13]  1.4918358 -5.1312933  2.6362911 -1.8784513  3.8484797  0.3262992
[19]  0.4942619  0.3405733
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -0.7138458
[2,] -0.2745954
[3,]  0.4351908
[4,]  0.7417607
[5,]  1.3695356
> 
> rowApply(tmp,sum)
[1]   7.319745  -1.823083   1.665797   5.868394 -10.772440
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]   15   14   19    2   11
[2,]    2   11   12    9    7
[3,]   16   13    2   19   12
[4,]   17    3   11    3    9
[5,]    1    1    3    4    2
> 
> 
> as.matrix(tmp)
           [,1]        [,2]       [,3]       [,4]       [,5]       [,6]
[1,]  0.7417607 -0.52304715  0.9162633  0.9533352 -1.9367354  0.1831880
[2,]  0.4351908  0.17636398  0.3748213 -1.2448017 -2.6736873  0.6063188
[3,]  1.3695356  0.54363844 -1.1825921  0.1213598 -0.9068081  0.6650629
[4,] -0.7138458  0.01279608  2.3885731 -0.5775407 -0.1597569 -0.1262189
[5,] -0.2745954 -1.02015048 -0.2337099 -0.6998938 -1.9615830  0.5979495
           [,7]        [,8]       [,9]      [,10]       [,11]       [,12]
[1,]  0.6532071 -0.24726268  0.5284063  0.7017268  1.74042233  1.36118297
[2,]  0.1123146  1.24958535 -0.4454856  0.5558552 -0.11492849  0.17140773
[3,] -0.7048241  0.80231777  2.0715980  1.1390266 -0.36328367 -0.41359943
[4,] -1.4785376  0.09639467  0.4906136  0.1429242 -0.07638281  0.01127545
[5,]  0.6810986  0.43741888 -1.7179417 -1.4381509 -1.57268925 -0.09446363
          [,13]      [,14]      [,15]      [,16]      [,17]       [,18]
[1,]  0.6900609  0.1747621 -0.2776929  0.3973195  0.2059789  1.35032255
[2,]  0.6846637 -2.3315773  0.7050218 -0.6637013  0.7324239 -0.21239239
[3,] -0.4409663 -2.3182850  0.5456558  0.5693394 -0.5146193  0.04163948
[4,]  0.5994806  0.1444465  0.6323462 -0.1509358  3.0846915  0.28409336
[5,] -0.0414031 -0.8006396  1.0309602 -2.0304731  0.3400046 -1.13736377
          [,19]      [,20]
[1,] -0.5054973  0.2120443
[2,]  0.3125461 -0.2530218
[3,] -0.1546200  0.7962215
[4,]  1.0227671  0.2412099
[5,] -0.1809340 -0.6558806
> 
> 
> 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 :  566  bytes.
Disk usage :  160  bytes.
> subBufferedMatrix(tmp,1:3,)
BufferedMatrix object
Matrix size:  3 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  480  bytes.
> 
> 
> rm(tmp)
> 
> 
> ###
> ### Testing colnames and rownames
> ###
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> 
> 
> colnames(tmp)
NULL
> rownames(tmp)
NULL
> 
> 
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> colnames(tmp)
 [1] "col1"  "col2"  "col3"  "col4"  "col5"  "col6"  "col7"  "col8"  "col9" 
[10] "col10" "col11" "col12" "col13" "col14" "col15" "col16" "col17" "col18"
[19] "col19" "col20"
> rownames(tmp)
[1] "row1" "row2" "row3" "row4" "row5"
> 
> 
> tmp["row1",]
         col1      col2      col3      col4       col5       col6     col7
row1 0.515337 0.4308944 -1.260476 0.4327492 -0.9597087 -0.1856158 -1.43452
           col8      col9     col10     col11    col12      col13   col14
row1 -0.8745552 0.6726356 0.3223861 0.2744434 1.100095 -0.5020043 1.56705
          col15     col16     col17     col18     col19     col20
row1 -0.1458769 0.1061015 0.4228634 -2.725296 0.5645891 -1.171885
> tmp[,"col10"]
          col10
row1  0.3223861
row2  2.0505975
row3  0.9800913
row4 -0.3484856
row5 -1.4166815
> tmp[c("row1","row5"),]
          col1      col2       col3       col4       col5       col6       col7
row1  0.515337 0.4308944 -1.2604756  0.4327492 -0.9597087 -0.1856158 -1.4345202
row5 -1.338166 0.2386265 -0.6955553 -1.0175589  0.0073683 -1.9183800  0.9573566
           col8      col9      col10     col11    col12       col13    col14
row1 -0.8745552 0.6726356  0.3223861 0.2744434 1.100095 -0.50200426 1.567050
row5 -0.8252902 1.2080754 -1.4166815 0.2204860 2.001163 -0.01982465 2.375588
          col15     col16     col17      col18      col19      col20
row1 -0.1458769 0.1061015 0.4228634 -2.7252963  0.5645891 -1.1718847
row5 -1.5416791 1.1721191 0.0858171 -0.5790563 -0.5846066 -0.5464013
> tmp[,c("col6","col20")]
           col6       col20
row1 -0.1856158 -1.17188469
row2  0.4746812 -0.23977923
row3  0.4631874  1.34208289
row4 -1.3651710  0.02085164
row5 -1.9183800 -0.54640129
> tmp[c("row1","row5"),c("col6","col20")]
           col6      col20
row1 -0.1856158 -1.1718847
row5 -1.9183800 -0.5464013
> 
> 
> 
> 
> tmp["row1",] <- rnorm(20,mean=10)
> tmp[,"col10"] <- rnorm(5,mean=30)
> tmp[c("row1","row5"),] <- rnorm(40,mean=50)
> tmp[,c("col6","col20")] <- rnorm(10,mean=75)
> tmp[c("row1","row5"),c("col6","col20")]  <- rnorm(4,mean=105)
> 
> tmp["row1",]
         col1     col2     col3     col4     col5    col6     col7     col8
row1 50.11032 49.81959 50.39714 49.41383 49.09148 105.062 48.87968 51.13927
         col9    col10    col11    col12    col13   col14    col15   col16
row1 50.93375 49.02323 50.13294 51.73588 50.98682 50.6298 49.78562 50.8913
        col17    col18    col19    col20
row1 47.14314 49.40915 49.72588 104.0082
> tmp[,"col10"]
        col10
row1 49.02323
row2 30.13802
row3 29.63174
row4 30.56264
row5 49.58704
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5    col6     col7     col8
row1 50.11032 49.81959 50.39714 49.41383 49.09148 105.062 48.87968 51.13927
row5 49.70216 48.12937 49.00691 49.01576 51.30193 104.686 49.13516 48.58876
         col9    col10    col11    col12    col13    col14    col15    col16
row1 50.93375 49.02323 50.13294 51.73588 50.98682 50.62980 49.78562 50.89130
row5 49.64276 49.58704 51.33756 48.75291 50.54674 50.77079 49.12088 50.17833
        col17    col18    col19    col20
row1 47.14314 49.40915 49.72588 104.0082
row5 48.28756 51.03124 47.75705 105.2943
> tmp[,c("col6","col20")]
          col6     col20
row1 105.06201 104.00822
row2  76.71812  76.34389
row3  75.55975  76.35494
row4  75.27075  75.56461
row5 104.68597 105.29429
> tmp[c("row1","row5"),c("col6","col20")]
        col6    col20
row1 105.062 104.0082
row5 104.686 105.2943
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
        col6    col20
row1 105.062 104.0082
row5 104.686 105.2943
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
          col13
[1,] -0.1349223
[2,] -0.8107646
[3,]  0.6437932
[4,] -0.4958232
[5,] -0.5824259
> tmp[,c("col17","col7")]
          col17       col7
[1,] -0.4849589  0.9836654
[2,] -0.7349212  0.7279797
[3,]  1.2907767 -0.3134259
[4,] -0.2321583  0.4463826
[5,] -0.5139621  2.0948105
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
             col6      col20
[1,]  1.488146427 -1.1054226
[2,] -0.908071194  0.4090370
[3,] -0.536336227  0.2871904
[4,] -1.098042928 -0.5552872
[5,]  0.004296472  0.5898886
> subBufferedMatrix(tmp,1,c("col6"))[,1]
         col1
[1,] 1.488146
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
           col6
[1,]  1.4881464
[2,] -0.9080712
> 
> 
> 
> 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 1.2220194 0.3860191 -0.3115554 -2.1015732 0.2048140 -0.8097535 0.2467580
row1 0.1113325 1.3146068 -0.2285350  0.5808862 0.1013944  0.1838219 0.2648839
         [,8]      [,9]      [,10]      [,11]      [,12]     [,13]     [,14]
row3 0.477577 0.2031745 -1.0280088  0.7406032  0.2912364 1.2544422 1.7658114
row1 1.962282 0.8222981 -0.7479693 -0.5955601 -0.6900305 0.3909673 0.9264651
          [,15]     [,16]     [,17]      [,18]     [,19]     [,20]
row3 -0.4378920 0.2723632  1.799403 -0.9514113  1.803935 0.6755281
row1  0.4017267 0.4718070 -1.054350 -1.1443232 -1.305778 0.3845092
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
          [,1]      [,2]      [,3]     [,4]       [,5]    [,6]      [,7]
row2 -0.915918 -1.482271 0.7964087 0.201773 -0.8655792 1.49004 -0.637129
           [,8]       [,9]      [,10]
row2 -0.5399102 -0.1523816 -0.6762255
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
           [,1]       [,2]      [,3]      [,4]       [,5]       [,6]      [,7]
row5 -0.9325803 0.01261116 0.8769483 -1.808967 -0.5890804 -0.2253545 0.4769261
         [,8]       [,9]       [,10]      [,11]     [,12]     [,13]     [,14]
row5 1.602294 -0.1070988 -0.08347941 -0.7945733 -1.257866 -1.406751 0.4731167
          [,15]     [,16]    [,17]    [,18]       [,19]     [,20]
row5 -0.4798662 -0.734975 1.602066 1.271247 0.004738099 0.9053369
> 
> 
> 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: 0x1f107ae0>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM1ac0a17615d58c"
 [2] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM1ac0a1226c2a50"
 [3] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM1ac0a163bb2a0b"
 [4] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM1ac0a110744169"
 [5] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM1ac0a12fb2497b"
 [6] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM1ac0a12106d673"
 [7] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM1ac0a17e8e9b3d"
 [8] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM1ac0a127e8eb4f"
 [9] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM1ac0a12f458030"
[10] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM1ac0a139c1b85" 
[11] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM1ac0a15ac88cf9"
[12] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM1ac0a115544de4"
[13] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM1ac0a14fc5b16c"
[14] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM1ac0a175d41b65"
[15] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM1ac0a11110d932"
> 
> 
> ### 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: 0x1e3412a0>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x1e3412a0>
Warning message:
In dir.create(new.directory) :
  '/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x1e3412a0>
> rowMedians(tmp)
  [1]  0.664000857 -0.013448657  0.088069999 -0.085538967  0.112468884
  [6] -0.393295698 -0.089832111  0.162674318 -0.099221250  0.606644187
 [11] -0.435270914  0.638639020 -0.088857535 -0.172276605  0.491215904
 [16]  0.062922608  0.035728403 -0.257415346  0.302997259 -0.136098856
 [21]  0.249787481  0.182739478 -0.182392258  0.026859611 -0.042285784
 [26]  0.200765156  0.169103504 -0.235827055  0.401861319 -0.124961305
 [31] -0.497203418 -0.086631022  0.226766326 -0.506968784  0.326317465
 [36]  0.209053123 -0.061862766  0.212555736  0.178078561 -0.353998386
 [41] -0.443713840 -0.692418657 -0.733453060 -0.123693251 -0.071020446
 [46] -0.085008485 -0.123729205  0.125618928  0.502904991  0.056967598
 [51] -0.513327697 -0.209273759 -0.453931882  0.351742424  0.517354586
 [56] -0.241662582 -0.141913959  0.047630328  0.100686367 -0.457982173
 [61]  0.162073372 -0.632526773  0.185978328 -0.232188132 -0.245749688
 [66]  0.317652231 -0.365137817 -0.423407401  0.785666952  0.107618863
 [71]  0.098260109  0.371848013  0.006919408  0.565463956 -0.062938184
 [76]  0.089346593 -0.123482027  0.029539724 -0.101461482 -0.285372119
 [81] -0.268883393 -0.343390125 -0.502474402 -0.161006729 -0.082109152
 [86]  0.321321003  0.052318160  0.404413297 -0.256355954  0.022945010
 [91]  0.309858407 -0.716414862 -0.092061093 -0.123388756  0.118514627
 [96]  0.396143472  0.183224199  0.209188872 -0.493062768 -0.321647702
[101]  0.190449928 -0.548097032 -0.712972397  0.238400063  0.049650147
[106] -0.439841794 -0.006936147  0.169290383  0.388624505 -0.037091765
[111] -0.422921417  0.063255261  0.358112993  0.298671677 -0.086148802
[116]  0.162157929 -0.035054040  0.004440633 -0.426990151  0.183805582
[121]  0.231874341  0.396152336 -0.015443164 -0.518537494  0.495994820
[126]  0.032742061 -0.099212627 -0.241091072  0.355664839  0.302931146
[131]  0.129403776 -0.091273455 -0.003534595 -0.390540333  0.229739532
[136] -0.071429360 -0.129837874 -0.204393355 -0.146872904 -0.130381407
[141]  0.169297969 -0.548685719 -0.075237048 -0.023216517 -0.178683185
[146] -0.031596301 -0.539725382 -0.331403978  0.115809028  0.013705437
[151] -0.063971365  0.008485338 -0.119845187 -0.074882578  0.528534078
[156]  0.138893475  0.002354914  0.772670658  0.207212345  0.005838561
[161] -0.009600682  0.495805479 -0.268301735  0.061567547 -0.104395439
[166]  0.175877692 -0.421369641  0.169150041  0.140440892 -0.257257869
[171]  0.190694386 -0.042567558  0.402754654  0.151571205  0.258559514
[176] -0.100977741  0.137354671 -0.235193991 -0.086102979  0.102891046
[181] -0.327258067 -0.068929467  0.016261409 -0.318757790 -0.579474644
[186] -0.040114075 -0.260023856 -0.112788717  0.302518741  0.359842005
[191]  0.407510865  0.218500426  0.089025680  0.078433087  0.284648272
[196]  0.164229409  0.240781749  0.320838917 -0.602680620 -0.108101164
[201]  0.612429228  0.671443344 -0.198649781  0.374780015  0.887744820
[206]  0.222204981  0.192402148  0.686134703 -0.806733577  0.217948180
[211]  0.113227458  0.520218104 -0.097534090 -0.309812739  0.354567042
[216]  0.437572305 -0.068435179  0.243794601  0.036966227  0.060559775
[221]  0.583220937 -0.522165366 -0.164662010 -0.074388400  0.543810134
[226] -0.013157327  0.117768037  0.361617579  0.559897708  0.276476732
> 
> proc.time()
   user  system elapsed 
  1.854   0.871   2.751 

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: 0x3b8f0ff0>
> .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: 0x3b8f0ff0>
> .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: 0x3b8f0ff0>
> .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: 0x3b8f0ff0>
> 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: 0x3b7d60e0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x3b7d60e0>
> .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: 0x3b7d60e0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x3b7d60e0>
> .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: 0x3b7d60e0>
> 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: 0x3a75d520>
> .Call("R_bm_AddColumn",P)
<pointer: 0x3a75d520>
> .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: 0x3a75d520>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x3a75d520>
> .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: 0x3a75d520>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x3a75d520>
> .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: 0x3a75d520>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x3a75d520>
> .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: 0x3a75d520>
> 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: 0x3a161720>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x3a161720>
> .Call("R_bm_AddColumn",P)
<pointer: 0x3a161720>
> .Call("R_bm_AddColumn",P)
<pointer: 0x3a161720>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile1ac0bd35e6b8f1" "BufferedMatrixFile1ac0bd4878086e"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile1ac0bd35e6b8f1" "BufferedMatrixFile1ac0bd4878086e"
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x3b0517d0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x3b0517d0>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x3b0517d0>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x3b0517d0>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x3b0517d0>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x3b0517d0>
> .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: 0x3b158c90>
> .Call("R_bm_AddColumn",P)
<pointer: 0x3b158c90>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x3b158c90>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x3b158c90>
> 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: 0x3c401110>
> .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: 0x3c401110>
> rm(P)
> 
> proc.time()
   user  system elapsed 
  0.349   0.019   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.329   0.048   0.362 

Example timings