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

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

HostnameOSArch (*)R versionInstalled pkgs
nebbiolo2Linux (Ubuntu 24.04.3 LTS)x86_644.5.1 Patched (2025-08-23 r88802) -- "Great Square Root" 4864
lconwaymacOS 12.7.1 Montereyx86_644.5.1 Patched (2025-09-10 r88807) -- "Great Square Root" 4652
kjohnson3macOS 13.7.7 Venturaarm644.5.1 Patched (2025-09-10 r88807) -- "Great Square Root" 4597
taishanLinux (openEuler 24.03 LTS)aarch644.5.0 (2025-04-11) -- "How About a Twenty-Six" 4586
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 255/2346HostnameOS / ArchINSTALLBUILDCHECKBUILD BIN
BufferedMatrix 1.73.0  (landing page)
Ben Bolstad
Snapshot Date: 2025-10-10 13:45 -0400 (Fri, 10 Oct 2025)
git_url: https://git.bioconductor.org/packages/BufferedMatrix
git_branch: devel
git_last_commit: 0147962
git_last_commit_date: 2025-04-15 09:39:39 -0400 (Tue, 15 Apr 2025)
nebbiolo2Linux (Ubuntu 24.04.3 LTS) / x86_64  OK    OK    OK  UNNEEDED, same version is already published
lconwaymacOS 12.7.1 Monterey / x86_64  OK    OK    WARNINGS    OK  UNNEEDED, same version is already published
kjohnson3macOS 13.7.7 Ventura / arm64  OK    OK    WARNINGS    OK  UNNEEDED, same version is already published
taishanLinux (openEuler 24.03 LTS) / aarch64  OK    OK    OK  


CHECK results for BufferedMatrix on lconway

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

raw results


Summary

Package: BufferedMatrix
Version: 1.73.0
Command: /Library/Frameworks/R.framework/Resources/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/Library/Frameworks/R.framework/Resources/library --no-vignettes --timings BufferedMatrix_1.73.0.tar.gz
StartedAt: 2025-10-10 20:25:41 -0400 (Fri, 10 Oct 2025)
EndedAt: 2025-10-10 20:26:32 -0400 (Fri, 10 Oct 2025)
EllapsedTime: 50.6 seconds
RetCode: 0
Status:   WARNINGS  
CheckDir: BufferedMatrix.Rcheck
Warnings: 1

Command output

##############################################################################
##############################################################################
###
### Running command:
###
###   /Library/Frameworks/R.framework/Resources/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/Library/Frameworks/R.framework/Resources/library --no-vignettes --timings BufferedMatrix_1.73.0.tar.gz
###
##############################################################################
##############################################################################


* using log directory ‘/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck’
* using R version 4.5.1 Patched (2025-09-10 r88807)
* using platform: x86_64-apple-darwin20
* R was compiled by
    Apple clang version 14.0.0 (clang-1400.0.29.202)
    GNU Fortran (GCC) 14.2.0
* running under: macOS Monterey 12.7.6
* using session charset: UTF-8
* using option ‘--no-vignettes’
* checking for file ‘BufferedMatrix/DESCRIPTION’ ... OK
* this is package ‘BufferedMatrix’ version ‘1.73.0’
* checking package namespace information ... OK
* checking package dependencies ... OK
* checking if this is a source package ... OK
* checking if there is a namespace ... OK
* checking for hidden files and directories ... OK
* checking for portable file names ... OK
* checking for sufficient/correct file permissions ... OK
* checking whether package ‘BufferedMatrix’ can be installed ... WARNING
Found the following significant warnings:
  doubleBufferedMatrix.c:1580:7: warning: logical not is only applied to the left hand side of this bitwise operator [-Wlogical-not-parentheses]
See ‘/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/00install.out’ for details.
* used C compiler: ‘Apple clang version 14.0.0 (clang-1400.0.29.202)’
* used SDK: ‘MacOSX11.3.1.sdk’
* 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 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 sizes of PDF files under ‘inst/doc’ ... OK
* 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: 1 WARNING, 2 NOTEs
See
  ‘/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/00check.log’
for details.


Installation output

BufferedMatrix.Rcheck/00install.out

##############################################################################
##############################################################################
###
### Running command:
###
###   /Library/Frameworks/R.framework/Resources/bin/R CMD INSTALL BufferedMatrix
###
##############################################################################
##############################################################################


