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

This page was generated on 2024-05-31 19:31:00 -0400 (Fri, 31 May 2024).

HostnameOSArch (*)R versionInstalled pkgs
nebbiolo2Linux (Ubuntu 22.04.3 LTS)x86_644.4.0 RC (2024-04-16 r86468) -- "Puppy Cup" 4669
palomino4Windows Server 2022 Datacenterx644.4.0 RC (2024-04-16 r86468 ucrt) -- "Puppy Cup" 4404
merida1macOS 12.7.4 Montereyx86_644.4.0 Patched (2024-04-24 r86482) -- "Puppy Cup" 4431
kjohnson1macOS 13.6.6 Venturaarm644.4.0 Patched (2024-04-24 r86482) -- "Puppy Cup" 4384
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 244/2233HostnameOS / ArchINSTALLBUILDCHECKBUILD BIN
BufferedMatrix 1.69.0  (landing page)
Ben Bolstad
Snapshot Date: 2024-05-30 18:57:37 -0400 (Thu, 30 May 2024)
git_url: https://git.bioconductor.org/packages/BufferedMatrix
git_branch: devel
git_last_commit: d422a05
git_last_commit_date: 2024-04-30 10:16:21 -0400 (Tue, 30 Apr 2024)
nebbiolo2Linux (Ubuntu 22.04.3 LTS) / x86_64  OK    OK    OK  UNNEEDED, same version is already published
palomino4Windows Server 2022 Datacenter / x64  OK    OK    OK    OK  UNNEEDED, same version is already published
merida1macOS 12.7.4 Monterey / x86_64  OK    OK    WARNINGS    OK  UNNEEDED, same version is already published
kjohnson1macOS 13.6.6 Ventura / arm64  OK    OK    WARNINGS    OK  UNNEEDED, same version is already published

CHECK results for BufferedMatrix on merida1


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.69.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.69.0.tar.gz
StartedAt: 2024-05-31 05:42:05 -0400 (Fri, 31 May 2024)
EndedAt: 2024-05-31 05:43:17 -0400 (Fri, 31 May 2024)
EllapsedTime: 72.4 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.69.0.tar.gz
###
##############################################################################
##############################################################################


* using log directory ‘/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck’
* using R version 4.4.0 Patched (2024-04-24 r86482)
* using platform: x86_64-apple-darwin20
* R was compiled by
    Apple clang version 14.0.0 (clang-1400.0.29.202)
    GNU Fortran (GCC) 12.2.0
* running under: macOS Monterey 12.7.4
* using session charset: UTF-8
* using option ‘--no-vignettes’
* checking for file ‘BufferedMatrix/DESCRIPTION’ ... OK
* this is package ‘BufferedMatrix’ version ‘1.69.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.20-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.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.20-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.4-x86_64/Resources/library’
* installing *source* package ‘BufferedMatrix’ ...
** using staged installation
** libs
using C compiler: ‘Apple clang version 14.0.0 (clang-1400.0.29.202)’
using SDK: ‘MacOSX11.3.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 -Wl,-framework -Wl,CoreFoundation
installing to /Library/Frameworks/R.framework/Versions/4.4-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.4.0 Patched (2024-04-24 r86482) -- "Puppy Cup"
Copyright (C) 2024 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.598   0.216   0.996 

BufferedMatrix.Rcheck/tests/objectTesting.Rout


R version 4.4.0 Patched (2024-04-24 r86482) -- "Puppy Cup"
Copyright (C) 2024 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.20-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 474175 25.4    1035502 55.4         NA   638565 34.2
Vcells 877671  6.7    8388608 64.0      65536  2072607 15.9
> 
> 
> 
> 
> ##
> ## checking reads
> ##
> 
> tmp2 <- createBufferedMatrix(10,20)
> 
> test.sample <- rnorm(10*20)
> 
> tmp2[1:10,1:20] <- test.sample
> 
> test.matrix <- matrix(test.sample,10,20)
> 
> ## testing reads
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   which.col <- sample(1:20,1)
+   if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> date()
[1] "Fri May 31 05:42:39 2024"
> 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 May 31 05:42:40 2024"
> 
> 
> 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: 0x6000036f4540>
> 
> 
> 
> 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 May 31 05:42:46 2024"
> 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 May 31 05:42:48 2024"
> 
> ColMode(tmp2)
<pointer: 0x6000036f4540>
> 
> 
> 
> ### Now testing assignments
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+ 
+   new.data <- rnorm(20)
+   tmp2[which.row,] <- new.data
+   test.matrix[which.row,] <- new.data
+   if (rep > 1){
+     if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+   
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   new.data <- rnorm(10)
+   tmp2[,which.col] <- new.data
+   test.matrix[,which.col]<- new.data
+ 
+   if (rep > 1){
+     if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.col <- which.col
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,5,replace=TRUE)
+   new.data <- matrix(rnorm(50),5,10)
+   tmp2[,which.col] <- new.data
+   test.matrix[,which.col]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.col <- which.col
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   new.data <- matrix(rnorm(50),5,10)
+   tmp2[which.row,] <- new.data
+   test.matrix[which.row,]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col  <- sample(1:20,5,replace=TRUE)
+   new.data <- matrix(rnorm(25),5,5)
+   tmp2[which.row,which.col] <- new.data
+   test.matrix[which.row,which.col]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[prev.row,prev.col] == test.matrix[prev.row,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+   prev.col <- which.col
+ }
> 
> 
> 
> 
> ###
> ###
> ### testing some more functions
> ###
> 
> 
> 
> ## duplication function
> tmp5 <- duplicate(tmp2)
> 
> # making sure really did copy everything.
> tmp5[1,1] <- tmp5[1,1] +100.00
> 
> if (tmp5[1,1] == tmp2[1,1]){
+   stop("Problem with duplication")
+ }
> 
> 
> 
> 
> ### testing elementwise applying of functions
> 
> tmp5[1:4,1:4]
           [,1]        [,2]        [,3]       [,4]
[1,] 99.3022760  1.76250992 -0.01552943 0.04768582
[2,]  1.2907011 -0.82584417  0.73037657 0.45610617
[3,]  1.5481015 -1.98234366 -0.32805837 1.02915721
[4,]  0.1881271 -0.07831362 -1.33041949 0.55314816
> ewApply(tmp5,abs)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.20-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,] 99.3022760 1.76250992 0.01552943 0.04768582
[2,]  1.2907011 0.82584417 0.73037657 0.45610617
[3,]  1.5481015 1.98234366 0.32805837 1.02915721
[4,]  0.1881271 0.07831362 1.33041949 0.55314816
> ewApply(tmp5,sqrt)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.20-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,] 9.9650527 1.3275955 0.1246171 0.2183708
[2,] 1.1360903 0.9087597 0.8546207 0.6753563
[3,] 1.2442273 1.4079573 0.5727638 1.0144739
[4,] 0.4337362 0.2798457 1.1534381 0.7437393
> 
> 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.20-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,] 223.95280 40.03847 26.26170 27.23139
[2,]  37.65160 34.91344 34.27658 32.20967
[3,]  38.99037 41.06192 31.05570 36.17390
[4,]  29.52549 27.87677 37.86480 32.99054
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x6000036f02a0>
> exp(tmp5)
<pointer: 0x6000036f02a0>
> log(tmp5,2)
<pointer: 0x6000036f02a0>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 466.1284
> Min(tmp5)
[1] 52.25044
> mean(tmp5)
[1] 72.29917
> Sum(tmp5)
[1] 14459.83
> Var(tmp5)
[1] 860.6575
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 89.18109 69.78280 70.17098 70.97799 74.72730 69.57427 72.20081 68.47262
 [9] 68.10777 69.79606
> rowSums(tmp5)
 [1] 1783.622 1395.656 1403.420 1419.560 1494.546 1391.485 1444.016 1369.452
 [9] 1362.155 1395.921
> rowVars(tmp5)
 [1] 7945.30611   68.15703   75.68838   54.31397  116.95747   72.84821
 [7]   37.58243   86.11500  108.20042   81.28292
> rowSd(tmp5)
 [1] 89.136447  8.255727  8.699907  7.369801 10.814687  8.535117  6.130451
 [8]  9.279817 10.401943  9.015704
