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

This page was generated on 2025-01-20 12:16 -0500 (Mon, 20 Jan 2025).

HostnameOSArch (*)R versionInstalled pkgs
nebbiolo2Linux (Ubuntu 24.04.1 LTS)x86_644.4.2 (2024-10-31) -- "Pile of Leaves" 4746
palomino8Windows Server 2022 Datacenterx644.4.2 (2024-10-31 ucrt) -- "Pile of Leaves" 4493
Click on any hostname to see more info about the system (e.g. compilers)      (*) as reported by 'uname -p', except on Windows and Mac OS X

Package 251/2289HostnameOS / ArchINSTALLBUILDCHECKBUILD BIN
BufferedMatrix 1.70.0  (landing page)
Ben Bolstad
Snapshot Date: 2025-01-19 12:27 -0500 (Sun, 19 Jan 2025)
git_url: https://git.bioconductor.org/packages/BufferedMatrix
git_branch: RELEASE_3_20
git_last_commit: 32b6f6a
git_last_commit_date: 2024-10-29 09:27:20 -0500 (Tue, 29 Oct 2024)
nebbiolo2Linux (Ubuntu 24.04.1 LTS) / x86_64  OK    OK    OK  UNNEEDED, same version is already published
palomino8Windows Server 2022 Datacenter / x64  OK    OK    OK    OK  UNNEEDED, same version is already published


CHECK results for BufferedMatrix on palomino8

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

raw results


Summary

Package: BufferedMatrix
Version: 1.70.0
Command: F:\biocbuild\bbs-3.20-bioc\R\bin\R.exe CMD check --no-multiarch --install=check:BufferedMatrix.install-out.txt --library=F:\biocbuild\bbs-3.20-bioc\R\library --no-vignettes --timings BufferedMatrix_1.70.0.tar.gz
StartedAt: 2025-01-19 22:15:06 -0500 (Sun, 19 Jan 2025)
EndedAt: 2025-01-19 22:22:05 -0500 (Sun, 19 Jan 2025)
EllapsedTime: 418.2 seconds
RetCode: 0
Status:   OK  
CheckDir: BufferedMatrix.Rcheck
Warnings: 0

Command output

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


* using log directory 'F:/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck'
* using R version 4.4.2 (2024-10-31 ucrt)
* using platform: x86_64-w64-mingw32
* R was compiled by
    gcc.exe (GCC) 13.3.0
    GNU Fortran (GCC) 13.3.0
* running under: Windows Server 2022 x64 (build 20348)
* using session charset: UTF-8
* using option '--no-vignettes'
* checking for file 'BufferedMatrix/DESCRIPTION' ... OK
* this is package 'BufferedMatrix' version '1.70.0'
* checking package namespace information ... OK
* checking package dependencies ... OK
* checking if this is a source package ... OK
* checking if there is a namespace ... OK
* checking for hidden files and directories ... OK
* checking for portable file names ... OK
* checking whether package 'BufferedMatrix' can be installed ... OK
* used C compiler: 'gcc.exe (GCC) 13.3.0'
* checking installed package size ... OK
* checking package directory ... OK
* checking 'build' directory ... OK
* checking DESCRIPTION meta-information ... OK
* checking top-level files ... OK
* checking for left-over files ... OK
* checking index information ... OK
* checking package subdirectories ... OK
* checking code files for non-ASCII characters ... OK
* checking R files for syntax errors ... OK
* checking whether the package can be loaded ... OK
* checking whether the package can be loaded with stated dependencies ... OK
* checking whether the package can be unloaded cleanly ... OK
* checking whether the namespace can be loaded with stated dependencies ... OK
* checking whether the namespace can be unloaded cleanly ... OK
* checking dependencies in R code ... OK
* checking S3 generic/method consistency ... OK
* checking replacement functions ... OK
* checking foreign function calls ... OK
* checking R code for possible problems ... OK
* checking Rd files ... NOTE
checkRd: (-1) BufferedMatrix-class.Rd:209: Lost braces; missing escapes or markup?
   209 |     $x^{power}$ elementwise of the matrix
       |        ^
prepare_Rd: createBufferedMatrix.Rd:26: Dropping empty section \keyword
prepare_Rd: createBufferedMatrix.Rd:17-18: Dropping empty section \details
prepare_Rd: createBufferedMatrix.Rd:15-16: Dropping empty section \value
prepare_Rd: createBufferedMatrix.Rd:19-20: Dropping empty section \references
prepare_Rd: createBufferedMatrix.Rd:21-22: Dropping empty section \seealso
prepare_Rd: createBufferedMatrix.Rd:23-24: Dropping empty section \examples
* checking Rd metadata ... OK
* checking Rd cross-references ... OK
* checking for missing documentation entries ... OK
* checking for code/documentation mismatches ... OK
* checking Rd \usage sections ... OK
* checking Rd contents ... OK
* checking for unstated dependencies in examples ... OK
* checking line endings in C/C++/Fortran sources/headers ... OK
* checking compiled code ... NOTE
Note: information on .o files for x64 is not available
File 'F:/biocbuild/bbs-3.20-bioc/R/library/BufferedMatrix/libs/x64/BufferedMatrix.dll':
  Found '_exit', possibly from '_exit' (C)
  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 nor [v]sprintf. 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 sizes of PDF files under 'inst/doc' ... OK
* checking files in 'vignettes' ... OK
* checking examples ... NONE
* checking for unstated dependencies in 'tests' ... OK
* checking tests ...
  Running 'Rcodetesting.R'
  Running 'c_code_level_tests.R'
  Running 'objectTesting.R'
  Running 'rawCalltesting.R'
 OK
* checking for unstated dependencies in vignettes ... OK
* checking package vignettes ... OK
* checking running R code from vignettes ... SKIPPED
* checking re-building of vignette outputs ... SKIPPED
* checking PDF version of manual ... OK
* DONE

Status: 2 NOTEs
See
  'F:/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/00check.log'
for details.


Installation output

BufferedMatrix.Rcheck/00install.out

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


* installing to library 'F:/biocbuild/bbs-3.20-bioc/R/library'
* installing *source* package 'BufferedMatrix' ...
** using staged installation
** libs
using C compiler: 'gcc.exe (GCC) 13.3.0'
gcc  -I"F:/biocbuild/bbs-3.20-bioc/R/include" -DNDEBUG     -I"C:/rtools44/x86_64-w64-mingw32.static.posix/include"     -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign  -c RBufferedMatrix.c -o RBufferedMatrix.o
gcc  -I"F:/biocbuild/bbs-3.20-bioc/R/include" -DNDEBUG     -I"C:/rtools44/x86_64-w64-mingw32.static.posix/include"     -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign  -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]
 1580 |   if (!(Matrix->readonly) & setting){
      |       ^~~~~~~~~~~~~~~~~~~
doubleBufferedMatrix.c: At top level:
doubleBufferedMatrix.c:3327:12: warning: 'sort_double' defined but not used [-Wunused-function]
 3327 | static int sort_double(const double *a1,const double *a2){
      |            ^~~~~~~~~~~
gcc  -I"F:/biocbuild/bbs-3.20-bioc/R/include" -DNDEBUG     -I"C:/rtools44/x86_64-w64-mingw32.static.posix/include"     -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign  -c doubleBufferedMatrix_C_tests.c -o doubleBufferedMatrix_C_tests.o
gcc  -I"F:/biocbuild/bbs-3.20-bioc/R/include" -DNDEBUG     -I"C:/rtools44/x86_64-w64-mingw32.static.posix/include"     -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign  -c init_package.c -o init_package.o
gcc -shared -s -static-libgcc -o BufferedMatrix.dll tmp.def RBufferedMatrix.o doubleBufferedMatrix.o doubleBufferedMatrix_C_tests.o init_package.o -LC:/rtools44/x86_64-w64-mingw32.static.posix/lib/x64 -LC:/rtools44/x86_64-w64-mingw32.static.posix/lib -LF:/biocbuild/bbs-3.20-bioc/R/bin/x64 -lR
installing to F:/biocbuild/bbs-3.20-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
** 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)

Tests output

BufferedMatrix.Rcheck/tests/c_code_level_tests.Rout


R version 4.4.2 (2024-10-31 ucrt) -- "Pile of Leaves"
Copyright (C) 2024 The R Foundation for Statistical Computing
Platform: x86_64-w64-mingw32/x64

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.31    0.15    3.79 

BufferedMatrix.Rcheck/tests/objectTesting.Rout


R version 4.4.2 (2024-10-31 ucrt) -- "Pile of Leaves"
Copyright (C) 2024 The R Foundation for Statistical Computing
Platform: x86_64-w64-mingw32/x64

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] "F:/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests"
> prefix(tmp3)
[1] "BM"
> 
> ## testing if we can remove these objects
> rm(tmp, tmp2, tmp3)
> gc()
         used (Mb) gc trigger (Mb) max used (Mb)