* installing to library ‘/Library/Frameworks/R.framework/Versions/4.5-x86_64/Resources/library’
* installing *source* package ‘BufferedMatrix’ ...
** this is package ‘BufferedMatrix’ version ‘1.73.0’
** using staged installation
** libs
using C compiler: ‘Apple clang version 14.0.0 (clang-1400.0.29.202)’
using SDK: ‘MacOSX11.3.1.sdk’
clang -arch x86_64 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/opt/R/x86_64/include    -fPIC  -falign-functions=64 -Wall -g -O2  -c RBufferedMatrix.c -o RBufferedMatrix.o
clang -arch x86_64 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/opt/R/x86_64/include    -fPIC  -falign-functions=64 -Wall -g -O2  -c doubleBufferedMatrix.c -o doubleBufferedMatrix.o
doubleBufferedMatrix.c:1580:7: warning: logical not is only applied to the left hand side of this bitwise operator [-Wlogical-not-parentheses]
  if (!(Matrix->readonly) & setting){
      ^                   ~
doubleBufferedMatrix.c:1580:7: note: add parentheses after the '!' to evaluate the bitwise operator first
  if (!(Matrix->readonly) & setting){
      ^
       (                           )
doubleBufferedMatrix.c:1580:7: note: add parentheses around left hand side expression to silence this warning
  if (!(Matrix->readonly) & setting){
      ^
      (                  )
doubleBufferedMatrix.c:3327:12: warning: unused function 'sort_double' [-Wunused-function]
static int sort_double(const double *a1,const double *a2){
           ^
2 warnings generated.
clang -arch x86_64 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/opt/R/x86_64/include    -fPIC  -falign-functions=64 -Wall -g -O2  -c doubleBufferedMatrix_C_tests.c -o doubleBufferedMatrix_C_tests.o
clang -arch x86_64 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/opt/R/x86_64/include    -fPIC  -falign-functions=64 -Wall -g -O2  -c init_package.c -o init_package.o
clang -arch x86_64 -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -L/Library/Frameworks/R.framework/Resources/lib -L/opt/R/x86_64/lib -o BufferedMatrix.so RBufferedMatrix.o doubleBufferedMatrix.o doubleBufferedMatrix_C_tests.o init_package.o -F/Library/Frameworks/R.framework/.. -framework R
installing to /Library/Frameworks/R.framework/Versions/4.5-x86_64/Resources/library/00LOCK-BufferedMatrix/00new/BufferedMatrix/libs
** R
** inst
** byte-compile and prepare package for lazy loading
Creating a new generic function for ‘rowMeans’ in package ‘BufferedMatrix’
Creating a new generic function for ‘rowSums’ in package ‘BufferedMatrix’
Creating a new generic function for ‘colMeans’ in package ‘BufferedMatrix’
Creating a new generic function for ‘colSums’ in package ‘BufferedMatrix’
Creating a generic function for ‘ncol’ from package ‘base’ in package ‘BufferedMatrix’
Creating a generic function for ‘nrow’ from package ‘base’ in package ‘BufferedMatrix’
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
** checking absolute paths in shared objects and dynamic libraries
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (BufferedMatrix)

Tests output

BufferedMatrix.Rcheck/tests/c_code_level_tests.Rout


R version 4.5.1 Patched (2025-09-10 r88807) -- "Great Square Root"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: x86_64-apple-darwin20

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.374   0.166   0.554 

BufferedMatrix.Rcheck/tests/objectTesting.Rout


R version 4.5.1 Patched (2025-09-10 r88807) -- "Great Square Root"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: x86_64-apple-darwin20

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] "/Users/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) limit (Mb) max used (Mb)
Ncells 480848 25.7    1056620 56.5         NA   634462 33.9
Vcells 891079  6.8    8388608 64.0      98304  2108714 16.1
> 
> 
> 
> 
> ##
> ## checking reads
> ##
> 
> tmp2 <- createBufferedMatrix(10,20)
> 
> test.sample <- rnorm(10*20)
> 
> tmp2[1:10,1:20] <- test.sample
> 
> test.matrix <- matrix(test.sample,10,20)
> 
> ## testing reads
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   which.col <- sample(1:20,1)
+   if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> date()
[1] "Fri Oct 10 20:26:06 2025"
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> date()
[1] "Fri Oct 10 20:26:06 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: 0x6000012ac000>
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   which.col <- sample(1:20,1)
+   if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,5,replace=TRUE)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> date()
[1] "Fri Oct 10 20:26:10 2025"
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col <- sample(1:20,5,replace=TRUE)
+   if (!all(tmp2[which.row,which.col] == test.matrix[which.row,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> date()
[1] "Fri Oct 10 20:26:12 2025"
> 
> ColMode(tmp2)
<pointer: 0x6000012ac000>
> 
> 
> 
> ### 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.054492161 -2.2055563  1.02042638 -0.4326305
[2,]  -0.001394229  0.6393145  0.65209975  0.4051067
[3,]   1.090442903 -1.2408841  0.08846564 -1.8860308
[4,]  -0.658228595 -0.2866305 -0.19753066 -0.4532851
> ewApply(tmp5,abs)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
             [,1]      [,2]       [,3]      [,4]
[1,] 1.000545e+02 2.2055563 1.02042638 0.4326305
[2,] 1.394229e-03 0.6393145 0.65209975 0.4051067
[3,] 1.090443e+00 1.2408841 0.08846564 1.8860308
[4,] 6.582286e-01 0.2866305 0.19753066 0.4532851
> ewApply(tmp5,sqrt)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
            [,1]      [,2]      [,3]      [,4]
[1,] 10.00272424 1.4851116 1.0101616 0.6577465
[2,]  0.03733937 0.7995714 0.8075269 0.6364800
[3,]  1.04424274 1.1139498 0.2974317 1.3733284
[4,]  0.81131288 0.5353789 0.4444442 0.6732645
> 
> 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:    /Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
          [,1]     [,2]     [,3]     [,4]
[1,] 225.08173 42.05667 36.12204 32.01010
[2,]  25.37479 33.63503 33.72737 31.76991
[3,]  36.53287 37.38038 28.06278 40.61931
[4,]  33.77136 30.64042 29.64197 32.18593
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x6000012a8000>
> exp(tmp5)
<pointer: 0x6000012a8000>
> log(tmp5,2)
<pointer: 0x6000012a8000>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 468.4781
> Min(tmp5)
[1] 52.8143
> mean(tmp5)
[1] 72.28286
> Sum(tmp5)
[1] 14456.57
> Var(tmp5)
[1] 868.2591
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 90.59199 71.44488 70.54063 69.57852 70.76386 69.36540 70.33739 73.60038
 [9] 67.58401 69.02158
> rowSums(tmp5)
 [1] 1811.840 1428.898 1410.813 1391.570 1415.277 1387.308 1406.748 1472.008
 [9] 1351.680 1380.432
> rowVars(tmp5)
 [1] 8009.37699   82.64009   77.51873   91.04153   98.75671   67.26805
 [7]   50.98907   96.05362   59.21725   44.87249
> rowSd(tmp5)
 [1] 89.495123  9.090659  8.804472  9.541568  9.937641  8.201710  7.140663
 [8]  9.800695  7.695274  6.698693
> rowMax(tmp5)
 [1] 468.47814  88.08544  84.54378  92.65718  89.11221  91.71363  81.67798
 [8]  89.49452  81.27402  83.14395
> rowMin(tmp5)
 [1] 54.27614 52.81430 56.48477 56.18752 55.47744 55.07022 58.54884 56.05263
 [9] 54.50615 56.43958
> 
> colMeans(tmp5)
 [1] 109.47032  74.76525  67.06379  72.62154  65.14744  70.67368  68.01533
 [8]  74.16641  67.75651  68.64727  66.06092  76.46060  69.21105  71.00278
[15]  69.06332  64.76797  71.05217  71.02658  73.80335  74.88102
> colSums(tmp5)
 [1] 1094.7032  747.6525  670.6379  726.2154  651.4744  706.7368  680.1533
 [8]  741.6641  677.5651  686.4727  660.6092  764.6060  692.1105  710.0278
[15]  690.6332  647.6797  710.5217  710.2658  738.0335  748.8102
> colVars(tmp5)
 [1] 16002.52580    43.18515    68.90415    80.37512    44.23841   111.53477
 [7]    65.04158    66.19404    64.64558   132.46030    56.94208    27.05580
[13]    47.67848    63.29194    64.63705    43.20652    53.56701    44.00648
[19]   112.91471   148.40486
> colSd(tmp5)
 [1] 126.501090   6.571541   8.300852   8.965217   6.651196  10.561003
 [7]   8.064836   8.135972   8.040248  11.509140   7.545998   5.201519
[13]   6.904960   7.955623   8.039717   6.573167   7.318949   6.633738
[19]  10.626134  12.182153
> colMax(tmp5)
 [1] 468.47814  87.53545  84.30026  84.90696  76.55528  87.33914  88.08544
 [8]  85.67180  81.90352  89.49452  83.14395  82.98834  82.12095  87.54198
[15]  81.84846  77.82901  81.77200  79.71841  92.65718  91.71363
> colMin(tmp5)
 [1] 52.81430 63.77402 58.34043 63.27103 55.04487 54.27614 60.89762 59.73930
 [9] 60.13992 55.07022 56.18752 68.88711 56.75628 59.32434 58.54884 54.50615
[17] 61.73871 62.78660 55.27262 56.05263
> 
> 
> ### setting a random element to NA and then testing with na.rm=TRUE or na.rm=FALSE (The default)
> 
> 
> which.row <- sample(1:10,1,replace=TRUE)
> which.col  <- sample(1:20,1,replace=TRUE)
> 
> tmp5[which.row,which.col] <- NA
> 
> Max(tmp5)
[1] NA
> Min(tmp5)
[1] NA
> mean(tmp5)
[1] NA
> Sum(tmp5)
[1] NA
> Var(tmp5)
[1] NA
> 
> rowMeans(tmp5)
 [1] 90.59199 71.44488 70.54063       NA 70.76386 69.36540 70.33739 73.60038
 [9] 67.58401 69.02158
> rowSums(tmp5)
 [1] 1811.840 1428.898 1410.813       NA 1415.277 1387.308 1406.748 1472.008
 [9] 1351.680 1380.432
> rowVars(tmp5)
 [1] 8009.37699   82.64009   77.51873   92.77706   98.75671   67.26805
 [7]   50.98907   96.05362   59.21725   44.87249
> rowSd(tmp5)
 [1] 89.495123  9.090659  8.804472  9.632085  9.937641  8.201710  7.140663
 [8]  9.800695  7.695274  6.698693
> rowMax(tmp5)
 [1] 468.47814  88.08544  84.54378        NA  89.11221  91.71363  81.67798
 [8]  89.49452  81.27402  83.14395
> rowMin(tmp5)
 [1] 54.27614 52.81430 56.48477       NA 55.47744 55.07022 58.54884 56.05263
 [9] 54.50615 56.43958
> 
> colMeans(tmp5)
 [1] 109.47032  74.76525  67.06379  72.62154  65.14744  70.67368  68.01533
 [8]  74.16641  67.75651  68.64727  66.06092  76.46060  69.21105  71.00278
[15]  69.06332  64.76797  71.05217        NA  73.80335  74.88102
> colSums(tmp5)
 [1] 1094.7032  747.6525  670.6379  726.2154  651.4744  706.7368  680.1533
 [8]  741.6641  677.5651  686.4727  660.6092  764.6060  692.1105  710.0278
[15]  690.6332  647.6797  710.5217        NA  738.0335  748.8102
> colVars(tmp5)
 [1] 16002.52580    43.18515    68.90415    80.37512    44.23841   111.53477
 [7]    65.04158    66.19404    64.64558   132.46030    56.94208    27.05580
[13]    47.67848    63.29194    64.63705    43.20652    53.56701          NA
[19]   112.91471   148.40486
> colSd(tmp5)
 [1] 126.501090   6.571541   8.300852   8.965217   6.651196  10.561003
 [7]   8.064836   8.135972   8.040248  11.509140   7.545998   5.201519
[13]   6.904960   7.955623   8.039717   6.573167   7.318949         NA
[19]  10.626134  12.182153
> colMax(tmp5)
 [1] 468.47814  87.53545  84.30026  84.90696  76.55528  87.33914  88.08544
 [8]  85.67180  81.90352  89.49452  83.14395  82.98834  82.12095  87.54198
[15]  81.84846  77.82901  81.77200        NA  92.65718  91.71363
> colMin(tmp5)
 [1] 52.81430 63.77402 58.34043 63.27103 55.04487 54.27614 60.89762 59.73930
 [9] 60.13992 55.07022 56.18752 68.88711 56.75628 59.32434 58.54884 54.50615
[17] 61.73871       NA 55.27262 56.05263
> 
> Max(tmp5,na.rm=TRUE)
[1] 468.4781
> Min(tmp5,na.rm=TRUE)
[1] 52.8143
> mean(tmp5,na.rm=TRUE)
[1] 72.25858
> Sum(tmp5,na.rm=TRUE)
[1] 14379.46
> Var(tmp5,na.rm=TRUE)
[1] 872.5257
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 90.59199 71.44488 70.54063 69.18182 70.76386 69.36540 70.33739 73.60038
 [9] 67.58401 69.02158
> rowSums(tmp5,na.rm=TRUE)
 [1] 1811.840 1428.898 1410.813 1314.455 1415.277 1387.308 1406.748 1472.008
 [9] 1351.680 1380.432
> rowVars(tmp5,na.rm=TRUE)
 [1] 8009.37699   82.64009   77.51873   92.77706   98.75671   67.26805
 [7]   50.98907   96.05362   59.21725   44.87249
> rowSd(tmp5,na.rm=TRUE)
 [1] 89.495123  9.090659  8.804472  9.632085  9.937641  8.201710  7.140663
 [8]  9.800695  7.695274  6.698693
> rowMax(tmp5,na.rm=TRUE)
 [1] 468.47814  88.08544  84.54378  92.65718  89.11221  91.71363  81.67798
 [8]  89.49452  81.27402  83.14395
> rowMin(tmp5,na.rm=TRUE)
 [1] 54.27614 52.81430 56.48477 56.18752 55.47744 55.07022 58.54884 56.05263
 [9] 54.50615 56.43958
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 109.47032  74.76525  67.06379  72.62154  65.14744  70.67368  68.01533
 [8]  74.16641  67.75651  68.64727  66.06092  76.46060  69.21105  71.00278
[15]  69.06332  64.76797  71.05217  70.34999  73.80335  74.88102
> colSums(tmp5,na.rm=TRUE)
 [1] 1094.7032  747.6525  670.6379  726.2154  651.4744  706.7368  680.1533
 [8]  741.6641  677.5651  686.4727  660.6092  764.6060  692.1105  710.0278
[15]  690.6332  647.6797  710.5217  633.1499  738.0335  748.8102
> colVars(tmp5,na.rm=TRUE)
 [1] 16002.52580    43.18515    68.90415    80.37512    44.23841   111.53477
 [7]    65.04158    66.19404    64.64558   132.46030    56.94208    27.05580
[13]    47.67848    63.29194    64.63705    43.20652    53.56701    44.35734
[19]   112.91471   148.40486
> colSd(tmp5,na.rm=TRUE)
 [1] 126.501090   6.571541   8.300852   8.965217   6.651196  10.561003
 [7]   8.064836   8.135972   8.040248  11.509140   7.545998   5.201519
[13]   6.904960   7.955623   8.039717   6.573167   7.318949   6.660130
[19]  10.626134  12.182153
> colMax(tmp5,na.rm=TRUE)
 [1] 468.47814  87.53545  84.30026  84.90696  76.55528  87.33914  88.08544
 [8]  85.67180  81.90352  89.49452  83.14395  82.98834  82.12095  87.54198
[15]  81.84846  77.82901  81.77200  79.71841  92.65718  91.71363
> colMin(tmp5,na.rm=TRUE)
 [1] 52.81430 63.77402 58.34043 63.27103 55.04487 54.27614 60.89762 59.73930
 [9] 60.13992 55.07022 56.18752 68.88711 56.75628 59.32434 58.54884 54.50615
[17] 61.73871 62.78660 55.27262 56.05263
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1] 90.59199 71.44488 70.54063      NaN 70.76386 69.36540 70.33739 73.60038
 [9] 67.58401 69.02158
> rowSums(tmp5,na.rm=TRUE)
 [1] 1811.840 1428.898 1410.813    0.000 1415.277 1387.308 1406.748 1472.008
 [9] 1351.680 1380.432
> rowVars(tmp5,na.rm=TRUE)
 [1] 8009.37699   82.64009   77.51873         NA   98.75671   67.26805
 [7]   50.98907   96.05362   59.21725   44.87249
> rowSd(tmp5,na.rm=TRUE)
 [1] 89.495123  9.090659  8.804472        NA  9.937641  8.201710  7.140663
 [8]  9.800695  7.695274  6.698693
> rowMax(tmp5,na.rm=TRUE)
 [1] 468.47814  88.08544  84.54378        NA  89.11221  91.71363  81.67798
 [8]  89.49452  81.27402  83.14395
> rowMin(tmp5,na.rm=TRUE)
 [1] 54.27614 52.81430 56.48477       NA 55.47744 55.07022 58.54884 56.05263
 [9] 54.50615 56.43958
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1] 113.82362  75.98649  67.66022  73.24718  65.38888  68.82196  68.02881
 [8]  74.23709  68.60280  69.41495  67.15797  77.28582  69.65591  70.75852
[15]  70.04544  64.81122  69.86108       NaN  71.70848  74.82051
> colSums(tmp5,na.rm=TRUE)
 [1] 1024.4126  683.8784  608.9420  659.2246  588.4999  619.3976  612.2593
 [8]  668.1338  617.4252  624.7345  604.4217  695.5724  626.9032  636.8267
[15]  630.4090  583.3010  628.7497    0.0000  645.3764  673.3846
> colVars(tmp5,na.rm=TRUE)
 [1] 17789.64063    31.80453    73.51517    86.01849    49.11242    86.90193
 [7]    73.16973    74.41210    64.66901   142.38794    50.52038    22.77673
[13]    51.41188    70.53223    61.86529    48.58630    44.30251          NA
[19]    77.65866   166.91429
> colSd(tmp5,na.rm=TRUE)
 [1] 133.377812   5.639551   8.574099   9.274615   7.008026   9.322121
 [7]   8.553931   8.626245   8.041704  11.932642   7.107769   4.772497
[13]   7.170208   8.398347   7.865449   6.970387   6.656013         NA
[19]   8.812415  12.919531
> colMax(tmp5,na.rm=TRUE)
 [1] 468.47814  87.53545  84.30026  84.90696  76.55528  81.05375  88.08544
 [8]  85.67180  81.90352  89.49452  83.14395  82.98834  82.12095  87.54198
[15]  81.84846  77.82901  81.07550      -Inf  83.68980  91.71363
> colMin(tmp5,na.rm=TRUE)
 [1] 52.81430 70.00691 58.34043 63.27103 55.04487 54.27614 60.89762 59.73930
 [9] 61.03690 55.07022 60.74250 68.88711 56.75628 59.32434 58.54884 54.50615
[17] 61.73871      Inf 55.27262 56.05263
> 
> 
> 
> 
> 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] 390.7986 375.5453 186.3528 184.6971 158.4866 127.4261 269.5802 148.6598
 [9] 166.1448 317.0698
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 390.7986 375.5453 186.3528 184.6971 158.4866 127.4261 269.5802 148.6598
 [9] 166.1448 317.0698
> 
> 
> 
> copymatrix <- matrix(rnorm(200,150,15),10,20)
> 
> tmp5[1:10,1:20] <- copymatrix
> which.row <- 1
> which.col  <- 3
> cat(which.row," ",which.col,"\n")
1   3 
> tmp5[which.row,which.col] <- NA
> copymatrix[which.row,which.col] <- NA
> 
> colVars(tmp5,na.rm=TRUE)-apply(copymatrix,2,var,na.rm=TRUE)
 [1] -5.684342e-14 -1.136868e-13 -5.684342e-14  0.000000e+00 -1.136868e-13
 [6]  2.842171e-13 -1.136868e-13 -2.842171e-14 -8.526513e-14 -5.684342e-14
[11] -8.526513e-14  0.000000e+00 -8.526513e-14  0.000000e+00  0.000000e+00
[16] -5.684342e-14  0.000000e+00 -1.136868e-13 -2.842171e-14  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)
+ }
10   17 
10   1 
7   4 
6   5 
5   17 
4   20 
2   2 
1   5 
5   10 
9   20 
8   10 
7   4 
9   14 
5   11 
10   9 
1   16 
1   11 
6   13 
5   9 
4   3 
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] 3.179357
> Min(tmp)
[1] -2.28282
> mean(tmp)
[1] 0.1385766
> Sum(tmp)
[1] 13.85766
> Var(tmp)
[1] 1.104985
> 
> rowMeans(tmp)
[1] 0.1385766
> rowSums(tmp)
[1] 13.85766
> rowVars(tmp)
[1] 1.104985
> rowSd(tmp)
[1] 1.051183
> rowMax(tmp)
[1] 3.179357
> rowMin(tmp)
[1] -2.28282
> 
> colMeans(tmp)
  [1]  0.291327650  0.415696406  0.770555946 -1.012300987  0.517747013
  [6] -0.024367350 -0.191397030 -0.984518338 -0.775120936 -0.375123502
 [11] -0.429706795 -1.267580006  1.909579231  0.266233419 -0.737653855
 [16]  0.998183977  1.073990731  0.487334485  0.687848591 -0.240367457
 [21] -1.335937260  0.943776817  0.665780795 -0.002758145 -1.462610126
 [26] -2.133369170 -0.554625566  0.598433320 -0.078865241  0.332644926
 [31]  1.245133651 -0.252507585  1.762548841 -0.914382941  0.876735352
 [36] -0.054545347  1.389157463  0.116110400 -0.086892879 -0.348204354
 [41]  1.746354172 -0.271294960 -0.135224916 -0.449332332 -0.300558500
 [46]  1.869744665  0.422542870  0.343910614  2.518821622 -0.348473920
 [51]  2.068302283  0.175088202  0.889384903 -0.510246993 -2.282820270
 [56]  0.696725380  1.362237677  0.519336187 -2.056455597  0.374541201
 [61]  0.640532103 -0.636588914  3.179356630 -0.474145180 -0.006883002
 [66] -1.398531582 -0.651014600  0.303122595  0.109097326 -1.164090850
 [71]  1.194714377  0.442297604 -0.247389835 -1.686112386 -0.672208751
 [76] -0.114011451  1.462872389 -0.692486363 -0.632558956  0.307464659
 [81] -1.154077578 -1.915223189  0.924588940  0.171686329  0.042795958
 [86]  0.920381738  1.095137866  0.931580997  0.650889313 -0.903135047
 [91]  1.623796293  0.175403865  0.750723129  0.742803019 -0.755243724
 [96]  0.343600614  0.221449913  3.009607068  0.207246387 -1.208351160