> rowMax(tmp5)
 [1] 466.12842  85.70433  85.46500  79.97881  93.87904  82.79417  87.44635
 [8]  89.65510  86.31212  93.39304
> rowMin(tmp5)
 [1] 54.66029 55.90626 56.57405 56.23892 57.27764 53.33438 57.39140 56.56454
 [9] 52.25044 56.17414
> 
> colMeans(tmp5)
 [1] 109.35216  71.45805  68.14734  66.88591  73.07582  71.04519  68.13455
 [8]  70.52738  70.55376  71.76549  71.46887  70.41682  71.79922  69.21034
[15]  68.79411  70.96464  68.31725  70.57134  70.16856  73.32655
> colSums(tmp5)
 [1] 1093.5216  714.5805  681.4734  668.8591  730.7582  710.4519  681.3455
 [8]  705.2738  705.5376  717.6549  714.6887  704.1682  717.9922  692.1034
[15]  687.9411  709.6464  683.1725  705.7134  701.6856  733.2655
> colVars(tmp5)
 [1] 15776.77363   150.65103    73.03818    33.46824    45.60056    62.23859
 [7]    72.14257   119.87310   111.81548    99.77051    82.99542   108.54834
[13]   115.60168    94.67898    75.03490    76.46704    52.19231    67.87026
[19]    67.94912    78.17344
> colSd(tmp5)
 [1] 125.605627  12.273998   8.546238   5.785174   6.752819   7.889144
 [7]   8.493678  10.948657  10.574284   9.988519   9.110182  10.418654
[13]  10.751822   9.730313   8.662269   8.744544   7.224425   8.238341
[19]   8.243126   8.841574
> colMax(tmp5)
 [1] 466.12842  86.21562  78.81062  75.29122  81.21800  83.81133  81.53912
 [8]  89.65510  90.86741  87.44635  93.39304  81.22832  93.87904  81.58542
[15]  86.31212  84.72655  78.39465  80.94397  80.41380  85.70433
> colMin(tmp5)
 [1] 61.45344 56.36245 54.66029 56.67858 60.65127 60.40361 55.95861 52.25044
 [9] 53.68819 56.17414 62.12933 54.65040 57.42406 55.90626 56.56454 58.08869
[17] 53.33438 56.89560 56.82454 57.27764
> 
> 
> ### 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]       NA 69.78280 70.17098 70.97799 74.72730 69.57427 72.20081 68.47262
 [9] 68.10777 69.79606
> rowSums(tmp5)
 [1]       NA 1395.656 1403.420 1419.560 1494.546 1391.485 1444.016 1369.452
 [9] 1362.155 1395.921
> rowVars(tmp5)
 [1]  77.39679  68.15703  75.68838  54.31397 116.95747  72.84821  37.58243
 [8]  86.11500 108.20042  81.28292
> rowSd(tmp5)
 [1]  8.797545  8.255727  8.699907  7.369801 10.814687  8.535117  6.130451
 [8]  9.279817 10.401943  9.015704
> rowMax(tmp5)
 [1]       NA 85.70433 85.46500 79.97881 93.87904 82.79417 87.44635 89.65510
 [9] 86.31212 93.39304
> rowMin(tmp5)
 [1]       NA 55.90626 56.57405 56.23892 57.27764 53.33438 57.39140 56.56454
 [9] 52.25044 56.17414
> 
> colMeans(tmp5)
 [1]       NA 71.45805 68.14734 66.88591 73.07582 71.04519 68.13455 70.52738
 [9] 70.55376 71.76549 71.46887 70.41682 71.79922 69.21034 68.79411 70.96464
[17] 68.31725 70.57134 70.16856 73.32655
> colSums(tmp5)
 [1]       NA 714.5805 681.4734 668.8591 730.7582 710.4519 681.3455 705.2738
 [9] 705.5376 717.6549 714.6887 704.1682 717.9922 692.1034 687.9411 709.6464
[17] 683.1725 705.7134 701.6856 733.2655
> colVars(tmp5)
 [1]        NA 150.65103  73.03818  33.46824  45.60056  62.23859  72.14257
 [8] 119.87310 111.81548  99.77051  82.99542 108.54834 115.60168  94.67898
[15]  75.03490  76.46704  52.19231  67.87026  67.94912  78.17344
> colSd(tmp5)
 [1]        NA 12.273998  8.546238  5.785174  6.752819  7.889144  8.493678
 [8] 10.948657 10.574284  9.988519  9.110182 10.418654 10.751822  9.730313
[15]  8.662269  8.744544  7.224425  8.238341  8.243126  8.841574
> colMax(tmp5)
 [1]       NA 86.21562 78.81062 75.29122 81.21800 83.81133 81.53912 89.65510
 [9] 90.86741 87.44635 93.39304 81.22832 93.87904 81.58542 86.31212 84.72655
[17] 78.39465 80.94397 80.41380 85.70433
> colMin(tmp5)
 [1]       NA 56.36245 54.66029 56.67858 60.65127 60.40361 55.95861 52.25044
 [9] 53.68819 56.17414 62.12933 54.65040 57.42406 55.90626 56.56454 58.08869
[17] 53.33438 56.89560 56.82454 57.27764
> 
> Max(tmp5,na.rm=TRUE)
[1] 93.87904
> Min(tmp5,na.rm=TRUE)
[1] 52.25044
> mean(tmp5,na.rm=TRUE)
[1] 70.32013
> Sum(tmp5,na.rm=TRUE)
[1] 13993.71
> Var(tmp5,na.rm=TRUE)
[1] 77.72703
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 69.34175 69.78280 70.17098 70.97799 74.72730 69.57427 72.20081 68.47262
 [9] 68.10777 69.79606
> rowSums(tmp5,na.rm=TRUE)
 [1] 1317.493 1395.656 1403.420 1419.560 1494.546 1391.485 1444.016 1369.452
 [9] 1362.155 1395.921
> rowVars(tmp5,na.rm=TRUE)
 [1]  77.39679  68.15703  75.68838  54.31397 116.95747  72.84821  37.58243
 [8]  86.11500 108.20042  81.28292
> rowSd(tmp5,na.rm=TRUE)
 [1]  8.797545  8.255727  8.699907  7.369801 10.814687  8.535117  6.130451
 [8]  9.279817 10.401943  9.015704
> rowMax(tmp5,na.rm=TRUE)
 [1] 83.33482 85.70433 85.46500 79.97881 93.87904 82.79417 87.44635 89.65510
 [9] 86.31212 93.39304
> rowMin(tmp5,na.rm=TRUE)
 [1] 54.66029 55.90626 56.57405 56.23892 57.27764 53.33438 57.39140 56.56454
 [9] 52.25044 56.17414
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 69.71035 71.45805 68.14734 66.88591 73.07582 71.04519 68.13455 70.52738
 [9] 70.55376 71.76549 71.46887 70.41682 71.79922 69.21034 68.79411 70.96464
[17] 68.31725 70.57134 70.16856 73.32655
> colSums(tmp5,na.rm=TRUE)
 [1] 627.3931 714.5805 681.4734 668.8591 730.7582 710.4519 681.3455 705.2738
 [9] 705.5376 717.6549 714.6887 704.1682 717.9922 692.1034 687.9411 709.6464
[17] 683.1725 705.7134 701.6856 733.2655
> colVars(tmp5,na.rm=TRUE)
 [1]  69.80066 150.65103  73.03818  33.46824  45.60056  62.23859  72.14257
 [8] 119.87310 111.81548  99.77051  82.99542 108.54834 115.60168  94.67898
[15]  75.03490  76.46704  52.19231  67.87026  67.94912  78.17344
> colSd(tmp5,na.rm=TRUE)
 [1]  8.354679 12.273998  8.546238  5.785174  6.752819  7.889144  8.493678
 [8] 10.948657 10.574284  9.988519  9.110182 10.418654 10.751822  9.730313
[15]  8.662269  8.744544  7.224425  8.238341  8.243126  8.841574
> colMax(tmp5,na.rm=TRUE)
 [1] 81.15336 86.21562 78.81062 75.29122 81.21800 83.81133 81.53912 89.65510
 [9] 90.86741 87.44635 93.39304 81.22832 93.87904 81.58542 86.31212 84.72655
