Back to Multiple platform build/check report for BioC 3.10
A[B]CDEFGHIJKLMNOPQRSTUVWXYZ

CHECK report for BufferedMatrix on merida1

This page was generated on 2020-04-15 12:35:00 -0400 (Wed, 15 Apr 2020).

Package 205/1823HostnameOS / ArchINSTALLBUILDCHECKBUILD BIN
BufferedMatrix 1.50.0
Ben Bolstad
Snapshot Date: 2020-04-14 16:46:13 -0400 (Tue, 14 Apr 2020)
URL: https://git.bioconductor.org/packages/BufferedMatrix
Branch: RELEASE_3_10
Last Commit: c7a0fa5
Last Changed Date: 2019-10-29 13:07:46 -0400 (Tue, 29 Oct 2019)
malbec1 Linux (Ubuntu 18.04.4 LTS) / x86_64  OK  OK  OK UNNEEDED, same version exists in internal repository
tokay1 Windows Server 2012 R2 Standard / x64  OK  OK  OK  OK UNNEEDED, same version exists in internal repository
merida1 OS X 10.11.6 El Capitan / x86_64  OK  OK [ OK ] OK UNNEEDED, same version exists in internal repository

Summary

Package: BufferedMatrix
Version: 1.50.0
Command: /Library/Frameworks/R.framework/Versions/Current/Resources/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/Library/Frameworks/R.framework/Versions/Current/Resources/library --no-vignettes --timings BufferedMatrix_1.50.0.tar.gz
StartedAt: 2020-04-15 00:51:42 -0400 (Wed, 15 Apr 2020)
EndedAt: 2020-04-15 00:52:23 -0400 (Wed, 15 Apr 2020)
EllapsedTime: 40.8 seconds
RetCode: 0
Status:  OK 
CheckDir: BufferedMatrix.Rcheck
Warnings: 0

Command output

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


* using log directory ‘/Users/biocbuild/bbs-3.10-bioc/meat/BufferedMatrix.Rcheck’
* using R version 3.6.3 (2020-02-29)
* using platform: x86_64-apple-darwin15.6.0 (64-bit)
* using session charset: UTF-8
* using option ‘--no-vignettes’
* checking for file ‘BufferedMatrix/DESCRIPTION’ ... OK
* this is package ‘BufferedMatrix’ version ‘1.50.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 ... OK
* 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: 2 NOTEs
See
  ‘/Users/biocbuild/bbs-3.10-bioc/meat/BufferedMatrix.Rcheck/00check.log’
for details.



Installation output

BufferedMatrix.Rcheck/00install.out

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