> colSums(tmp)
  [1]  0.291327650  0.415696406  0.770555946 -1.012300987  0.517747013
  [6] -0.024367350 -0.191397030 -0.984518338 -0.775120936 -0.375123502
 [11] -0.429706795 -1.267580006  1.909579231  0.266233419 -0.737653855
 [16]  0.998183977  1.073990731  0.487334485  0.687848591 -0.240367457
 [21] -1.335937260  0.943776817  0.665780795 -0.002758145 -1.462610126
 [26] -2.133369170 -0.554625566  0.598433320 -0.078865241  0.332644926
 [31]  1.245133651 -0.252507585  1.762548841 -0.914382941  0.876735352
 [36] -0.054545347  1.389157463  0.116110400 -0.086892879 -0.348204354
 [41]  1.746354172 -0.271294960 -0.135224916 -0.449332332 -0.300558500
 [46]  1.869744665  0.422542870  0.343910614  2.518821622 -0.348473920
 [51]  2.068302283  0.175088202  0.889384903 -0.510246993 -2.282820270
 [56]  0.696725380  1.362237677  0.519336187 -2.056455597  0.374541201
 [61]  0.640532103 -0.636588914  3.179356630 -0.474145180 -0.006883002
 [66] -1.398531582 -0.651014600  0.303122595  0.109097326 -1.164090850
 [71]  1.194714377  0.442297604 -0.247389835 -1.686112386 -0.672208751
 [76] -0.114011451  1.462872389 -0.692486363 -0.632558956  0.307464659
 [81] -1.154077578 -1.915223189  0.924588940  0.171686329  0.042795958
 [86]  0.920381738  1.095137866  0.931580997  0.650889313 -0.903135047
 [91]  1.623796293  0.175403865  0.750723129  0.742803019 -0.755243724
 [96]  0.343600614  0.221449913  3.009607068  0.207246387 -1.208351160
