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

This page was generated on 2023-10-16 11:36:53 -0400 (Mon, 16 Oct 2023).

HostnameOSArch (*)R versionInstalled pkgs
nebbiolo1Linux (Ubuntu 22.04.2 LTS)x86_644.3.1 (2023-06-16) -- "Beagle Scouts" 4626
palomino3Windows Server 2022 Datacenterx644.3.1 (2023-06-16 ucrt) -- "Beagle Scouts" 4379
merida1macOS 12.6.4 Montereyx86_644.3.1 (2023-06-16) -- "Beagle Scouts" 4395
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 245/2230HostnameOS / ArchINSTALLBUILDCHECKBUILD BIN
BufferedMatrix 1.64.0  (landing page)
Ben Bolstad
Snapshot Date: 2023-10-15 14:00:13 -0400 (Sun, 15 Oct 2023)
git_url: https://git.bioconductor.org/packages/BufferedMatrix
git_branch: RELEASE_3_17
git_last_commit: 3e3f8d6
git_last_commit_date: 2023-04-25 09:44:48 -0400 (Tue, 25 Apr 2023)
nebbiolo1Linux (Ubuntu 22.04.2 LTS) / x86_64  OK    OK    OK  UNNEEDED, same version is already published
palomino3Windows Server 2022 Datacenter / x64  OK    OK    OK    OK  UNNEEDED, same version is already published
merida1macOS 12.6.4 Monterey / x86_64  OK    OK    WARNINGS    OK  UNNEEDED, same version is already published
kjohnson2macOS 12.6.1 Monterey / arm64see weekly results here

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.64.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.64.0.tar.gz
StartedAt: 2023-10-15 23:18:58 -0400 (Sun, 15 Oct 2023)
EndedAt: 2023-10-15 23:20:23 -0400 (Sun, 15 Oct 2023)
EllapsedTime: 85.7 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.64.0.tar.gz
###
##############################################################################
##############################################################################


* using log directory ‘/Users/biocbuild/bbs-3.17-bioc/meat/BufferedMatrix.Rcheck’
* using R version 4.3.1 (2023-06-16)
* using platform: x86_64-apple-darwin20 (64-bit)
* R was compiled by
    Apple clang version 14.0.3 (clang-1403.0.22.14.1)
    GNU Fortran (GCC) 12.2.0
* running under: macOS Monterey 12.6.4
* using session charset: UTF-8
* using option ‘--no-vignettes’
* checking for file ‘BufferedMatrix/DESCRIPTION’ ... OK
* this is package ‘BufferedMatrix’ version ‘1.64.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.17-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 R 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
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 in ‘inst/doc’ ... 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.17-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.3-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 -single_module -multiply_defined suppress -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.3-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.3.1 (2023-06-16) -- "Beagle Scouts"
Copyright (C) 2023 The R Foundation for Statistical Computing
Platform: x86_64-apple-darwin20 (64-bit)

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.595   0.212   0.983 

BufferedMatrix.Rcheck/tests/objectTesting.Rout


R version 4.3.1 (2023-06-16) -- "Beagle Scouts"
Copyright (C) 2023 The R Foundation for Statistical Computing
Platform: x86_64-apple-darwin20 (64-bit)

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.17-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 459924 24.6     991237   53         NA   645662 34.5
Vcells 848560  6.5    8388608   64      65536  2024450 15.5
> 
> 
> 
> 
> ##
> ## 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] "Sun Oct 15 23:19:34 2023"
> 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] "Sun Oct 15 23:19:35 2023"
> 
> 
> 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: 0x6000010682a0>
> 
> 
> 
> 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] "Sun Oct 15 23:19:42 2023"
> 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] "Sun Oct 15 23:19:45 2023"
> 
> ColMode(tmp2)
<pointer: 0x6000010682a0>
> 
> 
> 
> ### 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.601029 -0.94372370  0.1898417 -0.6471091
[2,]  -1.427904 -0.03603975  0.4984971  0.5649766
[3,]   1.372227 -0.55098927  0.4411361 -0.8525790
[4,]   1.523013 -0.19051469 -0.1721450 -0.5214332
> ewApply(tmp5,abs)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.17-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
           [,1]       [,2]      [,3]      [,4]
[1,] 100.601029 0.94372370 0.1898417 0.6471091
[2,]   1.427904 0.03603975 0.4984971 0.5649766
[3,]   1.372227 0.55098927 0.4411361 0.8525790
[4,]   1.523013 0.19051469 0.1721450 0.5214332
> ewApply(tmp5,sqrt)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.17-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
          [,1]      [,2]      [,3]      [,4]
[1,] 10.030006 0.9714544 0.4357083 0.8044309
[2,]  1.194949 0.1898414 0.7060433 0.7516492
[3,]  1.171421 0.7422865 0.6641808 0.9233521
[4,]  1.234104 0.4364799 0.4149036 0.7221033
> 
> 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.17-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
          [,1]     [,2]     [,3]     [,4]
[1,] 225.90109 35.65827 29.54692 33.69142
[2,]  38.37740 26.93445 32.55893 33.08147
[3,]  38.08643 32.97385 32.08294 35.08610
[4,]  38.86405 29.55531 29.32118 32.74247
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x600001048000>
> exp(tmp5)
<pointer: 0x600001048000>
> log(tmp5,2)
<pointer: 0x600001048000>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 470.1835
> Min(tmp5)
[1] 53.09352
> mean(tmp5)
[1] 72.87706
> Sum(tmp5)
[1] 14575.41
> Var(tmp5)
[1] 870.3618
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 86.84471 71.95545 72.25030 72.35022 71.82569 71.25088 70.63273 71.98123
 [9] 69.61268 70.06667
> rowSums(tmp5)
 [1] 1736.894 1439.109 1445.006 1447.004 1436.514 1425.018 1412.655 1439.625
 [9] 1392.254 1401.333
> rowVars(tmp5)
 [1] 8198.13881   83.23542   41.91627   93.77669   59.24035  116.58367
 [7]   67.32706  108.08653   49.63057   61.37126
> rowSd(tmp5)
 [1] 90.543574  9.123345  6.474278  9.683836  7.696775 10.797392  8.205307
 [8] 10.396467  7.044897  7.833981
> rowMax(tmp5)
 [1] 470.18353  88.15037  83.44858  86.40151  83.42893  91.10883  85.26911
 [8]  89.77102  81.83454  85.53684
> rowMin(tmp5)
 [1] 53.09352 55.10823 58.72420 55.08909 54.71957 55.05620 58.03674 55.77882
 [9] 54.48590 57.20729
> 
> colMeans(tmp5)
 [1] 111.47620  66.04078  67.04742  66.69428  68.48547  72.70652  76.55205
 [8]  73.21699  74.75246  70.11095  75.32182  66.91464  69.41671  69.80223
[15]  72.80118  70.73289  69.05883  75.83409  71.05165  69.52397
> colSums(tmp5)
 [1] 1114.7620  660.4078  670.4742  666.9428  684.8547  727.0652  765.5205
 [8]  732.1699  747.5246  701.1095  753.2182  669.1464  694.1671  698.0223
[15]  728.0118  707.3289  690.5883  758.3409  710.5165  695.2397
> colVars(tmp5)
 [1] 15934.18500    43.42952    58.55074    32.00512   119.60577    38.23988
 [7]    72.01167    87.65384    59.38297    77.58823    94.53536    50.05198
[13]    41.57443    83.55853    78.17138    88.99670    63.95961   145.90089
[19]    45.94679    75.53874
> colSd(tmp5)
 [1] 126.230682   6.590108   7.651845   5.657307  10.936442   6.183840
 [7]   8.485969   9.362363   7.706034   8.808418   9.722930   7.074742
[13]   6.447823   9.141035   8.841458   9.433806   7.997475  12.078944
[19]   6.778406   8.691302
> colMax(tmp5)
 [1] 470.18353  74.41678  81.77915  76.87514  83.93246  80.23481  91.10883
 [8]  88.72398  86.52941  84.40261  88.15037  79.93520  81.48794  83.81527