* installing to library ‘/Library/Frameworks/R.framework/Versions/3.6/Resources/library’
* installing *source* package ‘BufferedMatrix’ ...
** using staged installation
** libs
clang -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -I/usr/local/include  -fPIC  -Wall -g -O2  -c RBufferedMatrix.c -o RBufferedMatrix.o
clang -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -I/usr/local/include  -fPIC  -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 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -I/usr/local/include  -fPIC  -Wall -g -O2  -c doubleBufferedMatrix_C_tests.c -o doubleBufferedMatrix_C_tests.o
clang -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -I/usr/local/include  -fPIC  -Wall -g -O2  -c init_package.c -o init_package.o
clang -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -single_module -multiply_defined suppress -L/Library/Frameworks/R.framework/Resources/lib -L/usr/local/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/3.6/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 3.6.3 (2020-02-29) -- "Holding the Windsock"
Copyright (C) 2020 The R Foundation for Statistical Computing
Platform: x86_64-apple-darwin15.6.0 (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.417   0.108   0.502 

BufferedMatrix.Rcheck/tests/objectTesting.Rout


R version 3.6.3 (2020-02-29) -- "Holding the Windsock"
Copyright (C) 2020 The R Foundation for Statistical Computing
Platform: x86_64-apple-darwin15.6.0 (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.10-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 415836 22.3     879997   47         NA   616211 33.0
Vcells 749254  5.8    8388608   64      65536  1811279 13.9
> 
> 
> 
> 
> ##
> ## checking reads
> ##
> 
> tmp2 <- createBufferedMatrix(10,20)
> 
> test.sample <- rnorm(10*20)
> 
> tmp2[1:10,1:20] <- test.sample
> 
> test.matrix <- matrix(test.sample,10,20)
> 
> ## testing reads
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   which.col <- sample(1:20,1)
+   if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> date()
[1] "Wed Apr 15 00:52:06 2020"
> 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] "Wed Apr 15 00:52:06 2020"
> 
> 
> 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: 0x7f92a9910c50>
> 
> 
> 
> 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] "Wed Apr 15 00:52:08 2020"
> 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] "Wed Apr 15 00:52:09 2020"
> 
> ColMode(tmp2)
<pointer: 0x7f92a9910c50>
> 
> 
> 
> ### Now testing assignments
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+ 
+   new.data <- rnorm(20)
+   tmp2[which.row,] <- new.data
+   test.matrix[which.row,] <- new.data
+   if (rep > 1){
+     if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+   
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   new.data <- rnorm(10)
+   tmp2[,which.col] <- new.data
+   test.matrix[,which.col]<- new.data
+ 
+   if (rep > 1){
+     if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.col <- which.col
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,5,replace=TRUE)
+   new.data <- matrix(rnorm(50),5,10)
+   tmp2[,which.col] <- new.data
+   test.matrix[,which.col]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.col <- which.col
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   new.data <- matrix(rnorm(50),5,10)
+   tmp2[which.row,] <- new.data
+   test.matrix[which.row,]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col  <- sample(1:20,5,replace=TRUE)
+   new.data <- matrix(rnorm(25),5,5)
+   tmp2[which.row,which.col] <- new.data
+   test.matrix[which.row,which.col]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[prev.row,prev.col] == test.matrix[prev.row,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+   prev.col <- which.col
+ }
> 
> 
> 
> 
> ###
> ###
> ### testing some more functions
> ###
> 
> 
> 
> ## duplication function
> tmp5 <- duplicate(tmp2)
> 
> # making sure really did copy everything.
> tmp5[1,1] <- tmp5[1,1] +100.00
> 
> if (tmp5[1,1] == tmp2[1,1]){
+   stop("Problem with duplication")
+ }
> 
> 
> 
> 
> ### testing elementwise applying of functions
> 
> tmp5[1:4,1:4]
            [,1]       [,2]        [,3]         [,4]
[1,] 100.0682862  0.9168799  0.26827600 -0.008779983
[2,]   0.3250981 -2.7610675 -1.18704795  0.279778476
[3,]   0.9782585 -1.0644497  0.04675994  0.767569917
[4,]   0.6335836 -0.3268276 -0.94739438  0.033803277
> ewApply(tmp5,abs)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.10-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
            [,1]      [,2]       [,3]        [,4]
[1,] 100.0682862 0.9168799 0.26827600 0.008779983
[2,]   0.3250981 2.7610675 1.18704795 0.279778476
[3,]   0.9782585 1.0644497 0.04675994 0.767569917
[4,]   0.6335836 0.3268276 0.94739438 0.033803277
> ewApply(tmp5,sqrt)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.10-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
           [,1]      [,2]      [,3]       [,4]
[1,] 10.0034137 0.9575384 0.5179537 0.09370156
[2,]  0.5701737 1.6616460 1.0895173 0.52894090
[3,]  0.9890695 1.0317217 0.2162405 0.87611068
[4,]  0.7959797 0.5716884 0.9733419 0.18385667
> 
> 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.10-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
          [,1]     [,2]     [,3]     [,4]
[1,] 225.10242 35.49226 30.44781 25.94580
[2,]  31.02684 44.37753 37.08222 30.56919
[3,]  35.86895 36.38167 27.20916 34.52868
[4,]  33.59338 31.04371 35.68081 26.87237
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x7f92a25236a0>
> exp(tmp5)
<pointer: 0x7f92a25236a0>
> log(tmp5,2)
<pointer: 0x7f92a25236a0>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 468.5212
> Min(tmp5)
[1] 53.80077
> mean(tmp5)
[1] 71.70822
> Sum(tmp5)
[1] 14341.64
> Var(tmp5)
[1] 863.0241
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 91.11446 70.26261 70.44425 71.92547 71.01145 69.22857 69.13830 68.45717
 [9] 68.40488 67.09502
> rowSums(tmp5)
 [1] 1822.289 1405.252 1408.885 1438.509 1420.229 1384.571 1382.766 1369.143
 [9] 1368.098 1341.900
> rowVars(tmp5)
 [1] 7956.62397   76.22303   41.31161   59.94388  107.35571  115.25214
 [7]   67.37792   67.96497   39.33306   48.35205
> rowSd(tmp5)
 [1] 89.199910  8.730580  6.427411  7.742343 10.361260 10.735555  8.208406
 [8]  8.244087  6.271607  6.953564
> rowMax(tmp5)
 [1] 468.52120  92.36601  78.26907  87.34712  86.96350  84.51885  85.16931
 [8]  83.11466  77.32627  80.94093
> rowMin(tmp5)
 [1] 54.00277 58.96425 55.93204 55.93132 53.96733 55.38394 55.43691 53.80077
 [9] 59.09431 54.06135
> 
> colMeans(tmp5)
 [1] 111.01308  71.51002  73.69809  62.57671  71.50552  68.61914  68.90170
 [8]  70.62460  70.35891  69.30378  63.57765  68.78395  70.26097  68.54867
[15]  70.53785  69.25954  69.23461  74.15109  73.86634  67.83213
> colSums(tmp5)
 [1] 1110.1308  715.1002  736.9809  625.7671  715.0552  686.1914  689.0170
 [8]  706.2460  703.5891  693.0378  635.7765  687.8395  702.6097  685.4867
[15]  705.3785  692.5954  692.3461  741.5109  738.6634  678.3213
> colVars(tmp5)
 [1] 15816.22452    92.61391    79.55105    55.80158    67.39629    44.69549
 [7]    93.83319    65.33914    69.64876    56.61223    42.24526    56.71035
[13]    61.48005    68.82004    61.03634   129.09212    46.37794    32.71777
[19]   121.72872    37.87458
> colSd(tmp5)
 [1] 125.762572   9.623612   8.919139   7.470045   8.209524   6.685469
 [7]   9.686753   8.083263   8.345583   7.524110   6.499635   7.530628
[13]   7.840921   8.295784   7.812576  11.361871   6.810135   5.719945
[19]  11.033074   6.154233
> colMax(tmp5)
 [1] 468.52120  92.36601  84.90136  72.63968  86.96350  81.84568  86.22511
 [8]  83.43078  82.44610  77.94167  74.77615  81.92677  84.51885  79.73843
[15]  83.44246  91.96819  84.11330  85.77636  87.34712  73.74175
> colMin(tmp5)
 [1] 64.40314 56.73554 56.63231 53.96733 61.87555 59.09431 55.43691 62.10603
 [9] 53.80077 55.93204 55.38394 58.96425 56.30028 57.88826 56.77080 55.84243
[17] 61.01485 64.52515 54.06135 56.02960
> 
> 
> ### setting a random element to NA and then testing with na.rm=TRUE or na.rm=FALSE (The default)
> 
> 
> which.row <- sample(1:10,1,replace=TRUE)
> which.col  <- sample(1:20,1,replace=TRUE)
> 
> tmp5[which.row,which.col] <- NA
> 
> Max(tmp5)
[1] NA
> Min(tmp5)
[1] NA
> mean(tmp5)
[1] NA
> Sum(tmp5)
[1] NA
> Var(tmp5)
[1] NA
> 
> rowMeans(tmp5)
 [1] 91.11446 70.26261 70.44425 71.92547 71.01145 69.22857       NA 68.45717
 [9] 68.40488 67.09502
> rowSums(tmp5)
 [1] 1822.289 1405.252 1408.885 1438.509 1420.229 1384.571       NA 1369.143
 [9] 1368.098 1341.900
> rowVars(tmp5)
 [1] 7956.62397   76.22303   41.31161   59.94388  107.35571  115.25214
 [7]   68.41203   67.96497   39.33306   48.35205
> rowSd(tmp5)
 [1] 89.199910  8.730580  6.427411  7.742343 10.361260 10.735555  8.271156
 [8]  8.244087  6.271607  6.953564
> rowMax(tmp5)
 [1] 468.52120  92.36601  78.26907  87.34712  86.96350  84.51885        NA
 [8]  83.11466  77.32627  80.94093
> rowMin(tmp5)
 [1] 54.00277 58.96425 55.93204 55.93132 53.96733 55.38394       NA 53.80077
 [9] 59.09431 54.06135
> 
> colMeans(tmp5)
 [1] 111.01308  71.51002  73.69809  62.57671  71.50552  68.61914  68.90170
 [8]  70.62460  70.35891  69.30378  63.57765  68.78395  70.26097        NA
[15]  70.53785  69.25954  69.23461  74.15109  73.86634  67.83213
> colSums(tmp5)
 [1] 1110.1308  715.1002  736.9809  625.7671  715.0552  686.1914  689.0170
 [8]  706.2460  703.5891  693.0378  635.7765  687.8395  702.6097        NA
[15]  705.3785  692.5954  692.3461  741.5109  738.6634  678.3213
> colVars(tmp5)
 [1] 15816.22452    92.61391    79.55105    55.80158    67.39629    44.69549
 [7]    93.83319    65.33914    69.64876    56.61223    42.24526    56.71035
[13]    61.48005          NA    61.03634   129.09212    46.37794    32.71777
[19]   121.72872    37.87458
> colSd(tmp5)
 [1] 125.762572   9.623612   8.919139   7.470045   8.209524   6.685469
 [7]   9.686753   8.083263   8.345583   7.524110   6.499635   7.530628
[13]   7.840921         NA   7.812576  11.361871   6.810135   5.719945
[19]  11.033074   6.154233
> colMax(tmp5)
 [1] 468.52120  92.36601  84.90136  72.63968  86.96350  81.84568  86.22511
 [8]  83.43078  82.44610  77.94167  74.77615  81.92677  84.51885        NA
[15]  83.44246  91.96819  84.11330  85.77636  87.34712  73.74175
> colMin(tmp5)
 [1] 64.40314 56.73554 56.63231 53.96733 61.87555 59.09431 55.43691 62.10603
 [9] 53.80077 55.93204 55.38394 58.96425 56.30028       NA 56.77080 55.84243
[17] 61.01485 64.52515 54.06135 56.02960
> 
> Max(tmp5,na.rm=TRUE)
[1] 468.5212
> Min(tmp5,na.rm=TRUE)
[1] 53.80077
> mean(tmp5,na.rm=TRUE)
[1] 71.68693
> Sum(tmp5,na.rm=TRUE)
[1] 14265.7
> Var(tmp5,na.rm=TRUE)
[1] 867.2917
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 91.11446 70.26261 70.44425 71.92547 71.01145 69.22857 68.78007 68.45717
 [9] 68.40488 67.09502
> rowSums(tmp5,na.rm=TRUE)
 [1] 1822.289 1405.252 1408.885 1438.509 1420.229 1384.571 1306.821 1369.143
 [9] 1368.098 1341.900
> rowVars(tmp5,na.rm=TRUE)
 [1] 7956.62397   76.22303   41.31161   59.94388  107.35571  115.25214
 [7]   68.41203   67.96497   39.33306   48.35205
> rowSd(tmp5,na.rm=TRUE)
 [1] 89.199910  8.730580  6.427411  7.742343 10.361260 10.735555  8.271156
 [8]  8.244087  6.271607  6.953564
> rowMax(tmp5,na.rm=TRUE)
 [1] 468.52120  92.36601  78.26907  87.34712  86.96350  84.51885  85.16931
 [8]  83.11466  77.32627  80.94093
> rowMin(tmp5,na.rm=TRUE)
 [1] 54.00277 58.96425 55.93204 55.93132 53.96733 55.38394 55.43691 53.80077
 [9] 59.09431 54.06135
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 111.01308  71.51002  73.69809  62.57671  71.50552  68.61914  68.90170
 [8]  70.62460  70.35891  69.30378  63.57765  68.78395  70.26097  67.72690
[15]  70.53785  69.25954  69.23461  74.15109  73.86634  67.83213
> colSums(tmp5,na.rm=TRUE)
 [1] 1110.1308  715.1002  736.9809  625.7671  715.0552  686.1914  689.0170
 [8]  706.2460  703.5891  693.0378  635.7765  687.8395  702.6097  609.5421
[15]  705.3785  692.5954  692.3461  741.5109  738.6634  678.3213
> colVars(tmp5,na.rm=TRUE)
 [1] 15816.22452    92.61391    79.55105    55.80158    67.39629    44.69549
 [7]    93.83319    65.33914    69.64876    56.61223    42.24526    56.71035
[13]    61.48005    69.82533    61.03634   129.09212    46.37794    32.71777
[19]   121.72872    37.87458
> colSd(tmp5,na.rm=TRUE)
 [1] 125.762572   9.623612   8.919139   7.470045   8.209524   6.685469
 [7]   9.686753   8.083263   8.345583   7.524110   6.499635   7.530628
[13]   7.840921   8.356155   7.812576  11.361871   6.810135   5.719945
[19]  11.033074   6.154233
> colMax(tmp5,na.rm=TRUE)
 [1] 468.52120  92.36601  84.90136  72.63968  86.96350  81.84568  86.22511
 [8]  83.43078  82.44610  77.94167  74.77615  81.92677  84.51885  79.73843
[15]  83.44246  91.96819  84.11330  85.77636  87.34712  73.74175
> colMin(tmp5,na.rm=TRUE)
 [1] 64.40314 56.73554 56.63231 53.96733 61.87555 59.09431 55.43691 62.10603
 [9] 53.80077 55.93204 55.38394 58.96425 56.30028 57.88826 56.77080 55.84243
[17] 61.01485 64.52515 54.06135 56.02960
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1] 91.11446 70.26261 70.44425 71.92547 71.01145 69.22857      NaN 68.45717
 [9] 68.40488 67.09502