Ncells 468478 25.1    1021802 54.6   633411 33.9
Vcells 853910  6.6    8388608 64.0  2003128 15.3
> 
> 
> 
> 
> ##
> ## 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] "Sun Jan 19 22:15:49 2025"
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> date()
[1] "Sun Jan 19 22:15:52 2025"
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,which.col] == test.matrix[which.row,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> 
> 
> RowMode(tmp2)
<pointer: 0x0000020ca8aff3b0>
> 
> 
> 
> 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] "Sun Jan 19 22:16:53 2025"
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col <- sample(1:20,5,replace=TRUE)
+   if (!all(tmp2[which.row,which.col] == test.matrix[which.row,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> date()
[1] "Sun Jan 19 22:17:21 2025"
> 
> ColMode(tmp2)
<pointer: 0x0000020ca8aff3b0>
> 
> 
> 
> ### Now testing assignments
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+ 
+   new.data <- rnorm(20)
+   tmp2[which.row,] <- new.data
+   test.matrix[which.row,] <- new.data
+   if (rep > 1){
+     if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+   
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   new.data <- rnorm(10)
+   tmp2[,which.col] <- new.data
+   test.matrix[,which.col]<- new.data
+ 
+   if (rep > 1){
+     if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.col <- which.col
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,5,replace=TRUE)
+   new.data <- matrix(rnorm(50),5,10)
+   tmp2[,which.col] <- new.data
+   test.matrix[,which.col]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.col <- which.col
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   new.data <- matrix(rnorm(50),5,10)
+   tmp2[which.row,] <- new.data
+   test.matrix[which.row,]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col  <- sample(1:20,5,replace=TRUE)
+   new.data <- matrix(rnorm(25),5,5)
+   tmp2[which.row,which.col] <- new.data
+   test.matrix[which.row,which.col]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[prev.row,prev.col] == test.matrix[prev.row,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+   prev.col <- which.col
+ }
> 
> 
> 
> 
> ###
> ###
> ### testing some more functions
> ###
> 
> 
> 
> ## duplication function
> tmp5 <- duplicate(tmp2)
> 
> # making sure really did copy everything.
> tmp5[1,1] <- tmp5[1,1] +100.00
> 
> if (tmp5[1,1] == tmp2[1,1]){
+   stop("Problem with duplication")
+ }
> 
> 
> 
> 
> ### testing elementwise applying of functions
> 
> tmp5[1:4,1:4]
          [,1]       [,2]       [,3]       [,4]
[1,] 99.881520 -0.7352020  0.5069849  0.2456942
[2,]  1.193160 -2.9824368 -0.8321282 -1.7832909
[3,]  1.363837 -0.1923133  0.7575968 -2.0260580
[4,] -1.229348  0.1719058 -1.5755490 -0.3175010
> ewApply(tmp5,abs)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    F:/biocbuild/bbs-3.20-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,] 99.881520 0.7352020 0.5069849 0.2456942
[2,]  1.193160 2.9824368 0.8321282 1.7832909
[3,]  1.363837 0.1923133 0.7575968 2.0260580
[4,]  1.229348 0.1719058 1.5755490 0.3175010
> ewApply(tmp5,sqrt)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    F:/biocbuild/bbs-3.20-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,] 9.994074 0.8574392 0.7120287 0.4956755
[2,] 1.092319 1.7269733 0.9122106 1.3353992
[3,] 1.167834 0.4385354 0.8704004 1.4233966
[4,] 1.108760 0.4146152 1.2552087 0.5634723
> 
> 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:    F:/biocbuild/bbs-3.20-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,] 224.82226 34.30959 32.62727 30.20245
[2,]  37.11635 45.25217 34.95423 40.13728
[3,]  38.04218 29.57767 34.46160 41.26002
[4,]  37.31694 29.31806 39.12764 30.95222
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x0000020ca8aff2f0>
> exp(tmp5)
<pointer: 0x0000020ca8aff2f0>
> log(tmp5,2)
<pointer: 0x0000020ca8aff2f0>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 467.9381
> Min(tmp5)
[1] 53.37156
> mean(tmp5)
[1] 73.14703
> Sum(tmp5)
[1] 14629.41
> Var(tmp5)
[1] 857.4098
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 92.31985 70.73424 72.89292 69.46882 72.74965 71.84271 73.69790 70.46068
 [9] 70.83332 66.47020
> rowSums(tmp5)
 [1] 1846.397 1414.685 1457.858 1389.376 1454.993 1436.854 1473.958 1409.214
 [9] 1416.666 1329.404
> rowVars(tmp5)
 [1] 7892.24838   97.89902   98.16062   56.85049   94.43424   53.89647
 [7]   45.01595   70.75389   48.80836   52.35689
> rowSd(tmp5)
 [1] 88.838327  9.894393  9.907604  7.539926  9.717728  7.341422  6.709393
 [8]  8.411533  6.986298  7.235806
> rowMax(tmp5)
 [1] 467.93808  94.18646  85.87733  81.43905  88.99210  85.92809  82.85373
 [8]  89.35691  89.36706  79.25891
> rowMin(tmp5)
 [1] 55.63972 56.91305 55.43296 57.91021 53.37156 59.88340 62.28694 59.08270
 [9] 58.77745 54.47683
> 
> colMeans(tmp5)
 [1] 111.06731  70.69738  71.57374  73.90177  68.16340  69.63680  70.61132
 [8]  67.85605  72.44004  72.15544  73.09896  70.33658  70.85885  68.41427
[15]  73.07108  71.91119  72.29292  72.00724  71.42633  71.41989
> colSums(tmp5)
 [1] 1110.6731  706.9738  715.7374  739.0177  681.6340  696.3680  706.1132
 [8]  678.5605  724.4004  721.5544  730.9896  703.3658  708.5885  684.1427
[15]  730.7108  719.1119  722.9292  720.0724  714.2633  714.1989
> colVars(tmp5)
 [1] 15759.55135   117.68335    30.95919    85.64434    50.35518    61.11270
 [7]    32.27370   109.34401    70.31580    54.32659    82.28786    47.35799
[13]   101.36105   116.58786    41.17916   106.03141    86.13616    98.15824
[19]    95.50693    73.11065
> colSd(tmp5)
 [1] 125.537052  10.848196   5.564098   9.254423   7.096138   7.817461
 [7]   5.680995  10.456769   8.385452   7.370657   9.071266   6.881714
[13]  10.067823  10.797586   6.417099  10.297155   9.280957   9.907484
[19]   9.772765   8.550476
> colMax(tmp5)
 [1] 467.93808  94.18646  81.43905  86.75687  78.99798  81.89197  79.42235
 [8]  88.99210  85.74859  80.62125  89.36706  86.46624  84.63586  89.35691
[15]  80.51881  85.92809  87.20006  84.52403  84.24279  85.06100
> colMin(tmp5)
 [1] 62.16711 60.54466 63.06831 62.86244 59.54952 55.43296 62.62590 56.07369
 [9] 60.84869 54.47683 57.91021 62.26103 53.37156 56.92604 58.77745 56.91305
[17] 58.43707 56.96487 55.63972 55.24029
> 
> 
> ### 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] 92.31985       NA 72.89292 69.46882 72.74965 71.84271 73.69790 70.46068
 [9] 70.83332 66.47020
> rowSums(tmp5)
 [1] 1846.397       NA 1457.858 1389.376 1454.993 1436.854 1473.958 1409.214
 [9] 1416.666 1329.404
> rowVars(tmp5)
 [1] 7892.24838  102.43795   98.16062   56.85049   94.43424   53.89647
 [7]   45.01595   70.75389   48.80836   52.35689
> rowSd(tmp5)
 [1] 88.838327 10.121163  9.907604  7.539926  9.717728  7.341422  6.709393
 [8]  8.411533  6.986298  7.235806
> rowMax(tmp5)
 [1] 467.93808        NA  85.87733  81.43905  88.99210  85.92809  82.85373
 [8]  89.35691  89.36706  79.25891
> rowMin(tmp5)
 [1] 55.63972       NA 55.43296 57.91021 53.37156 59.88340 62.28694 59.08270
 [9] 58.77745 54.47683
> 
> colMeans(tmp5)
 [1] 111.06731  70.69738  71.57374  73.90177  68.16340  69.63680  70.61132
 [8]  67.85605  72.44004  72.15544  73.09896        NA  70.85885  68.41427
[15]  73.07108  71.91119  72.29292  72.00724  71.42633  71.41989
> colSums(tmp5)
 [1] 1110.6731  706.9738  715.7374  739.0177  681.6340  696.3680  706.1132
 [8]  678.5605  724.4004  721.5544  730.9896        NA  708.5885  684.1427
[15]  730.7108  719.1119  722.9292  720.0724  714.2633  714.1989
> colVars(tmp5)
 [1] 15759.55135   117.68335    30.95919    85.64434    50.35518    61.11270
 [7]    32.27370   109.34401    70.31580    54.32659    82.28786          NA
[13]   101.36105   116.58786    41.17916   106.03141    86.13616    98.15824
[19]    95.50693    73.11065
> colSd(tmp5)
 [1] 125.537052  10.848196   5.564098   9.254423   7.096138   7.817461
 [7]   5.680995  10.456769   8.385452   7.370657   9.071266         NA
[13]  10.067823  10.797586   6.417099  10.297155   9.280957   9.907484
[19]   9.772765   8.550476
> colMax(tmp5)
 [1] 467.93808  94.18646  81.43905  86.75687  78.99798  81.89197  79.42235
 [8]  88.99210  85.74859  80.62125  89.36706        NA  84.63586  89.35691
[15]  80.51881  85.92809  87.20006  84.52403  84.24279  85.06100
> colMin(tmp5)
 [1] 62.16711 60.54466 63.06831 62.86244 59.54952 55.43296 62.62590 56.07369
 [9] 60.84869 54.47683 57.91021       NA 53.37156 56.92604 58.77745 56.91305
[17] 58.43707 56.96487 55.63972 55.24029
> 
> Max(tmp5,na.rm=TRUE)
[1] 467.9381
> Min(tmp5,na.rm=TRUE)
[1] 53.37156
> mean(tmp5,na.rm=TRUE)
[1] 73.13944
> Sum(tmp5,na.rm=TRUE)
[1] 14554.75
> Var(tmp5,na.rm=TRUE)
[1] 861.7286
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 92.31985 70.52778 72.89292 69.46882 72.74965 71.84271 73.69790 70.46068
 [9] 70.83332 66.47020
> rowSums(tmp5,na.rm=TRUE)
 [1] 1846.397 1340.028 1457.858 1389.376 1454.993 1436.854 1473.958 1409.214
 [9] 1416.666 1329.404
> rowVars(tmp5,na.rm=TRUE)
 [1] 7892.24838  102.43795   98.16062   56.85049   94.43424   53.89647
 [7]   45.01595   70.75389   48.80836   52.35689
> rowSd(tmp5,na.rm=TRUE)
 [1] 88.838327 10.121163  9.907604  7.539926  9.717728  7.341422  6.709393
 [8]  8.411533  6.986298  7.235806
> rowMax(tmp5,na.rm=TRUE)
 [1] 467.93808  94.18646  85.87733  81.43905  88.99210  85.92809  82.85373
 [8]  89.35691  89.36706  79.25891
> rowMin(tmp5,na.rm=TRUE)
 [1] 55.63972 56.91305 55.43296 57.91021 53.37156 59.88340 62.28694 59.08270
 [9] 58.77745 54.47683
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 111.06731  70.69738  71.57374  73.90177  68.16340  69.63680  70.61132
 [8]  67.85605  72.44004  72.15544  73.09896  69.85653  70.85885  68.41427
[15]  73.07108  71.91119  72.29292  72.00724  71.42633  71.41989
> colSums(tmp5,na.rm=TRUE)
 [1] 1110.6731  706.9738  715.7374  739.0177  681.6340  696.3680  706.1132
 [8]  678.5605  724.4004  721.5544  730.9896  628.7087  708.5885  684.1427
[15]  730.7108  719.1119  722.9292  720.0724  714.2633  714.1989
> colVars(tmp5,na.rm=TRUE)
 [1] 15759.55135   117.68335    30.95919    85.64434    50.35518    61.11270
 [7]    32.27370   109.34401    70.31580    54.32659    82.28786    50.68518
[13]   101.36105   116.58786    41.17916   106.03141    86.13616    98.15824
[19]    95.50693    73.11065
> colSd(tmp5,na.rm=TRUE)
 [1] 125.537052  10.848196   5.564098   9.254423   7.096138   7.817461
 [7]   5.680995  10.456769   8.385452   7.370657   9.071266   7.119353
[13]  10.067823  10.797586   6.417099  10.297155   9.280957   9.907484
[19]   9.772765   8.550476
> colMax(tmp5,na.rm=TRUE)
 [1] 467.93808  94.18646  81.43905  86.75687  78.99798  81.89197  79.42235
 [8]  88.99210  85.74859  80.62125  89.36706  86.46624  84.63586  89.35691
[15]  80.51881  85.92809  87.20006  84.52403  84.24279  85.06100
> colMin(tmp5,na.rm=TRUE)
 [1] 62.16711 60.54466 63.06831 62.86244 59.54952 55.43296 62.62590 56.07369
 [9] 60.84869 54.47683 57.91021 62.26103 53.37156 56.92604 58.77745 56.91305
[17] 58.43707 56.96487 55.63972 55.24029
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1] 92.31985      NaN 72.89292 69.46882 72.74965 71.84271 73.69790 70.46068
 [9] 70.83332 66.47020
