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

This page was generated on 2024-04-17 11:37:33 -0400 (Wed, 17 Apr 2024).

HostnameOSArch (*)R versionInstalled pkgs
nebbiolo2Linux (Ubuntu 22.04.3 LTS)x86_644.3.3 (2024-02-29) -- "Angel Food Cake" 4676
palomino4Windows Server 2022 Datacenterx644.3.3 (2024-02-29 ucrt) -- "Angel Food Cake" 4414
merida1macOS 12.7.1 Montereyx86_644.3.3 (2024-02-29) -- "Angel Food Cake" 4437
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-04-15 14:05:01 -0400 (Mon, 15 Apr 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-04-16 00:11:03 -0400 (Tue, 16 Apr 2024)
EndedAt: 2024-04-16 00:12:17 -0400 (Tue, 16 Apr 2024)
EllapsedTime: 73.6 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.583   0.202   0.779 

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 Apr 16 00:11:38 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 Apr 16 00:11:39 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: 0x600003694180>
> 
> 
> 
> 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 Apr 16 00:11:45 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 Apr 16 00:11:47 2024"
> 
> ColMode(tmp2)
<pointer: 0x600003694180>
> 
> 
> 
> ### 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,] 98.9729542  1.51349805  0.31234811 -0.2848055
[2,] -1.0790301  0.99524118 -0.91463592  0.5383451
[3,] -0.7964921 -0.86298765  0.09414639  1.7133622
[4,]  1.2998528  0.08051646 -0.19962358  2.0726390
> 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,] 98.9729542 1.51349805 0.31234811 0.2848055
[2,]  1.0790301 0.99524118 0.91463592 0.5383451
[3,]  0.7964921 0.86298765 0.09414639 1.7133622
[4,]  1.2998528 0.08051646 0.19962358 2.0726390
> 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,] 9.948515 1.2302431 0.5588811 0.5336717
[2,] 1.038764 0.9976178 0.9563660 0.7337200
[3,] 0.892464 0.9289713 0.3068328 1.3089546
[4,] 1.140111 0.2837542 0.4467925 1.4396663
> 
> 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,] 223.45811 38.81593 30.90116 30.62152
[2,]  36.46667 35.97142 35.47830 32.87555
[3,]  34.72113 35.15270 28.16247 39.80291
[4,]  37.70096 27.91806 29.66755 41.46930
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x6000036b0000>
> exp(tmp5)
<pointer: 0x6000036b0000>
> log(tmp5,2)
<pointer: 0x6000036b0000>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 465.0988
> Min(tmp5)
[1] 53.39687
> mean(tmp5)
[1] 72.68228
> Sum(tmp5)
[1] 14536.46
> Var(tmp5)
[1] 849.5202
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 90.91336 69.76437 68.88502 71.80204 71.93327 72.00626 68.72263 71.24230
 [9] 69.29609 72.25751
> rowSums(tmp5)
 [1] 1818.267 1395.287 1377.700 1436.041 1438.665 1440.125 1374.453 1424.846
 [9] 1385.922 1445.150
> rowVars(tmp5)
 [1] 7825.67071   63.61533   48.75495   83.20490   97.84106   77.27149
 [7]   51.97209   67.35462   81.15059   93.93135
> rowSd(tmp5)
 [1] 88.462821  7.975922  6.982474  9.121672  9.891464  8.790421  7.209167
 [8]  8.206986  9.008362  9.691818
> rowMax(tmp5)
 [1] 465.09877  83.44424  82.93325  86.31292  87.41926  89.91747  82.52465
 [8]  90.89367  86.64067  87.76808
> rowMin(tmp5)
 [1] 55.60863 56.92392 58.61650 58.10778 53.78716 59.10791 55.03979 60.82626
 [9] 53.39687 56.22787
> 
> colMeans(tmp5)
 [1] 108.68763  69.13427  71.22747  72.17174  67.43126  65.07590  73.81246
 [8]  67.56207  70.40017  74.29688  73.17188  72.35468  72.32621  72.42537
[15]  71.50056  72.27092  71.28460  70.12912  67.28800  71.09449
> colSums(tmp5)
 [1] 1086.8763  691.3427  712.2747  721.7174  674.3126  650.7590  738.1246
 [8]  675.6207  704.0017  742.9688  731.7188  723.5468  723.2621  724.2537
[15]  715.0056  722.7092  712.8460  701.2912  672.8800  710.9449
> colVars(tmp5)
 [1] 15763.13051   113.99395    92.18406    64.14529    83.24656   104.39417
 [7]    61.08771    35.76475    55.30133    97.76485    44.82916    45.48334
[13]   102.90725    63.38525    67.03900    67.93048    98.34782    52.12551
[19]   108.32822    24.35085
> colSd(tmp5)
 [1] 125.551306  10.676795   9.601253   8.009076   9.123955  10.217347
 [7]   7.815863   5.980363   7.436486   9.887611   6.695458   6.744134
[13]  10.144321   7.961486   8.187735   8.241995   9.917047   7.219800
[19]  10.408084   4.934659
> colMax(tmp5)
 [1] 465.09877  89.91747  87.76808  86.31292  83.44424  82.86234  85.40436
 [8]  82.52465  81.01053  85.92660  85.32795  80.44009  86.64067  87.41926
[15]  85.64971  84.19453  90.89367  79.56900  81.23478  80.93785
> colMin(tmp5)
 [1] 53.78716 56.22787 58.61650 62.67120 57.48801 54.42230 61.29928 61.75015
 [9] 58.15742 56.92392 60.82626 59.47652 55.03979 62.06302 65.30411 58.95147
[17] 57.28908 59.10791 53.39687 65.91271
> 
> 
> ### 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] 90.91336 69.76437 68.88502 71.80204 71.93327 72.00626 68.72263 71.24230
 [9] 69.29609       NA
> rowSums(tmp5)
 [1] 1818.267 1395.287 1377.700 1436.041 1438.665 1440.125 1374.453 1424.846
 [9] 1385.922       NA
> rowVars(tmp5)
 [1] 7825.67071   63.61533   48.75495   83.20490   97.84106   77.27149
 [7]   51.97209   67.35462   81.15059   85.08087
> rowSd(tmp5)
 [1] 88.462821  7.975922  6.982474  9.121672  9.891464  8.790421  7.209167
 [8]  8.206986  9.008362  9.223929
> rowMax(tmp5)
 [1] 465.09877  83.44424  82.93325  86.31292  87.41926  89.91747  82.52465
 [8]  90.89367  86.64067        NA
> rowMin(tmp5)
 [1] 55.60863 56.92392 58.61650 58.10778 53.78716 59.10791 55.03979 60.82626
 [9] 53.39687       NA
> 
> colMeans(tmp5)
 [1] 108.68763  69.13427        NA  72.17174  67.43126  65.07590  73.81246
 [8]  67.56207  70.40017  74.29688  73.17188  72.35468  72.32621  72.42537
[15]  71.50056  72.27092  71.28460  70.12912  67.28800  71.09449
> colSums(tmp5)
 [1] 1086.8763  691.3427        NA  721.7174  674.3126  650.7590  738.1246
 [8]  675.6207  704.0017  742.9688  731.7188  723.5468  723.2621  724.2537
[15]  715.0056  722.7092  712.8460  701.2912  672.8800  710.9449
> colVars(tmp5)
 [1] 15763.13051   113.99395          NA    64.14529    83.24656   104.39417
 [7]    61.08771    35.76475    55.30133    97.76485    44.82916    45.48334
[13]   102.90725    63.38525    67.03900    67.93048    98.34782    52.12551
[19]   108.32822    24.35085
> colSd(tmp5)
 [1] 125.551306  10.676795         NA   8.009076   9.123955  10.217347
 [7]   7.815863   5.980363   7.436486   9.887611   6.695458   6.744134