> rowSums(tmp5,na.rm=TRUE)
 [1] 1822.289 1405.252 1408.885 1438.509 1420.229 1384.571    0.000 1369.143
 [9] 1368.098 1341.900
> rowVars(tmp5,na.rm=TRUE)
 [1] 7956.62397   76.22303   41.31161   59.94388  107.35571  115.25214
 [7]         NA   67.96497   39.33306   48.35205
> rowSd(tmp5,na.rm=TRUE)
 [1] 89.199910  8.730580  6.427411  7.742343 10.361260 10.735555        NA
 [8]  8.244087  6.271607  6.953564
> rowMax(tmp5,na.rm=TRUE)
 [1] 468.52120  92.36601  78.26907  87.34712  86.96350  84.51885        NA
 [8]  83.11466  77.32627  80.94093
> rowMin(tmp5,na.rm=TRUE)
 [1] 54.00277 58.96425 55.93204 55.93132 53.96733 55.38394       NA 53.80077
 [9] 59.09431 54.06135
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1] 114.86894  70.96118  74.35574  62.75499  72.57072  67.14953  70.39778
 [8]  69.88574  71.03930  70.02049  63.67865  68.38479  70.81808       NaN
[15]  70.17966  69.19954  69.58153  74.54774  72.61046  69.14353
> colSums(tmp5,na.rm=TRUE)
 [1] 1033.8205  638.6506  669.2016  564.7950  653.1365  604.3458  633.5800
 [8]  628.9717  639.3537  630.1844  573.1078  615.4631  637.3627    0.0000
[15]  631.6169  622.7958  626.2338  670.9296  653.4941  622.2918
> colVars(tmp5,na.rm=TRUE)
 [1] 17625.99103   100.80188    84.62936    62.41920    63.05593    25.98502
 [7]    80.38171    67.36493    73.14684    57.90990    47.41116    62.00668
[13]    65.67334          NA    67.22248   145.18813    50.82121    35.03752
[19]   119.20076    23.26169
> colSd(tmp5,na.rm=TRUE)
 [1] 132.762913  10.040014   9.199422   7.900583   7.940776   5.097550
 [7]   8.965585   8.207614   8.552593   7.609855   6.885576   7.874432
[13]   8.103909         NA   8.198932  12.049404   7.128900   5.919250
[19]  10.917910   4.823037
> colMax(tmp5,na.rm=TRUE)
 [1] 468.52120  92.36601  84.90136  72.63968  86.96350  73.14891  86.22511
 [8]  83.43078  82.44610  77.94167  74.77615  81.92677  84.51885      -Inf
[15]  83.44246  91.96819  84.11330  85.77636  87.34712  73.74175
> colMin(tmp5,na.rm=TRUE)
 [1] 64.40314 56.73554 56.63231 53.96733 61.87555 59.09431 60.85645 62.10603
 [9] 53.80077 55.93204 55.38394 58.96425 56.30028      Inf 56.77080 55.84243
[17] 61.01485 64.52515 54.06135 59.35315
> 
> 
> 
> 
> 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] 217.1547 273.0180 238.4859 207.3484 155.9404 138.7998 302.8902 312.1685
 [9] 384.0223 320.1790
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 217.1547 273.0180 238.4859 207.3484 155.9404 138.7998 302.8902 312.1685
 [9] 384.0223 320.1790
> 
> 
> 
> 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] -8.526513e-14 -1.136868e-13  0.000000e+00 -1.136868e-13  5.684342e-14
 [6]  2.273737e-13  1.989520e-13 -1.705303e-13  2.842171e-14  2.842171e-14
