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

This page was generated on 2025-02-06 12:09 -0500 (Thu, 06 Feb 2025).

HostnameOSArch (*)R versionInstalled pkgs
nebbiolo2Linux (Ubuntu 24.04.1 LTS)x86_644.4.2 (2024-10-31) -- "Pile of Leaves" 4753
palomino8Windows Server 2022 Datacenterx644.4.2 (2024-10-31 ucrt) -- "Pile of Leaves" 4501
merida1macOS 12.7.5 Montereyx86_644.4.2 (2024-10-31) -- "Pile of Leaves" 4524
kjohnson1macOS 13.6.6 Venturaarm644.4.2 (2024-10-31) -- "Pile of Leaves" 4476
taishanLinux (openEuler 24.03 LTS)aarch644.4.2 (2024-10-31) -- "Pile of Leaves" 4407
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: 2025-02-03 13:00 -0500 (Mon, 03 Feb 2025)
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
taishanLinux (openEuler 24.03 LTS) / aarch64  OK    OK    OK  


CHECK results for BufferedMatrix on kjohnson1

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: 2025-02-04 13:29:16 -0500 (Tue, 04 Feb 2025)
EndedAt: 2025-02-04 13:29:56 -0500 (Tue, 04 Feb 2025)
EllapsedTime: 39.5 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: aarch64-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 Ventura 13.7.1
* 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 15.0.0 (clang-1500.0.40.1)’
* 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-arm64/Resources/library’
* installing *source* package ‘BufferedMatrix’ ...
** using staged installation
** libs
using C compiler: ‘Apple clang version 15.0.0 (clang-1500.0.40.1)’
using SDK: ‘MacOSX11.3.sdk’
clang -arch arm64 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/opt/R/arm64/include    -fPIC  -falign-functions=64 -Wall -g -O2  -c RBufferedMatrix.c -o RBufferedMatrix.o
clang -arch arm64 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/opt/R/arm64/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 arm64 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/opt/R/arm64/include    -fPIC  -falign-functions=64 -Wall -g -O2  -c doubleBufferedMatrix_C_tests.c -o doubleBufferedMatrix_C_tests.o
clang -arch arm64 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/opt/R/arm64/include    -fPIC  -falign-functions=64 -Wall -g -O2  -c init_package.c -o init_package.o
clang -arch arm64 -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -L/Library/Frameworks/R.framework/Resources/lib -L/opt/R/arm64/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-arm64/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: aarch64-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.351   0.101   0.451 

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: aarch64-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 474168 25.4    1035467 55.3         NA   638597 34.2
Vcells 877630  6.7    8388608 64.0      65536  2072107 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 Feb  4 13:29:35 2025"
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> date()
[1] "Tue Feb  4 13:29:35 2025"
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,which.col] == test.matrix[which.row,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> 
> 
> RowMode(tmp2)
<pointer: 0x600000500000>
> 
> 
> 
> 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 Feb  4 13:29:38 2025"
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col <- sample(1:20,5,replace=TRUE)
+   if (!all(tmp2[which.row,which.col] == test.matrix[which.row,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> date()
[1] "Tue Feb  4 13:29:39 2025"
> 
> ColMode(tmp2)
<pointer: 0x600000500000>
> 
> 
> 
> ### Now testing assignments
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+ 
+   new.data <- rnorm(20)
+   tmp2[which.row,] <- new.data
+   test.matrix[which.row,] <- new.data
+   if (rep > 1){
+     if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+   
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   new.data <- rnorm(10)
+   tmp2[,which.col] <- new.data
+   test.matrix[,which.col]<- new.data
+ 
+   if (rep > 1){
+     if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.col <- which.col
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,5,replace=TRUE)
+   new.data <- matrix(rnorm(50),5,10)
+   tmp2[,which.col] <- new.data
+   test.matrix[,which.col]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.col <- which.col
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   new.data <- matrix(rnorm(50),5,10)
+   tmp2[which.row,] <- new.data
+   test.matrix[which.row,]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col  <- sample(1:20,5,replace=TRUE)
+   new.data <- matrix(rnorm(25),5,5)
+   tmp2[which.row,which.col] <- new.data
+   test.matrix[which.row,which.col]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[prev.row,prev.col] == test.matrix[prev.row,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+   prev.col <- which.col
+ }
> 
> 
> 
> 
> ###
> ###
> ### testing some more functions
> ###
> 
> 
> 
> ## duplication function
> tmp5 <- duplicate(tmp2)
> 
> # making sure really did copy everything.
> tmp5[1,1] <- tmp5[1,1] +100.00
> 
> if (tmp5[1,1] == tmp2[1,1]){
+   stop("Problem with duplication")
+ }
> 
> 
> 
> 
> ### testing elementwise applying of functions
> 
> tmp5[1:4,1:4]
            [,1]       [,2]       [,3]        [,4]
[1,] 100.8822225  0.7938180 -0.6430399 -0.88257409
[2,]   1.4279414 -0.2390616 -0.3132523 -1.63094441
[3,]   0.3726226  0.8557941  0.1112280 -0.48712606
[4,]   0.0923593  2.0286836 -0.3794188 -0.06131445
> 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 :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
            [,1]      [,2]      [,3]       [,4]
[1,] 100.8822225 0.7938180 0.6430399 0.88257409
[2,]   1.4279414 0.2390616 0.3132523 1.63094441
[3,]   0.3726226 0.8557941 0.1112280 0.48712606
[4,]   0.0923593 2.0286836 0.3794188 0.06131445
> 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 :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
           [,1]      [,2]      [,3]      [,4]
[1,] 10.0440143 0.8909646 0.8018977 0.9394541
[2,]  1.1949650 0.4889393 0.5596894 1.2770843
[3,]  0.6104282 0.9250914 0.3335087 0.6979442
[4,]  0.3039067 1.4243186 0.6159698 0.2476175
> 
> 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 :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
          [,1]     [,2]     [,3]     [,4]
[1,] 226.32237 34.70346 33.66202 35.27712
[2,]  38.37759 30.12845 30.91015 39.40179
[3,]  31.47690 35.10671 28.44631 32.46657
[4,]  28.13143 41.27187 31.53912 27.53749
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x600000534120>
> exp(tmp5)
<pointer: 0x600000534120>
> log(tmp5,2)
<pointer: 0x600000534120>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 471.0604
> Min(tmp5)
[1] 52.26642
> mean(tmp5)
[1] 72.0591
> Sum(tmp5)
[1] 14411.82
> Var(tmp5)
[1] 881.2468
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 88.48719 70.50946 74.32740 68.23620 70.59996 72.34726 65.90749 68.97640
 [9] 68.76375 72.43584
> rowSums(tmp5)
 [1] 1769.744 1410.189 1486.548 1364.724 1411.999 1446.945 1318.150 1379.528
 [9] 1375.275 1448.717
> rowVars(tmp5)
 [1] 8155.67725   87.70960  101.40779   76.26081   65.33876   46.11225
 [7]   55.51099   96.05935   90.97351   83.69025
> rowSd(tmp5)
 [1] 90.308788  9.365341 10.070144  8.732743  8.083239  6.790600  7.450570
 [8]  9.800987  9.538003  9.148238
> rowMax(tmp5)
 [1] 471.06035  85.14310  97.38927  85.90199  88.21656  81.67449  83.78991
 [8]  87.34895  86.72681  91.43770
> rowMin(tmp5)
 [1] 54.23123 52.26642 58.56424 56.39990 54.45384 59.02350 55.49640 56.02544
 [9] 53.18680 59.87872
> 
> colMeans(tmp5)
 [1] 113.27390  74.79079  68.18429  65.14230  71.70882  66.61225  73.92951
 [8]  72.34520  76.05098  67.18091  69.61389  67.29720  70.73350  69.30257
[15]  70.52572  70.78580  65.65667  69.88803  67.61319  70.54638
> colSums(tmp5)
 [1] 1132.7390  747.9079  681.8429  651.4230  717.0882  666.1225  739.2951
 [8]  723.4520  760.5098  671.8091  696.1389  672.9720  707.3350  693.0257
[15]  705.2572  707.8580  656.5667  698.8803  676.1319  705.4638
> colVars(tmp5)
 [1] 15847.76242    82.68256    53.34806    63.10950    78.30948   102.71756
 [7]    79.25648    78.49120    93.49478    64.15358   111.60004    43.07786
[13]   183.27418    68.64624    87.21848    46.01813    32.77799    52.23022
[19]    58.55568    89.92949
> colSd(tmp5)
 [1] 125.887896   9.092995   7.303976   7.944149   8.849264  10.134967
 [7]   8.902611   8.859526   9.669270   8.009593  10.564092   6.563372
[13]  13.537880   8.285302   9.339084   6.783667   5.725206   7.227048
[19]   7.652169   9.483116
> colMax(tmp5)
 [1] 471.06035  91.43770  79.35303  82.00966  84.25501  83.36128  85.14310
 [8]  88.21656  87.72531  78.03504  85.93267  79.34185  97.38927  85.92471
[15]  91.27587  83.92392  77.55372  80.26713  80.86230  83.78991
> colMin(tmp5)
 [1] 58.55188 62.70843 56.02544 57.31568 54.45384 53.18680 56.39990 63.65481
 [9] 65.92982 56.72122 52.26642 58.53471 54.18270 58.56635 56.31764 60.38004
[17] 59.67047 56.41797 55.49640 53.19046
> 
> 
> ### 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.48719 70.50946 74.32740 68.23620 70.59996 72.34726 65.90749 68.97640
 [9]       NA 72.43584
> rowSums(tmp5)
 [1] 1769.744 1410.189 1486.548 1364.724 1411.999 1446.945 1318.150 1379.528
 [9]       NA 1448.717
> rowVars(tmp5)
 [1] 8155.67725   87.70960  101.40779   76.26081   65.33876   46.11225
 [7]   55.51099   96.05935   96.02045   83.69025
> rowSd(tmp5)
 [1] 90.308788  9.365341 10.070144  8.732743  8.083239  6.790600  7.450570
 [8]  9.800987  9.799003  9.148238
> rowMax(tmp5)
 [1] 471.06035  85.14310  97.38927  85.90199  88.21656  81.67449  83.78991
 [8]  87.34895        NA  91.43770
> rowMin(tmp5)
 [1] 54.23123 52.26642 58.56424 56.39990 54.45384 59.02350 55.49640 56.02544
 [9]       NA 59.87872
> 
> colMeans(tmp5)
 [1] 113.27390  74.79079  68.18429  65.14230  71.70882  66.61225  73.92951
 [8]  72.34520  76.05098  67.18091  69.61389  67.29720  70.73350  69.30257
[15]  70.52572        NA  65.65667  69.88803  67.61319  70.54638
> colSums(tmp5)
 [1] 1132.7390  747.9079  681.8429  651.4230  717.0882  666.1225  739.2951
 [8]  723.4520  760.5098  671.8091  696.1389  672.9720  707.3350  693.0257
[15]  705.2572        NA  656.5667  698.8803  676.1319  705.4638
> colVars(tmp5)
 [1] 15847.76242    82.68256    53.34806    63.10950    78.30948   102.71756
 [7]    79.25648    78.49120    93.49478    64.15358   111.60004    43.07786
[13]   183.27418    68.64624    87.21848          NA    32.77799    52.23022
[19]    58.55568    89.92949
> colSd(tmp5)
 [1] 125.887896   9.092995   7.303976   7.944149   8.849264  10.134967
 [7]   8.902611   8.859526   9.669270   8.009593  10.564092   6.563372
[13]  13.537880   8.285302   9.339084         NA   5.725206   7.227048
[19]   7.652169   9.483116
> colMax(tmp5)
 [1] 471.06035  91.43770  79.35303  82.00966  84.25501  83.36128  85.14310
 [8]  88.21656  87.72531  78.03504  85.93267  79.34185  97.38927  85.92471
[15]  91.27587        NA  77.55372  80.26713  80.86230  83.78991
> colMin(tmp5)
 [1] 58.55188 62.70843 56.02544 57.31568 54.45384 53.18680 56.39990 63.65481
 [9] 65.92982 56.72122 52.26642 58.53471 54.18270 58.56635 56.31764       NA
[17] 59.67047 56.41797 55.49640 53.19046
> 
> Max(tmp5,na.rm=TRUE)
[1] 471.0604
> Min(tmp5,na.rm=TRUE)
[1] 52.26642
> mean(tmp5,na.rm=TRUE)
[1] 72.07741
> Sum(tmp5,na.rm=TRUE)
[1] 14343.4
> Var(tmp5,na.rm=TRUE)
[1] 885.6301
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 88.48719 70.50946 74.32740 68.23620 70.59996 72.34726 65.90749 68.97640
 [9] 68.78214 72.43584
> rowSums(tmp5,na.rm=TRUE)
 [1] 1769.744 1410.189 1486.548 1364.724 1411.999 1446.945 1318.150 1379.528
 [9] 1306.861 1448.717
> rowVars(tmp5,na.rm=TRUE)
 [1] 8155.67725   87.70960  101.40779   76.26081   65.33876   46.11225
 [7]   55.51099   96.05935   96.02045   83.69025
> rowSd(tmp5,na.rm=TRUE)
 [1] 90.308788  9.365341 10.070144  8.732743  8.083239  6.790600  7.450570
 [8]  9.800987  9.799003  9.148238
> rowMax(tmp5,na.rm=TRUE)
 [1] 471.06035  85.14310  97.38927  85.90199  88.21656  81.67449  83.78991
 [8]  87.34895  86.72681  91.43770
> rowMin(tmp5,na.rm=TRUE)
 [1] 54.23123 52.26642 58.56424 56.39990 54.45384 59.02350 55.49640 56.02544
 [9] 53.18680 59.87872
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 113.27390  74.79079  68.18429  65.14230  71.70882  66.61225  73.92951
 [8]  72.34520  76.05098  67.18091  69.61389  67.29720  70.73350  69.30257
[15]  70.52572  71.04929  65.65667  69.88803  67.61319  70.54638
> colSums(tmp5,na.rm=TRUE)
 [1] 1132.7390  747.9079  681.8429  651.4230  717.0882  666.1225  739.2951
 [8]  723.4520  760.5098  671.8091  696.1389  672.9720  707.3350  693.0257
[15]  705.2572  639.4436  656.5667  698.8803  676.1319  705.4638
> colVars(tmp5,na.rm=TRUE)
 [1] 15847.76242    82.68256    53.34806    63.10950    78.30948   102.71756
 [7]    79.25648    78.49120    93.49478    64.15358   111.60004    43.07786
[13]   183.27418    68.64624    87.21848    50.98934    32.77799    52.23022
[19]    58.55568    89.92949
> colSd(tmp5,na.rm=TRUE)
 [1] 125.887896   9.092995   7.303976   7.944149   8.849264  10.134967
 [7]   8.902611   8.859526   9.669270   8.009593  10.564092   6.563372
[13]  13.537880   8.285302   9.339084   7.140682   5.725206   7.227048
[19]   7.652169   9.483116
> colMax(tmp5,na.rm=TRUE)
 [1] 471.06035  91.43770  79.35303  82.00966  84.25501  83.36128  85.14310
 [8]  88.21656  87.72531  78.03504  85.93267  79.34185  97.38927  85.92471
[15]  91.27587  83.92392  77.55372  80.26713  80.86230  83.78991
> colMin(tmp5,na.rm=TRUE)
 [1] 58.55188 62.70843 56.02544 57.31568 54.45384 53.18680 56.39990 63.65481
 [9] 65.92982 56.72122 52.26642 58.53471 54.18270 58.56635 56.31764 60.38004
[17] 59.67047 56.41797 55.49640 53.19046
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1] 88.48719 70.50946 74.32740 68.23620 70.59996 72.34726 65.90749 68.97640
 [9]      NaN 72.43584
> rowSums(tmp5,na.rm=TRUE)
 [1] 1769.744 1410.189 1486.548 1364.724 1411.999 1446.945 1318.150 1379.528
 [9]    0.000 1448.717
> rowVars(tmp5,na.rm=TRUE)
 [1] 8155.67725   87.70960  101.40779   76.26081   65.33876   46.11225
 [7]   55.51099   96.05935         NA   83.69025
> rowSd(tmp5,na.rm=TRUE)
 [1] 90.308788  9.365341 10.070144  8.732743  8.083239  6.790600  7.450570
 [8]  9.800987        NA  9.148238
> rowMax(tmp5,na.rm=TRUE)
 [1] 471.06035  85.14310  97.38927  85.90199  88.21656  81.67449  83.78991
 [8]  87.34895        NA  91.43770
> rowMin(tmp5,na.rm=TRUE)
 [1] 54.23123 52.26642 58.56424 56.39990 54.45384 59.02350 55.49640 56.02544
 [9]       NA 59.87872
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1] 117.14502  74.82044  67.72177  65.40450  71.67425  68.10396  74.44689
 [8]  73.31080  74.86478  68.27576  67.80069  67.46369  72.22068  69.49330
[15]  70.36492       NaN  64.33477  69.45050  68.08407  72.47482
> colSums(tmp5,na.rm=TRUE)
 [1] 1054.3052  673.3839  609.4959  588.6405  645.0682  612.9357  670.0220
 [8]  659.7972  673.7830  614.4818  610.2062  607.1732  649.9862  625.4397
[15]  633.2843    0.0000  579.0130  625.0545  612.7566  652.2734
> colVars(tmp5,na.rm=TRUE)
 [1] 17660.14444    93.00800    57.60991    70.22479    88.08471    90.52355
 [7]    86.15210    77.81332    89.35198    58.68741    88.56358    48.15074
[13]   181.30154    76.81779    97.82990          NA    17.21693    56.60539
[19]    63.38077    59.33342
> colSd(tmp5,na.rm=TRUE)
 [1] 132.891476   9.644065   7.590119   8.380023   9.385346   9.514386
 [7]   9.281816   8.821186   9.452618   7.660771   9.410823   6.939074
[13]  13.464826   8.764576   9.890900         NA   4.149328   7.523656
[19]   7.961204   7.702819
> colMax(tmp5,na.rm=TRUE)
 [1] 471.06035  91.43770  79.35303  82.00966  84.25501  83.36128  85.14310
 [8]  88.21656  87.72531  78.03504  78.70180  79.34185  97.38927  85.92471
[15]  91.27587      -Inf  72.46178  80.26713  80.86230  83.78991
> colMin(tmp5,na.rm=TRUE)
 [1] 58.55188 62.70843 56.02544 57.31568 54.45384 58.31977 56.39990 64.45693
 [9] 65.92982 56.72122 52.26642 58.53471 54.18270 58.56635 56.31764      Inf
[17] 59.67047 56.41797 55.49640 63.82192
> 
> 
> 
> 
> 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] 233.3920 319.6929 338.7958 182.6340 213.8903 228.0298 215.7296 202.1057
 [9] 171.5618 263.1710
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 233.3920 319.6929 338.7958 182.6340 213.8903 228.0298 215.7296 202.1057
 [9] 171.5618 263.1710
> 
> 
> 
> 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  2.842171e-14  2.842171e-14  1.989520e-13
 [6]  0.000000e+00 -5.684342e-14 -1.136868e-13 -1.136868e-13  1.705303e-13
[11] -5.684342e-14 -5.684342e-14 -5.684342e-14 -2.842171e-14 -9.947598e-14
[16]  5.684342e-14  5.684342e-14 -2.273737e-13  8.526513e-14  8.526513e-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)
+ }
9   7 
2   20 
3   19 
10   19 
7   1 
10   9 
8   11 
1   12 
7   13 
6   3 
9   3 
2   9 
9   8 
1   19 
3   7 
4   7 
9   20 
10   9 
3   15 
4   15 
There were 50 or more warnings (use warnings() to see the first 50)
> 
> 
> ### now test 1 by n and n by 1 matrix
> 
> 
> err.tol <- 1e-12
> 
> rm(tmp5)
> 
> dataset1 <- rnorm(100)
> dataset2 <- rnorm(100)
> 
> tmp <- createBufferedMatrix(1,100)
> tmp[1,] <- dataset1
> 
> tmp2 <- createBufferedMatrix(100,1)
> tmp2[,1] <- dataset2
> 
> 
> 
> 
> 
> Max(tmp)
[1] 3.129634
> Min(tmp)
[1] -2.696195
> mean(tmp)
[1] -0.1319444
> Sum(tmp)
[1] -13.19444
> Var(tmp)
[1] 0.8588821
> 
> rowMeans(tmp)
[1] -0.1319444
> rowSums(tmp)
[1] -13.19444
> rowVars(tmp)
[1] 0.8588821
> rowSd(tmp)
[1] 0.9267589
> rowMax(tmp)
[1] 3.129634
> rowMin(tmp)
[1] -2.696195
> 
> colMeans(tmp)
  [1]  1.24248693 -1.70135778  0.05404346 -1.16138427  2.00732627 -0.23978393
  [7] -0.38787507 -0.98951005 -0.01818559 -0.70983004 -0.46026037 -1.23941117
 [13] -1.38008315 -1.59568707  0.31605598  0.22535013  0.28567924 -2.69619530
 [19] -0.68912092  0.35911623  1.93470896  0.58828788  0.21428189 -0.46854965
 [25]  0.92684657 -0.41342541 -1.16140549  0.04671772 -1.65831299 -0.82896233
 [31]  0.63942463  1.11515776  0.49715836  1.14526295  0.47968388 -1.35731025
 [37] -0.16618790 -0.68826402 -1.25965613 -0.40073457  0.61927474  0.27133036
 [43]  0.25099508 -1.24391482 -1.04793602 -0.28316532  0.28265009  0.07159187
 [49]  0.01145852 -2.20360921  1.39618047  0.49177142 -0.45012721  0.17378698
 [55]  0.34558671  0.07316390 -0.61947178  0.85960876 -0.11898789 -0.28306861
 [61] -0.36395030 -0.79421175 -0.38874875 -0.99162770  0.56203418 -0.12047174
 [67] -0.01808823 -0.34391601 -0.64366957  0.57830728  0.93774825  0.85202178
 [73] -0.09806489 -0.26090251  0.31396629 -0.66131691 -0.77765587 -0.74958532
 [79] -0.06337613 -0.72452094 -0.72520011  3.12963376 -0.63195524 -0.63367837
 [85] -1.05638189 -0.80345649 -1.10005807 -0.05642173  0.41402300  1.57279158
 [91]  0.90961123  0.75672504  0.19757659 -0.05212482 -1.09079860  1.28356329
 [97]  0.61278640  0.53102401 -0.08618092 -1.61310383
