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

This page was generated on 2024-03-27 11:37:26 -0400 (Wed, 27 Mar 2024).

HostnameOSArch (*)R versionInstalled pkgs
nebbiolo2Linux (Ubuntu 22.04.3 LTS)x86_644.3.3 (2024-02-29) -- "Angel Food Cake" 4667
palomino4Windows Server 2022 Datacenterx644.3.3 (2024-02-29 ucrt) -- "Angel Food Cake" 4403
merida1macOS 12.7.1 Montereyx86_644.3.3 (2024-02-29) -- "Angel Food Cake" 4426
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 246/2266HostnameOS / ArchINSTALLBUILDCHECKBUILD BIN
BufferedMatrix 1.66.0  (landing page)
Ben Bolstad
Snapshot Date: 2024-03-25 14:05:07 -0400 (Mon, 25 Mar 2024)
git_url: https://git.bioconductor.org/packages/BufferedMatrix
git_branch: RELEASE_3_18
git_last_commit: 1feca44
git_last_commit_date: 2023-10-24 09:37:50 -0400 (Tue, 24 Oct 2023)
nebbiolo2Linux (Ubuntu 22.04.3 LTS) / x86_64  OK    OK    OK  UNNEEDED, same version is already published
palomino4Windows Server 2022 Datacenter / x64  OK    OK    OK    OK  UNNEEDED, same version is already published
merida1macOS 12.7.1 Monterey / x86_64  OK    OK    WARNINGS    OK  UNNEEDED, same version is already published
kjohnson1macOS 13.6.1 Ventura / arm64see weekly results here

CHECK results for BufferedMatrix on merida1


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

raw results


Summary

Package: BufferedMatrix
Version: 1.66.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.66.0.tar.gz
StartedAt: 2024-03-26 00:01:21 -0400 (Tue, 26 Mar 2024)
EndedAt: 2024-03-26 00:02:29 -0400 (Tue, 26 Mar 2024)
EllapsedTime: 68.2 seconds
RetCode: 0
Status:   WARNINGS  
CheckDir: BufferedMatrix.Rcheck
Warnings: 1

Command output

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


* using log directory ‘/Users/biocbuild/bbs-3.18-bioc/meat/BufferedMatrix.Rcheck’
* using R version 4.3.3 (2024-02-29)
* using platform: x86_64-apple-darwin20 (64-bit)
* 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.1
* using session charset: UTF-8
* using option ‘--no-vignettes’
* checking for file ‘BufferedMatrix/DESCRIPTION’ ... OK
* this is package ‘BufferedMatrix’ version ‘1.66.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.18-bioc/meat/BufferedMatrix.Rcheck/00install.out’ for details.
* used C compiler: ‘Apple clang version 14.0.0 (clang-1400.0.29.202)’
* used SDK: ‘MacOSX11.3.sdk’
* checking installed package size ... OK
* checking package directory ... OK
* checking ‘build’ directory ... OK
* checking DESCRIPTION meta-information ... OK
* checking top-level files ... OK
* checking for left-over files ... OK
* checking index information ... OK
* checking package subdirectories ... OK
* checking R files for non-ASCII characters ... OK
* checking R files for syntax errors ... OK
* checking whether the package can be loaded ... OK
* checking whether the package can be loaded with stated dependencies ... OK
* checking whether the package can be unloaded cleanly ... OK
* checking whether the namespace can be loaded with stated dependencies ... OK
* checking whether the namespace can be unloaded cleanly ... OK
* checking dependencies in R code ... OK
* checking S3 generic/method consistency ... OK
* checking replacement functions ... OK
* checking foreign function calls ... OK
* checking R code for possible problems ... OK
* checking Rd files ... NOTE
prepare_Rd: createBufferedMatrix.Rd:26: Dropping empty section \keyword
prepare_Rd: createBufferedMatrix.Rd:17-18: Dropping empty section \details
prepare_Rd: createBufferedMatrix.Rd:15-16: Dropping empty section \value
prepare_Rd: createBufferedMatrix.Rd:19-20: Dropping empty section \references
prepare_Rd: createBufferedMatrix.Rd:21-22: Dropping empty section \seealso
prepare_Rd: createBufferedMatrix.Rd:23-24: Dropping empty section \examples
* checking Rd metadata ... OK
* checking Rd cross-references ... OK
* checking for missing documentation entries ... OK
* checking for code/documentation mismatches ... OK
* checking Rd \usage sections ... OK
* checking Rd contents ... OK
* checking for unstated dependencies in examples ... OK
* checking line endings in C/C++/Fortran sources/headers ... OK
* checking compiled code ... NOTE
Note: information on .o files is not available
* checking sizes of PDF files under ‘inst/doc’ ... OK
* checking files in ‘vignettes’ ... OK
* checking examples ... NONE
* checking for unstated dependencies in ‘tests’ ... OK
* checking tests ...
  Running ‘Rcodetesting.R’
  Running ‘c_code_level_tests.R’
  Running ‘objectTesting.R’
  Running ‘rawCalltesting.R’
 OK
* checking for unstated dependencies in vignettes ... OK
* checking package vignettes in ‘inst/doc’ ... OK
* checking running R code from vignettes ... SKIPPED
* checking re-building of vignette outputs ... SKIPPED
* checking PDF version of manual ... OK
* DONE

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



Installation output

BufferedMatrix.Rcheck/00install.out

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


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

Tests output

BufferedMatrix.Rcheck/tests/c_code_level_tests.Rout


R version 4.3.3 (2024-02-29) -- "Angel Food Cake"
Copyright (C) 2024 The R Foundation for Statistical Computing
Platform: x86_64-apple-darwin20 (64-bit)

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

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

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

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

Attaching package: 'BufferedMatrix'

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

    colMeans, colSums, rowMeans, rowSums

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

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

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

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

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

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

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

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

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

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

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

[[1]]
[1] 0

> 
> proc.time()
   user  system elapsed 
  0.576   0.203   0.742 

BufferedMatrix.Rcheck/tests/objectTesting.Rout


R version 4.3.3 (2024-02-29) -- "Angel Food Cake"
Copyright (C) 2024 The R Foundation for Statistical Computing
Platform: x86_64-apple-darwin20 (64-bit)

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

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

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

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

Attaching package: 'BufferedMatrix'

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

    colMeans, colSums, rowMeans, rowSums

> 
> 
> ### this is used to control how many repetitions in something below
> ### higher values result in more checks.
> nreps <-100 ##20000
> 
> 
> ## test creation and some simple assignments and subsetting operations
> 
> ## first on single elements
> tmp <- createBufferedMatrix(1000,10)
> 
> tmp[10,5]
[1] 0
> tmp[10,5] <- 10
> tmp[10,5]
[1] 10
> tmp[10,5] <- 12.445
> tmp[10,5]
[1] 12.445
> 
> 
> 
> ## now testing accessing multiple elements
> tmp2 <- createBufferedMatrix(10,20)
> 
> 
> tmp2[3,1] <- 51.34
> tmp2[9,2] <- 9.87654
> tmp2[,1:2]
       [,1]    [,2]
 [1,]  0.00 0.00000
 [2,]  0.00 0.00000
 [3,] 51.34 0.00000
 [4,]  0.00 0.00000
 [5,]  0.00 0.00000
 [6,]  0.00 0.00000
 [7,]  0.00 0.00000
 [8,]  0.00 0.00000
 [9,]  0.00 9.87654
[10,]  0.00 0.00000
> tmp2[,-(3:20)]
       [,1]    [,2]
 [1,]  0.00 0.00000
 [2,]  0.00 0.00000
 [3,] 51.34 0.00000
 [4,]  0.00 0.00000
 [5,]  0.00 0.00000
 [6,]  0.00 0.00000
 [7,]  0.00 0.00000
 [8,]  0.00 0.00000
 [9,]  0.00 9.87654
