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

This page was generated on 2022-03-18 11:07:05 -0400 (Fri, 18 Mar 2022).

HostnameOSArch (*)R versionInstalled pkgs
nebbiolo1Linux (Ubuntu 20.04.4 LTS)x86_64R Under development (unstable) (2022-02-17 r81757) -- "Unsuffered Consequences" 4334
riesling1Windows Server 2019 Standardx64R Under development (unstable) (2021-11-21 r81221) -- "Unsuffered Consequences" 4097
palomino3Windows Server 2022 Datacenterx64R Under development (unstable) (2022-02-17 r81757 ucrt) -- "Unsuffered Consequences" 4083
merida1macOS 10.14.6 Mojavex86_64R Under development (unstable) (2022-03-02 r81842) -- "Unsuffered Consequences" 4134
Click on any hostname to see more info about the system (e.g. compilers)      (*) as reported by 'uname -p', except on Windows and Mac OS X

CHECK results for BufferedMatrix on riesling1


To the developers/maintainers of the BufferedMatrix package:
- Please allow up to 24 hours (and sometimes 48 hours) for your latest push to git@git.bioconductor.org:packages/BufferedMatrix.git to
reflect on this report. See How and When does the builder pull? When will my changes propagate? here for more information.
- Make sure to use the following settings in order to reproduce any error or warning you see on this page.

raw results

Package 221/2090HostnameOS / ArchINSTALLBUILDCHECKBUILD BIN
BufferedMatrix 1.59.0  (landing page)
Ben Bolstad
Snapshot Date: 2022-03-17 13:55:23 -0400 (Thu, 17 Mar 2022)
git_url: https://git.bioconductor.org/packages/BufferedMatrix
git_branch: master
git_last_commit: 50f93ab
git_last_commit_date: 2021-10-26 11:50:47 -0400 (Tue, 26 Oct 2021)
nebbiolo1Linux (Ubuntu 20.04.4 LTS) / x86_64  OK    OK    OK  UNNEEDED, same version is already published
riesling1Windows Server 2019 Standard / x64  OK    OK    OK    OK  
palomino3Windows Server 2022 Datacenter / x64  OK    OK    OK    OK  UNNEEDED, same version is already published
merida1macOS 10.14.6 Mojave / x86_64  OK    OK    WARNINGS    OK  UNNEEDED, same version is already published

Summary

Package: BufferedMatrix
Version: 1.59.0
Command: D:\biocbuild\bbs-3.15-bioc\R\bin\R.exe CMD check --no-multiarch --install=check:BufferedMatrix.install-out.txt --library=D:\biocbuild\bbs-3.15-bioc\R\library --no-vignettes --timings BufferedMatrix_1.59.0.tar.gz
StartedAt: 2022-03-17 18:37:08 -0400 (Thu, 17 Mar 2022)
EndedAt: 2022-03-17 18:39:17 -0400 (Thu, 17 Mar 2022)
EllapsedTime: 129.3 seconds
RetCode: 0
Status:   OK  
CheckDir: BufferedMatrix.Rcheck
Warnings: 0

Command output

##############################################################################
##############################################################################
###
### Running command:
###
###   D:\biocbuild\bbs-3.15-bioc\R\bin\R.exe CMD check --no-multiarch --install=check:BufferedMatrix.install-out.txt --library=D:\biocbuild\bbs-3.15-bioc\R\library --no-vignettes --timings BufferedMatrix_1.59.0.tar.gz
###
##############################################################################
##############################################################################


* using log directory 'D:/biocbuild/bbs-3.15-bioc/meat/BufferedMatrix.Rcheck'
* using R Under development (unstable) (2021-11-21 r81221)
* using platform: x86_64-w64-mingw32 (64-bit)
* using session charset: ISO8859-1
* using option '--no-vignettes'
* checking for file 'BufferedMatrix/DESCRIPTION' ... OK
* this is package 'BufferedMatrix' version '1.59.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 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 for x64 is not available
File 'D:/biocbuild/bbs-3.15-bioc/R/library/BufferedMatrix/libs/x64/BufferedMatrix.dll':
  Found 'abort', possibly from 'abort' (C), 'runtime' (Fortran)

Compiled code should not call entry points which might terminate R nor
write to stdout/stderr instead of to the console, nor use Fortran I/O
nor system RNGs. The detected symbols are linked into the code but
might come from libraries and not actually be called.

See 'Writing portable packages' in the 'Writing R Extensions' manual.
* 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
  'D:/biocbuild/bbs-3.15-bioc/meat/BufferedMatrix.Rcheck/00check.log'
for details.



Installation output

BufferedMatrix.Rcheck/00install.out

##############################################################################
##############################################################################
###
### Running command:
###
###   D:\biocbuild\bbs-3.15-bioc\R\bin\R.exe CMD INSTALL BufferedMatrix
###
##############################################################################
##############################################################################


* installing to library 'D:/biocbuild/bbs-3.15-bioc/R/library'
* installing *source* package 'BufferedMatrix' ...
** using staged installation
** libs
"C:/rtools40/mingw64/bin/"gcc  -I"D:/biocbuild/bbs-3.15-bioc/R/include" -DNDEBUG     -I"C:/extsoft/include"     -O2 -Wall  -std=gnu99 -mfpmath=sse -msse2 -mstackrealign -fno-reorder-blocks-and-partition  -c RBufferedMatrix.c -o RBufferedMatrix.o
"C:/rtools40/mingw64/bin/"gcc  -I"D:/biocbuild/bbs-3.15-bioc/R/include" -DNDEBUG     -I"C:/extsoft/include"     -O2 -Wall  -std=gnu99 -mfpmath=sse -msse2 -mstackrealign -fno-reorder-blocks-and-partition  -c doubleBufferedMatrix.c -o doubleBufferedMatrix.o
doubleBufferedMatrix.c: In function 'dbm_ReadOnlyMode':
doubleBufferedMatrix.c:1580:7: warning: suggest parentheses around operand of '!' or change '&' to '&&' or '!' to '~' [-Wparentheses]
   if (!(Matrix->readonly) & setting){
       ^~~~~~~~~~~~~~~~~~~
At top level:
doubleBufferedMatrix.c:3327:12: warning: 'sort_double' defined but not used [-Wunused-function]
 static int sort_double(const double *a1,const double *a2){
            ^~~~~~~~~~~
"C:/rtools40/mingw64/bin/"gcc  -I"D:/biocbuild/bbs-3.15-bioc/R/include" -DNDEBUG     -I"C:/extsoft/include"     -O2 -Wall  -std=gnu99 -mfpmath=sse -msse2 -mstackrealign -fno-reorder-blocks-and-partition  -c doubleBufferedMatrix_C_tests.c -o doubleBufferedMatrix_C_tests.o
"C:/rtools40/mingw64/bin/"gcc  -I"D:/biocbuild/bbs-3.15-bioc/R/include" -DNDEBUG     -I"C:/extsoft/include"     -O2 -Wall  -std=gnu99 -mfpmath=sse -msse2 -mstackrealign -fno-reorder-blocks-and-partition  -c init_package.c -o init_package.o
C:/rtools40/mingw64/bin/gcc -shared -s -static-libgcc -o BufferedMatrix.dll tmp.def RBufferedMatrix.o doubleBufferedMatrix.o doubleBufferedMatrix_C_tests.o init_package.o -LC:/extsoft/lib/x64 -LC:/extsoft/lib -LD:/biocbuild/bbs-3.15-bioc/R/bin/x64 -lR
installing to D:/biocbuild/bbs-3.15-bioc/R/library/00LOCK-BufferedMatrix/00new/BufferedMatrix/libs/x64
** 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
  converting help for package 'BufferedMatrix'
    finding HTML links ... done
    BufferedMatrix-class                    html  
    as.BufferedMatrix                       html  
    createBufferedMatrix                    html  
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (BufferedMatrix)
Making 'packages.html' ... done

Tests output

BufferedMatrix.Rcheck/tests/c_code_level_tests.Rout


R Under development (unstable) (2021-11-21 r81221) -- "Unsuffered Consequences"
Copyright (C) 2021 The R Foundation for Statistical Computing
Platform: x86_64-w64-mingw32/x64 (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.25    0.09    0.62 

BufferedMatrix.Rcheck/tests/objectTesting.Rout


R Under development (unstable) (2021-11-21 r81221) -- "Unsuffered Consequences"
Copyright (C) 2021 The R Foundation for Statistical Computing
Platform: x86_64-w64-mingw32/x64 (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] "D:/biocbuild/bbs-3.15-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) max used (Mb)
Ncells 438496 23.5     940730 50.3   624231 33.4
Vcells 761370  5.9    8388608 64.0  1691090 13.0
> 
> 
> 
> 
> ##
> ## 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] "Thu Mar 17 18:37:32 2022"
> 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] "Thu Mar 17 18:37:34 2022"
> 
> 
> 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: 0x0000000012b13d70>
> 
> 
> 
> 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] "Thu Mar 17 18:37:58 2022"
> 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] "Thu Mar 17 18:38:11 2022"
> 
> ColMode(tmp2)
<pointer: 0x0000000012b13d70>
> 
> 
> 
> ### 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.6691731 -1.1306467  0.4733143  0.6298952
[2,]   1.2592110  0.5202191 -0.1696558 -0.3847474
[3,]  -0.1556034  1.0821276 -1.4765426  0.7465664
[4,]  -0.3904053 -0.1745694  1.5583277 -1.2079907
> ewApply(tmp5,abs)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    D:/biocbuild/bbs-3.15-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
            [,1]      [,2]      [,3]      [,4]