> colSums(tmp)
  [1]  1.24248693 -1.70135778  0.05404346 -1.16138427  2.00732627 -0.23978393
  [7] -0.38787507 -0.98951005 -0.01818559 -0.70983004 -0.46026037 -1.23941117
 [13] -1.38008315 -1.59568707  0.31605598  0.22535013  0.28567924 -2.69619530
 [19] -0.68912092  0.35911623  1.93470896  0.58828788  0.21428189 -0.46854965
 [25]  0.92684657 -0.41342541 -1.16140549  0.04671772 -1.65831299 -0.82896233
 [31]  0.63942463  1.11515776  0.49715836  1.14526295  0.47968388 -1.35731025
 [37] -0.16618790 -0.68826402 -1.25965613 -0.40073457  0.61927474  0.27133036
 [43]  0.25099508 -1.24391482 -1.04793602 -0.28316532  0.28265009  0.07159187
 [49]  0.01145852 -2.20360921  1.39618047  0.49177142 -0.45012721  0.17378698
 [55]  0.34558671  0.07316390 -0.61947178  0.85960876 -0.11898789 -0.28306861
 [61] -0.36395030 -0.79421175 -0.38874875 -0.99162770  0.56203418 -0.12047174
 [67] -0.01808823 -0.34391601 -0.64366957  0.57830728  0.93774825  0.85202178
 [73] -0.09806489 -0.26090251  0.31396629 -0.66131691 -0.77765587 -0.74958532
 [79] -0.06337613 -0.72452094 -0.72520011  3.12963376 -0.63195524 -0.63367837
 [85] -1.05638189 -0.80345649 -1.10005807 -0.05642173  0.41402300  1.57279158
 [91]  0.90961123  0.75672504  0.19757659 -0.05212482 -1.09079860  1.28356329
 [97]  0.61278640  0.53102401 -0.08618092 -1.61310383
