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

This page was generated on 2025-02-03 12:08 -0500 (Mon, 03 Feb 2025).

HostnameOSArch (*)R versionInstalled pkgs
nebbiolo2Linux (Ubuntu 24.04.1 LTS)x86_644.4.2 (2024-10-31) -- "Pile of Leaves" 4746
palomino8Windows Server 2022 Datacenterx644.4.2 (2024-10-31 ucrt) -- "Pile of Leaves" 4494
merida1macOS 12.7.5 Montereyx86_644.4.2 (2024-10-31) -- "Pile of Leaves" 4517
kjohnson1macOS 13.6.6 Venturaarm644.4.2 (2024-10-31) -- "Pile of Leaves" 4469
taishanLinux (openEuler 24.03 LTS)aarch644.4.2 (2024-10-31) -- "Pile of Leaves" 4400
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-01-30 13:00 -0500 (Thu, 30 Jan 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 merida1

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

raw results


Summary

Package: BufferedMatrix
Version: 1.70.0
Command: /Library/Frameworks/R.framework/Resources/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/Library/Frameworks/R.framework/Resources/library --no-vignettes --timings BufferedMatrix_1.70.0.tar.gz
StartedAt: 2025-01-31 01:05:13 -0500 (Fri, 31 Jan 2025)
EndedAt: 2025-01-31 01:06:27 -0500 (Fri, 31 Jan 2025)
EllapsedTime: 73.8 seconds
RetCode: 0
Status:   WARNINGS  
CheckDir: BufferedMatrix.Rcheck
Warnings: 1

Command output

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


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

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


Installation output

BufferedMatrix.Rcheck/00install.out

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


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

Tests output

BufferedMatrix.Rcheck/tests/c_code_level_tests.Rout


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

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

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

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

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

Attaching package: 'BufferedMatrix'

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

    colMeans, colSums, rowMeans, rowSums

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

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

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

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

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

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

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

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

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

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

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

[[1]]
[1] 0

> 
> proc.time()
   user  system elapsed 
  0.605   0.210   0.777 

BufferedMatrix.Rcheck/tests/objectTesting.Rout


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

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

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

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

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

Attaching package: 'BufferedMatrix'

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

    colMeans, colSums, rowMeans, rowSums

> 
> 
> ### this is used to control how many repetitions in something below
> ### higher values result in more checks.
> nreps <-100 ##20000
> 
> 
> ## test creation and some simple assignments and subsetting operations
> 
> ## first on single elements
> tmp <- createBufferedMatrix(1000,10)
> 
> tmp[10,5]
[1] 0
> tmp[10,5] <- 10
> tmp[10,5]
[1] 10
> tmp[10,5] <- 12.445
> tmp[10,5]
[1] 12.445
> 
> 
> 
> ## now testing accessing multiple elements
> tmp2 <- createBufferedMatrix(10,20)
> 
> 
> tmp2[3,1] <- 51.34
> tmp2[9,2] <- 9.87654
> tmp2[,1:2]
       [,1]    [,2]
 [1,]  0.00 0.00000
 [2,]  0.00 0.00000
 [3,] 51.34 0.00000
 [4,]  0.00 0.00000
 [5,]  0.00 0.00000
 [6,]  0.00 0.00000
 [7,]  0.00 0.00000
 [8,]  0.00 0.00000
 [9,]  0.00 9.87654
[10,]  0.00 0.00000
> tmp2[,-(3:20)]
       [,1]    [,2]
 [1,]  0.00 0.00000
 [2,]  0.00 0.00000
 [3,] 51.34 0.00000
 [4,]  0.00 0.00000
 [5,]  0.00 0.00000
 [6,]  0.00 0.00000
 [7,]  0.00 0.00000
 [8,]  0.00 0.00000
 [9,]  0.00 9.87654
[10,]  0.00 0.00000
> tmp2[3,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
[1,] 51.34    0    0    0    0    0    0    0    0     0     0     0     0
     [,14] [,15] [,16] [,17] [,18] [,19] [,20]
[1,]     0     0     0     0     0     0     0
> tmp2[-3,]
      [,1]    [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [2,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [3,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [4,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [5,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [6,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [7,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [8,]    0 9.87654    0    0    0    0    0    0    0     0     0     0     0
 [9,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
      [,14] [,15] [,16] [,17] [,18] [,19] [,20]
 [1,]     0     0     0     0     0     0     0
 [2,]     0     0     0     0     0     0     0
 [3,]     0     0     0     0     0     0     0
 [4,]     0     0     0     0     0     0     0
 [5,]     0     0     0     0     0     0     0
 [6,]     0     0     0     0     0     0     0
 [7,]     0     0     0     0     0     0     0
 [8,]     0     0     0     0     0     0     0
 [9,]     0     0     0     0     0     0     0
> tmp2[2,1:3]
     [,1] [,2] [,3]
[1,]    0    0    0
> tmp2[3:9,1:3]
      [,1]    [,2] [,3]
[1,] 51.34 0.00000    0
[2,]  0.00 0.00000    0
[3,]  0.00 0.00000    0
[4,]  0.00 0.00000    0
[5,]  0.00 0.00000    0
[6,]  0.00 0.00000    0
[7,]  0.00 9.87654    0
> tmp2[-4,-4]
       [,1]    [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [2,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [3,] 51.34 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [4,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [5,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [6,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [7,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [8,]  0.00 9.87654    0    0    0    0    0    0    0     0     0     0     0
 [9,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
      [,14] [,15] [,16] [,17] [,18] [,19]
 [1,]     0     0     0     0     0     0
 [2,]     0     0     0     0     0     0
 [3,]     0     0     0     0     0     0
 [4,]     0     0     0     0     0     0
 [5,]     0     0     0     0     0     0
 [6,]     0     0     0     0     0     0
 [7,]     0     0     0     0     0     0
 [8,]     0     0     0     0     0     0
 [9,]     0     0     0     0     0     0
> 
> ## now testing accessing/assigning multiple elements
> tmp3 <- createBufferedMatrix(10,10)
> 
> for (i in 1:10){
+   for (j in 1:10){
+     tmp3[i,j] <- (j-1)*10 + i
+   }
+ }
> 
> tmp3[2:4,2:4]
     [,1] [,2] [,3]
[1,]   12   22   32
[2,]   13   23   33
[3,]   14   24   34
> tmp3[c(-10),c(2:4,2:4,10,1,2,1:10,10:1)]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]   11   21   31   11   21   31   91    1   11     1    11    21    31
 [2,]   12   22   32   12   22   32   92    2   12     2    12    22    32
 [3,]   13   23   33   13   23   33   93    3   13     3    13    23    33
 [4,]   14   24   34   14   24   34   94    4   14     4    14    24    34
 [5,]   15   25   35   15   25   35   95    5   15     5    15    25    35
 [6,]   16   26   36   16   26   36   96    6   16     6    16    26    36
 [7,]   17   27   37   17   27   37   97    7   17     7    17    27    37
 [8,]   18   28   38   18   28   38   98    8   18     8    18    28    38
 [9,]   19   29   39   19   29   39   99    9   19     9    19    29    39
      [,14] [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24] [,25]
 [1,]    41    51    61    71    81    91    91    81    71    61    51    41
 [2,]    42    52    62    72    82    92    92    82    72    62    52    42
 [3,]    43    53    63    73    83    93    93    83    73    63    53    43
 [4,]    44    54    64    74    84    94    94    84    74    64    54    44
 [5,]    45    55    65    75    85    95    95    85    75    65    55    45
 [6,]    46    56    66    76    86    96    96    86    76    66    56    46
 [7,]    47    57    67    77    87    97    97    87    77    67    57    47
 [8,]    48    58    68    78    88    98    98    88    78    68    58    48
 [9,]    49    59    69    79    89    99    99    89    79    69    59    49
      [,26] [,27] [,28] [,29]
 [1,]    31    21    11     1
 [2,]    32    22    12     2
 [3,]    33    23    13     3
 [4,]    34    24    14     4
 [5,]    35    25    15     5
 [6,]    36    26    16     6
 [7,]    37    27    17     7
 [8,]    38    28    18     8
 [9,]    39    29    19     9
> tmp3[-c(1:5),-c(6:10)]
     [,1] [,2] [,3] [,4] [,5]
[1,]    6   16   26   36   46
[2,]    7   17   27   37   47
[3,]    8   18   28   38   48
[4,]    9   19   29   39   49
[5,]   10   20   30   40   50
> 
> ## assignment of whole columns
> tmp3[,1] <- c(1:10*100.0)
> tmp3[,1:2] <- tmp3[,1:2]*100
> tmp3[,1:2] <- tmp3[,2:1]
> tmp3[,1:2]
      [,1]  [,2]
 [1,] 1100 1e+04
 [2,] 1200 2e+04
 [3,] 1300 3e+04
 [4,] 1400 4e+04
 [5,] 1500 5e+04
 [6,] 1600 6e+04
 [7,] 1700 7e+04
 [8,] 1800 8e+04
 [9,] 1900 9e+04
[10,] 2000 1e+05
> 
> 
> tmp3[,-1] <- tmp3[,1:9]
> tmp3[,1:10]
      [,1] [,2]  [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,] 1100 1100 1e+04   21   31   41   51   61   71    81
 [2,] 1200 1200 2e+04   22   32   42   52   62   72    82
 [3,] 1300 1300 3e+04   23   33   43   53   63   73    83
 [4,] 1400 1400 4e+04   24   34   44   54   64   74    84
 [5,] 1500 1500 5e+04   25   35   45   55   65   75    85
 [6,] 1600 1600 6e+04   26   36   46   56   66   76    86
 [7,] 1700 1700 7e+04   27   37   47   57   67   77    87
 [8,] 1800 1800 8e+04   28   38   48   58   68   78    88
 [9,] 1900 1900 9e+04   29   39   49   59   69   79    89
[10,] 2000 2000 1e+05   30   40   50   60   70   80    90
> 
> tmp3[,1:2] <- rep(1,10)
> tmp3[,1:2] <- rep(1,20)
> tmp3[,1:2] <- matrix(c(1:5),1,5)
> 
> tmp3[,-c(1:8)] <- matrix(c(1:5),1,5)
> 
> tmp3[1,] <- 1:10
> tmp3[1,]
     [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,]    1    2    3    4    5    6    7    8    9    10
> tmp3[-1,] <- c(1,2)
> tmp3[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    1    2    3    4    5    6    7    8    9    10
 [2,]    1    2    1    2    1    2    1    2    1     2
 [3,]    2    1    2    1    2    1    2    1    2     1
 [4,]    1    2    1    2    1    2    1    2    1     2
 [5,]    2    1    2    1    2    1    2    1    2     1
 [6,]    1    2    1    2    1    2    1    2    1     2
 [7,]    2    1    2    1    2    1    2    1    2     1
 [8,]    1    2    1    2    1    2    1    2    1     2
 [9,]    2    1    2    1    2    1    2    1    2     1
[10,]    1    2    1    2    1    2    1    2    1     2
> tmp3[-c(1:8),] <- matrix(c(1:5),1,5)
> tmp3[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    1    2    3    4    5    6    7    8    9    10
 [2,]    1    2    1    2    1    2    1    2    1     2
 [3,]    2    1    2    1    2    1    2    1    2     1
 [4,]    1    2    1    2    1    2    1    2    1     2
 [5,]    2    1    2    1    2    1    2    1    2     1
 [6,]    1    2    1    2    1    2    1    2    1     2
 [7,]    2    1    2    1    2    1    2    1    2     1
 [8,]    1    2    1    2    1    2    1    2    1     2
 [9,]    1    3    5    2    4    1    3    5    2     4
[10,]    2    4    1    3    5    2    4    1    3     5
> 
> 
> tmp3[1:2,1:2] <- 5555.04
> tmp3[-(1:2),1:2] <- 1234.56789
> 
> 
> 
> ## testing accessors for the directory and prefix
> directory(tmp3)
[1] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests"
> prefix(tmp3)
[1] "BM"
> 
> ## testing if we can remove these objects
> rm(tmp, tmp2, tmp3)
> gc()
         used (Mb) gc trigger (Mb) limit (Mb) max used (Mb)
Ncells 474188 25.4    1035498 55.4         NA   638648 34.2
Vcells 877698  6.7    8388608 64.0      65536  2071806 15.9
> 
> 
> 
> 
> ##
> ## checking reads
> ##
> 
> tmp2 <- createBufferedMatrix(10,20)
> 
> test.sample <- rnorm(10*20)
> 
> tmp2[1:10,1:20] <- test.sample
> 
> test.matrix <- matrix(test.sample,10,20)
> 
> ## testing reads
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   which.col <- sample(1:20,1)
+   if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> date()
[1] "Fri Jan 31 01:05:48 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] "Fri Jan 31 01:05:49 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: 0x6000009ac060>
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   which.col <- sample(1:20,1)
+   if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,5,replace=TRUE)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> date()
[1] "Fri Jan 31 01:05:54 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] "Fri Jan 31 01:05:57 2025"
> 
> ColMode(tmp2)
<pointer: 0x6000009ac060>
> 
> 
> 
> ### Now testing assignments
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+ 
+   new.data <- rnorm(20)
+   tmp2[which.row,] <- new.data
+   test.matrix[which.row,] <- new.data
+   if (rep > 1){
+     if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+   
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   new.data <- rnorm(10)
+   tmp2[,which.col] <- new.data
+   test.matrix[,which.col]<- new.data
+ 
+   if (rep > 1){
+     if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.col <- which.col
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,5,replace=TRUE)
+   new.data <- matrix(rnorm(50),5,10)
+   tmp2[,which.col] <- new.data
+   test.matrix[,which.col]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.col <- which.col
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   new.data <- matrix(rnorm(50),5,10)
+   tmp2[which.row,] <- new.data
+   test.matrix[which.row,]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col  <- sample(1:20,5,replace=TRUE)
+   new.data <- matrix(rnorm(25),5,5)
+   tmp2[which.row,which.col] <- new.data
+   test.matrix[which.row,which.col]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[prev.row,prev.col] == test.matrix[prev.row,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+   prev.col <- which.col
+ }
> 
> 
> 
> 
> ###
> ###
> ### testing some more functions
> ###
> 
> 
> 
> ## duplication function
> tmp5 <- duplicate(tmp2)
> 
> # making sure really did copy everything.
> tmp5[1,1] <- tmp5[1,1] +100.00
> 
> if (tmp5[1,1] == tmp2[1,1]){
+   stop("Problem with duplication")
+ }
> 
> 
> 
> 
> ### testing elementwise applying of functions
> 
> tmp5[1:4,1:4]
            [,1]       [,2]       [,3]       [,4]
[1,] 99.40109382  0.7667181  0.1118341  0.2566417
[2,] -1.76121021 -2.8725052  0.7861995  0.1651743
[3,]  0.16952454 -1.8967185 -1.4878945  1.5165697
[4,]  0.01780464 -0.2917186 -1.5327044 -0.7238497
> 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,] 99.40109382 0.7667181 0.1118341 0.2566417
[2,]  1.76121021 2.8725052 0.7861995 0.1651743
[3,]  0.16952454 1.8967185 1.4878945 1.5165697
[4,]  0.01780464 0.2917186 1.5327044 0.7238497
> 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,] 9.9700097 0.8756244 0.3344160 0.5065982
[2,] 1.3271060 1.6948467 0.8866789 0.4064164
[3,] 0.4117336 1.3772141 1.2197928 1.2314909
[4,] 0.1334340 0.5401098 1.2380244 0.8507936
> 
> 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,] 224.10119 34.52296 28.45599 30.32262
[2,]  40.03227 44.82097 34.65299 29.22934
[3,]  29.28686 40.66886 38.68582 38.83148
[4,]  26.35214 30.69282 38.91295 34.23179
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x6000009e8000>
> exp(tmp5)
<pointer: 0x6000009e8000>
> log(tmp5,2)
<pointer: 0x6000009e8000>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 466.4373
> Min(tmp5)
[1] 54.5743
> mean(tmp5)
[1] 74.13189
> Sum(tmp5)
[1] 14826.38
> Var(tmp5)
[1] 846.0419
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 88.69606 74.64528 71.34859 70.31180 72.99878 72.41311 73.28473 70.70273
 [9] 71.87143 75.04637
> rowSums(tmp5)
 [1] 1773.921 1492.906 1426.972 1406.236 1459.976 1448.262 1465.695 1414.055
 [9] 1437.429 1500.927
> rowVars(tmp5)
 [1] 7953.89450   88.21195   85.91925   92.18273   72.41483   75.12752
 [7]   47.78549   71.06342   72.10262   31.54711
> rowSd(tmp5)
 [1] 89.184609  9.392122  9.269264  9.601184  8.509691  8.667613  6.912705
 [8]  8.429912  8.491326  5.616682
> rowMax(tmp5)
 [1] 466.43727  93.28898  84.64690  92.66064  85.63042  92.64295  85.84160
 [8]  89.58841  92.08510  85.35492
> rowMin(tmp5)
 [1] 59.22742 60.83704 55.15033 54.84854 54.57430 59.87022 61.98310 55.92018
 [9] 58.17361 62.87499
> 
> colMeans(tmp5)
 [1] 109.00442  73.55747  75.04845  68.19845  73.02784  75.59421  72.85807
 [8]  69.44041  72.62539  70.91033  71.20048  72.55994  72.90818  73.47740
[15]  75.93577  71.30800  72.00481  71.15259  70.38477  71.44082
> colSums(tmp5)
 [1] 1090.0442  735.5747  750.4845  681.9845  730.2784  755.9421  728.5807
 [8]  694.4041  726.2539  709.1033  712.0048  725.5994  729.0818  734.7740
[15]  759.3577  713.0800  720.0481  711.5259  703.8477  714.4082
> colVars(tmp5)
 [1] 15859.14087   108.00363    70.49170   117.69723    41.70224    71.97642
 [7]    91.64133    75.64354   100.07515    52.93195    84.18713    44.76031
[13]    75.29833    44.20477    83.68532    76.00949    58.25578    57.13861
[19]    56.04901    36.91159
> colSd(tmp5)
 [1] 125.933081  10.392480   8.395933  10.848836   6.457727   8.483892
 [7]   9.572948   8.697330  10.003757   7.275435   9.175354   6.690315
[13]   8.677461   6.648667   9.147968   8.718342   7.632547   7.559008
[19]   7.486589   6.075491
> colMax(tmp5)
 [1] 466.43727  93.28898  89.58841  92.08510  86.12371  92.66064  88.14706
 [8]  79.71756  92.64295  83.98631  81.38103  81.37866  83.00820  80.82709
[15]  85.63042  85.33800  85.89127  83.69696  83.18150  81.42478
> colMin(tmp5)
 [1] 54.84854 58.42012 59.22742 55.92018 64.91520 61.46377 60.88224 55.15033
 [9] 60.50323 57.80794 54.57430 59.87022 62.57588 60.08964 59.78632 57.92096
[17] 58.19338 57.07897 62.37267 63.85469
> 
> 
> ### 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.69606 74.64528 71.34859 70.31180 72.99878       NA 73.28473 70.70273
 [9] 71.87143 75.04637
> rowSums(tmp5)
 [1] 1773.921 1492.906 1426.972 1406.236 1459.976       NA 1465.695 1414.055
 [9] 1437.429 1500.927
> rowVars(tmp5)
 [1] 7953.89450   88.21195   85.91925   92.18273   72.41483   79.23837
 [7]   47.78549   71.06342   72.10262   31.54711
> rowSd(tmp5)
 [1] 89.184609  9.392122  9.269264  9.601184  8.509691  8.901594  6.912705
 [8]  8.429912  8.491326  5.616682
> rowMax(tmp5)
 [1] 466.43727  93.28898  84.64690  92.66064  85.63042        NA  85.84160
 [8]  89.58841  92.08510  85.35492
> rowMin(tmp5)
 [1] 59.22742 60.83704 55.15033 54.84854 54.57430       NA 61.98310 55.92018
 [9] 58.17361 62.87499
> 
> colMeans(tmp5)
 [1] 109.00442        NA  75.04845  68.19845  73.02784  75.59421  72.85807
 [8]  69.44041  72.62539  70.91033  71.20048  72.55994  72.90818  73.47740
[15]  75.93577  71.30800  72.00481  71.15259  70.38477  71.44082
> colSums(tmp5)
 [1] 1090.0442        NA  750.4845  681.9845  730.2784  755.9421  728.5807
 [8]  694.4041  726.2539  709.1033  712.0048  725.5994  729.0818  734.7740
[15]  759.3577  713.0800  720.0481  711.5259  703.8477  714.4082
> colVars(tmp5)
 [1] 15859.14087          NA    70.49170   117.69723    41.70224    71.97642
 [7]    91.64133    75.64354   100.07515    52.93195    84.18713    44.76031
[13]    75.29833    44.20477    83.68532    76.00949    58.25578    57.13861
[19]    56.04901    36.91159
> colSd(tmp5)
 [1] 125.933081         NA   8.395933  10.848836   6.457727   8.483892
 [7]   9.572948   8.697330  10.003757   7.275435   9.175354   6.690315
[13]   8.677461   6.648667   9.147968   8.718342   7.632547   7.559008
[19]   7.486589   6.075491
> colMax(tmp5)
 [1] 466.43727        NA  89.58841  92.08510  86.12371  92.66064  88.14706
 [8]  79.71756  92.64295  83.98631  81.38103  81.37866  83.00820  80.82709
[15]  85.63042  85.33800  85.89127  83.69696  83.18150  81.42478
> colMin(tmp5)
 [1] 54.84854       NA 59.22742 55.92018 64.91520 61.46377 60.88224 55.15033
 [9] 60.50323 57.80794 54.57430 59.87022 62.57588 60.08964 59.78632 57.92096
[17] 58.19338 57.07897 62.37267 63.85469
> 
> Max(tmp5,na.rm=TRUE)
[1] 466.4373
> Min(tmp5,na.rm=TRUE)
[1] 54.5743
> mean(tmp5,na.rm=TRUE)
[1] 74.14574
> Sum(tmp5,na.rm=TRUE)
[1] 14755
> Var(tmp5,na.rm=TRUE)
[1] 850.2762
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 88.69606 74.64528 71.34859 70.31180 72.99878 72.46770 73.28473 70.70273
 [9] 71.87143 75.04637
> rowSums(tmp5,na.rm=TRUE)
 [1] 1773.921 1492.906 1426.972 1406.236 1459.976 1376.886 1465.695 1414.055
 [9] 1437.429 1500.927
> rowVars(tmp5,na.rm=TRUE)
 [1] 7953.89450   88.21195   85.91925   92.18273   72.41483   79.23837
 [7]   47.78549   71.06342   72.10262   31.54711
> rowSd(tmp5,na.rm=TRUE)
 [1] 89.184609  9.392122  9.269264  9.601184  8.509691  8.901594  6.912705
 [8]  8.429912  8.491326  5.616682
> rowMax(tmp5,na.rm=TRUE)
 [1] 466.43727  93.28898  84.64690  92.66064  85.63042  92.64295  85.84160
 [8]  89.58841  92.08510  85.35492
> rowMin(tmp5,na.rm=TRUE)
 [1] 59.22742 60.83704 55.15033 54.84854 54.57430 59.87022 61.98310 55.92018
 [9] 58.17361 62.87499
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 109.00442  73.79986  75.04845  68.19845  73.02784  75.59421  72.85807
 [8]  69.44041  72.62539  70.91033  71.20048  72.55994  72.90818  73.47740
[15]  75.93577  71.30800  72.00481  71.15259  70.38477  71.44082
> colSums(tmp5,na.rm=TRUE)
 [1] 1090.0442  664.1987  750.4845  681.9845  730.2784  755.9421  728.5807
 [8]  694.4041  726.2539  709.1033  712.0048  725.5994  729.0818  734.7740
[15]  759.3577  713.0800  720.0481  711.5259  703.8477  714.4082
> colVars(tmp5,na.rm=TRUE)
 [1] 15859.14087   120.84316    70.49170   117.69723    41.70224    71.97642
 [7]    91.64133    75.64354   100.07515    52.93195    84.18713    44.76031
[13]    75.29833    44.20477    83.68532    76.00949    58.25578    57.13861
[19]    56.04901    36.91159
> colSd(tmp5,na.rm=TRUE)
 [1] 125.933081  10.992869   8.395933  10.848836   6.457727   8.483892
 [7]   9.572948   8.697330  10.003757   7.275435   9.175354   6.690315
[13]   8.677461   6.648667   9.147968   8.718342   7.632547   7.559008
[19]   7.486589   6.075491
> colMax(tmp5,na.rm=TRUE)
 [1] 466.43727  93.28898  89.58841  92.08510  86.12371  92.66064  88.14706
 [8]  79.71756  92.64295  83.98631  81.38103  81.37866  83.00820  80.82709
[15]  85.63042  85.33800  85.89127  83.69696  83.18150  81.42478
> colMin(tmp5,na.rm=TRUE)
 [1] 54.84854 58.42012 59.22742 55.92018 64.91520 61.46377 60.88224 55.15033
 [9] 60.50323 57.80794 54.57430 59.87022 62.57588 60.08964 59.78632 57.92096
[17] 58.19338 57.07897 62.37267 63.85469
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1] 88.69606 74.64528 71.34859 70.31180 72.99878      NaN 73.28473 70.70273
 [9] 71.87143 75.04637
> rowSums(tmp5,na.rm=TRUE)
 [1] 1773.921 1492.906 1426.972 1406.236 1459.976    0.000 1465.695 1414.055
 [9] 1437.429 1500.927
> rowVars(tmp5,na.rm=TRUE)
 [1] 7953.89450   88.21195   85.91925   92.18273   72.41483         NA
 [7]   47.78549   71.06342   72.10262   31.54711
> rowSd(tmp5,na.rm=TRUE)
 [1] 89.184609  9.392122  9.269264  9.601184  8.509691        NA  6.912705
 [8]  8.429912  8.491326  5.616682
> rowMax(tmp5,na.rm=TRUE)
 [1] 466.43727  93.28898  84.64690  92.66064  85.63042        NA  85.84160
 [8]  89.58841  92.08510  85.35492
> rowMin(tmp5,na.rm=TRUE)
 [1] 59.22742 60.83704 55.15033 54.84854 54.57430       NA 61.98310 55.92018
 [9] 58.17361 62.87499
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1] 113.80971       NaN  75.68920  69.01543  72.41499  76.45585  71.15929
 [8]  68.39148  70.40121  71.03971  70.06930  73.96991  72.08599  73.23230
[15]  76.95693  71.79862  72.05263  71.58123  70.24990  72.28372
> colSums(tmp5,na.rm=TRUE)
 [1] 1024.2874    0.0000  681.2028  621.1388  651.7349  688.1026  640.4337
 [8]  615.5233  633.6109  639.3574  630.6237  665.7292  648.7739  659.0907
[15]  692.6124  646.1876  648.4737  644.2310  632.2491  650.5535
> colVars(tmp5,na.rm=TRUE)
 [1] 17581.76153          NA    74.68434   124.90051    42.68969    72.62121
 [7]    70.63078    72.72121    56.93136    59.36010    80.31557    27.99019
[13]    77.10581    49.05452    82.41484    82.80272    65.51202    62.21399
[19]    62.85052    33.53257
> colSd(tmp5,na.rm=TRUE)
 [1] 132.596235         NA   8.642010  11.175890   6.533735   8.521808
 [7]   8.404212   8.527673   7.545287   7.704551   8.961896   5.290576
[13]   8.780992   7.003893   9.078262   9.099600   8.093950   7.887585
[19]   7.927832   5.790731
> colMax(tmp5,na.rm=TRUE)
 [1] 466.43727      -Inf  89.58841  92.08510  86.12371  92.66064  81.36820
 [8]  79.71756  85.84160  83.98631  79.63837  81.37866  83.00820  80.82709
[15]  85.63042  85.33800  85.89127  83.69696  83.18150  81.42478
> colMin(tmp5,na.rm=TRUE)
 [1] 54.84854      Inf 59.22742 55.92018 64.91520 61.46377 60.88224 55.15033
 [9] 60.50323 57.80794 54.57430 65.82516 62.57588 60.08964 59.78632 57.92096
[17] 58.19338 57.07897 62.37267 64.75112
> 
> 
> 
> 
> 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] 174.0976 226.9108 229.3542 231.2626 228.0810 410.4556 172.7842 136.5994
 [9] 173.6182 169.0230
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 174.0976 226.9108 229.3542 231.2626 228.0810 410.4556 172.7842 136.5994
 [9] 173.6182 169.0230
> 
> 
> 
> 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.421085e-13  5.684342e-14  2.842171e-14  2.842171e-14  5.684342e-14
 [6] -1.136868e-13  1.705303e-13 -1.136868e-13  0.000000e+00 -5.684342e-14
[11] -5.684342e-14  1.136868e-13  0.000000e+00 -1.989520e-13  2.842171e-14
[16] -1.136868e-13  1.705303e-13  2.273737e-13 -5.684342e-14 -5.684342e-14
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> ## making sure these things agree
> ##
> ## first when there is no NA
> 
> 
> 
> agree.checks <- function(buff.matrix,r.matrix,err.tol=1e-10){
+ 
+   if (Max(buff.matrix,na.rm=TRUE) != max(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Max")
+   }
+   
+ 
+   if (Min(buff.matrix,na.rm=TRUE) != min(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Min")
+   }
+ 
+ 
+   if (abs(Sum(buff.matrix,na.rm=TRUE)- sum(r.matrix,na.rm=TRUE)) > err.tol){
+ 
+     cat(Sum(buff.matrix,na.rm=TRUE),"\n")
+     cat(sum(r.matrix,na.rm=TRUE),"\n")
+     cat(Sum(buff.matrix,na.rm=TRUE) - sum(r.matrix,na.rm=TRUE),"\n")
+     
+     stop("No agreement in Sum")
+   }
+   
+   if (abs(mean(buff.matrix,na.rm=TRUE) - mean(r.matrix,na.rm=TRUE)) > err.tol){
+     stop("No agreement in mean")
+   }
+   
+   
+   if(abs(Var(buff.matrix,na.rm=TRUE) - var(as.vector(r.matrix),na.rm=TRUE)) > err.tol){
+     stop("No agreement in Var")
+   }
+   
+   
+ 
+   if(any(abs(rowMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,mean,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowMeans")
+   }
+   
+   
+   if(any(abs(colMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,mean,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colMeans")
+   }
+   
+   
+   if(any(abs(rowSums(buff.matrix,na.rm=TRUE)  -  apply(r.matrix,1,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in rowSums")
+   }
+   
+   
+   if(any(abs(colSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colSums")
+   }
+   
+   ### this is to get around the fact that R doesn't like to compute NA on an entire vector of NA when 
+   ### computing variance
+   my.Var <- function(x,na.rm=FALSE){
+    if (all(is.na(x))){
+      return(NA)
+    } else {
+      var(x,na.rm=na.rm)
+    }
+ 
+   }
+   
+   if(any(abs(rowVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+   
+   
+   if(any(abs(colVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+ 
+ 
+   if(any(abs(rowMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+ 
+   if(any(abs(colMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+   
+   
+   if(any(abs(rowMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+   
+ 
+   if(any(abs(colMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+ 
+   if(any(abs(colMedians(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,median,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMedian")
+   }
+ 
+   if(any(abs(colRanges(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,range,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colRanges")
+   }
+ 
+ 
+   
+ }
> 
> 
> 
> 
> 
> 
> 
> 
> 
> for (rep in 1:20){
+   copymatrix <- matrix(rnorm(200,150,15),10,20)
+   
+   tmp5[1:10,1:20] <- copymatrix
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ## now lets assign some NA values and check agreement
+ 
+   which.row <- sample(1:10,1,replace=TRUE)
+   which.col  <- sample(1:20,1,replace=TRUE)
+   
+   cat(which.row," ",which.col,"\n")
+   
+   tmp5[which.row,which.col] <- NA
+   copymatrix[which.row,which.col] <- NA
+   
+   agree.checks(tmp5,copymatrix)
+ 
+   ## make an entire row NA
+   tmp5[which.row,] <- NA
+   copymatrix[which.row,] <- NA
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ### also make an entire col NA
+   tmp5[,which.col] <- NA
+   copymatrix[,which.col] <- NA
+ 
+   agree.checks(tmp5,copymatrix)
+ 
+   ### now make 1 element non NA with NA in the rest of row and column
+ 
+   tmp5[which.row,which.col] <- rnorm(1,150,15)
+   copymatrix[which.row,which.col] <- tmp5[which.row,which.col]
+ 
+   agree.checks(tmp5,copymatrix)
+ }
5   18 
9   15 
5   20 
1   17 
1   13 
1   2 
4   10 
1   15 
7   9 
9   11 
9   15 
8   3 
3   5 
7   20 
4   5 
4   4 
5   20 
10   19 
9   2 
6   1 
There were 50 or more warnings (use warnings() to see the first 50)
> 
> 
> ### now test 1 by n and n by 1 matrix
> 
> 
> err.tol <- 1e-12
> 
> rm(tmp5)
> 
> dataset1 <- rnorm(100)
> dataset2 <- rnorm(100)
> 
> tmp <- createBufferedMatrix(1,100)
> tmp[1,] <- dataset1
> 
> tmp2 <- createBufferedMatrix(100,1)
> tmp2[,1] <- dataset2
> 
> 
> 
> 
> 
> Max(tmp)
[1] 2.168072
> Min(tmp)
[1] -3.076789
> mean(tmp)
[1] 0.000905321
> Sum(tmp)
[1] 0.0905321
> Var(tmp)
[1] 0.9986644
> 
> rowMeans(tmp)
[1] 0.000905321
> rowSums(tmp)
[1] 0.0905321
> rowVars(tmp)
[1] 0.9986644
> rowSd(tmp)
[1] 0.999332
> rowMax(tmp)
[1] 2.168072
> rowMin(tmp)
[1] -3.076789
> 
> colMeans(tmp)
  [1]  0.31584166 -1.34706563  0.11797790 -0.12290108  0.12108604  0.22928478
  [7]  1.05445253 -0.07501307 -1.96177283  2.00835482 -0.30707781 -1.76737039
 [13]  0.82426346 -0.36973939 -1.39535626 -0.50273001 -0.31333500  0.91015474
 [19] -0.61834530  1.55601046 -0.51758874 -0.20427193 -0.16088334  0.43984927
 [25] -1.05711848  0.59212020 -0.88505163  0.53916856 -0.35009594 -0.36410632
 [31]  0.03643529  1.15527639 -0.56723681  0.61855126  1.79181778  0.74139169
 [37] -0.63701440 -1.67359382 -0.26282335 -0.69719639 -0.53852576 -0.92368667
 [43]  0.03880473  0.43462750 -0.57327009  1.77368416 -0.55790494  0.46932342
 [49]  1.22228735 -1.14855189  1.09723281 -0.04089823 -0.98791600  2.14684310
 [55]  0.21930567  2.16807176 -0.81920899 -0.23144014 -1.54124861  0.09588024
 [61] -2.10034136  0.28344118 -0.71304790  0.24320960  0.31811038  0.27582260
 [67]  0.13304339 -0.99679120 -0.32644417 -0.13919672  0.26267859  0.10369423
 [73] -0.09617312  0.56915478  1.41971446 -0.85070626  0.58284002  2.07566258
 [79]  0.07775094  0.12006163 -0.46713536  1.14828390  0.23018777  0.57780694
 [85] -0.38077567 -3.07678922 -0.81520769  1.39412524  0.53301149 -2.23735606
 [91]  0.47842743  0.10464003  1.75908093 -0.34574284  0.01693206 -0.39688501
 [97]  0.39756824  0.10360638 -1.20320609  1.82971763
> colSums(tmp)
  [1]  0.31584166 -1.34706563  0.11797790 -0.12290108  0.12108604  0.22928478
  [7]  1.05445253 -0.07501307 -1.96177283  2.00835482 -0.30707781 -1.76737039
 [13]  0.82426346 -0.36973939 -1.39535626 -0.50273001 -0.31333500  0.91015474
 [19] -0.61834530  1.55601046 -0.51758874 -0.20427193 -0.16088334  0.43984927
 [25] -1.05711848  0.59212020 -0.88505163  0.53916856 -0.35009594 -0.36410632
 [31]  0.03643529  1.15527639 -0.56723681  0.61855126  1.79181778  0.74139169
 [37] -0.63701440 -1.67359382 -0.26282335 -0.69719639 -0.53852576 -0.92368667
 [43]  0.03880473  0.43462750 -0.57327009  1.77368416 -0.55790494  0.46932342
 [49]  1.22228735 -1.14855189  1.09723281 -0.04089823 -0.98791600  2.14684310
 [55]  0.21930567  2.16807176 -0.81920899 -0.23144014 -1.54124861  0.09588024
 [61] -2.10034136  0.28344118 -0.71304790  0.24320960  0.31811038  0.27582260
 [67]  0.13304339 -0.99679120 -0.32644417 -0.13919672  0.26267859  0.10369423
 [73] -0.09617312  0.56915478  1.41971446 -0.85070626  0.58284002  2.07566258
 [79]  0.07775094  0.12006163 -0.46713536  1.14828390  0.23018777  0.57780694
 [85] -0.38077567 -3.07678922 -0.81520769  1.39412524  0.53301149 -2.23735606
 [91]  0.47842743  0.10464003  1.75908093 -0.34574284  0.01693206 -0.39688501
 [97]  0.39756824  0.10360638 -1.20320609  1.82971763
> colVars(tmp)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> colSd(tmp)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> colMax(tmp)
  [1]  0.31584166 -1.34706563  0.11797790 -0.12290108  0.12108604  0.22928478
  [7]  1.05445253 -0.07501307 -1.96177283  2.00835482 -0.30707781 -1.76737039
 [13]  0.82426346 -0.36973939 -1.39535626 -0.50273001 -0.31333500  0.91015474
 [19] -0.61834530  1.55601046 -0.51758874 -0.20427193 -0.16088334  0.43984927
 [25] -1.05711848  0.59212020 -0.88505163  0.53916856 -0.35009594 -0.36410632
 [31]  0.03643529  1.15527639 -0.56723681  0.61855126  1.79181778  0.74139169
 [37] -0.63701440 -1.67359382 -0.26282335 -0.69719639 -0.53852576 -0.92368667
 [43]  0.03880473  0.43462750 -0.57327009  1.77368416 -0.55790494  0.46932342
 [49]  1.22228735 -1.14855189  1.09723281 -0.04089823 -0.98791600  2.14684310
 [55]  0.21930567  2.16807176 -0.81920899 -0.23144014 -1.54124861  0.09588024
 [61] -2.10034136  0.28344118 -0.71304790  0.24320960  0.31811038  0.27582260
 [67]  0.13304339 -0.99679120 -0.32644417 -0.13919672  0.26267859  0.10369423
 [73] -0.09617312  0.56915478  1.41971446 -0.85070626  0.58284002  2.07566258
 [79]  0.07775094  0.12006163 -0.46713536  1.14828390  0.23018777  0.57780694
 [85] -0.38077567 -3.07678922 -0.81520769  1.39412524  0.53301149 -2.23735606
 [91]  0.47842743  0.10464003  1.75908093 -0.34574284  0.01693206 -0.39688501
 [97]  0.39756824  0.10360638 -1.20320609  1.82971763
> colMin(tmp)
  [1]  0.31584166 -1.34706563  0.11797790 -0.12290108  0.12108604  0.22928478
  [7]  1.05445253 -0.07501307 -1.96177283  2.00835482 -0.30707781 -1.76737039
 [13]  0.82426346 -0.36973939 -1.39535626 -0.50273001 -0.31333500  0.91015474
 [19] -0.61834530  1.55601046 -0.51758874 -0.20427193 -0.16088334  0.43984927
 [25] -1.05711848  0.59212020 -0.88505163  0.53916856 -0.35009594 -0.36410632
 [31]  0.03643529  1.15527639 -0.56723681  0.61855126  1.79181778  0.74139169
 [37] -0.63701440 -1.67359382 -0.26282335 -0.69719639 -0.53852576 -0.92368667
 [43]  0.03880473  0.43462750 -0.57327009  1.77368416 -0.55790494  0.46932342
 [49]  1.22228735 -1.14855189  1.09723281 -0.04089823 -0.98791600  2.14684310
 [55]  0.21930567  2.16807176 -0.81920899 -0.23144014 -1.54124861  0.09588024
 [61] -2.10034136  0.28344118 -0.71304790  0.24320960  0.31811038  0.27582260
 [67]  0.13304339 -0.99679120 -0.32644417 -0.13919672  0.26267859  0.10369423
 [73] -0.09617312  0.56915478  1.41971446 -0.85070626  0.58284002  2.07566258
 [79]  0.07775094  0.12006163 -0.46713536  1.14828390  0.23018777  0.57780694
 [85] -0.38077567 -3.07678922 -0.81520769  1.39412524  0.53301149 -2.23735606
 [91]  0.47842743  0.10464003  1.75908093 -0.34574284  0.01693206 -0.39688501
 [97]  0.39756824  0.10360638 -1.20320609  1.82971763
> colMedians(tmp)
  [1]  0.31584166 -1.34706563  0.11797790 -0.12290108  0.12108604  0.22928478
  [7]  1.05445253 -0.07501307 -1.96177283  2.00835482 -0.30707781 -1.76737039
 [13]  0.82426346 -0.36973939 -1.39535626 -0.50273001 -0.31333500  0.91015474
 [19] -0.61834530  1.55601046 -0.51758874 -0.20427193 -0.16088334  0.43984927
 [25] -1.05711848  0.59212020 -0.88505163  0.53916856 -0.35009594 -0.36410632
 [31]  0.03643529  1.15527639 -0.56723681  0.61855126  1.79181778  0.74139169
 [37] -0.63701440 -1.67359382 -0.26282335 -0.69719639 -0.53852576 -0.92368667
 [43]  0.03880473  0.43462750 -0.57327009  1.77368416 -0.55790494  0.46932342
 [49]  1.22228735 -1.14855189  1.09723281 -0.04089823 -0.98791600  2.14684310
 [55]  0.21930567  2.16807176 -0.81920899 -0.23144014 -1.54124861  0.09588024
 [61] -2.10034136  0.28344118 -0.71304790  0.24320960  0.31811038  0.27582260
 [67]  0.13304339 -0.99679120 -0.32644417 -0.13919672  0.26267859  0.10369423
 [73] -0.09617312  0.56915478  1.41971446 -0.85070626  0.58284002  2.07566258
 [79]  0.07775094  0.12006163 -0.46713536  1.14828390  0.23018777  0.57780694
 [85] -0.38077567 -3.07678922 -0.81520769  1.39412524  0.53301149 -2.23735606
 [91]  0.47842743  0.10464003  1.75908093 -0.34574284  0.01693206 -0.39688501
 [97]  0.39756824  0.10360638 -1.20320609  1.82971763
> colRanges(tmp)
          [,1]      [,2]      [,3]       [,4]     [,5]      [,6]     [,7]
[1,] 0.3158417 -1.347066 0.1179779 -0.1229011 0.121086 0.2292848 1.054453
[2,] 0.3158417 -1.347066 0.1179779 -0.1229011 0.121086 0.2292848 1.054453
            [,8]      [,9]    [,10]      [,11]    [,12]     [,13]      [,14]
[1,] -0.07501307 -1.961773 2.008355 -0.3070778 -1.76737 0.8242635 -0.3697394
[2,] -0.07501307 -1.961773 2.008355 -0.3070778 -1.76737 0.8242635 -0.3697394
         [,15]    [,16]     [,17]     [,18]      [,19]   [,20]      [,21]
[1,] -1.395356 -0.50273 -0.313335 0.9101547 -0.6183453 1.55601 -0.5175887
[2,] -1.395356 -0.50273 -0.313335 0.9101547 -0.6183453 1.55601 -0.5175887
          [,22]      [,23]     [,24]     [,25]     [,26]      [,27]     [,28]
[1,] -0.2042719 -0.1608833 0.4398493 -1.057118 0.5921202 -0.8850516 0.5391686
[2,] -0.2042719 -0.1608833 0.4398493 -1.057118 0.5921202 -0.8850516 0.5391686
          [,29]      [,30]      [,31]    [,32]      [,33]     [,34]    [,35]
[1,] -0.3500959 -0.3641063 0.03643529 1.155276 -0.5672368 0.6185513 1.791818
[2,] -0.3500959 -0.3641063 0.03643529 1.155276 -0.5672368 0.6185513 1.791818
         [,36]      [,37]     [,38]      [,39]      [,40]      [,41]      [,42]
[1,] 0.7413917 -0.6370144 -1.673594 -0.2628233 -0.6971964 -0.5385258 -0.9236867
[2,] 0.7413917 -0.6370144 -1.673594 -0.2628233 -0.6971964 -0.5385258 -0.9236867
          [,43]     [,44]      [,45]    [,46]      [,47]     [,48]    [,49]
[1,] 0.03880473 0.4346275 -0.5732701 1.773684 -0.5579049 0.4693234 1.222287
[2,] 0.03880473 0.4346275 -0.5732701 1.773684 -0.5579049 0.4693234 1.222287
         [,50]    [,51]       [,52]     [,53]    [,54]     [,55]    [,56]
[1,] -1.148552 1.097233 -0.04089823 -0.987916 2.146843 0.2193057 2.168072
[2,] -1.148552 1.097233 -0.04089823 -0.987916 2.146843 0.2193057 2.168072
         [,57]      [,58]     [,59]      [,60]     [,61]     [,62]      [,63]
[1,] -0.819209 -0.2314401 -1.541249 0.09588024 -2.100341 0.2834412 -0.7130479
[2,] -0.819209 -0.2314401 -1.541249 0.09588024 -2.100341 0.2834412 -0.7130479
         [,64]     [,65]     [,66]     [,67]      [,68]      [,69]      [,70]
[1,] 0.2432096 0.3181104 0.2758226 0.1330434 -0.9967912 -0.3264442 -0.1391967
[2,] 0.2432096 0.3181104 0.2758226 0.1330434 -0.9967912 -0.3264442 -0.1391967
         [,71]     [,72]       [,73]     [,74]    [,75]      [,76]   [,77]
[1,] 0.2626786 0.1036942 -0.09617312 0.5691548 1.419714 -0.8507063 0.58284
[2,] 0.2626786 0.1036942 -0.09617312 0.5691548 1.419714 -0.8507063 0.58284
        [,78]      [,79]     [,80]      [,81]    [,82]     [,83]     [,84]
[1,] 2.075663 0.07775094 0.1200616 -0.4671354 1.148284 0.2301878 0.5778069
[2,] 2.075663 0.07775094 0.1200616 -0.4671354 1.148284 0.2301878 0.5778069
          [,85]     [,86]      [,87]    [,88]     [,89]     [,90]     [,91]
[1,] -0.3807757 -3.076789 -0.8152077 1.394125 0.5330115 -2.237356 0.4784274
[2,] -0.3807757 -3.076789 -0.8152077 1.394125 0.5330115 -2.237356 0.4784274
       [,92]    [,93]      [,94]      [,95]     [,96]     [,97]     [,98]
[1,] 0.10464 1.759081 -0.3457428 0.01693206 -0.396885 0.3975682 0.1036064
[2,] 0.10464 1.759081 -0.3457428 0.01693206 -0.396885 0.3975682 0.1036064
         [,99]   [,100]
[1,] -1.203206 1.829718
[2,] -1.203206 1.829718
> 
> 
> Max(tmp2)
[1] 3.496302
> Min(tmp2)
[1] -2.401619
> mean(tmp2)
[1] 0.1465052
> Sum(tmp2)
[1] 14.65052
> Var(tmp2)
[1] 1.150997
> 
> rowMeans(tmp2)
  [1] -0.03369427 -0.60900211  0.50864228  1.86665486 -0.24551951  0.44615774
  [7]  0.58434888  0.84565735  0.16644485  0.64506003 -0.32556639 -1.32480588
 [13]  0.59571035  0.47930424  1.23687777 -1.01577412 -0.72835987  3.49630191
 [19] -1.00215451  1.16102693 -0.16151421  1.30020975 -0.49215812 -1.49607200
 [25]  1.61739934  0.86978319 -1.39460106 -0.27061197 -0.60412740  0.36714687
 [31]  2.33073673  1.92423464 -1.71429594  0.21724189  0.76271965  0.22776479
 [37]  1.64414545 -0.04509089 -0.04346811  0.61502464 -0.88776808 -0.87743036
 [43]  1.15438358 -1.58777184  0.61684341  0.53917571  1.50817040 -0.71231661
 [49] -0.00677138 -0.21739234 -0.95150892  0.50500463 -1.10700556  0.64265369
 [55]  2.33564380 -0.88917155  0.57540460  0.69022968 -0.66299703  1.13481063
 [61]  1.29747507  1.32459972  1.06531548  0.88921293 -0.40312233 -1.48656849
 [67] -1.60437715  0.67267591  0.18680646 -0.61295595 -1.44425729  0.23753987
 [73]  0.72899432 -1.10299030 -0.03265478 -0.29327822  2.00008852  0.37812828
 [79]  0.27520533 -0.34368992 -1.39148316  1.70121714  0.34717034 -1.55874684
 [85] -0.76285110  0.57186374 -0.39870878 -1.20314457 -1.13940897  0.08392066
 [91] -0.09509889  0.74002583  1.26565087  0.64887986  0.42151424  0.60014961
 [97]  1.66239237 -0.98789648 -2.40161851  0.61057747
> rowSums(tmp2)
  [1] -0.03369427 -0.60900211  0.50864228  1.86665486 -0.24551951  0.44615774
  [7]  0.58434888  0.84565735  0.16644485  0.64506003 -0.32556639 -1.32480588
 [13]  0.59571035  0.47930424  1.23687777 -1.01577412 -0.72835987  3.49630191
 [19] -1.00215451  1.16102693 -0.16151421  1.30020975 -0.49215812 -1.49607200
 [25]  1.61739934  0.86978319 -1.39460106 -0.27061197 -0.60412740  0.36714687
 [31]  2.33073673  1.92423464 -1.71429594  0.21724189  0.76271965  0.22776479
 [37]  1.64414545 -0.04509089 -0.04346811  0.61502464 -0.88776808 -0.87743036
 [43]  1.15438358 -1.58777184  0.61684341  0.53917571  1.50817040 -0.71231661
 [49] -0.00677138 -0.21739234 -0.95150892  0.50500463 -1.10700556  0.64265369
 [55]  2.33564380 -0.88917155  0.57540460  0.69022968 -0.66299703  1.13481063
 [61]  1.29747507  1.32459972  1.06531548  0.88921293 -0.40312233 -1.48656849
 [67] -1.60437715  0.67267591  0.18680646 -0.61295595 -1.44425729  0.23753987
 [73]  0.72899432 -1.10299030 -0.03265478 -0.29327822  2.00008852  0.37812828
 [79]  0.27520533 -0.34368992 -1.39148316  1.70121714  0.34717034 -1.55874684
 [85] -0.76285110  0.57186374 -0.39870878 -1.20314457 -1.13940897  0.08392066
 [91] -0.09509889  0.74002583  1.26565087  0.64887986  0.42151424  0.60014961
 [97]  1.66239237 -0.98789648 -2.40161851  0.61057747
> rowVars(tmp2)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowSd(tmp2)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowMax(tmp2)
  [1] -0.03369427 -0.60900211  0.50864228  1.86665486 -0.24551951  0.44615774
  [7]  0.58434888  0.84565735  0.16644485  0.64506003 -0.32556639 -1.32480588
 [13]  0.59571035  0.47930424  1.23687777 -1.01577412 -0.72835987  3.49630191
 [19] -1.00215451  1.16102693 -0.16151421  1.30020975 -0.49215812 -1.49607200
 [25]  1.61739934  0.86978319 -1.39460106 -0.27061197 -0.60412740  0.36714687
 [31]  2.33073673  1.92423464 -1.71429594  0.21724189  0.76271965  0.22776479
 [37]  1.64414545 -0.04509089 -0.04346811  0.61502464 -0.88776808 -0.87743036
 [43]  1.15438358 -1.58777184  0.61684341  0.53917571  1.50817040 -0.71231661
 [49] -0.00677138 -0.21739234 -0.95150892  0.50500463 -1.10700556  0.64265369
 [55]  2.33564380 -0.88917155  0.57540460  0.69022968 -0.66299703  1.13481063
 [61]  1.29747507  1.32459972  1.06531548  0.88921293 -0.40312233 -1.48656849
 [67] -1.60437715  0.67267591  0.18680646 -0.61295595 -1.44425729  0.23753987
 [73]  0.72899432 -1.10299030 -0.03265478 -0.29327822  2.00008852  0.37812828
 [79]  0.27520533 -0.34368992 -1.39148316  1.70121714  0.34717034 -1.55874684
 [85] -0.76285110  0.57186374 -0.39870878 -1.20314457 -1.13940897  0.08392066
 [91] -0.09509889  0.74002583  1.26565087  0.64887986  0.42151424  0.60014961
 [97]  1.66239237 -0.98789648 -2.40161851  0.61057747
> rowMin(tmp2)
  [1] -0.03369427 -0.60900211  0.50864228  1.86665486 -0.24551951  0.44615774
  [7]  0.58434888  0.84565735  0.16644485  0.64506003 -0.32556639 -1.32480588
 [13]  0.59571035  0.47930424  1.23687777 -1.01577412 -0.72835987  3.49630191
 [19] -1.00215451  1.16102693 -0.16151421  1.30020975 -0.49215812 -1.49607200
 [25]  1.61739934  0.86978319 -1.39460106 -0.27061197 -0.60412740  0.36714687
 [31]  2.33073673  1.92423464 -1.71429594  0.21724189  0.76271965  0.22776479
 [37]  1.64414545 -0.04509089 -0.04346811  0.61502464 -0.88776808 -0.87743036
 [43]  1.15438358 -1.58777184  0.61684341  0.53917571  1.50817040 -0.71231661
 [49] -0.00677138 -0.21739234 -0.95150892  0.50500463 -1.10700556  0.64265369
 [55]  2.33564380 -0.88917155  0.57540460  0.69022968 -0.66299703  1.13481063
 [61]  1.29747507  1.32459972  1.06531548  0.88921293 -0.40312233 -1.48656849
 [67] -1.60437715  0.67267591  0.18680646 -0.61295595 -1.44425729  0.23753987
 [73]  0.72899432 -1.10299030 -0.03265478 -0.29327822  2.00008852  0.37812828
 [79]  0.27520533 -0.34368992 -1.39148316  1.70121714  0.34717034 -1.55874684
 [85] -0.76285110  0.57186374 -0.39870878 -1.20314457 -1.13940897  0.08392066
 [91] -0.09509889  0.74002583  1.26565087  0.64887986  0.42151424  0.60014961
 [97]  1.66239237 -0.98789648 -2.40161851  0.61057747
> 
> colMeans(tmp2)
[1] 0.1465052
> colSums(tmp2)
[1] 14.65052
> colVars(tmp2)
[1] 1.150997
> colSd(tmp2)
[1] 1.072845
> colMax(tmp2)
[1] 3.496302
> colMin(tmp2)
[1] -2.401619
> colMedians(tmp2)
[1] 0.2326523
> colRanges(tmp2)
          [,1]
[1,] -2.401619
[2,]  3.496302
> 
> 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]  1.0649462  3.4294534  0.7640161 -4.5797370  1.3338610 -3.0918594
 [7]  0.4833430  1.7570192 -0.6092687 -5.1950477
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -0.7905417
[2,] -0.4476338
[3,]  0.1695887
[4,]  0.5183192
[5,]  1.4584191
> 
> rowApply(tmp,sum)
 [1] -0.459545046 -2.910437407  2.598890378 -1.245360367  1.046900353
 [6] -1.494363587 -0.002598101 -3.232185348 -4.767547071  5.822972272
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    8    7    2    9    7    7    9    4    6     3
 [2,]    3    4    5    8    1    8    8   10    9     9
 [3,]   10   10    6    1    3    6    2    8    4     8
 [4,]    1    5    1    3    9   10    3    7    2     5
 [5,]    5    9    7    2    2    5    6    3   10     2
 [6,]    7    3   10    6    6    1    4    9    1     4
 [7,]    4    1    9    5   10    3    7    2    7    10
 [8,]    9    8    8    7    5    2   10    1    5     7
 [9,]    6    2    4   10    4    4    5    5    3     6
[10,]    2    6    3    4    8    9    1    6    8     1
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1]  0.3912893  2.9434947  0.5276007  3.7521781  2.9444700  3.3057654
 [7]  4.2067970 -2.7281613  0.8919778  1.9194459 -1.3037305  0.4505617
[13] -0.8996464 -6.5451342  0.8255337 -1.4252746  1.4109017  1.2252937
[19]  3.6876397 -0.8000301
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -0.6721152
[2,] -0.1123464
[3,]  0.2039108
[4,]  0.4391557
[5,]  0.5326845
> 
> rowApply(tmp,sum)
[1] -3.037683 -1.046366  7.926771  2.649777  8.288473
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]   14    6   13    7    8
[2,]    8   17   16    6   13
[3,]    1   14   11   17   19
[4,]   17    9   12   14   20
[5,]   19    2   15   19   14
> 
> 
> as.matrix(tmp)
           [,1]       [,2]       [,3]       [,4]       [,5]       [,6]
[1,]  0.5326845 -0.4196696 -2.5731983  1.2199006  1.4411538 -0.1474594
[2,] -0.6721152  1.1622096  0.3934965 -0.2361181 -1.8434163  1.1748680
[3,]  0.4391557  1.4229076  0.2423747  0.3109586  1.1158665  1.5751022
[4,] -0.1123464 -0.1466076  0.8684763  0.5643688  1.2545187  0.8222290
[5,]  0.2039108  0.9246547  1.5964514  1.8930682  0.9763473 -0.1189744
            [,7]       [,8]       [,9]       [,10]      [,11]       [,12]
[1,]  1.52585167 -0.2724484  1.4275822 -0.70042049 -0.8766277  0.26419105
[2,]  1.59162740 -0.9209030 -0.0033264  2.22810152  0.4355982  0.03333448
[3,]  2.00611138 -0.6766746 -0.4695960 -0.01091619 -0.5220429 -0.77262055
[4,] -0.95865127  0.2159487  0.1971605  0.05980212  0.2032907 -0.08784832
[5,]  0.04185781 -1.0740840 -0.2598426  0.34287893 -0.5439488  1.01350505
           [,13]      [,14]      [,15]       [,16]       [,17]      [,18]
[1,] -1.84141075 -1.2469942  0.9784564 -0.30449045  0.57852795 -1.4007375
[2,] -0.02796672 -2.2753621 -0.4391351 -1.10211124  0.34551497 -1.5180441
[3,]  0.94144552 -0.3544832  2.0139884 -0.63614160 -0.08648398  1.9639528
[4,] -0.95770948 -1.7726627 -0.7817757 -0.05549742 -0.24280977  0.9299409
[5,]  0.98599506 -0.8956319 -0.9460003  0.67296608  0.81615254  1.2501816
          [,19]      [,20]
[1,] -0.1207308 -1.1018440
[2,]  0.9714798 -0.3440978
[3,] -0.1195775 -0.4565555
[4,]  1.8501529  0.7997967
[5,]  1.1063152  0.3026706
> 
> 
> 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 :  654  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.173791 0.2213536 -0.6695824 -1.425603 1.515941 1.144283 -0.9072211
          col8        col9    col10    col11   col12     col13    col14
row1 0.3825877 -0.00343379 -0.84711 1.558746 1.22424 0.5295463 1.389692
         col15     col16    col17      col18     col19      col20
row1 -1.584442 0.6162539 1.267855 -0.4809837 0.9025394 -0.2601774
> tmp[,"col10"]
           col10
row1 -0.84711002
row2  0.67247620
row3  0.81558309
row4 -0.01029482
row5  1.10033048
> tmp[c("row1","row5"),]
          col1       col2       col3      col4     col5        col6       col7
row1 -1.173791  0.2213536 -0.6695824 -1.425603 1.515941  1.14428321 -0.9072211
row5  2.605872 -0.2419403  0.3673140  1.860869 2.482917 -0.04079292  1.5104464
           col8        col9    col10      col11     col12     col13       col14
row1  0.3825877 -0.00343379 -0.84711 1.55874591 1.2242395 0.5295463  1.38969153
row5 -1.0692352  0.03935704  1.10033 0.03463183 0.8175941 1.4080439 -0.01540254
         col15     col16     col17       col18      col19      col20
row1 -1.584442 0.6162539  1.267855 -0.48098370  0.9025394 -0.2601774
row5  1.412229 1.1052568 -1.157075 -0.03415738 -1.4811652 -2.0351000
> tmp[,c("col6","col20")]
            col6      col20
row1  1.14428321 -0.2601774
row2  0.24790852  1.8745289
row3  2.13714790 -0.1064563
row4 -1.26651666  0.3851329
row5 -0.04079292 -2.0351000
> tmp[c("row1","row5"),c("col6","col20")]
            col6      col20
row1  1.14428321 -0.2601774
row5 -0.04079292 -2.0351000
> 
> 
> 
> 
> tmp["row1",] <- rnorm(20,mean=10)
> tmp[,"col10"] <- rnorm(5,mean=30)
> tmp[c("row1","row5"),] <- rnorm(40,mean=50)
> tmp[,c("col6","col20")] <- rnorm(10,mean=75)
> tmp[c("row1","row5"),c("col6","col20")]  <- rnorm(4,mean=105)
> 
> tmp["row1",]
         col1     col2     col3     col4    col5     col6     col7     col8
row1 51.35994 49.45725 48.74519 51.63349 49.9184 105.2527 50.68229 48.60967
         col9    col10    col11    col12    col13    col14    col15    col16
row1 52.08714 50.28578 50.19235 49.89016 50.17375 50.71362 49.20359 51.55303
        col17    col18    col19    col20
row1 49.14586 48.74252 50.76072 105.1393
> tmp[,"col10"]
        col10
row1 50.28578
row2 31.47658
row3 27.99139
row4 30.57096
row5 49.46790
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 51.35994 49.45725 48.74519 51.63349 49.91840 105.2527 50.68229 48.60967
row5 50.10016 50.13652 49.22790 51.85583 48.51357 106.1204 48.65064 48.97123
         col9    col10    col11    col12    col13    col14    col15    col16
row1 52.08714 50.28578 50.19235 49.89016 50.17375 50.71362 49.20359 51.55303
row5 50.58224 49.46790 51.04561 50.99505 48.96189 50.88558 49.24407 51.02854
        col17    col18    col19    col20
row1 49.14586 48.74252 50.76072 105.1393
row5 51.14758 50.02800 50.02529 104.5385
> tmp[,c("col6","col20")]
          col6     col20
row1 105.25273 105.13932
row2  74.05805  75.45233
row3  74.54777  76.04956
row4  74.42651  74.75591
row5 106.12041 104.53848
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 105.2527 105.1393
row5 106.1204 104.5385
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 105.2527 105.1393
row5 106.1204 104.5385
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
           col13
[1,]  1.30853458
[2,]  0.01921497
[3,]  0.73576495
[4,]  0.93941601
[5,] -0.32328331
> tmp[,c("col17","col7")]
          col17       col7
[1,] -1.3287928 -1.4629174
[2,]  1.3900125 -0.7512128
[3,]  0.6440833 -0.6987924
[4,]  1.1666353 -0.4115590
[5,] -0.1321099 -1.4786945
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
            col6       col20
[1,] -0.02368839  0.11491248
[2,] -1.30335718  0.74157113
[3,]  1.03254435  0.01592299
[4,]  0.98554671 -0.10529343
[5,]  0.35306548  0.66041443
> subBufferedMatrix(tmp,1,c("col6"))[,1]
            col1
[1,] -0.02368839
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
            col6
[1,] -0.02368839
[2,] -1.30335718
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> 
> 
> 
> subBufferedMatrix(tmp,c("row3","row1"),)[,1:20]
          [,1]      [,2]       [,3]      [,4]        [,5]       [,6]
row3 0.7753327 0.9932798  0.4519947 0.2493966  0.04384383 0.22967301
row1 0.4836347 0.2953127 -0.1978570 0.1382698 -0.65627425 0.03983345
             [,7]       [,8]        [,9]      [,10]      [,11]     [,12]
row3  1.850751146  0.7744604 -0.09472114 -0.7863471  1.0276131 0.8110256
row1 -0.004710077 -0.4613547 -0.46354930 -1.5514840 -0.5221852 0.7404158
         [,13]    [,14]      [,15]      [,16]     [,17]      [,18]     [,19]
row3 0.7240464 1.312150  1.8254825  0.2827228 0.2291070  0.9091678 0.3152264
row1 0.2408655 2.007475 -0.7886214 -0.5338842 0.8561593 -0.2105592 1.3912449
          [,20]
row3  1.2636229
row1 -0.0398853
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
           [,1]       [,2]      [,3]      [,4]       [,5]      [,6]     [,7]
row2 -0.4488005 -0.7044277 0.3649677 0.5076806 -0.4948014 -1.246706 0.532642
          [,8]       [,9]      [,10]
row2 -1.596635 -0.5887776 -0.9407633
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
          [,1]      [,2]       [,3]     [,4]     [,5]     [,6]     [,7]
row5 -0.794244 -1.055202 -0.6406438 1.272425 1.361207 1.890205 1.107314
          [,8]       [,9]     [,10]    [,11]     [,12]     [,13]      [,14]
row5 -1.926594 -0.2537485 0.6219015 1.590489 -0.796408 0.7752195 -0.4246286
          [,15]     [,16]     [,17]      [,18]     [,19]      [,20]
row5 -0.4397104 -0.424762 0.1680598 0.09433879 -1.284084 -0.7784318
> 
> 
> 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: 0x600000994000>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM168f71745397e"
 [2] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM168f741c18b21"
 [3] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM168f79954541" 
 [4] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM168f726f5b351"
 [5] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM168f74ccf9ed2"
 [6] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM168f752c41463"
 [7] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM168f747169a08"
 [8] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM168f71cdaa7ae"
 [9] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM168f757369f4e"
[10] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM168f74314e69d"
[11] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM168f711306fd3"
[12] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM168f72fd8e76" 
[13] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM168f75493e682"
[14] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM168f73a028c2f"
[15] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM168f77d417f69"
> 
> 
> ### 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: 0x600000994060>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x600000994060>
Warning message:
In dir.create(new.directory) :
  '/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x600000994060>
> rowMedians(tmp)
  [1] -0.331414016  0.450925959 -0.333624288  0.055264038  0.038334134
  [6] -0.120022841  0.571664960 -0.367674178  0.687304017 -0.400316198
 [11]  0.022897159  0.137698620  0.277085580 -0.642650953 -0.363348152
 [16]  0.645130843  0.387631113 -0.154652619  0.348345188  0.065207577
 [21]  0.472746837 -0.163524089 -0.137858086  0.041431075  0.463395078
 [26] -0.072543373  0.684758646  0.053243387  0.027216875  0.189311292
 [31]  0.092996288  0.185940353 -0.185755343  0.073373771  0.734836571
 [36] -0.328666482  0.678738682  0.007917698  0.241979722  0.065668716
 [41] -0.042032599  0.347021673 -0.152784612  0.045215600  0.131045449
 [46]  0.337070363  0.286598416  0.003888282 -0.128264296 -0.602102974
 [51]  0.159967051  0.200986283 -0.024064836  0.022999159  0.066995981
 [56]  0.510168820 -0.423297324  0.447519186  0.722113067 -0.660970023
 [61] -0.133230908 -0.724758187  0.231678226 -0.018296447 -0.353503570
 [66] -0.131035892  0.651415093 -0.201950103 -0.319587627  0.245323696
 [71]  0.119096720 -0.567660908 -0.213713881 -0.013644062  0.184109376
 [76]  0.141104068  0.129835733  0.028270357 -0.075088440  0.079257946
 [81] -0.019018288 -0.163311678  0.038940329  0.010329319  0.126855581
 [86]  0.447924181  0.220197104  0.246848997  0.234058012 -0.213084130
 [91] -0.376428802 -0.245279299  0.130818387  0.084196779  0.339701838
 [96]  0.214614659  0.354358823 -0.332902670 -0.469793433 -0.128942678
[101]  0.007729153 -0.362000980  0.208354441 -0.012697587  0.224397142
[106] -0.561305806  0.303996866  0.079179513 -0.031637156 -0.204976041
[111]  0.163835374  0.015568919  0.098202400 -0.026168784  0.136334884
[116] -0.063211706  0.357707760  0.498239380  0.099850693 -0.141070398
[121]  0.350919754 -0.293583867  0.106394085  0.335779881  0.049476644
[126]  0.289691917  0.005046483 -0.006791212 -0.344466925  0.064799060
[131] -0.255939878  0.388345603  0.216620383 -0.497253652 -0.259034058
[136] -0.220807451 -0.407009284  0.269645818 -0.251641167 -0.475749988
[141]  0.250936928  0.142462868  0.477667544 -0.054442002 -0.326314405
[146] -0.162640593 -0.069141997 -0.309902763  0.189060265 -0.251441652
[151]  0.435830009  0.374177114  0.369594282 -0.088324067 -0.362659318
[156] -0.051098556 -0.419482589 -0.229281575  0.733491305 -0.324512772
[161]  0.024191365 -0.104672528 -0.157804624  0.203359567 -0.232529805
[166] -0.010457760  0.223174959  0.130478170  0.209194410  0.135754748
[171]  0.192142095  0.192347987 -0.060041598 -0.103887621 -0.022205926
[176] -0.106768743  0.389899626  0.259833499 -0.012923214 -0.310044089
[181] -0.807634789 -0.118958003  0.305485735 -0.129980030  0.400188029
[186]  0.028808396  0.608148365 -0.020776269  0.270445749  0.084746347
[191]  0.165468779 -0.160720331  0.041401351  0.107020288  0.143827843
[196] -0.260627525 -0.600932063  0.293922552 -0.300276152  0.238939682
[201] -0.577627568 -0.292004646 -0.229691016  0.237545495  0.519717790
[206]  0.112210815 -0.108794393 -0.220279157  0.361383702 -0.584066633
[211]  0.104392351 -0.186939490  0.197885669  0.362737161  0.058657203
[216] -0.442463783 -0.167313910 -0.005853331 -0.197031188 -0.155467552
[221]  0.021384119  0.413737037 -0.467935678 -0.519114172  0.227541773
[226] -0.417898321 -0.248872666 -0.095904187  0.280292847 -0.562630649
> 
> proc.time()
   user  system elapsed 
  5.142  19.055  25.596 

BufferedMatrix.Rcheck/tests/rawCalltesting.Rout


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

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

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

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

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

Attaching package: 'BufferedMatrix'

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

    colMeans, colSums, rowMeans, rowSums

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

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

<pointer: 0x6000028e0060>
> .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: 0x6000028e0060>
> .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: 0x6000028e0060>
> .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: 0x6000028e0060>
> 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: 0x6000028c4540>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000028c4540>
> .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: 0x6000028c4540>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000028c4540>
> .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: 0x6000028c4540>
> 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: 0x6000028dc000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000028dc000>
> .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: 0x6000028dc000>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x6000028dc000>
> .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: 0x6000028dc000>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x6000028dc000>
> .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: 0x6000028dc000>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x6000028dc000>
> .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: 0x6000028dc000>
> 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: 0x6000028d8000>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x6000028d8000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000028d8000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000028d8000>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile16d6b64b45f18" "BufferedMatrixFile16d6b7dbe7bd6"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile16d6b64b45f18" "BufferedMatrixFile16d6b7dbe7bd6"
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000028d8240>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000028d8240>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x6000028d8240>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x6000028d8240>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x6000028d8240>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x6000028d8240>
> .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: 0x6000028d8420>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000028d8420>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x6000028d8420>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x6000028d8420>
> 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: 0x6000028d8600>
> .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: 0x6000028d8600>
> rm(P)
> 
> proc.time()
   user  system elapsed 
  0.593   0.222   0.777 

BufferedMatrix.Rcheck/tests/Rcodetesting.Rout


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

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

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

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

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

Attaching package: 'BufferedMatrix'

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

    colMeans, colSums, rowMeans, rowSums

> 
> Temp <- createBufferedMatrix(100)
> dim(Temp)
[1] 100   0
> buffer.dim(Temp)
[1] 1 1
> 
> 
> proc.time()
   user  system elapsed 
  0.590   0.139   0.691 

Example timings