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

This page was generated on 2024-08-27 17:41 -0400 (Tue, 27 Aug 2024).

HostnameOSArch (*)R versionInstalled pkgs
nebbiolo1Linux (Ubuntu 22.04.3 LTS)x86_644.4.1 (2024-06-14) -- "Race for Your Life" 4757
palomino7Windows Server 2022 Datacenterx644.4.1 (2024-06-14 ucrt) -- "Race for Your Life" 4494
merida1macOS 12.7.5 Montereyx86_644.4.1 (2024-06-14) -- "Race for Your Life" 4523
kjohnson1macOS 13.6.6 Venturaarm644.4.1 (2024-06-14) -- "Race for Your Life" 4472
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 249/2300HostnameOS / ArchINSTALLBUILDCHECKBUILD BIN
BufferedMatrix 1.68.0  (landing page)
Ben Bolstad
Snapshot Date: 2024-08-25 14:00 -0400 (Sun, 25 Aug 2024)
git_url: https://git.bioconductor.org/packages/BufferedMatrix
git_branch: RELEASE_3_19
git_last_commit: af6c73d
git_last_commit_date: 2024-04-30 10:16:21 -0400 (Tue, 30 Apr 2024)
nebbiolo1Linux (Ubuntu 22.04.3 LTS) / x86_64  OK    OK    OK  UNNEEDED, same version is already published
palomino7Windows Server 2022 Datacenter / x64  OK    OK    OK    OK  UNNEEDED, same version is already published
merida1macOS 12.7.5 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.68.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.68.0.tar.gz
StartedAt: 2024-08-26 02:03:57 -0400 (Mon, 26 Aug 2024)
EndedAt: 2024-08-26 02:05:15 -0400 (Mon, 26 Aug 2024)
EllapsedTime: 78.2 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.68.0.tar.gz
###
##############################################################################
##############################################################################


* using log directory ‘/Users/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck’
* using R version 4.4.1 (2024-06-14)
* 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.5
* using session charset: UTF-8
* using option ‘--no-vignettes’
* checking for file ‘BufferedMatrix/DESCRIPTION’ ... OK
* this is package ‘BufferedMatrix’ version ‘1.68.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.19-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.19-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.1 (2024-06-14) -- "Race for Your Life"
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.594   0.200   0.836 

BufferedMatrix.Rcheck/tests/objectTesting.Rout