[13]  10.144321   7.961486   8.187735   8.241995   9.917047   7.219800
[19]  10.408084   4.934659
> colMax(tmp5)
 [1] 465.09877  89.91747        NA  86.31292  83.44424  82.86234  85.40436
 [8]  82.52465  81.01053  85.92660  85.32795  80.44009  86.64067  87.41926
[15]  85.64971  84.19453  90.89367  79.56900  81.23478  80.93785
> colMin(tmp5)
 [1] 53.78716 56.22787       NA 62.67120 57.48801 54.42230 61.29928 61.75015
 [9] 58.15742 56.92392 60.82626 59.47652 55.03979 62.06302 65.30411 58.95147
[17] 57.28908 59.10791 53.39687 65.91271
> 
> Max(tmp5,na.rm=TRUE)
[1] 465.0988
> Min(tmp5,na.rm=TRUE)
[1] 53.39687
> mean(tmp5,na.rm=TRUE)
[1] 72.60648
> Sum(tmp5,na.rm=TRUE)
[1] 14448.69
> Var(tmp5,na.rm=TRUE)
[1] 852.6556
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 90.91336 69.76437 68.88502 71.80204 71.93327 72.00626 68.72263 71.24230
 [9] 69.29609 71.44116
> rowSums(tmp5,na.rm=TRUE)
 [1] 1818.267 1395.287 1377.700 1436.041 1438.665 1440.125 1374.453 1424.846
 [9] 1385.922 1357.382
> rowVars(tmp5,na.rm=TRUE)
 [1] 7825.67071   63.61533   48.75495   83.20490   97.84106   77.27149
 [7]   51.97209   67.35462   81.15059   85.08087
> rowSd(tmp5,na.rm=TRUE)
 [1] 88.462821  7.975922  6.982474  9.121672  9.891464  8.790421  7.209167
 [8]  8.206986  9.008362  9.223929
> rowMax(tmp5,na.rm=TRUE)
 [1] 465.09877  83.44424  82.93325  86.31292  87.41926  89.91747  82.52465
 [8]  90.89367  86.64067  85.64971
> rowMin(tmp5,na.rm=TRUE)
 [1] 55.60863 56.92392 58.61650 58.10778 53.78716 59.10791 55.03979 60.82626
 [9] 53.39687 56.22787
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 108.68763  69.13427  69.38962  72.17174  67.43126  65.07590  73.81246
 [8]  67.56207  70.40017  74.29688  73.17188  72.35468  72.32621  72.42537
[15]  71.50056  72.27092  71.28460  70.12912  67.28800  71.09449
> colSums(tmp5,na.rm=TRUE)
 [1] 1086.8763  691.3427  624.5066  721.7174  674.3126  650.7590  738.1246
 [8]  675.6207  704.0017  742.9688  731.7188  723.5468  723.2621  724.2537
[15]  715.0056  722.7092  712.8460  701.2912  672.8800  710.9449
> colVars(tmp5,na.rm=TRUE)
 [1] 15763.13051   113.99395    65.70818    64.14529    83.24656   104.39417
 [7]    61.08771    35.76475    55.30133    97.76485    44.82916    45.48334
[13]   102.90725    63.38525    67.03900    67.93048    98.34782    52.12551
[19]   108.32822    24.35085
> colSd(tmp5,na.rm=TRUE)
 [1] 125.551306  10.676795   8.106058   8.009076   9.123955  10.217347
 [7]   7.815863   5.980363   7.436486   9.887611   6.695458   6.744134
[13]  10.144321   7.961486   8.187735   8.241995   9.917047   7.219800
[19]  10.408084   4.934659
> colMax(tmp5,na.rm=TRUE)
 [1] 465.09877  89.91747  78.93304  86.31292  83.44424  82.86234  85.40436
 [8]  82.52465  81.01053  85.92660  85.32795  80.44009  86.64067  87.41926
[15]  85.64971  84.19453  90.89367  79.56900  81.23478  80.93785
> colMin(tmp5,na.rm=TRUE)
 [1] 53.78716 56.22787 58.61650 62.67120 57.48801 54.42230 61.29928 61.75015
 [9] 58.15742 56.92392 60.82626 59.47652 55.03979 62.06302 65.30411 58.95147
[17] 57.28908 59.10791 53.39687 65.91271
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1] 90.91336 69.76437 68.88502 71.80204 71.93327 72.00626 68.72263 71.24230
 [9] 69.29609      NaN
> rowSums(tmp5,na.rm=TRUE)
 [1] 1818.267 1395.287 1377.700 1436.041 1438.665 1440.125 1374.453 1424.846
 [9] 1385.922    0.000
> rowVars(tmp5,na.rm=TRUE)
 [1] 7825.67071   63.61533   48.75495   83.20490   97.84106   77.27149
 [7]   51.97209   67.35462   81.15059         NA
> rowSd(tmp5,na.rm=TRUE)
 [1] 88.462821  7.975922  6.982474  9.121672  9.891464  8.790421  7.209167
 [8]  8.206986  9.008362        NA
> rowMax(tmp5,na.rm=TRUE)
 [1] 465.09877  83.44424  82.93325  86.31292  87.41926  89.91747  82.52465
 [8]  90.89367  86.64067        NA
> rowMin(tmp5,na.rm=TRUE)
 [1] 55.60863 56.92392 58.61650 58.10778 53.78716 59.10791 55.03979 60.82626
 [9] 53.39687       NA
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1] 114.27790  70.56831       NaN  72.36524  66.26014  65.94374  73.15127
 [8]  67.44173  71.76048  73.80189  72.57602  71.50618  73.05247  71.81071
[15]  69.92843  71.85766  70.66147  69.61642  67.95963  70.66031
> colSums(tmp5,na.rm=TRUE)
 [1] 1028.5011  635.1148    0.0000  651.2872  596.3413  593.4937  658.3614
 [8]  606.9755  645.8443  664.2170  653.1841  643.5556  657.4722  646.2964
[15]  629.3559  646.7190  635.9532  626.5478  611.6366  635.9428
> colVars(tmp5,na.rm=TRUE)
 [1] 17381.94694   105.10775          NA    71.74220    78.22274   108.97051
 [7]    63.80543    40.07241    41.39662   107.22903    46.43850    43.06935
[13]   109.83679    67.05801    47.61355    74.50050   106.27304    55.68398
[19]   116.79452    25.27392
> colSd(tmp5,na.rm=TRUE)
 [1] 131.840612  10.252207         NA   8.470077   8.844362  10.438894
 [7]   7.987830   6.330277   6.434021  10.355145   6.814580   6.562724
[13]  10.480305   8.188895   6.900257   8.631367  10.308881   7.462170
[19]  10.807151   5.027318
> colMax(tmp5,na.rm=TRUE)
 [1] 465.09877  89.91747      -Inf  86.31292  83.44424  82.86234  85.40436
 [8]  82.52465  81.01053  85.92660  85.32795  80.44009  86.64067  87.41926
[15]  81.92746  84.19453  90.89367  79.56900  81.23478  80.93785
> colMin(tmp5,na.rm=TRUE)
 [1] 53.78716 58.10778      Inf 62.67120 57.48801 54.42230 61.29928 61.75015
 [9] 62.68214 56.92392 60.82626 59.47652 55.03979 62.06302 65.30411 58.95147
[17] 57.28908 59.10791 53.39687 65.91271
> 
> 
> 
> 
> 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] 125.4062 214.5276 216.5727 203.1865 129.6395 229.3676 226.3242 354.7864
 [9] 278.2089 398.6866
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 125.4062 214.5276 216.5727 203.1865 129.6395 229.3676 226.3242 354.7864
 [9] 278.2089 398.6866