[11]  5.684342e-14  8.526513e-14  0.000000e+00  0.000000e+00  5.684342e-14
[16] -1.421085e-13 -5.684342e-14  1.705303e-13  5.684342e-14 -5.684342e-14
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> ## making sure these things agree
> ##
> ## first when there is no NA
> 
> 
> 
> agree.checks <- function(buff.matrix,r.matrix,err.tol=1e-10){
+ 
+   if (Max(buff.matrix,na.rm=TRUE) != max(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Max")
+   }
+   
+ 
+   if (Min(buff.matrix,na.rm=TRUE) != min(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Min")
+   }
+ 
+ 
+   if (abs(Sum(buff.matrix,na.rm=TRUE)- sum(r.matrix,na.rm=TRUE)) > err.tol){
+ 
+     cat(Sum(buff.matrix,na.rm=TRUE),"\n")
+     cat(sum(r.matrix,na.rm=TRUE),"\n")
+     cat(Sum(buff.matrix,na.rm=TRUE) - sum(r.matrix,na.rm=TRUE),"\n")
+     
+     stop("No agreement in Sum")
+   }
+   
+   if (abs(mean(buff.matrix,na.rm=TRUE) - mean(r.matrix,na.rm=TRUE)) > err.tol){
+     stop("No agreement in mean")
+   }
+   
+   
+   if(abs(Var(buff.matrix,na.rm=TRUE) - var(as.vector(r.matrix),na.rm=TRUE)) > err.tol){
+     stop("No agreement in Var")
+   }
+   
+   
+ 
+   if(any(abs(rowMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,mean,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowMeans")
+   }
+   
+   
+   if(any(abs(colMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,mean,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colMeans")
+   }
+   
+   
+   if(any(abs(rowSums(buff.matrix,na.rm=TRUE)  -  apply(r.matrix,1,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in rowSums")
+   }
+   
+   
+   if(any(abs(colSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colSums")
+   }
+   
+   ### this is to get around the fact that R doesn't like to compute NA on an entire vector of NA when 
+   ### computing variance
+   my.Var <- function(x,na.rm=FALSE){
+    if (all(is.na(x))){
+      return(NA)
+    } else {
+      var(x,na.rm=na.rm)
+    }
+ 
+   }
+   
+   if(any(abs(rowVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+   
+   
+   if(any(abs(colVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+ 
+ 
+   if(any(abs(rowMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+ 
+   if(any(abs(colMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+   
+   
+   if(any(abs(rowMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+   
+ 
+   if(any(abs(colMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+ 
+   if(any(abs(colMedians(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,median,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMedian")
+   }
+ 
+   if(any(abs(colRanges(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,range,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colRanges")
+   }
+ 
+ 
+   
+ }
> 
> 
> 
> 
> 
> 
> 
> 
> 
> for (rep in 1:20){
+   copymatrix <- matrix(rnorm(200,150,15),10,20)
+   
+   tmp5[1:10,1:20] <- copymatrix
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ## now lets assign some NA values and check agreement
+ 
+   which.row <- sample(1:10,1,replace=TRUE)
+   which.col  <- sample(1:20,1,replace=TRUE)
+   
+   cat(which.row," ",which.col,"\n")
+   
+   tmp5[which.row,which.col] <- NA
+   copymatrix[which.row,which.col] <- NA
+   
+   agree.checks(tmp5,copymatrix)
+ 
+   ## make an entire row NA
+   tmp5[which.row,] <- NA
+   copymatrix[which.row,] <- NA
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ### also make an entire col NA
+   tmp5[,which.col] <- NA
+   copymatrix[,which.col] <- NA
+ 
+   agree.checks(tmp5,copymatrix)
+ 
+   ### now make 1 element non NA with NA in the rest of row and column
+ 
+   tmp5[which.row,which.col] <- rnorm(1,150,15)
+   copymatrix[which.row,which.col] <- tmp5[which.row,which.col]
+ 
+   agree.checks(tmp5,copymatrix)
+ }
8   2 
8   3 
8   19 
5   4 
5   2 
2   12 
5   10 
1   11 
5   6 
3   4 
1   18 
7   2 
10   11 
4   17 
3   20 
5   13 
10   19 
9   15 
10   2 
6   6 
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] 1.868437
> Min(tmp)
[1] -1.792183
> mean(tmp)
[1] 0.09503146
> Sum(tmp)
[1] 9.503146
> Var(tmp)
[1] 0.7608389
> 
> rowMeans(tmp)
[1] 0.09503146
> rowSums(tmp)
[1] 9.503146
> rowVars(tmp)
[1] 0.7608389
> rowSd(tmp)
[1] 0.8722608
> rowMax(tmp)
[1] 1.868437
> rowMin(tmp)
[1] -1.792183
> 
> colMeans(tmp)
  [1]  0.031197151 -0.467076561  0.655030510 -1.654078971  1.164519159
  [6] -1.792183295  0.320035209  0.593359498  0.549742867  0.389220864
 [11]  0.474736390  1.787880323 -1.698398489  0.529066551  0.926146577
 [16] -1.073997705  0.266136501 -1.270826441 -0.666316999  0.133056255
 [21] -0.295734787  0.398237174  0.641403952 -0.322864884 -1.144828232
 [26]  0.091373327 -0.245520809  0.094982868  1.703680202 -0.948035455
 [31]  1.228170363 -0.491845145 -0.419248927  0.376950845  1.255884095
 [36] -0.722278746  0.003197664  0.042865849 -0.734716863  0.098268409
 [41]  1.868437178 -0.877687626 -0.421609874  0.808684525  1.444776155
 [46]  0.732205414 -0.593077891  1.151366149  0.130015148  0.938622324
 [51]  1.315577393 -0.933067367 -0.954402963 -0.988464886 -0.136657926
 [56]  0.908593704  0.498771684  0.939328107  0.498963958  0.721456655
 [61]  1.324933045  0.223051588 -0.264243998  1.159143057 -0.275657555
 [66] -1.236476398 -0.221264050 -0.540648431 -0.327375185  0.755549595
 [71]  0.206768051 -0.578918619  1.130945532  1.350263941 -0.744554600
 [76]  0.890117194  0.045684493  1.106807830 -0.061458406  0.498085897
 [81]  0.250917138  1.101375333 -0.070228670  0.457433009 -0.715671960
 [86]  0.305692726 -1.779370695 -1.136658475  1.229138406 -0.807204001
 [91] -0.138647394  0.057691766  0.149024260  0.834825712 -1.297991303
 [96]  0.532149385 -0.403938300  1.596436692 -0.653181856 -1.308419327
> colSums(tmp)
  [1]  0.031197151 -0.467076561  0.655030510 -1.654078971  1.164519159
  [6] -1.792183295  0.320035209  0.593359498  0.549742867  0.389220864
 [11]  0.474736390  1.787880323 -1.698398489  0.529066551  0.926146577
 [16] -1.073997705  0.266136501 -1.270826441 -0.666316999  0.133056255
 [21] -0.295734787  0.398237174  0.641403952 -0.322864884 -1.144828232
 [26]  0.091373327 -0.245520809  0.094982868  1.703680202 -0.948035455
 [31]  1.228170363 -0.491845145 -0.419248927  0.376950845  1.255884095
 [36] -0.722278746  0.003197664  0.042865849 -0.734716863  0.098268409
 [41]  1.868437178 -0.877687626 -0.421609874  0.808684525  1.444776155
 [46]  0.732205414 -0.593077891  1.151366149  0.130015148  0.938622324
 [51]  1.315577393 -0.933067367 -0.954402963 -0.988464886 -0.136657926
 [56]  0.908593704  0.498771684  0.939328107  0.498963958  0.721456655
 [61]  1.324933045  0.223051588 -0.264243998  1.159143057 -0.275657555
 [66] -1.236476398 -0.221264050 -0.540648431 -0.327375185  0.755549595
 [71]  0.206768051 -0.578918619  1.130945532  1.350263941 -0.744554600
 [76]  0.890117194  0.045684493  1.106807830 -0.061458406  0.498085897
 [81]  0.250917138  1.101375333 -0.070228670  0.457433009 -0.715671960
 [86]  0.305692726 -1.779370695 -1.136658475  1.229138406 -0.807204001
 [91] -0.138647394  0.057691766  0.149024260  0.834825712 -1.297991303
 [96]  0.532149385 -0.403938300  1.596436692 -0.653181856 -1.308419327
> 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.031197151 -0.467076561  0.655030510 -1.654078971  1.164519159
  [6] -1.792183295  0.320035209  0.593359498  0.549742867  0.389220864
 [11]  0.474736390  1.787880323 -1.698398489  0.529066551  0.926146577
 [16] -1.073997705  0.266136501 -1.270826441 -0.666316999  0.133056255
 [21] -0.295734787  0.398237174  0.641403952 -0.322864884 -1.144828232
 [26]  0.091373327 -0.245520809  0.094982868  1.703680202 -0.948035455
 [31]  1.228170363 -0.491845145 -0.419248927  0.376950845  1.255884095
 [36] -0.722278746  0.003197664  0.042865849 -0.734716863  0.098268409
 [41]  1.868437178 -0.877687626 -0.421609874  0.808684525  1.444776155
 [46]  0.732205414 -0.593077891  1.151366149  0.130015148  0.938622324
 [51]  1.315577393 -0.933067367 -0.954402963 -0.988464886 -0.136657926
 [56]  0.908593704  0.498771684  0.939328107  0.498963958  0.721456655
 [61]  1.324933045  0.223051588 -0.264243998  1.159143057 -0.275657555
 [66] -1.236476398 -0.221264050 -0.540648431 -0.327375185  0.755549595
 [71]  0.206768051 -0.578918619  1.130945532  1.350263941 -0.744554600
 [76]  0.890117194  0.045684493  1.106807830 -0.061458406  0.498085897
 [81]  0.250917138  1.101375333 -0.070228670  0.457433009 -0.715671960
 [86]  0.305692726 -1.779370695 -1.136658475  1.229138406 -0.807204001
 [91] -0.138647394  0.057691766  0.149024260  0.834825712 -1.297991303
 [96]  0.532149385 -0.403938300  1.596436692 -0.653181856 -1.308419327
> colMin(tmp)
  [1]  0.031197151 -0.467076561  0.655030510 -1.654078971  1.164519159
  [6] -1.792183295  0.320035209  0.593359498  0.549742867  0.389220864
 [11]  0.474736390  1.787880323 -1.698398489  0.529066551  0.926146577
 [16] -1.073997705  0.266136501 -1.270826441 -0.666316999  0.133056255
 [21] -0.295734787  0.398237174  0.641403952 -0.322864884 -1.144828232
 [26]  0.091373327 -0.245520809  0.094982868  1.703680202 -0.948035455
 [31]  1.228170363 -0.491845145 -0.419248927  0.376950845  1.255884095
 [36] -0.722278746  0.003197664  0.042865849 -0.734716863  0.098268409
 [41]  1.868437178 -0.877687626 -0.421609874  0.808684525  1.444776155
 [46]  0.732205414 -0.593077891  1.151366149  0.130015148  0.938622324
 [51]  1.315577393 -0.933067367 -0.954402963 -0.988464886 -0.136657926
 [56]  0.908593704  0.498771684  0.939328107  0.498963958  0.721456655
 [61]  1.324933045  0.223051588 -0.264243998  1.159143057 -0.275657555
 [66] -1.236476398 -0.221264050 -0.540648431 -0.327375185  0.755549595
 [71]  0.206768051 -0.578918619  1.130945532  1.350263941 -0.744554600
 [76]  0.890117194  0.045684493  1.106807830 -0.061458406  0.498085897
 [81]  0.250917138  1.101375333 -0.070228670  0.457433009 -0.715671960
 [86]  0.305692726 -1.779370695 -1.136658475  1.229138406 -0.807204001
 [91] -0.138647394  0.057691766  0.149024260  0.834825712 -1.297991303
 [96]  0.532149385 -0.403938300  1.596436692 -0.653181856 -1.308419327
> colMedians(tmp)
  [1]  0.031197151 -0.467076561  0.655030510 -1.654078971  1.164519159
  [6] -1.792183295  0.320035209  0.593359498  0.549742867  0.389220864
 [11]  0.474736390  1.787880323 -1.698398489  0.529066551  0.926146577
 [16] -1.073997705  0.266136501 -1.270826441 -0.666316999  0.133056255
 [21] -0.295734787  0.398237174  0.641403952 -0.322864884 -1.144828232
 [26]  0.091373327 -0.245520809  0.094982868  1.703680202 -0.948035455
 [31]  1.228170363 -0.491845145 -0.419248927  0.376950845  1.255884095
 [36] -0.722278746  0.003197664  0.042865849 -0.734716863  0.098268409
 [41]  1.868437178 -0.877687626 -0.421609874  0.808684525  1.444776155
 [46]  0.732205414 -0.593077891  1.151366149  0.130015148  0.938622324
 [51]  1.315577393 -0.933067367 -0.954402963 -0.988464886 -0.136657926
 [56]  0.908593704  0.498771684  0.939328107  0.498963958  0.721456655
 [61]  1.324933045  0.223051588 -0.264243998  1.159143057 -0.275657555
 [66] -1.236476398 -0.221264050 -0.540648431 -0.327375185  0.755549595
 [71]  0.206768051 -0.578918619  1.130945532  1.350263941 -0.744554600
 [76]  0.890117194  0.045684493  1.106807830 -0.061458406  0.498085897
 [81]  0.250917138  1.101375333 -0.070228670  0.457433009 -0.715671960
 [86]  0.305692726 -1.779370695 -1.136658475  1.229138406 -0.807204001
 [91] -0.138647394  0.057691766  0.149024260  0.834825712 -1.297991303
 [96]  0.532149385 -0.403938300  1.596436692 -0.653181856 -1.308419327
> colRanges(tmp)
           [,1]       [,2]      [,3]      [,4]     [,5]      [,6]      [,7]
[1,] 0.03119715 -0.4670766 0.6550305 -1.654079 1.164519 -1.792183 0.3200352
[2,] 0.03119715 -0.4670766 0.6550305 -1.654079 1.164519 -1.792183 0.3200352
          [,8]      [,9]     [,10]     [,11]   [,12]     [,13]     [,14]
[1,] 0.5933595 0.5497429 0.3892209 0.4747364 1.78788 -1.698398 0.5290666
[2,] 0.5933595 0.5497429 0.3892209 0.4747364 1.78788 -1.698398 0.5290666
         [,15]     [,16]     [,17]     [,18]     [,19]     [,20]      [,21]
[1,] 0.9261466 -1.073998 0.2661365 -1.270826 -0.666317 0.1330563 -0.2957348
[2,] 0.9261466 -1.073998 0.2661365 -1.270826 -0.666317 0.1330563 -0.2957348
         [,22]    [,23]      [,24]     [,25]      [,26]      [,27]      [,28]
[1,] 0.3982372 0.641404 -0.3228649 -1.144828 0.09137333 -0.2455208 0.09498287
[2,] 0.3982372 0.641404 -0.3228649 -1.144828 0.09137333 -0.2455208 0.09498287
       [,29]      [,30]   [,31]      [,32]      [,33]     [,34]    [,35]
[1,] 1.70368 -0.9480355 1.22817 -0.4918451 -0.4192489 0.3769508 1.255884
[2,] 1.70368 -0.9480355 1.22817 -0.4918451 -0.4192489 0.3769508 1.255884
          [,36]       [,37]      [,38]      [,39]      [,40]    [,41]
[1,] -0.7222787 0.003197664 0.04286585 -0.7347169 0.09826841 1.868437
[2,] -0.7222787 0.003197664 0.04286585 -0.7347169 0.09826841 1.868437
          [,42]      [,43]     [,44]    [,45]     [,46]      [,47]    [,48]
[1,] -0.8776876 -0.4216099 0.8086845 1.444776 0.7322054 -0.5930779 1.151366
[2,] -0.8776876 -0.4216099 0.8086845 1.444776 0.7322054 -0.5930779 1.151366
         [,49]     [,50]    [,51]      [,52]     [,53]      [,54]      [,55]
[1,] 0.1300151 0.9386223 1.315577 -0.9330674 -0.954403 -0.9884649 -0.1366579
[2,] 0.1300151 0.9386223 1.315577 -0.9330674 -0.954403 -0.9884649 -0.1366579
         [,56]     [,57]     [,58]    [,59]     [,60]    [,61]     [,62]
[1,] 0.9085937 0.4987717 0.9393281 0.498964 0.7214567 1.324933 0.2230516
[2,] 0.9085937 0.4987717 0.9393281 0.498964 0.7214567 1.324933 0.2230516
         [,63]    [,64]      [,65]     [,66]      [,67]      [,68]      [,69]
[1,] -0.264244 1.159143 -0.2756576 -1.236476 -0.2212641 -0.5406484 -0.3273752
[2,] -0.264244 1.159143 -0.2756576 -1.236476 -0.2212641 -0.5406484 -0.3273752
         [,70]     [,71]      [,72]    [,73]    [,74]      [,75]     [,76]
[1,] 0.7555496 0.2067681 -0.5789186 1.130946 1.350264 -0.7445546 0.8901172
[2,] 0.7555496 0.2067681 -0.5789186 1.130946 1.350264 -0.7445546 0.8901172
          [,77]    [,78]       [,79]     [,80]     [,81]    [,82]       [,83]
[1,] 0.04568449 1.106808 -0.06145841 0.4980859 0.2509171 1.101375 -0.07022867
[2,] 0.04568449 1.106808 -0.06145841 0.4980859 0.2509171 1.101375 -0.07022867
        [,84]     [,85]     [,86]     [,87]     [,88]    [,89]     [,90]
[1,] 0.457433 -0.715672 0.3056927 -1.779371 -1.136658 1.229138 -0.807204
[2,] 0.457433 -0.715672 0.3056927 -1.779371 -1.136658 1.229138 -0.807204
          [,91]      [,92]     [,93]     [,94]     [,95]     [,96]      [,97]
[1,] -0.1386474 0.05769177 0.1490243 0.8348257 -1.297991 0.5321494 -0.4039383
[2,] -0.1386474 0.05769177 0.1490243 0.8348257 -1.297991 0.5321494 -0.4039383
        [,98]      [,99]    [,100]
[1,] 1.596437 -0.6531819 -1.308419
[2,] 1.596437 -0.6531819 -1.308419
> 
> 
> Max(tmp2)
[1] 3.596107
> Min(tmp2)
[1] -2.169092
> mean(tmp2)
[1] 0.1990787
> Sum(tmp2)
[1] 19.90787
> Var(tmp2)
[1] 1.073782
> 
> rowMeans(tmp2)
  [1] -0.6184360442  1.6369491967 -1.4178314455 -0.5806316085  0.0958878695
  [6]  0.4934733337 -0.5491233793  0.7451173037 -1.8315094064  0.6609103109
 [11] -0.4175398472 -0.7421436554 -0.1237675515  0.1088668367 -0.9569630849
 [16]  2.9006289325 -0.7675342180  1.3309613361  0.6104945199  1.6369923958
 [21] -0.1887587612  0.7987734760  0.1554703419 -2.1690920845  0.5443181414
 [26]  0.5117325923  0.0759857734  1.2813131344  0.8424298088  0.1500961918
 [31] -0.8149062024 -0.4278386878  1.5858354924 -0.2586031599 -0.1321449719
 [36]  0.6090354751 -0.4971783739  0.5775091056  0.0126704542 -0.9719506113
 [41] -0.7087655626  1.0424655794  3.5961071808  2.6262685062  1.1145392877
 [46]  0.8813262519 -0.6791182313 -0.2136344614  0.7978439804  0.1470226015
 [51]  0.6906177669  0.1371349376 -1.3207770626  0.4819761954 -1.2331487603
 [56] -0.8459064701 -1.0318608948  2.1872610713 -0.2093499664 -1.0391287685
 [61] -0.4059640633 -0.8050267252  1.3894682861 -0.6995546464  1.1520661743
 [66]  0.6425697420 -1.3586343174  1.8366262283  0.4990066547 -0.2060714834
 [71]  0.1855900513 -0.1582066704 -0.0468193323  0.8212909447 -0.9363141845
 [76] -0.3967500232 -0.6316074545  0.3298617270  0.5423518497 -0.1900418296
 [81]  0.6499280377 -0.4863119716  1.6538750615 -0.1751335279  1.1393449341
 [86] -1.1807678089  1.4085122252 -1.0868251098 -0.7398295640 -0.0006324788
 [91]  0.4946622264  2.3357284847 -0.5186268933  0.8283906916  0.9090321523
 [96]  0.9665478636  1.2895715425 -0.7684277375  0.8162175765  0.4884042171
> rowSums(tmp2)
  [1] -0.6184360442  1.6369491967 -1.4178314455 -0.5806316085  0.0958878695
  [6]  0.4934733337 -0.5491233793  0.7451173037 -1.8315094064  0.6609103109
 [11] -0.4175398472 -0.7421436554 -0.1237675515  0.1088668367 -0.9569630849
 [16]  2.9006289325 -0.7675342180  1.3309613361  0.6104945199  1.6369923958
 [21] -0.1887587612  0.7987734760  0.1554703419 -2.1690920845  0.5443181414
 [26]  0.5117325923  0.0759857734  1.2813131344  0.8424298088  0.1500961918
 [31] -0.8149062024 -0.4278386878  1.5858354924 -0.2586031599 -0.1321449719
 [36]  0.6090354751 -0.4971783739  0.5775091056  0.0126704542 -0.9719506113
 [41] -0.7087655626  1.0424655794  3.5961071808  2.6262685062  1.1145392877
 [46]  0.8813262519 -0.6791182313 -0.2136344614  0.7978439804  0.1470226015
 [51]  0.6906177669  0.1371349376 -1.3207770626  0.4819761954 -1.2331487603
 [56] -0.8459064701 -1.0318608948  2.1872610713 -0.2093499664 -1.0391287685
 [61] -0.4059640633 -0.8050267252  1.3894682861 -0.6995546464  1.1520661743
 [66]  0.6425697420 -1.3586343174  1.8366262283  0.4990066547 -0.2060714834
 [71]  0.1855900513 -0.1582066704 -0.0468193323  0.8212909447 -0.9363141845
 [76] -0.3967500232 -0.6316074545  0.3298617270  0.5423518497 -0.1900418296
 [81]  0.6499280377 -0.4863119716  1.6538750615 -0.1751335279  1.1393449341
 [86] -1.1807678089  1.4085122252 -1.0868251098 -0.7398295640 -0.0006324788
 [91]  0.4946622264  2.3357284847 -0.5186268933  0.8283906916  0.9090321523
 [96]  0.9665478636  1.2895715425 -0.7684277375  0.8162175765  0.4884042171
> rowVars(tmp2)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowSd(tmp2)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowMax(tmp2)
  [1] -0.6184360442  1.6369491967 -1.4178314455 -0.5806316085  0.0958878695
  [6]  0.4934733337 -0.5491233793  0.7451173037 -1.8315094064  0.6609103109
 [11] -0.4175398472 -0.7421436554 -0.1237675515  0.1088668367 -0.9569630849
 [16]  2.9006289325 -0.7675342180  1.3309613361  0.6104945199  1.6369923958
 [21] -0.1887587612  0.7987734760  0.1554703419 -2.1690920845  0.5443181414
 [26]  0.5117325923  0.0759857734  1.2813131344  0.8424298088  0.1500961918
 [31] -0.8149062024 -0.4278386878  1.5858354924 -0.2586031599 -0.1321449719
 [36]  0.6090354751 -0.4971783739  0.5775091056  0.0126704542 -0.9719506113
 [41] -0.7087655626  1.0424655794  3.5961071808  2.6262685062  1.1145392877
 [46]  0.8813262519 -0.6791182313 -0.2136344614  0.7978439804  0.1470226015
 [51]  0.6906177669  0.1371349376 -1.3207770626  0.4819761954 -1.2331487603
 [56] -0.8459064701 -1.0318608948  2.1872610713 -0.2093499664 -1.0391287685
 [61] -0.4059640633 -0.8050267252  1.3894682861 -0.6995546464  1.1520661743
 [66]  0.6425697420 -1.3586343174  1.8366262283  0.4990066547 -0.2060714834
 [71]  0.1855900513 -0.1582066704 -0.0468193323  0.8212909447 -0.9363141845
 [76] -0.3967500232 -0.6316074545  0.3298617270  0.5423518497 -0.1900418296
 [81]  0.6499280377 -0.4863119716  1.6538750615 -0.1751335279  1.1393449341
 [86] -1.1807678089  1.4085122252 -1.0868251098 -0.7398295640 -0.0006324788
 [91]  0.4946622264  2.3357284847 -0.5186268933  0.8283906916  0.9090321523
 [96]  0.9665478636  1.2895715425 -0.7684277375  0.8162175765  0.4884042171
> rowMin(tmp2)
  [1] -0.6184360442  1.6369491967 -1.4178314455 -0.5806316085  0.0958878695
  [6]  0.4934733337 -0.5491233793  0.7451173037 -1.8315094064  0.6609103109
 [11] -0.4175398472 -0.7421436554 -0.1237675515  0.1088668367 -0.9569630849
 [16]  2.9006289325 -0.7675342180  1.3309613361  0.6104945199  1.6369923958
 [21] -0.1887587612  0.7987734760  0.1554703419 -2.1690920845  0.5443181414
 [26]  0.5117325923  0.0759857734  1.2813131344  0.8424298088  0.1500961918
 [31] -0.8149062024 -0.4278386878  1.5858354924 -0.2586031599 -0.1321449719
 [36]  0.6090354751 -0.4971783739  0.5775091056  0.0126704542 -0.9719506113
 [41] -0.7087655626  1.0424655794  3.5961071808  2.6262685062  1.1145392877
 [46]  0.8813262519 -0.6791182313 -0.2136344614  0.7978439804  0.1470226015
 [51]  0.6906177669  0.1371349376 -1.3207770626  0.4819761954 -1.2331487603
 [56] -0.8459064701 -1.0318608948  2.1872610713 -0.2093499664 -1.0391287685
 [61] -0.4059640633 -0.8050267252  1.3894682861 -0.6995546464  1.1520661743
 [66]  0.6425697420 -1.3586343174  1.8366262283  0.4990066547 -0.2060714834
 [71]  0.1855900513 -0.1582066704 -0.0468193323  0.8212909447 -0.9363141845
 [76] -0.3967500232 -0.6316074545  0.3298617270  0.5423518497 -0.1900418296
 [81]  0.6499280377 -0.4863119716  1.6538750615 -0.1751335279  1.1393449341
 [86] -1.1807678089  1.4085122252 -1.0868251098 -0.7398295640 -0.0006324788
 [91]  0.4946622264  2.3357284847 -0.5186268933  0.8283906916  0.9090321523
 [96]  0.9665478636  1.2895715425 -0.7684277375  0.8162175765  0.4884042171
> 
> colMeans(tmp2)
[1] 0.1990787
> colSums(tmp2)
[1] 19.90787
> colVars(tmp2)
[1] 1.073782
> colSd(tmp2)
[1] 1.036235
> colMax(tmp2)
[1] 3.596107
> colMin(tmp2)
[1] -2.169092
> colMedians(tmp2)
[1] 0.1230009
> colRanges(tmp2)
          [,1]
[1,] -2.169092
[2,]  3.596107
> 
> dataset1 <- matrix(dataset1,1,100)
> 
> agree.checks(tmp,dataset1)
> 
> dataset2 <- matrix(dataset2,100,1)
> agree.checks(tmp2,dataset2)
>   
> 
> tmp <- createBufferedMatrix(10,10)
> 
> tmp[1:10,1:10] <- rnorm(100)
> colApply(tmp,sum)
 [1]  2.1470451 -3.3098648 -0.0635931 -1.2630939  1.9166114  0.9732878
 [7] -7.5583213  0.1231686 -3.1131492  1.4089466
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -0.9937587
[2,] -0.5498934
[3,]  0.2730236
[4,]  0.6233587
[5,]  2.0300696
> 
> rowApply(tmp,sum)
 [1] -7.8793071 -1.7359310  1.9456084 -0.6894045 -0.3625124 -1.1937341
 [7]  0.4189405  0.6645571 -0.1338766  0.2266971
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]   10    5    6   10    3    9    8    7    2     2
 [2,]    6    1    1    7   10    7    2    2    4     5
 [3,]    7    2    3    8    9    8    3    4    6     9
 [4,]    5    7    7    1    4    2    7    1   10     8
 [5,]    4    3    4    5    6   10    6    8    9     6
 [6,]    8   10    8    6    1    5   10    6    5     7
 [7,]    1    4    5    3    7    1    1    3    3     4
 [8,]    9    6    2    4    2    4    5    9    7    10
 [9,]    3    9   10    2    5    6    4    5    1     3
[10,]    2    8    9    9    8    3    9   10    8     1
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1]  4.85229488  1.46513712 -0.51834816 -1.20127944  0.28990633  1.05659123
 [7] -1.70103955 -1.34587759  0.09044199 -1.64390756  5.85767693 -1.41878538
[13] -2.25322704  2.57268738 -0.98997635 -2.02483006 -0.49977531 -0.48509972
[19]  2.09411565  0.59750308
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -0.1001459
[2,]  0.5003452
[3,]  0.8869396
[4,]  1.2963635
[5,]  2.2687924
> 
> rowApply(tmp,sum)
[1]  3.734284 -4.083666  1.362120  6.010427 -2.228956
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]   19   12   16   19   17
[2,]    5    5   18   18   10
[3,]   18    7    3   13   12
[4,]    4   15    6   14    3
[5,]    6   17    8   12   13
> 
> 
> as.matrix(tmp)
           [,1]       [,2]        [,3]       [,4]        [,5]        [,6]
[1,]  1.2963635 -0.4620600  1.04979960 -0.6599723 -0.37091552  0.85794115
[2,] -0.1001459 -1.0331298 -0.82379608  0.3670608  0.73794253 -0.22591901
[3,]  0.8869396  1.3107896 -0.98086587 -0.6273039 -0.27980659  0.04638009
[4,]  2.2687924  2.0308832  0.33314303  0.5672628  0.25044394  0.83181039
[5,]  0.5003452 -0.3813458 -0.09662884 -0.8483268 -0.04775803 -0.45362139
           [,7]       [,8]        [,9]       [,10]      [,11]      [,12]
[1,] -1.8809506 -0.1251783 -0.35344529  0.36958656  0.9667909  0.7504415
[2,] -0.2525464 -1.4136768  1.45740890 -0.89037155  2.4920345  0.5875056
[3,] -1.6216855  0.5254539 -0.21357239 -0.72383182  2.8002729 -1.3107404
[4,]  2.6369022 -0.5967964  0.06707678 -0.01480018  0.1455583 -0.7968656
[5,] -0.5827593  0.2643200 -0.86702601 -0.38449057 -0.5469796 -0.6491264
          [,13]      [,14]      [,15]       [,16]      [,17]       [,18]
[1,] -1.4404266 0.49159447  0.3707809  1.60851218  0.9801809 -0.78540160
[2,] -1.6918052 0.77567137 -1.0929329 -1.75918648 -0.3854826 -0.76627798
[3,] -0.1930847 0.13315598  0.1664111 -0.01895069 -0.7378514  1.28718375
[4,] -0.1815038 0.01877234 -1.6917562 -2.23809884 -0.5040869  0.08111439
[5,]  1.2535933 1.15349321  1.2575207  0.38289377  0.1474646 -0.30171827
           [,19]       [,20]
[1,]  0.58795792  0.48268462
[2,] -0.04615516 -0.01986386
[3,]  1.43379853 -0.52057227
[4,]  0.88406553  1.91850950
[5,] -0.76555117 -1.26325492
> 
> 
> 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.10-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.10-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  654  bytes.
Disk usage :  200  bytes.
> subBufferedMatrix(tmp,,5:8)
BufferedMatrix object
Matrix size:  5 4 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.10-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.10-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.6567541 -1.872539 -0.5536373 -0.4005852 0.1719554 -0.4803694 -2.062669
          col8     col9      col10      col11     col12      col13    col14
row1 -0.558259 1.900012 -0.3910387 -0.6518288 0.4199666 -0.9724263 1.295234
         col15      col16      col17      col18     col19     col20
row1 0.2250245 -0.5633068 -0.7828091 -0.3497952 -1.605394 -1.467985
> tmp[,"col10"]
          col10
row1 -0.3910387
row2  0.8267922
row3 -0.8252844
row4  0.5903340
row5 -0.5512609
> tmp[c("row1","row5"),]
           col1      col2       col3       col4      col5       col6       col7
row1 -0.6567541 -1.872539 -0.5536373 -0.4005852 0.1719554 -0.4803694 -2.0626693
row5 -2.7410521  1.836299  0.6905878  0.7268871 0.9838162 -2.3626849 -0.3633442
           col8      col9      col10      col11      col12      col13     col14
row1 -0.5582590 1.9000116 -0.3910387 -0.6518288 0.41996658 -0.9724263  1.295234
row5  0.2429543 0.2539994 -0.5512609 -0.8658917 0.07851758  1.3815556 -0.943657
          col15      col16      col17      col18     col19      col20
row1  0.2250245 -0.5633068 -0.7828091 -0.3497952 -1.605394 -1.4679855
row5 -0.3525345  1.2848108 -1.0183753 -0.6572045  1.965604 -0.9064703
> tmp[,c("col6","col20")]
           col6      col20
row1 -0.4803694 -1.4679855
row2 -1.4863889 -0.1730651
row3 -0.2503530 -0.3891187
row4 -0.4927954  0.8491295
row5 -2.3626849 -0.9064703
> tmp[c("row1","row5"),c("col6","col20")]
           col6      col20
row1 -0.4803694 -1.4679855
row5 -2.3626849 -0.9064703
> 
> 
> 
> 
> tmp["row1",] <- rnorm(20,mean=10)
> tmp[,"col10"] <- rnorm(5,mean=30)
> tmp[c("row1","row5"),] <- rnorm(40,mean=50)
> tmp[,c("col6","col20")] <- rnorm(10,mean=75)
> tmp[c("row1","row5"),c("col6","col20")]  <- rnorm(4,mean=105)
> 
> tmp["row1",]
        col1     col2     col3     col4     col5     col6     col7     col8
row1 49.0773 51.56064 50.16086 49.10859 51.45048 104.1809 49.82359 50.87022
         col9    col10    col11    col12    col13   col14    col15    col16
row1 50.23701 49.65411 51.15482 50.12261 51.28252 49.7447 49.44902 48.04473
        col17    col18    col19    col20
row1 49.53558 50.64897 50.02606 106.7281
> tmp[,"col10"]
        col10
row1 49.65411
row2 30.53248
row3 30.99942
row4 29.36945
row5 49.65418
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 49.07730 51.56064 50.16086 49.10859 51.45048 104.1809 49.82359 50.87022
row5 51.52336 49.18285 48.10806 47.98649 49.41946 105.3497 50.54226 50.13301
         col9    col10    col11    col12    col13    col14    col15    col16
row1 50.23701 49.65411 51.15482 50.12261 51.28252 49.74470 49.44902 48.04473
row5 50.37476 49.65418 50.40753 50.08564 50.00697 49.40785 49.16310 49.90698
        col17    col18    col19    col20
row1 49.53558 50.64897 50.02606 106.7281
row5 51.36353 48.48723 49.25495 104.5396
> tmp[,c("col6","col20")]
          col6     col20
row1 104.18088 106.72809
row2  75.37958  73.90586
row3  74.42805  75.14202
row4  73.58516  74.42089
row5 105.34965 104.53960
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 104.1809 106.7281
row5 105.3497 104.5396
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 104.1809 106.7281
row5 105.3497 104.5396
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
          col13
[1,]  0.7868133
[2,]  1.7938793
[3,]  0.8968126
[4,] -0.3756508
[5,] -0.5959405
> tmp[,c("col17","col7")]
          col17       col7
[1,] -1.1310221  1.7042909
[2,]  0.1986820  0.2245942
[3,]  1.1644991 -0.4689276
[4,] -1.4370356  1.0884700
[5,]  0.8503402  0.5175300
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
           col6      col20
[1,]  0.4256324 -0.4105534
[2,]  1.7734649  1.7834494
[3,]  0.3136617 -1.6766147
[4,] -2.7217261  0.8549321
[5,]  2.2502291  1.0291483
> subBufferedMatrix(tmp,1,c("col6"))[,1]
          col1
[1,] 0.4256324
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
          col6
[1,] 0.4256324
[2,] 1.7734649
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> 
> 
> 
> subBufferedMatrix(tmp,c("row3","row1"),)[,1:20]
           [,1]      [,2]       [,3]        [,4]      [,5]       [,6]      [,7]
row3  0.2171634 1.4579766  0.3118843  0.06438733 1.2687663 -0.2842399 0.2036103
row1 -0.6282039 0.6498406 -1.3965538 -1.81199563 0.5067162  0.6458475 2.7189836
           [,8]      [,9]     [,10]      [,11]     [,12]      [,13]      [,14]
row3  0.8896021 0.7742209 0.6310440  0.4533786 0.8582195 -0.6032722 -0.6534307
row1 -0.3779218 0.1801003 0.7402092 -1.3203050 0.6919280 -0.7648441  0.2830550
          [,15]       [,16]      [,17]       [,18]     [,19]     [,20]
row3 0.03027922  0.41256401 -0.3450704 -1.42178615 1.7856542 -2.081097
row1 0.58697152 -0.08824524 -0.7030488  0.02617027 0.8799937  1.623906
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
          [,1]      [,2]      [,3]      [,4]       [,5]    [,6]      [,7]
row2 0.3780234 -1.551537 -1.501436 -1.831253 -0.1912473 1.04586 -1.520267
         [,8]      [,9]     [,10]
row2 1.367157 0.9359332 0.5780771
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
          [,1]      [,2]      [,3]      [,4]      [,5]      [,6]       [,7]
row5 0.9954869 -1.151713 -1.972983 0.2545416 0.3764509 0.7602619 -0.9521534
         [,8]      [,9]      [,10]      [,11]      [,12]      [,13]      [,14]
row5 1.660939 -1.475153 -0.4288628 0.05551797 -0.1327328 -0.1775207 -0.9659739
          [,15]      [,16]    [,17]     [,18]     [,19]      [,20]
row5 -0.1851081 -0.7659593 0.203417 -2.075812 -1.076464 -0.7991006
> 
> 
> 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: 0x7f92a2400a00>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "/Users/biocbuild/bbs-3.10-bioc/meat/BufferedMatrix.Rcheck/tests/BM15d3a7fc186a1"
 [2] "/Users/biocbuild/bbs-3.10-bioc/meat/BufferedMatrix.Rcheck/tests/BM15d3a7a6df58d"
 [3] "/Users/biocbuild/bbs-3.10-bioc/meat/BufferedMatrix.Rcheck/tests/BM15d3a49143ac6"
 [4] "/Users/biocbuild/bbs-3.10-bioc/meat/BufferedMatrix.Rcheck/tests/BM15d3a4f1ec2a5"
 [5] "/Users/biocbuild/bbs-3.10-bioc/meat/BufferedMatrix.Rcheck/tests/BM15d3a6c7d0737"
 [6] "/Users/biocbuild/bbs-3.10-bioc/meat/BufferedMatrix.Rcheck/tests/BM15d3a464e386" 
 [7] "/Users/biocbuild/bbs-3.10-bioc/meat/BufferedMatrix.Rcheck/tests/BM15d3a7b9574aa"
 [8] "/Users/biocbuild/bbs-3.10-bioc/meat/BufferedMatrix.Rcheck/tests/BM15d3a111e8449"
 [9] "/Users/biocbuild/bbs-3.10-bioc/meat/BufferedMatrix.Rcheck/tests/BM15d3a6a7edd66"
[10] "/Users/biocbuild/bbs-3.10-bioc/meat/BufferedMatrix.Rcheck/tests/BM15d3a2ef98a29"
[11] "/Users/biocbuild/bbs-3.10-bioc/meat/BufferedMatrix.Rcheck/tests/BM15d3adda1d7"  
[12] "/Users/biocbuild/bbs-3.10-bioc/meat/BufferedMatrix.Rcheck/tests/BM15d3a56ac2ab2"
[13] "/Users/biocbuild/bbs-3.10-bioc/meat/BufferedMatrix.Rcheck/tests/BM15d3a41273892"
[14] "/Users/biocbuild/bbs-3.10-bioc/meat/BufferedMatrix.Rcheck/tests/BM15d3a75f31aa8"
[15] "/Users/biocbuild/bbs-3.10-bioc/meat/BufferedMatrix.Rcheck/tests/BM15d3a2b5b4817"
> 
> 
> ### 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: 0x7f92aea0b5e0>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x7f92aea0b5e0>
Warning message:
In dir.create(new.directory) :
  '/Users/biocbuild/bbs-3.10-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x7f92aea0b5e0>
> rowMedians(tmp)
  [1] -7.179365e-02 -5.423550e-01  3.451036e-01  4.022077e-01  1.206088e-01
  [6] -4.863658e-02  1.979518e-03 -3.389816e-01 -1.648681e-01 -3.145217e-01
 [11]  5.288489e-02 -4.760794e-03 -1.332705e-01  2.065777e-01 -9.537983e-02
 [16]  1.073606e-01  1.751306e-01  2.961117e-01 -5.917090e-02 -7.281195e-01
 [21]  2.657239e-01  8.496110e-01 -1.723566e-01  5.327362e-01 -3.291872e-01
 [26] -2.453055e-01  4.426801e-01 -4.024913e-01 -8.397539e-02 -3.025319e-01
 [31]  2.791097e-01  1.348833e-01  1.184522e-01  2.937070e-01  3.346517e-01
 [36] -4.712067e-01  7.517777e-01  1.476678e-01 -7.537686e-02 -3.506570e-01
 [41] -9.195046e-02 -3.608954e-01  1.361556e-01  4.271682e-01  5.596293e-02
 [46]  3.362676e-02 -9.379688e-01  4.923943e-01  6.798037e-01 -2.265390e-01
 [51]  4.455737e-01  2.366039e-01 -7.448574e-01 -2.004880e-01 -2.966491e-01
 [56] -8.568066e-02  2.546244e-01  2.110412e-01 -1.986463e-01 -5.605828e-02
 [61] -9.513382e-02  3.917979e-02 -4.071036e-02  3.956338e-01 -1.053324e-01
 [66]  1.751993e-01 -3.976729e-01 -2.499055e-02 -3.746054e-01 -4.148142e-01
 [71]  2.441037e-01 -5.348251e-01  1.365885e-01 -2.270032e-01 -3.372304e-01
 [76] -2.510394e-01  2.485935e-01 -8.947475e-02 -3.646062e-01 -6.193156e-02
 [81]  2.030381e-01 -1.373238e-01 -3.056263e-01  4.340063e-01 -3.431841e-01
 [86]  2.924845e-01  1.389350e-01 -4.257964e-01 -2.700852e-01 -3.166625e-01
 [91]  3.238431e-01 -9.623110e-02 -3.775217e-01  3.365238e-01 -8.637299e-02
 [96] -6.631347e-01  4.387898e-01 -1.955332e-02  4.249876e-01 -1.278302e-01
[101] -2.593257e-02  7.574727e-02 -2.772585e-02  2.251844e-01  1.763060e-01
[106] -4.761516e-01 -1.611944e-01 -1.977814e-01  5.832397e-01  1.230771e-01
[111]  2.636936e-01 -3.990450e-01 -7.370437e-02  2.315945e-01 -4.940408e-01
[116] -6.134104e-01 -3.554364e-01 -9.803987e-01  3.261300e-01  1.301496e-01
[121]  1.105753e-01  4.357797e-01  6.014632e-02  1.236213e-01  2.491007e-01
[126]  1.851178e-01  1.877072e-01  2.816732e-01  2.756885e-01 -1.490146e-01
[131] -4.765738e-01  4.518213e-01 -4.034406e-02  1.623547e-02 -1.920849e-01
[136]  2.992144e-01  2.791199e-01 -1.744308e-01 -2.658749e-01 -1.944108e-01
[141]  1.149034e-02 -3.518238e-01 -4.647975e-01 -2.278276e-02 -3.869564e-01
[146] -8.348284e-02 -5.043190e-02  1.127761e-01 -5.668828e-02  5.083813e-02
[151] -3.393735e-01  1.053906e-01  4.060472e-01 -1.121423e-01  3.355087e-02
[156] -4.407859e-01 -2.190738e-01 -4.054742e-01  3.616115e-02  3.697268e-02
[161] -8.082266e-02  2.599149e-01 -2.052461e-01 -4.359756e-01  1.818690e-01
[166]  1.808982e-01 -3.392656e-02 -3.888632e-01  5.187299e-01  1.209188e-01
[171] -3.546779e-01  4.233355e-01 -2.236312e-01  3.806291e-01  1.664993e-02
[176] -4.904146e-01  4.964677e-01 -4.118446e-01  2.447706e-01 -7.665212e-02
[181]  1.284168e-01  2.994973e-01 -5.149251e-01  1.257342e-01 -1.302834e-01
[186] -4.968046e-02  1.202617e-01  1.833286e-01  1.564229e-01  7.540314e-02
[191] -1.633905e-01  1.392036e-01 -3.303898e-01 -6.521687e-02  1.611442e-01
[196]  9.983042e-05 -8.462314e-02  4.585896e-01 -1.949121e-01  1.776657e-01
[201] -3.091289e-02 -3.393608e-01  2.211782e-01 -2.716121e-01 -1.179599e-01
[206] -4.679930e-01  5.249679e-01  1.298306e-01 -2.854676e-01 -7.802243e-02
[211]  1.373458e-01 -2.979526e-01  9.662314e-03 -2.526234e-01  6.800735e-02
[216]  8.901646e-03 -3.268025e-01  3.769072e-01  1.218612e-01  7.640357e-01
[221]  2.308573e-01 -1.195075e-01 -1.391981e-01 -3.183464e-02  1.086370e-02
[226] -4.011983e-01  2.235457e-01 -5.275385e-01 -9.532662e-02 -2.143236e-01
> 
> proc.time()
   user  system elapsed 
  4.043   6.738  11.250 

BufferedMatrix.Rcheck/tests/rawCalltesting.Rout


R version 3.6.3 (2020-02-29) -- "Holding the Windsock"
Copyright (C) 2020 The R Foundation for Statistical Computing
Platform: x86_64-apple-darwin15.6.0 (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: 0x7f87aea06190>
> .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: 0x7f87aea06190>
> .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: 0x7f87aea06190>
> .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: 0x7f87aea06190>
> 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: 0x7f87b3400700>
> .Call("R_bm_AddColumn",P)
<pointer: 0x7f87b3400700>
> .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: 0x7f87b3400700>
> .Call("R_bm_AddColumn",P)
<pointer: 0x7f87b3400700>
> .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: 0x7f87b3400700>
> 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: 0x7f87b3508130>
> .Call("R_bm_AddColumn",P)
<pointer: 0x7f87b3508130>
> .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: 0x7f87b3508130>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x7f87b3508130>
> .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: 0x7f87b3508130>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x7f87b3508130>
> .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: 0x7f87b3508130>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x7f87b3508130>
> .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: 0x7f87b3508130>
> 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: 0x7f87b3506f50>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x7f87b3506f50>
> .Call("R_bm_AddColumn",P)
<pointer: 0x7f87b3506f50>
> .Call("R_bm_AddColumn",P)
<pointer: 0x7f87b3506f50>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile15fca1845b148" "BufferedMatrixFile15fca779fa6b" 
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile15fca1845b148" "BufferedMatrixFile15fca779fa6b" 
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x7f87abe20340>
> .Call("R_bm_AddColumn",P)
<pointer: 0x7f87abe20340>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x7f87abe20340>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x7f87abe20340>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x7f87abe20340>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x7f87abe20340>
> .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: 0x7f87b3504dc0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x7f87b3504dc0>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x7f87b3504dc0>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x7f87b3504dc0>
> 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: 0x7f87aee011a0>
> .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: 0x7f87aee011a0>
> rm(P)
> 
> proc.time()
   user  system elapsed 
  0.455   0.118   0.545 

BufferedMatrix.Rcheck/tests/Rcodetesting.Rout


R version 3.6.3 (2020-02-29) -- "Holding the Windsock"
Copyright (C) 2020 The R Foundation for Statistical Computing
Platform: x86_64-apple-darwin15.6.0 (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.420   0.082   0.477 

Example timings