[17] 78.39465 80.94397 80.41380 85.70433
> colMin(tmp5,na.rm=TRUE)
 [1] 61.45344 56.36245 54.66029 56.67858 60.65127 60.40361 55.95861 52.25044
 [9] 53.68819 56.17414 62.12933 54.65040 57.42406 55.90626 56.56454 58.08869
[17] 53.33438 56.89560 56.82454 57.27764
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1]      NaN 69.78280 70.17098 70.97799 74.72730 69.57427 72.20081 68.47262
 [9] 68.10777 69.79606
> rowSums(tmp5,na.rm=TRUE)
 [1]    0.000 1395.656 1403.420 1419.560 1494.546 1391.485 1444.016 1369.452
 [9] 1362.155 1395.921
> rowVars(tmp5,na.rm=TRUE)
 [1]        NA  68.15703  75.68838  54.31397 116.95747  72.84821  37.58243
 [8]  86.11500 108.20042  81.28292
> rowSd(tmp5,na.rm=TRUE)
 [1]        NA  8.255727  8.699907  7.369801 10.814687  8.535117  6.130451
 [8]  9.279817 10.401943  9.015704
> rowMax(tmp5,na.rm=TRUE)
 [1]       NA 85.70433 85.46500 79.97881 93.87904 82.79417 87.44635 89.65510
 [9] 86.31212 93.39304
> rowMin(tmp5,na.rm=TRUE)
 [1]       NA 55.90626 56.57405 56.23892 57.27764 53.33438 57.39140 56.56454
 [9] 52.25044 56.17414
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1]      NaN 70.13841 69.64591 68.02005 72.38403 71.81501 68.19449 69.65068
 [9] 69.61080 72.94339 72.01281 69.71611 72.70138 68.88628 69.28608 71.52913
[17] 68.04267 72.09087 69.23794 72.85160
> colSums(tmp5,na.rm=TRUE)
 [1]   0.0000 631.2457 626.8131 612.1805 651.4563 646.3351 613.7504 626.8561
 [9] 626.4972 656.4905 648.1153 627.4450 654.3124 619.9765 623.5748 643.7622
[17] 612.3840 648.8178 623.1415 655.6644
> colVars(tmp5,na.rm=TRUE)
 [1]        NA 149.89108  56.90397  23.18100  45.91673  63.35136  81.11997
 [8] 126.21038 115.78940  96.63320  90.04138 116.59314 120.89560 105.33243
[15]  81.69130  82.44063  57.86813  50.37824  66.69968  85.40729
> colSd(tmp5,na.rm=TRUE)
 [1]        NA 12.243001  7.543472  4.814665  6.776189  7.959357  9.006663
 [8] 11.234339 10.760548  9.830218  9.489014 10.797830 10.995253 10.263159
[15]  9.038324  9.079682  7.607110  7.097763  8.166987  9.241606
> colMax(tmp5,na.rm=TRUE)
 [1]     -Inf 86.21562 78.81062 75.29122 81.21800 83.81133 81.53912 89.65510
 [9] 90.86741 87.44635 93.39304 81.22832 93.87904 81.58542 86.31212 84.72655
[17] 78.39465 80.94397 80.41380 85.70433
> colMin(tmp5,na.rm=TRUE)
 [1]      Inf 56.36245 59.89740 58.36589 60.65127 60.40361 55.95861 52.25044
 [9] 53.68819 56.17414 62.12933 54.65040 57.42406 55.90626 56.56454 58.08869
[17] 53.33438 59.73839 56.82454 57.27764
> 
> 
> 
> 
> 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] 205.4081 150.8665 274.0625 259.0970 316.9875 192.5746 152.0698 211.8970
 [9] 248.6082 159.4387
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 205.4081 150.8665 274.0625 259.0970 316.9875 192.5746 152.0698 211.8970
 [9] 248.6082 159.4387
> 
> 
> 
> copymatrix <- matrix(rnorm(200,150,15),10,20)
> 
> tmp5[1:10,1:20] <- copymatrix
> which.row <- 1
> which.col  <- 3
> cat(which.row," ",which.col,"\n")
1   3 
> tmp5[which.row,which.col] <- NA
> copymatrix[which.row,which.col] <- NA
> 
> colVars(tmp5,na.rm=TRUE)-apply(copymatrix,2,var,na.rm=TRUE)
 [1]  2.842171e-13 -2.273737e-13  0.000000e+00 -1.136868e-13  5.684342e-14
 [6]  2.842171e-14 -1.421085e-13 -5.684342e-14 -8.526513e-14  1.705303e-13