> colVars(tmp)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> colSd(tmp)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> colMax(tmp)
  [1]  1.24248693 -1.70135778  0.05404346 -1.16138427  2.00732627 -0.23978393
  [7] -0.38787507 -0.98951005 -0.01818559 -0.70983004 -0.46026037 -1.23941117
 [13] -1.38008315 -1.59568707  0.31605598  0.22535013  0.28567924 -2.69619530
 [19] -0.68912092  0.35911623  1.93470896  0.58828788  0.21428189 -0.46854965
 [25]  0.92684657 -0.41342541 -1.16140549  0.04671772 -1.65831299 -0.82896233
 [31]  0.63942463  1.11515776  0.49715836  1.14526295  0.47968388 -1.35731025
 [37] -0.16618790 -0.68826402 -1.25965613 -0.40073457  0.61927474  0.27133036
 [43]  0.25099508 -1.24391482 -1.04793602 -0.28316532  0.28265009  0.07159187
 [49]  0.01145852 -2.20360921  1.39618047  0.49177142 -0.45012721  0.17378698
 [55]  0.34558671  0.07316390 -0.61947178  0.85960876 -0.11898789 -0.28306861
 [61] -0.36395030 -0.79421175 -0.38874875 -0.99162770  0.56203418 -0.12047174
 [67] -0.01808823 -0.34391601 -0.64366957  0.57830728  0.93774825  0.85202178
 [73] -0.09806489 -0.26090251  0.31396629 -0.66131691 -0.77765587 -0.74958532
 [79] -0.06337613 -0.72452094 -0.72520011  3.12963376 -0.63195524 -0.63367837
 [85] -1.05638189 -0.80345649 -1.10005807 -0.05642173  0.41402300  1.57279158
 [91]  0.90961123  0.75672504  0.19757659 -0.05212482 -1.09079860  1.28356329
 [97]  0.61278640  0.53102401 -0.08618092 -1.61310383