> rowSums(tmp5,na.rm=TRUE)
 [1] 1846.397    0.000 1457.858 1389.376 1454.993 1436.854 1473.958 1409.214
 [9] 1416.666 1329.404
> rowVars(tmp5,na.rm=TRUE)
 [1] 7892.24838         NA   98.16062   56.85049   94.43424   53.89647
 [7]   45.01595   70.75389   48.80836   52.35689
> rowSd(tmp5,na.rm=TRUE)
 [1] 88.838327        NA  9.907604  7.539926  9.717728  7.341422  6.709393
 [8]  8.411533  6.986298  7.235806
> rowMax(tmp5,na.rm=TRUE)
 [1] 467.93808        NA  85.87733  81.43905  88.99210  85.92809  82.85373
 [8]  89.35691  89.36706  79.25891
> rowMin(tmp5,na.rm=TRUE)
 [1] 55.63972       NA 55.43296 57.91021 53.37156 59.88340 62.28694 59.08270
 [9] 58.77745 54.47683
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1] 114.82448  68.08749  71.44275  72.83081  68.74384  70.22219  71.39518
 [8]  68.13239  72.88103  72.12379  73.96116       NaN  71.74496  69.69074
[15]  73.77842  73.57765  71.23732  71.56970  72.29769  69.90422
> colSums(tmp5,na.rm=TRUE)
 [1] 1033.4203  612.7874  642.9847  655.4773  618.6945  631.9997  642.5566
 [8]  613.1915  655.9293  649.1141  665.6505    0.0000  645.7046  627.2166
[15]  664.0058  662.1988  641.1359  644.1273  650.6792  629.1379
> colVars(tmp5,na.rm=TRUE)
 [1] 17570.68692    55.76365    34.63605    83.44642    52.85939    64.89657
 [7]    29.39541   122.15291    76.91745    61.10614    84.21058          NA
[13]   105.19775   112.83086    40.69796    88.04310    84.36746   108.27432
[19]    98.90362    56.40507
> colSd(tmp5,na.rm=TRUE)
 [1] 132.554468   7.467507   5.885240   9.134901   7.270446   8.055841
 [7]   5.421753  11.052281   8.770259   7.817042   9.176632         NA
[13]  10.256595  10.622187   6.379495   9.383129   9.185176  10.405495
[19]   9.945030   7.510331
> colMax(tmp5,na.rm=TRUE)
 [1] 467.93808  84.30860  81.43905  86.75687  78.99798  81.89197  79.42235
 [8]  88.99210  85.74859  80.62125  89.36706      -Inf  84.63586  89.35691
[15]  80.51881  85.92809  87.20006  84.52403  84.24279  79.71320
> colMin(tmp5,na.rm=TRUE)
 [1] 62.16711 60.54466 63.06831 62.86244 59.54952 55.43296 62.62590 56.07369
 [9] 60.84869 54.47683 57.91021      Inf 53.37156 58.33095 58.77745 60.28894
[17] 58.43707 56.96487 55.63972 55.24029
> 
> 
> 
> 
> 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] 299.66872 227.35598 137.06689 166.41538 225.63935 315.75059 197.03669
 [8] 144.59774  99.50211 253.96704
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 299.66872 227.35598 137.06689 166.41538 225.63935 315.75059 197.03669
 [8] 144.59774  99.50211 253.96704
> 
> 
> 
> copymatrix <- matrix(rnorm(200,150,15),10,20)
> 
> tmp5[1:10,1:20] <- copymatrix
> which.row <- 1
> which.col  <- 3
> cat(which.row," ",which.col,"\n")
1   3 
> tmp5[which.row,which.col] <- NA
> copymatrix[which.row,which.col] <- NA
> 
> colVars(tmp5,na.rm=TRUE)-apply(copymatrix,2,var,na.rm=TRUE)
 [1]  1.136868e-13 -1.705303e-13 -5.684342e-14  5.684342e-14 -5.684342e-14
 [6] -2.273737e-13 -2.273737e-13 -1.136868e-13  2.842171e-14  0.000000e+00