[15]  83.42893  89.77102  77.26440  87.94366  80.53821  83.44858
> colMin(tmp5)
 [1] 62.45674 56.06054 55.05620 59.84850 53.09352 59.72425 65.46068 54.48590
 [9] 62.49675 58.11594 55.11057 59.09586 62.47582 55.08909 55.10823 58.35821
[17] 56.40505 56.11257 62.82175 55.77882
> 
> 
> ### setting a random element to NA and then testing with na.rm=TRUE or na.rm=FALSE (The default)
> 
> 
> which.row <- sample(1:10,1,replace=TRUE)
> which.col  <- sample(1:20,1,replace=TRUE)
> 
> tmp5[which.row,which.col] <- NA
> 
> Max(tmp5)
[1] NA
> Min(tmp5)
[1] NA
> mean(tmp5)
[1] NA
> Sum(tmp5)
[1] NA
> Var(tmp5)
[1] NA
> 
> rowMeans(tmp5)
 [1]       NA 71.95545 72.25030 72.35022 71.82569 71.25088 70.63273 71.98123
 [9] 69.61268 70.06667
> rowSums(tmp5)
 [1]       NA 1439.109 1445.006 1447.004 1436.514 1425.018 1412.655 1439.625
 [9] 1392.254 1401.333
> rowVars(tmp5)
 [1] 8637.71457   83.23542   41.91627   93.77669   59.24035  116.58367
 [7]   67.32706  108.08653   49.63057   61.37126
> rowSd(tmp5)
 [1] 92.939306  9.123345  6.474278  9.683836  7.696775 10.797392  8.205307
 [8] 10.396467  7.044897  7.833981
> rowMax(tmp5)
 [1]       NA 88.15037 83.44858 86.40151 83.42893 91.10883 85.26911 89.77102
 [9] 81.83454 85.53684
> rowMin(tmp5)
 [1]       NA 55.10823 58.72420 55.08909 54.71957 55.05620 58.03674 55.77882
 [9] 54.48590 57.20729
> 
> colMeans(tmp5)
 [1] 111.47620  66.04078  67.04742  66.69428  68.48547  72.70652  76.55205
 [8]  73.21699  74.75246  70.11095  75.32182  66.91464  69.41671  69.80223
[15]  72.80118  70.73289  69.05883  75.83409  71.05165        NA
> colSums(tmp5)
 [1] 1114.7620  660.4078  670.4742  666.9428  684.8547  727.0652  765.5205
 [8]  732.1699  747.5246  701.1095  753.2182  669.1464  694.1671  698.0223
[15]  728.0118  707.3289  690.5883  758.3409  710.5165        NA
> colVars(tmp5)
 [1] 15934.18500    43.42952    58.55074    32.00512   119.60577    38.23988
 [7]    72.01167    87.65384    59.38297    77.58823    94.53536    50.05198
[13]    41.57443    83.55853    78.17138    88.99670    63.95961   145.90089
[19]    45.94679          NA
> colSd(tmp5)
 [1] 126.230682   6.590108   7.651845   5.657307  10.936442   6.183840
 [7]   8.485969   9.362363   7.706034   8.808418   9.722930   7.074742
[13]   6.447823   9.141035   8.841458   9.433806   7.997475  12.078944
[19]   6.778406         NA
> colMax(tmp5)
 [1] 470.18353  74.41678  81.77915  76.87514  83.93246  80.23481  91.10883
 [8]  88.72398  86.52941  84.40261  88.15037  79.93520  81.48794  83.81527
[15]  83.42893  89.77102  77.26440  87.94366  80.53821        NA
> colMin(tmp5)
 [1] 62.45674 56.06054 55.05620 59.84850 53.09352 59.72425 65.46068 54.48590
 [9] 62.49675 58.11594 55.11057 59.09586 62.47582 55.08909 55.10823 58.35821
[17] 56.40505 56.11257 62.82175       NA
> 
> Max(tmp5,na.rm=TRUE)
[1] 470.1835
> Min(tmp5,na.rm=TRUE)
[1] 53.09352
> mean(tmp5,na.rm=TRUE)
[1] 72.88967
> Sum(tmp5,na.rm=TRUE)
[1] 14505.04
> Var(tmp5,na.rm=TRUE)
[1] 874.7256
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 87.71191 71.95545 72.25030 72.35022 71.82569 71.25088 70.63273 71.98123
 [9] 69.61268 70.06667
> rowSums(tmp5,na.rm=TRUE)
 [1] 1666.526 1439.109 1445.006 1447.004 1436.514 1425.018 1412.655 1439.625
 [9] 1392.254 1401.333
> rowVars(tmp5,na.rm=TRUE)
 [1] 8637.71457   83.23542   41.91627   93.77669   59.24035  116.58367
 [7]   67.32706  108.08653   49.63057   61.37126
> rowSd(tmp5,na.rm=TRUE)
 [1] 92.939306  9.123345  6.474278  9.683836  7.696775 10.797392  8.205307
 [8] 10.396467  7.044897  7.833981
> rowMax(tmp5,na.rm=TRUE)
 [1] 470.18353  88.15037  83.44858  86.40151  83.42893  91.10883  85.26911
 [8]  89.77102  81.83454  85.53684
> rowMin(tmp5,na.rm=TRUE)
 [1] 53.09352 55.10823 58.72420 55.08909 54.71957 55.05620 58.03674 55.77882
 [9] 54.48590 57.20729
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 111.47620  66.04078  67.04742  66.69428  68.48547  72.70652  76.55205
 [8]  73.21699  74.75246  70.11095  75.32182  66.91464  69.41671  69.80223
[15]  72.80118  70.73289  69.05883  75.83409  71.05165  69.43020
> colSums(tmp5,na.rm=TRUE)
 [1] 1114.7620  660.4078  670.4742  666.9428  684.8547  727.0652  765.5205
 [8]  732.1699  747.5246  701.1095  753.2182  669.1464  694.1671  698.0223
[15]  728.0118  707.3289  690.5883  758.3409  710.5165  624.8718
> colVars(tmp5,na.rm=TRUE)
 [1] 15934.18500    43.42952    58.55074    32.00512   119.60577    38.23988
 [7]    72.01167    87.65384    59.38297    77.58823    94.53536    50.05198
[13]    41.57443    83.55853    78.17138    88.99670    63.95961   145.90089
[19]    45.94679    84.88217
> colSd(tmp5,na.rm=TRUE)
 [1] 126.230682   6.590108   7.651845   5.657307  10.936442   6.183840
 [7]   8.485969   9.362363   7.706034   8.808418   9.722930   7.074742
[13]   6.447823   9.141035   8.841458   9.433806   7.997475  12.078944
[19]   6.778406   9.213152
> colMax(tmp5,na.rm=TRUE)
 [1] 470.18353  74.41678  81.77915  76.87514  83.93246  80.23481  91.10883
 [8]  88.72398  86.52941  84.40261  88.15037  79.93520  81.48794  83.81527
[15]  83.42893  89.77102  77.26440  87.94366  80.53821  83.44858
> colMin(tmp5,na.rm=TRUE)
 [1] 62.45674 56.06054 55.05620 59.84850 53.09352 59.72425 65.46068 54.48590
 [9] 62.49675 58.11594 55.11057 59.09586 62.47582 55.08909 55.10823 58.35821
[17] 56.40505 56.11257 62.82175 55.77882
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1]      NaN 71.95545 72.25030 72.35022 71.82569 71.25088 70.63273 71.98123
 [9] 69.61268 70.06667
> rowSums(tmp5,na.rm=TRUE)
 [1]    0.000 1439.109 1445.006 1447.004 1436.514 1425.018 1412.655 1439.625
 [9] 1392.254 1401.333
> rowVars(tmp5,na.rm=TRUE)
 [1]        NA  83.23542  41.91627  93.77669  59.24035 116.58367  67.32706
 [8] 108.08653  49.63057  61.37126