R version 4.4.1 (2024-06-14) -- "Race for Your Life"
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.19-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 474173 25.4    1035481 55.4         NA   638597 34.2
Vcells 877659  6.7    8388608 64.0      65536  2072435 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] "Mon Aug 26 02:04:33 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] "Mon Aug 26 02:04:33 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: 0x600000d9c000>
> 
> 
> 
> 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] "Mon Aug 26 02:04:40 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] "Mon Aug 26 02:04:43 2024"
> 
> ColMode(tmp2)
<pointer: 0x600000d9c000>
> 
> 
> 
> ### Now testing assignments
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+ 
+   new.data <- rnorm(20)
+   tmp2[which.row,] <- new.data
+   test.matrix[which.row,] <- new.data
+   if (rep > 1){
+     if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+   
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   new.data <- rnorm(10)
+   tmp2[,which.col] <- new.data
+   test.matrix[,which.col]<- new.data
+ 
+   if (rep > 1){
+     if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.col <- which.col
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,5,replace=TRUE)
+   new.data <- matrix(rnorm(50),5,10)
+   tmp2[,which.col] <- new.data
+   test.matrix[,which.col]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.col <- which.col
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   new.data <- matrix(rnorm(50),5,10)
+   tmp2[which.row,] <- new.data
+   test.matrix[which.row,]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col  <- sample(1:20,5,replace=TRUE)
+   new.data <- matrix(rnorm(25),5,5)
+   tmp2[which.row,which.col] <- new.data
+   test.matrix[which.row,which.col]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[prev.row,prev.col] == test.matrix[prev.row,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+   prev.col <- which.col
+ }
> 
> 
> 
> 
> ###
> ###
> ### testing some more functions
> ###
> 
> 
> 
> ## duplication function
> tmp5 <- duplicate(tmp2)
> 
> # making sure really did copy everything.
> tmp5[1,1] <- tmp5[1,1] +100.00
> 
> if (tmp5[1,1] == tmp2[1,1]){
+   stop("Problem with duplication")
+ }
> 
> 
> 
> 
> ### testing elementwise applying of functions
> 
> tmp5[1:4,1:4]
            [,1]       [,2]       [,3]        [,4]
[1,] 100.3939308  0.5398050  0.5117220 -0.59262673
[2,]   0.8126314 -1.1288831 -0.3957404  0.06089165
[3,]   1.6070852  0.7977457 -0.9849103  1.70940252
[4,]   0.3130796 -0.9106585 -1.1383514  2.12601748
> ewApply(tmp5,abs)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
            [,1]      [,2]      [,3]       [,4]
[1,] 100.3939308 0.5398050 0.5117220 0.59262673
[2,]   0.8126314 1.1288831 0.3957404 0.06089165
[3,]   1.6070852 0.7977457 0.9849103 1.70940252
[4,]   0.3130796 0.9106585 1.1383514 2.12601748
> ewApply(tmp5,sqrt)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
           [,1]      [,2]      [,3]      [,4]
[1,] 10.0196772 0.7347143 0.7153474 0.7698225
[2,]  0.9014607 1.0624891 0.6290790 0.2467623
[3,]  1.2677086 0.8931661 0.9924265 1.3074412
[4,]  0.5595352 0.9542843 1.0669355 1.4580869
> 
> 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.19-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
          [,1]     [,2]     [,3]     [,4]
[1,] 225.59070 32.88695 32.66520 33.29085
[2,]  34.82724 36.75377 31.68653 27.52851
[3,]  39.28417 34.72941 35.90918 39.78381
[4,]  30.90843 35.45350 36.80771 41.70689
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x600000da0000>
> exp(tmp5)
<pointer: 0x600000da0000>
> log(tmp5,2)
<pointer: 0x600000da0000>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 469.5375
> Min(tmp5)
[1] 53.06951
> mean(tmp5)
[1] 72.28292
> Sum(tmp5)
[1] 14456.58
> Var(tmp5)
[1] 866.6762
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 91.71064 68.48283 74.28023 70.81124 71.22301 65.82333 69.93156 67.48851
 [9] 74.66225 68.41563
> rowSums(tmp5)
 [1] 1834.213 1369.657 1485.605 1416.225 1424.460 1316.467 1398.631 1349.770
 [9] 1493.245 1368.313
> rowVars(tmp5)
 [1] 7958.35533   57.86453   79.14605   71.68875   73.95346   71.56706
 [7]   58.09221   72.51673   42.79722   75.50652
> rowSd(tmp5)
 [1] 89.209615  7.606874  8.896407  8.466921  8.599620  8.459732  7.621825
 [8]  8.515676  6.541958  8.689449
> rowMax(tmp5)
 [1] 469.53749  82.40060  94.66616  86.80742  85.49890  82.54209  85.22276
 [8]  81.89665  87.50303  86.10516
> rowMin(tmp5)
 [1] 61.66823 54.65086 56.59323 54.13855 55.84388 54.80520 57.87395 53.06951
 [9] 62.35391 54.08276
> 
> colMeans(tmp5)
 [1] 112.65325  68.21472  72.43076  67.38163  66.15711  66.15236  71.87791
 [8]  74.32307  69.68843  72.50539  66.46858  71.77916  69.21331  73.48395
[15]  67.27266  72.50769  68.18728  75.19454  68.53638  71.63026
> colSums(tmp5)
 [1] 1126.5325  682.1472  724.3076  673.8163  661.5711  661.5236  718.7791
 [8]  743.2307  696.8843  725.0539  664.6858  717.7916  692.1331  734.8395
[15]  672.7266  725.0769  681.8728  751.9454  685.3638  716.3026
> colVars(tmp5)
 [1] 15802.93782    49.76976    68.15761   121.87015    77.51618    41.26269
 [7]    70.48778    88.25561    28.77961    57.32343    49.70830    57.89265
[13]    56.51720    59.88085    72.80348    32.33419    22.08342   150.05103
[19]    62.49465   119.30429
> colSd(tmp5)
 [1] 125.709736   7.054769   8.255762  11.039481   8.804327   6.423604
 [7]   8.395700   9.394445   5.364663   7.571224   7.050412   7.608722
[13]   7.517792   7.738272   8.532495   5.686316   4.699300  12.249532
[19]   7.905356  10.922650
> colMax(tmp5)
 [1] 469.53749  76.49817  83.76648  86.80742  82.40060  76.52626  80.48611
 [8]  83.88205  77.56745  81.89665  78.78279  80.02347  81.13245  82.74786
[15]  82.04983  78.73808  73.52649  94.66616  83.12467  87.50303
> colMin(tmp5)
 [1] 54.14528 57.69325 60.79450 54.08276 55.84388 56.10558 54.13855 54.65086
 [9] 62.04979 60.01975 53.06951 57.16404 58.72254 61.30065 57.87395 62.24219
[17] 58.45441 60.54903 57.93118 55.46708
> 
> 
> ### 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] 91.71064 68.48283       NA 70.81124 71.22301 65.82333 69.93156 67.48851
 [9] 74.66225 68.41563
> rowSums(tmp5)
 [1] 1834.213 1369.657       NA 1416.225 1424.460 1316.467 1398.631 1349.770
 [9] 1493.245 1368.313
> rowVars(tmp5)
 [1] 7958.35533   57.86453   83.49461   71.68875   73.95346   71.56706
 [7]   58.09221   72.51673   42.79722   75.50652
> rowSd(tmp5)
 [1] 89.209615  7.606874  9.137538  8.466921  8.599620  8.459732  7.621825
 [8]  8.515676  6.541958  8.689449
> rowMax(tmp5)
 [1] 469.53749  82.40060        NA  86.80742  85.49890  82.54209  85.22276
 [8]  81.89665  87.50303  86.10516
> rowMin(tmp5)
 [1] 61.66823 54.65086       NA 54.13855 55.84388 54.80520 57.87395 53.06951
 [9] 62.35391 54.08276
> 
> colMeans(tmp5)
 [1] 112.65325  68.21472  72.43076  67.38163  66.15711  66.15236  71.87791
 [8]  74.32307  69.68843  72.50539  66.46858        NA  69.21331  73.48395
[15]  67.27266  72.50769  68.18728  75.19454  68.53638  71.63026
> colSums(tmp5)
 [1] 1126.5325  682.1472  724.3076  673.8163  661.5711  661.5236  718.7791
 [8]  743.2307  696.8843  725.0539  664.6858        NA  692.1331  734.8395
[15]  672.7266  725.0769  681.8728  751.9454  685.3638  716.3026
> colVars(tmp5)
 [1] 15802.93782    49.76976    68.15761   121.87015    77.51618    41.26269
 [7]    70.48778    88.25561    28.77961    57.32343    49.70830          NA
[13]    56.51720    59.88085    72.80348    32.33419    22.08342   150.05103
[19]    62.49465   119.30429
> colSd(tmp5)
 [1] 125.709736   7.054769   8.255762  11.039481   8.804327   6.423604
 [7]   8.395700   9.394445   5.364663   7.571224   7.050412         NA
[13]   7.517792   7.738272   8.532495   5.686316   4.699300  12.249532
[19]   7.905356  10.922650
> colMax(tmp5)
 [1] 469.53749  76.49817  83.76648  86.80742  82.40060  76.52626  80.48611
 [8]  83.88205  77.56745  81.89665  78.78279        NA  81.13245  82.74786
[15]  82.04983  78.73808  73.52649  94.66616  83.12467  87.50303
> colMin(tmp5)
 [1] 54.14528 57.69325 60.79450 54.08276 55.84388 56.10558 54.13855 54.65086
 [9] 62.04979 60.01975 53.06951       NA 58.72254 61.30065 57.87395 62.24219
[17] 58.45441 60.54903 57.93118 55.46708
> 
> Max(tmp5,na.rm=TRUE)
[1] 469.5375
> Min(tmp5,na.rm=TRUE)
[1] 53.06951
> mean(tmp5,na.rm=TRUE)
[1] 72.26831
> Sum(tmp5,na.rm=TRUE)
[1] 14381.39
> Var(tmp5,na.rm=TRUE)
[1] 871.0104
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 91.71064 68.48283 74.23233 70.81124 71.22301 65.82333 69.93156 67.48851
 [9] 74.66225 68.41563
> rowSums(tmp5,na.rm=TRUE)
 [1] 1834.213 1369.657 1410.414 1416.225 1424.460 1316.467 1398.631 1349.770
 [9] 1493.245 1368.313
> rowVars(tmp5,na.rm=TRUE)
 [1] 7958.35533   57.86453   83.49461   71.68875   73.95346   71.56706
 [7]   58.09221   72.51673   42.79722   75.50652
> rowSd(tmp5,na.rm=TRUE)
 [1] 89.209615  7.606874  9.137538  8.466921  8.599620  8.459732  7.621825
 [8]  8.515676  6.541958  8.689449
> rowMax(tmp5,na.rm=TRUE)
 [1] 469.53749  82.40060  94.66616  86.80742  85.49890  82.54209  85.22276
 [8]  81.89665  87.50303  86.10516
> rowMin(tmp5,na.rm=TRUE)
 [1] 61.66823 54.65086 56.59323 54.13855 55.84388 54.80520 57.87395 53.06951
 [9] 62.35391 54.08276
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 112.65325  68.21472  72.43076  67.38163  66.15711  66.15236  71.87791
 [8]  74.32307  69.68843  72.50539  66.46858  71.40013  69.21331  73.48395
[15]  67.27266  72.50769  68.18728  75.19454  68.53638  71.63026
> colSums(tmp5,na.rm=TRUE)
 [1] 1126.5325  682.1472  724.3076  673.8163  661.5711  661.5236  718.7791
 [8]  743.2307  696.8843  725.0539  664.6858  642.6012  692.1331  734.8395
[15]  672.7266  725.0769  681.8728  751.9454  685.3638  716.3026
> colVars(tmp5,na.rm=TRUE)
 [1] 15802.93782    49.76976    68.15761   121.87015    77.51618    41.26269
 [7]    70.48778    88.25561    28.77961    57.32343    49.70830    63.51304
[13]    56.51720    59.88085    72.80348    32.33419    22.08342   150.05103
[19]    62.49465   119.30429
> colSd(tmp5,na.rm=TRUE)
 [1] 125.709736   7.054769   8.255762  11.039481   8.804327   6.423604
 [7]   8.395700   9.394445   5.364663   7.571224   7.050412   7.969507
[13]   7.517792   7.738272   8.532495   5.686316   4.699300  12.249532
[19]   7.905356  10.922650
> colMax(tmp5,na.rm=TRUE)
 [1] 469.53749  76.49817  83.76648  86.80742  82.40060  76.52626  80.48611
 [8]  83.88205  77.56745  81.89665  78.78279  80.02347  81.13245  82.74786
[15]  82.04983  78.73808  73.52649  94.66616  83.12467  87.50303
> colMin(tmp5,na.rm=TRUE)
 [1] 54.14528 57.69325 60.79450 54.08276 55.84388 56.10558 54.13855 54.65086
 [9] 62.04979 60.01975 53.06951 57.16404 58.72254 61.30065 57.87395 62.24219
[17] 58.45441 60.54903 57.93118 55.46708
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1] 91.71064 68.48283      NaN 70.81124 71.22301 65.82333 69.93156 67.48851
 [9] 74.66225 68.41563
> rowSums(tmp5,na.rm=TRUE)
 [1] 1834.213 1369.657    0.000 1416.225 1424.460 1316.467 1398.631 1349.770
 [9] 1493.245 1368.313
> rowVars(tmp5,na.rm=TRUE)
 [1] 7958.35533   57.86453         NA   71.68875   73.95346   71.56706
 [7]   58.09221   72.51673   42.79722   75.50652