[11] -5.684342e-14  5.684342e-14 -7.105427e-14  1.136868e-13 -5.684342e-14
[16]  5.684342e-14  0.000000e+00  5.684342e-14 -8.526513e-14 -1.136868e-13
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> ## making sure these things agree
> ##
> ## first when there is no NA
> 
> 
> 
> agree.checks <- function(buff.matrix,r.matrix,err.tol=1e-10){
+ 
+   if (Max(buff.matrix,na.rm=TRUE) != max(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Max")
+   }
+   
+ 
+   if (Min(buff.matrix,na.rm=TRUE) != min(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Min")
+   }
+ 
+ 
+   if (abs(Sum(buff.matrix,na.rm=TRUE)- sum(r.matrix,na.rm=TRUE)) > err.tol){
+ 
+     cat(Sum(buff.matrix,na.rm=TRUE),"\n")
+     cat(sum(r.matrix,na.rm=TRUE),"\n")
+     cat(Sum(buff.matrix,na.rm=TRUE) - sum(r.matrix,na.rm=TRUE),"\n")
+     
+     stop("No agreement in Sum")
+   }
+   
+   if (abs(mean(buff.matrix,na.rm=TRUE) - mean(r.matrix,na.rm=TRUE)) > err.tol){
+     stop("No agreement in mean")
+   }
+   
+   
+   if(abs(Var(buff.matrix,na.rm=TRUE) - var(as.vector(r.matrix),na.rm=TRUE)) > err.tol){
+     stop("No agreement in Var")
+   }
+   
+   
+ 
+   if(any(abs(rowMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,mean,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowMeans")
+   }
+   
+   
+   if(any(abs(colMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,mean,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colMeans")
+   }
+   
+   
+   if(any(abs(rowSums(buff.matrix,na.rm=TRUE)  -  apply(r.matrix,1,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in rowSums")
+   }
+   
+   
+   if(any(abs(colSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colSums")
+   }
+   
+   ### this is to get around the fact that R doesn't like to compute NA on an entire vector of NA when 
+   ### computing variance
+   my.Var <- function(x,na.rm=FALSE){
+    if (all(is.na(x))){
+      return(NA)
+    } else {
+      var(x,na.rm=na.rm)
+    }
+ 
+   }
+   
+   if(any(abs(rowVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+   
+   
+   if(any(abs(colVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+ 
+ 
+   if(any(abs(rowMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+ 
+   if(any(abs(colMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+   
+   
+   if(any(abs(rowMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+   
+ 
+   if(any(abs(colMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+ 
+   if(any(abs(colMedians(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,median,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMedian")
+   }
+ 
+   if(any(abs(colRanges(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,range,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colRanges")
+   }
+ 
+ 
+   
+ }
> 
> 
> 
> 
> 
> 
> 
> 
> 
> for (rep in 1:20){
+   copymatrix <- matrix(rnorm(200,150,15),10,20)
+   
+   tmp5[1:10,1:20] <- copymatrix
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ## now lets assign some NA values and check agreement
+ 
+   which.row <- sample(1:10,1,replace=TRUE)
+   which.col  <- sample(1:20,1,replace=TRUE)
+   
+   cat(which.row," ",which.col,"\n")
+   
+   tmp5[which.row,which.col] <- NA
+   copymatrix[which.row,which.col] <- NA
+   
+   agree.checks(tmp5,copymatrix)
+ 
+   ## make an entire row NA
+   tmp5[which.row,] <- NA
+   copymatrix[which.row,] <- NA
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ### also make an entire col NA
+   tmp5[,which.col] <- NA
+   copymatrix[,which.col] <- NA
+ 
+   agree.checks(tmp5,copymatrix)
+ 
+   ### now make 1 element non NA with NA in the rest of row and column
+ 
+   tmp5[which.row,which.col] <- rnorm(1,150,15)
+   copymatrix[which.row,which.col] <- tmp5[which.row,which.col]
+ 
+   agree.checks(tmp5,copymatrix)
+ }
6   14 
1   17 
8   14 
2   12 
7   1 
4   13 
10   8 
6   11 
3   13 
7   4 
7   17 
4   16 
10   20 
2   4 
5   7 
9   10 
8   9 
5   10 
8   10 
10   7 
There were 50 or more warnings (use warnings() to see the first 50)
> 
> 
> ### now test 1 by n and n by 1 matrix
> 
> 
> err.tol <- 1e-12
> 
> rm(tmp5)
> 
> dataset1 <- rnorm(100)
> dataset2 <- rnorm(100)
> 
> tmp <- createBufferedMatrix(1,100)
> tmp[1,] <- dataset1
> 
> tmp2 <- createBufferedMatrix(100,1)
> tmp2[,1] <- dataset2
> 
> 
> 
> 
> 
> Max(tmp)
[1] 2.953053
> Min(tmp)
[1] -2.941447
> mean(tmp)
[1] 0.03692282
> Sum(tmp)
[1] 3.692282
> Var(tmp)
[1] 0.8999627
> 
> rowMeans(tmp)
[1] 0.03692282
> rowSums(tmp)
[1] 3.692282
> rowVars(tmp)
[1] 0.8999627
> rowSd(tmp)
[1] 0.9486636
> rowMax(tmp)
[1] 2.953053
> rowMin(tmp)
[1] -2.941447
> 
> colMeans(tmp)
  [1] -1.215127586  0.608486914 -0.856333610 -0.489263238  1.123382944
  [6]  1.120363202 -0.912830761 -0.648391038  0.726612186 -0.601105599
 [11]  0.355683450 -0.167899285 -0.793744722 -0.348649226  0.940329361
 [16] -1.010101651 -2.941447220 -0.921276843 -0.646768301  1.055070282
 [21]  1.235703065  0.703473229  1.145557100  0.006390552  0.676062576
 [26]  0.533181947 -0.382286714 -0.442243576 -0.553483736 -0.094919596
 [31]  0.111580925 -1.947757911 -0.725917126 -0.169506288  0.858111781
 [36]  0.873075072  1.982677253 -1.185636796 -0.789318008 -1.084970498
 [41]  0.206661591 -0.484984658 -0.400224746 -0.230069567  2.953052647
 [46]  0.879858660  0.410590256  1.298447013 -0.167421756  0.382101849
 [51] -1.854430742 -0.369010209 -0.016628167  0.776442207  0.487607338
 [56]  0.266396340 -0.549591653 -0.673497412 -2.563906353  0.117180477
 [61]  1.272906813  0.113014106  0.990952756 -0.270410372  0.927216904
 [66]  0.564738653  0.650469845 -1.306193058  0.318748797  0.058569998
 [71] -0.147945520  0.086516567 -0.229292640  1.465673529  0.028419588
 [76]  1.175089391 -0.496070210 -0.745116263  1.010893298 -0.136177517
 [81]  0.817395496  0.006406518  0.056793277 -0.500569717  0.883743898
 [86] -0.142716215  0.755085218  0.047808943  0.685615581 -0.699954787
 [91]  0.453866136  0.845595622 -1.463489127 -0.699760747 -0.424875402
 [96]  0.611838874  2.279649634  0.898975110 -0.992633072 -0.653833312
> colSums(tmp)
  [1] -1.215127586  0.608486914 -0.856333610 -0.489263238  1.123382944
  [6]  1.120363202 -0.912830761 -0.648391038  0.726612186 -0.601105599
 [11]  0.355683450 -0.167899285 -0.793744722 -0.348649226  0.940329361
 [16] -1.010101651 -2.941447220 -0.921276843 -0.646768301  1.055070282
 [21]  1.235703065  0.703473229  1.145557100  0.006390552  0.676062576
 [26]  0.533181947 -0.382286714 -0.442243576 -0.553483736 -0.094919596
 [31]  0.111580925 -1.947757911 -0.725917126 -0.169506288  0.858111781
 [36]  0.873075072  1.982677253 -1.185636796 -0.789318008 -1.084970498
 [41]  0.206661591 -0.484984658 -0.400224746 -0.230069567  2.953052647
 [46]  0.879858660  0.410590256  1.298447013 -0.167421756  0.382101849
 [51] -1.854430742 -0.369010209 -0.016628167  0.776442207  0.487607338
 [56]  0.266396340 -0.549591653 -0.673497412 -2.563906353  0.117180477
 [61]  1.272906813  0.113014106  0.990952756 -0.270410372  0.927216904
 [66]  0.564738653  0.650469845 -1.306193058  0.318748797  0.058569998
 [71] -0.147945520  0.086516567 -0.229292640  1.465673529  0.028419588
 [76]  1.175089391 -0.496070210 -0.745116263  1.010893298 -0.136177517
 [81]  0.817395496  0.006406518  0.056793277 -0.500569717  0.883743898
 [86] -0.142716215  0.755085218  0.047808943  0.685615581 -0.699954787
 [91]  0.453866136  0.845595622 -1.463489127 -0.699760747 -0.424875402
 [96]  0.611838874  2.279649634  0.898975110 -0.992633072 -0.653833312
> colVars(tmp)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> colSd(tmp)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> colMax(tmp)
  [1] -1.215127586  0.608486914 -0.856333610 -0.489263238  1.123382944
  [6]  1.120363202 -0.912830761 -0.648391038  0.726612186 -0.601105599
 [11]  0.355683450 -0.167899285 -0.793744722 -0.348649226  0.940329361
 [16] -1.010101651 -2.941447220 -0.921276843 -0.646768301  1.055070282
 [21]  1.235703065  0.703473229  1.145557100  0.006390552  0.676062576
 [26]  0.533181947 -0.382286714 -0.442243576 -0.553483736 -0.094919596
 [31]  0.111580925 -1.947757911 -0.725917126 -0.169506288  0.858111781
 [36]  0.873075072  1.982677253 -1.185636796 -0.789318008 -1.084970498
 [41]  0.206661591 -0.484984658 -0.400224746 -0.230069567  2.953052647
 [46]  0.879858660  0.410590256  1.298447013 -0.167421756  0.382101849
 [51] -1.854430742 -0.369010209 -0.016628167  0.776442207  0.487607338
 [56]  0.266396340 -0.549591653 -0.673497412 -2.563906353  0.117180477
 [61]  1.272906813  0.113014106  0.990952756 -0.270410372  0.927216904
 [66]  0.564738653  0.650469845 -1.306193058  0.318748797  0.058569998
 [71] -0.147945520  0.086516567 -0.229292640  1.465673529  0.028419588
 [76]  1.175089391 -0.496070210 -0.745116263  1.010893298 -0.136177517
 [81]  0.817395496  0.006406518  0.056793277 -0.500569717  0.883743898
 [86] -0.142716215  0.755085218  0.047808943  0.685615581 -0.699954787
 [91]  0.453866136  0.845595622 -1.463489127 -0.699760747 -0.424875402
 [96]  0.611838874  2.279649634  0.898975110 -0.992633072 -0.653833312
> colMin(tmp)
  [1] -1.215127586  0.608486914 -0.856333610 -0.489263238  1.123382944
  [6]  1.120363202 -0.912830761 -0.648391038  0.726612186 -0.601105599
 [11]  0.355683450 -0.167899285 -0.793744722 -0.348649226  0.940329361
 [16] -1.010101651 -2.941447220 -0.921276843 -0.646768301  1.055070282
 [21]  1.235703065  0.703473229  1.145557100  0.006390552  0.676062576
 [26]  0.533181947 -0.382286714 -0.442243576 -0.553483736 -0.094919596
 [31]  0.111580925 -1.947757911 -0.725917126 -0.169506288  0.858111781
 [36]  0.873075072  1.982677253 -1.185636796 -0.789318008 -1.084970498
 [41]  0.206661591 -0.484984658 -0.400224746 -0.230069567  2.953052647
 [46]  0.879858660  0.410590256  1.298447013 -0.167421756  0.382101849
 [51] -1.854430742 -0.369010209 -0.016628167  0.776442207  0.487607338
 [56]  0.266396340 -0.549591653 -0.673497412 -2.563906353  0.117180477
 [61]  1.272906813  0.113014106  0.990952756 -0.270410372  0.927216904
 [66]  0.564738653  0.650469845 -1.306193058  0.318748797  0.058569998
 [71] -0.147945520  0.086516567 -0.229292640  1.465673529  0.028419588
 [76]  1.175089391 -0.496070210 -0.745116263  1.010893298 -0.136177517
 [81]  0.817395496  0.006406518  0.056793277 -0.500569717  0.883743898
 [86] -0.142716215  0.755085218  0.047808943  0.685615581 -0.699954787
 [91]  0.453866136  0.845595622 -1.463489127 -0.699760747 -0.424875402
 [96]  0.611838874  2.279649634  0.898975110 -0.992633072 -0.653833312
> colMedians(tmp)
  [1] -1.215127586  0.608486914 -0.856333610 -0.489263238  1.123382944
  [6]  1.120363202 -0.912830761 -0.648391038  0.726612186 -0.601105599
 [11]  0.355683450 -0.167899285 -0.793744722 -0.348649226  0.940329361
 [16] -1.010101651 -2.941447220 -0.921276843 -0.646768301  1.055070282
 [21]  1.235703065  0.703473229  1.145557100  0.006390552  0.676062576
 [26]  0.533181947 -0.382286714 -0.442243576 -0.553483736 -0.094919596
 [31]  0.111580925 -1.947757911 -0.725917126 -0.169506288  0.858111781
 [36]  0.873075072  1.982677253 -1.185636796 -0.789318008 -1.084970498
 [41]  0.206661591 -0.484984658 -0.400224746 -0.230069567  2.953052647
 [46]  0.879858660  0.410590256  1.298447013 -0.167421756  0.382101849
 [51] -1.854430742 -0.369010209 -0.016628167  0.776442207  0.487607338
 [56]  0.266396340 -0.549591653 -0.673497412 -2.563906353  0.117180477
 [61]  1.272906813  0.113014106  0.990952756 -0.270410372  0.927216904
 [66]  0.564738653  0.650469845 -1.306193058  0.318748797  0.058569998
 [71] -0.147945520  0.086516567 -0.229292640  1.465673529  0.028419588
 [76]  1.175089391 -0.496070210 -0.745116263  1.010893298 -0.136177517
 [81]  0.817395496  0.006406518  0.056793277 -0.500569717  0.883743898
 [86] -0.142716215  0.755085218  0.047808943  0.685615581 -0.699954787
 [91]  0.453866136  0.845595622 -1.463489127 -0.699760747 -0.424875402
 [96]  0.611838874  2.279649634  0.898975110 -0.992633072 -0.653833312
> colRanges(tmp)
          [,1]      [,2]       [,3]       [,4]     [,5]     [,6]       [,7]
[1,] -1.215128 0.6084869 -0.8563336 -0.4892632 1.123383 1.120363 -0.9128308
[2,] -1.215128 0.6084869 -0.8563336 -0.4892632 1.123383 1.120363 -0.9128308
          [,8]      [,9]      [,10]     [,11]      [,12]      [,13]      [,14]
[1,] -0.648391 0.7266122 -0.6011056 0.3556834 -0.1678993 -0.7937447 -0.3486492
[2,] -0.648391 0.7266122 -0.6011056 0.3556834 -0.1678993 -0.7937447 -0.3486492
         [,15]     [,16]     [,17]      [,18]      [,19]   [,20]    [,21]
[1,] 0.9403294 -1.010102 -2.941447 -0.9212768 -0.6467683 1.05507 1.235703
[2,] 0.9403294 -1.010102 -2.941447 -0.9212768 -0.6467683 1.05507 1.235703
         [,22]    [,23]       [,24]     [,25]     [,26]      [,27]      [,28]
[1,] 0.7034732 1.145557 0.006390552 0.6760626 0.5331819 -0.3822867 -0.4422436
[2,] 0.7034732 1.145557 0.006390552 0.6760626 0.5331819 -0.3822867 -0.4422436
          [,29]      [,30]     [,31]     [,32]      [,33]      [,34]     [,35]
[1,] -0.5534837 -0.0949196 0.1115809 -1.947758 -0.7259171 -0.1695063 0.8581118
[2,] -0.5534837 -0.0949196 0.1115809 -1.947758 -0.7259171 -0.1695063 0.8581118
         [,36]    [,37]     [,38]     [,39]    [,40]     [,41]      [,42]
[1,] 0.8730751 1.982677 -1.185637 -0.789318 -1.08497 0.2066616 -0.4849847
[2,] 0.8730751 1.982677 -1.185637 -0.789318 -1.08497 0.2066616 -0.4849847
          [,43]      [,44]    [,45]     [,46]     [,47]    [,48]      [,49]
[1,] -0.4002247 -0.2300696 2.953053 0.8798587 0.4105903 1.298447 -0.1674218
[2,] -0.4002247 -0.2300696 2.953053 0.8798587 0.4105903 1.298447 -0.1674218
         [,50]     [,51]      [,52]       [,53]     [,54]     [,55]     [,56]
[1,] 0.3821018 -1.854431 -0.3690102 -0.01662817 0.7764422 0.4876073 0.2663963
[2,] 0.3821018 -1.854431 -0.3690102 -0.01662817 0.7764422 0.4876073 0.2663963
          [,57]      [,58]     [,59]     [,60]    [,61]     [,62]     [,63]
[1,] -0.5495917 -0.6734974 -2.563906 0.1171805 1.272907 0.1130141 0.9909528
[2,] -0.5495917 -0.6734974 -2.563906 0.1171805 1.272907 0.1130141 0.9909528
          [,64]     [,65]     [,66]     [,67]     [,68]     [,69]   [,70]
[1,] -0.2704104 0.9272169 0.5647387 0.6504698 -1.306193 0.3187488 0.05857
[2,] -0.2704104 0.9272169 0.5647387 0.6504698 -1.306193 0.3187488 0.05857
          [,71]      [,72]      [,73]    [,74]      [,75]    [,76]      [,77]
[1,] -0.1479455 0.08651657 -0.2292926 1.465674 0.02841959 1.175089 -0.4960702
[2,] -0.1479455 0.08651657 -0.2292926 1.465674 0.02841959 1.175089 -0.4960702
          [,78]    [,79]      [,80]     [,81]       [,82]      [,83]      [,84]
[1,] -0.7451163 1.010893 -0.1361775 0.8173955 0.006406518 0.05679328 -0.5005697
[2,] -0.7451163 1.010893 -0.1361775 0.8173955 0.006406518 0.05679328 -0.5005697
         [,85]      [,86]     [,87]      [,88]     [,89]      [,90]     [,91]
[1,] 0.8837439 -0.1427162 0.7550852 0.04780894 0.6856156 -0.6999548 0.4538661
[2,] 0.8837439 -0.1427162 0.7550852 0.04780894 0.6856156 -0.6999548 0.4538661
         [,92]     [,93]      [,94]      [,95]     [,96]   [,97]     [,98]
[1,] 0.8455956 -1.463489 -0.6997607 -0.4248754 0.6118389 2.27965 0.8989751
[2,] 0.8455956 -1.463489 -0.6997607 -0.4248754 0.6118389 2.27965 0.8989751
          [,99]     [,100]
[1,] -0.9926331 -0.6538333
[2,] -0.9926331 -0.6538333
> 
> 
> Max(tmp2)
[1] 2.602385
> Min(tmp2)
[1] -2.20821
> mean(tmp2)
[1] -0.1093628
> Sum(tmp2)
[1] -10.93628
> Var(tmp2)
[1] 1.046098
> 
> rowMeans(tmp2)
  [1]  0.042734207  0.447834578 -1.086519612  0.198464526 -0.774564274
  [6] -1.448819403 -1.163571302 -1.282702028 -0.914786096 -1.946073451
 [11]  0.702988481 -0.698028976 -0.633258038 -1.195822414 -0.003606732
 [16] -0.547243146 -1.589245174 -1.240451966  0.782122422  0.225759152
 [21]  2.602384994 -1.114210566  0.799753388  0.111255218  0.104675787
 [26]  0.016002404  0.314066670 -0.510948951 -2.053838694  0.409239682
 [31]  0.238021188  0.729933328 -0.440289923 -1.092750695  1.040877600
 [36]  0.063656048  0.685471828 -1.141657989  0.222963571  0.828650818
 [41]  0.499624993  0.514130852 -0.743373473  0.114063896  0.926766823
 [46] -1.780205864  0.442311776  0.159555172 -0.163279214 -0.143312553
 [51]  1.494263680  0.964233735 -1.503946292  0.107139532 -0.002015727
 [56] -0.906681280 -0.949497686 -0.781719435 -0.376506739  0.173588917
 [61]  2.530206841  0.113427872  1.518211651 -1.848965643  1.809562224
 [66] -0.207322117  0.950194364  1.022571233  0.597180118 -1.004033700
 [71]  1.433071423  0.114878704  0.977657748 -0.121879887 -2.208209530
 [76] -0.509386953 -1.095675526 -0.589348395  1.412736228 -0.435428780
 [81] -0.505146933 -2.051561671 -0.146788217 -0.789214395  0.884789665
 [86]  0.981642929  1.155544791 -0.405101963  0.709642056 -2.075558559
 [91] -0.057678793  1.047428729  1.233195853 -0.839198562 -0.295557141
 [96] -1.325407915  0.627223648 -0.189877779  0.645384063 -1.733095279
> rowSums(tmp2)
  [1]  0.042734207  0.447834578 -1.086519612  0.198464526 -0.774564274
  [6] -1.448819403 -1.163571302 -1.282702028 -0.914786096 -1.946073451
 [11]  0.702988481 -0.698028976 -0.633258038 -1.195822414 -0.003606732
 [16] -0.547243146 -1.589245174 -1.240451966  0.782122422  0.225759152
 [21]  2.602384994 -1.114210566  0.799753388  0.111255218  0.104675787
 [26]  0.016002404  0.314066670 -0.510948951 -2.053838694  0.409239682
 [31]  0.238021188  0.729933328 -0.440289923 -1.092750695  1.040877600
 [36]  0.063656048  0.685471828 -1.141657989  0.222963571  0.828650818
 [41]  0.499624993  0.514130852 -0.743373473  0.114063896  0.926766823
 [46] -1.780205864  0.442311776  0.159555172 -0.163279214 -0.143312553
 [51]  1.494263680  0.964233735 -1.503946292  0.107139532 -0.002015727
 [56] -0.906681280 -0.949497686 -0.781719435 -0.376506739  0.173588917
 [61]  2.530206841  0.113427872  1.518211651 -1.848965643  1.809562224
 [66] -0.207322117  0.950194364  1.022571233  0.597180118 -1.004033700
 [71]  1.433071423  0.114878704  0.977657748 -0.121879887 -2.208209530
 [76] -0.509386953 -1.095675526 -0.589348395  1.412736228 -0.435428780
 [81] -0.505146933 -2.051561671 -0.146788217 -0.789214395  0.884789665
 [86]  0.981642929  1.155544791 -0.405101963  0.709642056 -2.075558559
 [91] -0.057678793  1.047428729  1.233195853 -0.839198562 -0.295557141
 [96] -1.325407915  0.627223648 -0.189877779  0.645384063 -1.733095279
> 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.042734207  0.447834578 -1.086519612  0.198464526 -0.774564274
  [6] -1.448819403 -1.163571302 -1.282702028 -0.914786096 -1.946073451
 [11]  0.702988481 -0.698028976 -0.633258038 -1.195822414 -0.003606732
 [16] -0.547243146 -1.589245174 -1.240451966  0.782122422  0.225759152
 [21]  2.602384994 -1.114210566  0.799753388  0.111255218  0.104675787
 [26]  0.016002404  0.314066670 -0.510948951 -2.053838694  0.409239682
 [31]  0.238021188  0.729933328 -0.440289923 -1.092750695  1.040877600
 [36]  0.063656048  0.685471828 -1.141657989  0.222963571  0.828650818
 [41]  0.499624993  0.514130852 -0.743373473  0.114063896  0.926766823
 [46] -1.780205864  0.442311776  0.159555172 -0.163279214 -0.143312553
 [51]  1.494263680  0.964233735 -1.503946292  0.107139532 -0.002015727
 [56] -0.906681280 -0.949497686 -0.781719435 -0.376506739  0.173588917
 [61]  2.530206841  0.113427872  1.518211651 -1.848965643  1.809562224
 [66] -0.207322117  0.950194364  1.022571233  0.597180118 -1.004033700
 [71]  1.433071423  0.114878704  0.977657748 -0.121879887 -2.208209530
 [76] -0.509386953 -1.095675526 -0.589348395  1.412736228 -0.435428780
 [81] -0.505146933 -2.051561671 -0.146788217 -0.789214395  0.884789665
 [86]  0.981642929  1.155544791 -0.405101963  0.709642056 -2.075558559
 [91] -0.057678793  1.047428729  1.233195853 -0.839198562 -0.295557141
 [96] -1.325407915  0.627223648 -0.189877779  0.645384063 -1.733095279
> rowMin(tmp2)
  [1]  0.042734207  0.447834578 -1.086519612  0.198464526 -0.774564274
  [6] -1.448819403 -1.163571302 -1.282702028 -0.914786096 -1.946073451
 [11]  0.702988481 -0.698028976 -0.633258038 -1.195822414 -0.003606732
 [16] -0.547243146 -1.589245174 -1.240451966  0.782122422  0.225759152
 [21]  2.602384994 -1.114210566  0.799753388  0.111255218  0.104675787
 [26]  0.016002404  0.314066670 -0.510948951 -2.053838694  0.409239682
 [31]  0.238021188  0.729933328 -0.440289923 -1.092750695  1.040877600
 [36]  0.063656048  0.685471828 -1.141657989  0.222963571  0.828650818
 [41]  0.499624993  0.514130852 -0.743373473  0.114063896  0.926766823
 [46] -1.780205864  0.442311776  0.159555172 -0.163279214 -0.143312553
 [51]  1.494263680  0.964233735 -1.503946292  0.107139532 -0.002015727
 [56] -0.906681280 -0.949497686 -0.781719435 -0.376506739  0.173588917
 [61]  2.530206841  0.113427872  1.518211651 -1.848965643  1.809562224
 [66] -0.207322117  0.950194364  1.022571233  0.597180118 -1.004033700
 [71]  1.433071423  0.114878704  0.977657748 -0.121879887 -2.208209530
 [76] -0.509386953 -1.095675526 -0.589348395  1.412736228 -0.435428780
 [81] -0.505146933 -2.051561671 -0.146788217 -0.789214395  0.884789665
 [86]  0.981642929  1.155544791 -0.405101963  0.709642056 -2.075558559
 [91] -0.057678793  1.047428729  1.233195853 -0.839198562 -0.295557141
 [96] -1.325407915  0.627223648 -0.189877779  0.645384063 -1.733095279
> 
> colMeans(tmp2)
[1] -0.1093628
> colSums(tmp2)
[1] -10.93628
> colVars(tmp2)
[1] 1.046098
> colSd(tmp2)
[1] 1.022789
> colMax(tmp2)
[1] 2.602385
> colMin(tmp2)
[1] -2.20821
> colMedians(tmp2)
[1] -0.002811229
> colRanges(tmp2)
          [,1]
[1,] -2.208210
[2,]  2.602385
> 
> 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] -3.36740932  0.02000315 -1.04202089 -3.45900308 -2.51493286 -3.66081566
 [7]  2.91071233 -0.95938903  0.16043491  0.81593160
> colApply(tmp,quantile)[,1]
            [,1]
[1,] -2.93856809
[2,] -0.83516358
[3,]  0.09121748
[4,]  0.29425725
[5,]  1.43662420
> 
> rowApply(tmp,sum)
 [1]  1.8710005  1.1962205  0.5401931 -3.0578546 -2.0250464 -4.8253924
 [7] -1.2771234 -2.3623640 -1.2431931  0.0870710
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    1    6    5    1   10    2    6    9    8     4
 [2,]    4    5    8    8    6    4    8    1    9    10
 [3,]    8    3   10    5    1    3    9    3    7     8
 [4,]    5    2    6    2    3    9    1    8    2     9
 [5,]    3    4    1    6    9    7    7    6    3     5
 [6,]    7    7    4    4    5    1    2    4    4     7
 [7,]   10   10    2   10    8   10    3    5    1     6
 [8,]    2    9    7    7    7    5    5    2    6     1
 [9,]    9    8    3    3    4    6    4    7   10     3
[10,]    6    1    9    9    2    8   10   10    5     2
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1] -0.4914130 -3.1571347  0.1198516 -2.9688392 -3.1335800 -1.7119661
 [7] -1.8674848  2.4650167 -1.6996535  0.1161326 -3.3829771 -1.9903134
[13] -1.7257555  2.1178885  2.4257468  2.9242936 -0.3206013  1.8229455
[19]  1.9956308  3.1819969
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -0.5205538
[2,] -0.2575860
[3,] -0.1266586
[4,]  0.1860519
[5,]  0.2273336
> 
> rowApply(tmp,sum)
[1]  2.044175 -3.344338 -2.721058  1.378263 -2.637258
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]    9    8   14    8   11
[2,]   17    3    2   15    1
[3,]   11    4    9   13   14
[4,]    3   14    7   10    5
[5,]   10    6    6    4    7
> 
> 
> as.matrix(tmp)
           [,1]       [,2]       [,3]         [,4]        [,5]       [,6]
[1,] -0.1266586  1.0981019  0.1605121 -0.954497411 -0.07817861 -0.3405025
[2,] -0.5205538 -0.8173328 -0.7994248 -0.004037432 -0.62512089 -1.5450815
[3,]  0.1860519 -1.2111809 -0.3132140 -0.556387595 -0.83799467 -0.9476577
[4,] -0.2575860  0.6655643  0.5745088 -0.250570845 -0.67651897  0.6069073
[5,]  0.2273336 -2.8922871  0.4974696 -1.203345901 -0.91576689  0.5143682
           [,7]       [,8]        [,9]       [,10]       [,11]      [,12]
[1,] -0.6126378  1.7560881  0.18906466 -0.31832345 -2.26411255  1.3846149
[2,] -0.5170150  1.1093143 -0.17865383  1.69496156 -0.52329812 -1.2848704
[3,] -0.3193785 -0.1251063 -1.15539713 -0.08088128  0.08214849 -1.2653547
[4,]  1.4773038 -0.2564013 -0.06405674  0.20512684 -1.12776511  0.7401158
[5,] -1.8957573 -0.0188781 -0.49061049 -1.38475103  0.45005019 -1.5648191
          [,13]      [,14]      [,15]      [,16]       [,17]        [,18]
[1,] -1.3194958  0.4798777  1.5553692 0.64727351  1.08962890 -0.254534914
[2,] -0.3930216 -0.6825714 -0.5104084 0.07300249  1.09005482 -0.007032586
[3,]  1.3921758 -0.1489717  0.2344976 0.88349463 -1.10019029  0.509457593
[4,] -0.4625057  1.7525609 -0.3213702 0.86958601 -1.34413924 -0.602935401
[5,] -0.9429082  0.7169930  1.4676586 0.45093696 -0.05595547  2.177990758
          [,19]      [,20]
[1,]  0.7523053 -0.7997198
[2,]  0.2068743  0.8898766
[3,]  1.1399656  0.9128656
[4,] -0.9643168  0.8147557
[5,]  0.8608024  1.3642188
> 
> 
> 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.20-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.20-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.20-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  562  bytes.
Disk usage :  160  bytes.
> subBufferedMatrix(tmp,1:3,)
BufferedMatrix object
Matrix size:  3 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.20-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.8459329 1.099106 -1.334399 1.674742 2.407365 0.8931176 0.5553847
           col8      col9     col10    col11      col12      col13      col14
row1 0.07138166 -1.998853 -1.178667 1.015992 -0.1973721 -0.4910797 0.07880115
         col15     col16      col17    col18     col19      col20
row1 0.6694418 0.3617548 -0.2510455 1.463382 0.7009127 0.03558656
> tmp[,"col10"]
          col10
row1 -1.1786670
row2  0.1462230
row3  0.0678651
row4 -0.7906566
row5 -0.1453141
> tmp[c("row1","row5"),]
           col1      col2       col3      col4      col5      col6      col7
row1  0.8459329 1.0991060 -1.3343987 1.6747420  2.407365 0.8931176 0.5553847
row5 -0.3509720 0.6247815  0.5278798 0.2273895 -2.177302 1.5386981 1.5822072
           col8      col9      col10     col11      col12      col13      col14
row1 0.07138166 -1.998853 -1.1786670  1.015992 -0.1973721 -0.4910797 0.07880115
row5 0.93715717  1.968789 -0.1453141 -1.019106  0.6744614  1.8433719 0.58344081
         col15      col16       col17    col18      col19       col20
row1 0.6694418  0.3617548 -0.25104546 1.463382  0.7009127  0.03558656
row5 0.2146033 -0.3787457  0.03061066 0.181197 -0.3078112 -0.92482353
> tmp[,c("col6","col20")]
           col6       col20
row1  0.8931176  0.03558656
row2 -0.7614436  0.30340191
row3 -1.5771041  1.09859835
row4  0.1327524 -0.88702828
row5  1.5386981 -0.92482353
> tmp[c("row1","row5"),c("col6","col20")]
          col6       col20
row1 0.8931176  0.03558656
row5 1.5386981 -0.92482353
> 
> 
> 
> 
> 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.54059 51.51448 50.40439 51.66166 49.93272 105.607 50.4523 51.21755
         col9    col10    col11    col12    col13    col14    col15    col16
row1 49.61524 47.93174 49.62379 49.28595 50.14042 50.46349 49.49054 49.22604
        col17    col18    col19    col20
row1 50.30586 48.15581 52.83316 106.9416
> tmp[,"col10"]
        col10
row1 47.93174
row2 30.33653
row3 30.26902
row4 30.00123
row5 49.86975
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 49.54059 51.51448 50.40439 51.66166 49.93272 105.6070 50.45230 51.21755
row5 51.40134 50.81852 49.29338 51.21562 50.58743 103.2077 49.45517 49.11506
         col9    col10    col11    col12    col13    col14    col15    col16
row1 49.61524 47.93174 49.62379 49.28595 50.14042 50.46349 49.49054 49.22604
row5 49.94097 49.86975 47.97519 50.32452 49.11564 48.10166 49.79119 49.06258
        col17    col18    col19    col20
row1 50.30586 48.15581 52.83316 106.9416
row5 49.98419 49.58571 51.04868 104.4113
> tmp[,c("col6","col20")]
          col6     col20
row1 105.60700 106.94156
row2  74.04726  74.10025
row3  75.44566  76.17146
row4  76.58010  74.55287
row5 103.20772 104.41132
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 105.6070 106.9416
row5 103.2077 104.4113
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 105.6070 106.9416
row5 103.2077 104.4113
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
           col13
[1,]  1.69726408
[2,] -1.39201571
[3,]  1.09483551
[4,] -0.07223249
[5,] -0.12597651
> tmp[,c("col17","col7")]
            col17         col7
[1,]  0.008963927 -1.301984940
[2,]  1.694800941  0.006059178
[3,]  0.861631285 -0.584117501
[4,]  1.171046122 -0.106852724
[5,] -0.141272518 -0.547335905
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
           col6      col20
[1,]  1.7871357 -0.2338427
[2,] -0.7371668 -1.0805332
[3,] -0.4082799  0.1853244
[4,]  1.6757528  0.6369590
[5,] -1.3490809  0.8654399
> subBufferedMatrix(tmp,1,c("col6"))[,1]
         col1
[1,] 1.787136
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
           col6
[1,]  1.7871357
[2,] -0.7371668
> 
> 
> 
> 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.2452743 1.772311 0.5544820  0.3139992 -1.2758868 1.3657771 0.4921861
row1 -0.9752452 2.476749 0.8664444 -0.7881304 -0.2017068 0.4115175 0.6551952
           [,8]      [,9]     [,10]      [,11]      [,12]     [,13]      [,14]
row3 -1.7097679 0.3587866 0.6305116 -1.3191059 -1.0381345 -1.820848 -0.2670037
row1  0.3550681 0.2476996 0.7550039  0.8884395 -0.4019518  2.194061 -1.1142287
          [,15]      [,16]      [,17]      [,18]     [,19]    [,20]
row3 -0.8060375 -0.5884368 -0.4257041  0.2737428 0.1434370 0.575667
row1  0.4792600 -0.4464058 -0.7263199 -1.5643725 0.6158844 2.115345
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
           [,1]      [,2]      [,3]      [,4]       [,5]       [,6]       [,7]
row2 0.07526807 -1.213921 -1.346949 -1.137139 -0.4462154 -0.7267388 -0.5600422
          [,8]       [,9]      [,10]
row2 0.9788053 -0.2668515 -0.6402868
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
           [,1]      [,2]      [,3]      [,4]     [,5]     [,6]       [,7]
row5 0.07158656 -2.079453 0.6581835 -1.223288 1.383188 2.043547 0.05632664
         [,8]      [,9]      [,10]     [,11]    [,12]      [,13]     [,14]
row5 -0.41669 -2.553959 -0.9293954 0.7434788 0.538901 -0.3649947 0.1927394
         [,15]      [,16]     [,17]      [,18]    [,19]    [,20]
row5 0.5798488 -0.8146802 0.9488029 -0.7661028 1.343867 1.005149
> 
> 
> 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: 0x6000036bc000>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM2e9969466569"
 [2] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM2e99cac067e" 
 [3] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM2e9971de40b1"
 [4] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM2e9936695ede"
 [5] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM2e993fd35cba"
 [6] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM2e994d6cd812"
 [7] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM2e9924ddad74"
 [8] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM2e9955a6ad94"
 [9] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM2e9931cdfb7a"
[10] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM2e994a392021"
[11] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM2e996c6c7c98"
[12] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM2e99466816c4"
[13] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM2e995baec1f8"
[14] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM2e992e40afce"
[15] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM2e9918d6151b"
> 
> 
> ### 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: 0x6000036d4180>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x6000036d4180>
Warning message:
In dir.create(new.directory) :
  '/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x6000036d4180>
> rowMedians(tmp)
  [1] -0.381807827 -0.295516148 -0.012023078  0.433452549 -0.170950569
  [6] -0.623911262  0.357219656  0.084715343 -0.167918515  0.357131591
 [11] -0.265499898 -0.517748581  0.376609615  0.001155300 -0.145176710
 [16] -0.058901766 -0.382156205 -0.259066555 -0.386899779  0.199953912
 [21] -1.016075997 -0.525225134 -0.015991619 -0.089737510  0.417689056
 [26] -0.480212522  0.010585334  0.228958887 -0.060136131  0.489655497
 [31]  0.297546065 -0.059943860 -0.832306360 -0.064616442  0.093809309
 [36]  0.144106255  0.126262897 -0.078334189 -0.205397991 -0.430612526
 [41]  0.081446038 -0.089963898  0.034550344  0.472296280 -0.018971341
 [46] -0.043690077 -0.338726570 -0.671691038  0.107438560 -0.224487552
 [51] -0.357408872  0.168114072  0.142254697  0.037615519 -0.262454891
 [56]  0.475790398  0.622030573 -0.425292203  0.018489922 -0.192670568
 [61] -0.231217793 -0.103293386 -0.394024056 -0.002242009 -0.405551955
 [66]  0.135930026 -0.168145057  0.083512011 -0.087492809  0.132391845
 [71]  0.229118469 -0.094071784  0.377245962 -0.106103073  0.400941742
 [76] -0.003937339 -0.002912536  0.159075373  0.134622420 -0.023467047
 [81]  0.355270538  0.161384769  0.738141753 -0.490520011  0.119145451
 [86] -0.004659482  0.203737052  0.120634885 -0.454973606 -0.192332745
 [91] -0.270654599 -0.624439280  0.500605137  0.110642466 -0.217435384
 [96] -0.002685763  0.396014924 -0.422767021  0.028444959  0.130536535
[101] -0.182441851  0.391384923  0.510080946  0.136074998  0.003962278
[106] -0.234089834  0.284702977  0.552720437 -0.563168465 -0.101926328
[111] -0.133464459 -0.344470445  0.558088993 -0.325246066  0.184915920
[116] -0.331235367  0.032391588 -0.038976988  0.283036332 -1.018210219
[121]  0.160072517 -0.083063715 -0.178400887 -0.220074633 -0.106702536
[126]  0.100127488 -0.324804676 -0.399444462  0.024998766  0.162311533
[131]  0.070398728 -0.115212652 -0.798286907 -0.268458811 -0.227213968
[136] -0.602285022 -0.235370323 -0.126050663 -0.006442522 -0.096657694
[141] -0.430813953 -0.008850355 -0.079418768 -0.266355158 -0.540380983
[146] -0.519070371 -0.009125977  0.074391455 -0.024769317  0.426681553
[151]  0.235552813  0.258714440 -0.042810977  0.638409534  0.204579099
[156] -0.367257321 -0.027810433 -0.214300854  0.516560211  0.203854202
[161]  0.201609022  0.045547793 -0.201246196 -0.001705739  0.097611162
[166] -0.087385216 -0.735750342 -0.142474876 -0.059348580 -0.380782449
[171]  0.320567366  0.120212812 -0.028682156  0.326176799  0.437883432
[176]  0.057054758 -0.671407616  0.206073474  0.364431981 -0.008087774
[181]  0.074269818 -0.514277310 -0.136658124  0.962612672 -0.038867555
[186] -0.082200629  0.380430796  0.306576039  0.131795055  0.252661741
[191] -0.103219657  0.561481966  0.406091503  0.089264888 -0.001387507
[196]  0.063954268  0.047915937 -0.860846728  0.085063485  0.195941250
[201]  0.543917300 -0.561027749 -0.188821146  0.176247413  0.351965594
[206]  0.233690259  0.155793914  0.048695032 -0.036230588 -0.343611757
[211]  0.753530851 -0.396584943  0.281381442  0.088286847 -0.620266542
[216]  0.351889101 -0.033043547 -0.252167600  0.419536108 -0.273220686
[221]  0.077688375  0.329232278 -0.283358011  0.404697658 -0.169806999
[226] -0.010762231  0.175142054 -0.341274382  0.095683669  0.052409493
> 
> proc.time()
   user  system elapsed 
  5.164  18.330  25.002 

BufferedMatrix.Rcheck/tests/rawCalltesting.Rout


R version 4.4.0 Patched (2024-04-24 r86482) -- "Puppy Cup"
Copyright (C) 2024 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: 0x600003398000>
> .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: 0x600003398000>
> .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: 0x600003398000>
> .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: 0x600003398000>
> 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: 0x600003384000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600003384000>
> .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: 0x600003384000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600003384000>
> .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: 0x600003384000>
> 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: 0x600003380000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600003380000>
> .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: 0x600003380000>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x600003380000>
> .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: 0x600003380000>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x600003380000>
> .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: 0x600003380000>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x600003380000>
> .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: 0x600003380000>
> 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: 0x600003380180>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x600003380180>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600003380180>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600003380180>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile354c7594f9a6" "BufferedMatrixFile354c7923d99" 
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile354c7594f9a6" "BufferedMatrixFile354c7923d99" 
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000033a0120>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000033a0120>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x6000033a0120>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x6000033a0120>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x6000033a0120>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x6000033a0120>
> .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: 0x600003388060>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600003388060>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x600003388060>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x600003388060>
> 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: 0x600003380420>
> .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: 0x600003380420>
> rm(P)
> 
> proc.time()
   user  system elapsed 
  0.603   0.210   0.796 

BufferedMatrix.Rcheck/tests/Rcodetesting.Rout


R version 4.4.0 Patched (2024-04-24 r86482) -- "Puppy Cup"
Copyright (C) 2024 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.587   0.140   0.708 

Example timings