[1,] 100.6691731 1.1306467 0.4733143 0.6298952
[2,]   1.2592110 0.5202191 0.1696558 0.3847474
[3,]   0.1556034 1.0821276 1.4765426 0.7465664
[4,]   0.3904053 0.1745694 1.5583277 1.2079907
> ewApply(tmp5,sqrt)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    D:/biocbuild/bbs-3.15-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
           [,1]      [,2]      [,3]      [,4]
[1,] 10.0334029 1.0633187 0.6879784 0.7936594
[2,]  1.1221457 0.7212622 0.4118930 0.6202801
[3,]  0.3944660 1.0402536 1.2151307 0.8640407
[4,]  0.6248242 0.4178151 1.2483300 1.0990863
> 
> 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:    D:/biocbuild/bbs-3.15-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
          [,1]     [,2]     [,3]     [,4]
[1,] 226.00320 36.76383 32.35310 33.56649
[2,]  37.48067 32.73284 29.28859 31.58755
[3,]  29.10026 36.48466 38.62785 34.38697
[4,]  31.63865 29.35272 39.04163 37.19885
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x0000000012b13fa0>
> exp(tmp5)
<pointer: 0x0000000012b13fa0>
> log(tmp5,2)
<pointer: 0x0000000012b13fa0>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 470.3961
> Min(tmp5)
[1] 53.25222
> mean(tmp5)
[1] 71.92847
> Sum(tmp5)
[1] 14385.69
> Var(tmp5)
[1] 865.567
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 90.63288 71.55738 68.50224 70.50881 73.30794 69.00561 64.28981 72.92598
 [9] 69.29362 69.26047
> rowSums(tmp5)
 [1] 1812.658 1431.148 1370.045 1410.176 1466.159 1380.112 1285.796 1458.520
 [9] 1385.872 1385.209
> rowVars(tmp5)
 [1] 8050.46162   70.14301   37.12951   74.61755  104.84397   52.08184
 [7]   31.42116   66.06344   74.91317   32.84491
> rowSd(tmp5)
 [1] 89.724365  8.375142  6.093399  8.638145 10.239334  7.216775  5.605458
 [8]  8.127942  8.655239  5.731048
> rowMax(tmp5)
 [1] 470.39605  87.34529  80.39881  87.82241  91.49006  83.88966  76.11562
 [8]  88.70234  88.76774  81.92239
> rowMin(tmp5)
 [1] 57.50304 58.22348 60.09848 56.47239 56.76351 59.13137 56.71454 59.03376
 [9] 53.25222 56.88164
> 
> colMeans(tmp5)
 [1] 109.66663  67.78225  71.18107  71.40971  73.62411  69.49007  73.02292
 [8]  70.76947  72.10529  68.28008  69.90230  69.71299  68.70271  69.63548
[15]  72.53319  65.77108  70.56185  69.25481  67.68061  67.48283
> colSums(tmp5)
 [1] 1096.6663  677.8225  711.8107  714.0971  736.2411  694.9007  730.2292
 [8]  707.6947  721.0529  682.8008  699.0230  697.1299  687.0271  696.3548
[15]  725.3319  657.7108  705.6185  692.5481  676.8061  674.8283
> colVars(tmp5)
 [1] 16101.93666    39.63322    71.90421    67.55207   116.12511    76.14224
 [7]    77.12015   142.61848    38.27944    71.41900    28.40731    77.61618
[13]    60.98798    39.38716    87.98137    40.07783    77.01560    45.91227
[19]    76.54711    50.12810
> colSd(tmp5)
 [1] 126.893407   6.295492   8.479635   8.219006  10.776136   8.725952
 [7]   8.781808  11.942298   6.187038   8.450976   5.329851   8.810005
[13]   7.809480   6.275919   9.379838   6.330706   8.775853   6.775859
[19]   8.749120   7.080120
> colMax(tmp5)
 [1] 470.39605  76.51910  81.66158  88.61652  91.49006  88.70234  83.91243
 [8]  87.82241  80.49762  81.11227  77.68399  84.22635  87.34529  83.20010
[15]  84.42140  75.04424  88.76774  82.76305  82.96480  81.92239
> colMin(tmp5)
 [1] 60.56839 59.54740 57.65415 59.26358 61.71428 60.21637 58.99567 56.88164
 [9] 62.32557 58.22348 58.93115 56.71454 59.03376 62.89867 58.48332 57.50304
[17] 56.76351 58.95329 53.25222 56.47239
> 
> 
> ### 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]       NA 71.55738 68.50224 70.50881 73.30794 69.00561 64.28981 72.92598
 [9] 69.29362 69.26047
> rowSums(tmp5)
 [1]       NA 1431.148 1370.045 1410.176 1466.159 1380.112 1285.796 1458.520
 [9] 1385.872 1385.209
> rowVars(tmp5)
 [1] 8469.17264   70.14301   37.12951   74.61755  104.84397   52.08184
 [7]   31.42116   66.06344   74.91317   32.84491
> rowSd(tmp5)
 [1] 92.028108  8.375142  6.093399  8.638145 10.239334  7.216775  5.605458
 [8]  8.127942  8.655239  5.731048
> rowMax(tmp5)
 [1]       NA 87.34529 80.39881 87.82241 91.49006 83.88966 76.11562 88.70234
 [9] 88.76774 81.92239
> rowMin(tmp5)
 [1]       NA 58.22348 60.09848 56.47239 56.76351 59.13137 56.71454 59.03376
 [9] 53.25222 56.88164
> 
> colMeans(tmp5)
 [1] 109.66663  67.78225  71.18107  71.40971  73.62411  69.49007  73.02292
 [8]  70.76947  72.10529  68.28008  69.90230        NA  68.70271  69.63548
[15]  72.53319  65.77108  70.56185  69.25481  67.68061  67.48283
> colSums(tmp5)
 [1] 1096.6663  677.8225  711.8107  714.0971  736.2411  694.9007  730.2292
 [8]  707.6947  721.0529  682.8008  699.0230        NA  687.0271  696.3548
[15]  725.3319  657.7108  705.6185  692.5481  676.8061  674.8283
> colVars(tmp5)
 [1] 16101.93666    39.63322    71.90421    67.55207   116.12511    76.14224
 [7]    77.12015   142.61848    38.27944    71.41900    28.40731          NA
[13]    60.98798    39.38716    87.98137    40.07783    77.01560    45.91227
[19]    76.54711    50.12810
> colSd(tmp5)
 [1] 126.893407   6.295492   8.479635   8.219006  10.776136   8.725952
 [7]   8.781808  11.942298   6.187038   8.450976   5.329851         NA
[13]   7.809480   6.275919   9.379838   6.330706   8.775853   6.775859
[19]   8.749120   7.080120
> colMax(tmp5)
 [1] 470.39605  76.51910  81.66158  88.61652  91.49006  88.70234  83.91243
 [8]  87.82241  80.49762  81.11227  77.68399        NA  87.34529  83.20010
[15]  84.42140  75.04424  88.76774  82.76305  82.96480  81.92239
> colMin(tmp5)
 [1] 60.56839 59.54740 57.65415 59.26358 61.71428 60.21637 58.99567 56.88164
 [9] 62.32557 58.22348 58.93115       NA 59.03376 62.89867 58.48332 57.50304
[17] 56.76351 58.95329 53.25222 56.47239
> 
> Max(tmp5,na.rm=TRUE)
[1] 470.3961
> Min(tmp5,na.rm=TRUE)
[1] 53.25222
> mean(tmp5,na.rm=TRUE)
[1] 71.94549
> Sum(tmp5,na.rm=TRUE)
[1] 14317.15
> Var(tmp5,na.rm=TRUE)
[1] 869.8804
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 91.79552 71.55738 68.50224 70.50881 73.30794 69.00561 64.28981 72.92598
 [9] 69.29362 69.26047
> rowSums(tmp5,na.rm=TRUE)
 [1] 1744.115 1431.148 1370.045 1410.176 1466.159 1380.112 1285.796 1458.520
 [9] 1385.872 1385.209
> rowVars(tmp5,na.rm=TRUE)
 [1] 8469.17264   70.14301   37.12951   74.61755  104.84397   52.08184
 [7]   31.42116   66.06344   74.91317   32.84491