> rowSd(tmp5,na.rm=TRUE)
 [1]        NA  9.123345  6.474278  9.683836  7.696775 10.797392  8.205307
 [8] 10.396467  7.044897  7.833981
> rowMax(tmp5,na.rm=TRUE)
 [1]       NA 88.15037 83.44858 86.40151 83.42893 91.10883 85.26911 89.77102
 [9] 81.83454 85.53684
> rowMin(tmp5,na.rm=TRUE)
 [1]       NA 55.10823 58.72420 55.08909 54.71957 55.05620 58.03674 55.77882
 [9] 54.48590 57.20729
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1] 71.61983 65.13220 67.66402 66.31317 70.19569 72.68843 76.14209 74.08000
 [9] 76.11421 71.44373 75.44235 67.78339 69.14265 71.07761 72.56844 71.47330
[17] 68.38523 78.02537 71.78000      NaN
> colSums(tmp5,na.rm=TRUE)
 [1] 644.5784 586.1898 608.9761 596.8186 631.7612 654.1959 685.2788 666.7200
 [9] 685.0279 642.9935 678.9812 610.0505 622.2838 639.6985 653.1160 643.2597
[17] 615.4671 702.2283 646.0200   0.0000
> colVars(tmp5,na.rm=TRUE)
 [1]  54.99272  39.57111  61.59243  34.37176 101.65202  43.01618  79.12234
 [8]  90.23188  45.94439  67.30338 106.18883  47.81775  45.92625  75.70413
[15]  87.33340  93.95394  66.85012 110.11929  45.72212        NA
> colSd(tmp5,na.rm=TRUE)
 [1]  7.415707  6.290557  7.848084  5.862743 10.082263  6.558672  8.895074
 [8]  9.499046  6.778229  8.203864 10.304797  6.915038  6.776891  8.700812
[15]  9.345234  9.692984  8.176192 10.493774  6.761813        NA
> colMax(tmp5,na.rm=TRUE)
 [1] 80.89044 74.41678 81.77915 76.87514 83.93246 80.23481 91.10883 88.72398
 [9] 86.52941 84.40261 88.15037 79.93520 81.48794 83.81527 83.42893 89.77102
[17] 77.26440 87.94366 80.53821     -Inf
> colMin(tmp5,na.rm=TRUE)
 [1] 62.45674 56.06054 55.05620 59.84850 54.71957 59.72425 65.46068 54.48590
 [9] 65.79630 58.41217 55.11057 62.35227 62.47582 55.08909 55.10823 58.35821
[17] 56.40505 58.72420 62.82175      Inf
> 
> 
> 
> 
> 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] 185.8977 108.1493 153.3088 315.3969 309.6534 253.8226 152.8007 209.4610
 [9] 282.1370 196.2791
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 185.8977 108.1493 153.3088 315.3969 309.6534 253.8226 152.8007 209.4610
 [9] 282.1370 196.2791
> 
> 
> 
> 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]  8.526513e-14 -8.526513e-14  0.000000e+00 -7.105427e-14  0.000000e+00
 [6]  8.526513e-14 -5.684342e-14  0.000000e+00 -2.273737e-13  0.000000e+00
[11]  5.684342e-14  0.000000e+00  5.684342e-14  5.684342e-14 -5.684342e-14
[16]  1.705303e-13  1.421085e-13  1.136868e-13  9.947598e-14  0.000000e+00
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> ## 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)
+ }
1   4 
2   16 
9   2 
3   17 
2   5 
7   3 
4   10 
5   4 
2   2 
9   1 
10   9 
9   3 
7   2 
2   3 
10   6 
7   1 
6   5 
4   6 
4   19 
9   8 
There were 50 or more warnings (use warnings() to see the first 50)
> 
> 
> ### now test 1 by n and n by 1 matrix
> 
> 
> err.tol <- 1e-12
> 
> rm(tmp5)
> 
> dataset1 <- rnorm(100)
> dataset2 <- rnorm(100)
> 
> tmp <- createBufferedMatrix(1,100)
> tmp[1,] <- dataset1
> 
> tmp2 <- createBufferedMatrix(100,1)
> tmp2[,1] <- dataset2
> 
> 
> 
> 
> 
> Max(tmp)
[1] 2.83637
> Min(tmp)
[1] -2.845304
> mean(tmp)
[1] -0.2496734
> Sum(tmp)
[1] -24.96734
> Var(tmp)
[1] 1.011674
> 
> rowMeans(tmp)
[1] -0.2496734
> rowSums(tmp)
[1] -24.96734
> rowVars(tmp)
[1] 1.011674
> rowSd(tmp)
[1] 1.00582
> rowMax(tmp)
[1] 2.83637
> rowMin(tmp)
[1] -2.845304
> 
> colMeans(tmp)
  [1]  0.902595852  0.312045357 -1.105760679  0.012683502  0.215492799
  [6] -0.952389863 -0.044559607  0.208320623 -1.121959004 -1.200266796
 [11]  0.755804801  1.874695170 -1.697684840 -0.453601405 -0.783258167
 [16] -0.732650869 -0.963082959  0.198788511 -0.471523737  2.836369685
 [21]  0.863530970 -1.107430185  0.721015197 -1.119862583 -1.296405241
 [26] -1.423497953  2.088143680 -0.008532296 -0.151070418 -0.507540785
 [31] -0.264586367  0.744827969 -1.667673059  0.334868539 -0.899345523
 [36]  0.231208485  0.377085099  0.028486661  0.823662770 -1.733456288
 [41] -1.309686190  0.039884296 -0.316281422  0.224563807 -1.250588320
 [46] -0.833029217  1.205298832 -2.845303937 -0.408727937 -2.419165711
 [51] -1.162676832  0.431455245 -0.152556385 -1.716070187  0.239812967
 [56] -0.183206814 -0.933871228 -1.297188429 -0.745454689 -0.212445742
 [61] -1.888502327  0.724791343  0.512276887 -0.551451355 -0.745052186
 [66] -0.337120788 -0.057405489 -0.947031633 -0.253351923 -1.302164290
 [71]  0.502313926  0.849938042  0.514256441  2.104826620  0.139433059
 [76]  0.601967271  0.966127936 -0.281517412  1.224654773 -0.492251364
 [81] -0.035639938 -2.248841766 -0.986412218 -1.113931008  0.853487182
 [86]  0.106453035  0.298855546 -2.035027229  0.614665953  0.004702153
 [91] -1.121951971  0.770759178  0.788621513 -1.226298477  0.084582812
 [96]  0.750141282 -0.251329972 -0.297459550 -0.990792500 -0.394912367
> colSums(tmp)
  [1]  0.902595852  0.312045357 -1.105760679  0.012683502  0.215492799
  [6] -0.952389863 -0.044559607  0.208320623 -1.121959004 -1.200266796
 [11]  0.755804801  1.874695170 -1.697684840 -0.453601405 -0.783258167
 [16] -0.732650869 -0.963082959  0.198788511 -0.471523737  2.836369685
 [21]  0.863530970 -1.107430185  0.721015197 -1.119862583 -1.296405241
 [26] -1.423497953  2.088143680 -0.008532296 -0.151070418 -0.507540785
 [31] -0.264586367  0.744827969 -1.667673059  0.334868539 -0.899345523
 [36]  0.231208485  0.377085099  0.028486661  0.823662770 -1.733456288
 [41] -1.309686190  0.039884296 -0.316281422  0.224563807 -1.250588320
 [46] -0.833029217  1.205298832 -2.845303937 -0.408727937 -2.419165711
 [51] -1.162676832  0.431455245 -0.152556385 -1.716070187  0.239812967
 [56] -0.183206814 -0.933871228 -1.297188429 -0.745454689 -0.212445742
 [61] -1.888502327  0.724791343  0.512276887 -0.551451355 -0.745052186
 [66] -0.337120788 -0.057405489 -0.947031633 -0.253351923 -1.302164290
 [71]  0.502313926  0.849938042  0.514256441  2.104826620  0.139433059
 [76]  0.601967271  0.966127936 -0.281517412  1.224654773 -0.492251364
 [81] -0.035639938 -2.248841766 -0.986412218 -1.113931008  0.853487182
 [86]  0.106453035  0.298855546 -2.035027229  0.614665953  0.004702153
 [91] -1.121951971  0.770759178  0.788621513 -1.226298477  0.084582812
 [96]  0.750141282 -0.251329972 -0.297459550 -0.990792500 -0.394912367