[10,]  0.00 0.00000
> tmp2[3,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
[1,] 51.34    0    0    0    0    0    0    0    0     0     0     0     0
     [,14] [,15] [,16] [,17] [,18] [,19] [,20]
[1,]     0     0     0     0     0     0     0
> tmp2[-3,]
      [,1]    [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [2,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [3,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [4,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [5,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [6,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [7,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [8,]    0 9.87654    0    0    0    0    0    0    0     0     0     0     0
 [9,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
      [,14] [,15] [,16] [,17] [,18] [,19] [,20]
 [1,]     0     0     0     0     0     0     0
 [2,]     0     0     0     0     0     0     0
 [3,]     0     0     0     0     0     0     0
 [4,]     0     0     0     0     0     0     0
 [5,]     0     0     0     0     0     0     0
 [6,]     0     0     0     0     0     0     0
 [7,]     0     0     0     0     0     0     0
 [8,]     0     0     0     0     0     0     0
 [9,]     0     0     0     0     0     0     0
> tmp2[2,1:3]
     [,1] [,2] [,3]
[1,]    0    0    0
> tmp2[3:9,1:3]
      [,1]    [,2] [,3]
[1,] 51.34 0.00000    0
[2,]  0.00 0.00000    0
[3,]  0.00 0.00000    0
[4,]  0.00 0.00000    0
[5,]  0.00 0.00000    0
[6,]  0.00 0.00000    0
[7,]  0.00 9.87654    0
> tmp2[-4,-4]
       [,1]    [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [2,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [3,] 51.34 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [4,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [5,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [6,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [7,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [8,]  0.00 9.87654    0    0    0    0    0    0    0     0     0     0     0
 [9,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
      [,14] [,15] [,16] [,17] [,18] [,19]
 [1,]     0     0     0     0     0     0
 [2,]     0     0     0     0     0     0
 [3,]     0     0     0     0     0     0
 [4,]     0     0     0     0     0     0
 [5,]     0     0     0     0     0     0
 [6,]     0     0     0     0     0     0
 [7,]     0     0     0     0     0     0
 [8,]     0     0     0     0     0     0
 [9,]     0     0     0     0     0     0
> 
> ## now testing accessing/assigning multiple elements
> tmp3 <- createBufferedMatrix(10,10)
> 
> for (i in 1:10){
+   for (j in 1:10){
+     tmp3[i,j] <- (j-1)*10 + i
+   }
+ }
> 
> tmp3[2:4,2:4]
     [,1] [,2] [,3]
[1,]   12   22   32
[2,]   13   23   33
[3,]   14   24   34
> tmp3[c(-10),c(2:4,2:4,10,1,2,1:10,10:1)]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]   11   21   31   11   21   31   91    1   11     1    11    21    31
 [2,]   12   22   32   12   22   32   92    2   12     2    12    22    32
 [3,]   13   23   33   13   23   33   93    3   13     3    13    23    33
 [4,]   14   24   34   14   24   34   94    4   14     4    14    24    34
 [5,]   15   25   35   15   25   35   95    5   15     5    15    25    35
 [6,]   16   26   36   16   26   36   96    6   16     6    16    26    36
 [7,]   17   27   37   17   27   37   97    7   17     7    17    27    37
 [8,]   18   28   38   18   28   38   98    8   18     8    18    28    38
 [9,]   19   29   39   19   29   39   99    9   19     9    19    29    39
      [,14] [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24] [,25]
 [1,]    41    51    61    71    81    91    91    81    71    61    51    41
 [2,]    42    52    62    72    82    92    92    82    72    62    52    42
 [3,]    43    53    63    73    83    93    93    83    73    63    53    43
 [4,]    44    54    64    74    84    94    94    84    74    64    54    44
 [5,]    45    55    65    75    85    95    95    85    75    65    55    45
 [6,]    46    56    66    76    86    96    96    86    76    66    56    46
 [7,]    47    57    67    77    87    97    97    87    77    67    57    47
 [8,]    48    58    68    78    88    98    98    88    78    68    58    48
 [9,]    49    59    69    79    89    99    99    89    79    69    59    49
      [,26] [,27] [,28] [,29]
 [1,]    31    21    11     1
 [2,]    32    22    12     2
 [3,]    33    23    13     3
 [4,]    34    24    14     4
 [5,]    35    25    15     5
 [6,]    36    26    16     6
 [7,]    37    27    17     7
 [8,]    38    28    18     8
 [9,]    39    29    19     9
> tmp3[-c(1:5),-c(6:10)]
     [,1] [,2] [,3] [,4] [,5]
[1,]    6   16   26   36   46
[2,]    7   17   27   37   47
[3,]    8   18   28   38   48
[4,]    9   19   29   39   49
[5,]   10   20   30   40   50
> 
> ## assignment of whole columns
> tmp3[,1] <- c(1:10*100.0)
> tmp3[,1:2] <- tmp3[,1:2]*100
> tmp3[,1:2] <- tmp3[,2:1]
> tmp3[,1:2]
      [,1]  [,2]
 [1,] 1100 1e+04
 [2,] 1200 2e+04
 [3,] 1300 3e+04
 [4,] 1400 4e+04
 [5,] 1500 5e+04
 [6,] 1600 6e+04
 [7,] 1700 7e+04
 [8,] 1800 8e+04
 [9,] 1900 9e+04
[10,] 2000 1e+05
> 
> 
> tmp3[,-1] <- tmp3[,1:9]
> tmp3[,1:10]
      [,1] [,2]  [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,] 1100 1100 1e+04   21   31   41   51   61   71    81
 [2,] 1200 1200 2e+04   22   32   42   52   62   72    82
 [3,] 1300 1300 3e+04   23   33   43   53   63   73    83
 [4,] 1400 1400 4e+04   24   34   44   54   64   74    84
 [5,] 1500 1500 5e+04   25   35   45   55   65   75    85
 [6,] 1600 1600 6e+04   26   36   46   56   66   76    86
 [7,] 1700 1700 7e+04   27   37   47   57   67   77    87
 [8,] 1800 1800 8e+04   28   38   48   58   68   78    88
 [9,] 1900 1900 9e+04   29   39   49   59   69   79    89
[10,] 2000 2000 1e+05   30   40   50   60   70   80    90
> 
> tmp3[,1:2] <- rep(1,10)
> tmp3[,1:2] <- rep(1,20)
> tmp3[,1:2] <- matrix(c(1:5),1,5)
> 
> tmp3[,-c(1:8)] <- matrix(c(1:5),1,5)
> 
> tmp3[1,] <- 1:10
> tmp3[1,]
     [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,]    1    2    3    4    5    6    7    8    9    10
> tmp3[-1,] <- c(1,2)
> tmp3[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    1    2    3    4    5    6    7    8    9    10
 [2,]    1    2    1    2    1    2    1    2    1     2
 [3,]    2    1    2    1    2    1    2    1    2     1
 [4,]    1    2    1    2    1    2    1    2    1     2
 [5,]    2    1    2    1    2    1    2    1    2     1
 [6,]    1    2    1    2    1    2    1    2    1     2
 [7,]    2    1    2    1    2    1    2    1    2     1
 [8,]    1    2    1    2    1    2    1    2    1     2
 [9,]    2    1    2    1    2    1    2    1    2     1
[10,]    1    2    1    2    1    2    1    2    1     2
> tmp3[-c(1:8),] <- matrix(c(1:5),1,5)
> tmp3[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    1    2    3    4    5    6    7    8    9    10
 [2,]    1    2    1    2    1    2    1    2    1     2
 [3,]    2    1    2    1    2    1    2    1    2     1
 [4,]    1    2    1    2    1    2    1    2    1     2
 [5,]    2    1    2    1    2    1    2    1    2     1
 [6,]    1    2    1    2    1    2    1    2    1     2
 [7,]    2    1    2    1    2    1    2    1    2     1
 [8,]    1    2    1    2    1    2    1    2    1     2
 [9,]    1    3    5    2    4    1    3    5    2     4
[10,]    2    4    1    3    5    2    4    1    3     5
> 
> 
> tmp3[1:2,1:2] <- 5555.04
> tmp3[-(1:2),1:2] <- 1234.56789
> 
> 
> 
> ## testing accessors for the directory and prefix
> directory(tmp3)
[1] "/Users/biocbuild/bbs-3.18-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 460384 24.6     992698 53.1         NA   645368 34.5
Vcells 848931  6.5    8388608 64.0      65536  2019930 15.5
> 
> 
> 
> 
> ##
> ## checking reads
> ##
> 
> tmp2 <- createBufferedMatrix(10,20)
> 
> test.sample <- rnorm(10*20)
> 
> tmp2[1:10,1:20] <- test.sample
> 
> test.matrix <- matrix(test.sample,10,20)
> 
> ## testing reads
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   which.col <- sample(1:20,1)
+   if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> date()
[1] "Tue Mar 26 00:01:52 2024"
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> date()
[1] "Tue Mar 26 00:01:53 2024"
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,which.col] == test.matrix[which.row,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> 
> 
> RowMode(tmp2)
<pointer: 0x6000016e4060>
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   which.col <- sample(1:20,1)
+   if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,5,replace=TRUE)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> date()
[1] "Tue Mar 26 00:01:59 2024"
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col <- sample(1:20,5,replace=TRUE)
+   if (!all(tmp2[which.row,which.col] == test.matrix[which.row,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> date()
[1] "Tue Mar 26 00:02:01 2024"
> 
> ColMode(tmp2)
<pointer: 0x6000016e4060>
> 
> 
> 
> ### Now testing assignments
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+ 
+   new.data <- rnorm(20)
+   tmp2[which.row,] <- new.data
+   test.matrix[which.row,] <- new.data
+   if (rep > 1){
+     if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+   
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   new.data <- rnorm(10)
+   tmp2[,which.col] <- new.data
+   test.matrix[,which.col]<- new.data
+ 
+   if (rep > 1){
+     if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.col <- which.col
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,5,replace=TRUE)
+   new.data <- matrix(rnorm(50),5,10)
+   tmp2[,which.col] <- new.data
+   test.matrix[,which.col]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.col <- which.col
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   new.data <- matrix(rnorm(50),5,10)
+   tmp2[which.row,] <- new.data
+   test.matrix[which.row,]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col  <- sample(1:20,5,replace=TRUE)
+   new.data <- matrix(rnorm(25),5,5)
+   tmp2[which.row,which.col] <- new.data
+   test.matrix[which.row,which.col]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[prev.row,prev.col] == test.matrix[prev.row,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+   prev.col <- which.col
+ }
> 
> 
> 
> 
> ###
> ###
> ### testing some more functions
> ###
> 
> 
> 
> ## duplication function
> tmp5 <- duplicate(tmp2)
> 
> # making sure really did copy everything.
> tmp5[1,1] <- tmp5[1,1] +100.00
> 
> if (tmp5[1,1] == tmp2[1,1]){
+   stop("Problem with duplication")
+ }
> 
> 
> 
> 
> ### testing elementwise applying of functions
> 
> tmp5[1:4,1:4]
            [,1]       [,2]       [,3]       [,4]
[1,] 100.0174450 -0.5431656  0.0406617  1.0945323
[2,]  -0.4137801  1.4444943  0.4162762 -0.4039193
[3,]   1.1643481  0.6752384 -0.1552309  1.3254312
[4,]  -0.9264180 -0.6963723 -0.4487477 -0.8277042
> ewApply(tmp5,abs)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.18-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
            [,1]      [,2]      [,3]      [,4]
[1,] 100.0174450 0.5431656 0.0406617 1.0945323
[2,]   0.4137801 1.4444943 0.4162762 0.4039193
[3,]   1.1643481 0.6752384 0.1552309 1.3254312
[4,]   0.9264180 0.6963723 0.4487477 0.8277042
> ewApply(tmp5,sqrt)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.18-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
           [,1]      [,2]      [,3]      [,4]
[1,] 10.0008722 0.7369977 0.2016475 1.0461990
[2,]  0.6432574 1.2018712 0.6451947 0.6355465
[3,]  1.0790496 0.8217289 0.3939936 1.1512737
[4,]  0.9625061 0.8344893 0.6698863 0.9097825
> 
> 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.18-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
          [,1]     [,2]     [,3]     [,4]
[1,] 225.02617 32.91314 27.05714 36.55652
[2,]  31.84635 38.46321 31.86822 31.75938
[3,]  36.95484 33.89253 29.09517 37.83817
[4,]  35.55148 34.04126 32.14761 34.92553
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x6000016dc000>
> exp(tmp5)
<pointer: 0x6000016dc000>
> log(tmp5,2)
<pointer: 0x6000016dc000>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 468.3625
> Min(tmp5)
[1] 53.73938
> mean(tmp5)
[1] 72.52415
> Sum(tmp5)
[1] 14504.83
> Var(tmp5)
[1] 854.7663
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 91.05208 71.12366 69.88143 70.55629 71.97074 69.63803 72.08858 69.69292
 [9] 66.68017 72.55765
> rowSums(tmp5)
 [1] 1821.042 1422.473 1397.629 1411.126 1439.415 1392.761 1441.772 1393.858
 [9] 1333.603 1451.153
> rowVars(tmp5)
 [1] 7957.16759   60.26324   57.65744   36.25322   46.78498   87.90281
 [7]   61.69199   42.38903   57.77083  116.14851
> rowSd(tmp5)
 [1] 89.202957  7.762940  7.593250  6.021065  6.839954  9.375650  7.854425
 [8]  6.510686  7.600713 10.777222
> rowMax(tmp5)
 [1] 468.36248  83.61704  79.97881  87.29525  82.22996  85.05383  86.28524
 [8]  82.30783  80.61361  92.70935
> rowMin(tmp5)
 [1] 54.31929 57.76450 57.06232 62.26828 57.35537 54.99151 55.75788 61.97966
 [9] 55.05964 53.73938
> 
> colMeans(tmp5)
 [1] 112.98271  73.28591  66.30122  69.83501  66.17339  70.90315  65.06329
 [8]  68.61149  74.83686  72.34925  71.18332  66.52455  69.43289  74.92968
[15]  72.20884  69.20186  72.12593  72.93241  71.93359  69.66773
> colSums(tmp5)
 [1] 1129.8271  732.8591  663.0122  698.3501  661.7339  709.0315  650.6329
 [8]  686.1149  748.3686  723.4925  711.8332  665.2455  694.3289  749.2968
[15]  722.0884  692.0186  721.2593  729.3241  719.3359  696.6773
> colVars(tmp5)
 [1] 15669.62925    20.88948    26.97941    38.74387    72.97355    39.28042
 [7]    56.53988    78.03332    75.64308   100.58072    58.85072    51.94516
[13]    80.54724    48.70484    75.32426    88.05434    37.94983    88.67273
[19]    42.24739    63.96604
> colSd(tmp5)
 [1] 125.178390   4.570501   5.194171   6.224457   8.542456   6.267409
 [7]   7.519301   8.833647   8.697303  10.028994   7.671423   7.207299
[13]   8.974812   6.978885   8.678955   9.383727   6.160344   9.416620
[19]   6.499799   7.997878
> colMax(tmp5)
 [1] 468.36248  82.15349  73.77844  78.75519  78.20405  80.98730  80.52019
 [8]  80.23642  87.29525  92.70935  82.23233  77.57462  82.30783  85.00175
[15]  83.61704  86.24176  81.77472  89.88932  84.10177  79.60418
> colMin(tmp5)
 [1] 55.95729 68.50439 56.31588 56.91612 54.99151 63.38688 55.45678 53.73938
 [9] 58.51548 57.35537 57.98956 55.05964 56.95408 61.13560 56.31440 57.76450
[17] 63.44922 61.18560 61.97966 54.31929
> 
> 
> ### setting a random element to NA and then testing with na.rm=TRUE or na.rm=FALSE (The default)
> 
> 
> which.row <- sample(1:10,1,replace=TRUE)
> which.col  <- sample(1:20,1,replace=TRUE)
> 
> tmp5[which.row,which.col] <- NA
> 
> Max(tmp5)
[1] NA
> Min(tmp5)
[1] NA
> mean(tmp5)
[1] NA
> Sum(tmp5)
[1] NA
> Var(tmp5)
[1] NA
> 
> rowMeans(tmp5)
 [1] 91.05208 71.12366       NA 70.55629 71.97074 69.63803 72.08858 69.69292
 [9] 66.68017 72.55765
> rowSums(tmp5)
 [1] 1821.042 1422.473       NA 1411.126 1439.415 1392.761 1441.772 1393.858
 [9] 1333.603 1451.153
> rowVars(tmp5)
 [1] 7957.16759   60.26324   56.65205   36.25322   46.78498   87.90281
 [7]   61.69199   42.38903   57.77083  116.14851
> rowSd(tmp5)
 [1] 89.202957  7.762940  7.526755  6.021065  6.839954  9.375650  7.854425
 [8]  6.510686  7.600713 10.777222
> rowMax(tmp5)
 [1] 468.36248  83.61704        NA  87.29525  82.22996  85.05383  86.28524
 [8]  82.30783  80.61361  92.70935
> rowMin(tmp5)
 [1] 54.31929 57.76450       NA 62.26828 57.35537 54.99151 55.75788 61.97966
 [9] 55.05964 53.73938
> 
> colMeans(tmp5)
 [1] 112.98271  73.28591  66.30122  69.83501  66.17339  70.90315  65.06329
 [8]  68.61149  74.83686  72.34925  71.18332  66.52455  69.43289  74.92968
[15]        NA  69.20186  72.12593  72.93241  71.93359  69.66773
> colSums(tmp5)
 [1] 1129.8271  732.8591  663.0122  698.3501  661.7339  709.0315  650.6329
 [8]  686.1149  748.3686  723.4925  711.8332  665.2455  694.3289  749.2968
[15]        NA  692.0186  721.2593  729.3241  719.3359  696.6773
> colVars(tmp5)
 [1] 15669.62925    20.88948    26.97941    38.74387    72.97355    39.28042
 [7]    56.53988    78.03332    75.64308   100.58072    58.85072    51.94516
[13]    80.54724    48.70484          NA    88.05434    37.94983    88.67273
[19]    42.24739    63.96604
> colSd(tmp5)
 [1] 125.178390   4.570501   5.194171   6.224457   8.542456   6.267409
 [7]   7.519301   8.833647   8.697303  10.028994   7.671423   7.207299
[13]   8.974812   6.978885         NA   9.383727   6.160344   9.416620
[19]   6.499799   7.997878
> colMax(tmp5)
 [1] 468.36248  82.15349  73.77844  78.75519  78.20405  80.98730  80.52019
 [8]  80.23642  87.29525  92.70935  82.23233  77.57462  82.30783  85.00175
[15]        NA  86.24176  81.77472  89.88932  84.10177  79.60418
> colMin(tmp5)
 [1] 55.95729 68.50439 56.31588 56.91612 54.99151 63.38688 55.45678 53.73938
 [9] 58.51548 57.35537 57.98956 55.05964 56.95408 61.13560       NA 57.76450
[17] 63.44922 61.18560 61.97966 54.31929
> 
> Max(tmp5,na.rm=TRUE)
[1] 468.3625
> Min(tmp5,na.rm=TRUE)
[1] 53.73938
> mean(tmp5,na.rm=TRUE)
[1] 72.4948
> Sum(tmp5,na.rm=TRUE)
[1] 14426.47
> Var(tmp5,na.rm=TRUE)
[1] 858.9102
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 91.05208 71.12366 69.43493 70.55629 71.97074 69.63803 72.08858 69.69292
 [9] 66.68017 72.55765
> rowSums(tmp5,na.rm=TRUE)
 [1] 1821.042 1422.473 1319.264 1411.126 1439.415 1392.761 1441.772 1393.858
 [9] 1333.603 1451.153
> rowVars(tmp5,na.rm=TRUE)
 [1] 7957.16759   60.26324   56.65205   36.25322   46.78498   87.90281
 [7]   61.69199   42.38903   57.77083  116.14851
> rowSd(tmp5,na.rm=TRUE)
 [1] 89.202957  7.762940  7.526755  6.021065  6.839954  9.375650  7.854425
 [8]  6.510686  7.600713 10.777222
> rowMax(tmp5,na.rm=TRUE)
 [1] 468.36248  83.61704  79.97881  87.29525  82.22996  85.05383  86.28524
 [8]  82.30783  80.61361  92.70935
> rowMin(tmp5,na.rm=TRUE)
 [1] 54.31929 57.76450 57.06232 62.26828 57.35537 54.99151 55.75788 61.97966
 [9] 55.05964 53.73938
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 112.98271  73.28591  66.30122  69.83501  66.17339  70.90315  65.06329
 [8]  68.61149  74.83686  72.34925  71.18332  66.52455  69.43289  74.92968
[15]  71.52485  69.20186  72.12593  72.93241  71.93359  69.66773
> colSums(tmp5,na.rm=TRUE)
 [1] 1129.8271  732.8591  663.0122  698.3501  661.7339  709.0315  650.6329
 [8]  686.1149  748.3686  723.4925  711.8332  665.2455  694.3289  749.2968
[15]  643.7237  692.0186  721.2593  729.3241  719.3359  696.6773
> colVars(tmp5,na.rm=TRUE)
 [1] 15669.62925    20.88948    26.97941    38.74387    72.97355    39.28042
 [7]    56.53988    78.03332    75.64308   100.58072    58.85072    51.94516
[13]    80.54724    48.70484    79.47656    88.05434    37.94983    88.67273
[19]    42.24739    63.96604
> colSd(tmp5,na.rm=TRUE)
 [1] 125.178390   4.570501   5.194171   6.224457   8.542456   6.267409
 [7]   7.519301   8.833647   8.697303  10.028994   7.671423   7.207299
[13]   8.974812   6.978885   8.914963   9.383727   6.160344   9.416620
[19]   6.499799   7.997878
> colMax(tmp5,na.rm=TRUE)
 [1] 468.36248  82.15349  73.77844  78.75519  78.20405  80.98730  80.52019
 [8]  80.23642  87.29525  92.70935  82.23233  77.57462  82.30783  85.00175
[15]  83.61704  86.24176  81.77472  89.88932  84.10177  79.60418
> colMin(tmp5,na.rm=TRUE)
 [1] 55.95729 68.50439 56.31588 56.91612 54.99151 63.38688 55.45678 53.73938
 [9] 58.51548 57.35537 57.98956 55.05964 56.95408 61.13560 56.31440 57.76450
[17] 63.44922 61.18560 61.97966 54.31929
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1] 91.05208 71.12366      NaN 70.55629 71.97074 69.63803 72.08858 69.69292
 [9] 66.68017 72.55765
> rowSums(tmp5,na.rm=TRUE)
 [1] 1821.042 1422.473    0.000 1411.126 1439.415 1392.761 1441.772 1393.858
 [9] 1333.603 1451.153
> rowVars(tmp5,na.rm=TRUE)
 [1] 7957.16759   60.26324         NA   36.25322   46.78498   87.90281
 [7]   61.69199   42.38903   57.77083  116.14851
> rowSd(tmp5,na.rm=TRUE)
 [1] 89.202957  7.762940        NA  6.021065  6.839954  9.375650  7.854425
 [8]  6.510686  7.600713 10.777222
> rowMax(tmp5,na.rm=TRUE)
 [1] 468.36248  83.61704        NA  87.29525  82.22996  85.05383  86.28524
 [8]  82.30783  80.61361  92.70935
> rowMin(tmp5,na.rm=TRUE)
 [1] 54.31929 57.76450       NA 62.26828 57.35537 54.99151 55.75788 61.97966
 [9] 55.05964 53.73938
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1] 116.99005  73.59069  66.93938  68.84388  66.78858  71.43079  65.95229
 [8]  68.42442  75.35050  72.57409  70.24418  67.01279  70.39081  74.36866
[15]       NaN  70.05482  72.73662  73.05433  71.27985  68.80423
> colSums(tmp5,na.rm=TRUE)
 [1] 1052.9105  662.3162  602.4544  619.5949  601.0972  642.8771  593.5706
 [8]  615.8197  678.1545  653.1668  632.1976  603.1151  633.5173  669.3179
[15]    0.0000  630.4934  654.6296  657.4890  641.5186  619.2380
> colVars(tmp5,na.rm=TRUE)
 [1] 17447.67183    22.45562    25.77029    32.53552    77.83762    41.05844
 [7]    54.71631    87.39378    82.13036   112.58460    56.28486    55.75665
[13]    80.29251    51.25213          NA    90.87626    38.49797    99.58957
[19]    42.72032    63.57333
> colSd(tmp5,na.rm=TRUE)
 [1] 132.089636   4.738736   5.076445   5.703992   8.822563   6.407686
 [7]   7.397048   9.348464   9.062580  10.610589   7.502324   7.467038
[13]   8.960609   7.159060         NA   9.532904   6.204673   9.979458
[19]   6.536078   7.973289
> colMax(tmp5,na.rm=TRUE)
 [1] 468.36248  82.15349  73.77844  76.08761  78.20405  80.98730  80.52019
 [8]  80.23642  87.29525  92.70935  82.23233  77.57462  82.30783  85.00175
[15]      -Inf  86.24176  81.77472  89.88932  84.10177  79.60418
> colMin(tmp5,na.rm=TRUE)
 [1] 55.95729 68.50439 56.31588 56.91612 54.99151 63.38688 55.45678 53.73938
 [9] 58.51548 57.35537 57.98956 55.05964 56.95408 61.13560      Inf 57.76450
[17] 63.44922 61.18560 61.97966 54.31929
> 
> 
> 
> 
> 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] 145.1777 265.6719 307.1407 147.2226 196.1074 301.4243 131.7739 248.9258
 [9] 254.9522 191.5930
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 145.1777 265.6719 307.1407 147.2226 196.1074 301.4243 131.7739 248.9258
 [9] 254.9522 191.5930
> 
> 
> 
> 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]  0.000000e+00  2.842171e-14 -5.684342e-14  0.000000e+00  2.842171e-14
 [6] -1.136868e-13 -1.136868e-13 -5.684342e-14 -2.273737e-13 -8.526513e-14
[11]  0.000000e+00  1.136868e-13  5.684342e-14 -1.705303e-13 -1.989520e-13
[16]  1.136868e-13 -1.136868e-13  2.273737e-13  0.000000e+00 -1.421085e-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   8 
8   4 
2   11 
3   3 
10   19 
8   15 
2   10 
6   1 
8   13 
10   6 
5   18 
7   5 
5   15 
10   18 
10   8 
8   2 
1   18 
2   18 
2   5 
7   17 
There were 50 or more warnings (use warnings() to see the first 50)
> 
> 
> ### now test 1 by n and n by 1 matrix
> 
> 
> err.tol <- 1e-12
> 
> rm(tmp5)
> 
> dataset1 <- rnorm(100)
> dataset2 <- rnorm(100)
> 
> tmp <- createBufferedMatrix(1,100)
> tmp[1,] <- dataset1
> 
> tmp2 <- createBufferedMatrix(100,1)
> tmp2[,1] <- dataset2
> 
> 
> 
> 
> 
> Max(tmp)
[1] 3.096452
> Min(tmp)
[1] -2.102984
> mean(tmp)
[1] 0.01939373
> Sum(tmp)
[1] 1.939373
> Var(tmp)
[1] 0.821262
> 
> rowMeans(tmp)
[1] 0.01939373
> rowSums(tmp)
[1] 1.939373
> rowVars(tmp)
[1] 0.821262
> rowSd(tmp)
[1] 0.9062351
> rowMax(tmp)
[1] 3.096452
> rowMin(tmp)
[1] -2.102984
> 
> colMeans(tmp)
  [1] -0.85421973  0.36522054 -1.52492747 -0.50229119  0.06133893 -0.87444161
  [7] -0.08418636  1.28042547 -0.38915450 -0.32213216  0.69378742  0.40156351
 [13] -0.59410992  1.45231252 -0.06700397  0.80327094  0.27320670  0.69780549
 [19]  0.30817888 -0.08475854  1.24235363 -0.82624344  0.46284594 -0.16119732
 [25] -1.30524238 -0.58831893  0.84063367  1.50797682  0.47589888 -0.71493641
 [31] -1.22700800 -0.31055006  0.32703876  0.79588313 -1.13684480 -1.25344599
 [37] -1.46613641  0.10454536 -2.10298401  1.35143019 -0.38506747 -0.48799343
 [43]  0.19983286  0.42926673 -1.47582202  0.52797302 -0.31508124 -1.31517165
 [49]  0.81585355  0.38049323  0.39521122 -1.07862727  0.15701753 -0.05116317
 [55] -1.28150099 -0.23271904  0.10574782 -0.24511438 -0.79777264 -0.15979081
 [61] -0.05390469 -0.58053050  1.08387946 -0.16433127  0.08730571 -0.65998950
 [67] -0.38038846 -1.83346007  0.69072308  0.72520756  0.36145104  3.09645178
 [73] -1.73027498 -0.29465292  0.72876635  0.23261552 -0.31723349  1.30304174
 [79]  1.13602889 -0.17002453  2.16161809 -0.23201721 -0.02477048  0.62124110
 [85]  1.20612448 -0.31296971 -0.40282430 -0.19220113  1.85224940  0.13011594
 [91] -0.74402777 -0.70103237  0.70742701 -1.05521131  1.12988783  0.88316072
 [97] -0.08426407  0.55715201  1.05970922 -0.12183071
> colSums(tmp)
  [1] -0.85421973  0.36522054 -1.52492747 -0.50229119  0.06133893 -0.87444161
  [7] -0.08418636  1.28042547 -0.38915450 -0.32213216  0.69378742  0.40156351
 [13] -0.59410992  1.45231252 -0.06700397  0.80327094  0.27320670  0.69780549
 [19]  0.30817888 -0.08475854  1.24235363 -0.82624344  0.46284594 -0.16119732
 [25] -1.30524238 -0.58831893  0.84063367  1.50797682  0.47589888 -0.71493641
 [31] -1.22700800 -0.31055006  0.32703876  0.79588313 -1.13684480 -1.25344599
 [37] -1.46613641  0.10454536 -2.10298401  1.35143019 -0.38506747 -0.48799343
 [43]  0.19983286  0.42926673 -1.47582202  0.52797302 -0.31508124 -1.31517165
 [49]  0.81585355  0.38049323  0.39521122 -1.07862727  0.15701753 -0.05116317
 [55] -1.28150099 -0.23271904  0.10574782 -0.24511438 -0.79777264 -0.15979081
 [61] -0.05390469 -0.58053050  1.08387946 -0.16433127  0.08730571 -0.65998950
 [67] -0.38038846 -1.83346007  0.69072308  0.72520756  0.36145104  3.09645178
 [73] -1.73027498 -0.29465292  0.72876635  0.23261552 -0.31723349  1.30304174
 [79]  1.13602889 -0.17002453  2.16161809 -0.23201721 -0.02477048  0.62124110
 [85]  1.20612448 -0.31296971 -0.40282430 -0.19220113  1.85224940  0.13011594
 [91] -0.74402777 -0.70103237  0.70742701 -1.05521131  1.12988783  0.88316072
 [97] -0.08426407  0.55715201  1.05970922 -0.12183071
> 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.85421973  0.36522054 -1.52492747 -0.50229119  0.06133893 -0.87444161
  [7] -0.08418636  1.28042547 -0.38915450 -0.32213216  0.69378742  0.40156351
 [13] -0.59410992  1.45231252 -0.06700397  0.80327094  0.27320670  0.69780549
 [19]  0.30817888 -0.08475854  1.24235363 -0.82624344  0.46284594 -0.16119732
 [25] -1.30524238 -0.58831893  0.84063367  1.50797682  0.47589888 -0.71493641
 [31] -1.22700800 -0.31055006  0.32703876  0.79588313 -1.13684480 -1.25344599
 [37] -1.46613641  0.10454536 -2.10298401  1.35143019 -0.38506747 -0.48799343
 [43]  0.19983286  0.42926673 -1.47582202  0.52797302 -0.31508124 -1.31517165
 [49]  0.81585355  0.38049323  0.39521122 -1.07862727  0.15701753 -0.05116317
 [55] -1.28150099 -0.23271904  0.10574782 -0.24511438 -0.79777264 -0.15979081
 [61] -0.05390469 -0.58053050  1.08387946 -0.16433127  0.08730571 -0.65998950
 [67] -0.38038846 -1.83346007  0.69072308  0.72520756  0.36145104  3.09645178
 [73] -1.73027498 -0.29465292  0.72876635  0.23261552 -0.31723349  1.30304174
 [79]  1.13602889 -0.17002453  2.16161809 -0.23201721 -0.02477048  0.62124110
 [85]  1.20612448 -0.31296971 -0.40282430 -0.19220113  1.85224940  0.13011594
 [91] -0.74402777 -0.70103237  0.70742701 -1.05521131  1.12988783  0.88316072
 [97] -0.08426407  0.55715201  1.05970922 -0.12183071
> colMin(tmp)
  [1] -0.85421973  0.36522054 -1.52492747 -0.50229119  0.06133893 -0.87444161
  [7] -0.08418636  1.28042547 -0.38915450 -0.32213216  0.69378742  0.40156351
 [13] -0.59410992  1.45231252 -0.06700397  0.80327094  0.27320670  0.69780549
 [19]  0.30817888 -0.08475854  1.24235363 -0.82624344  0.46284594 -0.16119732
 [25] -1.30524238 -0.58831893  0.84063367  1.50797682  0.47589888 -0.71493641
 [31] -1.22700800 -0.31055006  0.32703876  0.79588313 -1.13684480 -1.25344599
 [37] -1.46613641  0.10454536 -2.10298401  1.35143019 -0.38506747 -0.48799343
 [43]  0.19983286  0.42926673 -1.47582202  0.52797302 -0.31508124 -1.31517165
 [49]  0.81585355  0.38049323  0.39521122 -1.07862727  0.15701753 -0.05116317
 [55] -1.28150099 -0.23271904  0.10574782 -0.24511438 -0.79777264 -0.15979081
 [61] -0.05390469 -0.58053050  1.08387946 -0.16433127  0.08730571 -0.65998950
 [67] -0.38038846 -1.83346007  0.69072308  0.72520756  0.36145104  3.09645178
 [73] -1.73027498 -0.29465292  0.72876635  0.23261552 -0.31723349  1.30304174
 [79]  1.13602889 -0.17002453  2.16161809 -0.23201721 -0.02477048  0.62124110
 [85]  1.20612448 -0.31296971 -0.40282430 -0.19220113  1.85224940  0.13011594
 [91] -0.74402777 -0.70103237  0.70742701 -1.05521131  1.12988783  0.88316072
 [97] -0.08426407  0.55715201  1.05970922 -0.12183071
> colMedians(tmp)
  [1] -0.85421973  0.36522054 -1.52492747 -0.50229119  0.06133893 -0.87444161
  [7] -0.08418636  1.28042547 -0.38915450 -0.32213216  0.69378742  0.40156351
 [13] -0.59410992  1.45231252 -0.06700397  0.80327094  0.27320670  0.69780549
 [19]  0.30817888 -0.08475854  1.24235363 -0.82624344  0.46284594 -0.16119732
 [25] -1.30524238 -0.58831893  0.84063367  1.50797682  0.47589888 -0.71493641
 [31] -1.22700800 -0.31055006  0.32703876  0.79588313 -1.13684480 -1.25344599
 [37] -1.46613641  0.10454536 -2.10298401  1.35143019 -0.38506747 -0.48799343
 [43]  0.19983286  0.42926673 -1.47582202  0.52797302 -0.31508124 -1.31517165
 [49]  0.81585355  0.38049323  0.39521122 -1.07862727  0.15701753 -0.05116317
 [55] -1.28150099 -0.23271904  0.10574782 -0.24511438 -0.79777264 -0.15979081
 [61] -0.05390469 -0.58053050  1.08387946 -0.16433127  0.08730571 -0.65998950
 [67] -0.38038846 -1.83346007  0.69072308  0.72520756  0.36145104  3.09645178
 [73] -1.73027498 -0.29465292  0.72876635  0.23261552 -0.31723349  1.30304174
 [79]  1.13602889 -0.17002453  2.16161809 -0.23201721 -0.02477048  0.62124110
 [85]  1.20612448 -0.31296971 -0.40282430 -0.19220113  1.85224940  0.13011594
 [91] -0.74402777 -0.70103237  0.70742701 -1.05521131  1.12988783  0.88316072
 [97] -0.08426407  0.55715201  1.05970922 -0.12183071
> colRanges(tmp)
           [,1]      [,2]      [,3]       [,4]       [,5]       [,6]
[1,] -0.8542197 0.3652205 -1.524927 -0.5022912 0.06133893 -0.8744416
[2,] -0.8542197 0.3652205 -1.524927 -0.5022912 0.06133893 -0.8744416
            [,7]     [,8]       [,9]      [,10]     [,11]     [,12]      [,13]
[1,] -0.08418636 1.280425 -0.3891545 -0.3221322 0.6937874 0.4015635 -0.5941099
[2,] -0.08418636 1.280425 -0.3891545 -0.3221322 0.6937874 0.4015635 -0.5941099
        [,14]       [,15]     [,16]     [,17]     [,18]     [,19]       [,20]
[1,] 1.452313 -0.06700397 0.8032709 0.2732067 0.6978055 0.3081789 -0.08475854
[2,] 1.452313 -0.06700397 0.8032709 0.2732067 0.6978055 0.3081789 -0.08475854
        [,21]      [,22]     [,23]      [,24]     [,25]      [,26]     [,27]
[1,] 1.242354 -0.8262434 0.4628459 -0.1611973 -1.305242 -0.5883189 0.8406337
[2,] 1.242354 -0.8262434 0.4628459 -0.1611973 -1.305242 -0.5883189 0.8406337
        [,28]     [,29]      [,30]     [,31]      [,32]     [,33]     [,34]
[1,] 1.507977 0.4758989 -0.7149364 -1.227008 -0.3105501 0.3270388 0.7958831
[2,] 1.507977 0.4758989 -0.7149364 -1.227008 -0.3105501 0.3270388 0.7958831
         [,35]     [,36]     [,37]     [,38]     [,39]   [,40]      [,41]
[1,] -1.136845 -1.253446 -1.466136 0.1045454 -2.102984 1.35143 -0.3850675
[2,] -1.136845 -1.253446 -1.466136 0.1045454 -2.102984 1.35143 -0.3850675
          [,42]     [,43]     [,44]     [,45]    [,46]      [,47]     [,48]
[1,] -0.4879934 0.1998329 0.4292667 -1.475822 0.527973 -0.3150812 -1.315172
[2,] -0.4879934 0.1998329 0.4292667 -1.475822 0.527973 -0.3150812 -1.315172
         [,49]     [,50]     [,51]     [,52]     [,53]       [,54]     [,55]
[1,] 0.8158536 0.3804932 0.3952112 -1.078627 0.1570175 -0.05116317 -1.281501
[2,] 0.8158536 0.3804932 0.3952112 -1.078627 0.1570175 -0.05116317 -1.281501
         [,56]     [,57]      [,58]      [,59]      [,60]       [,61]
[1,] -0.232719 0.1057478 -0.2451144 -0.7977726 -0.1597908 -0.05390469
[2,] -0.232719 0.1057478 -0.2451144 -0.7977726 -0.1597908 -0.05390469
          [,62]    [,63]      [,64]      [,65]      [,66]      [,67]    [,68]
[1,] -0.5805305 1.083879 -0.1643313 0.08730571 -0.6599895 -0.3803885 -1.83346
[2,] -0.5805305 1.083879 -0.1643313 0.08730571 -0.6599895 -0.3803885 -1.83346
         [,69]     [,70]    [,71]    [,72]     [,73]      [,74]     [,75]
[1,] 0.6907231 0.7252076 0.361451 3.096452 -1.730275 -0.2946529 0.7287663
[2,] 0.6907231 0.7252076 0.361451 3.096452 -1.730275 -0.2946529 0.7287663
         [,76]      [,77]    [,78]    [,79]      [,80]    [,81]      [,82]
[1,] 0.2326155 -0.3172335 1.303042 1.136029 -0.1700245 2.161618 -0.2320172
[2,] 0.2326155 -0.3172335 1.303042 1.136029 -0.1700245 2.161618 -0.2320172
           [,83]     [,84]    [,85]      [,86]      [,87]      [,88]    [,89]
[1,] -0.02477048 0.6212411 1.206124 -0.3129697 -0.4028243 -0.1922011 1.852249
[2,] -0.02477048 0.6212411 1.206124 -0.3129697 -0.4028243 -0.1922011 1.852249
         [,90]      [,91]      [,92]    [,93]     [,94]    [,95]     [,96]
[1,] 0.1301159 -0.7440278 -0.7010324 0.707427 -1.055211 1.129888 0.8831607
[2,] 0.1301159 -0.7440278 -0.7010324 0.707427 -1.055211 1.129888 0.8831607
           [,97]    [,98]    [,99]     [,100]
[1,] -0.08426407 0.557152 1.059709 -0.1218307
[2,] -0.08426407 0.557152 1.059709 -0.1218307
> 
> 
> Max(tmp2)
[1] 3.373632
> Min(tmp2)
[1] -2.543692
> mean(tmp2)
[1] -0.02427928
> Sum(tmp2)
[1] -2.427928
> Var(tmp2)
[1] 1.140093
> 
> rowMeans(tmp2)
  [1]  0.90361693 -0.94031865  1.28934719 -0.65552550  0.59607614 -0.58522074
  [7] -2.00673118  1.10803962 -0.03525143  0.77204494 -0.73672396  2.02016208
 [13]  0.24444284 -0.70287234  1.41395347  0.02826654  0.23084137 -0.86784446
 [19]  0.51226678  0.21900663  0.24145210  1.33752656  0.33277251 -0.41143641
 [25] -0.94100462  0.43758445 -0.58104862 -0.34206579 -1.61093478 -1.07156700
 [31]  0.85967564 -2.54369168 -0.15165089  2.14743478  1.11102867  1.04277834
 [37] -1.45899640 -1.38986115 -0.24655295 -1.17291747 -0.13930663  0.42399602
 [43] -0.13043419  2.17484679  1.25946545 -0.38831434  0.57992199  0.73875764
 [49]  0.42104980 -0.76630187 -0.66628586  0.11298271 -1.41056728 -0.34106464
 [55] -0.08160545 -1.53337985 -2.00427662 -0.60926620 -0.53813004 -1.51108836
 [61]  1.30241797 -0.98451318  1.70143080 -1.75664200 -0.86930297  0.12305004
 [67] -0.92256067 -0.11568154  3.37363232  0.69467237  0.91488799 -0.25626547
 [73]  0.37242114 -0.86950029 -0.04654069  0.43821952 -0.17477877 -1.23120613
 [79]  0.74887399 -0.93829424  0.52834455 -0.68710467  0.10855239  0.72743170
 [85]  0.29298161 -0.34580392 -0.20919224  1.14073300  1.06342262  0.52348403
 [91]  1.26539023 -0.61370563 -1.33971571  0.33973546 -0.19346977  0.29496723
 [97] -0.02902975 -1.34555515  2.47753408 -1.91834898
> rowSums(tmp2)
  [1]  0.90361693 -0.94031865  1.28934719 -0.65552550  0.59607614 -0.58522074
  [7] -2.00673118  1.10803962 -0.03525143  0.77204494 -0.73672396  2.02016208
 [13]  0.24444284 -0.70287234  1.41395347  0.02826654  0.23084137 -0.86784446
 [19]  0.51226678  0.21900663  0.24145210  1.33752656  0.33277251 -0.41143641
 [25] -0.94100462  0.43758445 -0.58104862 -0.34206579 -1.61093478 -1.07156700
 [31]  0.85967564 -2.54369168 -0.15165089  2.14743478  1.11102867  1.04277834
 [37] -1.45899640 -1.38986115 -0.24655295 -1.17291747 -0.13930663  0.42399602
 [43] -0.13043419  2.17484679  1.25946545 -0.38831434  0.57992199  0.73875764
 [49]  0.42104980 -0.76630187 -0.66628586  0.11298271 -1.41056728 -0.34106464
 [55] -0.08160545 -1.53337985 -2.00427662 -0.60926620 -0.53813004 -1.51108836
 [61]  1.30241797 -0.98451318  1.70143080 -1.75664200 -0.86930297  0.12305004
 [67] -0.92256067 -0.11568154  3.37363232  0.69467237  0.91488799 -0.25626547
 [73]  0.37242114 -0.86950029 -0.04654069  0.43821952 -0.17477877 -1.23120613
 [79]  0.74887399 -0.93829424  0.52834455 -0.68710467  0.10855239  0.72743170
 [85]  0.29298161 -0.34580392 -0.20919224  1.14073300  1.06342262  0.52348403
 [91]  1.26539023 -0.61370563 -1.33971571  0.33973546 -0.19346977  0.29496723
 [97] -0.02902975 -1.34555515  2.47753408 -1.91834898
> 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.90361693 -0.94031865  1.28934719 -0.65552550  0.59607614 -0.58522074
  [7] -2.00673118  1.10803962 -0.03525143  0.77204494 -0.73672396  2.02016208
 [13]  0.24444284 -0.70287234  1.41395347  0.02826654  0.23084137 -0.86784446
 [19]  0.51226678  0.21900663  0.24145210  1.33752656  0.33277251 -0.41143641
 [25] -0.94100462  0.43758445 -0.58104862 -0.34206579 -1.61093478 -1.07156700
 [31]  0.85967564 -2.54369168 -0.15165089  2.14743478  1.11102867  1.04277834
 [37] -1.45899640 -1.38986115 -0.24655295 -1.17291747 -0.13930663  0.42399602
 [43] -0.13043419  2.17484679  1.25946545 -0.38831434  0.57992199  0.73875764
 [49]  0.42104980 -0.76630187 -0.66628586  0.11298271 -1.41056728 -0.34106464
 [55] -0.08160545 -1.53337985 -2.00427662 -0.60926620 -0.53813004 -1.51108836
 [61]  1.30241797 -0.98451318  1.70143080 -1.75664200 -0.86930297  0.12305004
 [67] -0.92256067 -0.11568154  3.37363232  0.69467237  0.91488799 -0.25626547
 [73]  0.37242114 -0.86950029 -0.04654069  0.43821952 -0.17477877 -1.23120613
 [79]  0.74887399 -0.93829424  0.52834455 -0.68710467  0.10855239  0.72743170
 [85]  0.29298161 -0.34580392 -0.20919224  1.14073300  1.06342262  0.52348403
 [91]  1.26539023 -0.61370563 -1.33971571  0.33973546 -0.19346977  0.29496723
 [97] -0.02902975 -1.34555515  2.47753408 -1.91834898
> rowMin(tmp2)
  [1]  0.90361693 -0.94031865  1.28934719 -0.65552550  0.59607614 -0.58522074
  [7] -2.00673118  1.10803962 -0.03525143  0.77204494 -0.73672396  2.02016208
 [13]  0.24444284 -0.70287234  1.41395347  0.02826654  0.23084137 -0.86784446
 [19]  0.51226678  0.21900663  0.24145210  1.33752656  0.33277251 -0.41143641
 [25] -0.94100462  0.43758445 -0.58104862 -0.34206579 -1.61093478 -1.07156700
 [31]  0.85967564 -2.54369168 -0.15165089  2.14743478  1.11102867  1.04277834
 [37] -1.45899640 -1.38986115 -0.24655295 -1.17291747 -0.13930663  0.42399602
 [43] -0.13043419  2.17484679  1.25946545 -0.38831434  0.57992199  0.73875764
 [49]  0.42104980 -0.76630187 -0.66628586  0.11298271 -1.41056728 -0.34106464
 [55] -0.08160545 -1.53337985 -2.00427662 -0.60926620 -0.53813004 -1.51108836
 [61]  1.30241797 -0.98451318  1.70143080 -1.75664200 -0.86930297  0.12305004
 [67] -0.92256067 -0.11568154  3.37363232  0.69467237  0.91488799 -0.25626547
 [73]  0.37242114 -0.86950029 -0.04654069  0.43821952 -0.17477877 -1.23120613
 [79]  0.74887399 -0.93829424  0.52834455 -0.68710467  0.10855239  0.72743170
 [85]  0.29298161 -0.34580392 -0.20919224  1.14073300  1.06342262  0.52348403
 [91]  1.26539023 -0.61370563 -1.33971571  0.33973546 -0.19346977  0.29496723
 [97] -0.02902975 -1.34555515  2.47753408 -1.91834898
> 
> colMeans(tmp2)
[1] -0.02427928
> colSums(tmp2)
[1] -2.427928
> colVars(tmp2)
[1] 1.140093
> colSd(tmp2)
[1] 1.067751
> colMax(tmp2)
[1] 3.373632
> colMin(tmp2)
[1] -2.543692
> colMedians(tmp2)
[1] -0.06407307
> colRanges(tmp2)
          [,1]
[1,] -2.543692
[2,]  3.373632
> 
> 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]  6.1777632  0.7213149  1.0620458 -1.0342003  4.2436063  1.4132281
 [7]  1.1303146  4.7241747 -1.2672746 -1.4103628
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -1.0104294
[2,]  0.1078455
[3,]  0.7991580
[4,]  1.2116947
[5,]  1.7547156
> 
> rowApply(tmp,sum)
 [1]  1.374504343  1.745521368  0.130773935 -0.104802704 -1.899479163
 [6]  3.591345778  2.855841751  5.317370445  2.745398093  0.004136172
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    3    6    7    1   10   10    9    3   10     8
 [2,]    9    8    8    3    1    8    4    9    2     3
 [3,]    5    9    3    7    6    4    3    4    4     7
 [4,]    2    7    5    8    8    3    2    5    5     5
 [5,]    4   10   10    6    2    6    1   10    7     9
 [6,]   10    3    2    9    4    1   10    7    3     4
 [7,]    7    5    9   10    7    5    5    2    1     2
 [8,]    1    2    6    4    9    9    8    6    9    10
 [9,]    6    1    4    5    3    2    7    1    8     6
[10,]    8    4    1    2    5    7    6    8    6     1
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1]  2.9807964  3.0909795  2.3017125 -2.7796055 -1.3063045  2.4282981
 [7] -4.0084504 -1.2149918  0.8364889 -1.7503201  2.5229790  4.1653814
[13] -1.0792550 -0.2149982 -1.6906986  2.4075780  2.3059446 -0.1714387
[19]  0.5754640 -0.6644785
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -0.1917557
[2,]  0.3338775
[3,]  0.8258910
[4,]  0.9314750
[5,]  1.0813086
> 
> rowApply(tmp,sum)
[1] -2.8503597  3.5896504  3.1256982 -0.7639232  5.6340152
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]   15   16   14    9   15
[2,]   17   20   13   13    8
[3,]   11   10   17   12   11
[4,]    1    9    1   17    6
[5,]   12    3   10   16    2
> 
> 
> as.matrix(tmp)
           [,1]        [,2]        [,3]       [,4]       [,5]       [,6]
[1,]  0.3338775  0.61347072  0.23732257 -1.4534233  0.2395411  0.6412864
[2,]  1.0813086  1.80720956 -0.03571029 -0.1043553 -0.7529338 -0.3573700
[3,]  0.8258910  0.36026796  1.25137315 -1.5770392  0.1111754 -0.3614497
[4,] -0.1917557  0.37837917  0.32854563  0.5568912  0.5335211  0.5111231
[5,]  0.9314750 -0.06834787  0.52018146 -0.2016789 -1.4376082  1.9947082
          [,7]       [,8]        [,9]       [,10]      [,11]      [,12]
[1,] -1.407131 -1.1873420  0.07906745 -0.62737057  0.3626520 -0.2550850
[2,]  1.390067  0.7161435 -0.60814321  0.26695527  1.6683035  0.7187620
[3,] -1.391115 -0.1072897  2.29320601 -0.07074016  0.1755360  0.9463557
[4,] -1.468537 -1.1134201  0.09883868 -2.31756545  0.5171821  1.0496073
[5,] -1.131734  0.4769165 -1.02648004  0.99840078 -0.2006947  1.7057414
          [,13]      [,14]      [,15]      [,16]      [,17]      [,18]
[1,] -0.6436934  0.3133564 -0.9180046  0.6380907  0.8329243  0.2193645
[2,]  1.5464469 -1.6549362  0.8357894 -0.4036764  0.3159518 -1.8725564
[3,] -1.0836122 -0.6741090  1.5156881 -0.7330536  0.8623270  0.1800568
[4,] -0.6077434 -0.3070661 -0.4322526  1.5482855 -0.5557631  0.9919197
[5,] -0.2906529  2.1077567 -2.6919188  1.3579318  0.8505047  0.3097767
           [,19]      [,20]
[1,] -1.17948024  0.3102169
[2,] -0.54576544 -0.4218402
[3,]  1.64015355 -1.0379240
[4,]  0.08707992 -0.3711927
[5,]  0.57347622  0.8562615
> 
> 
> 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.18-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.18-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.18-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  566  bytes.
Disk usage :  160  bytes.
> subBufferedMatrix(tmp,1:3,)
BufferedMatrix object
Matrix size:  3 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.18-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  480  bytes.
> 
> 
> rm(tmp)
> 
> 
> ###
> ### Testing colnames and rownames
> ###
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> 
> 
> colnames(tmp)
NULL
> rownames(tmp)
NULL
> 
> 
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> colnames(tmp)
 [1] "col1"  "col2"  "col3"  "col4"  "col5"  "col6"  "col7"  "col8"  "col9" 
[10] "col10" "col11" "col12" "col13" "col14" "col15" "col16" "col17" "col18"
[19] "col19" "col20"
> rownames(tmp)
[1] "row1" "row2" "row3" "row4" "row5"
> 
> 
> tmp["row1",]
          col1     col2       col3      col4       col5      col6      col7
row1 0.4033225 1.736494 -0.4019365 0.9077819 -0.4951689 0.5238839 -1.562842
         col8       col9     col10      col11     col12     col13      col14
row1 0.514131 -0.4204542 -2.292729 -0.2094491 -1.150387 -1.370941 -0.4274217
          col15     col16      col17     col18      col19       col20
row1 0.08193184 0.1531184 -0.7910402 -1.407082 -0.8896586 -0.01918951
> tmp[,"col10"]
          col10
row1 -2.2927291
row2  0.9199343
row3  0.3365962
row4 -2.2071601
row5 -0.3228011
> tmp[c("row1","row5"),]
           col1      col2       col3       col4        col5       col6
row1  0.4033225  1.736494 -0.4019365 0.90778192 -0.49516888 0.52388389
row5 -0.7947292 -1.838317 -1.4995056 0.04630742 -0.04322583 0.02329288
          col7      col8       col9      col10      col11      col12      col13
row1 -1.562842 0.5141310 -0.4204542 -2.2927291 -0.2094491 -1.1503871 -1.3709409
row5  1.185359 0.3317832  0.9870281 -0.3228011  0.1308485 -0.8154852  0.3633091
          col14      col15     col16      col17     col18      col19
row1 -0.4274217 0.08193184 0.1531184 -0.7910402 -1.407082 -0.8896586
row5 -0.3944775 2.18371155 0.2126991 -0.5040801 -2.208552  2.0417662
           col20
row1 -0.01918951
row5 -0.79742690
> tmp[,c("col6","col20")]
            col6        col20
row1  0.52388389 -0.019189510
row2 -0.06447036  1.203081794
row3  0.22521507 -0.172565805
row4  0.32557542  0.005166983
row5  0.02329288 -0.797426898
> tmp[c("row1","row5"),c("col6","col20")]
           col6       col20
row1 0.52388389 -0.01918951
row5 0.02329288 -0.79742690
> 
> 
> 
> 
> 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.70347 50.522 50.27129 49.08038 50.47984 105.7431 49.98465 50.46011
         col9   col10    col11   col12    col13    col14    col15    col16
row1 49.95302 48.2491 50.10168 51.7932 50.05383 49.41851 49.59301 51.10669
       col17    col18   col19    col20
row1 49.7225 50.86255 50.7326 104.1454
> tmp[,"col10"]
        col10
row1 48.24910
row2 30.79688
row3 30.18750
row4 30.47006
row5 49.42307
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 51.70347 50.52200 50.27129 49.08038 50.47984 105.7431 49.98465 50.46011
row5 50.58724 50.47957 49.03096 51.56512 48.48817 105.5446 48.81511 49.88393
         col9    col10    col11    col12    col13    col14    col15    col16
row1 49.95302 48.24910 50.10168 51.79320 50.05383 49.41851 49.59301 51.10669
row5 48.37762 49.42307 50.06533 49.84169 50.26653 48.32781 50.73222 49.06894
        col17    col18   col19    col20
row1 49.72250 50.86255 50.7326 104.1454
row5 50.44561 49.44952 50.5181 105.9071
> tmp[,c("col6","col20")]
          col6     col20
row1 105.74309 104.14538
row2  76.05660  75.29369
row3  74.76755  76.36400
row4  76.99522  74.66082
row5 105.54462 105.90707
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 105.7431 104.1454
row5 105.5446 105.9071
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 105.7431 104.1454
row5 105.5446 105.9071
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
          col13
[1,]  0.1108036
[2,] -1.7380158
[3,]  0.3194498
[4,]  1.8595008
[5,]  0.8383725
> tmp[,c("col17","col7")]
          col17        col7
[1,] -1.5240127  0.23439146
[2,]  0.4718798  1.30998391
[3,]  0.6067363 -2.90624391
[4,]  0.7629807  0.09685809
[5,] -0.6202579  1.16870739
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
           col6     col20
[1,]  0.3680952  1.254286
[2,] -1.6366982  1.132361
[3,]  0.3277133  0.470995
[4,]  0.9315995  0.457594
[5,] -0.9768817 -1.598874
> subBufferedMatrix(tmp,1,c("col6"))[,1]
          col1
[1,] 0.3680952
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
           col6
[1,]  0.3680952
[2,] -1.6366982
> 
> 
> 
> 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.7116737 0.50573855 -1.61153524 -2.143724  0.43344432 -1.022793401
row1 0.3317735 0.01661216  0.04064711 -1.043341 -0.07132512  0.008542646
           [,7]       [,8]      [,9]      [,10]      [,11]      [,12]     [,13]
row3  2.4203849 -0.9186861 0.6228760  0.2531129 -0.7022523 -0.2831981 0.7568639
row1 -0.3468788  0.4563313 0.1041852 -0.7936064  0.6062158  0.4360973 0.4814806
          [,14]      [,15]     [,16]      [,17]     [,18]      [,19]      [,20]
row3 0.05510485  0.6044902 0.6297065  0.6828201 -0.505626 -0.5187817  0.4632439
row1 0.57417062 -0.3385167 0.4063684 -0.4225820 -1.334465 -0.1571516 -0.7943582
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
           [,1]      [,2]      [,3]       [,4]      [,5]       [,6]       [,7]
row2 -0.4034425 -1.625817 0.2489369 -0.6598043 -2.742588 -0.1799558 -0.7620393
          [,8]      [,9]     [,10]
row2 -1.465429 0.8489269 0.5588245
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
         [,1]       [,2]      [,3]        [,4]      [,5]      [,6]      [,7]
row5 1.885864 -0.2824627 0.1106045 -0.03163801 0.3031949 -1.238234 0.4134134
           [,8]       [,9]    [,10]     [,11]      [,12]     [,13]     [,14]
row5 -0.8365897 -0.4347729 1.268601 0.8645812 -0.5954516 0.4983945 -1.265304
          [,15]      [,16]     [,17]    [,18]      [,19]      [,20]
row5 -0.6554071 -0.5882185 0.7209856 -0.49173 -0.2249814 -0.6379432
> 
> 
> 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: 0x6000016c0120>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "/Users/biocbuild/bbs-3.18-bioc/meat/BufferedMatrix.Rcheck/tests/BM1815d533c0dce"
 [2] "/Users/biocbuild/bbs-3.18-bioc/meat/BufferedMatrix.Rcheck/tests/BM1815dbae7a13" 
 [3] "/Users/biocbuild/bbs-3.18-bioc/meat/BufferedMatrix.Rcheck/tests/BM1815d6bd07b62"
 [4] "/Users/biocbuild/bbs-3.18-bioc/meat/BufferedMatrix.Rcheck/tests/BM1815d4454963a"
 [5] "/Users/biocbuild/bbs-3.18-bioc/meat/BufferedMatrix.Rcheck/tests/BM1815dd52dce2" 
 [6] "/Users/biocbuild/bbs-3.18-bioc/meat/BufferedMatrix.Rcheck/tests/BM1815d3b238043"
 [7] "/Users/biocbuild/bbs-3.18-bioc/meat/BufferedMatrix.Rcheck/tests/BM1815d17b9cd0a"
 [8] "/Users/biocbuild/bbs-3.18-bioc/meat/BufferedMatrix.Rcheck/tests/BM1815d274457b1"
 [9] "/Users/biocbuild/bbs-3.18-bioc/meat/BufferedMatrix.Rcheck/tests/BM1815d77d9399a"
[10] "/Users/biocbuild/bbs-3.18-bioc/meat/BufferedMatrix.Rcheck/tests/BM1815d5654eaee"
[11] "/Users/biocbuild/bbs-3.18-bioc/meat/BufferedMatrix.Rcheck/tests/BM1815d610bdb89"
[12] "/Users/biocbuild/bbs-3.18-bioc/meat/BufferedMatrix.Rcheck/tests/BM1815d517a3125"
[13] "/Users/biocbuild/bbs-3.18-bioc/meat/BufferedMatrix.Rcheck/tests/BM1815d2d309ded"
[14] "/Users/biocbuild/bbs-3.18-bioc/meat/BufferedMatrix.Rcheck/tests/BM1815d52d049c8"
[15] "/Users/biocbuild/bbs-3.18-bioc/meat/BufferedMatrix.Rcheck/tests/BM1815d689c13f1"
> 
> 
> ### 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: 0x6000016d0240>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x6000016d0240>
Warning message:
In dir.create(new.directory) :
  '/Users/biocbuild/bbs-3.18-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x6000016d0240>
> rowMedians(tmp)
  [1]  0.004401113  0.456634912 -0.456567978  0.006616411 -0.314247396
  [6] -0.450830167 -0.047568515  0.296432212 -0.495373808  0.386696612
 [11]  0.319633641  0.422497705 -0.270501059  0.073600107  0.329867533
 [16]  0.146148184  0.207671685  0.135799246 -0.341282966  0.286259378
 [21]  0.329580982 -0.077991731  0.330222276 -0.092821281  0.187609211
 [26] -0.096056198 -0.037988976 -0.175484598 -0.220367060  0.332514559
 [31] -0.261130065  0.367416975  0.291157621  0.111141145  0.624168115
 [36]  0.272352313 -0.080269665  0.490784836  0.718698564 -0.413526608
 [41] -0.071280312 -0.405640571 -0.169548145  0.072719792 -0.298071155
 [46]  0.749691547 -0.278133450  0.071883447 -0.408415230 -0.482139596
 [51] -0.109649941 -0.251779483  0.026539045 -0.350181982  0.131709948
 [56]  0.077441577 -0.340821751  0.127715324 -0.160453321 -0.418894075
 [61]  0.404446562  0.262722557  0.377843552 -0.209021993  0.271600670
 [66] -0.033413472 -0.416330886 -0.126805317 -0.075498878 -0.072747328
 [71]  0.040846826 -0.018359554 -0.079983806  0.386887585  0.358555006
 [76] -0.499360117  0.270228463  0.029350307  0.146629096 -0.304384794
 [81]  0.454240088  0.173854625 -0.389083611 -0.284568983  0.094832129
 [86]  0.123535032 -0.017802495  0.368159354 -0.289505918  0.380848759
 [91] -0.075138113 -0.011184862 -0.026081122  0.412994516  0.270030610
 [96] -0.174039442 -0.222952447 -0.193096867  0.502735613 -0.222433897
[101]  0.271621224  0.348007780 -0.049273403 -0.052911757 -0.146924631
[106] -0.001925874 -0.201352327 -0.060732187 -0.076348503 -0.125040080
[111] -0.598455225  0.292837747 -0.123245317 -0.349778258  0.440916818
[116] -0.154060830 -0.144293303 -0.070462546  0.518422142 -0.214558200
[121]  0.058539708 -0.174647881 -0.553659095 -0.232706104 -0.002946229
[126] -0.214647500  0.018289579 -0.452235648 -0.405570702 -0.336098455
[131] -0.475003538 -0.380711706  0.250165838  0.105958315 -0.243172801
[136] -0.153815967 -0.498866379  0.445938056  0.145658221 -0.154672184
[141] -0.038309071  0.334325647 -0.603919152 -0.190509203  0.372210420
[146]  0.175310396  0.136116474 -0.010388893 -0.162410207  0.168209057
[151] -0.570484939 -0.074033152  0.007478233 -0.202264444  0.202695918
[156] -0.001236111  0.155113776 -0.074346947 -0.299573402  0.048658217
[161]  0.231832646 -0.471665221  0.041554395  0.054526477  0.567387015
[166]  0.248106795 -0.030628388 -0.008242254  0.071912344  0.060304367
[171]  0.042439221  0.036591654 -0.134456210  0.483541787 -0.074372099
[176] -0.314025869 -0.425898197  0.298466072 -0.099003260 -0.101162660
[181]  0.296879241 -0.431143047  0.757864291 -0.001468068 -0.197983817
[186] -0.381131806  0.315003508 -0.042365767  0.500715508  0.001327743
[191]  0.306711670  0.037210708 -0.014967270  0.242178033  0.333778589
[196] -0.102134452 -0.108953490  0.001541144 -0.015636321  0.094951406
[201]  0.407592360 -0.368633158 -0.107143576  0.903873509 -0.184586004
[206]  0.002585057  0.428371859 -0.370654132  0.382600094  0.010817102
[211]  0.613855486  0.723822261  0.688565273  0.632930884 -0.635289218
[216]  0.248366314 -0.714476177 -0.026011092  0.133765701 -0.028039496
[221]  0.425519628  0.190782314 -0.381098218 -0.043158170 -0.486863535
[226]  0.024463412 -0.572413589  0.211945670 -0.606652238 -0.684176917
> 
> proc.time()
   user  system elapsed 
  4.938  17.855  24.498 

BufferedMatrix.Rcheck/tests/rawCalltesting.Rout


R version 4.3.3 (2024-02-29) -- "Angel Food Cake"
Copyright (C) 2024 The R Foundation for Statistical Computing
Platform: x86_64-apple-darwin20 (64-bit)

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

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

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

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

Attaching package: 'BufferedMatrix'

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

    colMeans, colSums, rowMeans, rowSums

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

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

<pointer: 0x600000c60120>
> .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: 0x600000c60120>
> .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: 0x600000c60120>
> .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: 0x600000c60120>
> 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: 0x600000c50000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600000c50000>
> .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: 0x600000c50000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600000c50000>
> .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: 0x600000c50000>
> 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: 0x600000c604e0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600000c604e0>
> .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: 0x600000c604e0>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x600000c604e0>
> .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: 0x600000c604e0>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x600000c604e0>
> .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: 0x600000c604e0>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x600000c604e0>
> .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: 0x600000c604e0>
> 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: 0x600000c54000>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x600000c54000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600000c54000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600000c54000>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFilee14215b7e64" "BufferedMatrixFilee147dc6e857"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFilee14215b7e64" "BufferedMatrixFilee147dc6e857"
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x600000c54240>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600000c54240>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x600000c54240>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x600000c54240>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x600000c54240>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x600000c54240>
> .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: 0x600000c70180>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600000c70180>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x600000c70180>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x600000c70180>
> 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: 0x600000c70300>
> .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: 0x600000c70300>
> rm(P)
> 
> proc.time()
   user  system elapsed 
  0.590   0.209   0.783 

BufferedMatrix.Rcheck/tests/Rcodetesting.Rout


R version 4.3.3 (2024-02-29) -- "Angel Food Cake"
Copyright (C) 2024 The R Foundation for Statistical Computing
Platform: x86_64-apple-darwin20 (64-bit)

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

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

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

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

Attaching package: 'BufferedMatrix'

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

    colMeans, colSums, rowMeans, rowSums

> 
> Temp <- createBufferedMatrix(100)
> dim(Temp)
[1] 100   0
> buffer.dim(Temp)
[1] 1 1
> 
> 
> proc.time()
   user  system elapsed 
  0.577   0.134   0.675 

Example timings