> rowSd(tmp5,na.rm=TRUE)
 [1] 92.028108  8.375142  6.093399  8.638145 10.239334  7.216775  5.605458
 [8]  8.127942  8.655239  5.731048
> rowMax(tmp5,na.rm=TRUE)
 [1] 470.39605  87.34529  80.39881  87.82241  91.49006  83.88966  76.11562
 [8]  88.70234  88.76774  81.92239
> rowMin(tmp5,na.rm=TRUE)
 [1] 57.50304 58.22348 60.09848 56.47239 56.76351 59.13137 56.71454 59.03376
 [9] 53.25222 56.88164
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 109.66663  67.78225  71.18107  71.40971  73.62411  69.49007  73.02292
 [8]  70.76947  72.10529  68.28008  69.90230  69.84303  68.70271  69.63548
[15]  72.53319  65.77108  70.56185  69.25481  67.68061  67.48283
> colSums(tmp5,na.rm=TRUE)
 [1] 1096.6663  677.8225  711.8107  714.0971  736.2411  694.9007  730.2292
 [8]  707.6947  721.0529  682.8008  699.0230  628.5873  687.0271  696.3548
[15]  725.3319  657.7108  705.6185  692.5481  676.8061  674.8283
> colVars(tmp5,na.rm=TRUE)
 [1] 16101.93666    39.63322    71.90421    67.55207   116.12511    76.14224
 [7]    77.12015   142.61848    38.27944    71.41900    28.40731    87.12796
[13]    60.98798    39.38716    87.98137    40.07783    77.01560    45.91227
[19]    76.54711    50.12810
> colSd(tmp5,na.rm=TRUE)
 [1] 126.893407   6.295492   8.479635   8.219006  10.776136   8.725952
 [7]   8.781808  11.942298   6.187038   8.450976   5.329851   9.334236
[13]   7.809480   6.275919   9.379838   6.330706   8.775853   6.775859
[19]   8.749120   7.080120
> colMax(tmp5,na.rm=TRUE)
 [1] 470.39605  76.51910  81.66158  88.61652  91.49006  88.70234  83.91243
 [8]  87.82241  80.49762  81.11227  77.68399  84.22635  87.34529  83.20010
[15]  84.42140  75.04424  88.76774  82.76305  82.96480  81.92239
> colMin(tmp5,na.rm=TRUE)
 [1] 60.56839 59.54740 57.65415 59.26358 61.71428 60.21637 58.99567 56.88164
 [9] 62.32557 58.22348 58.93115 56.71454 59.03376 62.89867 58.48332 57.50304
[17] 56.76351 58.95329 53.25222 56.47239
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1]      NaN 71.55738 68.50224 70.50881 73.30794 69.00561 64.28981 72.92598
 [9] 69.29362 69.26047
> rowSums(tmp5,na.rm=TRUE)
 [1]    0.000 1431.148 1370.045 1410.176 1466.159 1380.112 1285.796 1458.520
 [9] 1385.872 1385.209
> rowVars(tmp5,na.rm=TRUE)
 [1]        NA  70.14301  37.12951  74.61755 104.84397  52.08184  31.42116
 [8]  66.06344  74.91317  32.84491
> rowSd(tmp5,na.rm=TRUE)
 [1]        NA  8.375142  6.093399  8.638145 10.239334  7.216775  5.605458
 [8]  8.127942  8.655239  5.731048
> rowMax(tmp5,na.rm=TRUE)
 [1]       NA 87.34529 80.39881 87.82241 91.49006 83.88966 76.11562 88.70234
 [9] 88.76774 81.92239
> rowMin(tmp5,na.rm=TRUE)
 [1]       NA 58.22348 60.09848 56.47239 56.76351 59.13137 56.71454 59.03376
 [9] 53.25222 56.88164
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1] 69.58558 66.81149 71.60800 71.58143 73.43648 69.14278 74.58150 68.93681
 [9] 72.14852 67.25171 69.10936      NaN 68.67694 68.95562 71.48051 66.68975
[17] 70.74107 70.39942 68.27931 67.74479
> colSums(tmp5,na.rm=TRUE)
 [1] 626.2702 601.3034 644.4720 644.2329 660.9284 622.2850 671.2335 620.4313
 [9] 649.3367 605.2654 621.9842   0.0000 618.0925 620.6006 643.3246 600.2078
[17] 636.6697 633.5948 614.5138 609.7031
> colVars(tmp5,na.rm=TRUE)
 [1]  41.66237  33.98562  78.84174  75.66434 130.24471  84.30313  59.43187
 [8] 122.66132  43.04334  68.44893  24.88462        NA  68.60401  39.11068
[15]  86.51259  35.59303  86.28120  36.91224  82.08305  55.62212
> colSd(tmp5,na.rm=TRUE)
 [1]  6.454639  5.829719  8.879287  8.698525 11.412480  9.181673  7.709207
 [8] 11.075257  6.560743  8.273387  4.988449        NA  8.282754  6.253853
[15]  9.301214  5.965990  9.288767  6.075544  9.059970  7.458024
> colMax(tmp5,na.rm=TRUE)
 [1] 78.47259 75.93805 81.66158 88.61652 91.49006 88.70234 83.91243 87.82241
 [9] 80.49762 81.11227 77.68399     -Inf 87.34529 83.20010 84.42140 75.04424
[17] 88.76774 82.76305 82.96480 81.92239
> colMin(tmp5,na.rm=TRUE)
 [1] 60.56839 59.54740 57.65415 59.26358 61.71428 60.21637 62.28710 56.88164
 [9] 62.32557 58.22348 58.93115      Inf 59.03376 62.89867 58.48332 60.11944
[17] 56.76351 63.51545 53.25222 56.47239
> 
> 
> 
> 
> 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] 231.10536 152.29742 285.42492 181.63888 176.71813 291.28685  73.11808
 [8] 251.20194 268.07301 158.86312
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 231.10536 152.29742 285.42492 181.63888 176.71813 291.28685  73.11808
 [8] 251.20194 268.07301 158.86312
> 
> 
> 
> 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  5.684342e-14  0.000000e+00 -5.684342e-14  5.684342e-14
 [6] -2.842171e-14 -5.684342e-14  0.000000e+00  0.000000e+00  2.842171e-14