> colVars(tmp)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> colSd(tmp)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> colMax(tmp)
  [1]  0.902595852  0.312045357 -1.105760679  0.012683502  0.215492799
  [6] -0.952389863 -0.044559607  0.208320623 -1.121959004 -1.200266796
 [11]  0.755804801  1.874695170 -1.697684840 -0.453601405 -0.783258167
 [16] -0.732650869 -0.963082959  0.198788511 -0.471523737  2.836369685
 [21]  0.863530970 -1.107430185  0.721015197 -1.119862583 -1.296405241
 [26] -1.423497953  2.088143680 -0.008532296 -0.151070418 -0.507540785
 [31] -0.264586367  0.744827969 -1.667673059  0.334868539 -0.899345523
 [36]  0.231208485  0.377085099  0.028486661  0.823662770 -1.733456288
 [41] -1.309686190  0.039884296 -0.316281422  0.224563807 -1.250588320
 [46] -0.833029217  1.205298832 -2.845303937 -0.408727937 -2.419165711
 [51] -1.162676832  0.431455245 -0.152556385 -1.716070187  0.239812967
 [56] -0.183206814 -0.933871228 -1.297188429 -0.745454689 -0.212445742
 [61] -1.888502327  0.724791343  0.512276887 -0.551451355 -0.745052186
 [66] -0.337120788 -0.057405489 -0.947031633 -0.253351923 -1.302164290
 [71]  0.502313926  0.849938042  0.514256441  2.104826620  0.139433059
 [76]  0.601967271  0.966127936 -0.281517412  1.224654773 -0.492251364
 [81] -0.035639938 -2.248841766 -0.986412218 -1.113931008  0.853487182
 [86]  0.106453035  0.298855546 -2.035027229  0.614665953  0.004702153
 [91] -1.121951971  0.770759178  0.788621513 -1.226298477  0.084582812
 [96]  0.750141282 -0.251329972 -0.297459550 -0.990792500 -0.394912367
> colMin(tmp)
  [1]  0.902595852  0.312045357 -1.105760679  0.012683502  0.215492799
  [6] -0.952389863 -0.044559607  0.208320623 -1.121959004 -1.200266796
 [11]  0.755804801  1.874695170 -1.697684840 -0.453601405 -0.783258167
 [16] -0.732650869 -0.963082959  0.198788511 -0.471523737  2.836369685
 [21]  0.863530970 -1.107430185  0.721015197 -1.119862583 -1.296405241
 [26] -1.423497953  2.088143680 -0.008532296 -0.151070418 -0.507540785
 [31] -0.264586367  0.744827969 -1.667673059  0.334868539 -0.899345523
 [36]  0.231208485  0.377085099  0.028486661  0.823662770 -1.733456288
 [41] -1.309686190  0.039884296 -0.316281422  0.224563807 -1.250588320
 [46] -0.833029217  1.205298832 -2.845303937 -0.408727937 -2.419165711
 [51] -1.162676832  0.431455245 -0.152556385 -1.716070187  0.239812967
 [56] -0.183206814 -0.933871228 -1.297188429 -0.745454689 -0.212445742
 [61] -1.888502327  0.724791343  0.512276887 -0.551451355 -0.745052186
 [66] -0.337120788 -0.057405489 -0.947031633 -0.253351923 -1.302164290
 [71]  0.502313926  0.849938042  0.514256441  2.104826620  0.139433059
 [76]  0.601967271  0.966127936 -0.281517412  1.224654773 -0.492251364
 [81] -0.035639938 -2.248841766 -0.986412218 -1.113931008  0.853487182
 [86]  0.106453035  0.298855546 -2.035027229  0.614665953  0.004702153
 [91] -1.121951971  0.770759178  0.788621513 -1.226298477  0.084582812
 [96]  0.750141282 -0.251329972 -0.297459550 -0.990792500 -0.394912367
> colMedians(tmp)
  [1]  0.902595852  0.312045357 -1.105760679  0.012683502  0.215492799
  [6] -0.952389863 -0.044559607  0.208320623 -1.121959004 -1.200266796
 [11]  0.755804801  1.874695170 -1.697684840 -0.453601405 -0.783258167
 [16] -0.732650869 -0.963082959  0.198788511 -0.471523737  2.836369685
 [21]  0.863530970 -1.107430185  0.721015197 -1.119862583 -1.296405241
 [26] -1.423497953  2.088143680 -0.008532296 -0.151070418 -0.507540785
 [31] -0.264586367  0.744827969 -1.667673059  0.334868539 -0.899345523
 [36]  0.231208485  0.377085099  0.028486661  0.823662770 -1.733456288
 [41] -1.309686190  0.039884296 -0.316281422  0.224563807 -1.250588320
 [46] -0.833029217  1.205298832 -2.845303937 -0.408727937 -2.419165711
 [51] -1.162676832  0.431455245 -0.152556385 -1.716070187  0.239812967
 [56] -0.183206814 -0.933871228 -1.297188429 -0.745454689 -0.212445742
 [61] -1.888502327  0.724791343  0.512276887 -0.551451355 -0.745052186
 [66] -0.337120788 -0.057405489 -0.947031633 -0.253351923 -1.302164290
 [71]  0.502313926  0.849938042  0.514256441  2.104826620  0.139433059
 [76]  0.601967271  0.966127936 -0.281517412  1.224654773 -0.492251364
 [81] -0.035639938 -2.248841766 -0.986412218 -1.113931008  0.853487182
 [86]  0.106453035  0.298855546 -2.035027229  0.614665953  0.004702153
 [91] -1.121951971  0.770759178  0.788621513 -1.226298477  0.084582812
 [96]  0.750141282 -0.251329972 -0.297459550 -0.990792500 -0.394912367
> colRanges(tmp)
          [,1]      [,2]      [,3]      [,4]      [,5]       [,6]        [,7]
[1,] 0.9025959 0.3120454 -1.105761 0.0126835 0.2154928 -0.9523899 -0.04455961
[2,] 0.9025959 0.3120454 -1.105761 0.0126835 0.2154928 -0.9523899 -0.04455961
          [,8]      [,9]     [,10]     [,11]    [,12]     [,13]      [,14]
[1,] 0.2083206 -1.121959 -1.200267 0.7558048 1.874695 -1.697685 -0.4536014
[2,] 0.2083206 -1.121959 -1.200267 0.7558048 1.874695 -1.697685 -0.4536014
          [,15]      [,16]     [,17]     [,18]      [,19]   [,20]    [,21]
[1,] -0.7832582 -0.7326509 -0.963083 0.1987885 -0.4715237 2.83637 0.863531
[2,] -0.7832582 -0.7326509 -0.963083 0.1987885 -0.4715237 2.83637 0.863531
        [,22]     [,23]     [,24]     [,25]     [,26]    [,27]        [,28]
[1,] -1.10743 0.7210152 -1.119863 -1.296405 -1.423498 2.088144 -0.008532296
[2,] -1.10743 0.7210152 -1.119863 -1.296405 -1.423498 2.088144 -0.008532296
          [,29]      [,30]      [,31]    [,32]     [,33]     [,34]      [,35]
[1,] -0.1510704 -0.5075408 -0.2645864 0.744828 -1.667673 0.3348685 -0.8993455
[2,] -0.1510704 -0.5075408 -0.2645864 0.744828 -1.667673 0.3348685 -0.8993455
         [,36]     [,37]      [,38]     [,39]     [,40]     [,41]     [,42]