> colMin(tmp)
  [1]  1.24248693 -1.70135778  0.05404346 -1.16138427  2.00732627 -0.23978393
  [7] -0.38787507 -0.98951005 -0.01818559 -0.70983004 -0.46026037 -1.23941117
 [13] -1.38008315 -1.59568707  0.31605598  0.22535013  0.28567924 -2.69619530
 [19] -0.68912092  0.35911623  1.93470896  0.58828788  0.21428189 -0.46854965
 [25]  0.92684657 -0.41342541 -1.16140549  0.04671772 -1.65831299 -0.82896233
 [31]  0.63942463  1.11515776  0.49715836  1.14526295  0.47968388 -1.35731025
 [37] -0.16618790 -0.68826402 -1.25965613 -0.40073457  0.61927474  0.27133036
 [43]  0.25099508 -1.24391482 -1.04793602 -0.28316532  0.28265009  0.07159187
 [49]  0.01145852 -2.20360921  1.39618047  0.49177142 -0.45012721  0.17378698
 [55]  0.34558671  0.07316390 -0.61947178  0.85960876 -0.11898789 -0.28306861
 [61] -0.36395030 -0.79421175 -0.38874875 -0.99162770  0.56203418 -0.12047174
 [67] -0.01808823 -0.34391601 -0.64366957  0.57830728  0.93774825  0.85202178
 [73] -0.09806489 -0.26090251  0.31396629 -0.66131691 -0.77765587 -0.74958532
 [79] -0.06337613 -0.72452094 -0.72520011  3.12963376 -0.63195524 -0.63367837
 [85] -1.05638189 -0.80345649 -1.10005807 -0.05642173  0.41402300  1.57279158
 [91]  0.90961123  0.75672504  0.19757659 -0.05212482 -1.09079860  1.28356329
 [97]  0.61278640  0.53102401 -0.08618092 -1.61310383
> colMedians(tmp)
  [1]  1.24248693 -1.70135778  0.05404346 -1.16138427  2.00732627 -0.23978393
  [7] -0.38787507 -0.98951005 -0.01818559 -0.70983004 -0.46026037 -1.23941117
 [13] -1.38008315 -1.59568707  0.31605598  0.22535013  0.28567924 -2.69619530
 [19] -0.68912092  0.35911623  1.93470896  0.58828788  0.21428189 -0.46854965
 [25]  0.92684657 -0.41342541 -1.16140549  0.04671772 -1.65831299 -0.82896233
 [31]  0.63942463  1.11515776  0.49715836  1.14526295  0.47968388 -1.35731025
 [37] -0.16618790 -0.68826402 -1.25965613 -0.40073457  0.61927474  0.27133036
 [43]  0.25099508 -1.24391482 -1.04793602 -0.28316532  0.28265009  0.07159187
 [49]  0.01145852 -2.20360921  1.39618047  0.49177142 -0.45012721  0.17378698
 [55]  0.34558671  0.07316390 -0.61947178  0.85960876 -0.11898789 -0.28306861
 [61] -0.36395030 -0.79421175 -0.38874875 -0.99162770  0.56203418 -0.12047174
 [67] -0.01808823 -0.34391601 -0.64366957  0.57830728  0.93774825  0.85202178
 [73] -0.09806489 -0.26090251  0.31396629 -0.66131691 -0.77765587 -0.74958532
 [79] -0.06337613 -0.72452094 -0.72520011  3.12963376 -0.63195524 -0.63367837
 [85] -1.05638189 -0.80345649 -1.10005807 -0.05642173  0.41402300  1.57279158
 [91]  0.90961123  0.75672504  0.19757659 -0.05212482 -1.09079860  1.28356329
 [97]  0.61278640  0.53102401 -0.08618092 -1.61310383
> colRanges(tmp)
         [,1]      [,2]       [,3]      [,4]     [,5]       [,6]       [,7]