> rowSd(tmp5,na.rm=TRUE)
 [1] 89.209615  7.606874        NA  8.466921  8.599620  8.459732  7.621825
 [8]  8.515676  6.541958  8.689449
> rowMax(tmp5,na.rm=TRUE)
 [1] 469.53749  82.40060        NA  86.80742  85.49890  82.54209  85.22276
 [8]  81.89665  87.50303  86.10516
> rowMin(tmp5,na.rm=TRUE)
 [1] 61.66823 54.65086       NA 54.13855 55.84388 54.80520 57.87395 53.06951
 [9] 62.35391 54.08276
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1] 116.08530  67.76250  72.17415  65.66795  67.21977  65.54387  70.92145
 [8]  74.77473  68.85297  73.89269  65.10034       NaN  70.14185  73.37871
[15]  65.63075  71.81543  67.96236  73.03103  67.63247  72.23157
> colSums(tmp5,na.rm=TRUE)
 [1] 1044.7677  609.8625  649.5673  591.0115  604.9779  589.8948  638.2930
 [8]  672.9726  619.6767  665.0342  585.9030    0.0000  631.2766  660.4084
[15]  590.6767  646.3388  611.6613  657.2792  608.6922  650.0841
> colVars(tmp5,na.rm=TRUE)
 [1] 17645.79211    53.69032    75.93651   104.06586    74.50182    42.25502
 [7]    69.00695    96.99255    24.52461    42.83728    34.86078          NA
[13]    53.88227    67.24136    51.57544    30.98461    24.27474   116.14852
[19]    61.11456   130.14964
> colSd(tmp5,na.rm=TRUE)
 [1] 132.837465   7.327368   8.714156  10.201267   8.631444   6.500386
 [7]   8.307042   9.848479   4.952233   6.545019   5.904302         NA
[13]   7.340454   8.200083   7.181605   5.566382   4.926940  10.777222
[19]   7.817580  11.408315
> colMax(tmp5,na.rm=TRUE)
 [1] 469.53749  76.49817  83.76648  86.80742  82.40060  76.52626  78.28891
 [8]  83.88205  77.56745  81.89665  71.90936      -Inf  81.13245  82.74786
[15]  79.51284  78.28581  73.52649  86.10516  83.12467  87.50303
> colMin(tmp5,na.rm=TRUE)
 [1] 54.14528 57.69325 60.79450 54.08276 55.84388 56.10558 54.13855 54.65086
 [9] 62.04979 65.67086 53.06951      Inf 58.72254 61.30065 57.87395 62.24219
[17] 58.45441 60.54903 57.93118 55.46708
> 
> 
> 
> 
> 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] 401.0638 276.6407 148.9552 397.9358 240.3417 250.5654 151.8158 229.7032
 [9] 186.2598 138.0567
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 401.0638 276.6407 148.9552 397.9358 240.3417 250.5654 151.8158 229.7032
 [9] 186.2598 138.0567
> 
> 
> 
> 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-14  1.421085e-13  0.000000e+00 -9.947598e-14 -1.136868e-13
 [6]  1.705303e-13  3.552714e-14  0.000000e+00 -1.136868e-13  0.000000e+00
