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

This page was generated on 2025-01-02 12:05 -0500 (Thu, 02 Jan 2025).

HostnameOSArch (*)R versionInstalled pkgs
nebbiolo2Linux (Ubuntu 24.04.1 LTS)x86_644.4.2 (2024-10-31) -- "Pile of Leaves" 4744
palomino8Windows Server 2022 Datacenterx644.4.2 (2024-10-31 ucrt) -- "Pile of Leaves" 4487
merida1macOS 12.7.5 Montereyx86_644.4.2 (2024-10-31) -- "Pile of Leaves" 4515
kjohnson1macOS 13.6.6 Venturaarm644.4.2 (2024-10-31) -- "Pile of Leaves" 4467
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 251/2289HostnameOS / ArchINSTALLBUILDCHECKBUILD BIN
BufferedMatrix 1.70.0  (landing page)
Ben Bolstad
Snapshot Date: 2024-12-30 13:00 -0500 (Mon, 30 Dec 2024)
git_url: https://git.bioconductor.org/packages/BufferedMatrix
git_branch: RELEASE_3_20
git_last_commit: 32b6f6a
git_last_commit_date: 2024-10-29 09:27:20 -0500 (Tue, 29 Oct 2024)
nebbiolo2Linux (Ubuntu 24.04.1 LTS) / x86_64  OK    OK    OK  UNNEEDED, same version is already published
palomino8Windows Server 2022 Datacenter / x64  OK    OK    OK    OK  UNNEEDED, same version is already published
merida1macOS 12.7.5 Monterey / x86_64  OK    OK    WARNINGS    OK  UNNEEDED, same version is already published
kjohnson1macOS 13.6.6 Ventura / arm64  OK    OK    WARNINGS    OK  UNNEEDED, same version is already published


CHECK results for BufferedMatrix on merida1

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

raw results


Summary

Package: BufferedMatrix
Version: 1.70.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.70.0.tar.gz
StartedAt: 2024-12-31 00:45:14 -0500 (Tue, 31 Dec 2024)
EndedAt: 2024-12-31 00:46:35 -0500 (Tue, 31 Dec 2024)
EllapsedTime: 80.4 seconds
RetCode: 0
Status:   WARNINGS  
CheckDir: BufferedMatrix.Rcheck
Warnings: 1

Command output

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


* using log directory ‘/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck’
* using R version 4.4.2 (2024-10-31)
* using platform: x86_64-apple-darwin20
* R was compiled by
    Apple clang version 14.0.0 (clang-1400.0.29.202)
    GNU Fortran (GCC) 12.2.0
* running under: macOS Monterey 12.7.6
* using session charset: UTF-8
* using option ‘--no-vignettes’
* checking for file ‘BufferedMatrix/DESCRIPTION’ ... OK
* this is package ‘BufferedMatrix’ version ‘1.70.0’
* checking package namespace information ... OK
* checking package dependencies ... OK
* checking if this is a source package ... OK
* checking if there is a namespace ... OK
* checking for hidden files and directories ... OK
* checking for portable file names ... OK
* checking for sufficient/correct file permissions ... OK
* checking whether package ‘BufferedMatrix’ can be installed ... WARNING
Found the following significant warnings:
  doubleBufferedMatrix.c:1580:7: warning: logical not is only applied to the left hand side of this bitwise operator [-Wlogical-not-parentheses]
See ‘/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/00install.out’ for details.
* used C compiler: ‘Apple clang version 14.0.0 (clang-1400.0.29.202)’
* used SDK: ‘MacOSX11.3.sdk’
* checking installed package size ... OK
* checking package directory ... OK
* checking ‘build’ directory ... OK
* checking DESCRIPTION meta-information ... OK
* checking top-level files ... OK
* checking for left-over files ... OK
* checking index information ... OK
* checking package subdirectories ... OK
* checking code files for non-ASCII characters ... OK
* checking R files for syntax errors ... OK
* checking whether the package can be loaded ... OK
* checking whether the package can be loaded with stated dependencies ... OK
* checking whether the package can be unloaded cleanly ... OK
* checking whether the namespace can be loaded with stated dependencies ... OK
* checking whether the namespace can be unloaded cleanly ... OK
* checking dependencies in R code ... OK
* checking S3 generic/method consistency ... OK
* checking replacement functions ... OK
* checking foreign function calls ... OK
* checking R code for possible problems ... OK
* checking Rd files ... NOTE
checkRd: (-1) BufferedMatrix-class.Rd:209: Lost braces; missing escapes or markup?
   209 |     $x^{power}$ elementwise of the matrix
       |        ^
prepare_Rd: createBufferedMatrix.Rd:26: Dropping empty section \keyword
prepare_Rd: createBufferedMatrix.Rd:17-18: Dropping empty section \details
prepare_Rd: createBufferedMatrix.Rd:15-16: Dropping empty section \value
prepare_Rd: createBufferedMatrix.Rd:19-20: Dropping empty section \references
prepare_Rd: createBufferedMatrix.Rd:21-22: Dropping empty section \seealso
prepare_Rd: createBufferedMatrix.Rd:23-24: Dropping empty section \examples
* checking Rd metadata ... OK
* checking Rd cross-references ... OK
* checking for missing documentation entries ... OK
* checking for code/documentation mismatches ... OK
* checking Rd \usage sections ... OK
* checking Rd contents ... OK
* checking for unstated dependencies in examples ... OK
* checking line endings in C/C++/Fortran sources/headers ... OK
* checking compiled code ... NOTE
Note: information on .o files is not available
* checking sizes of PDF files under ‘inst/doc’ ... OK
* checking files in ‘vignettes’ ... OK
* checking examples ... NONE
* checking for unstated dependencies in ‘tests’ ... OK
* checking tests ...
  Running ‘Rcodetesting.R’
  Running ‘c_code_level_tests.R’
  Running ‘objectTesting.R’
  Running ‘rawCalltesting.R’
 OK
* checking for unstated dependencies in vignettes ... OK
* checking package vignettes ... OK
* checking running R code from vignettes ... SKIPPED
* checking re-building of vignette outputs ... SKIPPED
* checking PDF version of manual ... OK
* DONE

Status: 1 WARNING, 2 NOTEs
See
  ‘/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/00check.log’
for details.


Installation output

BufferedMatrix.Rcheck/00install.out

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


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

Tests output

BufferedMatrix.Rcheck/tests/c_code_level_tests.Rout


R version 4.4.2 (2024-10-31) -- "Pile of Leaves"
Copyright (C) 2024 The R Foundation for Statistical Computing
Platform: x86_64-apple-darwin20

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

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

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

> library(BufferedMatrix);library.dynam("BufferedMatrix", "BufferedMatrix", .libPaths());.C("dbm_c_tester",integer(1))

Attaching package: 'BufferedMatrix'

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

    colMeans, colSums, rowMeans, rowSums

Checking dimensions
Rows: 5
Cols: 5
Buffer Rows: 1
Buffer Cols: 1

Assigning Values
0.000000 1.000000 2.000000 3.000000 4.000000 
1.000000 2.000000 3.000000 4.000000 5.000000 
2.000000 3.000000 4.000000 5.000000 6.000000 
3.000000 4.000000 5.000000 6.000000 7.000000 
4.000000 5.000000 6.000000 7.000000 8.000000 

Adding Additional Column
Checking dimensions
Rows: 5
Cols: 6
Buffer Rows: 1
Buffer Cols: 1
0.000000 1.000000 2.000000 3.000000 4.000000 0.000000 
1.000000 2.000000 3.000000 4.000000 5.000000 0.000000 
2.000000 3.000000 4.000000 5.000000 6.000000 0.000000 
3.000000 4.000000 5.000000 6.000000 7.000000 0.000000 
4.000000 5.000000 6.000000 7.000000 8.000000 0.000000 

Reassigning values
1.000000 6.000000 11.000000 16.000000 21.000000 26.000000 
2.000000 7.000000 12.000000 17.000000 22.000000 27.000000 
3.000000 8.000000 13.000000 18.000000 23.000000 28.000000 
4.000000 9.000000 14.000000 19.000000 24.000000 29.000000 
5.000000 10.000000 15.000000 20.000000 25.000000 30.000000 

Resizing Buffers
Checking dimensions
Rows: 5
Cols: 6
Buffer Rows: 3
Buffer Cols: 3
1.000000 6.000000 11.000000 16.000000 21.000000 26.000000 
2.000000 7.000000 12.000000 17.000000 22.000000 27.000000 
3.000000 8.000000 13.000000 18.000000 23.000000 28.000000 
4.000000 9.000000 14.000000 19.000000 24.000000 29.000000 
5.000000 10.000000 15.000000 20.000000 25.000000 30.000000 

Activating Row Buffer
In row mode: 1
1.000000 6.000000 11.000000 16.000000 21.000000 26.000000 
2.000000 7.000000 12.000000 17.000000 22.000000 27.000000 
3.000000 8.000000 13.000000 18.000000 23.000000 28.000000 
4.000000 9.000000 14.000000 19.000000 24.000000 29.000000 
5.000000 10.000000 15.000000 20.000000 25.000000 30.000000 

Squaring Last Column
1.000000 6.000000 11.000000 16.000000 21.000000 676.000000 
2.000000 7.000000 12.000000 17.000000 22.000000 729.000000 
3.000000 8.000000 13.000000 18.000000 23.000000 784.000000 
4.000000 9.000000 14.000000 19.000000 24.000000 841.000000 
5.000000 10.000000 15.000000 20.000000 25.000000 900.000000 

Square rooting Last Row, then turing off Row Buffer
In row mode: 0
Checking on value that should be not be in column buffer2.236068 
1.000000 6.000000 11.000000 16.000000 21.000000 676.000000 
2.000000 7.000000 12.000000 17.000000 22.000000 729.000000 
3.000000 8.000000 13.000000 18.000000 23.000000 784.000000 
4.000000 9.000000 14.000000 19.000000 24.000000 841.000000 
2.236068 3.162278 3.872983 4.472136 5.000000 30.000000 

Single Indexing. Assign each value its square
1.000000 36.000000 121.000000 256.000000 441.000000 676.000000 
4.000000 49.000000 144.000000 289.000000 484.000000 729.000000 
9.000000 64.000000 169.000000 324.000000 529.000000 784.000000 
16.000000 81.000000 196.000000 361.000000 576.000000 841.000000 
25.000000 100.000000 225.000000 400.000000 625.000000 900.000000 