> colVars(tmp)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> colSd(tmp)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> colMax(tmp)
  [1]  0.291327650  0.415696406  0.770555946 -1.012300987  0.517747013
  [6] -0.024367350 -0.191397030 -0.984518338 -0.775120936 -0.375123502
 [11] -0.429706795 -1.267580006  1.909579231  0.266233419 -0.737653855
 [16]  0.998183977  1.073990731  0.487334485  0.687848591 -0.240367457
 [21] -1.335937260  0.943776817  0.665780795 -0.002758145 -1.462610126
 [26] -2.133369170 -0.554625566  0.598433320 -0.078865241  0.332644926
 [31]  1.245133651 -0.252507585  1.762548841 -0.914382941  0.876735352
 [36] -0.054545347  1.389157463  0.116110400 -0.086892879 -0.348204354
 [41]  1.746354172 -0.271294960 -0.135224916 -0.449332332 -0.300558500
 [46]  1.869744665  0.422542870  0.343910614  2.518821622 -0.348473920
 [51]  2.068302283  0.175088202  0.889384903 -0.510246993 -2.282820270
 [56]  0.696725380  1.362237677  0.519336187 -2.056455597  0.374541201
 [61]  0.640532103 -0.636588914  3.179356630 -0.474145180 -0.006883002
 [66] -1.398531582 -0.651014600  0.303122595  0.109097326 -1.164090850
 [71]  1.194714377  0.442297604 -0.247389835 -1.686112386 -0.672208751
 [76] -0.114011451  1.462872389 -0.692486363 -0.632558956  0.307464659
 [81] -1.154077578 -1.915223189  0.924588940  0.171686329  0.042795958
 [86]  0.920381738  1.095137866  0.931580997  0.650889313 -0.903135047
 [91]  1.623796293  0.175403865  0.750723129  0.742803019 -0.755243724
 [96]  0.343600614  0.221449913  3.009607068  0.207246387 -1.208351160
> colMin(tmp)
  [1]  0.291327650  0.415696406  0.770555946 -1.012300987  0.517747013
  [6] -0.024367350 -0.191397030 -0.984518338 -0.775120936 -0.375123502
 [11] -0.429706795 -1.267580006  1.909579231  0.266233419 -0.737653855
 [16]  0.998183977  1.073990731  0.487334485  0.687848591 -0.240367457
 [21] -1.335937260  0.943776817  0.665780795 -0.002758145 -1.462610126
 [26] -2.133369170 -0.554625566  0.598433320 -0.078865241  0.332644926
 [31]  1.245133651 -0.252507585  1.762548841 -0.914382941  0.876735352
 [36] -0.054545347  1.389157463  0.116110400 -0.086892879 -0.348204354
 [41]  1.746354172 -0.271294960 -0.135224916 -0.449332332 -0.300558500
 [46]  1.869744665  0.422542870  0.343910614  2.518821622 -0.348473920
 [51]  2.068302283  0.175088202  0.889384903 -0.510246993 -2.282820270
 [56]  0.696725380  1.362237677  0.519336187 -2.056455597  0.374541201
 [61]  0.640532103 -0.636588914  3.179356630 -0.474145180 -0.006883002
 [66] -1.398531582 -0.651014600  0.303122595  0.109097326 -1.164090850
 [71]  1.194714377  0.442297604 -0.247389835 -1.686112386 -0.672208751
 [76] -0.114011451  1.462872389 -0.692486363 -0.632558956  0.307464659
 [81] -1.154077578 -1.915223189  0.924588940  0.171686329  0.042795958
 [86]  0.920381738  1.095137866  0.931580997  0.650889313 -0.903135047
 [91]  1.623796293  0.175403865  0.750723129  0.742803019 -0.755243724
 [96]  0.343600614  0.221449913  3.009607068  0.207246387 -1.208351160