[1,] 1.242487 -1.701358 0.05404346 -1.161384 2.007326 -0.2397839 -0.3878751
[2,] 1.242487 -1.701358 0.05404346 -1.161384 2.007326 -0.2397839 -0.3878751
           [,8]        [,9]    [,10]      [,11]     [,12]     [,13]     [,14]
[1,] -0.9895101 -0.01818559 -0.70983 -0.4602604 -1.239411 -1.380083 -1.595687
[2,] -0.9895101 -0.01818559 -0.70983 -0.4602604 -1.239411 -1.380083 -1.595687
        [,15]     [,16]     [,17]     [,18]      [,19]     [,20]    [,21]
[1,] 0.316056 0.2253501 0.2856792 -2.696195 -0.6891209 0.3591162 1.934709
[2,] 0.316056 0.2253501 0.2856792 -2.696195 -0.6891209 0.3591162 1.934709
         [,22]     [,23]      [,24]     [,25]      [,26]     [,27]      [,28]
[1,] 0.5882879 0.2142819 -0.4685497 0.9268466 -0.4134254 -1.161405 0.04671772
[2,] 0.5882879 0.2142819 -0.4685497 0.9268466 -0.4134254 -1.161405 0.04671772
         [,29]      [,30]     [,31]    [,32]     [,33]    [,34]     [,35]
[1,] -1.658313 -0.8289623 0.6394246 1.115158 0.4971584 1.145263 0.4796839
[2,] -1.658313 -0.8289623 0.6394246 1.115158 0.4971584 1.145263 0.4796839
        [,36]      [,37]     [,38]     [,39]      [,40]     [,41]     [,42]
[1,] -1.35731 -0.1661879 -0.688264 -1.259656 -0.4007346 0.6192747 0.2713304
[2,] -1.35731 -0.1661879 -0.688264 -1.259656 -0.4007346 0.6192747 0.2713304
         [,43]     [,44]     [,45]      [,46]     [,47]      [,48]      [,49]
[1,] 0.2509951 -1.243915 -1.047936 -0.2831653 0.2826501 0.07159187 0.01145852
[2,] 0.2509951 -1.243915 -1.047936 -0.2831653 0.2826501 0.07159187 0.01145852
         [,50]   [,51]     [,52]      [,53]    [,54]     [,55]     [,56]
[1,] -2.203609 1.39618 0.4917714 -0.4501272 0.173787 0.3455867 0.0731639
[2,] -2.203609 1.39618 0.4917714 -0.4501272 0.173787 0.3455867 0.0731639
          [,57]     [,58]      [,59]      [,60]      [,61]      [,62]
[1,] -0.6194718 0.8596088 -0.1189879 -0.2830686 -0.3639503 -0.7942118
[2,] -0.6194718 0.8596088 -0.1189879 -0.2830686 -0.3639503 -0.7942118
          [,63]      [,64]     [,65]      [,66]       [,67]     [,68]
[1,] -0.3887488 -0.9916277 0.5620342 -0.1204717 -0.01808823 -0.343916
[2,] -0.3887488 -0.9916277 0.5620342 -0.1204717 -0.01808823 -0.343916
          [,69]     [,70]     [,71]     [,72]       [,73]      [,74]     [,75]
[1,] -0.6436696 0.5783073 0.9377483 0.8520218 -0.09806489 -0.2609025 0.3139663
[2,] -0.6436696 0.5783073 0.9377483 0.8520218 -0.09806489 -0.2609025 0.3139663
          [,76]      [,77]      [,78]       [,79]      [,80]      [,81]
[1,] -0.6613169 -0.7776559 -0.7495853 -0.06337613 -0.7245209 -0.7252001
[2,] -0.6613169 -0.7776559 -0.7495853 -0.06337613 -0.7245209 -0.7252001
        [,82]      [,83]      [,84]     [,85]      [,86]     [,87]       [,88]
[1,] 3.129634 -0.6319552 -0.6336784 -1.056382 -0.8034565 -1.100058 -0.05642173
[2,] 3.129634 -0.6319552 -0.6336784 -1.056382 -0.8034565 -1.100058 -0.05642173
        [,89]    [,90]     [,91]    [,92]     [,93]       [,94]     [,95]
[1,] 0.414023 1.572792 0.9096112 0.756725 0.1975766 -0.05212482 -1.090799
[2,] 0.414023 1.572792 0.9096112 0.756725 0.1975766 -0.05212482 -1.090799
        [,96]     [,97]    [,98]       [,99]    [,100]
[1,] 1.283563 0.6127864 0.531024 -0.08618092 -1.613104
[2,] 1.283563 0.6127864 0.531024 -0.08618092 -1.613104
> 
> 
> Max(tmp2)
[1] 2.806065
> Min(tmp2)
[1] -2.159514
> mean(tmp2)
[1] 0.02258166
> Sum(tmp2)
[1] 2.258166
> Var(tmp2)
[1] 1.154132
> 
> rowMeans(tmp2)
  [1]  1.635772521  0.078920029 -0.183683251 -2.139946297 -0.566889306
  [6]  0.236685556 -0.268436445  0.083722414  0.149884068  0.591641441
 [11]  0.398870387 -0.228883871 -1.611129142  0.653668781  2.071849257
 [16] -0.516582573  0.240636948  1.084937267 -0.132897602  1.213666373
 [21]  0.242985719 -1.217102912 -0.185548436  1.391567452 -1.255092788
 [26]  0.228477207 -0.313651840  1.697931872  1.106575669  2.806065414
 [31] -0.356033303  0.975772804 -1.525644300 -0.398086230 -0.677766597
 [36] -0.557028609  0.060244315 -1.339889730  0.471948269  0.776407173
 [41] -0.710612289  1.745506678 -0.528125119 -0.624490110  0.027820009
 [46] -0.880948216 -0.222291360 -0.899915539  0.237481411  1.590311892
 [51]  1.250646632  1.622381515 -0.954218144  0.178842585 -1.041196079
 [56] -0.577381309  0.438587827 -0.437781711 -0.130713762 -0.578488427
 [61]  1.741034684 -0.627836029  0.151304119 -0.623755136  1.156453430
 [66] -0.215647409 -0.117154946  2.610278484  0.762144495  1.806292390
 [71]  0.073859178 -0.808941996 -0.424704041 -1.349306820 -0.581949981
 [76] -0.837787671 -1.805329535 -0.157965950 -0.255628268  0.430138962
 [81] -0.499946351 -0.550257386 -0.354284160  1.014895397  0.184948356
 [86] -0.147711853 -1.064059891  0.008260457  2.063611321 -2.041489755
 [91]  0.757218021 -0.354543937  2.363713395 -2.159513696  0.753415582
 [96] -1.263328382  0.018892392 -2.096175326  1.592377292 -1.122707960