[1,] 0.2312085 0.3770851 0.02848666 0.8236628 -1.733456 -1.309686 0.0398843
[2,] 0.2312085 0.3770851 0.02848666 0.8236628 -1.733456 -1.309686 0.0398843
          [,43]     [,44]     [,45]      [,46]    [,47]     [,48]      [,49]
[1,] -0.3162814 0.2245638 -1.250588 -0.8330292 1.205299 -2.845304 -0.4087279
[2,] -0.3162814 0.2245638 -1.250588 -0.8330292 1.205299 -2.845304 -0.4087279
         [,50]     [,51]     [,52]      [,53]    [,54]    [,55]      [,56]
[1,] -2.419166 -1.162677 0.4314552 -0.1525564 -1.71607 0.239813 -0.1832068
[2,] -2.419166 -1.162677 0.4314552 -0.1525564 -1.71607 0.239813 -0.1832068
          [,57]     [,58]      [,59]      [,60]     [,61]     [,62]     [,63]
[1,] -0.9338712 -1.297188 -0.7454547 -0.2124457 -1.888502 0.7247913 0.5122769
[2,] -0.9338712 -1.297188 -0.7454547 -0.2124457 -1.888502 0.7247913 0.5122769
          [,64]      [,65]      [,66]       [,67]      [,68]      [,69]
[1,] -0.5514514 -0.7450522 -0.3371208 -0.05740549 -0.9470316 -0.2533519
[2,] -0.5514514 -0.7450522 -0.3371208 -0.05740549 -0.9470316 -0.2533519
         [,70]     [,71]    [,72]     [,73]    [,74]     [,75]     [,76]
[1,] -1.302164 0.5023139 0.849938 0.5142564 2.104827 0.1394331 0.6019673
[2,] -1.302164 0.5023139 0.849938 0.5142564 2.104827 0.1394331 0.6019673
         [,77]      [,78]    [,79]      [,80]       [,81]     [,82]      [,83]
[1,] 0.9661279 -0.2815174 1.224655 -0.4922514 -0.03563994 -2.248842 -0.9864122
[2,] 0.9661279 -0.2815174 1.224655 -0.4922514 -0.03563994 -2.248842 -0.9864122
         [,84]     [,85]    [,86]     [,87]     [,88]    [,89]       [,90]
[1,] -1.113931 0.8534872 0.106453 0.2988555 -2.035027 0.614666 0.004702153
[2,] -1.113931 0.8534872 0.106453 0.2988555 -2.035027 0.614666 0.004702153
         [,91]     [,92]     [,93]     [,94]      [,95]     [,96]    [,97]
[1,] -1.121952 0.7707592 0.7886215 -1.226298 0.08458281 0.7501413 -0.25133
[2,] -1.121952 0.7707592 0.7886215 -1.226298 0.08458281 0.7501413 -0.25133
          [,98]      [,99]     [,100]
[1,] -0.2974596 -0.9907925 -0.3949124
[2,] -0.2974596 -0.9907925 -0.3949124
> 
> 
> Max(tmp2)
[1] 2.239488
> Min(tmp2)
[1] -2.326432
> mean(tmp2)
[1] 0.09202154
> Sum(tmp2)
[1] 9.202154
> Var(tmp2)
[1] 1.123875
> 
> rowMeans(tmp2)
  [1] -2.22801809  0.26270042  0.53408382  1.37574462  1.32505483  2.22599717
  [7]  0.56176873  1.05797040 -0.33777665 -0.68576619  1.53414508  1.71575314
 [13] -0.24667991  0.45135662  0.88703201 -1.81112606  2.10699324  0.47480133
 [19]  0.21018355 -0.51745537  0.56049331  0.18830516  0.11476247 -0.13681920
 [25] -1.24327766 -1.18628707 -1.57510874  0.74961077  1.57320791  0.28959406
 [31]  0.33013928 -0.64395422 -0.55627739 -1.23080462 -1.32698022 -0.39953547
 [37]  0.84994189  1.47891975 -0.25357546 -2.08745001 -0.75647098 -0.12698755
 [43] -0.24492387 -0.62418704 -2.32643174 -0.44958413 -1.37729696 -1.54461423
 [49] -0.59983349  1.01075161  0.94665799  1.74492719  0.55588046 -1.81691040
 [55]  0.23909855  1.20891289  0.01474613 -0.44022180  1.06321822 -0.11260046
 [61] -1.00963435  0.34668608  0.78934101  0.79775894  0.69291326  0.32376310
 [67]  0.41462324  0.38863162 -0.41826312  0.42910868  1.69234585  1.67312959
 [73] -1.33116923 -0.11704143  0.72051246 -0.64344223  0.67029296 -1.06933736
 [79] -0.97800226  1.49521650  0.99441044 -0.43483096 -0.41982017  0.27621990
 [85]  1.09558123  1.51901908  0.12512644 -0.07713700  0.76550314  0.65438459
 [91] -0.34801149  0.41341430 -1.33624194  0.93015362 -0.98589132  1.31573493
 [97] -0.59138147 -2.05855661  2.23948837 -0.49824167
> rowSums(tmp2)
  [1] -2.22801809  0.26270042  0.53408382  1.37574462  1.32505483  2.22599717
  [7]  0.56176873  1.05797040 -0.33777665 -0.68576619  1.53414508  1.71575314
 [13] -0.24667991  0.45135662  0.88703201 -1.81112606  2.10699324  0.47480133
 [19]  0.21018355 -0.51745537  0.56049331  0.18830516  0.11476247 -0.13681920
 [25] -1.24327766 -1.18628707 -1.57510874  0.74961077  1.57320791  0.28959406
 [31]  0.33013928 -0.64395422 -0.55627739 -1.23080462 -1.32698022 -0.39953547
 [37]  0.84994189  1.47891975 -0.25357546 -2.08745001 -0.75647098 -0.12698755
 [43] -0.24492387 -0.62418704 -2.32643174 -0.44958413 -1.37729696 -1.54461423
 [49] -0.59983349  1.01075161  0.94665799  1.74492719  0.55588046 -1.81691040
 [55]  0.23909855  1.20891289  0.01474613 -0.44022180  1.06321822 -0.11260046
 [61] -1.00963435  0.34668608  0.78934101  0.79775894  0.69291326  0.32376310
 [67]  0.41462324  0.38863162 -0.41826312  0.42910868  1.69234585  1.67312959
 [73] -1.33116923 -0.11704143  0.72051246 -0.64344223  0.67029296 -1.06933736
 [79] -0.97800226  1.49521650  0.99441044 -0.43483096 -0.41982017  0.27621990
 [85]  1.09558123  1.51901908  0.12512644 -0.07713700  0.76550314  0.65438459
 [91] -0.34801149  0.41341430 -1.33624194  0.93015362 -0.98589132  1.31573493
 [97] -0.59138147 -2.05855661  2.23948837 -0.49824167
> 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] -2.22801809  0.26270042  0.53408382  1.37574462  1.32505483  2.22599717
  [7]  0.56176873  1.05797040 -0.33777665 -0.68576619  1.53414508  1.71575314
 [13] -0.24667991  0.45135662  0.88703201 -1.81112606  2.10699324  0.47480133
 [19]  0.21018355 -0.51745537  0.56049331  0.18830516  0.11476247 -0.13681920
 [25] -1.24327766 -1.18628707 -1.57510874  0.74961077  1.57320791  0.28959406
 [31]  0.33013928 -0.64395422 -0.55627739 -1.23080462 -1.32698022 -0.39953547
 [37]  0.84994189  1.47891975 -0.25357546 -2.08745001 -0.75647098 -0.12698755
 [43] -0.24492387 -0.62418704 -2.32643174 -0.44958413 -1.37729696 -1.54461423
 [49] -0.59983349  1.01075161  0.94665799  1.74492719  0.55588046 -1.81691040
 [55]  0.23909855  1.20891289  0.01474613 -0.44022180  1.06321822 -0.11260046
 [61] -1.00963435  0.34668608  0.78934101  0.79775894  0.69291326  0.32376310
 [67]  0.41462324  0.38863162 -0.41826312  0.42910868  1.69234585  1.67312959
 [73] -1.33116923 -0.11704143  0.72051246 -0.64344223  0.67029296 -1.06933736
 [79] -0.97800226  1.49521650  0.99441044 -0.43483096 -0.41982017  0.27621990
 [85]  1.09558123  1.51901908  0.12512644 -0.07713700  0.76550314  0.65438459
 [91] -0.34801149  0.41341430 -1.33624194  0.93015362 -0.98589132  1.31573493
 [97] -0.59138147 -2.05855661  2.23948837 -0.49824167