> colMedians(tmp)
  [1]  0.291327650  0.415696406  0.770555946 -1.012300987  0.517747013
  [6] -0.024367350 -0.191397030 -0.984518338 -0.775120936 -0.375123502
 [11] -0.429706795 -1.267580006  1.909579231  0.266233419 -0.737653855
 [16]  0.998183977  1.073990731  0.487334485  0.687848591 -0.240367457
 [21] -1.335937260  0.943776817  0.665780795 -0.002758145 -1.462610126
 [26] -2.133369170 -0.554625566  0.598433320 -0.078865241  0.332644926
 [31]  1.245133651 -0.252507585  1.762548841 -0.914382941  0.876735352
 [36] -0.054545347  1.389157463  0.116110400 -0.086892879 -0.348204354
 [41]  1.746354172 -0.271294960 -0.135224916 -0.449332332 -0.300558500
 [46]  1.869744665  0.422542870  0.343910614  2.518821622 -0.348473920
 [51]  2.068302283  0.175088202  0.889384903 -0.510246993 -2.282820270
 [56]  0.696725380  1.362237677  0.519336187 -2.056455597  0.374541201
 [61]  0.640532103 -0.636588914  3.179356630 -0.474145180 -0.006883002
 [66] -1.398531582 -0.651014600  0.303122595  0.109097326 -1.164090850
 [71]  1.194714377  0.442297604 -0.247389835 -1.686112386 -0.672208751
 [76] -0.114011451  1.462872389 -0.692486363 -0.632558956  0.307464659
 [81] -1.154077578 -1.915223189  0.924588940  0.171686329  0.042795958
 [86]  0.920381738  1.095137866  0.931580997  0.650889313 -0.903135047
 [91]  1.623796293  0.175403865  0.750723129  0.742803019 -0.755243724
 [96]  0.343600614  0.221449913  3.009607068  0.207246387 -1.208351160
> colRanges(tmp)
          [,1]      [,2]      [,3]      [,4]     [,5]        [,6]      [,7]
[1,] 0.2913277 0.4156964 0.7705559 -1.012301 0.517747 -0.02436735 -0.191397
[2,] 0.2913277 0.4156964 0.7705559 -1.012301 0.517747 -0.02436735 -0.191397
           [,8]       [,9]      [,10]      [,11]    [,12]    [,13]     [,14]
[1,] -0.9845183 -0.7751209 -0.3751235 -0.4297068 -1.26758 1.909579 0.2662334
[2,] -0.9845183 -0.7751209 -0.3751235 -0.4297068 -1.26758 1.909579 0.2662334
          [,15]    [,16]    [,17]     [,18]     [,19]      [,20]     [,21]
[1,] -0.7376539 0.998184 1.073991 0.4873345 0.6878486 -0.2403675 -1.335937
[2,] -0.7376539 0.998184 1.073991 0.4873345 0.6878486 -0.2403675 -1.335937
         [,22]     [,23]        [,24]    [,25]     [,26]      [,27]     [,28]
[1,] 0.9437768 0.6657808 -0.002758145 -1.46261 -2.133369 -0.5546256 0.5984333
[2,] 0.9437768 0.6657808 -0.002758145 -1.46261 -2.133369 -0.5546256 0.5984333
           [,29]     [,30]    [,31]      [,32]    [,33]      [,34]     [,35]
[1,] -0.07886524 0.3326449 1.245134 -0.2525076 1.762549 -0.9143829 0.8767354
[2,] -0.07886524 0.3326449 1.245134 -0.2525076 1.762549 -0.9143829 0.8767354
           [,36]    [,37]     [,38]       [,39]      [,40]    [,41]     [,42]
[1,] -0.05454535 1.389157 0.1161104 -0.08689288 -0.3482044 1.746354 -0.271295
[2,] -0.05454535 1.389157 0.1161104 -0.08689288 -0.3482044 1.746354 -0.271295
          [,43]      [,44]      [,45]    [,46]     [,47]     [,48]    [,49]
[1,] -0.1352249 -0.4493323 -0.3005585 1.869745 0.4225429 0.3439106 2.518822
[2,] -0.1352249 -0.4493323 -0.3005585 1.869745 0.4225429 0.3439106 2.518822
          [,50]    [,51]     [,52]     [,53]     [,54]    [,55]     [,56]
[1,] -0.3484739 2.068302 0.1750882 0.8893849 -0.510247 -2.28282 0.6967254
[2,] -0.3484739 2.068302 0.1750882 0.8893849 -0.510247 -2.28282 0.6967254
        [,57]     [,58]     [,59]     [,60]     [,61]      [,62]    [,63]
[1,] 1.362238 0.5193362 -2.056456 0.3745412 0.6405321 -0.6365889 3.179357
[2,] 1.362238 0.5193362 -2.056456 0.3745412 0.6405321 -0.6365889 3.179357
          [,64]        [,65]     [,66]      [,67]     [,68]     [,69]     [,70]
[1,] -0.4741452 -0.006883002 -1.398532 -0.6510146 0.3031226 0.1090973 -1.164091
[2,] -0.4741452 -0.006883002 -1.398532 -0.6510146 0.3031226 0.1090973 -1.164091
        [,71]     [,72]      [,73]     [,74]      [,75]      [,76]    [,77]
[1,] 1.194714 0.4422976 -0.2473898 -1.686112 -0.6722088 -0.1140115 1.462872
[2,] 1.194714 0.4422976 -0.2473898 -1.686112 -0.6722088 -0.1140115 1.462872
          [,78]     [,79]     [,80]     [,81]     [,82]     [,83]     [,84]
[1,] -0.6924864 -0.632559 0.3074647 -1.154078 -1.915223 0.9245889 0.1716863
[2,] -0.6924864 -0.632559 0.3074647 -1.154078 -1.915223 0.9245889 0.1716863
          [,85]     [,86]    [,87]    [,88]     [,89]     [,90]    [,91]
[1,] 0.04279596 0.9203817 1.095138 0.931581 0.6508893 -0.903135 1.623796
[2,] 0.04279596 0.9203817 1.095138 0.931581 0.6508893 -0.903135 1.623796
         [,92]     [,93]    [,94]      [,95]     [,96]     [,97]    [,98]
[1,] 0.1754039 0.7507231 0.742803 -0.7552437 0.3436006 0.2214499 3.009607
[2,] 0.1754039 0.7507231 0.742803 -0.7552437 0.3436006 0.2214499 3.009607
         [,99]    [,100]
[1,] 0.2072464 -1.208351
[2,] 0.2072464 -1.208351
> 
> 
> Max(tmp2)
[1] 2.67319
> Min(tmp2)
[1] -2.102804
> mean(tmp2)
[1] 0.05120803
> Sum(tmp2)
[1] 5.120803
> Var(tmp2)
[1] 1.044543
> 
> rowMeans(tmp2)
  [1]  0.661544190  1.663757684  1.881619553 -0.437414589  0.216803502
  [6]  1.212399623  1.462617075 -0.219386846 -0.608324649 -0.734519838
 [11]  1.534066387 -0.688178934  0.760276496 -1.958587746  0.399681666
 [16] -0.425206832  1.005604468 -0.016900204  1.473734112  0.231407523
 [21]  0.704561568  2.360736100  0.586244433  0.771874431 -1.516631566
 [26] -0.076827875  1.684654750  1.637424778 -0.209934960  0.548068216
 [31]  0.226148680  0.144289833 -0.246323538  1.366983492  1.491361033
 [36] -0.828953455 -1.071860881 -0.905766107 -1.391752978  1.522094254
 [41]  0.242403756 -0.328600802  0.737258666  0.743228744 -0.096143996
 [46]  0.492054407 -1.106157687  0.036136357 -0.336634931  0.901205381
 [51] -0.228474331 -1.061475715 -1.373165564 -1.058296518 -1.887671179
 [56]  0.740478064 -0.647466824  0.441863432  0.051072444  1.113292911
 [61] -0.560578464 -0.821982662 -1.925451899 -0.743415253 -0.004431287
 [66] -0.011805785 -0.656299641  1.162901156 -1.816539023  1.182795549
 [71] -0.700543805  0.348066514 -0.884583994  0.380417631 -1.596145608
 [76]  0.749900146  2.673189647 -1.185495000  0.054179173 -0.207625186
 [81]  1.175751633 -0.040806534  0.090428099  0.540619112  0.693225261
 [86] -0.756039091 -1.227543654  0.167909399 -0.575835860  0.226478936
 [91] -1.749894762  1.126315581 -1.103799771 -0.559174590  0.114353547
 [96]  0.264307036  0.563644133 -2.102803899  0.436929016  0.813897242