> rowSums(tmp2)
  [1]  1.635772521  0.078920029 -0.183683251 -2.139946297 -0.566889306
  [6]  0.236685556 -0.268436445  0.083722414  0.149884068  0.591641441
 [11]  0.398870387 -0.228883871 -1.611129142  0.653668781  2.071849257
 [16] -0.516582573  0.240636948  1.084937267 -0.132897602  1.213666373
 [21]  0.242985719 -1.217102912 -0.185548436  1.391567452 -1.255092788
 [26]  0.228477207 -0.313651840  1.697931872  1.106575669  2.806065414
 [31] -0.356033303  0.975772804 -1.525644300 -0.398086230 -0.677766597
 [36] -0.557028609  0.060244315 -1.339889730  0.471948269  0.776407173
 [41] -0.710612289  1.745506678 -0.528125119 -0.624490110  0.027820009
 [46] -0.880948216 -0.222291360 -0.899915539  0.237481411  1.590311892
 [51]  1.250646632  1.622381515 -0.954218144  0.178842585 -1.041196079
 [56] -0.577381309  0.438587827 -0.437781711 -0.130713762 -0.578488427
 [61]  1.741034684 -0.627836029  0.151304119 -0.623755136  1.156453430
 [66] -0.215647409 -0.117154946  2.610278484  0.762144495  1.806292390
 [71]  0.073859178 -0.808941996 -0.424704041 -1.349306820 -0.581949981
 [76] -0.837787671 -1.805329535 -0.157965950 -0.255628268  0.430138962
 [81] -0.499946351 -0.550257386 -0.354284160  1.014895397  0.184948356
 [86] -0.147711853 -1.064059891  0.008260457  2.063611321 -2.041489755
 [91]  0.757218021 -0.354543937  2.363713395 -2.159513696  0.753415582
 [96] -1.263328382  0.018892392 -2.096175326  1.592377292 -1.122707960
> rowVars(tmp2)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowSd(tmp2)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowMax(tmp2)
  [1]  1.635772521  0.078920029 -0.183683251 -2.139946297 -0.566889306
  [6]  0.236685556 -0.268436445  0.083722414  0.149884068  0.591641441
 [11]  0.398870387 -0.228883871 -1.611129142  0.653668781  2.071849257
 [16] -0.516582573  0.240636948  1.084937267 -0.132897602  1.213666373
 [21]  0.242985719 -1.217102912 -0.185548436  1.391567452 -1.255092788
 [26]  0.228477207 -0.313651840  1.697931872  1.106575669  2.806065414
 [31] -0.356033303  0.975772804 -1.525644300 -0.398086230 -0.677766597
 [36] -0.557028609  0.060244315 -1.339889730  0.471948269  0.776407173
 [41] -0.710612289  1.745506678 -0.528125119 -0.624490110  0.027820009
 [46] -0.880948216 -0.222291360 -0.899915539  0.237481411  1.590311892
 [51]  1.250646632  1.622381515 -0.954218144  0.178842585 -1.041196079
 [56] -0.577381309  0.438587827 -0.437781711 -0.130713762 -0.578488427
 [61]  1.741034684 -0.627836029  0.151304119 -0.623755136  1.156453430
 [66] -0.215647409 -0.117154946  2.610278484  0.762144495  1.806292390
 [71]  0.073859178 -0.808941996 -0.424704041 -1.349306820 -0.581949981
 [76] -0.837787671 -1.805329535 -0.157965950 -0.255628268  0.430138962
 [81] -0.499946351 -0.550257386 -0.354284160  1.014895397  0.184948356
 [86] -0.147711853 -1.064059891  0.008260457  2.063611321 -2.041489755
 [91]  0.757218021 -0.354543937  2.363713395 -2.159513696  0.753415582
 [96] -1.263328382  0.018892392 -2.096175326  1.592377292 -1.122707960
> rowMin(tmp2)
  [1]  1.635772521  0.078920029 -0.183683251 -2.139946297 -0.566889306
  [6]  0.236685556 -0.268436445  0.083722414  0.149884068  0.591641441
 [11]  0.398870387 -0.228883871 -1.611129142  0.653668781  2.071849257
 [16] -0.516582573  0.240636948  1.084937267 -0.132897602  1.213666373
 [21]  0.242985719 -1.217102912 -0.185548436  1.391567452 -1.255092788
 [26]  0.228477207 -0.313651840  1.697931872  1.106575669  2.806065414
 [31] -0.356033303  0.975772804 -1.525644300 -0.398086230 -0.677766597
 [36] -0.557028609  0.060244315 -1.339889730  0.471948269  0.776407173
 [41] -0.710612289  1.745506678 -0.528125119 -0.624490110  0.027820009
 [46] -0.880948216 -0.222291360 -0.899915539  0.237481411  1.590311892
 [51]  1.250646632  1.622381515 -0.954218144  0.178842585 -1.041196079
 [56] -0.577381309  0.438587827 -0.437781711 -0.130713762 -0.578488427
 [61]  1.741034684 -0.627836029  0.151304119 -0.623755136  1.156453430
 [66] -0.215647409 -0.117154946  2.610278484  0.762144495  1.806292390
 [71]  0.073859178 -0.808941996 -0.424704041 -1.349306820 -0.581949981
 [76] -0.837787671 -1.805329535 -0.157965950 -0.255628268  0.430138962
 [81] -0.499946351 -0.550257386 -0.354284160  1.014895397  0.184948356
 [86] -0.147711853 -1.064059891  0.008260457  2.063611321 -2.041489755
 [91]  0.757218021 -0.354543937  2.363713395 -2.159513696  0.753415582
 [96] -1.263328382  0.018892392 -2.096175326  1.592377292 -1.122707960
> 
> colMeans(tmp2)
[1] 0.02258166
> colSums(tmp2)
[1] 2.258166
> colVars(tmp2)
[1] 1.154132
> colSd(tmp2)
[1] 1.074305
> colMax(tmp2)
[1] 2.806065
> colMin(tmp2)
[1] -2.159514
> colMedians(tmp2)
[1] -0.1403047
> colRanges(tmp2)
          [,1]
[1,] -2.159514
[2,]  2.806065
> 
> dataset1 <- matrix(dataset1,1,100)
> 
> agree.checks(tmp,dataset1)
> 
> dataset2 <- matrix(dataset2,100,1)
> agree.checks(tmp2,dataset2)
>   
> 
> tmp <- createBufferedMatrix(10,10)
> 
> tmp[1:10,1:10] <- rnorm(100)
> colApply(tmp,sum)
 [1] -0.2043903 -4.3040167  3.9829578 -3.6684381 -1.9673158  3.4117034
 [7] -0.3631703  4.5611527 -5.8866749  2.7734835
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -0.8328093
[2,] -0.6437427
[3,] -0.1610295
[4,]  0.4855534
[5,]  1.1769450
> 
> rowApply(tmp,sum)
 [1] -6.2563249  2.7992629  0.3993760 -5.5027009  2.8818050  1.4187097
 [7] -0.3063403 -0.3884846  5.5393718 -2.2493834
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    6    7    8    5    3    7    9    8    1     4
 [2,]    3    8    3    2    1    6    4    6    8     1
 [3,]    9    6    4   10    6    5    8    7    6     9
 [4,]    5    2    2    9    2    8    3    5    4     5
 [5,]    1   10    5    4    5    4    5    2    7    10
 [6,]    7    3   10    7    9    2    7    3    9     8
 [7,]    2    5    1    3    8    3    6   10    2     7
 [8,]   10    4    7    8   10    9   10    4    3     2
 [9,]    4    1    6    1    4    1    1    9    5     6
[10,]    8    9    9    6    7   10    2    1   10     3
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1] -2.03525098  0.04372709  2.01331323  1.83188266 -1.16195080  1.89923793
 [7]  1.59723073 -1.98273792 -2.95409344  1.50417051 -3.35807345 -0.41532416
[13]  1.29857043 -0.55309009  2.70142897  0.52956600 -1.65304547 -5.69083938
[19] -0.15528475 -2.34754456
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -1.8275994
[2,] -0.9752180
[3,] -0.2006388
[4,]  0.1264425
[5,]  0.8417628
> 
> rowApply(tmp,sum)
[1]  0.9601873 -3.9514875  2.2535285  0.4256849 -8.5760205
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]    2   14    9    3   20
[2,]   13   12    8    6   17
[3,]   17   19    1   16   18
[4,]   12   10   14   12   19
[5,]    3   17   15    4   15
> 
> 
> as.matrix(tmp)
           [,1]        [,2]       [,3]       [,4]       [,5]       [,6]