> rowMin(tmp2)
  [1] -2.22801809  0.26270042  0.53408382  1.37574462  1.32505483  2.22599717
  [7]  0.56176873  1.05797040 -0.33777665 -0.68576619  1.53414508  1.71575314
 [13] -0.24667991  0.45135662  0.88703201 -1.81112606  2.10699324  0.47480133
 [19]  0.21018355 -0.51745537  0.56049331  0.18830516  0.11476247 -0.13681920
 [25] -1.24327766 -1.18628707 -1.57510874  0.74961077  1.57320791  0.28959406
 [31]  0.33013928 -0.64395422 -0.55627739 -1.23080462 -1.32698022 -0.39953547
 [37]  0.84994189  1.47891975 -0.25357546 -2.08745001 -0.75647098 -0.12698755
 [43] -0.24492387 -0.62418704 -2.32643174 -0.44958413 -1.37729696 -1.54461423
 [49] -0.59983349  1.01075161  0.94665799  1.74492719  0.55588046 -1.81691040
 [55]  0.23909855  1.20891289  0.01474613 -0.44022180  1.06321822 -0.11260046
 [61] -1.00963435  0.34668608  0.78934101  0.79775894  0.69291326  0.32376310
 [67]  0.41462324  0.38863162 -0.41826312  0.42910868  1.69234585  1.67312959
 [73] -1.33116923 -0.11704143  0.72051246 -0.64344223  0.67029296 -1.06933736
 [79] -0.97800226  1.49521650  0.99441044 -0.43483096 -0.41982017  0.27621990
 [85]  1.09558123  1.51901908  0.12512644 -0.07713700  0.76550314  0.65438459
 [91] -0.34801149  0.41341430 -1.33624194  0.93015362 -0.98589132  1.31573493
 [97] -0.59138147 -2.05855661  2.23948837 -0.49824167
> 
> colMeans(tmp2)
[1] 0.09202154
> colSums(tmp2)
[1] 9.202154
> colVars(tmp2)
[1] 1.123875
> colSd(tmp2)
[1] 1.06013
> colMax(tmp2)
[1] 2.239488
> colMin(tmp2)
[1] -2.326432
> colMedians(tmp2)
[1] 0.224641
> colRanges(tmp2)
          [,1]
[1,] -2.326432
[2,]  2.239488
> 
> 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] -0.3805275 -1.7170950 -0.4292745  0.5684295 -5.1980466  0.4745567
 [7] -2.5092948 -2.4291070 -1.2688545 -2.5086635
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -1.3837646
[2,] -0.3651519
[3,] -0.1821899
[4,]  0.6398632
[5,]  1.1160945
> 
> rowApply(tmp,sum)
 [1]  0.8349328456 -5.5593754841  1.7922000778 -2.6712917300  1.5217338405
 [6] -9.0734365491  3.3895484970 -2.7505819788  0.0008459178 -2.8824524775
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    6    4    9    9    4    5    3    6    5     9
 [2,]    1    5    1    4    8    9    8   10    8     3
 [3,]   10    1   10   10    3    8    2    1   10     5
 [4,]    2    7    4    8    2   10   10    5    7     1
 [5,]    5    2    5    2    5    1    5    9    4     4
 [6,]    4    6    2    6    1    6    9    8    9    10
 [7,]    3    9    6    5   10    2    4    4    6     6
 [8,]    7    8    7    3    9    7    1    7    3     2
 [9,]    8   10    3    1    6    3    6    2    2     7
[10,]    9    3    8    7    7    4    7    3    1     8
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1]  0.6195535 -0.6082952 -2.8964191  4.4672255 -0.9789187  2.2817771
 [7]  0.8017633  0.1924899 -3.6017172  0.2546197 -1.6489433  0.9905621
[13]  0.2121546  0.6816875  0.1108645  2.5227153 -3.4189795 -0.8922380
[19] -1.9675843  1.8902378
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -0.6441333
[2,] -0.6240457
[3,]  0.0880273
[4,]  0.5010321
[5,]  1.2986730
> 
> rowApply(tmp,sum)
[1]  2.919948 -7.875461  3.141817  2.974988 -2.148737
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]    9    7   14    4   20
[2,]   11   12    8   10   11
[3,]    1   17   10   12    6
[4,]   19   16   19   17    5
[5,]    6   15    9   16    2
> 
> 
> as.matrix(tmp)
           [,1]        [,2]       [,3]       [,4]        [,5]       [,6]
[1,]  0.0880273  0.25846710 -2.6483618  1.4123746 -0.19953254  0.9900746
[2,] -0.6441333 -0.25302090  0.4100068  0.2827659  0.09210945 -0.6379965
[3,]  0.5010321 -0.60721702 -0.3266584  2.2105435 -0.60412041  0.9803305
[4,] -0.6240457  0.06375950  0.3081082  1.2154664  0.98236822  1.4399018
[5,]  1.2986730 -0.07028383 -0.6395139 -0.6539250 -1.24974345 -0.4905334
           [,7]       [,8]        [,9]      [,10]      [,11]       [,12]
[1,]  0.4390032  0.0621957 -1.59075423  1.2872217  1.0439705  0.04507405
[2,] -0.1734554 -0.8451450 -1.18674923 -0.5081276 -1.6612301 -0.07981396
[3,]  0.3606763  1.6145686 -0.93773498 -1.1284455 -1.1791967  2.04065516
[4,]  0.5018540  0.1399467  0.02998588  0.3313535 -0.1645299 -2.01591642
[5,] -0.3263149 -0.7790761  0.08353539  0.2726178  0.3120430  1.00056330
          [,13]      [,14]       [,15]      [,16]      [,17]      [,18]
[1,]  0.2987365  0.2542947 -1.01229614  2.4650685 -0.3837113  0.5713195
[2,]  0.4943935 -0.5031028  0.61065484 -1.8630389 -0.5716290 -0.8777702
[3,] -0.1018694 -0.7799655  2.36163537  1.9816435 -1.6061603 -0.6715445
[4,] -0.8155313  1.2382012 -0.07835869  0.6394466 -0.2788129 -0.4613520
[5,]  0.3364254  0.4722600 -1.77077089 -0.7004045 -0.5786660  0.5471092
          [,19]      [,20]
[1,] -1.2897621  0.8285381
[2,] -0.8580850  0.8979068
[3,] -0.2853917 -0.6809639
[4,] -0.7032482  1.2263914
[5,]  1.1689026 -0.3816346
> 
> 
> 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.17-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.17-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  648  bytes.
Disk usage :  200  bytes.
> subBufferedMatrix(tmp,,5:8)
BufferedMatrix object
Matrix size:  5 4 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.17-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  563  bytes.
Disk usage :  160  bytes.
> subBufferedMatrix(tmp,1:3,)
BufferedMatrix object
Matrix size:  3 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.17-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  480  bytes.
> 
> 
> rm(tmp)
> 
> 
> ###
> ### Testing colnames and rownames
> ###
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> 
> 
> colnames(tmp)
NULL
> rownames(tmp)
NULL
> 
> 
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> colnames(tmp)
 [1] "col1"  "col2"  "col3"  "col4"  "col5"  "col6"  "col7"  "col8"  "col9" 