> rowSums(tmp2)
  [1]  0.661544190  1.663757684  1.881619553 -0.437414589  0.216803502
  [6]  1.212399623  1.462617075 -0.219386846 -0.608324649 -0.734519838
 [11]  1.534066387 -0.688178934  0.760276496 -1.958587746  0.399681666
 [16] -0.425206832  1.005604468 -0.016900204  1.473734112  0.231407523
 [21]  0.704561568  2.360736100  0.586244433  0.771874431 -1.516631566
 [26] -0.076827875  1.684654750  1.637424778 -0.209934960  0.548068216
 [31]  0.226148680  0.144289833 -0.246323538  1.366983492  1.491361033
 [36] -0.828953455 -1.071860881 -0.905766107 -1.391752978  1.522094254
 [41]  0.242403756 -0.328600802  0.737258666  0.743228744 -0.096143996
 [46]  0.492054407 -1.106157687  0.036136357 -0.336634931  0.901205381
 [51] -0.228474331 -1.061475715 -1.373165564 -1.058296518 -1.887671179
 [56]  0.740478064 -0.647466824  0.441863432  0.051072444  1.113292911
 [61] -0.560578464 -0.821982662 -1.925451899 -0.743415253 -0.004431287
 [66] -0.011805785 -0.656299641  1.162901156 -1.816539023  1.182795549
 [71] -0.700543805  0.348066514 -0.884583994  0.380417631 -1.596145608
 [76]  0.749900146  2.673189647 -1.185495000  0.054179173 -0.207625186
 [81]  1.175751633 -0.040806534  0.090428099  0.540619112  0.693225261
 [86] -0.756039091 -1.227543654  0.167909399 -0.575835860  0.226478936
 [91] -1.749894762  1.126315581 -1.103799771 -0.559174590  0.114353547
 [96]  0.264307036  0.563644133 -2.102803899  0.436929016  0.813897242
> 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.661544190  1.663757684  1.881619553 -0.437414589  0.216803502
  [6]  1.212399623  1.462617075 -0.219386846 -0.608324649 -0.734519838
 [11]  1.534066387 -0.688178934  0.760276496 -1.958587746  0.399681666
 [16] -0.425206832  1.005604468 -0.016900204  1.473734112  0.231407523
 [21]  0.704561568  2.360736100  0.586244433  0.771874431 -1.516631566
 [26] -0.076827875  1.684654750  1.637424778 -0.209934960  0.548068216
 [31]  0.226148680  0.144289833 -0.246323538  1.366983492  1.491361033
 [36] -0.828953455 -1.071860881 -0.905766107 -1.391752978  1.522094254
 [41]  0.242403756 -0.328600802  0.737258666  0.743228744 -0.096143996
 [46]  0.492054407 -1.106157687  0.036136357 -0.336634931  0.901205381
 [51] -0.228474331 -1.061475715 -1.373165564 -1.058296518 -1.887671179
 [56]  0.740478064 -0.647466824  0.441863432  0.051072444  1.113292911
 [61] -0.560578464 -0.821982662 -1.925451899 -0.743415253 -0.004431287
 [66] -0.011805785 -0.656299641  1.162901156 -1.816539023  1.182795549
 [71] -0.700543805  0.348066514 -0.884583994  0.380417631 -1.596145608
 [76]  0.749900146  2.673189647 -1.185495000  0.054179173 -0.207625186
 [81]  1.175751633 -0.040806534  0.090428099  0.540619112  0.693225261
 [86] -0.756039091 -1.227543654  0.167909399 -0.575835860  0.226478936
 [91] -1.749894762  1.126315581 -1.103799771 -0.559174590  0.114353547
 [96]  0.264307036  0.563644133 -2.102803899  0.436929016  0.813897242
> rowMin(tmp2)
  [1]  0.661544190  1.663757684  1.881619553 -0.437414589  0.216803502
  [6]  1.212399623  1.462617075 -0.219386846 -0.608324649 -0.734519838
 [11]  1.534066387 -0.688178934  0.760276496 -1.958587746  0.399681666
 [16] -0.425206832  1.005604468 -0.016900204  1.473734112  0.231407523
 [21]  0.704561568  2.360736100  0.586244433  0.771874431 -1.516631566
 [26] -0.076827875  1.684654750  1.637424778 -0.209934960  0.548068216
 [31]  0.226148680  0.144289833 -0.246323538  1.366983492  1.491361033
 [36] -0.828953455 -1.071860881 -0.905766107 -1.391752978  1.522094254
 [41]  0.242403756 -0.328600802  0.737258666  0.743228744 -0.096143996
 [46]  0.492054407 -1.106157687  0.036136357 -0.336634931  0.901205381
 [51] -0.228474331 -1.061475715 -1.373165564 -1.058296518 -1.887671179
 [56]  0.740478064 -0.647466824  0.441863432  0.051072444  1.113292911
 [61] -0.560578464 -0.821982662 -1.925451899 -0.743415253 -0.004431287
 [66] -0.011805785 -0.656299641  1.162901156 -1.816539023  1.182795549
 [71] -0.700543805  0.348066514 -0.884583994  0.380417631 -1.596145608
 [76]  0.749900146  2.673189647 -1.185495000  0.054179173 -0.207625186
 [81]  1.175751633 -0.040806534  0.090428099  0.540619112  0.693225261
 [86] -0.756039091 -1.227543654  0.167909399 -0.575835860  0.226478936
 [91] -1.749894762  1.126315581 -1.103799771 -0.559174590  0.114353547
 [96]  0.264307036  0.563644133 -2.102803899  0.436929016  0.813897242
> 
> colMeans(tmp2)
[1] 0.05120803
> colSums(tmp2)
[1] 5.120803
> colVars(tmp2)
[1] 1.044543
> colSd(tmp2)
[1] 1.022029
> colMax(tmp2)
[1] 2.67319
> colMin(tmp2)
[1] -2.102804
> colMedians(tmp2)
[1] 0.07230364
> colRanges(tmp2)
          [,1]
[1,] -2.102804
[2,]  2.673190
> 
> dataset1 <- matrix(dataset1,1,100)
> 
> agree.checks(tmp,dataset1)
> 
> dataset2 <- matrix(dataset2,100,1)
> agree.checks(tmp2,dataset2)
>   
> 
> tmp <- createBufferedMatrix(10,10)
> 
> tmp[1:10,1:10] <- rnorm(100)
> colApply(tmp,sum)
 [1] -1.4160095  4.4077901 -1.3575729 -0.2320401 -6.8046045  4.5052264
 [7]  3.9511305 -2.0861539  1.6165042  1.5080551
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -1.4398583
[2,] -0.6570138
[3,] -0.4062888
[4,]  0.3885159
[5,]  1.3426230
> 
> rowApply(tmp,sum)
 [1] -3.4582695  4.7632672 -2.4759107 -0.1299302  6.3065269 -0.4402246
 [7]  3.3273834 -2.1786783 -1.2133121 -0.4085267
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    6   10    4    6    1    1    8    6    8     4
 [2,]    7    1   10   10    8    4    3    7    3     9
 [3,]    4    6    7    2    3    5    2    3   10     8
 [4,]    8    8    9    4    6    6    5    8    1     1
 [5,]    2    2    1    3    7    3    7    1    2     6
 [6,]   10    7    6    7    4    8    9    4    7     3
 [7,]    9    4    3    9   10   10    1    5    4     7
 [8,]    3    5    2    5    9    2    6    9    6     2
 [9,]    5    9    5    1    5    9   10    2    9     5
[10,]    1    3    8    8    2    7    4   10    5    10
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1] -0.2487050  0.4583924 -0.8957410 -0.5678858  0.4888015 -0.6449123
 [7] -0.4717920  2.8299373 -2.2541821  0.7302280 -1.1192170  1.0767514