[11] -7.105427e-15  0.000000e+00  3.552714e-14  2.842171e-14 -8.526513e-14
[16] -5.684342e-14  1.136868e-13 -1.705303e-13 -2.273737e-13  1.705303e-13
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> ## making sure these things agree
> ##
> ## first when there is no NA
> 
> 
> 
> agree.checks <- function(buff.matrix,r.matrix,err.tol=1e-10){
+ 
+   if (Max(buff.matrix,na.rm=TRUE) != max(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Max")
+   }
+   
+ 
+   if (Min(buff.matrix,na.rm=TRUE) != min(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Min")
+   }
+ 
+ 
+   if (abs(Sum(buff.matrix,na.rm=TRUE)- sum(r.matrix,na.rm=TRUE)) > err.tol){
+ 
+     cat(Sum(buff.matrix,na.rm=TRUE),"\n")
+     cat(sum(r.matrix,na.rm=TRUE),"\n")
+     cat(Sum(buff.matrix,na.rm=TRUE) - sum(r.matrix,na.rm=TRUE),"\n")
+     
+     stop("No agreement in Sum")
+   }
+   
+   if (abs(mean(buff.matrix,na.rm=TRUE) - mean(r.matrix,na.rm=TRUE)) > err.tol){
+     stop("No agreement in mean")
+   }
+   
+   
+   if(abs(Var(buff.matrix,na.rm=TRUE) - var(as.vector(r.matrix),na.rm=TRUE)) > err.tol){
+     stop("No agreement in Var")
+   }
+   
+   
+ 
+   if(any(abs(rowMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,mean,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowMeans")
+   }
+   
+   
+   if(any(abs(colMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,mean,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colMeans")
+   }
+   
+   
+   if(any(abs(rowSums(buff.matrix,na.rm=TRUE)  -  apply(r.matrix,1,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in rowSums")
+   }
+   
+   
+   if(any(abs(colSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colSums")
+   }
+   
+   ### this is to get around the fact that R doesn't like to compute NA on an entire vector of NA when 
+   ### computing variance
+   my.Var <- function(x,na.rm=FALSE){
+    if (all(is.na(x))){
+      return(NA)
+    } else {
+      var(x,na.rm=na.rm)
+    }
+ 
+   }
+   
+   if(any(abs(rowVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+   
+   
+   if(any(abs(colVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+ 
+ 
+   if(any(abs(rowMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+ 
+   if(any(abs(colMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+   
+   
+   if(any(abs(rowMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+   
+ 
+   if(any(abs(colMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+ 
+   if(any(abs(colMedians(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,median,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMedian")
+   }
+ 
+   if(any(abs(colRanges(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,range,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colRanges")
+   }
+ 
+ 
+   
+ }
> 
> 
> 
> 
> 
> 
> 
> 
> 
> for (rep in 1:20){
+   copymatrix <- matrix(rnorm(200,150,15),10,20)
+   
+   tmp5[1:10,1:20] <- copymatrix
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ## now lets assign some NA values and check agreement
+ 
+   which.row <- sample(1:10,1,replace=TRUE)
+   which.col  <- sample(1:20,1,replace=TRUE)
+   
+   cat(which.row," ",which.col,"\n")
+   
+   tmp5[which.row,which.col] <- NA
+   copymatrix[which.row,which.col] <- NA
+   
+   agree.checks(tmp5,copymatrix)
+ 
+   ## make an entire row NA
+   tmp5[which.row,] <- NA
+   copymatrix[which.row,] <- NA
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ### also make an entire col NA
+   tmp5[,which.col] <- NA
+   copymatrix[,which.col] <- NA
+ 
+   agree.checks(tmp5,copymatrix)
+ 
+   ### now make 1 element non NA with NA in the rest of row and column
+ 
+   tmp5[which.row,which.col] <- rnorm(1,150,15)
+   copymatrix[which.row,which.col] <- tmp5[which.row,which.col]
+ 
+   agree.checks(tmp5,copymatrix)
+ }
9   8 
5   10 
6   20 
7   14 
6   3 
7   14 
10   18 
6   2 
7   7 
1   19 
7   18 
2   5 
4   14 
10   3 
7   4 
5   5 
8   3 
6   13 
9   12 
7   7 
There were 50 or more warnings (use warnings() to see the first 50)
> 
> 
> ### now test 1 by n and n by 1 matrix
> 
> 
> err.tol <- 1e-12
> 
> rm(tmp5)
> 
> dataset1 <- rnorm(100)
> dataset2 <- rnorm(100)
> 
> tmp <- createBufferedMatrix(1,100)
> tmp[1,] <- dataset1
> 
> tmp2 <- createBufferedMatrix(100,1)
> tmp2[,1] <- dataset2
> 
> 
> 
> 
> 
> Max(tmp)
[1] 2.84617
> Min(tmp)
[1] -2.815914
> mean(tmp)
[1] 0.1235956
> Sum(tmp)
[1] 12.35956
> Var(tmp)
[1] 1.288231
> 
> rowMeans(tmp)
[1] 0.1235956
> rowSums(tmp)
[1] 12.35956
> rowVars(tmp)
[1] 1.288231
> rowSd(tmp)
[1] 1.135003
> rowMax(tmp)
[1] 2.84617
> rowMin(tmp)
[1] -2.815914
> 
> colMeans(tmp)
  [1]  2.21658943 -0.38014650  0.65936277  1.94735994 -0.65701840  0.84079820
  [7]  0.84681022  0.89806301 -0.01057574  0.56246029  0.90066940  0.32749599
 [13]  2.51338341 -0.44747257  2.11121385 -1.15960973  0.16237497 -0.04769838
 [19] -2.03242038 -0.73445533  0.96990621 -0.19882485 -0.08695896  2.84617034
 [25] -0.83251916 -1.92926699  1.11812431  0.83192010  1.71672629  1.67871287
 [31]  0.33636350 -1.51563760 -1.19173931 -0.17430639  1.62461004  0.70311018
 [37]  0.82699328 -0.02612684  2.00776158  1.12951380 -1.02806445 -0.48528351
 [43] -0.57701653 -1.63281254 -0.33859600  0.09798236 -0.31099029 -0.86524419
 [49] -0.25999732  0.35579779 -0.13915738 -1.16039602  0.04523951 -0.25930360
 [55]  0.93399369  0.53013512  1.66200546 -0.57238416 -0.22135679  1.62396259
 [61] -1.08726303 -0.34436323 -0.37085568 -0.81624494 -0.67094049  0.15084321
 [67]  0.87309873 -1.02213936 -1.50754846  2.12161015  1.43575792 -1.65613373
 [73]  0.77943146 -1.09939599 -0.77369886 -0.57101181  0.67500159 -1.26714185
 [79] -0.39871913 -1.42415269  1.32692456  0.36956931  0.99013802 -2.81591444
 [85] -1.58902415  1.88237463 -0.26052822 -0.41973205  1.01989879  0.96114613
 [91]  0.36357140 -1.07263969 -0.86032390  0.64972770 -0.12193091  0.92569506
 [97] -0.05455358 -0.81309153  1.64617617  1.45571355
> colSums(tmp)
  [1]  2.21658943 -0.38014650  0.65936277  1.94735994 -0.65701840  0.84079820
  [7]  0.84681022  0.89806301 -0.01057574  0.56246029  0.90066940  0.32749599
 [13]  2.51338341 -0.44747257  2.11121385 -1.15960973  0.16237497 -0.04769838
 [19] -2.03242038 -0.73445533  0.96990621 -0.19882485 -0.08695896  2.84617034
 [25] -0.83251916 -1.92926699  1.11812431  0.83192010  1.71672629  1.67871287
 [31]  0.33636350 -1.51563760 -1.19173931 -0.17430639  1.62461004  0.70311018
 [37]  0.82699328 -0.02612684  2.00776158  1.12951380 -1.02806445 -0.48528351
 [43] -0.57701653 -1.63281254 -0.33859600  0.09798236 -0.31099029 -0.86524419
 [49] -0.25999732  0.35579779 -0.13915738 -1.16039602  0.04523951 -0.25930360
 [55]  0.93399369  0.53013512  1.66200546 -0.57238416 -0.22135679  1.62396259
 [61] -1.08726303 -0.34436323 -0.37085568 -0.81624494 -0.67094049  0.15084321
 [67]  0.87309873 -1.02213936 -1.50754846  2.12161015  1.43575792 -1.65613373
 [73]  0.77943146 -1.09939599 -0.77369886 -0.57101181  0.67500159 -1.26714185
 [79] -0.39871913 -1.42415269  1.32692456  0.36956931  0.99013802 -2.81591444
 [85] -1.58902415  1.88237463 -0.26052822 -0.41973205  1.01989879  0.96114613
 [91]  0.36357140 -1.07263969 -0.86032390  0.64972770 -0.12193091  0.92569506
 [97] -0.05455358 -0.81309153  1.64617617  1.45571355
> 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]  2.21658943 -0.38014650  0.65936277  1.94735994 -0.65701840  0.84079820
  [7]  0.84681022  0.89806301 -0.01057574  0.56246029  0.90066940  0.32749599
 [13]  2.51338341 -0.44747257  2.11121385 -1.15960973  0.16237497 -0.04769838
 [19] -2.03242038 -0.73445533  0.96990621 -0.19882485 -0.08695896  2.84617034
 [25] -0.83251916 -1.92926699  1.11812431  0.83192010  1.71672629  1.67871287
 [31]  0.33636350 -1.51563760 -1.19173931 -0.17430639  1.62461004  0.70311018
 [37]  0.82699328 -0.02612684  2.00776158  1.12951380 -1.02806445 -0.48528351
 [43] -0.57701653 -1.63281254 -0.33859600  0.09798236 -0.31099029 -0.86524419
 [49] -0.25999732  0.35579779 -0.13915738 -1.16039602  0.04523951 -0.25930360
 [55]  0.93399369  0.53013512  1.66200546 -0.57238416 -0.22135679  1.62396259
 [61] -1.08726303 -0.34436323 -0.37085568 -0.81624494 -0.67094049  0.15084321
 [67]  0.87309873 -1.02213936 -1.50754846  2.12161015  1.43575792 -1.65613373
 [73]  0.77943146 -1.09939599 -0.77369886 -0.57101181  0.67500159 -1.26714185
 [79] -0.39871913 -1.42415269  1.32692456  0.36956931  0.99013802 -2.81591444
 [85] -1.58902415  1.88237463 -0.26052822 -0.41973205  1.01989879  0.96114613
 [91]  0.36357140 -1.07263969 -0.86032390  0.64972770 -0.12193091  0.92569506
 [97] -0.05455358 -0.81309153  1.64617617  1.45571355
> colMin(tmp)
  [1]  2.21658943 -0.38014650  0.65936277  1.94735994 -0.65701840  0.84079820
  [7]  0.84681022  0.89806301 -0.01057574  0.56246029  0.90066940  0.32749599
 [13]  2.51338341 -0.44747257  2.11121385 -1.15960973  0.16237497 -0.04769838
 [19] -2.03242038 -0.73445533  0.96990621 -0.19882485 -0.08695896  2.84617034
 [25] -0.83251916 -1.92926699  1.11812431  0.83192010  1.71672629  1.67871287
 [31]  0.33636350 -1.51563760 -1.19173931 -0.17430639  1.62461004  0.70311018
 [37]  0.82699328 -0.02612684  2.00776158  1.12951380 -1.02806445 -0.48528351
 [43] -0.57701653 -1.63281254 -0.33859600  0.09798236 -0.31099029 -0.86524419
 [49] -0.25999732  0.35579779 -0.13915738 -1.16039602  0.04523951 -0.25930360
 [55]  0.93399369  0.53013512  1.66200546 -0.57238416 -0.22135679  1.62396259
 [61] -1.08726303 -0.34436323 -0.37085568 -0.81624494 -0.67094049  0.15084321
 [67]  0.87309873 -1.02213936 -1.50754846  2.12161015  1.43575792 -1.65613373
 [73]  0.77943146 -1.09939599 -0.77369886 -0.57101181  0.67500159 -1.26714185
 [79] -0.39871913 -1.42415269  1.32692456  0.36956931  0.99013802 -2.81591444
 [85] -1.58902415  1.88237463 -0.26052822 -0.41973205  1.01989879  0.96114613
 [91]  0.36357140 -1.07263969 -0.86032390  0.64972770 -0.12193091  0.92569506
 [97] -0.05455358 -0.81309153  1.64617617  1.45571355
> colMedians(tmp)
  [1]  2.21658943 -0.38014650  0.65936277  1.94735994 -0.65701840  0.84079820
  [7]  0.84681022  0.89806301 -0.01057574  0.56246029  0.90066940  0.32749599
 [13]  2.51338341 -0.44747257  2.11121385 -1.15960973  0.16237497 -0.04769838
 [19] -2.03242038 -0.73445533  0.96990621 -0.19882485 -0.08695896  2.84617034
 [25] -0.83251916 -1.92926699  1.11812431  0.83192010  1.71672629  1.67871287
 [31]  0.33636350 -1.51563760 -1.19173931 -0.17430639  1.62461004  0.70311018
 [37]  0.82699328 -0.02612684  2.00776158  1.12951380 -1.02806445 -0.48528351
 [43] -0.57701653 -1.63281254 -0.33859600  0.09798236 -0.31099029 -0.86524419
 [49] -0.25999732  0.35579779 -0.13915738 -1.16039602  0.04523951 -0.25930360
 [55]  0.93399369  0.53013512  1.66200546 -0.57238416 -0.22135679  1.62396259
 [61] -1.08726303 -0.34436323 -0.37085568 -0.81624494 -0.67094049  0.15084321
 [67]  0.87309873 -1.02213936 -1.50754846  2.12161015  1.43575792 -1.65613373
 [73]  0.77943146 -1.09939599 -0.77369886 -0.57101181  0.67500159 -1.26714185
 [79] -0.39871913 -1.42415269  1.32692456  0.36956931  0.99013802 -2.81591444
 [85] -1.58902415  1.88237463 -0.26052822 -0.41973205  1.01989879  0.96114613
 [91]  0.36357140 -1.07263969 -0.86032390  0.64972770 -0.12193091  0.92569506
 [97] -0.05455358 -0.81309153  1.64617617  1.45571355
> colRanges(tmp)
         [,1]       [,2]      [,3]    [,4]       [,5]      [,6]      [,7]
[1,] 2.216589 -0.3801465 0.6593628 1.94736 -0.6570184 0.8407982 0.8468102
[2,] 2.216589 -0.3801465 0.6593628 1.94736 -0.6570184 0.8407982 0.8468102
         [,8]        [,9]     [,10]     [,11]    [,12]    [,13]      [,14]
[1,] 0.898063 -0.01057574 0.5624603 0.9006694 0.327496 2.513383 -0.4474726
[2,] 0.898063 -0.01057574 0.5624603 0.9006694 0.327496 2.513383 -0.4474726
        [,15]    [,16]    [,17]       [,18]    [,19]      [,20]     [,21]
[1,] 2.111214 -1.15961 0.162375 -0.04769838 -2.03242 -0.7344553 0.9699062
[2,] 2.111214 -1.15961 0.162375 -0.04769838 -2.03242 -0.7344553 0.9699062
          [,22]       [,23]   [,24]      [,25]     [,26]    [,27]     [,28]
[1,] -0.1988248 -0.08695896 2.84617 -0.8325192 -1.929267 1.118124 0.8319201
[2,] -0.1988248 -0.08695896 2.84617 -0.8325192 -1.929267 1.118124 0.8319201
        [,29]    [,30]     [,31]     [,32]     [,33]      [,34]   [,35]
[1,] 1.716726 1.678713 0.3363635 -1.515638 -1.191739 -0.1743064 1.62461
[2,] 1.716726 1.678713 0.3363635 -1.515638 -1.191739 -0.1743064 1.62461
         [,36]     [,37]       [,38]    [,39]    [,40]     [,41]      [,42]
[1,] 0.7031102 0.8269933 -0.02612684 2.007762 1.129514 -1.028064 -0.4852835
[2,] 0.7031102 0.8269933 -0.02612684 2.007762 1.129514 -1.028064 -0.4852835
          [,43]     [,44]     [,45]      [,46]      [,47]      [,48]      [,49]
[1,] -0.5770165 -1.632813 -0.338596 0.09798236 -0.3109903 -0.8652442 -0.2599973
[2,] -0.5770165 -1.632813 -0.338596 0.09798236 -0.3109903 -0.8652442 -0.2599973
         [,50]      [,51]     [,52]      [,53]      [,54]     [,55]     [,56]
[1,] 0.3557978 -0.1391574 -1.160396 0.04523951 -0.2593036 0.9339937 0.5301351
[2,] 0.3557978 -0.1391574 -1.160396 0.04523951 -0.2593036 0.9339937 0.5301351
        [,57]      [,58]      [,59]    [,60]     [,61]      [,62]      [,63]
[1,] 1.662005 -0.5723842 -0.2213568 1.623963 -1.087263 -0.3443632 -0.3708557
[2,] 1.662005 -0.5723842 -0.2213568 1.623963 -1.087263 -0.3443632 -0.3708557
          [,64]      [,65]     [,66]     [,67]     [,68]     [,69]   [,70]
[1,] -0.8162449 -0.6709405 0.1508432 0.8730987 -1.022139 -1.507548 2.12161
[2,] -0.8162449 -0.6709405 0.1508432 0.8730987 -1.022139 -1.507548 2.12161
        [,71]     [,72]     [,73]     [,74]      [,75]      [,76]     [,77]
[1,] 1.435758 -1.656134 0.7794315 -1.099396 -0.7736989 -0.5710118 0.6750016
[2,] 1.435758 -1.656134 0.7794315 -1.099396 -0.7736989 -0.5710118 0.6750016
         [,78]      [,79]     [,80]    [,81]     [,82]    [,83]     [,84]
[1,] -1.267142 -0.3987191 -1.424153 1.326925 0.3695693 0.990138 -2.815914
[2,] -1.267142 -0.3987191 -1.424153 1.326925 0.3695693 0.990138 -2.815914
         [,85]    [,86]      [,87]     [,88]    [,89]     [,90]     [,91]
[1,] -1.589024 1.882375 -0.2605282 -0.419732 1.019899 0.9611461 0.3635714
[2,] -1.589024 1.882375 -0.2605282 -0.419732 1.019899 0.9611461 0.3635714
        [,92]      [,93]     [,94]      [,95]     [,96]       [,97]      [,98]
[1,] -1.07264 -0.8603239 0.6497277 -0.1219309 0.9256951 -0.05455358 -0.8130915
[2,] -1.07264 -0.8603239 0.6497277 -0.1219309 0.9256951 -0.05455358 -0.8130915
        [,99]   [,100]
[1,] 1.646176 1.455714
[2,] 1.646176 1.455714
> 
> 
> Max(tmp2)
[1] 2.647745
> Min(tmp2)
[1] -1.807209
> mean(tmp2)
[1] 0.1695933
> Sum(tmp2)
[1] 16.95933
> Var(tmp2)
[1] 0.8120367
> 
> rowMeans(tmp2)
  [1]  1.12752617  0.98858120 -0.04567743  2.47227327 -0.52660070 -1.76833967
  [7] -0.81799165 -0.27149594 -0.27216132 -0.86276453  0.50169232  0.62193013
 [13] -0.73231832 -0.27457115 -0.58327803 -0.21756310  0.54423448  0.91698892
 [19]  1.23341021  0.19988571  0.54653556 -1.74594708  1.22518106  0.26774367
 [25]  1.02559582  0.57465474  2.64774518 -0.88166775 -0.06331309 -0.74015893
 [31] -0.75283292 -0.45905353  0.97109156  0.71563312  0.12336973  0.38147524
 [37] -1.27555991 -0.71385033  0.62436528 -1.28479250  0.08725524  1.01339743
 [43]  0.24897831  1.51173974  0.31005996 -0.16615160  0.71113129 -0.43506071
 [49]  1.79157272 -0.58313695  0.33978043  0.10039173 -0.13855298  0.89417963
 [55] -0.36132451  0.27311216  0.21008639 -1.20396149  0.30850357  0.71897875
 [61]  1.48876139  0.66246491  0.40152976  0.37360987  0.64399409  0.15542483
 [67]  2.06413032 -0.27170933 -1.60072962  0.86036835  1.16805902  0.66228805
 [73]  0.13942309  0.74318954  0.37619075 -0.68970087 -0.16503717  0.58220773
 [79] -0.41672551 -1.14899786 -1.13883889  0.31023603  1.27727698  0.77309041
 [85] -0.18753643  0.08609547  0.79810980  0.42536781  0.23691721  2.18712774
 [91]  0.02924124 -0.31741091 -0.80729123 -1.80720874  0.60042989  0.69340627
 [97] -0.15438712  0.78793832 -0.30680518 -1.60612786
> rowSums(tmp2)
  [1]  1.12752617  0.98858120 -0.04567743  2.47227327 -0.52660070 -1.76833967
  [7] -0.81799165 -0.27149594 -0.27216132 -0.86276453  0.50169232  0.62193013
 [13] -0.73231832 -0.27457115 -0.58327803 -0.21756310  0.54423448  0.91698892
 [19]  1.23341021  0.19988571  0.54653556 -1.74594708  1.22518106  0.26774367
 [25]  1.02559582  0.57465474  2.64774518 -0.88166775 -0.06331309 -0.74015893
 [31] -0.75283292 -0.45905353  0.97109156  0.71563312  0.12336973  0.38147524
 [37] -1.27555991 -0.71385033  0.62436528 -1.28479250  0.08725524  1.01339743
 [43]  0.24897831  1.51173974  0.31005996 -0.16615160  0.71113129 -0.43506071
 [49]  1.79157272 -0.58313695  0.33978043  0.10039173 -0.13855298  0.89417963
 [55] -0.36132451  0.27311216  0.21008639 -1.20396149  0.30850357  0.71897875
 [61]  1.48876139  0.66246491  0.40152976  0.37360987  0.64399409  0.15542483
 [67]  2.06413032 -0.27170933 -1.60072962  0.86036835  1.16805902  0.66228805
 [73]  0.13942309  0.74318954  0.37619075 -0.68970087 -0.16503717  0.58220773
 [79] -0.41672551 -1.14899786 -1.13883889  0.31023603  1.27727698  0.77309041
 [85] -0.18753643  0.08609547  0.79810980  0.42536781  0.23691721  2.18712774
 [91]  0.02924124 -0.31741091 -0.80729123 -1.80720874  0.60042989  0.69340627
 [97] -0.15438712  0.78793832 -0.30680518 -1.60612786
> rowVars(tmp2)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowSd(tmp2)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowMax(tmp2)
  [1]  1.12752617  0.98858120 -0.04567743  2.47227327 -0.52660070 -1.76833967
  [7] -0.81799165 -0.27149594 -0.27216132 -0.86276453  0.50169232  0.62193013
 [13] -0.73231832 -0.27457115 -0.58327803 -0.21756310  0.54423448  0.91698892
 [19]  1.23341021  0.19988571  0.54653556 -1.74594708  1.22518106  0.26774367
 [25]  1.02559582  0.57465474  2.64774518 -0.88166775 -0.06331309 -0.74015893
 [31] -0.75283292 -0.45905353  0.97109156  0.71563312  0.12336973  0.38147524
 [37] -1.27555991 -0.71385033  0.62436528 -1.28479250  0.08725524  1.01339743
 [43]  0.24897831  1.51173974  0.31005996 -0.16615160  0.71113129 -0.43506071
 [49]  1.79157272 -0.58313695  0.33978043  0.10039173 -0.13855298  0.89417963
 [55] -0.36132451  0.27311216  0.21008639 -1.20396149  0.30850357  0.71897875
 [61]  1.48876139  0.66246491  0.40152976  0.37360987  0.64399409  0.15542483
 [67]  2.06413032 -0.27170933 -1.60072962  0.86036835  1.16805902  0.66228805
 [73]  0.13942309  0.74318954  0.37619075 -0.68970087 -0.16503717  0.58220773
 [79] -0.41672551 -1.14899786 -1.13883889  0.31023603  1.27727698  0.77309041
 [85] -0.18753643  0.08609547  0.79810980  0.42536781  0.23691721  2.18712774
 [91]  0.02924124 -0.31741091 -0.80729123 -1.80720874  0.60042989  0.69340627
 [97] -0.15438712  0.78793832 -0.30680518 -1.60612786
> rowMin(tmp2)
  [1]  1.12752617  0.98858120 -0.04567743  2.47227327 -0.52660070 -1.76833967
  [7] -0.81799165 -0.27149594 -0.27216132 -0.86276453  0.50169232  0.62193013
 [13] -0.73231832 -0.27457115 -0.58327803 -0.21756310  0.54423448  0.91698892
 [19]  1.23341021  0.19988571  0.54653556 -1.74594708  1.22518106  0.26774367
 [25]  1.02559582  0.57465474  2.64774518 -0.88166775 -0.06331309 -0.74015893
 [31] -0.75283292 -0.45905353  0.97109156  0.71563312  0.12336973  0.38147524
 [37] -1.27555991 -0.71385033  0.62436528 -1.28479250  0.08725524  1.01339743
 [43]  0.24897831  1.51173974  0.31005996 -0.16615160  0.71113129 -0.43506071
 [49]  1.79157272 -0.58313695  0.33978043  0.10039173 -0.13855298  0.89417963
 [55] -0.36132451  0.27311216  0.21008639 -1.20396149  0.30850357  0.71897875
 [61]  1.48876139  0.66246491  0.40152976  0.37360987  0.64399409  0.15542483
 [67]  2.06413032 -0.27170933 -1.60072962  0.86036835  1.16805902  0.66228805
 [73]  0.13942309  0.74318954  0.37619075 -0.68970087 -0.16503717  0.58220773
 [79] -0.41672551 -1.14899786 -1.13883889  0.31023603  1.27727698  0.77309041
 [85] -0.18753643  0.08609547  0.79810980  0.42536781  0.23691721  2.18712774
 [91]  0.02924124 -0.31741091 -0.80729123 -1.80720874  0.60042989  0.69340627
 [97] -0.15438712  0.78793832 -0.30680518 -1.60612786
> 
> colMeans(tmp2)
[1] 0.1695933
> colSums(tmp2)
[1] 16.95933
> colVars(tmp2)
[1] 0.8120367
> colSd(tmp2)
[1] 0.9011308
> colMax(tmp2)
[1] 2.647745
> colMin(tmp2)
[1] -1.807209
> colMedians(tmp2)
[1] 0.2429478
> colRanges(tmp2)
          [,1]
[1,] -1.807209
[2,]  2.647745
> 
> 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] -5.0317220  3.1580967  2.4346790 -0.7570421  5.4676038 -6.8458253
 [7]  2.6331037 -0.6655002  1.6916356 -0.1097654
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -2.0570381
[2,] -1.1247320
[3,] -0.7216922
[4,]  0.3963738
[5,]  1.1227061
> 
> rowApply(tmp,sum)
 [1]  2.4175551  0.2631596 -4.0657641 -0.8276748 -2.9281186 -4.2440887
 [7]  6.2334101 -0.5424796  0.4190771  5.2501879
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    2    8    4    2    1    1    3    1    7     8
 [2,]    6    3   10    1   10   10    9    6    2     4
 [3,]    4    9    7    4    6    7    1    5    8     6
 [4,]    1    1    3    3    8    3    8    9    4    10
 [5,]   10   10    8    8    4    9    5    7    3     7
 [6,]    8    4    1    5    2    2    6    3    1     2
 [7,]    9    7    2    6    9    4    2    8    6     5
 [8,]    5    6    5    7    5    6    7    4   10     3
 [9,]    3    2    6    9    7    5    4   10    5     9
[10,]    7    5    9   10    3    8   10    2    9     1
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1] -1.4600323  2.4663538  1.3697748 -0.9595846 -0.9673806 -4.8521120
 [7]  1.6295622  1.0962785  2.0680884  0.5300168 -1.1320929 -2.0505313
[13]  2.0569906  4.1347015 -0.8202427 -2.0519927 -3.4536186  2.2118497
[19] -1.2610089  0.6787488
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -1.8017646
[2,] -0.8066387
[3,] -0.2879127
[4,]  0.3566421
[5,]  1.0796416
> 
> rowApply(tmp,sum)
[1]  5.635813 10.325620 -7.999197 -6.944182 -1.784285
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]   15    9    8    2    8
[2,]   11   15   16   17   16
[3,]    5    7   19   10   17
[4,]    7   16    2    8   11
[5,]    8    8    4    3   19
> 
> 
> as.matrix(tmp)
           [,1]      [,2]       [,3]       [,4]       [,5]        [,6]
[1,]  1.0796416 0.5051310 -0.5808385 -0.3469027 -0.3309926 -0.27809258
[2,]  0.3566421 0.8901701  0.2121977  1.0061733  0.2862399 -2.41897118
[3,] -0.8066387 0.2829809  0.7882036 -1.5360233 -1.1293271 -1.13736526
[4,] -1.8017646 0.3324771 -0.1295017 -0.2839407 -1.2793207 -0.05686045
[5,] -0.2879127 0.4555946  1.0797138  0.2011087  1.4860197 -0.96082257
           [,7]        [,8]       [,9]      [,10]      [,11]       [,12]
[1,]  1.4865739  1.06626297  0.1316634 -0.6349612  1.3598556  0.50646319
[2,]  0.5139769 -0.50466549  1.5698300  2.8739216  0.3839194  0.46889827
[3,]  0.1220279  0.12462333 -0.9535305  0.3422517 -0.1382910 -2.07698843
[4,] -0.6050410  0.09275766  1.1058975  0.5786149 -0.6392347 -0.07575525
[5,]  0.1120245  0.31730005  0.2142281 -2.6298103 -2.0983423 -0.87314913
          [,13]       [,14]       [,15]      [,16]       [,17]        [,18]
[1,]  2.0364649  1.53364368 -0.71862315  1.0984449 -1.50287095  0.763851495
[2,]  2.4043778  0.79849949 -0.05609195 -0.1615740 -0.23122895  1.665009393
[3,] -0.2604021  0.37770444  0.88884649 -0.6776804 -0.01211996 -0.461479630
[4,] -0.9061986 -0.04296582 -0.18654756 -2.6436832 -1.12356055 -0.006098258
[5,] -1.2172514  1.46781975 -0.74782649  0.3325000 -0.58383816  0.250566673
           [,19]      [,20]
[1,] -0.47511357 -1.0637886
[2,] -0.15415432  0.4224499
[3,] -0.81155129 -0.9244376
[4,]  0.22748942  0.4990541
[5,] -0.04767916  1.7454711
> 
> 
> is.BufferedMatrix(tmp)
[1] TRUE
> 
> as.BufferedMatrix(as.matrix(tmp))
BufferedMatrix object
Matrix size:  5 20 
Buffer size:  1 1 
Directory:    D:/biocbuild/bbs-3.15-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.8  Kilobytes.
Disk usage :  800  bytes.
> 
> 
> 
> subBufferedMatrix(tmp,1:5,1:5)
BufferedMatrix object
Matrix size:  5 5 
Buffer size:  1 1 
Directory:    D:/biocbuild/bbs-3.15-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  625  bytes.
Disk usage :  200  bytes.
> subBufferedMatrix(tmp,,5:8)
BufferedMatrix object
Matrix size:  5 4 
Buffer size:  1 1 
Directory:    D:/biocbuild/bbs-3.15-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  541  bytes.
Disk usage :  160  bytes.
> subBufferedMatrix(tmp,1:3,)
BufferedMatrix object
Matrix size:  3 20 
Buffer size:  1 1 
Directory:    D:/biocbuild/bbs-3.15-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.8  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.4947207 0.04316574 -0.2819572 1.958815 -0.4398544 -0.2351394 -1.272162
           col8       col9     col10    col11      col12     col13     col14
row1 -0.1076782 -0.2860703 -1.820158 1.731387 -0.7907413 0.1354337 0.1130867
          col15     col16     col17     col18      col19     col20
row1 -0.2117903 -1.184511 0.1025714 0.5485622 0.03966733 -1.308569
> tmp[,"col10"]
          col10
row1 -1.8201576
row2  0.3567272
row3  0.3737915
row4  1.7630948
row5 -1.0324699
> tmp[c("row1","row5"),]
           col1       col2       col3     col4       col5       col6      col7
row1  0.4947207 0.04316574 -0.2819572 1.958815 -0.4398544 -0.2351394 -1.272162
row5 -1.4799538 0.89929536  2.0985136 1.299611  0.9070696 -0.6098972  1.127743
           col8       col9     col10    col11      col12     col13      col14
row1 -0.1076782 -0.2860703 -1.820158 1.731387 -0.7907413 0.1354337  0.1130867
row5 -1.0555360  0.1659845 -1.032470 0.883581  1.7403813 0.3927091 -0.3827372
          col15     col16      col17      col18       col19       col20
row1 -0.2117903 -1.184511  0.1025714  0.5485622  0.03966733 -1.30856905
row5 -0.6150400 -1.311861 -2.1718941 -0.8100961 -1.41410842 -0.06161777
> tmp[,c("col6","col20")]
            col6       col20
row1 -0.23513940 -1.30856905
row2  0.15624625 -0.21955511
row3 -0.03573304  1.08507425
row4  0.07496862  1.19332113
row5 -0.60989717 -0.06161777
> tmp[c("row1","row5"),c("col6","col20")]
           col6       col20
row1 -0.2351394 -1.30856905
row5 -0.6098972 -0.06161777
> 
> 
> 
> 
> 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.26254 51.17273 49.96143 50.40119 48.45413 105.5144 49.36239 49.68774
         col9    col10    col11    col12    col13    col14    col15  col16
row1 51.20465 50.85809 49.97592 49.11962 50.16274 51.01744 50.13977 47.059
        col17    col18    col19    col20
row1 51.43065 50.63636 49.22438 107.4871
> tmp[,"col10"]
        col10
row1 50.85809
row2 29.97348
row3 31.47610
row4 26.77449
row5 51.12169
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 49.26254 51.17273 49.96143 50.40119 48.45413 105.5144 49.36239 49.68774
row5 50.96597 50.85880 51.21188 51.19597 48.73329 105.4535 51.05947 49.01849
         col9    col10    col11    col12    col13    col14    col15    col16
row1 51.20465 50.85809 49.97592 49.11962 50.16274 51.01744 50.13977 47.05900
row5 49.57873 51.12169 49.53912 49.30576 48.98315 52.57845 49.34569 48.78341
        col17    col18    col19    col20
row1 51.43065 50.63636 49.22438 107.4871
row5 50.13738 48.58880 49.67205 104.3652
> tmp[,c("col6","col20")]
          col6     col20
row1 105.51444 107.48711
row2  75.85350  73.78491
row3  74.64635  75.34750
row4  75.54827  73.76860
row5 105.45351 104.36521
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 105.5144 107.4871
row5 105.4535 104.3652
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 105.5144 107.4871
row5 105.4535 104.3652
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
          col13
[1,]  0.5991067
[2,] -0.9785731
[3,]  1.6847711
[4,] -0.2004462
[5,]  0.3425437
> tmp[,c("col17","col7")]
           col17        col7
[1,]  0.01886655  0.26182388
[2,] -0.59373528  1.08155686
[3,]  0.72826607  2.13989215
[4,] -0.70156715 -0.05741053
[5,]  0.57346976 -0.90287122
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
           col6      col20
[1,] -0.6101559  0.2798359
[2,] -0.7428576 -0.6140226
[3,]  1.6314283  0.2232119
[4,] -1.8614145  1.2395687
[5,] -0.5832894  0.5972215
> subBufferedMatrix(tmp,1,c("col6"))[,1]
           col1
[1,] -0.6101559
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
           col6
[1,] -0.6101559
[2,] -0.7428576
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> 
> 
> 
> subBufferedMatrix(tmp,c("row3","row1"),)[,1:20]
          [,1]       [,2]        [,3]       [,4]       [,5]       [,6]
row3 0.3131581 -0.6336840 -0.59381954  0.6954229 -2.0594492 -1.1183447
row1 0.2871895 -0.6359172 -0.05629187 -0.1689773 -0.3274236  0.7868146
           [,7]      [,8]      [,9]     [,10]      [,11]     [,12]      [,13]
row3 -0.5389636 0.8968366 0.2177535 -1.030955  1.6133332 1.9517952 -0.2024538
row1  1.1716372 0.3276901 0.2887027 -2.522054 -0.4632697 0.7088077  0.9030173
          [,14]     [,15]      [,16]     [,17]     [,18]      [,19]     [,20]
row3 -1.8855047 0.1508317  0.7271687 0.1287335 0.2748852 -0.1843989 1.9947255
row1 -0.4203289 1.1543539 -0.1848063 1.0738206 0.8528249 -0.3573189 0.9467383
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
           [,1]      [,2]      [,3]       [,4]       [,5]       [,6]       [,7]
row2 -0.4496616 -2.180222 -1.246854 -0.3812193 -0.9365439 -0.8511277 -0.1734624
         [,8]       [,9]     [,10]
row2 2.702563 -0.0301289 0.4100796
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
        [,1]      [,2]        [,3]     [,4]     [,5]      [,6]       [,7]
row5 1.47799 0.8222993 -0.01452085 0.474704 1.141839 0.2188046 -0.6666679
         [,8]       [,9]    [,10]     [,11]      [,12]      [,13]     [,14]
row5 1.016145 -0.5881898 2.283815 0.4680483 -0.5025604 -0.3373342 0.7972743
         [,15]    [,16]     [,17]     [,18]   [,19]      [,20]
row5 0.8636696 1.449899 0.2219062 0.1480137 1.02318 -0.0310854
> 
> 
> 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: 0x0000000012b13de0>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "D:/biocbuild/bbs-3.15-bioc/meat/BufferedMatrix.Rcheck/tests\\BM3fbc3af602e" 
 [2] "D:/biocbuild/bbs-3.15-bioc/meat/BufferedMatrix.Rcheck/tests\\BM3fbc1903408d"
 [3] "D:/biocbuild/bbs-3.15-bioc/meat/BufferedMatrix.Rcheck/tests\\BM3fbc4a4b12dd"
 [4] "D:/biocbuild/bbs-3.15-bioc/meat/BufferedMatrix.Rcheck/tests\\BM3fbc622468fe"
 [5] "D:/biocbuild/bbs-3.15-bioc/meat/BufferedMatrix.Rcheck/tests\\BM3fbc5c2d4a67"
 [6] "D:/biocbuild/bbs-3.15-bioc/meat/BufferedMatrix.Rcheck/tests\\BM3fbc6db1361e"
 [7] "D:/biocbuild/bbs-3.15-bioc/meat/BufferedMatrix.Rcheck/tests\\BM3fbc58ae5d32"
 [8] "D:/biocbuild/bbs-3.15-bioc/meat/BufferedMatrix.Rcheck/tests\\BM3fbc3f52231" 
 [9] "D:/biocbuild/bbs-3.15-bioc/meat/BufferedMatrix.Rcheck/tests\\BM3fbc697bd36" 
[10] "D:/biocbuild/bbs-3.15-bioc/meat/BufferedMatrix.Rcheck/tests\\BM3fbc341a2182"
[11] "D:/biocbuild/bbs-3.15-bioc/meat/BufferedMatrix.Rcheck/tests\\BM3fbc704628bc"
[12] "D:/biocbuild/bbs-3.15-bioc/meat/BufferedMatrix.Rcheck/tests\\BM3fbcf87694a" 
[13] "D:/biocbuild/bbs-3.15-bioc/meat/BufferedMatrix.Rcheck/tests\\BM3fbc3cbb2865"
[14] "D:/biocbuild/bbs-3.15-bioc/meat/BufferedMatrix.Rcheck/tests\\BM3fbc2f6c1dd4"
[15] "D:/biocbuild/bbs-3.15-bioc/meat/BufferedMatrix.Rcheck/tests\\BM3fbc5eb66e6f"
> 
> 
> ### 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: 0x00000000119a2a10>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x00000000119a2a10>
Warning message:
In dir.create(new.directory) :
  'D:\biocbuild\bbs-3.15-bioc\meat\BufferedMatrix.Rcheck\tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x00000000119a2a10>
> rowMedians(tmp)
  [1]  0.132700818  0.572594667 -0.042576533  0.253091080  0.265346498
  [6] -0.733737856  0.242557424  0.042958159 -0.244369266  0.096670512
 [11]  0.026324610  0.830737493  0.422050256 -0.129373988  0.416024790
 [16]  0.101185007 -0.054410485  0.141102797 -0.360775574  0.531709958
 [21] -0.062370116 -0.069218505 -0.119935435 -0.177109721  0.019401529
 [26]  0.092662007 -0.445851084 -0.206966151 -0.012402334 -0.074116492
 [31] -0.236966444 -0.186666115  0.412081979 -0.180992417 -0.294268305
 [36] -0.214967122  0.044842405  0.636983495  0.262163567 -0.030299929
 [41]  0.225732231  0.356293979 -0.163753213 -0.088614633  0.225142170
 [46] -0.301177300 -0.196043106  0.383195894  0.346148396 -0.042735511
 [51] -0.264222339 -0.028056017 -0.309048111 -0.265965490  0.256955165
 [56] -0.030890121 -0.051592535  0.260673109 -0.518256836 -0.402697258
 [61] -0.173075545  0.033277943 -0.123147022 -0.310725216  0.031341131
 [66] -0.059656372  0.587031814 -0.308353489  0.096495184  0.263358855
 [71]  0.605466265  0.090204393  0.240963875  0.046394224 -0.423732803
 [76] -0.070153453 -0.304031429 -0.062512347 -0.193882992  0.094010422
 [81]  0.089405031  0.009526241  0.158423421  0.151443611  0.142850203
 [86]  0.144675096  0.171891616 -0.115029642  0.389394007 -0.345564848
 [91]  0.248933862  0.009456617  0.327777475  0.178196312 -0.353172411
 [96] -0.105036413 -0.289705538  0.188356650  0.430754815  0.523287549
[101]  0.351290536  0.283864993 -0.503087010 -0.311870961  0.122321199
[106]  0.020860774  0.150952821  0.025391335  0.136638852 -0.065650409
[111] -0.374058629 -0.122692001 -0.182137088  0.081340197  0.098665000
[116]  0.190009091 -0.161066341  0.061530363 -0.084550949  0.120144148
[121] -0.111182795  0.193086692 -0.255235053  0.233336117 -0.019803432
[126]  0.441975831 -0.729580721  0.555866926 -0.022175377 -0.117291938
[131]  0.323806790 -0.103580917  0.618758425 -0.448690159 -0.212027720
[136]  0.087640333 -0.773377604 -0.081898362  0.706170690 -0.064500807
[141]  0.004519884  0.079150834 -0.195486993 -0.109665479  0.059832964
[146]  0.039885869  0.272863454  0.027948168 -0.347162631 -0.116110059
[151]  0.156057388 -0.078870236  0.227539670  0.453098334 -0.237697589
[156] -0.376980178 -0.165438153 -0.207105397 -0.443638206 -0.148045184
[161]  0.220059089 -0.698741048  0.108623974  0.047270389  0.522408681
[166] -0.153740141 -0.140248443 -0.007304342 -0.061842310  0.024795842
[171] -0.280571098 -0.030147422  0.135498628 -0.412717431  0.177596598
[176] -0.422211841 -0.429070438 -0.195283255 -0.665581185  0.308089892
[181]  0.110988275 -0.049858871 -0.135070787 -0.063730450  0.166294487
[186]  0.332414531 -0.037459031  0.524228701  0.360848318  0.112971318
[191] -0.283123788  0.241036318 -0.415846958  0.525576375  0.092958291
[196]  0.273676361 -0.156006608  0.292760770  0.444147813 -0.005783859
[201] -0.377035594 -0.562076814  0.253522890  0.267978032 -0.208201083
[206] -0.300788069  0.148964703  0.420886554 -0.035515208 -0.351340457
[211]  0.128730766  0.199689531  0.336742829  0.148515152  0.295847474
[216] -0.301486712  0.031706398 -0.159136728  0.650771329 -0.328626677
[221] -0.011920882 -0.096341654  0.772765255 -0.211456348  0.032583495
[226]  0.037910554 -0.397324916 -0.035283298  0.045024568 -0.070352092
> 
> proc.time()
   user  system elapsed 
   2.79    9.75   94.89 

BufferedMatrix.Rcheck/tests/rawCalltesting.Rout


R Under development (unstable) (2021-11-21 r81221) -- "Unsuffered Consequences"
Copyright (C) 2021 The R Foundation for Statistical Computing
Platform: x86_64-w64-mingw32/x64 (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: 0x0000000012ae4010>
> .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: 0x0000000012ae4010>
> .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: 0x0000000012ae4010>
> .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: 0x0000000012ae4010>
> 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: 0x0000000012ae40f0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x0000000012ae40f0>
> .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: 0x0000000012ae40f0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x0000000012ae40f0>
> .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: 0x0000000012ae40f0>
> 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: 0x0000000012ae3ec0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x0000000012ae3ec0>
> .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: 0x0000000012ae3ec0>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x0000000012ae3ec0>
> .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: 0x0000000012ae3ec0>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x0000000012ae3ec0>
> .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: 0x0000000012ae3ec0>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x0000000012ae3ec0>
> .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: 0x0000000012ae3ec0>
> 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: 0x0000000012ae4160>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x0000000012ae4160>
> .Call("R_bm_AddColumn",P)
<pointer: 0x0000000012ae4160>
> .Call("R_bm_AddColumn",P)
<pointer: 0x0000000012ae4160>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile175428f36ea"  "BufferedMatrixFile175455ba15d1"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile175428f36ea"  "BufferedMatrixFile175455ba15d1"
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x0000000012ae44e0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x0000000012ae44e0>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x0000000012ae44e0>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x0000000012ae44e0>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x0000000012ae44e0>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x0000000012ae44e0>
> .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: 0x0000000012ae42b0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x0000000012ae42b0>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x0000000012ae42b0>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x0000000012ae42b0>
> 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: 0x0000000012ae41d0>
> .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: 0x0000000012ae41d0>
> rm(P)
> 
> proc.time()
   user  system elapsed 
   0.43    0.04    0.82 

BufferedMatrix.Rcheck/tests/Rcodetesting.Rout


R Under development (unstable) (2021-11-21 r81221) -- "Unsuffered Consequences"
Copyright (C) 2021 The R Foundation for Statistical Computing
Platform: x86_64-w64-mingw32/x64 (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.23    0.10    0.31 

Example timings