[10] "col10" "col11" "col12" "col13" "col14" "col15" "col16" "col17" "col18"
[19] "col19" "col20"
> rownames(tmp)
[1] "row1" "row2" "row3" "row4" "row5"
> 
> 
> tmp["row1",]
           col1      col2       col3     col4      col5    col6      col7
row1 -0.3999785 -2.295268 -0.3793909 1.162007 0.2006257 1.49419 0.2207599
          col8      col9      col10     col11     col12   col13      col14
row1 0.4965725 0.1169585 -0.7620862 0.0871046 0.7977335 0.66565 -0.3381749
         col15    col16     col17      col18     col19     col20
row1 -1.002994 1.588895 0.3838827 0.02578519 0.8043706 0.8135919
> tmp[,"col10"]
          col10
row1 -0.7620862
row2  1.4248475
row3  0.6922815
row4 -1.6945312
row5 -1.9979671
> tmp[c("row1","row5"),]
           col1      col2       col3      col4       col5     col6      col7
row1 -0.3999785 -2.295268 -0.3793909 1.1620066  0.2006257 1.494190 0.2207599
row5 -1.8996750 -1.550389 -0.2183484 0.6586788 -0.4016761 1.065901 0.5795352
          col8       col9      col10      col11     col12     col13      col14
row1 0.4965725  0.1169585 -0.7620862  0.0871046 0.7977335  0.665650 -0.3381749
row5 1.1538941 -1.0941794 -1.9979671 -1.1340480 0.2089424 -1.494384  1.3450312
          col15     col16      col17      col18      col19     col20
row1 -1.0029937 1.5888947  0.3838827 0.02578519  0.8043706 0.8135919
row5  0.1659908 0.5672621 -1.5231179 0.83034131 -0.1481995 1.1100720
> tmp[,c("col6","col20")]
           col6      col20
row1  1.4941897  0.8135919
row2  0.8547575 -0.7554406
row3 -1.1287511  1.0654681
row4  1.0873596  1.2916798
row5  1.0659010  1.1100720
> tmp[c("row1","row5"),c("col6","col20")]
         col6     col20
row1 1.494190 0.8135919
row5 1.065901 1.1100720
> 
> 
> 
> 
> tmp["row1",] <- rnorm(20,mean=10)
> tmp[,"col10"] <- rnorm(5,mean=30)
> tmp[c("row1","row5"),] <- rnorm(40,mean=50)
> tmp[,c("col6","col20")] <- rnorm(10,mean=75)
> tmp[c("row1","row5"),c("col6","col20")]  <- rnorm(4,mean=105)
> 
> tmp["row1",]
        col1    col2     col3     col4     col5     col6    col7    col8
row1 50.8002 49.2549 50.55316 49.32264 49.89921 104.1605 50.5639 48.9171
         col9    col10    col11    col12   col13   col14    col15    col16
row1 49.52389 49.36702 48.75442 50.91929 50.5103 51.3318 49.64689 49.78555
        col17    col18    col19    col20
row1 49.56367 49.69714 49.79977 105.1917
> tmp[,"col10"]
        col10
row1 49.36702
row2 30.85640
row3 29.27305
row4 30.48581
row5 48.53789
> tmp[c("row1","row5"),]
         col1    col2     col3     col4     col5     col6     col7     col8
row1 50.80020 49.2549 50.55316 49.32264 49.89921 104.1605 50.56390 48.91710
row5 50.06625 49.3237 50.39650 49.08168 51.34892 103.7110 49.65838 50.04574
         col9    col10    col11    col12    col13    col14    col15    col16
row1 49.52389 49.36702 48.75442 50.91929 50.51030 51.33180 49.64689 49.78555
row5 49.99241 48.53789 50.51785 48.88606 49.19241 49.80839 50.16792 51.14049
        col17    col18    col19    col20
row1 49.56367 49.69714 49.79977 105.1917
row5 50.21649 51.49873 49.96883 105.0893
> tmp[,c("col6","col20")]
          col6     col20
row1 104.16054 105.19166
row2  73.57655  74.89360
row3  75.98793  74.94577
row4  75.46477  76.18283
row5 103.71103 105.08932
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 104.1605 105.1917
row5 103.7110 105.0893
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 104.1605 105.1917
row5 103.7110 105.0893
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
           col13
[1,] -0.56713834
[2,] -0.57971031
[3,] -1.72214270
[4,] -0.04302318
[5,] -1.28629686
> tmp[,c("col17","col7")]
          col17       col7
[1,]  1.3790892 -0.3695637
[2,]  0.4725150  1.3854508
[3,] -0.5880581 -0.6948054
[4,]  0.6000128  2.0218090
[5,] -0.6770146 -0.7558638
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
            col6      col20
[1,] -0.66049988  0.3424555
[2,]  0.05008343 -1.4945853
[3,]  0.43496437  0.7512407
[4,] -0.68062681  0.5454488
[5,]  0.68861365  1.2128176
> subBufferedMatrix(tmp,1,c("col6"))[,1]
           col1
[1,] -0.6604999
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
            col6
[1,] -0.66049988
[2,]  0.05008343
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> 
> 
> 
> subBufferedMatrix(tmp,c("row3","row1"),)[,1:20]
           [,1]       [,2]       [,3]       [,4]      [,5]      [,6]       [,7]
row3  0.2431479 -0.8813634 -0.5603831 -0.9611727 0.6048705  1.254999 0.01879252
row1 -2.1511355  2.1929996 -0.6478940 -1.0767716 0.9382414 -2.082143 0.38609148
           [,8]      [,9]      [,10]      [,11]     [,12]      [,13]      [,14]
row3  0.8419983 0.3598046  1.2212049 1.02439918  1.016470 -0.5126742 -0.2141441
row1 -0.9444276 0.9167608 -0.1927731 0.04938933 -1.340118  0.2626719  0.6789819
         [,15]      [,16]    [,17]      [,18]      [,19]     [,20]
row3 1.7472899  0.3010771 1.576032 -1.2473651  0.2135824 0.3534124
row1 0.1741844 -1.5582201 1.500649  0.7303798 -0.6650982 1.4013548
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
           [,1]     [,2]     [,3]       [,4]         [,5]      [,6]       [,7]
row2 -0.3262764 2.035822 1.387042 -0.1098174 -0.009924486 -1.270464 -0.9397294
          [,8]      [,9]    [,10]
row2 0.4221788 -0.462463 -1.83597
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
          [,1]       [,2]      [,3]      [,4]      [,5]      [,6]      [,7]
row5 -1.383045 -0.4281763 0.4026961 -1.423726 -1.072864 0.4623933 -1.556051
         [,8]     [,9]      [,10]    [,11]     [,12]      [,13]      [,14]
row5 1.353298 1.369124 -0.6971461 0.764428 0.6775675 -0.7276669 -0.1773289
          [,15]      [,16]     [,17]     [,18]      [,19]      [,20]
row5 -0.6276515 0.01575386 0.3834161 -0.193582 -0.8502929 -0.3872001
> 
> 
> 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: 0x600001058000>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "/Users/biocbuild/bbs-3.17-bioc/meat/BufferedMatrix.Rcheck/tests/BMebf679e60e74"
 [2] "/Users/biocbuild/bbs-3.17-bioc/meat/BufferedMatrix.Rcheck/tests/BMebf66ebf2031"
 [3] "/Users/biocbuild/bbs-3.17-bioc/meat/BufferedMatrix.Rcheck/tests/BMebf645daa9c4"
 [4] "/Users/biocbuild/bbs-3.17-bioc/meat/BufferedMatrix.Rcheck/tests/BMebf616bfa6b0"
 [5] "/Users/biocbuild/bbs-3.17-bioc/meat/BufferedMatrix.Rcheck/tests/BMebf658787b"  
 [6] "/Users/biocbuild/bbs-3.17-bioc/meat/BufferedMatrix.Rcheck/tests/BMebf6304dd36a"
 [7] "/Users/biocbuild/bbs-3.17-bioc/meat/BufferedMatrix.Rcheck/tests/BMebf64572ecec"
 [8] "/Users/biocbuild/bbs-3.17-bioc/meat/BufferedMatrix.Rcheck/tests/BMebf67c209d92"
 [9] "/Users/biocbuild/bbs-3.17-bioc/meat/BufferedMatrix.Rcheck/tests/BMebf641491be8"