> 
> 
> 
> 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] -5.684342e-14  2.273737e-13 -5.684342e-14  5.684342e-14 -1.136868e-13
 [6]  5.684342e-14 -1.136868e-13 -5.684342e-14  0.000000e+00 -5.684342e-14
[11] -1.136868e-13  5.684342e-14  0.000000e+00  1.421085e-13  2.842171e-14
[16]  0.000000e+00  5.684342e-14  5.684342e-14 -5.684342e-14  0.000000e+00
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> ## making sure these things agree
> ##
> ## first when there is no NA
> 
> 
> 
> agree.checks <- function(buff.matrix,r.matrix,err.tol=1e-10){
+ 
+   if (Max(buff.matrix,na.rm=TRUE) != max(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Max")
+   }
+   
+ 
+   if (Min(buff.matrix,na.rm=TRUE) != min(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Min")
+   }
+ 
+ 
+   if (abs(Sum(buff.matrix,na.rm=TRUE)- sum(r.matrix,na.rm=TRUE)) > err.tol){
+ 
+     cat(Sum(buff.matrix,na.rm=TRUE),"\n")
+     cat(sum(r.matrix,na.rm=TRUE),"\n")
+     cat(Sum(buff.matrix,na.rm=TRUE) - sum(r.matrix,na.rm=TRUE),"\n")
+     
+     stop("No agreement in Sum")
+   }
+   
+   if (abs(mean(buff.matrix,na.rm=TRUE) - mean(r.matrix,na.rm=TRUE)) > err.tol){
+     stop("No agreement in mean")
+   }
+   
+   
+   if(abs(Var(buff.matrix,na.rm=TRUE) - var(as.vector(r.matrix),na.rm=TRUE)) > err.tol){
+     stop("No agreement in Var")
+   }
+   
+   
+ 
+   if(any(abs(rowMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,mean,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowMeans")
+   }
+   
+   
+   if(any(abs(colMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,mean,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colMeans")
+   }
+   
+   
+   if(any(abs(rowSums(buff.matrix,na.rm=TRUE)  -  apply(r.matrix,1,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in rowSums")
+   }
+   
+   
+   if(any(abs(colSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colSums")
+   }
+   
+   ### this is to get around the fact that R doesn't like to compute NA on an entire vector of NA when 
+   ### computing variance
+   my.Var <- function(x,na.rm=FALSE){
+    if (all(is.na(x))){
+      return(NA)
+    } else {
+      var(x,na.rm=na.rm)
+    }
+ 
+   }
+   
+   if(any(abs(rowVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+   
+   
+   if(any(abs(colVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+ 
+ 
+   if(any(abs(rowMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+ 
+   if(any(abs(colMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+   
+   
+   if(any(abs(rowMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+   
+ 
+   if(any(abs(colMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+ 
+   if(any(abs(colMedians(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,median,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMedian")
+   }
+ 
+   if(any(abs(colRanges(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,range,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colRanges")
+   }
+ 
+ 
+   
+ }
> 
> 
> 
> 
> 
> 
> 
> 
> 
> for (rep in 1:20){
+   copymatrix <- matrix(rnorm(200,150,15),10,20)
+   
+   tmp5[1:10,1:20] <- copymatrix
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ## now lets assign some NA values and check agreement
+ 
+   which.row <- sample(1:10,1,replace=TRUE)
+   which.col  <- sample(1:20,1,replace=TRUE)
+   
+   cat(which.row," ",which.col,"\n")
+   
+   tmp5[which.row,which.col] <- NA
+   copymatrix[which.row,which.col] <- NA
+   
+   agree.checks(tmp5,copymatrix)
+ 
+   ## make an entire row NA
+   tmp5[which.row,] <- NA
+   copymatrix[which.row,] <- NA
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ### also make an entire col NA
+   tmp5[,which.col] <- NA
+   copymatrix[,which.col] <- NA
+ 
+   agree.checks(tmp5,copymatrix)
+ 
+   ### now make 1 element non NA with NA in the rest of row and column
+ 
+   tmp5[which.row,which.col] <- rnorm(1,150,15)
+   copymatrix[which.row,which.col] <- tmp5[which.row,which.col]
+ 
+   agree.checks(tmp5,copymatrix)
+ }
5   15 
9   13 
7   20 
9   14 
5   5 
4   17 
7   10 
9   10 
5   9 
1   7 
9   7 
3   19 
5   5 
1   7 
7   2 
2   2 
7   9 
3   7 
3   16 
4   12 
There were 50 or more warnings (use warnings() to see the first 50)
> 
> 
> ### now test 1 by n and n by 1 matrix
> 
> 
> err.tol <- 1e-12
> 
> rm(tmp5)
> 
> dataset1 <- rnorm(100)
> dataset2 <- rnorm(100)
> 
> tmp <- createBufferedMatrix(1,100)
> tmp[1,] <- dataset1
> 
> tmp2 <- createBufferedMatrix(100,1)
> tmp2[,1] <- dataset2
> 
> 
> 
> 
> 
> Max(tmp)
[1] 2.294553
> Min(tmp)
[1] -2.817377
> mean(tmp)
[1] -0.1146256
> Sum(tmp)
[1] -11.46256
> Var(tmp)
[1] 1.067383
> 
> rowMeans(tmp)
[1] -0.1146256
> rowSums(tmp)
[1] -11.46256
> rowVars(tmp)
[1] 1.067383
> rowSd(tmp)
[1] 1.033142
> rowMax(tmp)
[1] 2.294553
> rowMin(tmp)
[1] -2.817377
> 
> colMeans(tmp)
  [1] -0.19205704 -0.07485619  1.40599265 -0.78499789 -0.76388740 -0.40646427
  [7]  0.04087847 -0.67098948 -0.52317895  1.61521300  0.35320423 -2.52479715
 [13] -1.88486982  0.32220681  1.48925379  1.11124227 -0.34904393  0.71413358
 [19] -0.41218935 -1.47799327 -2.81737702  1.19820019  1.89778301 -0.27262366
 [25] -0.20830351  0.13506241 -0.38187904 -0.18426972  0.11593798 -0.77404447
 [31] -0.58022265 -0.01995625  1.32454395 -1.39333875  1.09192574 -1.41238714
 [37] -0.54142725 -0.02074870 -0.61899796  0.40540282 -0.76456202  1.64224160
 [43] -0.64427230  1.32313780  0.86566253  0.02574758 -1.00595973 -1.32046976
 [49] -0.91047136  0.08769237 -1.48896534  0.43678338 -0.63031640  0.55069026
 [55] -0.07495078  0.25523001  0.53071505  2.29455333 -0.68481772 -0.49012014
 [61]  1.06529328  0.85222188 -1.42089444  2.02717278  0.41296723 -0.87647741
 [67] -0.63127463 -0.71865965  1.03291316  0.05116318  1.28049867 -0.63808338
 [73] -0.94268775 -0.09614036 -0.02100296  0.08464245 -1.02373578 -0.33223307
 [79]  1.27234872  0.60841509 -0.26701390  0.63250592  0.16101655 -0.30468121
 [85] -0.10325031 -0.68258755 -0.25757843 -1.92213168 -1.86566209  0.15558927
 [91] -1.94207419 -0.04848329  0.34900307  1.21834777 -1.37115201  0.47447115
 [97] -2.31332602 -0.48205047 -0.69939192  1.89181819
> colSums(tmp)
  [1] -0.19205704 -0.07485619  1.40599265 -0.78499789 -0.76388740 -0.40646427
  [7]  0.04087847 -0.67098948 -0.52317895  1.61521300  0.35320423 -2.52479715
 [13] -1.88486982  0.32220681  1.48925379  1.11124227 -0.34904393  0.71413358
 [19] -0.41218935 -1.47799327 -2.81737702  1.19820019  1.89778301 -0.27262366
 [25] -0.20830351  0.13506241 -0.38187904 -0.18426972  0.11593798 -0.77404447
 [31] -0.58022265 -0.01995625  1.32454395 -1.39333875  1.09192574 -1.41238714
 [37] -0.54142725 -0.02074870 -0.61899796  0.40540282 -0.76456202  1.64224160
 [43] -0.64427230  1.32313780  0.86566253  0.02574758 -1.00595973 -1.32046976
 [49] -0.91047136  0.08769237 -1.48896534  0.43678338 -0.63031640  0.55069026
 [55] -0.07495078  0.25523001  0.53071505  2.29455333 -0.68481772 -0.49012014
 [61]  1.06529328  0.85222188 -1.42089444  2.02717278  0.41296723 -0.87647741
 [67] -0.63127463 -0.71865965  1.03291316  0.05116318  1.28049867 -0.63808338
 [73] -0.94268775 -0.09614036 -0.02100296  0.08464245 -1.02373578 -0.33223307
 [79]  1.27234872  0.60841509 -0.26701390  0.63250592  0.16101655 -0.30468121
 [85] -0.10325031 -0.68258755 -0.25757843 -1.92213168 -1.86566209  0.15558927
 [91] -1.94207419 -0.04848329  0.34900307  1.21834777 -1.37115201  0.47447115
 [97] -2.31332602 -0.48205047 -0.69939192  1.89181819
> 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.19205704 -0.07485619  1.40599265 -0.78499789 -0.76388740 -0.40646427
  [7]  0.04087847 -0.67098948 -0.52317895  1.61521300  0.35320423 -2.52479715
 [13] -1.88486982  0.32220681  1.48925379  1.11124227 -0.34904393  0.71413358
 [19] -0.41218935 -1.47799327 -2.81737702  1.19820019  1.89778301 -0.27262366
 [25] -0.20830351  0.13506241 -0.38187904 -0.18426972  0.11593798 -0.77404447
 [31] -0.58022265 -0.01995625  1.32454395 -1.39333875  1.09192574 -1.41238714
 [37] -0.54142725 -0.02074870 -0.61899796  0.40540282 -0.76456202  1.64224160
 [43] -0.64427230  1.32313780  0.86566253  0.02574758 -1.00595973 -1.32046976
 [49] -0.91047136  0.08769237 -1.48896534  0.43678338 -0.63031640  0.55069026
 [55] -0.07495078  0.25523001  0.53071505  2.29455333 -0.68481772 -0.49012014
 [61]  1.06529328  0.85222188 -1.42089444  2.02717278  0.41296723 -0.87647741
 [67] -0.63127463 -0.71865965  1.03291316  0.05116318  1.28049867 -0.63808338
 [73] -0.94268775 -0.09614036 -0.02100296  0.08464245 -1.02373578 -0.33223307
 [79]  1.27234872  0.60841509 -0.26701390  0.63250592  0.16101655 -0.30468121
 [85] -0.10325031 -0.68258755 -0.25757843 -1.92213168 -1.86566209  0.15558927
 [91] -1.94207419 -0.04848329  0.34900307  1.21834777 -1.37115201  0.47447115
 [97] -2.31332602 -0.48205047 -0.69939192  1.89181819
> colMin(tmp)
  [1] -0.19205704 -0.07485619  1.40599265 -0.78499789 -0.76388740 -0.40646427
  [7]  0.04087847 -0.67098948 -0.52317895  1.61521300  0.35320423 -2.52479715
 [13] -1.88486982  0.32220681  1.48925379  1.11124227 -0.34904393  0.71413358
 [19] -0.41218935 -1.47799327 -2.81737702  1.19820019  1.89778301 -0.27262366
 [25] -0.20830351  0.13506241 -0.38187904 -0.18426972  0.11593798 -0.77404447
 [31] -0.58022265 -0.01995625  1.32454395 -1.39333875  1.09192574 -1.41238714
 [37] -0.54142725 -0.02074870 -0.61899796  0.40540282 -0.76456202  1.64224160
 [43] -0.64427230  1.32313780  0.86566253  0.02574758 -1.00595973 -1.32046976
 [49] -0.91047136  0.08769237 -1.48896534  0.43678338 -0.63031640  0.55069026
 [55] -0.07495078  0.25523001  0.53071505  2.29455333 -0.68481772 -0.49012014
 [61]  1.06529328  0.85222188 -1.42089444  2.02717278  0.41296723 -0.87647741
 [67] -0.63127463 -0.71865965  1.03291316  0.05116318  1.28049867 -0.63808338
 [73] -0.94268775 -0.09614036 -0.02100296  0.08464245 -1.02373578 -0.33223307
 [79]  1.27234872  0.60841509 -0.26701390  0.63250592  0.16101655 -0.30468121
 [85] -0.10325031 -0.68258755 -0.25757843 -1.92213168 -1.86566209  0.15558927
 [91] -1.94207419 -0.04848329  0.34900307  1.21834777 -1.37115201  0.47447115
 [97] -2.31332602 -0.48205047 -0.69939192  1.89181819
> colMedians(tmp)
  [1] -0.19205704 -0.07485619  1.40599265 -0.78499789 -0.76388740 -0.40646427
  [7]  0.04087847 -0.67098948 -0.52317895  1.61521300  0.35320423 -2.52479715
 [13] -1.88486982  0.32220681  1.48925379  1.11124227 -0.34904393  0.71413358
 [19] -0.41218935 -1.47799327 -2.81737702  1.19820019  1.89778301 -0.27262366
 [25] -0.20830351  0.13506241 -0.38187904 -0.18426972  0.11593798 -0.77404447
 [31] -0.58022265 -0.01995625  1.32454395 -1.39333875  1.09192574 -1.41238714
 [37] -0.54142725 -0.02074870 -0.61899796  0.40540282 -0.76456202  1.64224160
 [43] -0.64427230  1.32313780  0.86566253  0.02574758 -1.00595973 -1.32046976
 [49] -0.91047136  0.08769237 -1.48896534  0.43678338 -0.63031640  0.55069026
 [55] -0.07495078  0.25523001  0.53071505  2.29455333 -0.68481772 -0.49012014
 [61]  1.06529328  0.85222188 -1.42089444  2.02717278  0.41296723 -0.87647741
 [67] -0.63127463 -0.71865965  1.03291316  0.05116318  1.28049867 -0.63808338
 [73] -0.94268775 -0.09614036 -0.02100296  0.08464245 -1.02373578 -0.33223307
 [79]  1.27234872  0.60841509 -0.26701390  0.63250592  0.16101655 -0.30468121
 [85] -0.10325031 -0.68258755 -0.25757843 -1.92213168 -1.86566209  0.15558927
 [91] -1.94207419 -0.04848329  0.34900307  1.21834777 -1.37115201  0.47447115
 [97] -2.31332602 -0.48205047 -0.69939192  1.89181819
> colRanges(tmp)
          [,1]        [,2]     [,3]       [,4]       [,5]       [,6]       [,7]
[1,] -0.192057 -0.07485619 1.405993 -0.7849979 -0.7638874 -0.4064643 0.04087847
[2,] -0.192057 -0.07485619 1.405993 -0.7849979 -0.7638874 -0.4064643 0.04087847
           [,8]      [,9]    [,10]     [,11]     [,12]    [,13]     [,14]
[1,] -0.6709895 -0.523179 1.615213 0.3532042 -2.524797 -1.88487 0.3222068
[2,] -0.6709895 -0.523179 1.615213 0.3532042 -2.524797 -1.88487 0.3222068
        [,15]    [,16]      [,17]     [,18]      [,19]     [,20]     [,21]
[1,] 1.489254 1.111242 -0.3490439 0.7141336 -0.4121894 -1.477993 -2.817377
[2,] 1.489254 1.111242 -0.3490439 0.7141336 -0.4121894 -1.477993 -2.817377
      [,22]    [,23]      [,24]      [,25]     [,26]     [,27]      [,28]
[1,] 1.1982 1.897783 -0.2726237 -0.2083035 0.1350624 -0.381879 -0.1842697
[2,] 1.1982 1.897783 -0.2726237 -0.2083035 0.1350624 -0.381879 -0.1842697
        [,29]      [,30]      [,31]       [,32]    [,33]     [,34]    [,35]
[1,] 0.115938 -0.7740445 -0.5802226 -0.01995625 1.324544 -1.393339 1.091926
[2,] 0.115938 -0.7740445 -0.5802226 -0.01995625 1.324544 -1.393339 1.091926
         [,36]      [,37]      [,38]     [,39]     [,40]     [,41]    [,42]
[1,] -1.412387 -0.5414272 -0.0207487 -0.618998 0.4054028 -0.764562 1.642242
[2,] -1.412387 -0.5414272 -0.0207487 -0.618998 0.4054028 -0.764562 1.642242
          [,43]    [,44]     [,45]      [,46]    [,47]    [,48]      [,49]
[1,] -0.6442723 1.323138 0.8656625 0.02574758 -1.00596 -1.32047 -0.9104714
[2,] -0.6442723 1.323138 0.8656625 0.02574758 -1.00596 -1.32047 -0.9104714
          [,50]     [,51]     [,52]      [,53]     [,54]       [,55]   [,56]
[1,] 0.08769237 -1.488965 0.4367834 -0.6303164 0.5506903 -0.07495078 0.25523
[2,] 0.08769237 -1.488965 0.4367834 -0.6303164 0.5506903 -0.07495078 0.25523
         [,57]    [,58]      [,59]      [,60]    [,61]     [,62]     [,63]
[1,] 0.5307151 2.294553 -0.6848177 -0.4901201 1.065293 0.8522219 -1.420894
[2,] 0.5307151 2.294553 -0.6848177 -0.4901201 1.065293 0.8522219 -1.420894
        [,64]     [,65]      [,66]      [,67]      [,68]    [,69]      [,70]
[1,] 2.027173 0.4129672 -0.8764774 -0.6312746 -0.7186597 1.032913 0.05116318
[2,] 2.027173 0.4129672 -0.8764774 -0.6312746 -0.7186597 1.032913 0.05116318
        [,71]      [,72]      [,73]       [,74]       [,75]      [,76]
[1,] 1.280499 -0.6380834 -0.9426877 -0.09614036 -0.02100296 0.08464245
[2,] 1.280499 -0.6380834 -0.9426877 -0.09614036 -0.02100296 0.08464245
         [,77]      [,78]    [,79]     [,80]      [,81]     [,82]     [,83]
[1,] -1.023736 -0.3322331 1.272349 0.6084151 -0.2670139 0.6325059 0.1610166
[2,] -1.023736 -0.3322331 1.272349 0.6084151 -0.2670139 0.6325059 0.1610166
          [,84]      [,85]      [,86]      [,87]     [,88]     [,89]     [,90]
[1,] -0.3046812 -0.1032503 -0.6825875 -0.2575784 -1.922132 -1.865662 0.1555893
[2,] -0.3046812 -0.1032503 -0.6825875 -0.2575784 -1.922132 -1.865662 0.1555893
         [,91]       [,92]     [,93]    [,94]     [,95]     [,96]     [,97]
[1,] -1.942074 -0.04848329 0.3490031 1.218348 -1.371152 0.4744711 -2.313326
[2,] -1.942074 -0.04848329 0.3490031 1.218348 -1.371152 0.4744711 -2.313326
          [,98]      [,99]   [,100]
[1,] -0.4820505 -0.6993919 1.891818
[2,] -0.4820505 -0.6993919 1.891818
> 
> 
> Max(tmp2)
[1] 2.75338
> Min(tmp2)
[1] -3.240526
> mean(tmp2)
[1] 0.05081721
> Sum(tmp2)
[1] 5.081721
> Var(tmp2)
[1] 1.297804
> 
> rowMeans(tmp2)
  [1]  1.43396489 -1.23390123 -0.38642415  0.11921182  1.30549906  0.81042484
  [7] -1.96571804 -0.27480458 -2.42145988 -1.89990314  0.03453279  0.48467553
 [13] -2.21066146  0.52720852  0.39934552  0.64553217  0.67350647 -2.29610525
 [19] -1.25699471  1.07048830 -1.70310901  0.52383151  0.45901939 -1.80895556
 [25] -1.82538458 -0.44804928  1.24946310  0.09262725  0.54029958 -0.04965557
 [31] -0.54357014 -0.66797740  2.44365346  0.52598303  0.73625061  1.06604544
 [37]  0.83153320  1.01448447 -0.23832728 -0.16128241  1.35292894 -3.24052628
 [43] -1.10132830  0.69116615  0.42969480 -0.01153292 -1.04899836 -0.33882175
 [49]  1.29799606  0.37791504  2.75337952 -1.36617190  1.52254586  0.95732526
 [55]  0.39557329  1.74078360  1.47936506 -0.87008695  1.30872308  0.44245988
 [61] -1.15664130  1.21093595  0.89197477 -1.38695421  1.26489442  0.54244621
 [67] -0.10544724 -0.56926754  1.45804753 -0.37450720 -0.43205058  0.91890809
 [73]  1.20434499 -0.70440508 -0.42159074 -0.74735894  0.91021072  0.51176814
 [79]  0.82730614  1.45184741 -0.36757528 -0.09065201  0.12891523 -0.47766734
 [85] -0.25262663  1.77319500  0.23788852  0.79437550  1.18645344 -2.12141525
 [91]  0.34081338  0.27062828 -1.98580053 -0.70266694  0.12134464  0.27737688
 [97] -1.17778275 -0.05691094 -0.60381245  0.12549132
> rowSums(tmp2)
  [1]  1.43396489 -1.23390123 -0.38642415  0.11921182  1.30549906  0.81042484
  [7] -1.96571804 -0.27480458 -2.42145988 -1.89990314  0.03453279  0.48467553
 [13] -2.21066146  0.52720852  0.39934552  0.64553217  0.67350647 -2.29610525
 [19] -1.25699471  1.07048830 -1.70310901  0.52383151  0.45901939 -1.80895556
 [25] -1.82538458 -0.44804928  1.24946310  0.09262725  0.54029958 -0.04965557
 [31] -0.54357014 -0.66797740  2.44365346  0.52598303  0.73625061  1.06604544
 [37]  0.83153320  1.01448447 -0.23832728 -0.16128241  1.35292894 -3.24052628
 [43] -1.10132830  0.69116615  0.42969480 -0.01153292 -1.04899836 -0.33882175
 [49]  1.29799606  0.37791504  2.75337952 -1.36617190  1.52254586  0.95732526
 [55]  0.39557329  1.74078360  1.47936506 -0.87008695  1.30872308  0.44245988
 [61] -1.15664130  1.21093595  0.89197477 -1.38695421  1.26489442  0.54244621
 [67] -0.10544724 -0.56926754  1.45804753 -0.37450720 -0.43205058  0.91890809
 [73]  1.20434499 -0.70440508 -0.42159074 -0.74735894  0.91021072  0.51176814
 [79]  0.82730614  1.45184741 -0.36757528 -0.09065201  0.12891523 -0.47766734
 [85] -0.25262663  1.77319500  0.23788852  0.79437550  1.18645344 -2.12141525
 [91]  0.34081338  0.27062828 -1.98580053 -0.70266694  0.12134464  0.27737688
 [97] -1.17778275 -0.05691094 -0.60381245  0.12549132
> rowVars(tmp2)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowSd(tmp2)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowMax(tmp2)
  [1]  1.43396489 -1.23390123 -0.38642415  0.11921182  1.30549906  0.81042484
  [7] -1.96571804 -0.27480458 -2.42145988 -1.89990314  0.03453279  0.48467553
 [13] -2.21066146  0.52720852  0.39934552  0.64553217  0.67350647 -2.29610525
 [19] -1.25699471  1.07048830 -1.70310901  0.52383151  0.45901939 -1.80895556
 [25] -1.82538458 -0.44804928  1.24946310  0.09262725  0.54029958 -0.04965557
 [31] -0.54357014 -0.66797740  2.44365346  0.52598303  0.73625061  1.06604544
 [37]  0.83153320  1.01448447 -0.23832728 -0.16128241  1.35292894 -3.24052628
 [43] -1.10132830  0.69116615  0.42969480 -0.01153292 -1.04899836 -0.33882175
 [49]  1.29799606  0.37791504  2.75337952 -1.36617190  1.52254586  0.95732526
 [55]  0.39557329  1.74078360  1.47936506 -0.87008695  1.30872308  0.44245988
 [61] -1.15664130  1.21093595  0.89197477 -1.38695421  1.26489442  0.54244621
 [67] -0.10544724 -0.56926754  1.45804753 -0.37450720 -0.43205058  0.91890809
 [73]  1.20434499 -0.70440508 -0.42159074 -0.74735894  0.91021072  0.51176814
 [79]  0.82730614  1.45184741 -0.36757528 -0.09065201  0.12891523 -0.47766734
 [85] -0.25262663  1.77319500  0.23788852  0.79437550  1.18645344 -2.12141525
 [91]  0.34081338  0.27062828 -1.98580053 -0.70266694  0.12134464  0.27737688
 [97] -1.17778275 -0.05691094 -0.60381245  0.12549132
> rowMin(tmp2)
  [1]  1.43396489 -1.23390123 -0.38642415  0.11921182  1.30549906  0.81042484
  [7] -1.96571804 -0.27480458 -2.42145988 -1.89990314  0.03453279  0.48467553
 [13] -2.21066146  0.52720852  0.39934552  0.64553217  0.67350647 -2.29610525
 [19] -1.25699471  1.07048830 -1.70310901  0.52383151  0.45901939 -1.80895556
 [25] -1.82538458 -0.44804928  1.24946310  0.09262725  0.54029958 -0.04965557
 [31] -0.54357014 -0.66797740  2.44365346  0.52598303  0.73625061  1.06604544
 [37]  0.83153320  1.01448447 -0.23832728 -0.16128241  1.35292894 -3.24052628
 [43] -1.10132830  0.69116615  0.42969480 -0.01153292 -1.04899836 -0.33882175
 [49]  1.29799606  0.37791504  2.75337952 -1.36617190  1.52254586  0.95732526
 [55]  0.39557329  1.74078360  1.47936506 -0.87008695  1.30872308  0.44245988
 [61] -1.15664130  1.21093595  0.89197477 -1.38695421  1.26489442  0.54244621
 [67] -0.10544724 -0.56926754  1.45804753 -0.37450720 -0.43205058  0.91890809
 [73]  1.20434499 -0.70440508 -0.42159074 -0.74735894  0.91021072  0.51176814
 [79]  0.82730614  1.45184741 -0.36757528 -0.09065201  0.12891523 -0.47766734
 [85] -0.25262663  1.77319500  0.23788852  0.79437550  1.18645344 -2.12141525
 [91]  0.34081338  0.27062828 -1.98580053 -0.70266694  0.12134464  0.27737688
 [97] -1.17778275 -0.05691094 -0.60381245  0.12549132
> 
> colMeans(tmp2)
[1] 0.05081721
> colSums(tmp2)
[1] 5.081721
> colVars(tmp2)
[1] 1.297804
> colSd(tmp2)
[1] 1.139212
> colMax(tmp2)
[1] 2.75338
> colMin(tmp2)
[1] -3.240526
> colMedians(tmp2)
[1] 0.1834019
> colRanges(tmp2)
          [,1]
[1,] -3.240526
[2,]  2.753380
> 
> dataset1 <- matrix(dataset1,1,100)
> 
> agree.checks(tmp,dataset1)
> 
> dataset2 <- matrix(dataset2,100,1)
> agree.checks(tmp2,dataset2)
>   
> 
> tmp <- createBufferedMatrix(10,10)
> 
> tmp[1:10,1:10] <- rnorm(100)
> colApply(tmp,sum)
 [1] -0.0273581  1.8368037  2.1862005 -1.1172659 -0.1303521  2.1592923
 [7] -0.1491266 -2.8465085  2.5760267 -0.5625559
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -1.3758741
[2,] -1.0392845
[3,] -0.2536152
[4,]  1.0017522
[5,]  2.1041844
> 
> rowApply(tmp,sum)
 [1]  6.1490480 -0.3079103  2.7351760  1.7929515 -1.5435586 -0.6046294
 [7] -0.8339846  2.3480088  0.4412934 -6.2512387
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    8    2    6   10    1    2    5   10    4     2
 [2,]    4    9    7    7    5    7    3    3    6     7
 [3,]    5   10    4    6    3    3    7    6   10     6
 [4,]    7    7    8    5    4    8    1    5    2     1
 [5,]   10    3    5    9   10    4    4    4    1     3
 [6,]    6    8    3    4    8   10    8    2    3    10
 [7,]    2    6   10    1    9    6    2    1    8     8
 [8,]    1    1    1    2    7    9    9    7    7     5
 [9,]    3    4    9    8    2    5    6    8    9     9
[10,]    9    5    2    3    6    1   10    9    5     4
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1] -4.0929512 -0.1299376  0.5683854  0.4021005  1.1925347 -0.6486457
 [7]  6.1225078 -0.3524970 -1.4200011  0.8481767 -1.6759419  0.1204061
[13]  0.9344394 -1.9449755 -0.8427850  1.7215096 -2.0792841 -1.3549025
[19]  1.0479218 -0.2769775
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -1.4475593
[2,] -1.2411433
[3,] -0.8390210
[4,] -0.3658315
[5,] -0.1993962
> 
> rowApply(tmp,sum)
[1] -5.609881 -3.901890 -5.587226  6.232878  7.005203
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]   12   10    2    2    4
[2,]   16    2    6   17    9
[3,]   10   16   10   16    8
[4,]   20   14   11    6    5
[5,]   18    9   19    5   10
> 
> 
> as.matrix(tmp)
           [,1]        [,2]       [,3]        [,4]        [,5]       [,6]
[1,] -0.1993962  0.47124857 -0.5465925  1.75609035  1.42875656 -0.2358586
[2,] -0.3658315 -1.35123108  0.2016252  0.05141411 -0.60907541  1.5220111
[3,] -1.2411433 -0.78337072 -0.3395099 -0.30368158  0.77926382 -0.5368664
[4,] -1.4475593  1.56596538  1.4025181 -0.37882042 -0.38106991 -2.4364873
[5,] -0.8390210 -0.03254977 -0.1496555 -0.72290193 -0.02534038  1.0385555
            [,7]        [,8]       [,9]       [,10]      [,11]       [,12]
[1,]  0.23896137 -1.47871565 -1.4299935 -1.29867008 -1.0503499 -1.05258312
[2,] -0.03839626 -0.83608601  0.9857631 -0.03941048 -1.2654937 -0.97761854
[3,]  1.97990827  0.37311718 -0.8354218 -0.64633535  0.3088979 -0.01500411
[4,]  1.65413491  0.05537823 -1.3750976  1.06093998  0.6301110  0.43632525
[5,]  2.28789951  1.53380926  1.2347488  1.77165266 -0.2991073  1.72928664
          [,13]      [,14]      [,15]       [,16]      [,17]      [,18]
[1,]  0.1166177 -1.3850064 -1.2987439  0.04610421  1.2381210 -1.0914210
[2,] -0.9767384 -1.0412767  0.0212021  2.02059333 -2.0055922 -0.6563868
[3,]  0.2611682 -1.1744041 -1.1484759 -0.02948725 -0.1994681  0.1409396
[4,]  0.2951888  2.5481054  2.2709756  0.88068337 -0.2672262 -0.6146078
[5,]  1.2382032 -0.8923938 -0.6877429 -1.19638403 -0.8451185  0.8665735
          [,19]       [,20]
[1,]  1.5292613 -1.36771156
[2,]  0.1740111  1.28462672
[3,] -1.5033815 -0.67397133
[4,]  0.3991188 -0.06569882
[5,]  0.4489121  0.54577745
> 
> 
> 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 :  655  bytes.
Disk usage :  200  bytes.
> subBufferedMatrix(tmp,,5:8)
BufferedMatrix object
Matrix size:  5 4 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.18-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  567  bytes.
Disk usage :  160  bytes.
> subBufferedMatrix(tmp,1:3,)
BufferedMatrix object
Matrix size:  3 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.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.6488192 1.71395 -0.8875412 -0.3610107 1.77937 -0.6577412 0.6886312
           col8      col9      col10    col11      col12    col13    col14
row1 -0.2995948 0.9814229 -0.5454895 0.360555 0.03347744 1.437439 1.338648
         col15     col16     col17    col18      col19    col20
row1 0.5002008 0.9096392 0.7446643 0.870833 0.05307386 -1.46765
> tmp[,"col10"]
           col10
row1 -0.54548949
row2  0.52223859
row3 -0.37594461
row4  0.74109898
row5  0.05634309
> tmp[c("row1","row5"),]
           col1       col2       col3       col4      col5       col6      col7
row1 -0.6488192  1.7139495 -0.8875412 -0.3610107 1.7793703 -0.6577412 0.6886312
row5 -1.1594778 -0.4140679  0.3228548 -1.8177948 0.2274123  0.5131365 0.4293323
           col8      col9       col10     col11      col12      col13
row1 -0.2995948 0.9814229 -0.54548949 0.3605550 0.03347744  1.4374389
row5  0.9638156 0.1303217  0.05634309 0.1951074 1.05438088 -0.9223217
          col14      col15     col16      col17     col18       col19
row1  1.3386480  0.5002008 0.9096392  0.7446643 0.8708330  0.05307386
row5 -0.5073223 -1.0593503 0.4919426 -0.4446915 0.1832544 -1.88637380
          col20
row1 -1.4676502
row5  0.5688816
> tmp[,c("col6","col20")]
            col6      col20
row1 -0.65774116 -1.4676502
row2 -1.50932234 -0.7000391
row3  0.49099850 -0.2210199
row4  0.07947382  0.9818813
row5  0.51313649  0.5688816
> tmp[c("row1","row5"),c("col6","col20")]
           col6      col20
row1 -0.6577412 -1.4676502
row5  0.5131365  0.5688816
> 
> 
> 
> 
> 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 47.90339 49.29694 50.89188 49.09256 50.37545 102.8696 50.73271 50.80035
         col9    col10    col11    col12   col13   col14    col15    col16
row1 48.52588 50.05237 49.93648 49.70397 49.4753 50.8234 50.26847 49.17536
        col17    col18    col19    col20
row1 50.29758 48.95776 49.05725 105.4775
> tmp[,"col10"]
        col10
row1 50.05237
row2 29.94677
row3 31.72975
row4 30.23947
row5 50.86980
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 47.90339 49.29694 50.89188 49.09256 50.37545 102.8696 50.73271 50.80035
row5 51.41394 50.69639 50.76665 49.41489 49.18747 104.7822 49.14636 51.31664
         col9    col10    col11    col12    col13    col14    col15    col16
row1 48.52588 50.05237 49.93648 49.70397 49.47530 50.82340 50.26847 49.17536
row5 50.22636 50.86980 50.30048 49.19235 50.15061 51.71732 49.88046 50.98311
        col17    col18    col19    col20
row1 50.29758 48.95776 49.05725 105.4775
row5 49.50639 49.81616 51.05999 106.0679
> tmp[,c("col6","col20")]
          col6     col20
row1 102.86959 105.47751
row2  75.94199  76.23362
row3  75.18181  74.47396
row4  75.19509  76.19034
row5 104.78216 106.06790
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 102.8696 105.4775
row5 104.7822 106.0679
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 102.8696 105.4775
row5 104.7822 106.0679
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
          col13
[1,]  2.2488202
[2,] -0.3137606
[3,]  0.9188788
[4,] -2.0182743
[5,] -0.4986146
> tmp[,c("col17","col7")]
          col17       col7
[1,] -0.5100361 -0.6362928
[2,]  1.9576094  1.3733730
[3,] -0.4900161 -0.9700827
[4,]  2.3735494  0.3523671
[5,] -0.8507637  0.1760753
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
            col6      col20
[1,]  0.69089739 -0.8410935
[2,]  1.51827300  1.2204516
[3,] -0.04341543  0.5512339
[4,]  0.48130831  0.2706269
[5,]  0.83115270 -0.4568194
> subBufferedMatrix(tmp,1,c("col6"))[,1]
          col1
[1,] 0.6908974
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
          col6
[1,] 0.6908974
[2,] 1.5182730
> 
> 
> 
> 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.2345122  0.9742627  0.06405857 -0.6832829  1.131769 -1.3636340
row1 -1.9261635 -2.6178457 -0.53503074  2.3946548 -2.280947  0.4047736
           [,7]        [,8]      [,9]       [,10]     [,11]      [,12]    [,13]
row3 -0.8013691 0.007645097 0.3054592  0.02884295 -1.381871 -0.9697175 0.770685
row1 -0.5975489 1.351008683 0.7970257 -0.28147916  1.191715 -0.8982073 1.142580
          [,14]     [,15]     [,16]     [,17]     [,18]      [,19]      [,20]
row3 -0.1112061 0.6628991 0.8461462  0.725993 1.6689697  0.6529221 -0.8856435
row1  1.1913230 1.1523328 0.4097535 -1.242890 0.2699778 -1.1734286 -1.1547252
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
           [,1]     [,2]      [,3]        [,4]      [,5]      [,6]     [,7]
row2 -0.4376469 1.012365 0.7436925 -0.02127506 0.5336194 -1.798879 1.271177
           [,8]     [,9]      [,10]
row2 -0.2843398 1.002058 -0.3360061
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
            [,1]     [,2]       [,3]     [,4]      [,5]       [,6]       [,7]
row5 -0.06336796 1.508774 -0.4021084 1.347945 0.1978693 -0.5678497 -0.7391043
           [,8]      [,9]     [,10]   [,11]     [,12]      [,13]    [,14]
row5 -0.2619837 -1.640861 0.5129514 1.49845 -0.379034 -0.9522804 1.696365
          [,15]      [,16]      [,17]     [,18]     [,19]      [,20]
row5 -0.6017396 0.09272818 -0.8041554 0.9392286 -1.256194 -0.2343499
> 
> 
> 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: 0x600003694240>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "/Users/biocbuild/bbs-3.18-bioc/meat/BufferedMatrix.Rcheck/tests/BM121cf7fe98f18"
 [2] "/Users/biocbuild/bbs-3.18-bioc/meat/BufferedMatrix.Rcheck/tests/BM121cf3eb1b243"
 [3] "/Users/biocbuild/bbs-3.18-bioc/meat/BufferedMatrix.Rcheck/tests/BM121cf42e6cdd" 
 [4] "/Users/biocbuild/bbs-3.18-bioc/meat/BufferedMatrix.Rcheck/tests/BM121cf3ed2350" 
 [5] "/Users/biocbuild/bbs-3.18-bioc/meat/BufferedMatrix.Rcheck/tests/BM121cf45a95b33"
 [6] "/Users/biocbuild/bbs-3.18-bioc/meat/BufferedMatrix.Rcheck/tests/BM121cf71a294ff"
 [7] "/Users/biocbuild/bbs-3.18-bioc/meat/BufferedMatrix.Rcheck/tests/BM121cf68e42ba1"
 [8] "/Users/biocbuild/bbs-3.18-bioc/meat/BufferedMatrix.Rcheck/tests/BM121cf5bec8cd3"
 [9] "/Users/biocbuild/bbs-3.18-bioc/meat/BufferedMatrix.Rcheck/tests/BM121cf7119fcb" 
[10] "/Users/biocbuild/bbs-3.18-bioc/meat/BufferedMatrix.Rcheck/tests/BM121cf1611cc0d"
[11] "/Users/biocbuild/bbs-3.18-bioc/meat/BufferedMatrix.Rcheck/tests/BM121cf6a6b74cc"
[12] "/Users/biocbuild/bbs-3.18-bioc/meat/BufferedMatrix.Rcheck/tests/BM121cf34c133a9"
[13] "/Users/biocbuild/bbs-3.18-bioc/meat/BufferedMatrix.Rcheck/tests/BM121cf7826b74d"
[14] "/Users/biocbuild/bbs-3.18-bioc/meat/BufferedMatrix.Rcheck/tests/BM121cf35cc5ddb"
[15] "/Users/biocbuild/bbs-3.18-bioc/meat/BufferedMatrix.Rcheck/tests/BM121cf7c25f074"
> 
> 
> ### 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: 0x6000036ac300>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x6000036ac300>
Warning message:
In dir.create(new.directory) :
  '/Users/biocbuild/bbs-3.18-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x6000036ac300>
> rowMedians(tmp)
  [1] -0.237497962  0.146689130 -0.326123082  0.217754338 -0.739983519
  [6] -0.100904631  0.413630998 -0.050420106 -0.261313542  0.096983521
 [11]  0.120294955  0.457625791 -0.135607065  0.186460492 -0.342088882
 [16] -0.410242711  0.332694137  0.194319580  0.050821365  0.114346675
 [21] -0.430358738 -0.187626640  0.272518423  0.217352954  0.047579126
 [26]  0.355620709  0.040822339  0.656908012 -0.232864176  0.262736853
 [31] -0.468243612 -0.222825827  0.129453723 -0.042056590 -0.089469289
 [36]  0.485817271 -0.122568405  0.133592037  0.039200547 -0.072703955
 [41]  0.263981855  0.524422337  0.102012606  0.607844741  0.113985515
 [46] -0.174519489 -0.300163802  0.294355310  0.032155397  0.104657855
 [51]  0.049814285  0.157463581 -0.767711794 -0.407723880 -0.171042225
 [56]  0.194323310  0.035080869 -0.264841454  0.249680171 -0.091631585
 [61] -0.339887836  0.298187368  0.344826772 -0.113585082  0.111769754
 [66] -0.357980627  0.232241813  0.169513058  0.374822219 -0.010597074
 [71]  0.213944025  0.210246554  0.298492866  0.002251338 -0.041169830
 [76]  0.425166972 -0.037968467  0.037644684  0.235514881 -0.157506515
 [81] -0.360164687 -0.019342354  0.250303538 -0.413806776  0.078371729
 [86]  0.449601418 -0.113282041  0.309303329 -0.246007721  0.148674391
 [91]  0.578220732  0.174370620 -0.071202611  0.054633317 -0.239236663
 [96]  0.163160862 -0.211513413  0.272135983 -0.292692469  0.159489268
[101]  0.362659325 -0.119890610 -0.563115686 -0.140686750 -0.235926836
[106]  0.183620279 -0.333558168  0.237651912 -0.153733631  0.139023333
[111]  0.406712598 -0.049375170  0.209992522 -0.792634186  0.419191278
[116]  0.327205928 -0.025055746 -0.624462556 -0.266276765  0.269603318
[121] -0.271010313 -0.320533330  0.001045296  0.365367607 -0.078054730
[126]  0.052675788 -0.094331973 -0.179927028 -0.138614535  0.099203646
[131]  0.197654913  0.212123467  0.575167545 -0.140284760  0.298014998
[136] -0.029258498  0.070261843  0.181160526  0.228423047 -0.058628275
[141]  0.192752696  0.151368007 -0.173922077  0.292767706 -0.086911770
[146] -0.604839134  0.028744524 -0.530637224  0.435190905 -0.114558758
[151] -0.237654898  0.013565517 -0.007451529  0.111393298 -0.098644896
[156] -0.321855610  0.153966823  0.021960183 -0.050534998 -0.162546159
[161] -0.421567820 -0.284032148 -0.216362369  0.020131577  0.428227908
[166] -0.252946690  0.742043991 -0.026608630 -0.696873166  0.088697279
[171]  0.107200356  0.608702091  0.499272591 -0.137020793 -0.541208235
[176] -0.066910650  0.175662980 -0.146816265  0.222230840  0.086287557
[181] -0.007836450  0.420264149  0.364613952 -0.201230041  0.460094535
[186] -0.068916748  0.345368717 -0.239349931 -0.419575837  0.558794466
[191]  0.163686581 -0.178654843 -0.250055885  0.025229449 -0.293988709
[196]  0.393113191 -0.529425795  0.011627386 -0.275584807  0.047492520
[201] -0.365347295 -0.204211398 -0.045889270  0.007033545  0.235153763
[206] -0.391351776  0.041499160 -0.068353233 -0.284508725 -0.109876802
[211]  0.115087609 -0.206591776  0.127782643  0.002723982 -0.066480733
[216] -0.193969143 -0.300526483  0.393087506 -0.237322448  0.313514758
[221]  0.300541554  0.398072870  0.100631689  0.099829387 -0.295896620
[226] -0.482743029  0.250480083  0.400578026 -0.236696515  0.197768074
> 
> proc.time()
   user  system elapsed 
  4.939  17.747  25.671 

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: 0x600001338240>
> .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: 0x600001338240>
> .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: 0x600001338240>
> .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: 0x600001338240>
> 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: 0x600001300000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600001300000>
> .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: 0x600001300000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600001300000>
> .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: 0x600001300000>
> 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: 0x600001300180>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600001300180>
> .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: 0x600001300180>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x600001300180>
> .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: 0x600001300180>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x600001300180>
> .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: 0x600001300180>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x600001300180>
> .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: 0x600001300180>
> 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: 0x6000013081e0>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x6000013081e0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000013081e0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000013081e0>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile138bb1e90afaa" "BufferedMatrixFile138bb2cfcd193"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile138bb1e90afaa" "BufferedMatrixFile138bb2cfcd193"
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x60000131c240>
> .Call("R_bm_AddColumn",P)
<pointer: 0x60000131c240>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x60000131c240>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x60000131c240>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x60000131c240>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x60000131c240>
> .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: 0x60000131c420>
> .Call("R_bm_AddColumn",P)
<pointer: 0x60000131c420>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x60000131c420>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x60000131c420>
> 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: 0x600001304000>
> .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: 0x600001304000>
> rm(P)
> 
> proc.time()
   user  system elapsed 
  0.591   0.211   0.860 

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.681 

Example timings