[13]  4.3823162 -0.9270026  0.6463943 -0.9195390  0.5332690  2.8795741
[19]  2.1177773  0.8190624
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -0.5009863
[2,] -0.4881496
[3,] -0.4217623
[4,]  0.5652001
[5,]  0.5969932
> 
> rowApply(tmp,sum)
[1]  9.216712  1.687936  5.487408 -5.267426 -2.211104
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]   12    6   13    8    7
[2,]   13    2   15   17   13
[3,]    5    9   14    4    9
[4,]    1    8    2   10   19
[5,]    9   13   17    9    6
> 
> 
> as.matrix(tmp)
           [,1]       [,2]        [,3]       [,4]       [,5]        [,6]
[1,]  0.5969932  0.6205317 -0.08829132 -0.4746744  0.3350766 -0.19711577
[2,] -0.4881496 -1.4338633  0.26611944  0.1755825  0.4124442 -1.14165958
[3,]  0.5652001  0.6363139  0.60520208 -1.4261659  0.7619146  0.38446899
[4,] -0.4217623  0.4174188 -1.37747139 -0.3516088 -0.4208267  0.05078214
[5,] -0.5009863  0.2179913 -0.30129981  1.5089809 -0.5998073  0.25861193
           [,7]       [,8]       [,9]      [,10]      [,11]      [,12]
[1,]  1.1091811  0.6576577 -0.4306816  1.7644032  1.1939608  0.7513348
[2,] -1.3678822  0.7675459 -0.5105275  1.5219486  0.2699232 -2.6932458
[3,] -0.1443877 -0.1767945  1.5592480  0.5385616  0.2831882  1.9788292
[4,]  0.1548687  0.3847235 -1.5360405 -0.8143702 -1.1482726  0.6772462
[5,] -0.2235719  1.1968047 -1.3361804 -2.2803151 -1.7180166  0.3625870
         [,13]       [,14]       [,15]      [,16]      [,17]      [,18]
[1,] 0.9757493 -0.24600176  0.53805373  0.2924600  0.2325333  0.4777561
[2,] 0.5319294  0.85482074  1.41302292  0.2994772  0.3383113  1.4784594
[3,] 0.7504358  0.04063659 -0.07279546  0.2421074 -0.1470870 -1.5177141
[4,] 0.3710903 -1.47849676 -1.42996551 -1.1506642  0.9317853  1.4006361
[5,] 1.7531113 -0.09796143  0.19807861 -0.6029193 -0.8222740  1.0404366
          [,19]       [,20]
[1,]  1.0261327  0.08165274
[2,]  1.2128247 -0.21914562
[3,] -0.7493395  1.37558570
[4,]  0.3988359  0.07466656
[5,]  0.2293234 -0.49369701
> 
> 
> is.BufferedMatrix(tmp)
[1] TRUE
> 
> as.BufferedMatrix(as.matrix(tmp))
BufferedMatrix object
Matrix size:  5 20 
Buffer size:  1 1 
Directory:    /Users/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:    /Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  650  bytes.
Disk usage :  200  bytes.
> subBufferedMatrix(tmp,,5:8)
BufferedMatrix object
Matrix size:  5 4 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  561  bytes.
Disk usage :  160  bytes.
> subBufferedMatrix(tmp,1:3,)
BufferedMatrix object
Matrix size:  3 20 
Buffer size:  1 1 
Directory:    /Users/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.5839688 -2.318557 0.6310199 0.3060224 -0.9033936 1.08473 1.374935
          col8     col9    col10     col11    col12    col13    col14     col15
row1 -1.112802 2.539817 1.425712 0.4292864 1.295388 0.672567 2.654474 -1.372817
          col16      col17     col18      col19     col20
row1 -0.6308947 -0.6594455 0.7657239 -0.1603167 0.3263057
> tmp[,"col10"]
          col10
row1  1.4257123
row2  0.5934118
row3 -0.7535909
row4  0.4023018
row5 -0.4098240
> tmp[c("row1","row5"),]
           col1      col2       col3      col4       col5      col6     col7
row1  0.5839688 -2.318557  0.6310199 0.3060224 -0.9033936  1.084730 1.374935
row5 -1.5479852 -1.273437 -0.8893508 0.3810477  0.6908891 -2.303146 0.408666
           col8      col9     col10      col11     col12      col13     col14
row1 -1.1128018 2.5398171  1.425712  0.4292864 1.2953877  0.6725670 2.6544736
row5  0.7886952 0.4312648 -0.409824 -1.8395600 0.6775686 -0.4059611 0.3616368
          col15      col16      col17     col18      col19     col20
row1 -1.3728172 -0.6308947 -0.6594455 0.7657239 -0.1603167 0.3263057
row5 -0.4988272  0.7388616  0.9219818 1.1403320  0.1294781 1.0766985
> tmp[,c("col6","col20")]
           col6      col20
row1  1.0847300  0.3263057
row2 -0.8061073 -0.6542777
row3  0.8193074 -0.3051745
row4 -0.7833007  2.0907696
row5 -2.3031461  1.0766985
> tmp[c("row1","row5"),c("col6","col20")]
          col6     col20
row1  1.084730 0.3263057
row5 -2.303146 1.0766985
> 
> 
> 
> 
> tmp["row1",] <- rnorm(20,mean=10)
> tmp[,"col10"] <- rnorm(5,mean=30)
> tmp[c("row1","row5"),] <- rnorm(40,mean=50)
> tmp[,c("col6","col20")] <- rnorm(10,mean=75)
> tmp[c("row1","row5"),c("col6","col20")]  <- rnorm(4,mean=105)
> 
> tmp["row1",]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 49.18779 51.74227 49.08119 49.38296 49.89186 103.5052 50.06615 51.43171
         col9    col10    col11    col12    col13    col14    col15    col16
row1 50.06039 50.57352 49.82331 50.27731 51.12626 50.67558 51.00347 50.46562
        col17    col18    col19    col20
row1 51.40725 50.18973 47.21095 105.0462
> tmp[,"col10"]
        col10
row1 50.57352
row2 30.79114
row3 29.46617
row4 29.56933
row5 50.31679
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 49.18779 51.74227 49.08119 49.38296 49.89186 103.5052 50.06615 51.43171
row5 50.81767 49.90269 49.50508 49.62552 48.52651 104.5622 51.33889 50.09029
         col9    col10    col11    col12    col13    col14    col15    col16
row1 50.06039 50.57352 49.82331 50.27731 51.12626 50.67558 51.00347 50.46562
row5 48.91761 50.31679 49.40927 50.66236 51.15245 50.55636 50.82615 48.28776
        col17    col18    col19    col20
row1 51.40725 50.18973 47.21095 105.0462
row5 49.61876 49.11666 49.76668 105.5960
> tmp[,c("col6","col20")]
          col6     col20
row1 103.50516 105.04621
row2  75.52163  74.76260
row3  75.02738  73.16135
row4  73.98224  74.47670
row5 104.56218 105.59598
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 103.5052 105.0462
row5 104.5622 105.5960
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 103.5052 105.0462
row5 104.5622 105.5960
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
           col13
[1,] -0.88153920
[2,] -1.71057801
[3,] -0.06299495
[4,]  0.46818927
[5,] -0.21993053
> tmp[,c("col17","col7")]
           col17       col7
[1,]  0.06045834 -0.2084273
[2,]  0.07699159  1.5225667
[3,] -2.07667188 -0.2439941
[4,]  0.71699370 -0.2971075
[5,] -1.51629768  1.4571659
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
           col6       col20
[1,]  0.9283099 -0.03310446
[2,]  0.8952653  0.27047095
[3,] -1.6926320 -0.89673262
[4,]  0.6514717  0.29713588
[5,] -1.1010081  0.35834721
> subBufferedMatrix(tmp,1,c("col6"))[,1]
          col1
[1,] 0.9283099
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
          col6
[1,] 0.9283099
[2,] 0.8952653
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> 
> 
> 
> subBufferedMatrix(tmp,c("row3","row1"),)[,1:20]
           [,1]      [,2]       [,3]      [,4]       [,5]       [,6]       [,7]