Resizing Buffers Smaller
Checking dimensions
Rows: 5
Cols: 6
Buffer Rows: 1
Buffer Cols: 1
1.000000 36.000000 121.000000 256.000000 441.000000 676.000000 
4.000000 49.000000 144.000000 289.000000 484.000000 729.000000 
9.000000 64.000000 169.000000 324.000000 529.000000 784.000000 
16.000000 81.000000 196.000000 361.000000 576.000000 841.000000 
25.000000 100.000000 225.000000 400.000000 625.000000 900.000000 

Activating Row Mode.
Resizing Buffers
Checking dimensions
Rows: 5
Cols: 6
Buffer Rows: 1
Buffer Cols: 1
Activating ReadOnly Mode.
The results of assignment is: 0
Printing matrix reversed.
900.000000 625.000000 400.000000 225.000000 100.000000 25.000000 
841.000000 576.000000 361.000000 196.000000 81.000000 16.000000 
784.000000 529.000000 324.000000 169.000000 64.000000 9.000000 
729.000000 484.000000 289.000000 144.000000 49.000000 -30.000000 
676.000000 441.000000 256.000000 121.000000 -20.000000 -10.000000 

[[1]]
[1] 0

> 
> proc.time()
   user  system elapsed 
  0.603   0.211   0.834 

BufferedMatrix.Rcheck/tests/objectTesting.Rout


R version 4.4.2 (2024-10-31) -- "Pile of Leaves"
Copyright (C) 2024 The R Foundation for Statistical Computing
Platform: x86_64-apple-darwin20

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

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

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

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

Attaching package: 'BufferedMatrix'

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

    colMeans, colSums, rowMeans, rowSums

> 
> 
> ### this is used to control how many repetitions in something below
> ### higher values result in more checks.
> nreps <-100 ##20000
> 
> 
> ## test creation and some simple assignments and subsetting operations
> 
> ## first on single elements
> tmp <- createBufferedMatrix(1000,10)
> 
> tmp[10,5]
[1] 0
> tmp[10,5] <- 10
> tmp[10,5]
[1] 10
> tmp[10,5] <- 12.445
> tmp[10,5]
[1] 12.445
> 
> 
> 
> ## now testing accessing multiple elements
> tmp2 <- createBufferedMatrix(10,20)
> 
> 
> tmp2[3,1] <- 51.34
> tmp2[9,2] <- 9.87654
> tmp2[,1:2]
       [,1]    [,2]
 [1,]  0.00 0.00000
 [2,]  0.00 0.00000
 [3,] 51.34 0.00000
 [4,]  0.00 0.00000
 [5,]  0.00 0.00000
 [6,]  0.00 0.00000
 [7,]  0.00 0.00000
 [8,]  0.00 0.00000
 [9,]  0.00 9.87654
[10,]  0.00 0.00000
> tmp2[,-(3:20)]
       [,1]    [,2]
 [1,]  0.00 0.00000
 [2,]  0.00 0.00000
 [3,] 51.34 0.00000
 [4,]  0.00 0.00000
 [5,]  0.00 0.00000
 [6,]  0.00 0.00000
 [7,]  0.00 0.00000
 [8,]  0.00 0.00000
 [9,]  0.00 9.87654