[11]  2.131628e-14  0.000000e+00 -1.421085e-13  4.263256e-14  8.526513e-14
[16]  1.136868e-13 -8.526513e-14 -8.526513e-14  0.000000e+00 -2.842171e-14
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> ## making sure these things agree
> ##
> ## first when there is no NA
> 
> 
> 
> agree.checks <- function(buff.matrix,r.matrix,err.tol=1e-10){
+ 
+   if (Max(buff.matrix,na.rm=TRUE) != max(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Max")
+   }
+   
+ 
+   if (Min(buff.matrix,na.rm=TRUE) != min(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Min")
+   }
+ 
+ 
+   if (abs(Sum(buff.matrix,na.rm=TRUE)- sum(r.matrix,na.rm=TRUE)) > err.tol){
+ 
+     cat(Sum(buff.matrix,na.rm=TRUE),"\n")
+     cat(sum(r.matrix,na.rm=TRUE),"\n")
+     cat(Sum(buff.matrix,na.rm=TRUE) - sum(r.matrix,na.rm=TRUE),"\n")
+     
+     stop("No agreement in Sum")
+   }
+   
+   if (abs(mean(buff.matrix,na.rm=TRUE) - mean(r.matrix,na.rm=TRUE)) > err.tol){
+     stop("No agreement in mean")
+   }
+   
+   
+   if(abs(Var(buff.matrix,na.rm=TRUE) - var(as.vector(r.matrix),na.rm=TRUE)) > err.tol){
+     stop("No agreement in Var")
+   }
+   
+   
+ 
+   if(any(abs(rowMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,mean,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowMeans")
+   }
+   
+   
+   if(any(abs(colMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,mean,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colMeans")
+   }
+   
+   
+   if(any(abs(rowSums(buff.matrix,na.rm=TRUE)  -  apply(r.matrix,1,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in rowSums")
+   }
+   
+   
+   if(any(abs(colSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colSums")
+   }
+   
+   ### this is to get around the fact that R doesn't like to compute NA on an entire vector of NA when 
+   ### computing variance
+   my.Var <- function(x,na.rm=FALSE){
+    if (all(is.na(x))){
+      return(NA)
+    } else {
+      var(x,na.rm=na.rm)
+    }
+ 
+   }
+   
+   if(any(abs(rowVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+   
+   
+   if(any(abs(colVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+ 
+ 
+   if(any(abs(rowMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+ 
+   if(any(abs(colMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+   
+   
+   if(any(abs(rowMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+   
+ 
+   if(any(abs(colMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+ 
+   if(any(abs(colMedians(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,median,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMedian")
+   }
+ 
+   if(any(abs(colRanges(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,range,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colRanges")
+   }
+ 
+ 
+   
+ }
> 
> 
> 
> 
> 
> 
> 
> 
> 
> for (rep in 1:20){
+   copymatrix <- matrix(rnorm(200,150,15),10,20)
+   
+   tmp5[1:10,1:20] <- copymatrix
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ## now lets assign some NA values and check agreement
+ 
+   which.row <- sample(1:10,1,replace=TRUE)
+   which.col  <- sample(1:20,1,replace=TRUE)
+   
+   cat(which.row," ",which.col,"\n")
+   
+   tmp5[which.row,which.col] <- NA
+   copymatrix[which.row,which.col] <- NA
+   
+   agree.checks(tmp5,copymatrix)
+ 
+   ## make an entire row NA
+   tmp5[which.row,] <- NA
+   copymatrix[which.row,] <- NA
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ### also make an entire col NA
+   tmp5[,which.col] <- NA
+   copymatrix[,which.col] <- NA
+ 
+   agree.checks(tmp5,copymatrix)
+ 
+   ### now make 1 element non NA with NA in the rest of row and column
+ 
+   tmp5[which.row,which.col] <- rnorm(1,150,15)
+   copymatrix[which.row,which.col] <- tmp5[which.row,which.col]
+ 
+   agree.checks(tmp5,copymatrix)
+ }
7   18 
2   4 
6   5 
6   20 
2   15 
9   18 
1   14 
8   2 
2   3 
3   9 
8   14 
7   16 
1   9 
9   13 
1   9 
4   18 
10   6 
3   5 
2   17 
6   18 
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.909914
> Min(tmp)
[1] -2.746041
> mean(tmp)
[1] -0.05917491
> Sum(tmp)
[1] -5.917491
> Var(tmp)
[1] 0.9622266
> 
> rowMeans(tmp)
[1] -0.05917491
> rowSums(tmp)
[1] -5.917491
> rowVars(tmp)
[1] 0.9622266
> rowSd(tmp)
[1] 0.9809315
> rowMax(tmp)
[1] 2.909914
> rowMin(tmp)
[1] -2.746041
> 
> colMeans(tmp)
  [1]  0.010664904  0.734275324 -0.036411239  0.128611151  0.397862829
  [6] -0.513454337  0.158851400  0.105792884  0.202747488  0.255844190
 [11] -0.096016385 -0.657687893 -0.034628582  0.944921481  0.433192368
 [16]  0.915800069  0.245443043  0.038056326  0.176735098  0.829246217
 [21] -0.306717998 -0.057547588  1.160686264  1.352942523  1.746178089
 [26]  2.909914330  0.623419102  0.016783434 -1.356922334  0.085521741
 [31]  0.725908678 -0.284661968  0.606981219  1.681057970 -2.044985643
 [36] -1.708720425 -0.263863021  0.009110828 -2.020593121 -0.114115727
 [41]  1.621575344  0.064167235 -0.671737259 -0.453688292  1.257261953
 [46] -0.859790823  0.245720591  0.233311736 -0.187866417 -2.077923809
 [51] -0.828607271 -2.368996922  0.125738931  0.675937663 -0.934023590
 [56] -0.728909883 -1.304170833 -2.746041054 -1.287344032  0.459346415
 [61] -1.087670454  0.295742676 -0.295133305  0.748524932 -0.047412688
 [66]  0.799281233 -0.832833644  1.145825303 -0.023749833 -0.236572343
 [71]  0.586951934 -0.575003300 -1.631706921  1.030734637 -1.535715645
 [76]  0.346664398  1.436968681  0.404523891 -0.355493443 -0.263260649
 [81]  0.755355563  0.239209269 -2.498349309 -0.299875113  0.863299378
 [86] -0.496433921 -1.048848112 -0.422619922  1.122628812 -0.469439371
 [91] -0.360888127  0.103104447  0.832856477 -0.510682239 -0.112290253
 [96] -1.099675687 -0.767842412 -0.170716828  1.503818310 -0.224949341
> colSums(tmp)
  [1]  0.010664904  0.734275324 -0.036411239  0.128611151  0.397862829
  [6] -0.513454337  0.158851400  0.105792884  0.202747488  0.255844190
 [11] -0.096016385 -0.657687893 -0.034628582  0.944921481  0.433192368
 [16]  0.915800069  0.245443043  0.038056326  0.176735098  0.829246217
 [21] -0.306717998 -0.057547588  1.160686264  1.352942523  1.746178089
 [26]  2.909914330  0.623419102  0.016783434 -1.356922334  0.085521741
 [31]  0.725908678 -0.284661968  0.606981219  1.681057970 -2.044985643
 [36] -1.708720425 -0.263863021  0.009110828 -2.020593121 -0.114115727
 [41]  1.621575344  0.064167235 -0.671737259 -0.453688292  1.257261953
 [46] -0.859790823  0.245720591  0.233311736 -0.187866417 -2.077923809
 [51] -0.828607271 -2.368996922  0.125738931  0.675937663 -0.934023590
 [56] -0.728909883 -1.304170833 -2.746041054 -1.287344032  0.459346415
 [61] -1.087670454  0.295742676 -0.295133305  0.748524932 -0.047412688
 [66]  0.799281233 -0.832833644  1.145825303 -0.023749833 -0.236572343
 [71]  0.586951934 -0.575003300 -1.631706921  1.030734637 -1.535715645
 [76]  0.346664398  1.436968681  0.404523891 -0.355493443 -0.263260649
 [81]  0.755355563  0.239209269 -2.498349309 -0.299875113  0.863299378
 [86] -0.496433921 -1.048848112 -0.422619922  1.122628812 -0.469439371
 [91] -0.360888127  0.103104447  0.832856477 -0.510682239 -0.112290253
 [96] -1.099675687 -0.767842412 -0.170716828  1.503818310 -0.224949341
> colVars(tmp)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> colSd(tmp)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> colMax(tmp)
  [1]  0.010664904  0.734275324 -0.036411239  0.128611151  0.397862829
  [6] -0.513454337  0.158851400  0.105792884  0.202747488  0.255844190
 [11] -0.096016385 -0.657687893 -0.034628582  0.944921481  0.433192368
 [16]  0.915800069  0.245443043  0.038056326  0.176735098  0.829246217
 [21] -0.306717998 -0.057547588  1.160686264  1.352942523  1.746178089
 [26]  2.909914330  0.623419102  0.016783434 -1.356922334  0.085521741
 [31]  0.725908678 -0.284661968  0.606981219  1.681057970 -2.044985643
 [36] -1.708720425 -0.263863021  0.009110828 -2.020593121 -0.114115727
 [41]  1.621575344  0.064167235 -0.671737259 -0.453688292  1.257261953
 [46] -0.859790823  0.245720591  0.233311736 -0.187866417 -2.077923809
 [51] -0.828607271 -2.368996922  0.125738931  0.675937663 -0.934023590
 [56] -0.728909883 -1.304170833 -2.746041054 -1.287344032  0.459346415
 [61] -1.087670454  0.295742676 -0.295133305  0.748524932 -0.047412688
 [66]  0.799281233 -0.832833644  1.145825303 -0.023749833 -0.236572343
 [71]  0.586951934 -0.575003300 -1.631706921  1.030734637 -1.535715645
 [76]  0.346664398  1.436968681  0.404523891 -0.355493443 -0.263260649
 [81]  0.755355563  0.239209269 -2.498349309 -0.299875113  0.863299378
 [86] -0.496433921 -1.048848112 -0.422619922  1.122628812 -0.469439371
 [91] -0.360888127  0.103104447  0.832856477 -0.510682239 -0.112290253
 [96] -1.099675687 -0.767842412 -0.170716828  1.503818310 -0.224949341
> colMin(tmp)
  [1]  0.010664904  0.734275324 -0.036411239  0.128611151  0.397862829
  [6] -0.513454337  0.158851400  0.105792884  0.202747488  0.255844190
 [11] -0.096016385 -0.657687893 -0.034628582  0.944921481  0.433192368
 [16]  0.915800069  0.245443043  0.038056326  0.176735098  0.829246217
 [21] -0.306717998 -0.057547588  1.160686264  1.352942523  1.746178089
 [26]  2.909914330  0.623419102  0.016783434 -1.356922334  0.085521741
 [31]  0.725908678 -0.284661968  0.606981219  1.681057970 -2.044985643
 [36] -1.708720425 -0.263863021  0.009110828 -2.020593121 -0.114115727
 [41]  1.621575344  0.064167235 -0.671737259 -0.453688292  1.257261953
 [46] -0.859790823  0.245720591  0.233311736 -0.187866417 -2.077923809
 [51] -0.828607271 -2.368996922  0.125738931  0.675937663 -0.934023590
 [56] -0.728909883 -1.304170833 -2.746041054 -1.287344032  0.459346415
 [61] -1.087670454  0.295742676 -0.295133305  0.748524932 -0.047412688
 [66]  0.799281233 -0.832833644  1.145825303 -0.023749833 -0.236572343
 [71]  0.586951934 -0.575003300 -1.631706921  1.030734637 -1.535715645
 [76]  0.346664398  1.436968681  0.404523891 -0.355493443 -0.263260649
 [81]  0.755355563  0.239209269 -2.498349309 -0.299875113  0.863299378
 [86] -0.496433921 -1.048848112 -0.422619922  1.122628812 -0.469439371
 [91] -0.360888127  0.103104447  0.832856477 -0.510682239 -0.112290253
 [96] -1.099675687 -0.767842412 -0.170716828  1.503818310 -0.224949341
> colMedians(tmp)
  [1]  0.010664904  0.734275324 -0.036411239  0.128611151  0.397862829
  [6] -0.513454337  0.158851400  0.105792884  0.202747488  0.255844190
 [11] -0.096016385 -0.657687893 -0.034628582  0.944921481  0.433192368
 [16]  0.915800069  0.245443043  0.038056326  0.176735098  0.829246217
 [21] -0.306717998 -0.057547588  1.160686264  1.352942523  1.746178089
 [26]  2.909914330  0.623419102  0.016783434 -1.356922334  0.085521741
 [31]  0.725908678 -0.284661968  0.606981219  1.681057970 -2.044985643
 [36] -1.708720425 -0.263863021  0.009110828 -2.020593121 -0.114115727
 [41]  1.621575344  0.064167235 -0.671737259 -0.453688292  1.257261953
 [46] -0.859790823  0.245720591  0.233311736 -0.187866417 -2.077923809
 [51] -0.828607271 -2.368996922  0.125738931  0.675937663 -0.934023590
 [56] -0.728909883 -1.304170833 -2.746041054 -1.287344032  0.459346415
 [61] -1.087670454  0.295742676 -0.295133305  0.748524932 -0.047412688
 [66]  0.799281233 -0.832833644  1.145825303 -0.023749833 -0.236572343
 [71]  0.586951934 -0.575003300 -1.631706921  1.030734637 -1.535715645
 [76]  0.346664398  1.436968681  0.404523891 -0.355493443 -0.263260649
 [81]  0.755355563  0.239209269 -2.498349309 -0.299875113  0.863299378
 [86] -0.496433921 -1.048848112 -0.422619922  1.122628812 -0.469439371
 [91] -0.360888127  0.103104447  0.832856477 -0.510682239 -0.112290253
 [96] -1.099675687 -0.767842412 -0.170716828  1.503818310 -0.224949341
> colRanges(tmp)
          [,1]      [,2]        [,3]      [,4]      [,5]       [,6]      [,7]
[1,] 0.0106649 0.7342753 -0.03641124 0.1286112 0.3978628 -0.5134543 0.1588514
[2,] 0.0106649 0.7342753 -0.03641124 0.1286112 0.3978628 -0.5134543 0.1588514
          [,8]      [,9]     [,10]       [,11]      [,12]       [,13]     [,14]
[1,] 0.1057929 0.2027475 0.2558442 -0.09601639 -0.6576879 -0.03462858 0.9449215
[2,] 0.1057929 0.2027475 0.2558442 -0.09601639 -0.6576879 -0.03462858 0.9449215
         [,15]     [,16]    [,17]      [,18]     [,19]     [,20]     [,21]
[1,] 0.4331924 0.9158001 0.245443 0.03805633 0.1767351 0.8292462 -0.306718
[2,] 0.4331924 0.9158001 0.245443 0.03805633 0.1767351 0.8292462 -0.306718
           [,22]    [,23]    [,24]    [,25]    [,26]     [,27]      [,28]
[1,] -0.05754759 1.160686 1.352943 1.746178 2.909914 0.6234191 0.01678343
[2,] -0.05754759 1.160686 1.352943 1.746178 2.909914 0.6234191 0.01678343
         [,29]      [,30]     [,31]     [,32]     [,33]    [,34]     [,35]
[1,] -1.356922 0.08552174 0.7259087 -0.284662 0.6069812 1.681058 -2.044986
[2,] -1.356922 0.08552174 0.7259087 -0.284662 0.6069812 1.681058 -2.044986
        [,36]     [,37]       [,38]     [,39]      [,40]    [,41]      [,42]
[1,] -1.70872 -0.263863 0.009110828 -2.020593 -0.1141157 1.621575 0.06416724
[2,] -1.70872 -0.263863 0.009110828 -2.020593 -0.1141157 1.621575 0.06416724
          [,43]      [,44]    [,45]      [,46]     [,47]     [,48]      [,49]
[1,] -0.6717373 -0.4536883 1.257262 -0.8597908 0.2457206 0.2333117 -0.1878664
[2,] -0.6717373 -0.4536883 1.257262 -0.8597908 0.2457206 0.2333117 -0.1878664
         [,50]      [,51]     [,52]     [,53]     [,54]      [,55]      [,56]
[1,] -2.077924 -0.8286073 -2.368997 0.1257389 0.6759377 -0.9340236 -0.7289099
[2,] -2.077924 -0.8286073 -2.368997 0.1257389 0.6759377 -0.9340236 -0.7289099
         [,57]     [,58]     [,59]     [,60]    [,61]     [,62]      [,63]
[1,] -1.304171 -2.746041 -1.287344 0.4593464 -1.08767 0.2957427 -0.2951333
[2,] -1.304171 -2.746041 -1.287344 0.4593464 -1.08767 0.2957427 -0.2951333
         [,64]       [,65]     [,66]      [,67]    [,68]       [,69]      [,70]
[1,] 0.7485249 -0.04741269 0.7992812 -0.8328336 1.145825 -0.02374983 -0.2365723
[2,] 0.7485249 -0.04741269 0.7992812 -0.8328336 1.145825 -0.02374983 -0.2365723
         [,71]      [,72]     [,73]    [,74]     [,75]     [,76]    [,77]
[1,] 0.5869519 -0.5750033 -1.631707 1.030735 -1.535716 0.3466644 1.436969
[2,] 0.5869519 -0.5750033 -1.631707 1.030735 -1.535716 0.3466644 1.436969
         [,78]      [,79]      [,80]     [,81]     [,82]     [,83]      [,84]
[1,] 0.4045239 -0.3554934 -0.2632606 0.7553556 0.2392093 -2.498349 -0.2998751
[2,] 0.4045239 -0.3554934 -0.2632606 0.7553556 0.2392093 -2.498349 -0.2998751
         [,85]      [,86]     [,87]      [,88]    [,89]      [,90]      [,91]
[1,] 0.8632994 -0.4964339 -1.048848 -0.4226199 1.122629 -0.4694394 -0.3608881
[2,] 0.8632994 -0.4964339 -1.048848 -0.4226199 1.122629 -0.4694394 -0.3608881
         [,92]     [,93]      [,94]      [,95]     [,96]      [,97]      [,98]
[1,] 0.1031044 0.8328565 -0.5106822 -0.1122903 -1.099676 -0.7678424 -0.1707168
[2,] 0.1031044 0.8328565 -0.5106822 -0.1122903 -1.099676 -0.7678424 -0.1707168
        [,99]     [,100]
[1,] 1.503818 -0.2249493
[2,] 1.503818 -0.2249493
> 
> 
> Max(tmp2)
[1] 2.791736
> Min(tmp2)
[1] -1.949799
> mean(tmp2)
[1] 0.05541459
> Sum(tmp2)
[1] 5.541459
> Var(tmp2)
[1] 0.946464
> 
> rowMeans(tmp2)
  [1]  1.06723174  1.80193214  0.59681482 -1.94979882  0.87944061 -1.27827355
  [7] -0.21168169  0.83364267 -0.95373668 -0.09831704  0.28848203 -0.36483193
 [13]  0.57907729  0.08368005  0.83410673 -0.35388735 -0.78982045  0.99132945
 [19] -0.10203961 -0.44392649  0.31500144 -0.09938183 -0.81099311 -1.34566631
 [25]  0.24574396  0.16342909 -0.55112503 -0.04840363  0.63459812 -1.48628592
 [31] -1.59535909 -0.36999435 -0.64524067  1.33850840  0.15311050 -0.75015876
 [37]  1.03857891  0.07499122  0.07742823 -0.64302811 -1.26903660 -0.96498821
 [43]  1.44827785 -0.35059502 -0.90844923 -0.76316144  0.48419454 -0.46987227
 [49] -1.11666463  0.41244464 -0.95695946 -0.03386962  1.24990890  2.79173563
 [55]  2.65693783  0.13191248 -0.56331658  0.16798223  1.37776862  1.20050496
 [61]  0.47780772 -0.14452927  0.61728842 -0.33965442 -0.06213677 -0.48453972
 [67]  0.53908236 -1.18910283  2.62027769 -0.04891536  1.15624344  0.54870740
 [73] -0.01234508  0.98020849  0.46249342  0.46649891  1.22411422  0.37229804
 [79] -1.64209632 -1.76706512 -0.23647147  1.49080356 -0.46657894 -0.58808314
 [85] -1.72198777 -0.48215841  1.37792096  0.75312199 -1.17932725  1.48068287
 [91]  0.16052858 -0.08178640 -1.00661183 -0.29540666 -0.37413151  0.04446429
 [97]  1.16611501  1.09790213 -0.71222210 -0.28988195
> rowSums(tmp2)
  [1]  1.06723174  1.80193214  0.59681482 -1.94979882  0.87944061 -1.27827355
  [7] -0.21168169  0.83364267 -0.95373668 -0.09831704  0.28848203 -0.36483193
 [13]  0.57907729  0.08368005  0.83410673 -0.35388735 -0.78982045  0.99132945
 [19] -0.10203961 -0.44392649  0.31500144 -0.09938183 -0.81099311 -1.34566631
 [25]  0.24574396  0.16342909 -0.55112503 -0.04840363  0.63459812 -1.48628592
 [31] -1.59535909 -0.36999435 -0.64524067  1.33850840  0.15311050 -0.75015876
 [37]  1.03857891  0.07499122  0.07742823 -0.64302811 -1.26903660 -0.96498821
 [43]  1.44827785 -0.35059502 -0.90844923 -0.76316144  0.48419454 -0.46987227
 [49] -1.11666463  0.41244464 -0.95695946 -0.03386962  1.24990890  2.79173563
 [55]  2.65693783  0.13191248 -0.56331658  0.16798223  1.37776862  1.20050496
 [61]  0.47780772 -0.14452927  0.61728842 -0.33965442 -0.06213677 -0.48453972
 [67]  0.53908236 -1.18910283  2.62027769 -0.04891536  1.15624344  0.54870740
 [73] -0.01234508  0.98020849  0.46249342  0.46649891  1.22411422  0.37229804
 [79] -1.64209632 -1.76706512 -0.23647147  1.49080356 -0.46657894 -0.58808314
 [85] -1.72198777 -0.48215841  1.37792096  0.75312199 -1.17932725  1.48068287
 [91]  0.16052858 -0.08178640 -1.00661183 -0.29540666 -0.37413151  0.04446429
 [97]  1.16611501  1.09790213 -0.71222210 -0.28988195
> 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.06723174  1.80193214  0.59681482 -1.94979882  0.87944061 -1.27827355
  [7] -0.21168169  0.83364267 -0.95373668 -0.09831704  0.28848203 -0.36483193
 [13]  0.57907729  0.08368005  0.83410673 -0.35388735 -0.78982045  0.99132945
 [19] -0.10203961 -0.44392649  0.31500144 -0.09938183 -0.81099311 -1.34566631
 [25]  0.24574396  0.16342909 -0.55112503 -0.04840363  0.63459812 -1.48628592
 [31] -1.59535909 -0.36999435 -0.64524067  1.33850840  0.15311050 -0.75015876
 [37]  1.03857891  0.07499122  0.07742823 -0.64302811 -1.26903660 -0.96498821
 [43]  1.44827785 -0.35059502 -0.90844923 -0.76316144  0.48419454 -0.46987227
 [49] -1.11666463  0.41244464 -0.95695946 -0.03386962  1.24990890  2.79173563
 [55]  2.65693783  0.13191248 -0.56331658  0.16798223  1.37776862  1.20050496
 [61]  0.47780772 -0.14452927  0.61728842 -0.33965442 -0.06213677 -0.48453972
 [67]  0.53908236 -1.18910283  2.62027769 -0.04891536  1.15624344  0.54870740
 [73] -0.01234508  0.98020849  0.46249342  0.46649891  1.22411422  0.37229804
 [79] -1.64209632 -1.76706512 -0.23647147  1.49080356 -0.46657894 -0.58808314
 [85] -1.72198777 -0.48215841  1.37792096  0.75312199 -1.17932725  1.48068287
 [91]  0.16052858 -0.08178640 -1.00661183 -0.29540666 -0.37413151  0.04446429
 [97]  1.16611501  1.09790213 -0.71222210 -0.28988195
> rowMin(tmp2)
  [1]  1.06723174  1.80193214  0.59681482 -1.94979882  0.87944061 -1.27827355
  [7] -0.21168169  0.83364267 -0.95373668 -0.09831704  0.28848203 -0.36483193
 [13]  0.57907729  0.08368005  0.83410673 -0.35388735 -0.78982045  0.99132945
 [19] -0.10203961 -0.44392649  0.31500144 -0.09938183 -0.81099311 -1.34566631
 [25]  0.24574396  0.16342909 -0.55112503 -0.04840363  0.63459812 -1.48628592
 [31] -1.59535909 -0.36999435 -0.64524067  1.33850840  0.15311050 -0.75015876
 [37]  1.03857891  0.07499122  0.07742823 -0.64302811 -1.26903660 -0.96498821
 [43]  1.44827785 -0.35059502 -0.90844923 -0.76316144  0.48419454 -0.46987227
 [49] -1.11666463  0.41244464 -0.95695946 -0.03386962  1.24990890  2.79173563
 [55]  2.65693783  0.13191248 -0.56331658  0.16798223  1.37776862  1.20050496
 [61]  0.47780772 -0.14452927  0.61728842 -0.33965442 -0.06213677 -0.48453972
 [67]  0.53908236 -1.18910283  2.62027769 -0.04891536  1.15624344  0.54870740
 [73] -0.01234508  0.98020849  0.46249342  0.46649891  1.22411422  0.37229804
 [79] -1.64209632 -1.76706512 -0.23647147  1.49080356 -0.46657894 -0.58808314
 [85] -1.72198777 -0.48215841  1.37792096  0.75312199 -1.17932725  1.48068287
 [91]  0.16052858 -0.08178640 -1.00661183 -0.29540666 -0.37413151  0.04446429
 [97]  1.16611501  1.09790213 -0.71222210 -0.28988195
> 
> colMeans(tmp2)
[1] 0.05541459
> colSums(tmp2)
[1] 5.541459
> colVars(tmp2)
[1] 0.946464
> colSd(tmp2)
[1] 0.9728638
> colMax(tmp2)
[1] 2.791736
> colMin(tmp2)
[1] -1.949799
> colMedians(tmp2)
[1] -0.04113662
> colRanges(tmp2)
          [,1]
[1,] -1.949799
[2,]  2.791736
> 
> dataset1 <- matrix(dataset1,1,100)
> 
> agree.checks(tmp,dataset1)
> 
> dataset2 <- matrix(dataset2,100,1)
> agree.checks(tmp2,dataset2)
>   
> 
> tmp <- createBufferedMatrix(10,10)
> 
> tmp[1:10,1:10] <- rnorm(100)
> colApply(tmp,sum)
 [1]  1.0700048 -2.8186933  0.5828904  2.3019223  1.9839174 -1.1441068
 [7]  0.8155603  0.8236432 -4.7236527 -2.9840892
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -1.2355425
[2,] -0.3065364
[3,]  0.3765256
[4,]  0.5952571
[5,]  0.8949565
> 
> rowApply(tmp,sum)
 [1]  3.7420062 -0.8005872 -7.1621248  0.6629635  1.0730948  1.1714259
 [7]  5.4821007 -3.7561664 -3.6684615 -0.8368549
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    6    2    7    2    8    8    6    9    7     8
 [2,]   10    1    1    9    5    2    7    4    8     4
 [3,]    4    6    3    8    7    6    4    8    6     7
 [4,]    8    8    9    1    6    9    3    2   10     9
 [5,]    1   10    8    5    1    7    1   10    4    10
 [6,]    5    7    6    6    4    4    5    6    9     3
 [7,]    9    9    2    4   10    5   10    5    5     2
 [8,]    2    5   10    3    9   10    8    3    1     6
 [9,]    3    3    5    7    3    3    2    1    3     5
[10,]    7    4    4   10    2    1    9    7    2     1
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1] -2.10306116  1.08854623  1.64054373  3.55111526 -3.12373145 -1.91693091
 [7] -1.71854901  3.45689000 -4.40494927  1.81227910 -3.56873028  1.87054345
[13] -1.87816899  2.27958674  0.04914824 -0.43167399 -2.18801905 -1.32596468
[19] -1.41931428 -0.79457120
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -1.9413628
[2,] -0.6944907
[3,] -0.4640845
[4,] -0.3652315
[5,]  1.3621083
> 
> rowApply(tmp,sum)
[1] -2.151086 -7.577108 -4.872589  8.407762 -2.931991
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]   20    2   11    5    6
[2,]   15   13   15    9   11
[3,]   10    8   17   15   18
[4,]   17   16   14   20   10
[5,]    4    6    4   14    4
> 
> 
> as.matrix(tmp)
           [,1]       [,2]        [,3]       [,4]       [,5]        [,6]
[1,]  1.3621083  0.6268117 -0.03042974  0.9220191 -1.0623897  1.21517630
[2,] -1.9413628 -0.0900737 -0.78594658  0.5290544 -1.1221012 -0.89001206
[3,] -0.3652315  0.4936807  0.63210842  0.4395809 -0.9724514 -2.10352415
[4,] -0.4640845  0.3524691  1.00702121  1.9924062  0.8745139 -0.10497944
[5,] -0.6944907 -0.2943416  0.81779042 -0.3319454 -0.8413030 -0.03359156
           [,7]       [,8]       [,9]       [,10]      [,11]      [,12]
[1,] -2.2111053  0.3138306 -0.9467359 -0.06365577 -1.2201858 -0.9295520
[2,] -0.6495602  0.5398284 -1.2575767  1.47971855 -2.6397704  1.1487538
[3,] -0.9508212 -0.3656920 -0.2929633 -0.05348870 -1.4509516  0.9551804
[4,]  1.8692252  1.0561987 -0.2901588  1.18079449  1.5777581  0.4312093
[5,]  0.2237125  1.9127243 -1.6175145 -0.73108946  0.1644195  0.2649520
          [,13]      [,14]      [,15]       [,16]      [,17]      [,18]
[1,] -0.7070729  0.4328103  0.3779713 -0.02256411 -0.8152216 -1.3339864
[2,]  0.1320917  0.7178144 -0.2881588 -0.15543685  0.4457398 -1.2295661
[3,] -1.1683240  1.3316612  0.9565922  0.50467564 -0.3748411 -0.5533766
[4,] -0.6700380  0.4625690 -0.1557131 -0.86211821 -0.8108473  0.7975240
[5,]  0.5351742 -0.6652681 -0.8415434  0.10376954 -0.6328488  0.9934404
          [,19]      [,20]
[1,]  0.7116456  1.2294401
[2,] -1.1848096 -0.3357340
[3,] -0.9001010 -0.6343019
[4,]  0.8652657 -0.7012536
[5,] -0.9113149 -0.3527218
> 
> 
> is.BufferedMatrix(tmp)
[1] TRUE
> 
> as.BufferedMatrix(as.matrix(tmp))
BufferedMatrix object
Matrix size:  5 20 
Buffer size:  1 1 
Directory:    F:/biocbuild/bbs-3.20-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:    F:/biocbuild/bbs-3.20-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:    F:/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  542  bytes.
Disk usage :  160  bytes.
> subBufferedMatrix(tmp,1:3,)
BufferedMatrix object
Matrix size:  3 20 
Buffer size:  1 1 
Directory:    F:/biocbuild/bbs-3.20-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.2119718 0.6487449 -0.5140255 -0.2229049 1.13812 -0.1933071 0.59903
          col8       col9    col10      col11    col12    col13       col14
row1 0.3926261 -0.5547602 2.413449 -0.7216033 -1.96917 0.510554 -0.04466518
          col15    col16      col17       col18     col19      col20
row1 -0.8741562 1.208425 -0.4697011 -0.05528169 -1.859922 -0.8204608
> tmp[,"col10"]
          col10
row1 2.41344871
row2 0.07622329
row3 1.32858277
row4 0.20109343
row5 0.12249817
> tmp[c("row1","row5"),]
          col1       col2        col3       col4     col5       col6       col7
row1 0.2119718  0.6487449 -0.51402550 -0.2229049 1.138120 -0.1933071  0.5990300
row5 1.4203223 -0.0138210 -0.08500663  0.2566715 0.297964  0.8357052 -0.4884076
           col8       col9     col10      col11      col12      col13
row1  0.3926261 -0.5547602 2.4134487 -0.7216033 -1.9691695  0.5105540
row5 -0.2656431  0.5592668 0.1224982 -0.7511612 -0.1261863 -0.8120731
           col14      col15    col16       col17       col18      col19
row1 -0.04466518 -0.8741562 1.208425 -0.46970113 -0.05528169 -1.8599217
row5 -1.07219293 -0.6611108 1.111270 -0.01049885 -0.47548729 -0.1847138
          col20
row1 -0.8204608
row5 -2.1008310
> tmp[,c("col6","col20")]
            col6      col20
row1 -0.19330709 -0.8204608
row2 -0.02550734 -1.5083602
row3  0.37846053 -0.2350865
row4 -0.95690231 -1.7400790
row5  0.83570522 -2.1008310
> tmp[c("row1","row5"),c("col6","col20")]
           col6      col20
row1 -0.1933071 -0.8204608
row5  0.8357052 -2.1008310
> 
> 
> 
> 
> 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.71436 50.4843 50.06732 49.30509 49.75819 106.1119 50.35908 51.41913
         col9    col10   col11    col12    col13    col14    col15    col16
row1 49.65116 49.88886 51.2047 48.85395 51.35021 50.30941 50.93165 50.99033
        col17   col18   col19    col20
row1 50.44304 50.5726 50.0178 105.3128
> tmp[,"col10"]
        col10
row1 49.88886
row2 29.03681
row3 30.25527
row4 30.94801
row5 50.62687
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 49.71436 50.48430 50.06732 49.30509 49.75819 106.1119 50.35908 51.41913
row5 50.44447 48.37427 51.73183 52.31429 49.41169 103.0478 50.21401 49.84960
         col9    col10   col11    col12    col13    col14    col15    col16
row1 49.65116 49.88886 51.2047 48.85395 51.35021 50.30941 50.93165 50.99033
row5 49.70382 50.62687 50.4602 48.02979 49.37593 49.82280 50.05744 49.79046
        col17    col18   col19    col20
row1 50.44304 50.57260 50.0178 105.3128
row5 50.16889 49.90108 51.6435 104.7289
> tmp[,c("col6","col20")]
          col6     col20
row1 106.11192 105.31277
row2  74.68058  75.79352
row3  75.75890  75.27475
row4  75.73877  73.88309
row5 103.04783 104.72889
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 106.1119 105.3128
row5 103.0478 104.7289
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 106.1119 105.3128
row5 103.0478 104.7289
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
           col13
[1,]  0.29633291
[2,] -0.23648687
[3,] -0.05471775
[4,] -0.19908951
[5,] -0.77382074
> tmp[,c("col17","col7")]
          col17        col7
[1,] -0.5002735 -0.07391508
[2,]  1.1044160  0.28809885
[3,]  0.2593237 -1.29489159
[4,] -1.4204799 -1.42632791
[5,]  1.5867280  0.64267285
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
           col6       col20
[1,]  0.7876484  0.67139407
[2,] -0.6551230  1.44393671
[3,]  0.4599736  0.34081816
[4,] -1.7157369  0.04161574
[5,]  1.5003869 -0.23116485
> subBufferedMatrix(tmp,1,c("col6"))[,1]
          col1
[1,] 0.7876484
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
           col6
[1,]  0.7876484
[2,] -0.6551230
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> 
> 
> 
> subBufferedMatrix(tmp,c("row3","row1"),)[,1:20]
           [,1]       [,2]      [,3]       [,4]      [,5]       [,6]      [,7]
row3  1.7901154 -0.9803269 -0.478724  0.6007617 -1.096253  1.4299755 0.5165155
row1 -0.2100463 -0.9139923 -1.180029 -0.9092423 -2.230363 -0.4168859 1.0548995
           [,8]       [,9]      [,10]      [,11]      [,12]      [,13]
row3 -0.1831009 -0.8052612 -0.3326885 -0.3256576 -0.6116816 -0.7122096
row1 -0.4709145  1.6286426 -0.1220142 -0.8487218 -0.8582884  0.4378252
         [,14]    [,15]      [,16]      [,17]     [,18]      [,19]      [,20]
row3 0.6151112 1.243805  0.9397511 -0.8102649 -1.219298 -0.5758475 -0.3822038
row1 0.5525170 1.545300 -1.2709831 -0.8494554 -2.341035  0.7665847 -0.3614821
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
           [,1]      [,2]      [,3]       [,4]      [,5]       [,6]      [,7]
row2 -0.4119226 -0.346021 -1.059537 0.09810233 0.7430551 -0.5669659 0.6353688
          [,8]      [,9]     [,10]
row2 0.6896536 0.3459793 0.3337321
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
           [,1]      [,2]      [,3]     [,4]      [,5]       [,6]       [,7]
row5 -0.4830198 0.2464175 0.4777515 1.296239 0.2671917 -0.6955852 0.01363267
          [,8]       [,9]      [,10]      [,11]    [,12]     [,13]     [,14]
row5 0.2534989 -0.7949269 -0.4468487 0.04639555 0.472638 0.6415544 -0.124937
          [,15]    [,16]     [,17]       [,18]     [,19]      [,20]
row5 -0.4390842 1.200537 -0.805722 -0.07063633 -1.424289 -0.6274593
> 
> 
> 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: 0x0000020ca8aff650>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "F:/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests\\BM220056e346a0"
 [2] "F:/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests\\BM220054cc4e54"
 [3] "F:/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests\\BM220010728ba" 
 [4] "F:/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests\\BM220059295c71"
 [5] "F:/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests\\BM2200334b7159"
 [6] "F:/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests\\BM220014d7d49" 
 [7] "F:/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests\\BM220027392b71"
 [8] "F:/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests\\BM220045a53ba3"
 [9] "F:/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests\\BM2200204b211f"
[10] "F:/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests\\BM22004a2c649c"
[11] "F:/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests\\BM22004bf54b99"
[12] "F:/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests\\BM22005e8d1741"
[13] "F:/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests\\BM220062e67f66"
[14] "F:/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests\\BM2200498c725d"
[15] "F:/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests\\BM22006f8c28ca"
> 
> 
> ### 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: 0x0000020cab2ff7d0>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x0000020cab2ff7d0>
Warning message:
In dir.create(new.directory) :
  'F:\biocbuild\bbs-3.20-bioc\meat\BufferedMatrix.Rcheck\tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x0000020cab2ff7d0>
> rowMedians(tmp)
  [1]  0.145795937  0.021627112 -0.069943452 -0.369982500 -0.054668767
  [6]  0.475653009 -0.076990596 -0.361230436  0.275039147  0.433062849
 [11]  0.130449669 -0.163131504 -0.132556058 -0.101437811  0.311276712
 [16]  0.112003749  0.397556787 -0.152789303  0.388318872  0.427857587
 [21]  0.146262053 -0.412476627  0.421083077 -0.166605872  0.663899978
 [26] -0.132046779  0.083550642  0.400910192  0.199367857 -0.340270104
 [31]  0.373530728  0.103856180  0.031942619 -0.136464374  0.117176280
 [36] -0.622676720  0.205097575  0.083464223 -0.477629766  0.049447855
 [41]  0.064007528 -0.218176287 -0.160849361 -0.280807655 -0.081658770
 [46]  0.200951192  0.110440094 -0.029474368 -0.109060178  0.220351212
 [51]  0.443245600 -0.171612826 -0.159994726  0.278706633 -0.151558027
 [56] -0.194955670 -0.191557813  0.501082907  0.218276661 -0.355177350
 [61]  0.127749008 -0.337569464 -0.478698637  0.187126214 -0.526738031
 [66]  0.184330385 -0.216206401 -0.237811172  0.185820990 -0.006171869
 [71]  0.501908312 -0.689586632  0.277150766 -0.136686863  0.271199542
 [76]  0.159445024  0.377142275 -0.594310646  0.369106384 -0.525171895
 [81]  0.109137558  0.322886513 -0.510125382 -0.160850932  0.290927846
 [86] -0.425146711  0.073166824  0.032057307  0.383428456 -0.378780018
 [91] -0.495737621 -0.299908836 -0.113351859 -0.200443124  0.154502567
 [96] -0.634723142 -0.562179777  0.156618994  0.225692240 -0.134900799
[101] -0.229674055 -0.416172482 -0.236839154  0.107000300 -0.164488994
[106] -0.240802872 -0.099157858 -0.219545445  0.144270471  0.101556517
[111]  0.143847554 -0.139754438 -0.147984989  0.360932187  0.014613978
[116]  0.150811914 -0.234974157 -0.024089111 -0.009604377  0.107109913
[121]  0.138830737 -0.083748270  0.596871949 -0.402751937 -0.279777084
[126] -0.040672870 -0.233604918 -0.298711909 -0.017834221  0.013024168
[131] -0.149126569 -0.306437594 -0.193766944  0.800783699 -0.213431633
[136] -0.131548124 -0.056176039 -0.186995991  0.016489295 -0.331100008
[141] -0.393997236 -0.098405446  0.163272297  0.071018564 -0.133150794
[146]  0.231461126  0.080055219 -0.559656976 -0.186935629  0.084813053
[151]  0.005740745  0.492225379  0.014011603  0.296738008  0.291227115
[156]  0.629829255  0.021021490 -0.245807160 -0.327522176 -0.826908090
[161] -0.613946938 -0.064983840 -0.256680723  0.114081611 -0.337656312
[166]  0.044725916  0.020392326  0.329258496  0.273966972 -0.300200817
[171]  0.469477115  0.394133346 -0.169792548 -0.657984565  0.190404479
[176]  0.180856375 -0.141674325 -0.530006733 -0.548262678  0.100539074
[181] -0.190322300 -0.248295601  0.350829629  0.037158889 -0.052920443
[186]  0.124842695  0.004370569  0.328729176  0.337627385 -0.464347144
[191] -0.048167619 -0.151478303 -0.113071627  0.140620881  0.351334292
[196]  0.233338877  0.097069496 -0.438552656  0.126569891  0.489470736
[201]  0.041812864 -0.046422216 -0.059789945 -0.034739856 -0.222349302
[206] -0.074021415  0.153969920 -0.079378657 -0.152315680  0.604596594
[211]  0.062393108 -0.005767985  0.129797596  0.172400887 -0.157014039
[216] -0.464982985 -0.472911816  0.246950494  0.141994385  0.273249051
[221] -0.494622104 -0.223225321 -0.242757243  0.200774558 -0.013304869
[226]  0.175043578 -0.022295330  0.407718814 -0.309992078  0.367232613
> 
> proc.time()
   user  system elapsed 
   3.93   16.54  372.15 

BufferedMatrix.Rcheck/tests/rawCalltesting.Rout


R version 4.4.2 (2024-10-31 ucrt) -- "Pile of Leaves"
Copyright (C) 2024 The R Foundation for Statistical Computing
Platform: x86_64-w64-mingw32/x64

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: 0x0000025788af8110>
> .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: 0x0000025788af8110>
> .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: 0x0000025788af8110>
> .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: 0x0000025788af8110>
> 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: 0x0000025788af8590>
> .Call("R_bm_AddColumn",P)
<pointer: 0x0000025788af8590>
> .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: 0x0000025788af8590>
> .Call("R_bm_AddColumn",P)
<pointer: 0x0000025788af8590>
> .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: 0x0000025788af8590>
> 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: 0x0000025788af84d0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x0000025788af84d0>
> .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: 0x0000025788af84d0>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x0000025788af84d0>
> .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: 0x0000025788af84d0>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x0000025788af84d0>
> .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: 0x0000025788af84d0>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x0000025788af84d0>
> .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: 0x0000025788af84d0>
> 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: 0x0000025788af85f0>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x0000025788af85f0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x0000025788af85f0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x0000025788af85f0>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile33407203168b" "BufferedMatrixFile33407bc4bbc" 
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile33407203168b" "BufferedMatrixFile33407bc4bbc" 
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x0000025788af8b90>
> .Call("R_bm_AddColumn",P)
<pointer: 0x0000025788af8b90>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x0000025788af8b90>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x0000025788af8b90>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x0000025788af8b90>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x0000025788af8b90>
> .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: 0x0000025788af8650>
> .Call("R_bm_AddColumn",P)
<pointer: 0x0000025788af8650>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x0000025788af8650>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x0000025788af8650>
> 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: 0x0000025788af8170>
> .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: 0x0000025788af8170>
> rm(P)
> 
> proc.time()
   user  system elapsed 
   0.31    0.18    0.98 

BufferedMatrix.Rcheck/tests/Rcodetesting.Rout


R version 4.4.2 (2024-10-31 ucrt) -- "Pile of Leaves"
Copyright (C) 2024 The R Foundation for Statistical Computing
Platform: x86_64-w64-mingw32/x64

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.34    0.06    0.37 

Example timings