[1,] -1.8275994  0.49278175  1.3283657  0.3797564 -1.1751885  0.5129832
[2,]  0.1264425  0.02352112  1.1521508 -0.1036959  0.2856641  0.5278744
[3,] -0.2006388 -0.20478656 -1.4862187  0.5692994  0.6203842  0.8073367
[4,] -0.9752180 -0.64244100  0.6156812  0.3448828 -0.6901522  0.6723171
[5,]  0.8417628  0.37465178  0.4033343  0.6416400 -0.2026583 -0.6212735
           [,7]        [,8]        [,9]       [,10]      [,11]      [,12]
[1,]  1.2414980 -0.21196952  0.17119833 -0.49029337 -2.1626504  1.5410076
[2,] -0.2233153  0.14756052 -2.27774713  0.05330186 -0.4532966 -0.1808260
[3,]  1.0112938 -0.06866301  0.06491306  1.76666645 -0.4316039  0.1497622
[4,] -0.2155897  0.28750019 -0.55696400  1.02466126  0.5936940 -1.4498705
[5,] -0.2166561 -2.13716610 -0.35549371 -0.85016568 -0.9042166 -0.4753973
          [,13]      [,14]       [,15]       [,16]      [,17]      [,18]
[1,]  0.1247723 -0.1329206  0.56180814  1.70857015 -0.9484722 -0.9926964
[2,]  2.2393848 -0.2107862 -0.06446717  0.19822859 -0.7268699 -0.9467408
[3,] -0.8863840 -0.3874731  2.40755173 -0.74572426 -0.3028056 -1.0273047
[4,]  0.8891488  1.3687989  0.25441322  0.05814778  0.6024442 -1.4737404
[5,] -1.0683515 -1.1907090 -0.45787696 -0.68965626 -0.2773419 -1.2503570
          [,19]       [,20]
[1,]  1.5106729 -0.67143651
[2,] -1.7902425 -1.72762841
[3,]  0.6398970 -0.04197348
[4,] -0.6557832  0.37375453
[5,]  0.1401711 -0.28026069
> 
> 
> 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 :  655  bytes.
Disk usage :  200  bytes.
> subBufferedMatrix(tmp,,5:8)
BufferedMatrix object
Matrix size:  5 4 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  567  bytes.
Disk usage :  160  bytes.
> subBufferedMatrix(tmp,1:3,)
BufferedMatrix object
Matrix size:  3 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.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 1.231612 -1.295344 -1.844766 0.372145 1.295232 -0.9720247 0.3132641
           col8      col9       col10     col11     col12      col13    col14
row1 -0.9898687 0.1444574 -0.04197361 0.5151563 0.1581402 -0.1641956 2.703805
         col15     col16     col17     col18      col19     col20
row1 0.7883676 -0.594006 -1.093403 -0.384612 -0.8394971 -1.586796
> tmp[,"col10"]
           col10
row1 -0.04197361
row2 -0.13069467
row3 -0.69242681
row4  0.41131476
row5 -0.41808680
> tmp[c("row1","row5"),]
          col1      col2      col3      col4      col5       col6      col7
row1  1.231612 -1.295344 -1.844766  0.372145 1.2952320 -0.9720247 0.3132641
row5 -1.179658  2.288505  0.515158 -1.194437 0.3569102  0.4384515 1.8356085
           col8        col9       col10       col11     col12      col13
row1 -0.9898687  0.14445740 -0.04197361  0.51515630 0.1581402 -0.1641956
row5  0.8569011 -0.03919917 -0.41808680 -0.07236608 0.7402236 -0.3234640
          col14      col15      col16      col17     col18      col19     col20
row1  2.7038052  0.7883676 -0.5940060 -1.0934032 -0.384612 -0.8394971 -1.586796
row5 -0.5423217 -1.5968664 -0.6017607 -0.1666489 -1.023798 -0.7107533  1.166936
> tmp[,c("col6","col20")]
           col6      col20
row1 -0.9720247 -1.5867960
row2 -0.1720307  1.1120237
row3  0.5375670  0.6869984
row4 -0.5963581  0.5841146
row5  0.4384515  1.1669357
> tmp[c("row1","row5"),c("col6","col20")]
           col6     col20
row1 -0.9720247 -1.586796
row5  0.4384515  1.166936
> 
> 
> 
> 
> tmp["row1",] <- rnorm(20,mean=10)
> tmp[,"col10"] <- rnorm(5,mean=30)
> tmp[c("row1","row5"),] <- rnorm(40,mean=50)
> tmp[,c("col6","col20")] <- rnorm(10,mean=75)
> tmp[c("row1","row5"),c("col6","col20")]  <- rnorm(4,mean=105)
> 
> tmp["row1",]
         col1     col2    col3     col4     col5     col6     col7    col8
row1 50.16296 47.89931 50.1426 50.00721 49.24926 103.9711 49.19547 49.3196
         col9    col10    col11    col12    col13    col14    col15    col16
row1 49.81589 49.03121 50.42688 49.28042 48.37655 48.83422 48.47929 48.76977
        col17    col18    col19    col20
row1 49.13781 49.74421 49.47279 102.9059
> tmp[,"col10"]
        col10
row1 49.03121
row2 29.00645
row3 31.31247
row4 29.06817
row5 50.26419
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 50.16296 47.89931 50.14260 50.00721 49.24926 103.9711 49.19547 49.31960
row5 47.99655 50.23426 50.62889 49.03606 50.51237 105.2398 48.04111 49.94898
         col9    col10    col11    col12    col13    col14    col15    col16
row1 49.81589 49.03121 50.42688 49.28042 48.37655 48.83422 48.47929 48.76977
row5 50.12236 50.26419 49.40617 49.48268 50.33618 48.41136 50.81887 49.04898
        col17    col18    col19    col20
row1 49.13781 49.74421 49.47279 102.9059
row5 49.35909 51.10145 49.09269 105.0277
> tmp[,c("col6","col20")]
          col6     col20
row1 103.97107 102.90595
row2  74.43736  74.07690
row3  74.60006  74.46380
row4  74.47298  75.70606
row5 105.23981 105.02771
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 103.9711 102.9059
row5 105.2398 105.0277
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 103.9711 102.9059
row5 105.2398 105.0277
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
          col13
[1,]  0.3462824
[2,]  1.0174682
[3,] -0.9175585
[4,]  0.5792836
[5,]  0.1936367
> tmp[,c("col17","col7")]
           col17        col7
[1,]  0.11636772 -0.31549550
[2,]  0.00845834  0.41713288
[3,]  0.02756258 -0.23697994
[4,]  0.56774222  0.02573986
[5,] -1.03611633 -1.25779413
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
           col6      col20
[1,] -1.1458313  1.0791773
[2,] -0.4062995  0.4529417
[3,]  0.4019392  0.8478811
[4,] -0.2257044 -1.6005508
[5,] -0.2237482 -0.6708698
> subBufferedMatrix(tmp,1,c("col6"))[,1]
          col1
[1,] -1.145831
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
           col6
[1,] -1.1458313
[2,] -0.4062995
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> 
> 
> 
> subBufferedMatrix(tmp,c("row3","row1"),)[,1:20]
           [,1]       [,2]       [,3]       [,4]      [,5]       [,6]      [,7]
row3  0.2871448  0.7231346 -0.8532068 -0.7019768  2.520811 -0.3983442 1.5521295
row1 -1.4883783 -1.6505770 -1.0323168  0.6002636 -0.703511  0.4383541 0.8821271
          [,8]      [,9]     [,10]     [,11]     [,12]      [,13]      [,14]