[10] "/Users/biocbuild/bbs-3.17-bioc/meat/BufferedMatrix.Rcheck/tests/BMebf626c73dd4"
[11] "/Users/biocbuild/bbs-3.17-bioc/meat/BufferedMatrix.Rcheck/tests/BMebf662ac3d2f"
[12] "/Users/biocbuild/bbs-3.17-bioc/meat/BufferedMatrix.Rcheck/tests/BMebf619e50b45"
[13] "/Users/biocbuild/bbs-3.17-bioc/meat/BufferedMatrix.Rcheck/tests/BMebf6c46ec4b" 
[14] "/Users/biocbuild/bbs-3.17-bioc/meat/BufferedMatrix.Rcheck/tests/BMebf64433639" 
[15] "/Users/biocbuild/bbs-3.17-bioc/meat/BufferedMatrix.Rcheck/tests/BMebf6589cda5e"
> 
> 
> ### 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: 0x600001044180>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x600001044180>
Warning message:
In dir.create(new.directory) :
  '/Users/biocbuild/bbs-3.17-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x600001044180>
> rowMedians(tmp)
  [1]  0.1815582262 -0.4607500721 -0.1438077239  0.0058808979  0.0231738327
  [6]  0.0975983618 -0.2545721190  0.4107281358 -0.0095282969  0.2127163886
 [11]  0.3336462204  0.6748124753  0.0791940888 -0.0537539351 -0.5443611918
 [16] -0.1529840739 -0.2193791671 -0.2830185281  0.6025641155 -0.1279945638
 [21] -0.4515086380 -0.3767510576  0.1611721495  0.1547794845  0.3959514883
 [26]  0.2891836905 -0.3035708767  0.1079373596  0.2445685092  0.5554558173
 [31]  0.4866715322  0.0496587427 -0.0076616622  0.3633049988  0.4144597713
 [36] -0.0041955390 -0.2489111320  0.2286102794  0.6271732877  0.3202100868
 [41]  0.6956240977  0.1252417119  0.1479903114  0.2003886598 -0.0976220120
 [46] -0.1846411374 -0.0967204467 -0.0780496260  0.3194617912 -0.8046816114
 [51] -0.2330778321  0.1362347661  0.0148142341  0.3619923757 -0.6946713565
 [56]  0.4053611871  0.1664501191  0.1242721913  0.3638452303 -0.1919140236
 [61] -0.1421693947 -0.0175516224 -0.2729631225 -0.1222953005 -0.2059309576
 [66] -0.3200700961  0.7510097868  0.1779078843 -0.0571217178  0.0517057900
 [71]  0.0308695670  0.5024091282 -0.3716135018  0.0282855613 -0.1084954785
 [76] -0.0082824223  0.4342778940 -0.2277213534  0.2602670359 -0.1417226058
 [81]  0.0014241945  0.0939402874  0.0994373953 -0.0793169781 -0.0567798873
 [86] -0.9207747603  0.4794015869 -0.0019230476 -0.4552595340  0.0229367559
 [91] -0.4170616714  0.1795631191 -0.3160360061  0.1236170464  0.5914205778
 [96] -0.1577808648 -0.0577011474  0.0950864013 -0.2050456835 -0.0841861330
[101] -0.0808083892 -0.1065564209 -0.2802825216  0.3126711730 -0.0409637793
[106] -0.6114210851 -0.0379468934 -0.0626803696  0.1379232932 -0.2558036948
[111] -0.0066194330  0.4364030289 -0.0693983408  0.3337765449  0.1233955773
[116]  0.0261005032  0.2628727375  0.4799148710  0.1495757546  0.0671713442
[121]  0.5984128628 -0.0004760885 -0.2042120889 -0.1319792652  0.1672039008
[126]  0.3616559764  0.3319425895  0.1310039043 -0.0987015538 -0.0569733747
[131]  0.2635439543 -0.5087053053  0.4711803785 -0.2756051234  0.1981981679
[136] -0.2100000958  0.0038845244 -0.4533200596  0.0132643682  0.6849589407
[141]  0.3996812774 -0.5197586986  0.1937789659 -0.4537166538  0.0292998894
[146] -0.3810028274 -0.0397677668 -0.1094777682  0.0298218847  0.0624181605
[151]  0.4989755355 -0.6422519449  0.1964132983  0.2420673811  0.0100947499
[156]  0.1652564957  0.7937569270 -0.2227670910 -0.2958454086 -0.2093937288
[161] -0.2893484266  0.5422681584  0.0186072657 -0.1156779378  0.1907129756
[166]  0.2882934691 -0.2557507529 -0.1341211359  0.0054909793 -0.1211731250
[171]  0.1471791535 -0.3435463435  0.0016605763  0.2570585696 -0.2156315667
[176] -0.0709033695 -0.3197894662  0.2576030954 -0.3131703102  0.2217081913
[181]  0.0755048792 -0.5874744528  0.3056153291 -0.5117281036 -0.3124372593
[186]  0.0614807446  0.1988829188  0.5638455114  0.0099924029 -0.1415815709
[191]  0.0485691883 -0.1356170184  0.2816370277  0.0703471190  0.0222005891
[196] -0.0657550194 -0.1584654903  0.5840831790  0.0386149756  0.5772696305
[201]  0.1396613674  0.1202168616  0.2746299474  0.0476442679  0.3560732495
[206]  0.7279894874  0.2953427982 -0.0530126749  0.0170069740 -0.0071356679
[211] -0.1164901465  0.0201371132  0.0018157727 -0.0469393959  0.3211400294
[216] -0.0716467544 -0.1303678300 -0.6058699372 -0.1474434664  0.4637727758
[221] -0.0195816011  0.2532048449  0.3507908762 -0.8316205939 -0.3705297011
[226]  0.3392895248  0.2114365396 -0.0497028583 -0.0264861359 -0.2889298782
> 
> proc.time()
   user  system elapsed 
  5.062  18.337  31.762 

BufferedMatrix.Rcheck/tests/rawCalltesting.Rout


R version 4.3.1 (2023-06-16) -- "Beagle Scouts"
Copyright (C) 2023 The R Foundation for Statistical Computing
Platform: x86_64-apple-darwin20 (64-bit)

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: 0x600000150120>
> .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: 0x600000150120>
> .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: 0x600000150120>
> .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: 0x600000150120>
> 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: 0x6000001582a0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000001582a0>
> .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: 0x6000001582a0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000001582a0>
> .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: 0x6000001582a0>
> 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: 0x600000158420>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600000158420>
> .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: 0x600000158420>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x600000158420>
> .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: 0x600000158420>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x600000158420>
> .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: 0x600000158420>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x600000158420>
> .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: 0x600000158420>
> 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: 0x600000170000>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x600000170000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600000170000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600000170000>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFilef04543d585dd" "BufferedMatrixFilef045478c2cdd"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFilef04543d585dd" "BufferedMatrixFilef045478c2cdd"
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x600000178060>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600000178060>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x600000178060>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x600000178060>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x600000178060>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x600000178060>
> .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: 0x60000016c060>
> .Call("R_bm_AddColumn",P)
<pointer: 0x60000016c060>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x60000016c060>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x60000016c060>
> 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: 0x60000016c240>
> .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: 0x60000016c240>
> rm(P)
> 
> proc.time()
   user  system elapsed 
  0.593   0.218   0.898 

BufferedMatrix.Rcheck/tests/Rcodetesting.Rout


R version 4.3.1 (2023-06-16) -- "Beagle Scouts"
Copyright (C) 2023 The R Foundation for Statistical Computing
Platform: x86_64-apple-darwin20 (64-bit)

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.589   0.139   0.805 

Example timings