row3 -0.6417552  2.114790  0.7776375  1.785588 -2.3144129 -0.7269392 -1.7514356
row1 -0.5113882 -1.677698 -1.2983038 -1.179693  0.1746518 -0.5873540  0.7642195
           [,8]       [,9]       [,10]      [,11]      [,12]     [,13]
row3 -0.5872177 -0.7100668  1.06818754 -0.6464725  1.8895988 0.8006465
row1  0.2698018 -0.7895297 -0.07788302 -0.7131610 -0.5920267 0.2796672
          [,14]       [,15]    [,16]      [,17]      [,18]      [,19]     [,20]
row3 -0.6505705 -0.01479884 1.367468 -0.8717948  0.2958838 -1.5598291 1.2209008
row1  1.6916500 -0.26679777 1.300429  1.1968268 -1.1099571  0.5845537 0.2678283
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
           [,1]      [,2]      [,3]         [,4]      [,5]      [,6]      [,7]
row2 -0.2911335 0.4912074 -1.697319 -0.006028621 0.8435978 0.5414807 0.2865308
         [,8]     [,9]      [,10]
row2 1.454632 1.969451 -0.7022868
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
          [,1]     [,2]      [,3]       [,4]     [,5]      [,6]      [,7]
row5 0.4493257 1.330193 0.5134659 -0.8151192 1.149753 0.5335657 -1.169437
           [,8]      [,9]     [,10]     [,11]     [,12]     [,13]     [,14]
row5 -0.7880299 0.4765243 0.1622792 0.2812958 0.3692194 0.4611659 0.4294402
         [,15]     [,16]     [,17]     [,18]     [,19]     [,20]
row5 0.8814249 0.5080998 -1.454108 0.2367317 0.0118645 0.5713197
> 
> 
> 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: 0x6000012dc0c0>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM1dea4e7c9829"
 [2] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM1dea55e9d400"
 [3] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM1dea6a5d7810"
 [4] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM1dea1e7598fe"
 [5] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM1dea3a8f5b51"
 [6] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM1dea19b440e0"
 [7] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM1dea90f3f4f" 
 [8] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM1dea4805602e"
 [9] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM1dea58ed90f2"
[10] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM1dea54c72d7a"
[11] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM1dea607ad011"
[12] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM1dea1ef23d93"
[13] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM1dea31a88dc4"
[14] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM1dea30f35854"
[15] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM1dea382c0be7"
> 
> 
> ### 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: 0x6000012b8000>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x6000012b8000>
Warning message:
In dir.create(new.directory) :
  '/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x6000012b8000>
> rowMedians(tmp)
  [1] -0.179105126  0.140689204  0.073861947 -0.165279018  0.322702856
  [6]  0.105088891  0.184503161 -0.266601847 -0.556055069 -0.319181485
 [11]  0.053408909  0.109829063  0.034010706 -0.046187189 -0.203901344
 [16]  0.487592983 -0.446903081 -0.515625463  0.039473840 -0.407578837
 [21]  0.318905366 -0.917995726 -0.137167898  0.177134243 -0.408017362
 [26]  0.158901226  0.434856541  0.345410912 -0.544619923 -0.517956230
 [31]  0.271769153 -0.281848458 -0.206444850 -0.563611766 -0.371521760
 [36]  0.326635200  0.192078326  0.029571289 -0.309979571 -0.258894741
 [41]  0.248686116  0.130508556  0.454388454 -0.030507420 -0.317236110
 [46]  0.555983523  0.190199877 -0.306884738 -0.852657806 -0.225853642
 [51]  0.227482959  0.046171141 -0.354769659 -0.498629808  0.023837308
 [56]  0.161902726  0.127075833  0.221790644 -0.145110121  0.605214575
 [61]  0.004532226 -0.231524312  0.028834219 -0.420050854 -0.316103412
 [66]  0.341109596  0.438393965 -0.258440781  0.052324700  0.399565819
 [71] -0.781073956 -0.429317862  0.413925298  0.134014507 -0.141321909
 [76]  0.714665398 -0.692832526  0.340007928 -0.031058274 -0.437957126
 [81]  0.176223894 -0.295529277  0.463280531 -0.119443149 -0.352477893
 [86]  0.234093125  0.165430734  0.522618479  0.353584681 -0.236479046
 [91]  0.564772260  0.347174584 -0.115972569 -0.883734688 -0.251099158
 [96] -0.293415825  0.716368564 -0.085622971  0.157502239  0.402589960
[101]  0.060292700 -0.425087618 -0.304865495 -0.065872617  0.610267352
[106]  0.009510674 -0.040300953 -0.353800492  0.062958651  0.109715506
[111] -0.292046126 -0.049623159 -0.719102889 -0.201596805 -0.435362203
[116] -0.759470443  0.485536977  0.066848295  0.344496986  0.240209259
[121]  0.180894183 -0.179478811 -0.236671645  0.087941195 -0.322558746
[126] -0.026574528  0.230980838  0.180479816  0.026780913  0.034593615
[131]  0.196541331 -0.163878252 -0.032840208  0.154782477  0.621044467
[136] -0.237970802 -0.299351408  0.269742930  0.237226462 -0.070740155
[141] -0.029441220  0.370808802  0.062432654  0.021202529  0.037560844
[146]  0.119208147 -0.314044179  0.093824400  0.146778134 -0.213591456
[151]  0.107494375 -0.062841782 -0.085845134 -0.041824423 -0.271907956
[156]  0.075132911  0.014859278 -0.881744534  0.167280795  0.229790017
[161]  0.095620509  0.270527746  0.036807230 -0.190468368  0.144119406
[166] -0.159935927 -0.412874308 -0.169947891  0.444452087 -0.274494617
[171]  0.054713532  0.024242349 -0.125868438 -0.139378260  0.189222419
[176] -0.096186319  0.249121996 -0.131814660  0.405942980 -0.412851243
[181] -0.097511125 -0.777371334 -0.522094264 -0.230058264 -0.079669973
[186] -0.451812320  0.129094902  0.337749169 -0.290523785  0.210377246
[191]  0.070569182  0.079837617 -0.124691884  0.459246003 -0.475914706
[196] -0.194620918 -0.374294761  0.665395441  0.172427256  0.481372016
[201]  0.299908111 -0.119451256 -0.065487409 -0.205968560  0.451620454
[206] -0.083422561  0.023126613 -0.206355378 -0.048310345  0.116044954
[211] -0.152056404 -0.109726802  0.034388760 -0.470926092  0.184292946
[216] -0.293410992  0.115228987 -0.004438235 -0.435184290  0.587779653
[221]  0.393922922  0.600417185  0.300601413 -0.227921805  0.547099828
[226] -0.231386785 -0.041409267 -0.096708968 -0.225931414 -0.078837165
> 
> proc.time()
   user  system elapsed 
  2.631  15.336  18.687 

BufferedMatrix.Rcheck/tests/rawCalltesting.Rout


R version 4.5.1 Patched (2025-09-10 r88807) -- "Great Square Root"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: x86_64-apple-darwin20

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: 0x600001714000>
> .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: 0x600001714000>
> .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: 0x600001714000>
> .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: 0x600001714000>
> 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: 0x600001770060>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600001770060>
> .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: 0x600001770060>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600001770060>
> .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: 0x600001770060>
> 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: 0x600001718000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600001718000>
> .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: 0x600001718000>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x600001718000>
> .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: 0x600001718000>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x600001718000>
> .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: 0x600001718000>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x600001718000>
> .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: 0x600001718000>
> 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: 0x600001704000>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x600001704000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600001704000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600001704000>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile25bd16b1587f" "BufferedMatrixFile25bd5529057c"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile25bd16b1587f" "BufferedMatrixFile25bd5529057c"
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x600001704240>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600001704240>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x600001704240>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x600001704240>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x600001704240>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x600001704240>
> .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: 0x600001704420>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600001704420>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x600001704420>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x600001704420>
> 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: 0x600001704600>
> .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: 0x600001704600>
> rm(P)
> 
> proc.time()
   user  system elapsed 
  0.301   0.139   0.430 

BufferedMatrix.Rcheck/tests/Rcodetesting.Rout


R version 4.5.1 Patched (2025-09-10 r88807) -- "Great Square Root"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: x86_64-apple-darwin20

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.341   0.101   0.463 

Example timings