[10,]  0.00 0.00000
> tmp2[3,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
[1,] 51.34    0    0    0    0    0    0    0    0     0     0     0     0
     [,14] [,15] [,16] [,17] [,18] [,19] [,20]
[1,]     0     0     0     0     0     0     0
> tmp2[-3,]
      [,1]    [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [2,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [3,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [4,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [5,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [6,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [7,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [8,]    0 9.87654    0    0    0    0    0    0    0     0     0     0     0
 [9,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
      [,14] [,15] [,16] [,17] [,18] [,19] [,20]
 [1,]     0     0     0     0     0     0     0
 [2,]     0     0     0     0     0     0     0
 [3,]     0     0     0     0     0     0     0
 [4,]     0     0     0     0     0     0     0
 [5,]     0     0     0     0     0     0     0
 [6,]     0     0     0     0     0     0     0
 [7,]     0     0     0     0     0     0     0
 [8,]     0     0     0     0     0     0     0
 [9,]     0     0     0     0     0     0     0
> tmp2[2,1:3]
     [,1] [,2] [,3]
[1,]    0    0    0
> tmp2[3:9,1:3]
      [,1]    [,2] [,3]
[1,] 51.34 0.00000    0
[2,]  0.00 0.00000    0
[3,]  0.00 0.00000    0
[4,]  0.00 0.00000    0
[5,]  0.00 0.00000    0
[6,]  0.00 0.00000    0
[7,]  0.00 9.87654    0
> tmp2[-4,-4]
       [,1]    [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [2,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [3,] 51.34 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [4,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [5,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [6,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [7,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [8,]  0.00 9.87654    0    0    0    0    0    0    0     0     0     0     0
 [9,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
      [,14] [,15] [,16] [,17] [,18] [,19]
 [1,]     0     0     0     0     0     0
 [2,]     0     0     0     0     0     0
 [3,]     0     0     0     0     0     0
 [4,]     0     0     0     0     0     0
 [5,]     0     0     0     0     0     0
 [6,]     0     0     0     0     0     0
 [7,]     0     0     0     0     0     0
 [8,]     0     0     0     0     0     0
 [9,]     0     0     0     0     0     0
> 
> ## now testing accessing/assigning multiple elements
> tmp3 <- createBufferedMatrix(10,10)
> 
> for (i in 1:10){
+   for (j in 1:10){
+     tmp3[i,j] <- (j-1)*10 + i
+   }
+ }
> 
> tmp3[2:4,2:4]
     [,1] [,2] [,3]
[1,]   12   22   32
[2,]   13   23   33
[3,]   14   24   34
> tmp3[c(-10),c(2:4,2:4,10,1,2,1:10,10:1)]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]   11   21   31   11   21   31   91    1   11     1    11    21    31
 [2,]   12   22   32   12   22   32   92    2   12     2    12    22    32
 [3,]   13   23   33   13   23   33   93    3   13     3    13    23    33
 [4,]   14   24   34   14   24   34   94    4   14     4    14    24    34
 [5,]   15   25   35   15   25   35   95    5   15     5    15    25    35
 [6,]   16   26   36   16   26   36   96    6   16     6    16    26    36
 [7,]   17   27   37   17   27   37   97    7   17     7    17    27    37
 [8,]   18   28   38   18   28   38   98    8   18     8    18    28    38
 [9,]   19   29   39   19   29   39   99    9   19     9    19    29    39
      [,14] [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24] [,25]
 [1,]    41    51    61    71    81    91    91    81    71    61    51    41
 [2,]    42    52    62    72    82    92    92    82    72    62    52    42
 [3,]    43    53    63    73    83    93    93    83    73    63    53    43
 [4,]    44    54    64    74    84    94    94    84    74    64    54    44
 [5,]    45    55    65    75    85    95    95    85    75    65    55    45
 [6,]    46    56    66    76    86    96    96    86    76    66    56    46
 [7,]    47    57    67    77    87    97    97    87    77    67    57    47
 [8,]    48    58    68    78    88    98    98    88    78    68    58    48
 [9,]    49    59    69    79    89    99    99    89    79    69    59    49
      [,26] [,27] [,28] [,29]
 [1,]    31    21    11     1
 [2,]    32    22    12     2
 [3,]    33    23    13     3
 [4,]    34    24    14     4
 [5,]    35    25    15     5
 [6,]    36    26    16     6
 [7,]    37    27    17     7
 [8,]    38    28    18     8
 [9,]    39    29    19     9
> tmp3[-c(1:5),-c(6:10)]
     [,1] [,2] [,3] [,4] [,5]
[1,]    6   16   26   36   46
[2,]    7   17   27   37   47
[3,]    8   18   28   38   48
[4,]    9   19   29   39   49
[5,]   10   20   30   40   50
> 
> ## assignment of whole columns
> tmp3[,1] <- c(1:10*100.0)
> tmp3[,1:2] <- tmp3[,1:2]*100
> tmp3[,1:2] <- tmp3[,2:1]
> tmp3[,1:2]
      [,1]  [,2]
 [1,] 1100 1e+04
 [2,] 1200 2e+04
 [3,] 1300 3e+04
 [4,] 1400 4e+04
 [5,] 1500 5e+04
 [6,] 1600 6e+04
 [7,] 1700 7e+04
 [8,] 1800 8e+04
 [9,] 1900 9e+04
[10,] 2000 1e+05
> 
> 
> tmp3[,-1] <- tmp3[,1:9]
> tmp3[,1:10]
      [,1] [,2]  [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,] 1100 1100 1e+04   21   31   41   51   61   71    81
 [2,] 1200 1200 2e+04   22   32   42   52   62   72    82
 [3,] 1300 1300 3e+04   23   33   43   53   63   73    83
 [4,] 1400 1400 4e+04   24   34   44   54   64   74    84
 [5,] 1500 1500 5e+04   25   35   45   55   65   75    85
 [6,] 1600 1600 6e+04   26   36   46   56   66   76    86
 [7,] 1700 1700 7e+04   27   37   47   57   67   77    87
 [8,] 1800 1800 8e+04   28   38   48   58   68   78    88
 [9,] 1900 1900 9e+04   29   39   49   59   69   79    89
[10,] 2000 2000 1e+05   30   40   50   60   70   80    90
> 
> tmp3[,1:2] <- rep(1,10)
> tmp3[,1:2] <- rep(1,20)
> tmp3[,1:2] <- matrix(c(1:5),1,5)
> 
> tmp3[,-c(1:8)] <- matrix(c(1:5),1,5)
> 
> tmp3[1,] <- 1:10
> tmp3[1,]
     [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,]    1    2    3    4    5    6    7    8    9    10
> tmp3[-1,] <- c(1,2)
> tmp3[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    1    2    3    4    5    6    7    8    9    10
 [2,]    1    2    1    2    1    2    1    2    1     2
 [3,]    2    1    2    1    2    1    2    1    2     1
 [4,]    1    2    1    2    1    2    1    2    1     2
 [5,]    2    1    2    1    2    1    2    1    2     1
 [6,]    1    2    1    2    1    2    1    2    1     2
 [7,]    2    1    2    1    2    1    2    1    2     1
 [8,]    1    2    1    2    1    2    1    2    1     2
 [9,]    2    1    2    1    2    1    2    1    2     1
[10,]    1    2    1    2    1    2    1    2    1     2
> tmp3[-c(1:8),] <- matrix(c(1:5),1,5)
> tmp3[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    1    2    3    4    5    6    7    8    9    10
 [2,]    1    2    1    2    1    2    1    2    1     2
 [3,]    2    1    2    1    2    1    2    1    2     1
 [4,]    1    2    1    2    1    2    1    2    1     2
 [5,]    2    1    2    1    2    1    2    1    2     1
 [6,]    1    2    1    2    1    2    1    2    1     2
 [7,]    2    1    2    1    2    1    2    1    2     1
 [8,]    1    2    1    2    1    2    1    2    1     2
 [9,]    1    3    5    2    4    1    3    5    2     4
[10,]    2    4    1    3    5    2    4    1    3     5
> 
> 
> tmp3[1:2,1:2] <- 5555.04
> tmp3[-(1:2),1:2] <- 1234.56789
> 
> 
> 
> ## testing accessors for the directory and prefix
> directory(tmp3)
[1] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests"
> prefix(tmp3)
[1] "BM"
> 
> ## testing if we can remove these objects
> rm(tmp, tmp2, tmp3)
> gc()
         used (Mb) gc trigger (Mb) limit (Mb) max used (Mb)
Ncells 474188 25.4    1035498 55.4         NA   638648 34.2
Vcells 877698  6.7    8388608 64.0      65536  2071806 15.9
> 
> 
> 
> 
> ##
> ## checking reads
> ##
> 
> tmp2 <- createBufferedMatrix(10,20)
> 
> test.sample <- rnorm(10*20)
> 
> tmp2[1:10,1:20] <- test.sample
> 
> test.matrix <- matrix(test.sample,10,20)
> 
> ## testing reads
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   which.col <- sample(1:20,1)
+   if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> date()
[1] "Tue Dec 31 00:45:51 2024"
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> date()
[1] "Tue Dec 31 00:45:52 2024"
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,which.col] == test.matrix[which.row,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> 
> 
> RowMode(tmp2)
<pointer: 0x600001604000>
> 
> 
> 
> 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] "Tue Dec 31 00:45:58 2024"
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col <- sample(1:20,5,replace=TRUE)
+   if (!all(tmp2[which.row,which.col] == test.matrix[which.row,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> date()
[1] "Tue Dec 31 00:46:01 2024"
> 
> ColMode(tmp2)
<pointer: 0x600001604000>
> 
> 
> 
> ### 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,] 101.1477570 -0.6720017 -0.06039546 -0.4485392
[2,]   0.5825327 -1.1632244 -0.41717929 -1.0238724
[3,]   1.1470315  1.2471917  0.61794698  0.4271792
[4,]  -1.5835776  0.1886845 -0.01812806 -1.6489069
> ewApply(tmp5,abs)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
            [,1]      [,2]       [,3]      [,4]
[1,] 101.1477570 0.6720017 0.06039546 0.4485392
[2,]   0.5825327 1.1632244 0.41717929 1.0238724
[3,]   1.1470315 1.2471917 0.61794698 0.4271792
[4,]   1.5835776 0.1886845 0.01812806 1.6489069
> ewApply(tmp5,sqrt)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
           [,1]      [,2]      [,3]      [,4]
[1,] 10.0572241 0.8197571 0.2457549 0.6697307
[2,]  0.7632383 1.0785288 0.6458942 1.0118658
[3,]  1.0709956 1.1167774 0.7860960 0.6535894
[4,]  1.2584028 0.4343783 0.1346405 1.2840977
> 
> my.function <- function(x,power){
+   (x+5)^power
+ }
> 
> ewApply(tmp5,my.function,power=2)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
          [,1]     [,2]     [,3]     [,4]
[1,] 226.72000 33.86957 27.51794 32.14585
[2,]  33.21492 36.94851 31.87612 36.14253
[3,]  36.85699 37.41497 33.47891 31.96307
[4,]  39.16761 29.53247 26.36453 39.48988
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x600001624480>
> exp(tmp5)
<pointer: 0x600001624480>
> log(tmp5,2)
<pointer: 0x600001624480>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 471.888
> Min(tmp5)
[1] 52.93269
> mean(tmp5)
[1] 73.50329
> Sum(tmp5)
[1] 14700.66
> Var(tmp5)
[1] 877.4734
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 88.43521 72.67335 75.52728 69.20182 69.72536 70.59007 72.59682 73.55107
 [9] 73.06312 69.66875
> rowSums(tmp5)
 [1] 1768.704 1453.467 1510.546 1384.036 1394.507 1411.801 1451.936 1471.021
 [9] 1461.262 1393.375
> rowVars(tmp5)
 [1] 8238.41695   43.60116   63.10485   74.15423   81.55860   53.06237
 [7]   95.85426   92.80420   78.75633   69.34888
> rowSd(tmp5)
 [1] 90.765726  6.603118  7.943856  8.611285  9.030980  7.284392  9.790519
 [8]  9.633494  8.874476  8.327598
> rowMax(tmp5)
 [1] 471.88797  82.80699  88.47108  85.77190  92.24189  81.64101  89.06324
 [8]  90.84129  94.49507  87.58414
> rowMin(tmp5)
 [1] 54.90614 58.47248 63.35070 54.87432 57.02413 56.83312 55.87786 56.24669
 [9] 56.33430 52.93269
> 
> colMeans(tmp5)
 [1] 114.91103  73.97899  69.22263  71.27192  73.39669  67.84105  73.68707
 [8]  75.71998  73.51435  71.00823  74.74490  73.69173  69.53766  71.12888
[15]  72.62643  68.37667  69.47641  66.59508  69.34440  69.99160
> colSums(tmp5)
 [1] 1149.1103  739.7899  692.2263  712.7192  733.9669  678.4105  736.8707
 [8]  757.1998  735.1435  710.0823  747.4490  736.9173  695.3766  711.2888
[15]  726.2643  683.7667  694.7641  665.9508  693.4440  699.9160
> colVars(tmp5)
 [1] 15752.85358    58.99130   116.82443    41.67618    32.77550   113.96907
 [7]    69.59512    61.27904    87.12523    89.05863    64.78614    73.54395
[13]    42.94654   136.79979    66.77462    87.84352   101.23438   126.14590
[19]    99.93107    38.93964
> colSd(tmp5)
 [1] 125.510372   7.680580  10.808535   6.455709   5.724989  10.675630
 [7]   8.342369   7.828093   9.334090   9.437088   8.048984   8.575777
[13]   6.553361  11.696144   8.171574   9.372487  10.061530  11.231469
[19]   9.996553   6.240163
> colMax(tmp5)
 [1] 471.88797  90.84129  92.24189  82.19302  85.77190  89.06324  82.56907
 [8]  87.02651  87.94916  87.58414  88.47108  86.59288  78.96707  94.49507
[15]  85.21942  86.69626  84.42422  92.85615  85.09205  76.95736
> colMin(tmp5)
 [1] 69.13249 61.46796 54.87432 62.59414 67.19973 54.90614 55.87786 58.99700
 [9] 58.80155 58.47248 63.26806 56.62032 60.27974 55.51844 61.65051 55.16647
[17] 56.83312 52.93269 56.93576 59.94335
> 
> 
> ### 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] 88.43521 72.67335 75.52728 69.20182 69.72536 70.59007 72.59682 73.55107
 [9]       NA 69.66875
> rowSums(tmp5)
 [1] 1768.704 1453.467 1510.546 1384.036 1394.507 1411.801 1451.936 1471.021
 [9]       NA 1393.375
> rowVars(tmp5)
 [1] 8238.41695   43.60116   63.10485   74.15423   81.55860   53.06237
 [7]   95.85426   92.80420   83.11033   69.34888
> rowSd(tmp5)
 [1] 90.765726  6.603118  7.943856  8.611285  9.030980  7.284392  9.790519
 [8]  9.633494  9.116486  8.327598
> rowMax(tmp5)
 [1] 471.88797  82.80699  88.47108  85.77190  92.24189  81.64101  89.06324
 [8]  90.84129        NA  87.58414
> rowMin(tmp5)
 [1] 54.90614 58.47248 63.35070 54.87432 57.02413 56.83312 55.87786 56.24669
 [9]       NA 52.93269
> 
> colMeans(tmp5)
 [1] 114.91103  73.97899  69.22263  71.27192  73.39669  67.84105  73.68707
 [8]  75.71998  73.51435        NA  74.74490  73.69173  69.53766  71.12888
[15]  72.62643  68.37667  69.47641  66.59508  69.34440  69.99160
> colSums(tmp5)
 [1] 1149.1103  739.7899  692.2263  712.7192  733.9669  678.4105  736.8707
 [8]  757.1998  735.1435        NA  747.4490  736.9173  695.3766  711.2888
[15]  726.2643  683.7667  694.7641  665.9508  693.4440  699.9160
> colVars(tmp5)
 [1] 15752.85358    58.99130   116.82443    41.67618    32.77550   113.96907
 [7]    69.59512    61.27904    87.12523          NA    64.78614    73.54395
[13]    42.94654   136.79979    66.77462    87.84352   101.23438   126.14590
[19]    99.93107    38.93964
> colSd(tmp5)
 [1] 125.510372   7.680580  10.808535   6.455709   5.724989  10.675630
 [7]   8.342369   7.828093   9.334090         NA   8.048984   8.575777
[13]   6.553361  11.696144   8.171574   9.372487  10.061530  11.231469
[19]   9.996553   6.240163
> colMax(tmp5)
 [1] 471.88797  90.84129  92.24189  82.19302  85.77190  89.06324  82.56907
 [8]  87.02651  87.94916        NA  88.47108  86.59288  78.96707  94.49507
[15]  85.21942  86.69626  84.42422  92.85615  85.09205  76.95736
> colMin(tmp5)
 [1] 69.13249 61.46796 54.87432 62.59414 67.19973 54.90614 55.87786 58.99700
 [9] 58.80155       NA 63.26806 56.62032 60.27974 55.51844 61.65051 55.16647
[17] 56.83312 52.93269 56.93576 59.94335
> 
> Max(tmp5,na.rm=TRUE)
[1] 471.888
> Min(tmp5,na.rm=TRUE)
[1] 52.93269
> mean(tmp5,na.rm=TRUE)
[1] 73.50246
> Sum(tmp5,na.rm=TRUE)
[1] 14626.99
> Var(tmp5,na.rm=TRUE)
[1] 881.9049
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 88.43521 72.67335 75.52728 69.20182 69.72536 70.59007 72.59682 73.55107
 [9] 73.03132 69.66875
> rowSums(tmp5,na.rm=TRUE)
 [1] 1768.704 1453.467 1510.546 1384.036 1394.507 1411.801 1451.936 1471.021
 [9] 1387.595 1393.375
> rowVars(tmp5,na.rm=TRUE)
 [1] 8238.41695   43.60116   63.10485   74.15423   81.55860   53.06237
 [7]   95.85426   92.80420   83.11033   69.34888
> rowSd(tmp5,na.rm=TRUE)
 [1] 90.765726  6.603118  7.943856  8.611285  9.030980  7.284392  9.790519
 [8]  9.633494  9.116486  8.327598
> rowMax(tmp5,na.rm=TRUE)
 [1] 471.88797  82.80699  88.47108  85.77190  92.24189  81.64101  89.06324
 [8]  90.84129  94.49507  87.58414
> rowMin(tmp5,na.rm=TRUE)
 [1] 54.90614 58.47248 63.35070 54.87432 57.02413 56.83312 55.87786 56.24669
 [9] 56.33430 52.93269
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 114.91103  73.97899  69.22263  71.27192  73.39669  67.84105  73.68707
 [8]  75.71998  73.51435  70.71276  74.74490  73.69173  69.53766  71.12888
[15]  72.62643  68.37667  69.47641  66.59508  69.34440  69.99160
> colSums(tmp5,na.rm=TRUE)
 [1] 1149.1103  739.7899  692.2263  712.7192  733.9669  678.4105  736.8707
 [8]  757.1998  735.1435  636.4149  747.4490  736.9173  695.3766  711.2888
[15]  726.2643  683.7667  694.7641  665.9508  693.4440  699.9160
> colVars(tmp5,na.rm=TRUE)
 [1] 15752.85358    58.99130   116.82443    41.67618    32.77550   113.96907
 [7]    69.59512    61.27904    87.12523    99.20883    64.78614    73.54395
[13]    42.94654   136.79979    66.77462    87.84352   101.23438   126.14590
[19]    99.93107    38.93964
> colSd(tmp5,na.rm=TRUE)
 [1] 125.510372   7.680580  10.808535   6.455709   5.724989  10.675630
 [7]   8.342369   7.828093   9.334090   9.960363   8.048984   8.575777
[13]   6.553361  11.696144   8.171574   9.372487  10.061530  11.231469
[19]   9.996553   6.240163
> colMax(tmp5,na.rm=TRUE)
 [1] 471.88797  90.84129  92.24189  82.19302  85.77190  89.06324  82.56907
 [8]  87.02651  87.94916  87.58414  88.47108  86.59288  78.96707  94.49507
[15]  85.21942  86.69626  84.42422  92.85615  85.09205  76.95736
> colMin(tmp5,na.rm=TRUE)
 [1] 69.13249 61.46796 54.87432 62.59414 67.19973 54.90614 55.87786 58.99700
 [9] 58.80155 58.47248 63.26806 56.62032 60.27974 55.51844 61.65051 55.16647
[17] 56.83312 52.93269 56.93576 59.94335
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1] 88.43521 72.67335 75.52728 69.20182 69.72536 70.59007 72.59682 73.55107
 [9]      NaN 69.66875
> rowSums(tmp5,na.rm=TRUE)
 [1] 1768.704 1453.467 1510.546 1384.036 1394.507 1411.801 1451.936 1471.021
 [9]    0.000 1393.375
> rowVars(tmp5,na.rm=TRUE)
 [1] 8238.41695   43.60116   63.10485   74.15423   81.55860   53.06237
 [7]   95.85426   92.80420         NA   69.34888
> rowSd(tmp5,na.rm=TRUE)
 [1] 90.765726  6.603118  7.943856  8.611285  9.030980  7.284392  9.790519
 [8]  9.633494        NA  8.327598
> rowMax(tmp5,na.rm=TRUE)
 [1] 471.88797  82.80699  88.47108  85.77190  92.24189  81.64101  89.06324
 [8]  90.84129        NA  87.58414
> rowMin(tmp5,na.rm=TRUE)
 [1] 54.90614 58.47248 63.35070 54.87432 57.02413 56.83312 55.87786 56.24669
 [9]       NA 52.93269
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1] 119.03685  73.77821  69.23375  71.53086  73.90746  67.79868  72.70018
 [8]  75.23489  75.14911       NaN  75.11364  73.07549  68.73634  68.53263
[15]  72.53593  69.71472  68.56816  66.36969  68.20642  71.10807
> colSums(tmp5,na.rm=TRUE)
 [1] 1071.3316  664.0039  623.1037  643.7777  665.1671  610.1881  654.3016
 [8]  677.1140  676.3420    0.0000  676.0227  657.6794  618.6270  616.7937
[15]  652.8233  627.4324  617.1135  597.3272  613.8577  639.9727
> colVars(tmp5,na.rm=TRUE)
 [1] 17530.45921    65.91173   131.42609    46.13142    33.93745   128.19502
 [7]    67.33759    66.29173    67.95110          NA    71.35477    78.46474
[13]    41.09102    78.06938    75.02930    78.68245   104.60838   141.34261
[19]    97.85351    29.78385
> colSd(tmp5,na.rm=TRUE)
 [1] 132.402641   8.118604  11.464122   6.792011   5.825586  11.322324
 [7]   8.205948   8.141973   8.243246         NA   8.447175   8.858033
[13]   6.410228   8.835688   8.661946   8.870313  10.227824  11.888760
[19]   9.892093   5.457458
> colMax(tmp5,na.rm=TRUE)
 [1] 471.88797  90.84129  92.24189  82.19302  85.77190  89.06324  82.39047
 [8]  87.02651  87.94916      -Inf  88.47108  86.59288  78.96707  82.80699
[15]  85.21942  86.69626  84.42422  92.85615  85.09205  76.95736
> colMin(tmp5,na.rm=TRUE)
 [1] 69.13249 61.46796 54.87432 62.59414 67.19973 54.90614 55.87786 58.99700
 [9] 65.89797      Inf 63.26806 56.62032 60.27974 55.51844 61.65051 55.16647
[17] 56.83312 52.93269 56.93576 63.07850
> 
> 
> 
> 
> 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] 289.17451 167.35935 116.24169 252.75323 252.63930 114.34764  84.32995
 [8] 105.26878 148.77995 246.61761
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 289.17451 167.35935 116.24169 252.75323 252.63930 114.34764  84.32995
 [8] 105.26878 148.77995 246.61761
> 
> 
> 
> 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] -1.136868e-13  0.000000e+00 -5.684342e-14  5.684342e-14  0.000000e+00
 [6] -5.684342e-14 -1.421085e-14  5.684342e-14  1.136868e-13  0.000000e+00
[11] -7.815970e-14  3.126388e-13  2.842171e-14 -5.684342e-14 -5.684342e-14
[16] -1.421085e-13  5.684342e-14  2.842171e-14 -1.136868e-13 -5.684342e-14
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> ## making sure these things agree
> ##
> ## first when there is no NA
> 
> 
> 
> agree.checks <- function(buff.matrix,r.matrix,err.tol=1e-10){
+ 
+   if (Max(buff.matrix,na.rm=TRUE) != max(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Max")
+   }
+   
+ 
+   if (Min(buff.matrix,na.rm=TRUE) != min(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Min")
+   }
+ 
+ 
+   if (abs(Sum(buff.matrix,na.rm=TRUE)- sum(r.matrix,na.rm=TRUE)) > err.tol){
+ 
+     cat(Sum(buff.matrix,na.rm=TRUE),"\n")
+     cat(sum(r.matrix,na.rm=TRUE),"\n")
+     cat(Sum(buff.matrix,na.rm=TRUE) - sum(r.matrix,na.rm=TRUE),"\n")
+     
+     stop("No agreement in Sum")
+   }
+   
+   if (abs(mean(buff.matrix,na.rm=TRUE) - mean(r.matrix,na.rm=TRUE)) > err.tol){
+     stop("No agreement in mean")
+   }
+   
+   
+   if(abs(Var(buff.matrix,na.rm=TRUE) - var(as.vector(r.matrix),na.rm=TRUE)) > err.tol){
+     stop("No agreement in Var")
+   }
+   
+   
+ 
+   if(any(abs(rowMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,mean,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowMeans")
+   }
+   
+   
+   if(any(abs(colMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,mean,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colMeans")
+   }
+   
+   
+   if(any(abs(rowSums(buff.matrix,na.rm=TRUE)  -  apply(r.matrix,1,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in rowSums")
+   }
+   
+   
+   if(any(abs(colSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colSums")
+   }
+   
+   ### this is to get around the fact that R doesn't like to compute NA on an entire vector of NA when 
+   ### computing variance
+   my.Var <- function(x,na.rm=FALSE){
+    if (all(is.na(x))){
+      return(NA)
+    } else {
+      var(x,na.rm=na.rm)
+    }
+ 
+   }
+   
+   if(any(abs(rowVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+   
+   
+   if(any(abs(colVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+ 
+ 
+   if(any(abs(rowMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+ 
+   if(any(abs(colMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+   
+   
+   if(any(abs(rowMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+   
+ 
+   if(any(abs(colMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+ 
+   if(any(abs(colMedians(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,median,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMedian")
+   }
+ 
+   if(any(abs(colRanges(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,range,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colRanges")
+   }
+ 
+ 
+   
+ }
> 
> 
> 
> 
> 
> 
> 
> 
> 
> for (rep in 1:20){
+   copymatrix <- matrix(rnorm(200,150,15),10,20)
+   
+   tmp5[1:10,1:20] <- copymatrix
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ## now lets assign some NA values and check agreement
+ 
+   which.row <- sample(1:10,1,replace=TRUE)
+   which.col  <- sample(1:20,1,replace=TRUE)
+   
+   cat(which.row," ",which.col,"\n")
+   
+   tmp5[which.row,which.col] <- NA
+   copymatrix[which.row,which.col] <- NA
+   
+   agree.checks(tmp5,copymatrix)
+ 
+   ## make an entire row NA
+   tmp5[which.row,] <- NA
+   copymatrix[which.row,] <- NA
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ### also make an entire col NA
+   tmp5[,which.col] <- NA
+   copymatrix[,which.col] <- NA
+ 
+   agree.checks(tmp5,copymatrix)
+ 
+   ### now make 1 element non NA with NA in the rest of row and column
+ 
+   tmp5[which.row,which.col] <- rnorm(1,150,15)
+   copymatrix[which.row,which.col] <- tmp5[which.row,which.col]
+ 
+   agree.checks(tmp5,copymatrix)
+ }
5   5 
1   20 
7   12 
6   12 
1   13 
9   19 
7   18 
4   3 
1   19 
5   6 
9   12 
10   10 
2   3 
8   10 
8   17 
10   12 
7   13 
6   17 
10   13 
4   5 
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.714674
> Min(tmp)
[1] -2.302954
> mean(tmp)
[1] -0.04171153
> Sum(tmp)
[1] -4.171153
> Var(tmp)
[1] 0.8400069
> 
> rowMeans(tmp)
[1] -0.04171153
> rowSums(tmp)
[1] -4.171153
> rowVars(tmp)
[1] 0.8400069
> rowSd(tmp)
[1] 0.9165189
> rowMax(tmp)
[1] 2.714674
> rowMin(tmp)
[1] -2.302954
> 
> colMeans(tmp)
  [1] -0.683520242 -0.196984893  1.037194322 -0.083482021 -0.810207903
  [6]  0.818999906  0.209394405  0.316420556 -1.007313771 -1.477415241
 [11] -0.384650018  1.798531309  0.401849308  0.471543231 -1.250646389
 [16]  0.551215287  2.714674322  0.030041646 -0.222854408  0.367936897
 [21] -0.252006799 -0.434340675 -0.297158765 -0.911624707 -1.125177213
 [26] -1.015397283  0.937288929 -0.353567453  0.939109597  1.213105764
 [31] -0.014435610  0.662507580 -1.306110611 -0.617001308  0.854291144
 [36] -0.566013422  0.405990608 -0.585587978  0.775037219 -0.304198604
 [41] -0.002519119  0.756062155  0.313626777 -0.482154491  1.052565934
 [46]  0.426646146  0.350423163 -0.943449919 -1.269928085  0.221413397
 [51]  1.450822809  0.521681130 -2.302953635  1.124907878 -1.922207320
 [56] -0.107002197 -0.114616870  1.082189693 -0.257314022 -1.168678679
 [61] -2.230906063  0.942608796 -1.485136950 -0.228432169  0.374726931
 [66] -0.876898652 -0.105753193  1.052242906 -0.615791975 -0.846865173
 [71] -0.287909070 -0.322693071 -1.508046967  0.352287603 -1.005854396
 [76]  0.073218515 -0.267320068  0.470611101  1.148427391  0.218719559
 [81] -0.925786504  0.583276358  0.407076274 -0.883130028 -1.550517327
 [86]  1.896942581 -0.229093871  0.633106606 -0.323889296 -0.008864119
 [91]  0.590645416 -0.054890353 -0.205757739  1.568274503 -0.483014169
 [96]  0.660746275 -0.914849701  0.860272919 -0.946843946  0.968956830
> colSums(tmp)
  [1] -0.683520242 -0.196984893  1.037194322 -0.083482021 -0.810207903
  [6]  0.818999906  0.209394405  0.316420556 -1.007313771 -1.477415241
 [11] -0.384650018  1.798531309  0.401849308  0.471543231 -1.250646389
 [16]  0.551215287  2.714674322  0.030041646 -0.222854408  0.367936897
 [21] -0.252006799 -0.434340675 -0.297158765 -0.911624707 -1.125177213
 [26] -1.015397283  0.937288929 -0.353567453  0.939109597  1.213105764
 [31] -0.014435610  0.662507580 -1.306110611 -0.617001308  0.854291144
 [36] -0.566013422  0.405990608 -0.585587978  0.775037219 -0.304198604
 [41] -0.002519119  0.756062155  0.313626777 -0.482154491  1.052565934
 [46]  0.426646146  0.350423163 -0.943449919 -1.269928085  0.221413397
 [51]  1.450822809  0.521681130 -2.302953635  1.124907878 -1.922207320
 [56] -0.107002197 -0.114616870  1.082189693 -0.257314022 -1.168678679
 [61] -2.230906063  0.942608796 -1.485136950 -0.228432169  0.374726931
 [66] -0.876898652 -0.105753193  1.052242906 -0.615791975 -0.846865173
 [71] -0.287909070 -0.322693071 -1.508046967  0.352287603 -1.005854396
 [76]  0.073218515 -0.267320068  0.470611101  1.148427391  0.218719559
 [81] -0.925786504  0.583276358  0.407076274 -0.883130028 -1.550517327
 [86]  1.896942581 -0.229093871  0.633106606 -0.323889296 -0.008864119
 [91]  0.590645416 -0.054890353 -0.205757739  1.568274503 -0.483014169
 [96]  0.660746275 -0.914849701  0.860272919 -0.946843946  0.968956830
> 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.683520242 -0.196984893  1.037194322 -0.083482021 -0.810207903
  [6]  0.818999906  0.209394405  0.316420556 -1.007313771 -1.477415241
 [11] -0.384650018  1.798531309  0.401849308  0.471543231 -1.250646389
 [16]  0.551215287  2.714674322  0.030041646 -0.222854408  0.367936897
 [21] -0.252006799 -0.434340675 -0.297158765 -0.911624707 -1.125177213
 [26] -1.015397283  0.937288929 -0.353567453  0.939109597  1.213105764
 [31] -0.014435610  0.662507580 -1.306110611 -0.617001308  0.854291144
 [36] -0.566013422  0.405990608 -0.585587978  0.775037219 -0.304198604
 [41] -0.002519119  0.756062155  0.313626777 -0.482154491  1.052565934
 [46]  0.426646146  0.350423163 -0.943449919 -1.269928085  0.221413397
 [51]  1.450822809  0.521681130 -2.302953635  1.124907878 -1.922207320
 [56] -0.107002197 -0.114616870  1.082189693 -0.257314022 -1.168678679
 [61] -2.230906063  0.942608796 -1.485136950 -0.228432169  0.374726931
 [66] -0.876898652 -0.105753193  1.052242906 -0.615791975 -0.846865173
 [71] -0.287909070 -0.322693071 -1.508046967  0.352287603 -1.005854396
 [76]  0.073218515 -0.267320068  0.470611101  1.148427391  0.218719559
 [81] -0.925786504  0.583276358  0.407076274 -0.883130028 -1.550517327
 [86]  1.896942581 -0.229093871  0.633106606 -0.323889296 -0.008864119
 [91]  0.590645416 -0.054890353 -0.205757739  1.568274503 -0.483014169
 [96]  0.660746275 -0.914849701  0.860272919 -0.946843946  0.968956830
> colMin(tmp)
  [1] -0.683520242 -0.196984893  1.037194322 -0.083482021 -0.810207903
  [6]  0.818999906  0.209394405  0.316420556 -1.007313771 -1.477415241
 [11] -0.384650018  1.798531309  0.401849308  0.471543231 -1.250646389
 [16]  0.551215287  2.714674322  0.030041646 -0.222854408  0.367936897
 [21] -0.252006799 -0.434340675 -0.297158765 -0.911624707 -1.125177213
 [26] -1.015397283  0.937288929 -0.353567453  0.939109597  1.213105764
 [31] -0.014435610  0.662507580 -1.306110611 -0.617001308  0.854291144
 [36] -0.566013422  0.405990608 -0.585587978  0.775037219 -0.304198604
 [41] -0.002519119  0.756062155  0.313626777 -0.482154491  1.052565934
 [46]  0.426646146  0.350423163 -0.943449919 -1.269928085  0.221413397
 [51]  1.450822809  0.521681130 -2.302953635  1.124907878 -1.922207320
 [56] -0.107002197 -0.114616870  1.082189693 -0.257314022 -1.168678679
 [61] -2.230906063  0.942608796 -1.485136950 -0.228432169  0.374726931
 [66] -0.876898652 -0.105753193  1.052242906 -0.615791975 -0.846865173
 [71] -0.287909070 -0.322693071 -1.508046967  0.352287603 -1.005854396
 [76]  0.073218515 -0.267320068  0.470611101  1.148427391  0.218719559
 [81] -0.925786504  0.583276358  0.407076274 -0.883130028 -1.550517327
 [86]  1.896942581 -0.229093871  0.633106606 -0.323889296 -0.008864119
 [91]  0.590645416 -0.054890353 -0.205757739  1.568274503 -0.483014169
 [96]  0.660746275 -0.914849701  0.860272919 -0.946843946  0.968956830
> colMedians(tmp)
  [1] -0.683520242 -0.196984893  1.037194322 -0.083482021 -0.810207903
  [6]  0.818999906  0.209394405  0.316420556 -1.007313771 -1.477415241
 [11] -0.384650018  1.798531309  0.401849308  0.471543231 -1.250646389
 [16]  0.551215287  2.714674322  0.030041646 -0.222854408  0.367936897
 [21] -0.252006799 -0.434340675 -0.297158765 -0.911624707 -1.125177213
 [26] -1.015397283  0.937288929 -0.353567453  0.939109597  1.213105764
 [31] -0.014435610  0.662507580 -1.306110611 -0.617001308  0.854291144
 [36] -0.566013422  0.405990608 -0.585587978  0.775037219 -0.304198604
 [41] -0.002519119  0.756062155  0.313626777 -0.482154491  1.052565934
 [46]  0.426646146  0.350423163 -0.943449919 -1.269928085  0.221413397
 [51]  1.450822809  0.521681130 -2.302953635  1.124907878 -1.922207320
 [56] -0.107002197 -0.114616870  1.082189693 -0.257314022 -1.168678679
 [61] -2.230906063  0.942608796 -1.485136950 -0.228432169  0.374726931
 [66] -0.876898652 -0.105753193  1.052242906 -0.615791975 -0.846865173
 [71] -0.287909070 -0.322693071 -1.508046967  0.352287603 -1.005854396
 [76]  0.073218515 -0.267320068  0.470611101  1.148427391  0.218719559
 [81] -0.925786504  0.583276358  0.407076274 -0.883130028 -1.550517327
 [86]  1.896942581 -0.229093871  0.633106606 -0.323889296 -0.008864119
 [91]  0.590645416 -0.054890353 -0.205757739  1.568274503 -0.483014169
 [96]  0.660746275 -0.914849701  0.860272919 -0.946843946  0.968956830
> colRanges(tmp)
           [,1]       [,2]     [,3]        [,4]       [,5]      [,6]      [,7]
[1,] -0.6835202 -0.1969849 1.037194 -0.08348202 -0.8102079 0.8189999 0.2093944
[2,] -0.6835202 -0.1969849 1.037194 -0.08348202 -0.8102079 0.8189999 0.2093944
          [,8]      [,9]     [,10]    [,11]    [,12]     [,13]     [,14]
[1,] 0.3164206 -1.007314 -1.477415 -0.38465 1.798531 0.4018493 0.4715432
[2,] 0.3164206 -1.007314 -1.477415 -0.38465 1.798531 0.4018493 0.4715432
         [,15]     [,16]    [,17]      [,18]      [,19]     [,20]      [,21]
[1,] -1.250646 0.5512153 2.714674 0.03004165 -0.2228544 0.3679369 -0.2520068
[2,] -1.250646 0.5512153 2.714674 0.03004165 -0.2228544 0.3679369 -0.2520068
          [,22]      [,23]      [,24]     [,25]     [,26]     [,27]      [,28]
[1,] -0.4343407 -0.2971588 -0.9116247 -1.125177 -1.015397 0.9372889 -0.3535675
[2,] -0.4343407 -0.2971588 -0.9116247 -1.125177 -1.015397 0.9372889 -0.3535675
         [,29]    [,30]       [,31]     [,32]     [,33]      [,34]     [,35]
[1,] 0.9391096 1.213106 -0.01443561 0.6625076 -1.306111 -0.6170013 0.8542911
[2,] 0.9391096 1.213106 -0.01443561 0.6625076 -1.306111 -0.6170013 0.8542911
          [,36]     [,37]     [,38]     [,39]      [,40]        [,41]     [,42]
[1,] -0.5660134 0.4059906 -0.585588 0.7750372 -0.3041986 -0.002519119 0.7560622
[2,] -0.5660134 0.4059906 -0.585588 0.7750372 -0.3041986 -0.002519119 0.7560622
         [,43]      [,44]    [,45]     [,46]     [,47]      [,48]     [,49]
[1,] 0.3136268 -0.4821545 1.052566 0.4266461 0.3504232 -0.9434499 -1.269928
[2,] 0.3136268 -0.4821545 1.052566 0.4266461 0.3504232 -0.9434499 -1.269928
         [,50]    [,51]     [,52]     [,53]    [,54]     [,55]      [,56]
[1,] 0.2214134 1.450823 0.5216811 -2.302954 1.124908 -1.922207 -0.1070022
[2,] 0.2214134 1.450823 0.5216811 -2.302954 1.124908 -1.922207 -0.1070022
          [,57]   [,58]     [,59]     [,60]     [,61]     [,62]     [,63]
[1,] -0.1146169 1.08219 -0.257314 -1.168679 -2.230906 0.9426088 -1.485137
[2,] -0.1146169 1.08219 -0.257314 -1.168679 -2.230906 0.9426088 -1.485137
          [,64]     [,65]      [,66]      [,67]    [,68]     [,69]      [,70]
[1,] -0.2284322 0.3747269 -0.8768987 -0.1057532 1.052243 -0.615792 -0.8468652
[2,] -0.2284322 0.3747269 -0.8768987 -0.1057532 1.052243 -0.615792 -0.8468652
          [,71]      [,72]     [,73]     [,74]     [,75]      [,76]      [,77]
[1,] -0.2879091 -0.3226931 -1.508047 0.3522876 -1.005854 0.07321851 -0.2673201
[2,] -0.2879091 -0.3226931 -1.508047 0.3522876 -1.005854 0.07321851 -0.2673201
         [,78]    [,79]     [,80]      [,81]     [,82]     [,83]    [,84]
[1,] 0.4706111 1.148427 0.2187196 -0.9257865 0.5832764 0.4070763 -0.88313
[2,] 0.4706111 1.148427 0.2187196 -0.9257865 0.5832764 0.4070763 -0.88313
         [,85]    [,86]      [,87]     [,88]      [,89]        [,90]     [,91]
[1,] -1.550517 1.896943 -0.2290939 0.6331066 -0.3238893 -0.008864119 0.5906454
[2,] -1.550517 1.896943 -0.2290939 0.6331066 -0.3238893 -0.008864119 0.5906454
           [,92]      [,93]    [,94]      [,95]     [,96]      [,97]     [,98]
[1,] -0.05489035 -0.2057577 1.568275 -0.4830142 0.6607463 -0.9148497 0.8602729
[2,] -0.05489035 -0.2057577 1.568275 -0.4830142 0.6607463 -0.9148497 0.8602729
          [,99]    [,100]
[1,] -0.9468439 0.9689568
[2,] -0.9468439 0.9689568
> 
> 
> Max(tmp2)
[1] 2.58831
> Min(tmp2)
[1] -2.900436
> mean(tmp2)
[1] -0.04379215
> Sum(tmp2)
[1] -4.379215
> Var(tmp2)
[1] 1.007997
> 
> rowMeans(tmp2)
  [1] -0.89542092  1.68222089  0.36218232 -1.24270435  0.29422722 -0.96864321
  [7]  0.66702331  0.49095038 -0.89385289  0.14632467 -0.01104149 -1.45331046
 [13]  1.80099731 -0.22015507  0.36416021  1.12057849 -0.51304595 -0.99155871
 [19] -1.06338466  0.61221137 -0.91991067  0.89616594 -1.91523426  1.31530616
 [25] -2.19924316  1.48752075  0.09728947  0.33782648 -0.58748678 -0.50387679
 [31]  0.50284828  0.02087629 -2.90043589 -1.06906238  0.55783101 -0.19159179
 [37] -0.65363371  0.98455822 -2.10721534  1.63004055 -0.39580959 -0.74782108
 [43] -0.93659362 -1.46725037 -0.34229311  1.12949181 -1.53661596  1.31020712
 [49]  0.40631757 -0.42370772 -0.31590305 -0.06931714  1.16336014 -0.83141608
 [55]  0.73909072  0.18756092 -0.26107436 -0.90094929 -0.37857070 -2.11306985
 [61] -0.22533884 -0.88447184 -0.46846699 -1.19396928  0.71460396 -0.20139511
 [67] -1.08782890 -0.86761499  1.37002349  1.04004899  0.38752001  0.10842255
 [73] -0.62450805 -0.34051794  0.85250538 -0.21233705  1.04023162  1.10416427
 [79] -1.06312415  1.16572885  1.03188811  1.47596382 -0.16972266  0.24368913
 [85] -0.07563226  0.39545009  0.46036068 -0.61550267  1.08010171  0.61241220
 [91]  1.17368744 -0.35228990 -0.64766473  0.24972879 -1.38929512  0.62887461
 [97]  0.43185502 -0.58433832  0.18326605  2.58831001
> rowSums(tmp2)
  [1] -0.89542092  1.68222089  0.36218232 -1.24270435  0.29422722 -0.96864321
  [7]  0.66702331  0.49095038 -0.89385289  0.14632467 -0.01104149 -1.45331046
 [13]  1.80099731 -0.22015507  0.36416021  1.12057849 -0.51304595 -0.99155871
 [19] -1.06338466  0.61221137 -0.91991067  0.89616594 -1.91523426  1.31530616
 [25] -2.19924316  1.48752075  0.09728947  0.33782648 -0.58748678 -0.50387679
 [31]  0.50284828  0.02087629 -2.90043589 -1.06906238  0.55783101 -0.19159179
 [37] -0.65363371  0.98455822 -2.10721534  1.63004055 -0.39580959 -0.74782108
 [43] -0.93659362 -1.46725037 -0.34229311  1.12949181 -1.53661596  1.31020712
 [49]  0.40631757 -0.42370772 -0.31590305 -0.06931714  1.16336014 -0.83141608
 [55]  0.73909072  0.18756092 -0.26107436 -0.90094929 -0.37857070 -2.11306985
 [61] -0.22533884 -0.88447184 -0.46846699 -1.19396928  0.71460396 -0.20139511
 [67] -1.08782890 -0.86761499  1.37002349  1.04004899  0.38752001  0.10842255
 [73] -0.62450805 -0.34051794  0.85250538 -0.21233705  1.04023162  1.10416427
 [79] -1.06312415  1.16572885  1.03188811  1.47596382 -0.16972266  0.24368913
 [85] -0.07563226  0.39545009  0.46036068 -0.61550267  1.08010171  0.61241220
 [91]  1.17368744 -0.35228990 -0.64766473  0.24972879 -1.38929512  0.62887461
 [97]  0.43185502 -0.58433832  0.18326605  2.58831001
> rowVars(tmp2)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowSd(tmp2)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowMax(tmp2)
  [1] -0.89542092  1.68222089  0.36218232 -1.24270435  0.29422722 -0.96864321
  [7]  0.66702331  0.49095038 -0.89385289  0.14632467 -0.01104149 -1.45331046
 [13]  1.80099731 -0.22015507  0.36416021  1.12057849 -0.51304595 -0.99155871
 [19] -1.06338466  0.61221137 -0.91991067  0.89616594 -1.91523426  1.31530616
 [25] -2.19924316  1.48752075  0.09728947  0.33782648 -0.58748678 -0.50387679
 [31]  0.50284828  0.02087629 -2.90043589 -1.06906238  0.55783101 -0.19159179
 [37] -0.65363371  0.98455822 -2.10721534  1.63004055 -0.39580959 -0.74782108
 [43] -0.93659362 -1.46725037 -0.34229311  1.12949181 -1.53661596  1.31020712
 [49]  0.40631757 -0.42370772 -0.31590305 -0.06931714  1.16336014 -0.83141608
 [55]  0.73909072  0.18756092 -0.26107436 -0.90094929 -0.37857070 -2.11306985
 [61] -0.22533884 -0.88447184 -0.46846699 -1.19396928  0.71460396 -0.20139511
 [67] -1.08782890 -0.86761499  1.37002349  1.04004899  0.38752001  0.10842255
 [73] -0.62450805 -0.34051794  0.85250538 -0.21233705  1.04023162  1.10416427
 [79] -1.06312415  1.16572885  1.03188811  1.47596382 -0.16972266  0.24368913
 [85] -0.07563226  0.39545009  0.46036068 -0.61550267  1.08010171  0.61241220
 [91]  1.17368744 -0.35228990 -0.64766473  0.24972879 -1.38929512  0.62887461
 [97]  0.43185502 -0.58433832  0.18326605  2.58831001
> rowMin(tmp2)
  [1] -0.89542092  1.68222089  0.36218232 -1.24270435  0.29422722 -0.96864321
  [7]  0.66702331  0.49095038 -0.89385289  0.14632467 -0.01104149 -1.45331046
 [13]  1.80099731 -0.22015507  0.36416021  1.12057849 -0.51304595 -0.99155871
 [19] -1.06338466  0.61221137 -0.91991067  0.89616594 -1.91523426  1.31530616
 [25] -2.19924316  1.48752075  0.09728947  0.33782648 -0.58748678 -0.50387679
 [31]  0.50284828  0.02087629 -2.90043589 -1.06906238  0.55783101 -0.19159179
 [37] -0.65363371  0.98455822 -2.10721534  1.63004055 -0.39580959 -0.74782108
 [43] -0.93659362 -1.46725037 -0.34229311  1.12949181 -1.53661596  1.31020712
 [49]  0.40631757 -0.42370772 -0.31590305 -0.06931714  1.16336014 -0.83141608
 [55]  0.73909072  0.18756092 -0.26107436 -0.90094929 -0.37857070 -2.11306985
 [61] -0.22533884 -0.88447184 -0.46846699 -1.19396928  0.71460396 -0.20139511
 [67] -1.08782890 -0.86761499  1.37002349  1.04004899  0.38752001  0.10842255
 [73] -0.62450805 -0.34051794  0.85250538 -0.21233705  1.04023162  1.10416427
 [79] -1.06312415  1.16572885  1.03188811  1.47596382 -0.16972266  0.24368913
 [85] -0.07563226  0.39545009  0.46036068 -0.61550267  1.08010171  0.61241220
 [91]  1.17368744 -0.35228990 -0.64766473  0.24972879 -1.38929512  0.62887461
 [97]  0.43185502 -0.58433832  0.18326605  2.58831001
> 
> colMeans(tmp2)
[1] -0.04379215
> colSums(tmp2)
[1] -4.379215
> colVars(tmp2)
[1] 1.007997
> colSd(tmp2)
[1] 1.003991
> colMax(tmp2)
[1] 2.58831
> colMin(tmp2)
[1] -2.900436
> colMedians(tmp2)
[1] -0.0724747
> colRanges(tmp2)
          [,1]
[1,] -2.900436
[2,]  2.588310
> 
> 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] -2.72317981 -5.84314904  3.48698900  0.07642964  3.91481985  1.17363427
 [7] -1.84545243  4.26683802 -3.32916407 -0.30809588
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -1.7212911
[2,] -0.8622230
[3,] -0.3903711
[4,]  0.6779054
[5,]  1.2287594
> 
> rowApply(tmp,sum)
 [1]  0.2509511 -1.3651943  4.6034177  4.3381698 -1.2739232  3.0306378
 [7] -0.2434297 -1.9228032 -3.7514208 -4.7967356
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    3    9    8    3    5    1    4    6    8     2
 [2,]    2    7   10    7    2    2    2    3    1     4
 [3,]    9    5    6   10    7    7    6    9    2     6
 [4,]    6    1    2    9    6    6   10    4   10     3
 [5,]    7   10    7    4   10    8    5    5    3     5
 [6,]   10    6    5    2    1    4    7    8    9     7
 [7,]    4    2    4    8    9   10    1    1    7     1
 [8,]    5    4    9    5    8    5    9   10    5     9
 [9,]    8    3    1    1    4    9    3    7    4     8
[10,]    1    8    3    6    3    3    8    2    6    10
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1]  1.2098715 -0.5807554 -0.3784769  2.4398122  1.3361259 -0.4231125
 [7] -1.6578149 -0.8714102  1.5457889  0.9303380  3.1861878 -2.2514976
[13]  1.8070893  2.7883610 -1.5546278 -0.2840500 -4.5921243 -0.9426186
[19] -2.4368884  5.2696157
> colApply(tmp,quantile)[,1]
            [,1]
[1,] -0.99031968
[2,] -0.09092424
[3,]  0.26150929
[4,]  0.77289516
[5,]  1.25671094
> 
> rowApply(tmp,sum)
[1]  2.2416765 -2.6996494  6.9533686 -0.6168469 -1.3387353
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]    9   14    1   17   17
[2,]   10    3   13    5   19
[3,]   17    9    5    8    6
[4,]   20    7   16    4   11
[5,]    8    4   15   16   18
> 
> 
> as.matrix(tmp)
            [,1]        [,2]        [,3]        [,4]       [,5]       [,6]
[1,] -0.09092424 -0.01230329  0.87792690  2.82710127 -0.2690234 -1.0801280
[2,]  0.26150929 -1.13593323 -0.10530682 -0.37679637 -1.0145960  0.0867326
[3,] -0.99031968  0.73877783 -0.37875401  1.17223370  0.8642966 -0.5976117
[4,]  1.25671094 -1.19121431  0.03675594 -1.21282726  0.9788860  0.6898499
[5,]  0.77289516  1.01991757 -0.80909889  0.03010081  0.7765628  0.4780446
           [,7]        [,8]        [,9]       [,10]      [,11]       [,12]
[1,]  0.8030144 -1.33204580  0.81665295  0.57314569  1.3471895 -1.84174415
[2,]  0.2213436  1.18514805  0.79713834 -0.01446705  1.0328070  0.05974912
[3,] -0.4379283  0.05635531 -0.02988815  0.75821190  1.3513231  0.18455704
[4,]  0.2585881  0.16752329  0.15410823 -1.10625584 -0.8420232  0.19188508
[5,] -2.5028326 -0.94839109 -0.19222251  0.71970330  0.2968914 -0.84594470
          [,13]       [,14]       [,15]       [,16]      [,17]      [,18]
[1,] -1.7126516 -0.27858750  0.02706978 -0.69188895  0.2033411 -0.4396578
[2,]  0.6740552  0.66732511 -0.89984426 -0.93437801 -2.9271917 -0.1621642
[3,]  0.3776804 -0.04901643  0.50904200 -0.29312368  1.4290793 -0.5441503
[4,]  0.3875415  1.69252417 -1.72236998  1.67098359 -1.9556562  0.8235152
[5,]  2.0804638  0.75611561  0.53147469 -0.03564297 -1.3416968 -0.6201614
          [,19]      [,20]
[1,]  0.3553198  2.1598699
[2,] -1.4587801  1.3440000
[3,]  1.6013084  1.2312953
[4,] -2.2822752  1.3869032
[5,] -0.6524613 -0.8524527
> 
> 
> is.BufferedMatrix(tmp)
[1] TRUE
> 
> as.BufferedMatrix(as.matrix(tmp))
BufferedMatrix object
Matrix size:  5 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  800  bytes.
> 
> 
> 
> subBufferedMatrix(tmp,1:5,1:5)
BufferedMatrix object
Matrix size:  5 5 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  650  bytes.
Disk usage :  200  bytes.
> subBufferedMatrix(tmp,,5:8)
BufferedMatrix object
Matrix size:  5 4 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  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.20-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  480  bytes.
> 
> 
> rm(tmp)
> 
> 
> ###
> ### Testing colnames and rownames
> ###
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> 
> 
> colnames(tmp)
NULL
> rownames(tmp)
NULL
> 
> 
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> colnames(tmp)
 [1] "col1"  "col2"  "col3"  "col4"  "col5"  "col6"  "col7"  "col8"  "col9" 
[10] "col10" "col11" "col12" "col13" "col14" "col15" "col16" "col17" "col18"
[19] "col19" "col20"
> rownames(tmp)
[1] "row1" "row2" "row3" "row4" "row5"
> 
> 
> tmp["row1",]
          col1     col2     col3      col4      col5     col6      col7
row1 0.1934011 -0.20482 0.188926 0.1606529 0.2054089 1.759902 0.3875711
          col8      col9    col10     col11      col12     col13     col14
row1 -1.606671 0.2917463 1.494981 0.6706468 -0.3750023 0.9405331 0.8704078
         col15      col16      col17    col18      col19    col20
row1 0.8748678 -0.4726115 -0.7050159 1.518867 -0.8376929 -1.17184
> tmp[,"col10"]
          col10
row1  1.4949808
row2  1.1011131
row3 -1.0854886
row4  0.3961342
row5 -0.2185411
> tmp[c("row1","row5"),]
            col1      col2       col3       col4       col5      col6      col7
row1  0.19340113 -0.204820  0.1889260  0.1606529  0.2054089  1.759902 0.3875711
row5 -0.03231321  1.818002 -0.2608069 -0.6544695 -1.2375637 -1.679428 1.4659425
           col8      col9      col10     col11      col12     col13      col14
row1 -1.6066713 0.2917463  1.4949808 0.6706468 -0.3750023 0.9405331 0.87040775
row5  0.2401374 0.3315743 -0.2185411 2.1969685  0.7684198 0.3945635 0.09291032
          col15      col16      col17    col18      col19     col20
row1  0.8748678 -0.4726115 -0.7050159 1.518867 -0.8376929 -1.171840
row5 -2.6980371 -2.1373403 -0.2370911 1.028361 -0.4814494  1.469433
> tmp[,c("col6","col20")]
           col6       col20
row1  1.7599021 -1.17184041
row2  0.4612740 -0.01276909
row3  0.3573592 -1.33905784
row4  0.8805717  0.35203346
row5 -1.6794278  1.46943312
> tmp[c("row1","row5"),c("col6","col20")]
          col6     col20
row1  1.759902 -1.171840
row5 -1.679428  1.469433
> 
> 
> 
> 
> tmp["row1",] <- rnorm(20,mean=10)
> tmp[,"col10"] <- rnorm(5,mean=30)
> tmp[c("row1","row5"),] <- rnorm(40,mean=50)
> tmp[,c("col6","col20")] <- rnorm(10,mean=75)
> tmp[c("row1","row5"),c("col6","col20")]  <- rnorm(4,mean=105)
> 
> tmp["row1",]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 49.07196 50.61604 49.75559 49.26426 51.17145 105.0494 52.03082 49.57173
         col9    col10    col11    col12    col13    col14   col15    col16
row1 50.41376 50.16483 49.93733 50.39066 48.03511 49.06437 49.1699 49.46905
        col17    col18    col19    col20
row1 52.00192 50.86644 50.64568 104.8047
> tmp[,"col10"]
        col10
row1 50.16483
row2 28.15630
row3 27.70856
row4 28.34103
row5 49.47777
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 49.07196 50.61604 49.75559 49.26426 51.17145 105.0494 52.03082 49.57173
row5 50.03866 50.53460 49.93050 50.26634 50.02821 106.0700 49.18940 51.85755
         col9    col10    col11    col12    col13    col14    col15    col16
row1 50.41376 50.16483 49.93733 50.39066 48.03511 49.06437 49.16990 49.46905
row5 49.05523 49.47777 50.30932 48.12130 50.98952 51.61648 49.78398 51.27581
        col17    col18    col19    col20
row1 52.00192 50.86644 50.64568 104.8047
row5 50.35211 51.40325 47.47910 105.8152
> tmp[,c("col6","col20")]
          col6     col20
row1 105.04939 104.80470
row2  75.57812  76.14171
row3  74.88063  74.71833
row4  74.67095  75.29897
row5 106.06997 105.81521
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 105.0494 104.8047
row5 106.0700 105.8152
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 105.0494 104.8047
row5 106.0700 105.8152
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
          col13
[1,] -0.1635774
[2,] -0.6409956
[3,]  0.2498226
[4,]  0.2048202
[5,] -1.1776115
> tmp[,c("col17","col7")]
          col17       col7
[1,] -0.7430589  0.5257669
[2,]  0.3237765  0.5649578
[3,]  0.4392313 -1.6232815
[4,]  0.1790952 -0.3050759
[5,] -1.0362916  1.2985005
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
            col6      col20
[1,] -0.38566406  0.1770210
[2,]  0.06181794 -1.1189186
[3,] -2.02660814 -0.5783127
[4,]  1.04882990  2.1331505
[5,] -1.59915202 -0.0979782
> subBufferedMatrix(tmp,1,c("col6"))[,1]
           col1
[1,] -0.3856641
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
            col6
[1,] -0.38566406
[2,]  0.06181794
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> 
> 
> 
> subBufferedMatrix(tmp,c("row3","row1"),)[,1:20]
         [,1]       [,2]        [,3]      [,4]      [,5]       [,6]       [,7]
row3 1.384976 -0.9049220  1.92634298 -1.562183 -1.246256 -0.4478158  0.5485867
row1 1.559691  0.5785599 -0.05832194 -2.799075 -2.138543 -0.7663249 -0.7524659
         [,8]      [,9]      [,10]         [,11]      [,12]      [,13]
row3 0.176739 1.9563880  0.5044495 -0.0007020245 -0.9745769  0.6136514
row1 1.237478 0.2728682 -0.6359784 -0.1711813584 -0.7259023 -1.1259027
         [,14]      [,15]       [,16]      [,17]      [,18]    [,19]      [,20]
row3  1.607260 -0.9116881 -0.79027090  0.4528653 -0.6448934 1.279887 -0.3801278
row1 -1.606082 -1.6015070 -0.04750723 -2.5602686  0.1353618 0.935069 -1.9568299
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
         [,1]      [,2]       [,3]      [,4]      [,5]       [,6]     [,7]
row2 1.877598 0.1086931 -0.8360896 0.4224377 0.2318264 -0.6360844 1.122323
           [,8]      [,9]     [,10]
row2 -0.5005069 0.3079712 -1.157819
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
           [,1]      [,2]       [,3]       [,4]      [,5]       [,6]
row5 -0.6042621 -1.100167 -0.3810907 -0.2590458 -1.554514 -0.7839662
            [,7]       [,8]       [,9]     [,10]    [,11]    [,12]      [,13]
row5 -0.03918589 -0.8335793 -0.9017508 0.0550001 -1.35799 1.158277 -0.4529419
        [,14]      [,15]     [,16]     [,17]    [,18]     [,19]      [,20]
row5 1.796883 -0.9511023 -1.409213 0.1783782 -0.16733 0.1803087 -0.3892656
> 
> 
> 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: 0x60000161c060>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BMc28f60894424"
 [2] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BMc28f53d8c8ff"
 [3] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BMc28f3d74085a"
 [4] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BMc28fcd06c3b" 
 [5] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BMc28f47719c0f"
 [6] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BMc28f73bcc16d"
 [7] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BMc28f6d3f1677"
 [8] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BMc28f48dc16a9"
 [9] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BMc28f6953d69d"
[10] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BMc28f7f2f1370"
[11] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BMc28f6ba55f4b"
[12] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BMc28f36136c23"
[13] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BMc28f35208991"
[14] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BMc28f6b27a9d6"
[15] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BMc28f78ff578f"
> 
> 
> ### 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: 0x6000016245a0>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x6000016245a0>
Warning message:
In dir.create(new.directory) :
  '/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x6000016245a0>
> rowMedians(tmp)
  [1]  0.200816615  0.475608008  0.186441955  0.097321657 -0.514500498
  [6]  0.274854981 -0.114587295  0.318761281  0.295508898 -0.311403690
 [11] -0.023569620  0.261389047 -0.356933834  0.390994501  0.094520096
 [16] -0.366646322  0.054757861  0.332690607 -0.057352141  0.007629569
 [21] -0.228991749 -0.641721913 -0.032680351  0.107470501 -0.603632061
 [26]  0.326389084  0.220015281  0.262440606  0.252966969  0.246353801
 [31] -0.048120592 -0.235316260  0.391696427  0.543453786 -0.257280867
 [36]  0.385760392  0.100600878  0.764680237 -0.293055139 -0.056760142
 [41]  0.235294251  0.343369843  0.222536764 -0.068828715  0.368650472
 [46] -0.664793572 -0.198079920 -0.457270697  0.170000131 -0.051125347
 [51] -0.041192208 -0.215987441 -0.112652600 -0.049093419  0.462170071
 [56] -0.520365361  0.324086428 -0.060189293 -0.375845528  0.409774161
 [61] -0.220755340 -0.115707600  0.131726568  0.136232390 -0.265789374
 [66]  0.147197163 -0.052239795  0.730925370 -0.023541779 -0.085244571
 [71]  0.307411718 -0.166491860  0.681300477 -0.264790744  0.162956937
 [76] -0.109499650 -0.338680620  0.207279754 -0.108668301  0.422552378
 [81] -0.115101290 -0.360179936  0.353759603 -0.179036353  0.344223869
 [86] -0.394067508 -0.204890429  0.475875944 -0.474294585  0.102949051
 [91] -0.131216614  0.279391615 -0.132697151 -0.276626775  0.329298554
 [96]  0.106069398  0.234128558 -0.204073478  0.018038271  0.247383302
[101] -0.238033588 -0.288892692 -0.045064546  0.361539874  0.504433481
[106]  0.137068038 -0.429221161  0.028445290 -0.499548943 -0.259919251
[111]  0.446365418 -0.149245961 -0.067738267  0.305360383 -0.319884436
[116]  0.424867372 -0.297615150  0.577061448  0.231073303 -0.033478596
[121]  0.191107368  0.146371010  0.316915758  0.284664064  0.175883261
[126]  0.250026729  0.155636261  0.207940934  0.162057688 -0.102121252
[131]  0.129722429  0.212392113  0.176059243 -0.405911646  0.472945345
[136] -0.206754737 -0.019136464  0.192735932 -0.297702454  0.037080355
[141] -0.643470274 -0.028213841  0.462780530  0.132030153 -0.018758996
[146] -0.635083190 -0.274255274  0.480607422 -0.306398979 -0.468709965
[151]  0.512661093 -0.298788917 -0.130295272 -0.121479490 -0.705372010
[156]  0.433664097  0.331913850  0.212551553 -0.114641955 -0.070000982
[161]  0.030629830 -0.200314151  0.227886406  0.122285019 -0.277492152
[166]  0.079133441 -0.047784388  0.351748430  0.389408939  0.063124557
[171] -0.129797120 -0.030952611  0.538349204  0.539139167 -0.294661151
[176] -0.437892391 -0.494008028 -0.257152687 -0.083082374 -0.188490891
[181]  0.277023258 -0.119381388 -0.061196095 -0.239312332  0.103508068
[186] -0.165698989  0.481835335  0.418918184 -0.066880205  0.910136272
[191] -0.071424203 -0.382724908  0.088198675  0.073255644  0.611459786
[196]  0.048859402  0.038963980 -0.074212586  0.249041404 -0.337564222
[201]  0.715950840  0.406863457  0.580763254 -0.728147497  0.633873427
[206] -0.134848931 -0.177554814 -0.005440487  0.672463872 -0.256917559
[211] -0.136967088  0.112230383 -0.212603722 -0.115010431 -0.537852017
[216] -0.216448979 -0.042370217  0.147874269  0.150007541  0.067011504
[221]  0.080990216 -0.418490637 -0.179468982 -0.190526407 -0.036382832
[226]  0.274260233  0.189489888  0.179852130 -0.497220828 -0.014188502
> 
> proc.time()
   user  system elapsed 
  5.177  18.965  29.173 

BufferedMatrix.Rcheck/tests/rawCalltesting.Rout


R version 4.4.2 (2024-10-31) -- "Pile of Leaves"
Copyright (C) 2024 The R Foundation for Statistical Computing
Platform: x86_64-apple-darwin20

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

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

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

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

Attaching package: 'BufferedMatrix'

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

    colMeans, colSums, rowMeans, rowSums

> 
> prefix <- "dbmtest"
> directory <- getwd()
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_Test_C",P)
RBufferedMatrix
Checking dimensions
Rows: 5
Cols: 5
Buffer Rows: 1
Buffer Cols: 1

Assigning Values
0.000000 1.000000 2.000000 3.000000 4.000000 
1.000000 2.000000 3.000000 4.000000 5.000000 
2.000000 3.000000 4.000000 5.000000 6.000000 
3.000000 4.000000 5.000000 6.000000 7.000000 
4.000000 5.000000 6.000000 7.000000 8.000000 

<pointer: 0x600003510000>
> .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: 0x600003510000>
> .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: 0x600003510000>
> .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: 0x600003510000>
> 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: 0x60000353c0c0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x60000353c0c0>
> .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: 0x60000353c0c0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x60000353c0c0>
> .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: 0x60000353c0c0>
> 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: 0x600003564000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600003564000>
> .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: 0x600003564000>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x600003564000>
> .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: 0x600003564000>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x600003564000>
> .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: 0x600003564000>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x600003564000>
> .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: 0x600003564000>
> 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: 0x600003560000>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x600003560000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600003560000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600003560000>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFilec941172c7234" "BufferedMatrixFilec94166fdbfce"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFilec941172c7234" "BufferedMatrixFilec94166fdbfce"
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x600003560240>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600003560240>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x600003560240>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x600003560240>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x600003560240>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x600003560240>
> .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: 0x600003528060>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600003528060>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x600003528060>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x600003528060>
> 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: 0x6000035281e0>
> .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: 0x6000035281e0>
> rm(P)
> 
> proc.time()
   user  system elapsed 
  0.603   0.226   0.976 

BufferedMatrix.Rcheck/tests/Rcodetesting.Rout


R version 4.4.2 (2024-10-31) -- "Pile of Leaves"
Copyright (C) 2024 The R Foundation for Statistical Computing
Platform: x86_64-apple-darwin20

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

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

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

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

Attaching package: 'BufferedMatrix'

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

    colMeans, colSums, rowMeans, rowSums

> 
> Temp <- createBufferedMatrix(100)
> dim(Temp)
[1] 100   0
> buffer.dim(Temp)
[1] 1 1
> 
> 
> proc.time()
   user  system elapsed 
  0.601   0.143   0.763 

Example timings