row3 -1.148957 1.7546047 -1.425307 -1.679665 -1.251992 0.09848337 -0.8939477
row1  1.686956 0.2041324  1.468080  1.393531 -1.489060 1.88069470  0.8729919
         [,15]      [,16]     [,17]     [,18]      [,19]      [,20]
row3 0.2874095 0.58952690 0.8728638 -1.376905  0.5231231  0.6972926
row1 1.8992632 0.06194879 0.4375372 -0.399227 -1.1115053 -1.4243220
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
          [,1]       [,2]       [,3]     [,4]       [,5]       [,6]      [,7]
row2 -2.201489 -0.5036466 0.06147985 -1.89481 -0.7734522 -0.3082266 0.5827166
          [,8]     [,9]     [,10]
row2 0.1068252 1.617883 0.9532772
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
          [,1]     [,2]       [,3]       [,4]        [,5]     [,6]     [,7]
row5 -2.856176 1.600037 -0.9641862 -0.4981928 -0.04416961 1.551642 1.547898
           [,8]   [,9]      [,10]      [,11]     [,12]     [,13]     [,14]
row5 0.05332203 1.0082 -0.4007976 -0.5814706 0.5625111 -1.644444 -0.461431
         [,15]     [,16]    [,17]     [,18]      [,19]     [,20]
row5 0.8740829 0.9126091 1.084477 0.8437721 -0.0210158 0.2446403
> 
> 
> 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: 0x60000053c1e0>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM10f80481b30"  
 [2] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM10f807df0ec74"
 [3] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM10f805433f444"
 [4] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM10f801ee9c78c"
 [5] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM10f8062bc82f" 
 [6] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM10f80246388d3"
 [7] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM10f802abe74f" 
 [8] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM10f8063def4e7"
 [9] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM10f8042a09cea"
[10] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM10f803e9de8d2"
[11] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM10f807120531b"
[12] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM10f801304ba3" 
[13] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM10f809b5baf1" 
[14] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM10f807a042931"
[15] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM10f80272c8e8c"
> 
> 
> ### 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: 0x60000053c360>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x60000053c360>
Warning message:
In dir.create(new.directory) :
  '/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x60000053c360>
> rowMedians(tmp)
  [1] -0.094578005 -0.177836917  0.024546064 -0.184449207  0.239080551
  [6] -0.231300504  0.085092103  0.509362623 -0.385609579 -0.168396281
 [11]  0.102321488 -0.382042138  0.339767162  0.128973186 -0.137887180
 [16]  0.237118188  0.215811146  0.014619368  0.120900156  0.025487769
 [21]  0.036580180 -0.033913355 -0.369706887  0.574947953 -0.523591529
 [26] -0.003971660  0.184523032  0.463928606  0.410534237 -0.018840507
 [31]  0.690603951 -0.040401740  0.087482397 -0.296563934  0.083109348
 [36]  0.015509344  0.086127965  0.479746250 -0.121418341  0.369055792
 [41]  0.081766307 -0.101390976  0.165073747  0.197800810  0.097770752
 [46] -0.111094642  0.202546192 -0.094260913  0.210873489 -0.041506140
 [51]  0.238963061  0.049500357 -0.010040090  0.155302880 -0.174584798
 [56] -0.239116698 -0.175398094 -0.154437380 -0.138389797  0.216024747
 [61] -0.810197496 -0.035839195  0.126288630  0.120989408  0.004976815
 [66]  0.044862723 -0.358383539  0.440604702 -0.320434364 -0.101657978
 [71] -0.173149410  0.388566433 -0.028452718 -0.051526738  0.547056764
 [76] -0.181304856  0.110643727 -0.004515127  0.320759693  0.038857428
 [81] -0.439681074  0.306051293 -0.363305244  0.028809746 -0.703311374
 [86] -0.241452533 -0.389982346  0.031439826  0.018573051  0.393720532
 [91]  0.232241574  0.245818037 -0.198652476 -0.200233855  0.176867723
 [96] -0.033324148 -0.100879094  0.271288585  0.129338223 -0.163480965
[101] -0.061034573  0.343726569 -0.100489417  0.341880484 -0.190227624
[106] -0.191502686  0.032190346 -0.387172255 -0.330221540  0.667510695
[111] -0.135342234 -0.881537986  0.243855430  0.017474488  0.120349057
[116]  0.331775631 -0.231787821  0.350061223  0.247066337  0.120234847
[121] -0.373684324  0.167155444  0.104594049  0.441033437  0.592098091
[126] -0.438115395 -0.045916863  0.511825256 -0.799795445  0.449023268
[131] -0.025695336 -0.294469245  0.514558303 -0.136039996 -0.031983740
[136] -0.517102954  0.105338775 -0.073543259  0.030452297 -0.252628012
[141] -0.157002200  0.206587038  0.060215891 -0.361624056 -0.595568492
[146]  0.502026939  0.248103764 -0.284426450 -0.321706999  0.491126300
[151] -0.716650058  0.227488346  0.209187401  0.645682224 -0.289173305
[156] -0.212041967  0.557136307  0.643154126  0.206721798  0.010144234
[161] -0.040405340  0.357960651 -0.217755001 -0.105200495  0.353340978
[166] -0.337278989  0.435427981 -0.462107813 -0.572777984 -0.113355778
[171]  0.347386599 -0.401269512 -0.772291411  0.373101865 -0.075976168
[176] -0.108469893 -0.039839900  0.487073279  0.407322821 -0.289607865
[181]  0.009055880  0.012327105  0.192985283  0.051507155  0.234268320
[186]  0.479856579 -0.897500054 -0.223368935  0.145856535  0.478279165
[191]  0.053017959  0.254648961 -0.671578282  0.435029209 -0.258268946
[196] -0.278353728  0.144064256  0.056607877 -0.148396598  0.127331062
[201] -0.042974751 -0.358019032  0.308457406 -0.225560441 -0.181655844
[206]  0.312480660  0.136938775 -0.385483746  0.188962627  0.176636585
[211] -0.095673982 -0.053492547  0.335213537  0.447193169  0.068382131
[216] -0.134261999  0.520492994 -0.282383144 -0.449635649  0.102969886
[221]  0.852419695 -0.410324030  0.482200718  0.006865793  0.030423233
[226] -0.060361470 -0.092035593 -0.804045987  0.169391285  0.162159850
> 
> proc.time()
   user  system elapsed 
  1.990   8.707  10.823 

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: aarch64-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: 0x600000938180>
> .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: 0x600000938180>
> .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: 0x600000938180>
> .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: 0x600000938180>
> 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: 0x600000924de0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600000924de0>
> .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: 0x600000924de0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600000924de0>
> .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: 0x600000924de0>
> 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: 0x600000934000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600000934000>
> .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: 0x600000934000>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x600000934000>
> .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: 0x600000934000>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x600000934000>
> .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: 0x600000934000>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x600000934000>
> .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: 0x600000934000>
> 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: 0x600000934180>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x600000934180>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600000934180>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600000934180>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile110c81cafbaa1" "BufferedMatrixFile110c87f9d010b"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile110c81cafbaa1" "BufferedMatrixFile110c87f9d010b"
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x600000934420>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600000934420>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x600000934420>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x600000934420>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x600000934420>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x600000934420>
> .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: 0x600000934600>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600000934600>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x600000934600>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x600000934600>
> 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: 0x6000009347e0>
> .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: 0x6000009347e0>
> rm(P)
> 
> proc.time()
   user  system elapsed 
  0.353   0.118   0.457 

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: aarch64-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.355   0.072   0.437 

Example timings