[11]  0.000000e+00  2.842171e-14  7.815970e-14  1.421085e-14  0.000000e+00
[16]  2.842171e-14 -2.273737e-13  2.842171e-14  8.526513e-14 -5.684342e-14
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> ## making sure these things agree
> ##
> ## first when there is no NA
> 
> 
> 
> agree.checks <- function(buff.matrix,r.matrix,err.tol=1e-10){
+ 
+   if (Max(buff.matrix,na.rm=TRUE) != max(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Max")
+   }
+   
+ 
+   if (Min(buff.matrix,na.rm=TRUE) != min(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Min")
+   }
+ 
+ 
+   if (abs(Sum(buff.matrix,na.rm=TRUE)- sum(r.matrix,na.rm=TRUE)) > err.tol){
+ 
+     cat(Sum(buff.matrix,na.rm=TRUE),"\n")
+     cat(sum(r.matrix,na.rm=TRUE),"\n")
+     cat(Sum(buff.matrix,na.rm=TRUE) - sum(r.matrix,na.rm=TRUE),"\n")
+     
+     stop("No agreement in Sum")
+   }
+   
+   if (abs(mean(buff.matrix,na.rm=TRUE) - mean(r.matrix,na.rm=TRUE)) > err.tol){
+     stop("No agreement in mean")
+   }
+   
+   
+   if(abs(Var(buff.matrix,na.rm=TRUE) - var(as.vector(r.matrix),na.rm=TRUE)) > err.tol){
+     stop("No agreement in Var")
+   }
+   
+   
+ 
+   if(any(abs(rowMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,mean,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowMeans")
+   }
+   
+   
+   if(any(abs(colMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,mean,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colMeans")
+   }
+   
+   
+   if(any(abs(rowSums(buff.matrix,na.rm=TRUE)  -  apply(r.matrix,1,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in rowSums")
+   }
+   
+   
+   if(any(abs(colSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colSums")
+   }
+   
+   ### this is to get around the fact that R doesn't like to compute NA on an entire vector of NA when 
+   ### computing variance
+   my.Var <- function(x,na.rm=FALSE){
+    if (all(is.na(x))){
+      return(NA)
+    } else {
+      var(x,na.rm=na.rm)
+    }
+ 
+   }
+   
+   if(any(abs(rowVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+   
+   
+   if(any(abs(colVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+ 
+ 
+   if(any(abs(rowMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+ 
+   if(any(abs(colMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+   
+   
+   if(any(abs(rowMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+   
+ 
+   if(any(abs(colMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+ 
+   if(any(abs(colMedians(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,median,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMedian")
+   }
+ 
+   if(any(abs(colRanges(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,range,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colRanges")
+   }
+ 
+ 
+   
+ }
> 
> 
> 
> 
> 
> 
> 
> 
> 
> for (rep in 1:20){
+   copymatrix <- matrix(rnorm(200,150,15),10,20)
+   
+   tmp5[1:10,1:20] <- copymatrix
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ## now lets assign some NA values and check agreement
+ 
+   which.row <- sample(1:10,1,replace=TRUE)
+   which.col  <- sample(1:20,1,replace=TRUE)
+   
+   cat(which.row," ",which.col,"\n")
+   
+   tmp5[which.row,which.col] <- NA
+   copymatrix[which.row,which.col] <- NA
+   
+   agree.checks(tmp5,copymatrix)
+ 
+   ## make an entire row NA
+   tmp5[which.row,] <- NA
+   copymatrix[which.row,] <- NA
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ### also make an entire col NA
+   tmp5[,which.col] <- NA
+   copymatrix[,which.col] <- NA
+ 
+   agree.checks(tmp5,copymatrix)
+ 
+   ### now make 1 element non NA with NA in the rest of row and column
+ 
+   tmp5[which.row,which.col] <- rnorm(1,150,15)
+   copymatrix[which.row,which.col] <- tmp5[which.row,which.col]
+ 
+   agree.checks(tmp5,copymatrix)
+ }
8   12 
8   3 
3   18 
7   6 
6   7 
5   17 
4   12 
6   5 
3   3 
1   10 
2   16 
5   9 
10   9 
9   20 
3   13 
4   5 
1   1 
9   4 
8   10 
9   12 
There were 50 or more warnings (use warnings() to see the first 50)
> 
> 
> ### now test 1 by n and n by 1 matrix
> 
> 
> err.tol <- 1e-12
> 
> rm(tmp5)
> 
> dataset1 <- rnorm(100)
> dataset2 <- rnorm(100)
> 
> tmp <- createBufferedMatrix(1,100)
> tmp[1,] <- dataset1
> 
> tmp2 <- createBufferedMatrix(100,1)
> tmp2[,1] <- dataset2
> 
> 
> 
> 
> 
> Max(tmp)
[1] 3.169548
> Min(tmp)
[1] -3.084673
> mean(tmp)
[1] 0.09303707
> Sum(tmp)
[1] 9.303707
> Var(tmp)
[1] 1.160438
> 
> rowMeans(tmp)
[1] 0.09303707
> rowSums(tmp)
[1] 9.303707
> rowVars(tmp)
[1] 1.160438
> rowSd(tmp)
[1] 1.077236
> rowMax(tmp)
[1] 3.169548
> rowMin(tmp)
[1] -3.084673
> 
> colMeans(tmp)
  [1] -1.848078651  1.925639593  0.365485114  0.028240299  1.816959319
  [6]  0.054147347  1.114376442  1.814777947  1.019503456  0.532711013
 [11] -0.735828490  3.169547987 -0.393088720  0.029858786 -1.360747049
 [16] -0.410129199 -0.041606850  0.663046423  1.468702913  0.175259165
 [21]  0.002541998 -0.705802597  1.141529054  1.471558473  0.379260805
 [26]  0.138654900 -1.207739153  0.290027897  0.668646944  1.852540647
 [31] -0.670222684 -0.867966555  2.068286630  0.491445367  0.782686933
 [36]  0.164667711 -0.821750626 -1.503855581  0.455527164 -0.874304145
 [41] -0.070662862 -0.089605613 -0.866131642  1.121640193 -0.212365502
 [46] -1.381568386 -0.187009446 -0.265934980 -0.206489727 -1.041269443
 [51] -0.903758439 -0.684574888  1.000840074  0.756837543 -1.036274320
 [56] -1.028366386 -0.070460906  0.141552533  1.117197886 -0.324149181
 [61] -0.220988535 -0.328147360  2.449224162  0.213239844 -0.334145998
 [66] -1.599929472  0.360634349 -3.084673339  0.758441119  0.411278551
 [71]  1.298639389  1.298661234 -0.333409065 -0.229319919  0.295947216
 [76] -0.381932808 -1.683169351  0.061930896 -1.333270250  0.185993533
 [81]  0.185759130 -0.513776129  0.654159963  1.315908730 -0.700046112
 [86]  0.512204136 -1.306107840 -0.252487748  0.918920620  0.290981736
 [91]  1.090529992  0.128278076  1.089984551  2.360475861  0.613149077
 [96] -0.343822062  1.574179354 -0.715766600 -2.232361251 -1.585416958
> colSums(tmp)
  [1] -1.848078651  1.925639593  0.365485114  0.028240299  1.816959319
  [6]  0.054147347  1.114376442  1.814777947  1.019503456  0.532711013
 [11] -0.735828490  3.169547987 -0.393088720  0.029858786 -1.360747049
 [16] -0.410129199 -0.041606850  0.663046423  1.468702913  0.175259165
 [21]  0.002541998 -0.705802597  1.141529054  1.471558473  0.379260805
 [26]  0.138654900 -1.207739153  0.290027897  0.668646944  1.852540647
 [31] -0.670222684 -0.867966555  2.068286630  0.491445367  0.782686933
 [36]  0.164667711 -0.821750626 -1.503855581  0.455527164 -0.874304145
 [41] -0.070662862 -0.089605613 -0.866131642  1.121640193 -0.212365502
 [46] -1.381568386 -0.187009446 -0.265934980 -0.206489727 -1.041269443
 [51] -0.903758439 -0.684574888  1.000840074  0.756837543 -1.036274320
 [56] -1.028366386 -0.070460906  0.141552533  1.117197886 -0.324149181
 [61] -0.220988535 -0.328147360  2.449224162  0.213239844 -0.334145998
 [66] -1.599929472  0.360634349 -3.084673339  0.758441119  0.411278551
 [71]  1.298639389  1.298661234 -0.333409065 -0.229319919  0.295947216
 [76] -0.381932808 -1.683169351  0.061930896 -1.333270250  0.185993533
 [81]  0.185759130 -0.513776129  0.654159963  1.315908730 -0.700046112
 [86]  0.512204136 -1.306107840 -0.252487748  0.918920620  0.290981736
 [91]  1.090529992  0.128278076  1.089984551  2.360475861  0.613149077
 [96] -0.343822062  1.574179354 -0.715766600 -2.232361251 -1.585416958
> 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.848078651  1.925639593  0.365485114  0.028240299  1.816959319
  [6]  0.054147347  1.114376442  1.814777947  1.019503456  0.532711013
 [11] -0.735828490  3.169547987 -0.393088720  0.029858786 -1.360747049
 [16] -0.410129199 -0.041606850  0.663046423  1.468702913  0.175259165
 [21]  0.002541998 -0.705802597  1.141529054  1.471558473  0.379260805
 [26]  0.138654900 -1.207739153  0.290027897  0.668646944  1.852540647
 [31] -0.670222684 -0.867966555  2.068286630  0.491445367  0.782686933
 [36]  0.164667711 -0.821750626 -1.503855581  0.455527164 -0.874304145
 [41] -0.070662862 -0.089605613 -0.866131642  1.121640193 -0.212365502
 [46] -1.381568386 -0.187009446 -0.265934980 -0.206489727 -1.041269443
 [51] -0.903758439 -0.684574888  1.000840074  0.756837543 -1.036274320
 [56] -1.028366386 -0.070460906  0.141552533  1.117197886 -0.324149181
 [61] -0.220988535 -0.328147360  2.449224162  0.213239844 -0.334145998
 [66] -1.599929472  0.360634349 -3.084673339  0.758441119  0.411278551
 [71]  1.298639389  1.298661234 -0.333409065 -0.229319919  0.295947216
 [76] -0.381932808 -1.683169351  0.061930896 -1.333270250  0.185993533
 [81]  0.185759130 -0.513776129  0.654159963  1.315908730 -0.700046112
 [86]  0.512204136 -1.306107840 -0.252487748  0.918920620  0.290981736
 [91]  1.090529992  0.128278076  1.089984551  2.360475861  0.613149077
 [96] -0.343822062  1.574179354 -0.715766600 -2.232361251 -1.585416958
> colMin(tmp)
  [1] -1.848078651  1.925639593  0.365485114  0.028240299  1.816959319
  [6]  0.054147347  1.114376442  1.814777947  1.019503456  0.532711013
 [11] -0.735828490  3.169547987 -0.393088720  0.029858786 -1.360747049
 [16] -0.410129199 -0.041606850  0.663046423  1.468702913  0.175259165
 [21]  0.002541998 -0.705802597  1.141529054  1.471558473  0.379260805
 [26]  0.138654900 -1.207739153  0.290027897  0.668646944  1.852540647
 [31] -0.670222684 -0.867966555  2.068286630  0.491445367  0.782686933
 [36]  0.164667711 -0.821750626 -1.503855581  0.455527164 -0.874304145
 [41] -0.070662862 -0.089605613 -0.866131642  1.121640193 -0.212365502
 [46] -1.381568386 -0.187009446 -0.265934980 -0.206489727 -1.041269443
 [51] -0.903758439 -0.684574888  1.000840074  0.756837543 -1.036274320
 [56] -1.028366386 -0.070460906  0.141552533  1.117197886 -0.324149181
 [61] -0.220988535 -0.328147360  2.449224162  0.213239844 -0.334145998
 [66] -1.599929472  0.360634349 -3.084673339  0.758441119  0.411278551
 [71]  1.298639389  1.298661234 -0.333409065 -0.229319919  0.295947216
 [76] -0.381932808 -1.683169351  0.061930896 -1.333270250  0.185993533
 [81]  0.185759130 -0.513776129  0.654159963  1.315908730 -0.700046112
 [86]  0.512204136 -1.306107840 -0.252487748  0.918920620  0.290981736
 [91]  1.090529992  0.128278076  1.089984551  2.360475861  0.613149077
 [96] -0.343822062  1.574179354 -0.715766600 -2.232361251 -1.585416958
> colMedians(tmp)
  [1] -1.848078651  1.925639593  0.365485114  0.028240299  1.816959319
  [6]  0.054147347  1.114376442  1.814777947  1.019503456  0.532711013
 [11] -0.735828490  3.169547987 -0.393088720  0.029858786 -1.360747049
 [16] -0.410129199 -0.041606850  0.663046423  1.468702913  0.175259165
 [21]  0.002541998 -0.705802597  1.141529054  1.471558473  0.379260805
 [26]  0.138654900 -1.207739153  0.290027897  0.668646944  1.852540647
 [31] -0.670222684 -0.867966555  2.068286630  0.491445367  0.782686933
 [36]  0.164667711 -0.821750626 -1.503855581  0.455527164 -0.874304145
 [41] -0.070662862 -0.089605613 -0.866131642  1.121640193 -0.212365502
 [46] -1.381568386 -0.187009446 -0.265934980 -0.206489727 -1.041269443
 [51] -0.903758439 -0.684574888  1.000840074  0.756837543 -1.036274320
 [56] -1.028366386 -0.070460906  0.141552533  1.117197886 -0.324149181
 [61] -0.220988535 -0.328147360  2.449224162  0.213239844 -0.334145998
 [66] -1.599929472  0.360634349 -3.084673339  0.758441119  0.411278551
 [71]  1.298639389  1.298661234 -0.333409065 -0.229319919  0.295947216
 [76] -0.381932808 -1.683169351  0.061930896 -1.333270250  0.185993533
 [81]  0.185759130 -0.513776129  0.654159963  1.315908730 -0.700046112
 [86]  0.512204136 -1.306107840 -0.252487748  0.918920620  0.290981736
 [91]  1.090529992  0.128278076  1.089984551  2.360475861  0.613149077
 [96] -0.343822062  1.574179354 -0.715766600 -2.232361251 -1.585416958
> colRanges(tmp)
          [,1]    [,2]      [,3]      [,4]     [,5]       [,6]     [,7]
[1,] -1.848079 1.92564 0.3654851 0.0282403 1.816959 0.05414735 1.114376
[2,] -1.848079 1.92564 0.3654851 0.0282403 1.816959 0.05414735 1.114376
         [,8]     [,9]    [,10]      [,11]    [,12]      [,13]      [,14]
[1,] 1.814778 1.019503 0.532711 -0.7358285 3.169548 -0.3930887 0.02985879
[2,] 1.814778 1.019503 0.532711 -0.7358285 3.169548 -0.3930887 0.02985879
         [,15]      [,16]       [,17]     [,18]    [,19]     [,20]       [,21]
[1,] -1.360747 -0.4101292 -0.04160685 0.6630464 1.468703 0.1752592 0.002541998
[2,] -1.360747 -0.4101292 -0.04160685 0.6630464 1.468703 0.1752592 0.002541998
          [,22]    [,23]    [,24]     [,25]     [,26]     [,27]     [,28]
[1,] -0.7058026 1.141529 1.471558 0.3792608 0.1386549 -1.207739 0.2900279
[2,] -0.7058026 1.141529 1.471558 0.3792608 0.1386549 -1.207739 0.2900279
         [,29]    [,30]      [,31]      [,32]    [,33]     [,34]     [,35]
[1,] 0.6686469 1.852541 -0.6702227 -0.8679666 2.068287 0.4914454 0.7826869
[2,] 0.6686469 1.852541 -0.6702227 -0.8679666 2.068287 0.4914454 0.7826869
         [,36]      [,37]     [,38]     [,39]      [,40]       [,41]
[1,] 0.1646677 -0.8217506 -1.503856 0.4555272 -0.8743041 -0.07066286
[2,] 0.1646677 -0.8217506 -1.503856 0.4555272 -0.8743041 -0.07066286
           [,42]      [,43]   [,44]      [,45]     [,46]      [,47]     [,48]
[1,] -0.08960561 -0.8661316 1.12164 -0.2123655 -1.381568 -0.1870094 -0.265935
[2,] -0.08960561 -0.8661316 1.12164 -0.2123655 -1.381568 -0.1870094 -0.265935
          [,49]     [,50]      [,51]      [,52]   [,53]     [,54]     [,55]
[1,] -0.2064897 -1.041269 -0.9037584 -0.6845749 1.00084 0.7568375 -1.036274
[2,] -0.2064897 -1.041269 -0.9037584 -0.6845749 1.00084 0.7568375 -1.036274
         [,56]       [,57]     [,58]    [,59]      [,60]      [,61]      [,62]
[1,] -1.028366 -0.07046091 0.1415525 1.117198 -0.3241492 -0.2209885 -0.3281474
[2,] -1.028366 -0.07046091 0.1415525 1.117198 -0.3241492 -0.2209885 -0.3281474
        [,63]     [,64]     [,65]     [,66]     [,67]     [,68]     [,69]
[1,] 2.449224 0.2132398 -0.334146 -1.599929 0.3606343 -3.084673 0.7584411
[2,] 2.449224 0.2132398 -0.334146 -1.599929 0.3606343 -3.084673 0.7584411
         [,70]    [,71]    [,72]      [,73]      [,74]     [,75]      [,76]
[1,] 0.4112786 1.298639 1.298661 -0.3334091 -0.2293199 0.2959472 -0.3819328
[2,] 0.4112786 1.298639 1.298661 -0.3334091 -0.2293199 0.2959472 -0.3819328
         [,77]     [,78]    [,79]     [,80]     [,81]      [,82]   [,83]
[1,] -1.683169 0.0619309 -1.33327 0.1859935 0.1857591 -0.5137761 0.65416
[2,] -1.683169 0.0619309 -1.33327 0.1859935 0.1857591 -0.5137761 0.65416
        [,84]      [,85]     [,86]     [,87]      [,88]     [,89]     [,90]
[1,] 1.315909 -0.7000461 0.5122041 -1.306108 -0.2524877 0.9189206 0.2909817
[2,] 1.315909 -0.7000461 0.5122041 -1.306108 -0.2524877 0.9189206 0.2909817
       [,91]     [,92]    [,93]    [,94]     [,95]      [,96]    [,97]
[1,] 1.09053 0.1282781 1.089985 2.360476 0.6131491 -0.3438221 1.574179
[2,] 1.09053 0.1282781 1.089985 2.360476 0.6131491 -0.3438221 1.574179
          [,98]     [,99]    [,100]
[1,] -0.7157666 -2.232361 -1.585417
[2,] -0.7157666 -2.232361 -1.585417
> 
> 
> Max(tmp2)
[1] 2.529321
> Min(tmp2)
[1] -2.138931
> mean(tmp2)
[1] -0.0210775
> Sum(tmp2)
[1] -2.10775
> Var(tmp2)
[1] 0.9090968
> 
> rowMeans(tmp2)
  [1]  1.61106645  0.08201374  1.83936915  0.15651268 -0.55075119 -1.38229100
  [7]  0.16876823 -0.27151486 -0.62210195  1.13423783 -0.33336121 -0.33714122
 [13] -0.49418683 -0.70192341  1.61948253 -0.47281307 -1.13590431 -1.61099325
 [19]  1.25273349 -0.13301455 -0.30996425 -0.24542441 -0.25324886  0.15468008
 [25]  0.85458943  1.35283648  1.40172541 -0.85519795 -0.20145684  0.51301327
 [31] -1.89452685  1.04158704 -0.29082436  0.38131172 -1.12395748  0.92425996
 [37] -0.54289228  1.09373659  0.37218682  0.19203683  0.16014414  0.85403586
 [43] -0.89152067 -2.07690135  0.26032264  0.49343985  0.21311291  0.16310400
 [49]  0.12195736 -0.37823009  0.39871312  0.76269231 -0.49346237 -1.77720744
 [55] -1.21575728  1.12382760  1.05854073 -1.13188593  0.70647458 -0.74645954
 [61] -0.96774626  0.91621972 -0.58839830  0.48696752 -2.13893119 -0.84102946
 [67] -0.04923668 -1.60272078  0.52862303 -0.41983111 -0.35099104 -1.45271883
 [73] -0.78596865  0.15688944  0.44682877  1.12681029  0.93851293  0.25182091
 [79] -0.72680427  1.11135296  0.56101937 -1.79723067 -0.83281106  0.49349560
 [85]  0.25623744  0.16921967  0.01553081  1.04272680  1.11233004 -0.03930374
 [91]  0.44855694 -0.17268804 -0.26140144 -0.60261480  0.90271272  1.29152429
 [97] -2.04764399 -1.07159133  2.52932080 -0.13238652
> rowSums(tmp2)
  [1]  1.61106645  0.08201374  1.83936915  0.15651268 -0.55075119 -1.38229100
  [7]  0.16876823 -0.27151486 -0.62210195  1.13423783 -0.33336121 -0.33714122
 [13] -0.49418683 -0.70192341  1.61948253 -0.47281307 -1.13590431 -1.61099325
 [19]  1.25273349 -0.13301455 -0.30996425 -0.24542441 -0.25324886  0.15468008
 [25]  0.85458943  1.35283648  1.40172541 -0.85519795 -0.20145684  0.51301327
 [31] -1.89452685  1.04158704 -0.29082436  0.38131172 -1.12395748  0.92425996
 [37] -0.54289228  1.09373659  0.37218682  0.19203683  0.16014414  0.85403586
 [43] -0.89152067 -2.07690135  0.26032264  0.49343985  0.21311291  0.16310400
 [49]  0.12195736 -0.37823009  0.39871312  0.76269231 -0.49346237 -1.77720744
 [55] -1.21575728  1.12382760  1.05854073 -1.13188593  0.70647458 -0.74645954
 [61] -0.96774626  0.91621972 -0.58839830  0.48696752 -2.13893119 -0.84102946
 [67] -0.04923668 -1.60272078  0.52862303 -0.41983111 -0.35099104 -1.45271883
 [73] -0.78596865  0.15688944  0.44682877  1.12681029  0.93851293  0.25182091
 [79] -0.72680427  1.11135296  0.56101937 -1.79723067 -0.83281106  0.49349560
 [85]  0.25623744  0.16921967  0.01553081  1.04272680  1.11233004 -0.03930374
 [91]  0.44855694 -0.17268804 -0.26140144 -0.60261480  0.90271272  1.29152429
 [97] -2.04764399 -1.07159133  2.52932080 -0.13238652
> rowVars(tmp2)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowSd(tmp2)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowMax(tmp2)
  [1]  1.61106645  0.08201374  1.83936915  0.15651268 -0.55075119 -1.38229100
  [7]  0.16876823 -0.27151486 -0.62210195  1.13423783 -0.33336121 -0.33714122
 [13] -0.49418683 -0.70192341  1.61948253 -0.47281307 -1.13590431 -1.61099325
 [19]  1.25273349 -0.13301455 -0.30996425 -0.24542441 -0.25324886  0.15468008
 [25]  0.85458943  1.35283648  1.40172541 -0.85519795 -0.20145684  0.51301327
 [31] -1.89452685  1.04158704 -0.29082436  0.38131172 -1.12395748  0.92425996
 [37] -0.54289228  1.09373659  0.37218682  0.19203683  0.16014414  0.85403586
 [43] -0.89152067 -2.07690135  0.26032264  0.49343985  0.21311291  0.16310400
 [49]  0.12195736 -0.37823009  0.39871312  0.76269231 -0.49346237 -1.77720744
 [55] -1.21575728  1.12382760  1.05854073 -1.13188593  0.70647458 -0.74645954
 [61] -0.96774626  0.91621972 -0.58839830  0.48696752 -2.13893119 -0.84102946
 [67] -0.04923668 -1.60272078  0.52862303 -0.41983111 -0.35099104 -1.45271883
 [73] -0.78596865  0.15688944  0.44682877  1.12681029  0.93851293  0.25182091
 [79] -0.72680427  1.11135296  0.56101937 -1.79723067 -0.83281106  0.49349560
 [85]  0.25623744  0.16921967  0.01553081  1.04272680  1.11233004 -0.03930374
 [91]  0.44855694 -0.17268804 -0.26140144 -0.60261480  0.90271272  1.29152429
 [97] -2.04764399 -1.07159133  2.52932080 -0.13238652
> rowMin(tmp2)
  [1]  1.61106645  0.08201374  1.83936915  0.15651268 -0.55075119 -1.38229100
  [7]  0.16876823 -0.27151486 -0.62210195  1.13423783 -0.33336121 -0.33714122
 [13] -0.49418683 -0.70192341  1.61948253 -0.47281307 -1.13590431 -1.61099325
 [19]  1.25273349 -0.13301455 -0.30996425 -0.24542441 -0.25324886  0.15468008
 [25]  0.85458943  1.35283648  1.40172541 -0.85519795 -0.20145684  0.51301327
 [31] -1.89452685  1.04158704 -0.29082436  0.38131172 -1.12395748  0.92425996
 [37] -0.54289228  1.09373659  0.37218682  0.19203683  0.16014414  0.85403586
 [43] -0.89152067 -2.07690135  0.26032264  0.49343985  0.21311291  0.16310400
 [49]  0.12195736 -0.37823009  0.39871312  0.76269231 -0.49346237 -1.77720744
 [55] -1.21575728  1.12382760  1.05854073 -1.13188593  0.70647458 -0.74645954
 [61] -0.96774626  0.91621972 -0.58839830  0.48696752 -2.13893119 -0.84102946
 [67] -0.04923668 -1.60272078  0.52862303 -0.41983111 -0.35099104 -1.45271883
 [73] -0.78596865  0.15688944  0.44682877  1.12681029  0.93851293  0.25182091
 [79] -0.72680427  1.11135296  0.56101937 -1.79723067 -0.83281106  0.49349560
 [85]  0.25623744  0.16921967  0.01553081  1.04272680  1.11233004 -0.03930374
 [91]  0.44855694 -0.17268804 -0.26140144 -0.60261480  0.90271272  1.29152429
 [97] -2.04764399 -1.07159133  2.52932080 -0.13238652
> 
> colMeans(tmp2)
[1] -0.0210775
> colSums(tmp2)
[1] -2.10775
> colVars(tmp2)
[1] 0.9090968
> colSd(tmp2)
[1] 0.9534657
> colMax(tmp2)
[1] 2.529321
> colMin(tmp2)
[1] -2.138931
> colMedians(tmp2)
[1] 0.04877227
> colRanges(tmp2)
          [,1]
[1,] -2.138931
[2,]  2.529321
> 
> 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.9455790  1.4839647  0.7162174  0.9885919 -4.3315194  1.6929997
 [7]  0.2615959  2.5947482 -1.0600479 -1.1062079
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -2.1661813
[2,] -0.9918601
[3,] -0.3811502
[4,]  0.1994804
[5,]  1.0105867
> 
> rowApply(tmp,sum)
 [1]  1.4173141 -1.6689050 -1.6525521 -2.0769788  2.0940419 -3.4731454
 [7]  2.7830666 -2.1413279  0.5072372  1.5060130
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    7    1    3    9    2    7    2    1    9     1
 [2,]    5    8   10    2    1   10    4    8    7     6
 [3,]    8    7    6    8   10    2   10    7    4     3
 [4,]    9    9    5    5    3    8    9    3    1     7
 [5,]    6    3    4    1    8    3    1   10   10     4
 [6,]    4    6    9    6    7    1    6    9    2     9
 [7,]   10    2    7    4    5    5    3    5    6     5
 [8,]    3    4    8    7    9    9    5    2    8     2
 [9,]    1   10    1    3    4    6    8    4    5    10
[10,]    2    5    2   10    6    4    7    6    3     8
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1]  2.37332734 -2.46961249 -0.04704244  1.23665269  1.65278050 -0.17036674
 [7]  4.62750858 -2.76813821  0.55399021 -2.64608547  1.64708841 -0.01174675
[13] -0.87271967  0.04650181 -2.96202672  4.71600630 -3.12720596 -0.01379050
[19]  2.90332436  0.73378814
> colApply(tmp,quantile)[,1]
            [,1]
[1,] -0.26925855
[2,] -0.18759120
[3,]  0.06443097
[4,]  0.27214246
[5,]  2.49360366
> 
> rowApply(tmp,sum)
[1] -0.03182818 12.05031073 -1.83526004 -9.46273296  4.68174386
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]   13   20    7   13    9
[2,]    5    7    5   10    4
[3,]    4   12   19   12    5
[4,]   17    2   13   19    7
[5,]   12   19    2   14   18
> 
> 
> as.matrix(tmp)
            [,1]        [,2]       [,3]       [,4]        [,5]        [,6]
[1,]  0.06443097 -0.67987902 -0.7473626  0.5945359  0.06009059  0.03804106
[2,]  2.49360366  0.03466691  0.9213759 -1.3324723  2.38508494 -0.13116712
[3,] -0.26925855 -0.68205816  0.6186435  0.3574863 -1.78715472 -1.78923500
[4,] -0.18759120 -0.62483108 -0.3862350  1.5022325 -0.17524165  0.83593185
[5,]  0.27214246 -0.51751114 -0.4534642  0.1148703  1.17000135  0.87606249
           [,7]        [,8]       [,9]      [,10]      [,11]      [,12]
[1,]  2.2253959 -0.48524474 -0.2782792 -0.5108138  0.1576163 -0.5934026
[2,]  1.8102496 -2.07034942  0.7344928 -0.4218325  0.9927943  0.9716700
[3,]  0.2148893 -0.77033083  0.5884457  0.2188161  0.4041431 -0.3793669
[4,] -0.5848390  0.09803613 -0.9267136 -1.5343864 -1.1394637 -0.6963933
[5,]  0.9618127  0.45975064  0.4360445 -0.3978688  1.2319983  0.6857460
          [,13]      [,14]      [,15]      [,16]      [,17]      [,18]
[1,] -0.5855671  0.3476929  0.3836143 1.85195891 -1.5510636 -1.0491393
[2,]  0.7701234  1.6264045 -0.2548032 0.01721936  0.9807156  0.6740844
[3,]  0.1774687 -0.1879675  0.5115846 0.41938719  0.4625671 -0.8224457
[4,] -0.6505099 -2.3257674 -2.2683410 2.13039497 -1.6026151  0.3286621
[5,] -0.5842348  0.5861393 -1.3340813 0.29704587 -1.4168100  0.8550480
          [,19]      [,20]
[1,]  1.6838196 -0.9582726
[2,]  0.3989994  1.4494504
[3,]  0.7268100  0.1523157
[4,] -1.1457549 -0.1093073
[5,]  1.2394503  0.1996019
> 
> 
> 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.19-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.19-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  655  bytes.
Disk usage :  200  bytes.
> subBufferedMatrix(tmp,,5:8)
BufferedMatrix object
Matrix size:  5 4 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  567  bytes.
Disk usage :  160  bytes.
> subBufferedMatrix(tmp,1:3,)
BufferedMatrix object
Matrix size:  3 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  480  bytes.
> 
> 
> rm(tmp)
> 
> 
> ###
> ### Testing colnames and rownames
> ###
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> 
> 
> colnames(tmp)
NULL
> rownames(tmp)
NULL
> 
> 
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> colnames(tmp)
 [1] "col1"  "col2"  "col3"  "col4"  "col5"  "col6"  "col7"  "col8"  "col9" 
[10] "col10" "col11" "col12" "col13" "col14" "col15" "col16" "col17" "col18"
[19] "col19" "col20"
> rownames(tmp)
[1] "row1" "row2" "row3" "row4" "row5"
> 
> 
> tmp["row1",]
          col1      col2       col3       col4       col5     col6       col7
row1 -1.177793 0.7255536 -0.9056921 -0.4605556 -0.9948057 1.938776 -0.2094321
         col8      col9     col10     col11     col12    col13      col14
row1 1.748451 0.6782814 0.8009946 0.5525103 0.7569184 1.113754 0.01731634
        col15       col16      col17        col18    col19      col20
row1 0.159978 -0.06717732 -0.0856727 -0.001365062 1.101867 -0.2273223
> tmp[,"col10"]
          col10
row1  0.8009946
row2  0.1402188
row3  0.5704844
row4 -0.7754522
row5 -1.4445681
> tmp[c("row1","row5"),]
          col1      col2       col3       col4       col5      col6        col7
row1 -1.177793 0.7255536 -0.9056921 -0.4605556 -0.9948057  1.938776 -0.20943210
row5 -1.068845 0.7790148  0.3328530 -0.4340872 -0.5435387 -1.279072 -0.04237188
           col8      col9      col10     col11     col12     col13       col14
row1 1.74845103 0.6782814  0.8009946 0.5525103 0.7569184  1.113754  0.01731634
row5 0.08411142 1.3154439 -1.4445681 0.8882118 0.4827897 -1.929046 -0.20857459
         col15       col16      col17        col18      col19       col20
row1 0.1599780 -0.06717732 -0.0856727 -0.001365062  1.1018670 -0.22732226
row5 0.8580761  0.83793379 -1.3929155 -1.639480306 -0.3567002 -0.07194472
> tmp[,c("col6","col20")]
           col6       col20
row1  1.9387759 -0.22732226
row2 -1.0602542  0.66014492
row3 -0.5468835 -2.05963188
row4 -0.9942555  1.72033228
row5 -1.2790719 -0.07194472
> tmp[c("row1","row5"),c("col6","col20")]
          col6       col20
row1  1.938776 -0.22732226
row5 -1.279072 -0.07194472
> 
> 
> 
> 
> 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 51.16187 51.74759 50.21938 49.83906 50.00758 105.6237 48.57392 51.76209
        col9    col10    col11    col12    col13    col14    col15   col16
row1 51.3806 50.45908 50.25974 47.70928 47.52401 51.02408 49.61762 50.0176
        col17    col18    col19    col20
row1 50.91579 51.37429 50.32947 105.1355
> tmp[,"col10"]
        col10
row1 50.45908
row2 29.69002
row3 28.62808
row4 28.54947
row5 50.20824
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 51.16187 51.74759 50.21938 49.83906 50.00758 105.6237 48.57392 51.76209
row5 50.08602 49.59181 50.82933 50.50354 48.86295 106.6066 48.37850 49.66777
         col9    col10    col11    col12    col13    col14    col15    col16
row1 51.38060 50.45908 50.25974 47.70928 47.52401 51.02408 49.61762 50.01760
row5 49.97916 50.20824 49.30928 52.92932 49.38680 50.40074 48.90835 48.87156
        col17    col18    col19    col20
row1 50.91579 51.37429 50.32947 105.1355
row5 50.83804 48.90411 49.63455 104.5458
> tmp[,c("col6","col20")]
          col6     col20
row1 105.62366 105.13547
row2  75.65610  75.38047
row3  75.67419  73.20341
row4  74.72491  74.15429
row5 106.60657 104.54582
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 105.6237 105.1355
row5 106.6066 104.5458
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 105.6237 105.1355
row5 106.6066 104.5458
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
          col13
[1,]  1.0424881
[2,] -2.3740512
[3,] -0.3689634
[4,] -1.0091558
[5,] -0.1528891
> tmp[,c("col17","col7")]
          col17       col7
[1,] -0.7053492  0.4291199
[2,]  1.0321341  0.2072656
[3,]  0.2771007  0.9821544
[4,]  0.3433501 -0.1685674
[5,]  0.9682324 -0.7114246
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
           col6       col20
[1,] -0.6444752  0.62354926
[2,]  1.1977781  0.39968256
[3,] -0.5556890  0.88460064
[4,] -0.8236127 -0.87314615
[5,]  1.4988650  0.05528781
> subBufferedMatrix(tmp,1,c("col6"))[,1]
           col1
[1,] -0.6444752
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
           col6
[1,] -0.6444752
[2,]  1.1977781
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> 
> 
> 
> subBufferedMatrix(tmp,c("row3","row1"),)[,1:20]
          [,1]       [,2]       [,3]       [,4]       [,5]       [,6]
row3 0.8155163 -0.7735546  0.6081178 -0.1654713 -0.2975431 0.09654191
row1 1.5427922  0.4669536 -0.3020188 -0.6728060 -0.6398801 0.94113185
           [,7]      [,8]       [,9]      [,10]     [,11]      [,12]     [,13]
row3  0.2818418 -1.345710  0.4299341 -0.6580584 -1.575617 -1.9086222  1.967810
row1 -1.2865026  1.688108 -0.8688444  0.8833943 -1.664721  0.4947257 -1.129836
           [,14]     [,15]      [,16]     [,17]      [,18]      [,19]
row3  0.09016903 -1.301805 0.31682352 0.5537997 -0.6150731 -0.9795567
row1 -1.15566331  1.043641 0.02175885 0.9422628  0.9749574  0.6347756
          [,20]
row3 -0.7887893
row1  0.3519815
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
           [,1]     [,2]       [,3]      [,4]     [,5]       [,6]    [,7]
row2 0.01484328 3.401576 -0.5545007 0.2556923 0.188431 -0.9670656 1.14171
          [,8]       [,9]      [,10]
row2 -1.550901 -0.7179462 -0.6047389
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
           [,1]       [,2]      [,3]      [,4]     [,5]      [,6]     [,7]
row5 -0.8860253 -0.5931531 0.6226223 0.8125736 1.247859 0.6992315 1.652529
            [,8]      [,9]    [,10]     [,11]     [,12]    [,13]     [,14]
row5 -0.03024819 0.2078683 1.274999 0.2682285 0.7124869 1.669559 0.5382538
          [,15]     [,16]     [,17]      [,18]       [,19]     [,20]
row5 -0.1084838 -0.474295 0.3220688 -0.6039796 0.001323432 0.4787046
> 
> 
> 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: 0x600000dbc0c0>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "/Users/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests/BM142bc47b1552a"
 [2] "/Users/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests/BM142bc4b4e5d2b"
 [3] "/Users/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests/BM142bc5c6d8ad" 
 [4] "/Users/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests/BM142bc41bb48d1"
 [5] "/Users/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests/BM142bc6ea9b30d"
 [6] "/Users/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests/BM142bc472a533d"
 [7] "/Users/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests/BM142bc2bbeee4b"
 [8] "/Users/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests/BM142bc40e945d" 
 [9] "/Users/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests/BM142bc592e67bf"
[10] "/Users/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests/BM142bc759d5a56"
[11] "/Users/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests/BM142bc2d96006d"
[12] "/Users/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests/BM142bc52f60b7c"
[13] "/Users/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests/BM142bc176c2471"
[14] "/Users/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests/BM142bc3ccc82ba"
[15] "/Users/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests/BM142bc169aa085"
> 
> 
> ### 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: 0x600000db8240>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x600000db8240>
Warning message:
In dir.create(new.directory) :
  '/Users/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x600000db8240>
> rowMedians(tmp)
  [1] -0.337657534 -0.662226538  0.387437151 -0.028032013 -0.268866255
  [6] -0.123701826  0.048050534 -0.095025933 -0.540685237  0.694299107
 [11]  0.021515587  0.296947607  0.132741385  0.011980115 -0.683866718
 [16] -0.097812705 -0.158209622  0.333801696 -0.161946140 -0.104198746
 [21] -0.294491705 -0.325487727  0.335624816  0.041748901 -0.073308143
 [26] -0.154983331 -0.766979375 -0.037551425  0.179192771 -0.112091984
 [31]  0.681900751  0.031330481  0.103949638  0.243784140  0.501923237
 [36] -0.430320585 -0.098953337 -0.238622847  0.278645389  0.296023028
 [41] -0.156203198  0.169369636  0.102293985  0.103588759 -0.156395228
 [46] -0.718528271  0.270173703  0.179371712 -0.183877904  0.038487469
 [51] -0.243684245  0.059642212  0.177087469  0.138098552  0.018344824
 [56]  0.736322898  0.347754668  0.042579576 -0.472034121  0.044752189
 [61]  0.105539438 -0.713371122 -0.894760997 -0.119120140  0.552668376
 [66]  0.108166294  0.321523569  0.188614315  0.111280634 -0.298483765
 [71]  0.449096408 -0.379615393 -0.092927283  0.158091202 -0.343313890
 [76] -0.282912429 -0.312597886  0.442499205 -0.058409627 -0.756613781
 [81] -0.817072610  0.668820765  0.176148189  0.082046342 -0.193710300
 [86]  0.152510806  0.143088720 -0.729691221  0.132258653  0.084095918
 [91]  0.037483165 -0.223170979 -0.062166686  0.161151982  0.163336693
 [96] -0.169568134 -0.644314852 -0.346285777 -0.219409706 -0.013345759
[101] -0.460534086 -0.190732670  0.078600188  0.202434846  0.115463672
[106]  0.325308202 -0.366628846  0.039870538  0.010033447  0.171086295
[111] -0.020676051 -0.397178307 -0.097018125  0.008111762  0.461203518
[116]  0.023798525  0.423085233  0.352404749  0.141039313  0.184051338
[121] -0.453387910 -0.295934458  0.004429203  0.008412787 -0.193116472
[126] -0.046438741 -0.127004764 -0.338094734  0.088704678 -0.007925083
[131] -0.060389342  0.153445303  0.190180363 -0.484711163 -0.248578508
[136] -0.301244982  0.459138979 -0.273855990  0.432366407 -0.134480043
[141]  0.052385544 -0.107067215  0.066065723 -0.443477624 -0.263955337
[146]  0.359480212  0.338913472 -0.078334982 -0.485943617 -0.099722789
[151] -0.623801656  0.060404552 -0.139564604 -0.189282313  0.128612737
[156] -0.369361595  0.278931683 -0.698754503 -0.365544284  0.163134606
[161]  0.078960838 -0.207943244  0.421890077  0.125584008  0.600103131
[166] -0.296310736 -0.159377133  0.038216998  0.158681474 -0.281507338
[171] -0.324512821  0.638057640  0.233277276  0.112551682  0.012508827
[176]  0.504787352 -0.640755137 -0.028209027  0.577171070  0.008597781
[181]  0.142411578 -0.375894320  0.011158271  0.191826385  0.001280724
[186]  0.378959197  0.406654253 -0.168591843 -0.372553817 -0.039326989
[191] -0.360454453  0.254660501 -0.135699776 -0.098421037  0.378456398
[196]  0.214664265 -0.199531879 -0.148555124  0.265553147 -0.167456709
[201]  0.074901434  0.269623367  0.113750264 -0.115421052 -0.313241005
[206]  0.122444770 -0.099685335  0.514098788  0.244566254  0.135871194
[211] -0.515533999 -0.117665403  0.334488156 -0.295696206  0.563426329
[216]  0.404903771  0.397717707 -0.014488234 -0.406529305 -0.243817668
[221]  0.055617622  0.541402369  0.178325466  0.014710773  0.844239751
[226]  0.358750331  0.533064345 -0.018268385 -0.315942012 -0.516542455
> 
> proc.time()
   user  system elapsed 
  5.162  17.671  28.621 

BufferedMatrix.Rcheck/tests/rawCalltesting.Rout


R version 4.4.1 (2024-06-14) -- "Race for Your Life"
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: 0x60000301c000>
> .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: 0x60000301c000>
> .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: 0x60000301c000>
> .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: 0x60000301c000>
> 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: 0x600003014000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600003014000>
> .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: 0x600003014000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600003014000>
> .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: 0x600003014000>
> 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: 0x600003010420>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600003010420>
> .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: 0x600003010420>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x600003010420>
> .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: 0x600003010420>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x600003010420>
> .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: 0x600003010420>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x600003010420>
> .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: 0x600003010420>
> 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: 0x600003008060>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x600003008060>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600003008060>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600003008060>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile16c9f2f8dbfb9" "BufferedMatrixFile16c9f3262313" 
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile16c9f2f8dbfb9" "BufferedMatrixFile16c9f3262313" 
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x600003008300>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600003008300>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x600003008300>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x600003008300>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x600003008300>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x600003008300>
> .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: 0x60000300c000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x60000300c000>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x60000300c000>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x60000300c000>
> 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: 0x60000301c3c0>
> .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: 0x60000301c3c0>
> rm(P)
> 
> proc.time()
   user  system elapsed 
  0.606   0.213   0.868 

BufferedMatrix.Rcheck/tests/Rcodetesting.Rout


R version 4.4.1 (2024-06-14) -- "Race for Your Life"
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.588   0.134   0.744 

Example timings