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

This page was generated on 2024-05-22 11:35:28 -0400 (Wed, 22 May 2024).

HostnameOSArch (*)R versionInstalled pkgs
nebbiolo1Linux (Ubuntu 22.04.3 LTS)x86_644.4.0 (2024-04-24) -- "Puppy Cup" 4751
palomino3Windows Server 2022 Datacenterx644.4.0 (2024-04-24 ucrt) -- "Puppy Cup" 4485
lconwaymacOS 12.7.1 Montereyx86_644.4.0 (2024-04-24) -- "Puppy Cup" 3444
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 249/2300HostnameOS / ArchINSTALLBUILDCHECKBUILD BIN
BufferedMatrix 1.68.0  (landing page)
Ben Bolstad
Snapshot Date: 2024-05-21 14:00:15 -0400 (Tue, 21 May 2024)
git_url: https://git.bioconductor.org/packages/BufferedMatrix
git_branch: RELEASE_3_19
git_last_commit: af6c73d
git_last_commit_date: 2024-04-30 10:16:21 -0400 (Tue, 30 Apr 2024)
nebbiolo1Linux (Ubuntu 22.04.3 LTS) / x86_64  OK    OK    OK  UNNEEDED, same version is already published
palomino3Windows Server 2022 Datacenter / x64  OK    OK    OK    OK  UNNEEDED, same version is already published
lconwaymacOS 12.7.1 Monterey / x86_64  OK    OK    WARNINGS    OK  UNNEEDED, same version is already published
kjohnson3macOS 13.6.5 Ventura / arm64see weekly results here

CHECK results for BufferedMatrix on palomino3


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.68.0
Command: F:\biocbuild\bbs-3.19-bioc\R\bin\R.exe CMD check --no-multiarch --install=check:BufferedMatrix.install-out.txt --library=F:\biocbuild\bbs-3.19-bioc\R\library --no-vignettes --timings BufferedMatrix_1.68.0.tar.gz
StartedAt: 2024-05-21 23:47:03 -0400 (Tue, 21 May 2024)
EndedAt: 2024-05-21 23:48:09 -0400 (Tue, 21 May 2024)
EllapsedTime: 65.9 seconds
RetCode: 0
Status:   OK  
CheckDir: BufferedMatrix.Rcheck
Warnings: 0

Command output

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


* using log directory 'F:/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck'
* using R version 4.4.0 (2024-04-24 ucrt)
* using platform: x86_64-w64-mingw32
* R was compiled by
    gcc.exe (GCC) 13.2.0
    GNU Fortran (GCC) 13.2.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.68.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.2.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.19-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.19-bioc/meat/BufferedMatrix.Rcheck/00check.log'
for details.


Installation output

BufferedMatrix.Rcheck/00install.out

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


* installing to library 'F:/biocbuild/bbs-3.19-bioc/R/library'
* installing *source* package 'BufferedMatrix' ...
** using staged installation
** libs
using C compiler: 'gcc.exe (GCC) 13.2.0'
gcc  -I"F:/biocbuild/bbs-3.19-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.19-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.19-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.19-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.19-bioc/R/bin/x64 -lR
installing to F:/biocbuild/bbs-3.19-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.0 (2024-04-24 ucrt) -- "Puppy Cup"
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.34    0.21    0.65 

BufferedMatrix.Rcheck/tests/objectTesting.Rout


R version 4.4.0 (2024-04-24 ucrt) -- "Puppy Cup"
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.19-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 468464 25.1    1021761 54.6   633414 33.9
Vcells 853870  6.6    8388608 64.0  2003138 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] "Tue May 21 23:47:28 2024"
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> date()
[1] "Tue May 21 23:47:28 2024"
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,which.col] == test.matrix[which.row,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> 
> 
> RowMode(tmp2)
<pointer: 0x000001de556fe950>
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   which.col <- sample(1:20,1)
+   if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,5,replace=TRUE)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> date()
[1] "Tue May 21 23:47:35 2024"
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col <- sample(1:20,5,replace=TRUE)
+   if (!all(tmp2[which.row,which.col] == test.matrix[which.row,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> date()
[1] "Tue May 21 23:47:37 2024"
> 
> ColMode(tmp2)
<pointer: 0x000001de556fe950>
> 
> 
> 
> ### Now testing assignments
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+ 
+   new.data <- rnorm(20)
+   tmp2[which.row,] <- new.data
+   test.matrix[which.row,] <- new.data
+   if (rep > 1){
+     if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+   
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   new.data <- rnorm(10)
+   tmp2[,which.col] <- new.data
+   test.matrix[,which.col]<- new.data
+ 
+   if (rep > 1){
+     if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.col <- which.col
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,5,replace=TRUE)
+   new.data <- matrix(rnorm(50),5,10)
+   tmp2[,which.col] <- new.data
+   test.matrix[,which.col]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.col <- which.col
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   new.data <- matrix(rnorm(50),5,10)
+   tmp2[which.row,] <- new.data
+   test.matrix[which.row,]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col  <- sample(1:20,5,replace=TRUE)
+   new.data <- matrix(rnorm(25),5,5)
+   tmp2[which.row,which.col] <- new.data
+   test.matrix[which.row,which.col]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[prev.row,prev.col] == test.matrix[prev.row,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+   prev.col <- which.col
+ }
> 
> 
> 
> 
> ###
> ###
> ### testing some more functions
> ###
> 
> 
> 
> ## duplication function
> tmp5 <- duplicate(tmp2)
> 
> # making sure really did copy everything.
> tmp5[1,1] <- tmp5[1,1] +100.00
> 
> if (tmp5[1,1] == tmp2[1,1]){
+   stop("Problem with duplication")
+ }
> 
> 
> 
> 
> ### testing elementwise applying of functions
> 
> tmp5[1:4,1:4]
           [,1]       [,2]       [,3]       [,4]
[1,] 100.172220 -0.0528543 -1.1108952  0.8181821
[2,]  -0.112033  0.2430282 -1.0332961  0.5764320
[3,]   2.389489 -0.9663995  0.3907871  0.4409474
[4,]   1.213411 -0.6618786 -2.6606043 -0.2885368
> ewApply(tmp5,abs)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    F:/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
           [,1]      [,2]      [,3]      [,4]
[1,] 100.172220 0.0528543 1.1108952 0.8181821
[2,]   0.112033 0.2430282 1.0332961 0.5764320
[3,]   2.389489 0.9663995 0.3907871 0.4409474
[4,]   1.213411 0.6618786 2.6606043 0.2885368
> ewApply(tmp5,sqrt)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    F:/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
           [,1]      [,2]      [,3]      [,4]
[1,] 10.0086073 0.2299006 1.0539901 0.9045342
[2,]  0.3347134 0.4929789 1.0165117 0.7592312
[3,]  1.5457973 0.9830562 0.6251297 0.6640387
[4,]  1.1015491 0.8135592 1.6311359 0.5371562
> 
> 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.19-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,] 225.25829 27.35186 36.65080 34.86352
[2,]  28.45917 30.17282 36.19841 33.16874
[3,]  42.84746 35.79696 31.64208 32.08133
[4,]  37.22890 33.79747 43.97196 30.66010
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x000001de556fe770>
> exp(tmp5)
<pointer: 0x000001de556fe770>
> log(tmp5,2)
<pointer: 0x000001de556fe770>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 468.8456
> Min(tmp5)
[1] 53.14271
> mean(tmp5)
[1] 73.05107
> Sum(tmp5)
[1] 14610.21
> Var(tmp5)
[1] 868.4023
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 87.99465 69.73377 72.11791 73.89919 71.96889 73.05314 68.36522 70.83934
 [9] 72.08333 70.45527
> rowSums(tmp5)
 [1] 1759.893 1394.675 1442.358 1477.984 1439.378 1461.063 1367.304 1416.787
 [9] 1441.667 1409.105
> rowVars(tmp5)
 [1] 8113.71856   45.66075   51.63128  100.44281   76.77598   99.35265
 [7]   98.88313  100.30620   66.37227   56.33345
> rowSd(tmp5)
 [1] 90.076182  6.757274  7.185491 10.022116  8.762191  9.967580  9.944000
 [8] 10.015298  8.146918  7.505561
> rowMax(tmp5)
 [1] 468.84563  83.24903  89.18138  91.52188  86.48529  89.26058  89.29757
 [8]  87.85461  85.32939  82.77957
> rowMin(tmp5)
 [1] 53.14271 59.23403 58.87028 58.21302 56.80950 55.95716 55.75782 56.36765
 [9] 55.34379 54.34722
> 
> colMeans(tmp5)
 [1] 109.00144  74.29979  72.70378  66.95501  70.42522  72.61210  69.63767
 [8]  74.14138  71.76394  70.41550  72.31571  67.56870  68.55147  70.87841
[15]  76.88682  68.07674  65.12716  74.45552  72.08127  73.12378
> colSums(tmp5)
 [1] 1090.0144  742.9979  727.0378  669.5501  704.2522  726.1210  696.3767
 [8]  741.4138  717.6394  704.1550  723.1571  675.6870  685.5147  708.7841
[15]  768.8682  680.7674  651.2716  744.5552  720.8127  731.2378
> colVars(tmp5)
 [1] 16091.22462   133.69227    79.95813    83.37170    91.87600    55.39146
 [7]    65.48480    99.95817   117.78264    59.09261    72.00353    50.82830
[13]    65.40884    55.08650    76.37580    32.53332    60.48034    77.92985
[19]    89.69532    53.68903
> colSd(tmp5)
 [1] 126.851191  11.562537   8.941931   9.130810   9.585197   7.442544
 [7]   8.092268   9.997908  10.852771   7.687172   8.485489   7.129397
[13]   8.087573   7.422028   8.739325   5.703799   7.776911   8.827789
[19]   9.470761   7.327280
> colMax(tmp5)
 [1] 468.84563  88.55664  91.52188  86.72412  87.73755  85.32484  80.71765
 [8]  89.29757  89.26058  80.00957  88.98232  80.72792  84.55026  84.17436
[15]  89.25569  75.64757  77.80789  88.43828  83.95742  83.24903
> colMin(tmp5)
 [1] 56.80950 56.92931 62.26801 55.34379 53.14271 62.36864 54.34722 58.87028
 [9] 56.36765 55.75782 63.79862 55.95716 54.56156 58.79520 63.06390 56.67692
[17] 53.29599 62.22697 58.97444 62.84202
> 
> 
> ### 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] 87.99465       NA 72.11791 73.89919 71.96889 73.05314 68.36522 70.83934
 [9] 72.08333 70.45527
> rowSums(tmp5)
 [1] 1759.893       NA 1442.358 1477.984 1439.378 1461.063 1367.304 1416.787
 [9] 1441.667 1409.105
> rowVars(tmp5)
 [1] 8113.71856   41.75040   51.63128  100.44281   76.77598   99.35265
 [7]   98.88313  100.30620   66.37227   56.33345
> rowSd(tmp5)
 [1] 90.076182  6.461455  7.185491 10.022116  8.762191  9.967580  9.944000
 [8] 10.015298  8.146918  7.505561
> rowMax(tmp5)
 [1] 468.84563        NA  89.18138  91.52188  86.48529  89.26058  89.29757
 [8]  87.85461  85.32939  82.77957
> rowMin(tmp5)
 [1] 53.14271       NA 58.87028 58.21302 56.80950 55.95716 55.75782 56.36765
 [9] 55.34379 54.34722
> 
> colMeans(tmp5)
 [1]       NA 74.29979 72.70378 66.95501 70.42522 72.61210 69.63767 74.14138
 [9] 71.76394 70.41550 72.31571 67.56870 68.55147 70.87841 76.88682 68.07674
[17] 65.12716 74.45552 72.08127 73.12378
> colSums(tmp5)
 [1]       NA 742.9979 727.0378 669.5501 704.2522 726.1210 696.3767 741.4138
 [9] 717.6394 704.1550 723.1571 675.6870 685.5147 708.7841 768.8682 680.7674
[17] 651.2716 744.5552 720.8127 731.2378
> colVars(tmp5)
 [1]        NA 133.69227  79.95813  83.37170  91.87600  55.39146  65.48480
 [8]  99.95817 117.78264  59.09261  72.00353  50.82830  65.40884  55.08650
[15]  76.37580  32.53332  60.48034  77.92985  89.69532  53.68903
> colSd(tmp5)
 [1]        NA 11.562537  8.941931  9.130810  9.585197  7.442544  8.092268
 [8]  9.997908 10.852771  7.687172  8.485489  7.129397  8.087573  7.422028
[15]  8.739325  5.703799  7.776911  8.827789  9.470761  7.327280
> colMax(tmp5)
 [1]       NA 88.55664 91.52188 86.72412 87.73755 85.32484 80.71765 89.29757
 [9] 89.26058 80.00957 88.98232 80.72792 84.55026 84.17436 89.25569 75.64757
[17] 77.80789 88.43828 83.95742 83.24903
> colMin(tmp5)
 [1]       NA 56.92931 62.26801 55.34379 53.14271 62.36864 54.34722 58.87028
 [9] 56.36765 55.75782 63.79862 55.95716 54.56156 58.79520 63.06390 56.67692
[17] 53.29599 62.22697 58.97444 62.84202
> 
> Max(tmp5,na.rm=TRUE)
[1] 468.8456
> Min(tmp5,na.rm=TRUE)
[1] 53.14271
> mean(tmp5,na.rm=TRUE)
[1] 73.1205
> Sum(tmp5,na.rm=TRUE)
[1] 14550.98
> Var(tmp5,na.rm=TRUE)
[1] 871.8192
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 87.99465 70.28639 72.11791 73.89919 71.96889 73.05314 68.36522 70.83934
 [9] 72.08333 70.45527
> rowSums(tmp5,na.rm=TRUE)
 [1] 1759.893 1335.441 1442.358 1477.984 1439.378 1461.063 1367.304 1416.787
 [9] 1441.667 1409.105
> rowVars(tmp5,na.rm=TRUE)
 [1] 8113.71856   41.75040   51.63128  100.44281   76.77598   99.35265
 [7]   98.88313  100.30620   66.37227   56.33345
> rowSd(tmp5,na.rm=TRUE)
 [1] 90.076182  6.461455  7.185491 10.022116  8.762191  9.967580  9.944000
 [8] 10.015298  8.146918  7.505561
> rowMax(tmp5,na.rm=TRUE)
 [1] 468.84563  83.24903  89.18138  91.52188  86.48529  89.26058  89.29757
 [8]  87.85461  85.32939  82.77957
> rowMin(tmp5,na.rm=TRUE)
 [1] 53.14271 61.97752 58.87028 58.21302 56.80950 55.95716 55.75782 56.36765
 [9] 55.34379 54.34722
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 114.53115  74.29979  72.70378  66.95501  70.42522  72.61210  69.63767
 [8]  74.14138  71.76394  70.41550  72.31571  67.56870  68.55147  70.87841
[15]  76.88682  68.07674  65.12716  74.45552  72.08127  73.12378
> colSums(tmp5,na.rm=TRUE)
 [1] 1030.7804  742.9979  727.0378  669.5501  704.2522  726.1210  696.3767
 [8]  741.4138  717.6394  704.1550  723.1571  675.6870  685.5147  708.7841
[15]  768.8682  680.7674  651.2716  744.5552  720.8127  731.2378
> colVars(tmp5,na.rm=TRUE)
 [1] 17758.62833   133.69227    79.95813    83.37170    91.87600    55.39146
 [7]    65.48480    99.95817   117.78264    59.09261    72.00353    50.82830
[13]    65.40884    55.08650    76.37580    32.53332    60.48034    77.92985
[19]    89.69532    53.68903
> colSd(tmp5,na.rm=TRUE)
 [1] 133.261504  11.562537   8.941931   9.130810   9.585197   7.442544
 [7]   8.092268   9.997908  10.852771   7.687172   8.485489   7.129397
[13]   8.087573   7.422028   8.739325   5.703799   7.776911   8.827789
[19]   9.470761   7.327280
> colMax(tmp5,na.rm=TRUE)
 [1] 468.84563  88.55664  91.52188  86.72412  87.73755  85.32484  80.71765
 [8]  89.29757  89.26058  80.00957  88.98232  80.72792  84.55026  84.17436
[15]  89.25569  75.64757  77.80789  88.43828  83.95742  83.24903
> colMin(tmp5,na.rm=TRUE)
 [1] 56.80950 56.92931 62.26801 55.34379 53.14271 62.36864 54.34722 58.87028
 [9] 56.36765 55.75782 63.79862 55.95716 54.56156 58.79520 63.06390 56.67692
[17] 53.29599 62.22697 58.97444 62.84202
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1] 87.99465      NaN 72.11791 73.89919 71.96889 73.05314 68.36522 70.83934
 [9] 72.08333 70.45527
> rowSums(tmp5,na.rm=TRUE)
 [1] 1759.893    0.000 1442.358 1477.984 1439.378 1461.063 1367.304 1416.787
 [9] 1441.667 1409.105
> rowVars(tmp5,na.rm=TRUE)
 [1] 8113.71856         NA   51.63128  100.44281   76.77598   99.35265
 [7]   98.88313  100.30620   66.37227   56.33345
> rowSd(tmp5,na.rm=TRUE)
 [1] 90.076182        NA  7.185491 10.022116  8.762191  9.967580  9.944000
 [8] 10.015298  8.146918  7.505561
> rowMax(tmp5,na.rm=TRUE)
 [1] 468.84563        NA  89.18138  91.52188  86.48529  89.26058  89.29757
 [8]  87.85461  85.32939  82.77957
> rowMin(tmp5,na.rm=TRUE)
 [1] 53.14271       NA 58.87028 58.21302 56.80950 55.95716 55.75782 56.36765
 [9] 55.34379 54.34722
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1]      NaN 75.57746 72.41062 66.72374 71.36386 72.47979 69.25135 73.23078
 [9] 72.24773 69.57905 72.83994 67.12024 67.99260 70.73035 78.42270 68.65456
[17] 65.28746 75.39800 72.55307 71.99875
> colSums(tmp5,na.rm=TRUE)
 [1]   0.0000 680.1971 651.6956 600.5137 642.2747 652.3181 623.2622 659.0770
 [9] 650.2295 626.2114 655.5594 604.0822 611.9334 636.5731 705.8043 617.8910
[17] 587.5872 678.5820 652.9776 647.9887
> colVars(tmp5,na.rm=TRUE)
 [1]        NA 132.03886  88.98602  93.19147  93.44887  62.11842  71.99145
 [8] 103.12457 129.87245  58.60808  77.91234  54.91931  70.07123  61.72570
[15]  59.38483  32.84391  67.75127  77.67816  98.40311  46.16117
> colSd(tmp5,na.rm=TRUE)
 [1]        NA 11.490817  9.433240  9.653573  9.666896  7.881524  8.484778
 [8] 10.155027 11.396159  7.655592  8.826797  7.410757  8.370856  7.856571
[15]  7.706155  5.730960  8.231116  8.813522  9.919834  6.794201
> colMax(tmp5,na.rm=TRUE)
 [1]     -Inf 88.55664 91.52188 86.72412 87.73755 85.32484 80.71765 89.29757
 [9] 89.26058 80.00957 88.98232 80.72792 84.55026 84.17436 89.25569 75.64757
[17] 77.80789 88.43828 83.95742 80.57576
> colMin(tmp5,na.rm=TRUE)
 [1]      Inf 56.92931 62.26801 55.34379 53.14271 62.36864 54.34722 58.87028
 [9] 56.36765 55.75782 63.79862 55.95716 54.56156 58.79520 67.00258 56.67692
[17] 53.29599 62.22697 58.97444 62.84202
> 
> 
> 
> 
> 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]  84.35834 225.64069 270.71837 349.72262 177.31498 231.29623 189.01976
 [8] 151.09925 221.11328 118.50822
> apply(copymatrix,1,var,na.rm=TRUE)
 [1]  84.35834 225.64069 270.71837 349.72262 177.31498 231.29623 189.01976
 [8] 151.09925 221.11328 118.50822
> 
> 
> 
> copymatrix <- matrix(rnorm(200,150,15),10,20)
> 
> tmp5[1:10,1:20] <- copymatrix
> which.row <- 1
> which.col  <- 3
> cat(which.row," ",which.col,"\n")
1   3 
> tmp5[which.row,which.col] <- NA
> copymatrix[which.row,which.col] <- NA
> 
> colVars(tmp5,na.rm=TRUE)-apply(copymatrix,2,var,na.rm=TRUE)
 [1]  0.000000e+00 -5.684342e-14 -2.842171e-14 -1.421085e-13  2.842171e-14
 [6] -2.273737e-13  2.842171e-14  4.547474e-13 -5.684342e-14  0.000000e+00
[11] -1.136868e-13  2.842171e-14 -5.684342e-14  1.705303e-13  5.684342e-14
[16] -2.273737e-13 -8.526513e-14  2.842171e-14 -5.684342e-14  1.136868e-13
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> ## making sure these things agree
> ##
> ## first when there is no NA
> 
> 
> 
> agree.checks <- function(buff.matrix,r.matrix,err.tol=1e-10){
+ 
+   if (Max(buff.matrix,na.rm=TRUE) != max(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Max")
+   }
+   
+ 
+   if (Min(buff.matrix,na.rm=TRUE) != min(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Min")
+   }
+ 
+ 
+   if (abs(Sum(buff.matrix,na.rm=TRUE)- sum(r.matrix,na.rm=TRUE)) > err.tol){
+ 
+     cat(Sum(buff.matrix,na.rm=TRUE),"\n")
+     cat(sum(r.matrix,na.rm=TRUE),"\n")
+     cat(Sum(buff.matrix,na.rm=TRUE) - sum(r.matrix,na.rm=TRUE),"\n")
+     
+     stop("No agreement in Sum")
+   }
+   
+   if (abs(mean(buff.matrix,na.rm=TRUE) - mean(r.matrix,na.rm=TRUE)) > err.tol){
+     stop("No agreement in mean")
+   }
+   
+   
+   if(abs(Var(buff.matrix,na.rm=TRUE) - var(as.vector(r.matrix),na.rm=TRUE)) > err.tol){
+     stop("No agreement in Var")
+   }
+   
+   
+ 
+   if(any(abs(rowMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,mean,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowMeans")
+   }
+   
+   
+   if(any(abs(colMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,mean,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colMeans")
+   }
+   
+   
+   if(any(abs(rowSums(buff.matrix,na.rm=TRUE)  -  apply(r.matrix,1,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in rowSums")
+   }
+   
+   
+   if(any(abs(colSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colSums")
+   }
+   
+   ### this is to get around the fact that R doesn't like to compute NA on an entire vector of NA when 
+   ### computing variance
+   my.Var <- function(x,na.rm=FALSE){
+    if (all(is.na(x))){
+      return(NA)
+    } else {
+      var(x,na.rm=na.rm)
+    }
+ 
+   }
+   
+   if(any(abs(rowVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+   
+   
+   if(any(abs(colVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+ 
+ 
+   if(any(abs(rowMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+ 
+   if(any(abs(colMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+   
+   
+   if(any(abs(rowMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+   
+ 
+   if(any(abs(colMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+ 
+   if(any(abs(colMedians(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,median,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMedian")
+   }
+ 
+   if(any(abs(colRanges(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,range,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colRanges")
+   }
+ 
+ 
+   
+ }
> 
> 
> 
> 
> 
> 
> 
> 
> 
> for (rep in 1:20){
+   copymatrix <- matrix(rnorm(200,150,15),10,20)
+   
+   tmp5[1:10,1:20] <- copymatrix
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ## now lets assign some NA values and check agreement
+ 
+   which.row <- sample(1:10,1,replace=TRUE)
+   which.col  <- sample(1:20,1,replace=TRUE)
+   
+   cat(which.row," ",which.col,"\n")
+   
+   tmp5[which.row,which.col] <- NA
+   copymatrix[which.row,which.col] <- NA
+   
+   agree.checks(tmp5,copymatrix)
+ 
+   ## make an entire row NA
+   tmp5[which.row,] <- NA
+   copymatrix[which.row,] <- NA
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ### also make an entire col NA
+   tmp5[,which.col] <- NA
+   copymatrix[,which.col] <- NA
+ 
+   agree.checks(tmp5,copymatrix)
+ 
+   ### now make 1 element non NA with NA in the rest of row and column
+ 
+   tmp5[which.row,which.col] <- rnorm(1,150,15)
+   copymatrix[which.row,which.col] <- tmp5[which.row,which.col]
+ 
+   agree.checks(tmp5,copymatrix)
+ }
6   11 
7   13 
9   16 
2   15 
2   16 
7   14 
2   15 
5   19 
1   15 
3   6 
6   20 
7   1 
5   8 
1   20 
9   12 
9   15 
1   19 
5   19 
4   17 
10   3 
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.477246
> Min(tmp)
[1] -3.117192
> mean(tmp)
[1] -0.1032401
> Sum(tmp)
[1] -10.32401
> Var(tmp)
[1] 1.037865
> 
> rowMeans(tmp)
[1] -0.1032401
> rowSums(tmp)
[1] -10.32401
> rowVars(tmp)
[1] 1.037865
> rowSd(tmp)
[1] 1.018756
> rowMax(tmp)
[1] 2.477246
> rowMin(tmp)
[1] -3.117192
> 
> colMeans(tmp)
  [1]  0.301853408 -1.557572627  2.477246339  0.873138554  0.671134344
  [6]  0.039411799  0.697057006 -0.722300504  0.299063030  1.796884908
 [11]  0.027202845 -0.145809683  0.405989223 -0.845336030 -0.003927448
 [16]  0.128227348  0.531392272 -0.274092299 -1.741937299 -0.881879105
 [21]  0.648731617  0.535872112 -0.285177996  1.295239757  0.121308002
 [26] -1.173842296  0.044887619  0.459567880 -0.898810921 -1.083111946
 [31] -0.498250995 -0.172206993  0.462251546 -0.254505697 -0.553797848
 [36]  0.060598428  1.214722132  2.045257698  0.727190308  0.923009693
 [41]  0.415856628  0.676037950 -0.272495592 -0.602548437 -1.076828018
 [46]  0.658678709  0.088481965 -0.617680513  1.493171212 -3.117192180
 [51] -0.530773109  0.483216078 -1.331416342 -1.781277671 -1.006616541
 [56] -0.971365482 -0.477833103 -0.630473774  0.763631104 -0.488176140
 [61]  0.309402015  1.329777505 -2.178704245  0.473664834  0.377856277
 [66] -1.294480666  0.572859492 -0.504179367  0.119753054 -1.326522768
 [71]  0.590632058 -0.648885765  0.087670982  0.025707236  1.533916955
 [76]  0.718324669 -2.189889062 -0.297017252  0.586787819  0.825366883
 [81] -0.468687198 -0.122447352 -0.874875447 -1.803431625  0.415118487
 [86]  0.024125433  0.200337468 -1.684822302 -1.692788794  0.907937171
 [91] -1.322242599  0.080754032 -0.520434529 -2.642298395 -0.153160186
 [96]  0.117132123 -0.089473903  1.563004898  1.826445549 -0.565317871
> colSums(tmp)
  [1]  0.301853408 -1.557572627  2.477246339  0.873138554  0.671134344
  [6]  0.039411799  0.697057006 -0.722300504  0.299063030  1.796884908
 [11]  0.027202845 -0.145809683  0.405989223 -0.845336030 -0.003927448
 [16]  0.128227348  0.531392272 -0.274092299 -1.741937299 -0.881879105
 [21]  0.648731617  0.535872112 -0.285177996  1.295239757  0.121308002
 [26] -1.173842296  0.044887619  0.459567880 -0.898810921 -1.083111946
 [31] -0.498250995 -0.172206993  0.462251546 -0.254505697 -0.553797848
 [36]  0.060598428  1.214722132  2.045257698  0.727190308  0.923009693
 [41]  0.415856628  0.676037950 -0.272495592 -0.602548437 -1.076828018
 [46]  0.658678709  0.088481965 -0.617680513  1.493171212 -3.117192180
 [51] -0.530773109  0.483216078 -1.331416342 -1.781277671 -1.006616541
 [56] -0.971365482 -0.477833103 -0.630473774  0.763631104 -0.488176140
 [61]  0.309402015  1.329777505 -2.178704245  0.473664834  0.377856277
 [66] -1.294480666  0.572859492 -0.504179367  0.119753054 -1.326522768
 [71]  0.590632058 -0.648885765  0.087670982  0.025707236  1.533916955
 [76]  0.718324669 -2.189889062 -0.297017252  0.586787819  0.825366883
 [81] -0.468687198 -0.122447352 -0.874875447 -1.803431625  0.415118487
 [86]  0.024125433  0.200337468 -1.684822302 -1.692788794  0.907937171
 [91] -1.322242599  0.080754032 -0.520434529 -2.642298395 -0.153160186
 [96]  0.117132123 -0.089473903  1.563004898  1.826445549 -0.565317871
> 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.301853408 -1.557572627  2.477246339  0.873138554  0.671134344
  [6]  0.039411799  0.697057006 -0.722300504  0.299063030  1.796884908
 [11]  0.027202845 -0.145809683  0.405989223 -0.845336030 -0.003927448
 [16]  0.128227348  0.531392272 -0.274092299 -1.741937299 -0.881879105
 [21]  0.648731617  0.535872112 -0.285177996  1.295239757  0.121308002
 [26] -1.173842296  0.044887619  0.459567880 -0.898810921 -1.083111946
 [31] -0.498250995 -0.172206993  0.462251546 -0.254505697 -0.553797848
 [36]  0.060598428  1.214722132  2.045257698  0.727190308  0.923009693
 [41]  0.415856628  0.676037950 -0.272495592 -0.602548437 -1.076828018
 [46]  0.658678709  0.088481965 -0.617680513  1.493171212 -3.117192180
 [51] -0.530773109  0.483216078 -1.331416342 -1.781277671 -1.006616541
 [56] -0.971365482 -0.477833103 -0.630473774  0.763631104 -0.488176140
 [61]  0.309402015  1.329777505 -2.178704245  0.473664834  0.377856277
 [66] -1.294480666  0.572859492 -0.504179367  0.119753054 -1.326522768
 [71]  0.590632058 -0.648885765  0.087670982  0.025707236  1.533916955
 [76]  0.718324669 -2.189889062 -0.297017252  0.586787819  0.825366883
 [81] -0.468687198 -0.122447352 -0.874875447 -1.803431625  0.415118487
 [86]  0.024125433  0.200337468 -1.684822302 -1.692788794  0.907937171
 [91] -1.322242599  0.080754032 -0.520434529 -2.642298395 -0.153160186
 [96]  0.117132123 -0.089473903  1.563004898  1.826445549 -0.565317871
> colMin(tmp)
  [1]  0.301853408 -1.557572627  2.477246339  0.873138554  0.671134344
  [6]  0.039411799  0.697057006 -0.722300504  0.299063030  1.796884908
 [11]  0.027202845 -0.145809683  0.405989223 -0.845336030 -0.003927448
 [16]  0.128227348  0.531392272 -0.274092299 -1.741937299 -0.881879105
 [21]  0.648731617  0.535872112 -0.285177996  1.295239757  0.121308002
 [26] -1.173842296  0.044887619  0.459567880 -0.898810921 -1.083111946
 [31] -0.498250995 -0.172206993  0.462251546 -0.254505697 -0.553797848
 [36]  0.060598428  1.214722132  2.045257698  0.727190308  0.923009693
 [41]  0.415856628  0.676037950 -0.272495592 -0.602548437 -1.076828018
 [46]  0.658678709  0.088481965 -0.617680513  1.493171212 -3.117192180
 [51] -0.530773109  0.483216078 -1.331416342 -1.781277671 -1.006616541
 [56] -0.971365482 -0.477833103 -0.630473774  0.763631104 -0.488176140
 [61]  0.309402015  1.329777505 -2.178704245  0.473664834  0.377856277
 [66] -1.294480666  0.572859492 -0.504179367  0.119753054 -1.326522768
 [71]  0.590632058 -0.648885765  0.087670982  0.025707236  1.533916955
 [76]  0.718324669 -2.189889062 -0.297017252  0.586787819  0.825366883
 [81] -0.468687198 -0.122447352 -0.874875447 -1.803431625  0.415118487
 [86]  0.024125433  0.200337468 -1.684822302 -1.692788794  0.907937171
 [91] -1.322242599  0.080754032 -0.520434529 -2.642298395 -0.153160186
 [96]  0.117132123 -0.089473903  1.563004898  1.826445549 -0.565317871
> colMedians(tmp)
  [1]  0.301853408 -1.557572627  2.477246339  0.873138554  0.671134344
  [6]  0.039411799  0.697057006 -0.722300504  0.299063030  1.796884908
 [11]  0.027202845 -0.145809683  0.405989223 -0.845336030 -0.003927448
 [16]  0.128227348  0.531392272 -0.274092299 -1.741937299 -0.881879105
 [21]  0.648731617  0.535872112 -0.285177996  1.295239757  0.121308002
 [26] -1.173842296  0.044887619  0.459567880 -0.898810921 -1.083111946
 [31] -0.498250995 -0.172206993  0.462251546 -0.254505697 -0.553797848
 [36]  0.060598428  1.214722132  2.045257698  0.727190308  0.923009693
 [41]  0.415856628  0.676037950 -0.272495592 -0.602548437 -1.076828018
 [46]  0.658678709  0.088481965 -0.617680513  1.493171212 -3.117192180
 [51] -0.530773109  0.483216078 -1.331416342 -1.781277671 -1.006616541
 [56] -0.971365482 -0.477833103 -0.630473774  0.763631104 -0.488176140
 [61]  0.309402015  1.329777505 -2.178704245  0.473664834  0.377856277
 [66] -1.294480666  0.572859492 -0.504179367  0.119753054 -1.326522768
 [71]  0.590632058 -0.648885765  0.087670982  0.025707236  1.533916955
 [76]  0.718324669 -2.189889062 -0.297017252  0.586787819  0.825366883
 [81] -0.468687198 -0.122447352 -0.874875447 -1.803431625  0.415118487
 [86]  0.024125433  0.200337468 -1.684822302 -1.692788794  0.907937171
 [91] -1.322242599  0.080754032 -0.520434529 -2.642298395 -0.153160186
 [96]  0.117132123 -0.089473903  1.563004898  1.826445549 -0.565317871
> colRanges(tmp)
          [,1]      [,2]     [,3]      [,4]      [,5]      [,6]     [,7]
[1,] 0.3018534 -1.557573 2.477246 0.8731386 0.6711343 0.0394118 0.697057
[2,] 0.3018534 -1.557573 2.477246 0.8731386 0.6711343 0.0394118 0.697057
           [,8]     [,9]    [,10]      [,11]      [,12]     [,13]     [,14]
[1,] -0.7223005 0.299063 1.796885 0.02720285 -0.1458097 0.4059892 -0.845336
[2,] -0.7223005 0.299063 1.796885 0.02720285 -0.1458097 0.4059892 -0.845336
            [,15]     [,16]     [,17]      [,18]     [,19]      [,20]     [,21]
[1,] -0.003927448 0.1282273 0.5313923 -0.2740923 -1.741937 -0.8818791 0.6487316
[2,] -0.003927448 0.1282273 0.5313923 -0.2740923 -1.741937 -0.8818791 0.6487316
         [,22]     [,23]   [,24]    [,25]     [,26]      [,27]     [,28]
[1,] 0.5358721 -0.285178 1.29524 0.121308 -1.173842 0.04488762 0.4595679
[2,] 0.5358721 -0.285178 1.29524 0.121308 -1.173842 0.04488762 0.4595679
          [,29]     [,30]     [,31]     [,32]     [,33]      [,34]      [,35]
[1,] -0.8988109 -1.083112 -0.498251 -0.172207 0.4622515 -0.2545057 -0.5537978
[2,] -0.8988109 -1.083112 -0.498251 -0.172207 0.4622515 -0.2545057 -0.5537978
          [,36]    [,37]    [,38]     [,39]     [,40]     [,41]    [,42]
[1,] 0.06059843 1.214722 2.045258 0.7271903 0.9230097 0.4158566 0.676038
[2,] 0.06059843 1.214722 2.045258 0.7271903 0.9230097 0.4158566 0.676038
          [,43]      [,44]     [,45]     [,46]      [,47]      [,48]    [,49]
[1,] -0.2724956 -0.6025484 -1.076828 0.6586787 0.08848196 -0.6176805 1.493171
[2,] -0.2724956 -0.6025484 -1.076828 0.6586787 0.08848196 -0.6176805 1.493171
         [,50]      [,51]     [,52]     [,53]     [,54]     [,55]      [,56]
[1,] -3.117192 -0.5307731 0.4832161 -1.331416 -1.781278 -1.006617 -0.9713655
[2,] -3.117192 -0.5307731 0.4832161 -1.331416 -1.781278 -1.006617 -0.9713655
          [,57]      [,58]     [,59]      [,60]    [,61]    [,62]     [,63]
[1,] -0.4778331 -0.6304738 0.7636311 -0.4881761 0.309402 1.329778 -2.178704
[2,] -0.4778331 -0.6304738 0.7636311 -0.4881761 0.309402 1.329778 -2.178704
         [,64]     [,65]     [,66]     [,67]      [,68]     [,69]     [,70]
[1,] 0.4736648 0.3778563 -1.294481 0.5728595 -0.5041794 0.1197531 -1.326523
[2,] 0.4736648 0.3778563 -1.294481 0.5728595 -0.5041794 0.1197531 -1.326523
         [,71]      [,72]      [,73]      [,74]    [,75]     [,76]     [,77]
[1,] 0.5906321 -0.6488858 0.08767098 0.02570724 1.533917 0.7183247 -2.189889
[2,] 0.5906321 -0.6488858 0.08767098 0.02570724 1.533917 0.7183247 -2.189889
          [,78]     [,79]     [,80]      [,81]      [,82]      [,83]     [,84]
[1,] -0.2970173 0.5867878 0.8253669 -0.4686872 -0.1224474 -0.8748754 -1.803432
[2,] -0.2970173 0.5867878 0.8253669 -0.4686872 -0.1224474 -0.8748754 -1.803432
         [,85]      [,86]     [,87]     [,88]     [,89]     [,90]     [,91]
[1,] 0.4151185 0.02412543 0.2003375 -1.684822 -1.692789 0.9079372 -1.322243
[2,] 0.4151185 0.02412543 0.2003375 -1.684822 -1.692789 0.9079372 -1.322243
          [,92]      [,93]     [,94]      [,95]     [,96]      [,97]    [,98]
[1,] 0.08075403 -0.5204345 -2.642298 -0.1531602 0.1171321 -0.0894739 1.563005
[2,] 0.08075403 -0.5204345 -2.642298 -0.1531602 0.1171321 -0.0894739 1.563005
        [,99]     [,100]
[1,] 1.826446 -0.5653179
[2,] 1.826446 -0.5653179
> 
> 
> Max(tmp2)
[1] 2.137673
> Min(tmp2)
[1] -1.825151
> mean(tmp2)
[1] -0.01060469
> Sum(tmp2)
[1] -1.060469
> Var(tmp2)
[1] 0.7860301
> 
> rowMeans(tmp2)
  [1]  0.555826169  0.655715668  0.167385560  0.452889024 -0.157935202
  [6]  0.107401338 -0.849236463  1.005558022  0.704555214 -1.683946337
 [11] -1.705727950 -0.137861318 -0.160164241 -0.745389141  1.097964306
 [16]  2.137673208 -0.682896967  0.018776076  0.267436881 -0.604896567
 [21]  0.318977178  0.299966778 -0.081529422  0.346816948  0.284906979
 [26] -0.430411743 -1.729979849 -0.309768436  0.105561404 -0.336260807
 [31]  1.433837099 -0.576573842  0.435230944  0.963118827 -0.573655641
 [36]  0.476313075 -0.369246857  1.542599858 -0.398198709 -0.403983870
 [41] -1.824590162  1.687605021  0.952724491 -0.451478765 -0.081864189
 [46]  0.477686289  0.574971627  0.737493344  0.951450164  1.667631986
 [51]  0.076969463 -0.448289839  0.582947929  1.108278088  0.016930289
 [56]  0.217645348  0.656586182 -1.184028458  0.575406296 -1.236047338
 [61] -0.056925689  2.082638218  0.921501330  0.565657211 -0.965576997
 [66] -1.170940981  0.358747812  0.004932476  0.720206633 -0.259010133
 [71] -0.958226223 -1.152360453 -0.409852252 -0.351794336 -0.193744240
 [76]  0.177042624  0.401686477 -0.578258036  1.509025656 -1.498116749
 [81] -0.820158252  0.221429276  0.725514925 -1.825150616 -0.236284785
 [86] -1.037215509  0.163568294 -0.857491838  0.919934238 -0.900183978
 [91] -1.448781960  0.043427215  0.113006366  1.521766241 -1.057781504
 [96] -0.580281636 -1.599992225  0.511967856 -0.033388070 -0.529879923
> rowSums(tmp2)
  [1]  0.555826169  0.655715668  0.167385560  0.452889024 -0.157935202
  [6]  0.107401338 -0.849236463  1.005558022  0.704555214 -1.683946337
 [11] -1.705727950 -0.137861318 -0.160164241 -0.745389141  1.097964306
 [16]  2.137673208 -0.682896967  0.018776076  0.267436881 -0.604896567
 [21]  0.318977178  0.299966778 -0.081529422  0.346816948  0.284906979
 [26] -0.430411743 -1.729979849 -0.309768436  0.105561404 -0.336260807
 [31]  1.433837099 -0.576573842  0.435230944  0.963118827 -0.573655641
 [36]  0.476313075 -0.369246857  1.542599858 -0.398198709 -0.403983870
 [41] -1.824590162  1.687605021  0.952724491 -0.451478765 -0.081864189
 [46]  0.477686289  0.574971627  0.737493344  0.951450164  1.667631986
 [51]  0.076969463 -0.448289839  0.582947929  1.108278088  0.016930289
 [56]  0.217645348  0.656586182 -1.184028458  0.575406296 -1.236047338
 [61] -0.056925689  2.082638218  0.921501330  0.565657211 -0.965576997
 [66] -1.170940981  0.358747812  0.004932476  0.720206633 -0.259010133
 [71] -0.958226223 -1.152360453 -0.409852252 -0.351794336 -0.193744240
 [76]  0.177042624  0.401686477 -0.578258036  1.509025656 -1.498116749
 [81] -0.820158252  0.221429276  0.725514925 -1.825150616 -0.236284785
 [86] -1.037215509  0.163568294 -0.857491838  0.919934238 -0.900183978
 [91] -1.448781960  0.043427215  0.113006366  1.521766241 -1.057781504
 [96] -0.580281636 -1.599992225  0.511967856 -0.033388070 -0.529879923
> rowVars(tmp2)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowSd(tmp2)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowMax(tmp2)
  [1]  0.555826169  0.655715668  0.167385560  0.452889024 -0.157935202
  [6]  0.107401338 -0.849236463  1.005558022  0.704555214 -1.683946337
 [11] -1.705727950 -0.137861318 -0.160164241 -0.745389141  1.097964306
 [16]  2.137673208 -0.682896967  0.018776076  0.267436881 -0.604896567
 [21]  0.318977178  0.299966778 -0.081529422  0.346816948  0.284906979
 [26] -0.430411743 -1.729979849 -0.309768436  0.105561404 -0.336260807
 [31]  1.433837099 -0.576573842  0.435230944  0.963118827 -0.573655641
 [36]  0.476313075 -0.369246857  1.542599858 -0.398198709 -0.403983870
 [41] -1.824590162  1.687605021  0.952724491 -0.451478765 -0.081864189
 [46]  0.477686289  0.574971627  0.737493344  0.951450164  1.667631986
 [51]  0.076969463 -0.448289839  0.582947929  1.108278088  0.016930289
 [56]  0.217645348  0.656586182 -1.184028458  0.575406296 -1.236047338
 [61] -0.056925689  2.082638218  0.921501330  0.565657211 -0.965576997
 [66] -1.170940981  0.358747812  0.004932476  0.720206633 -0.259010133
 [71] -0.958226223 -1.152360453 -0.409852252 -0.351794336 -0.193744240
 [76]  0.177042624  0.401686477 -0.578258036  1.509025656 -1.498116749
 [81] -0.820158252  0.221429276  0.725514925 -1.825150616 -0.236284785
 [86] -1.037215509  0.163568294 -0.857491838  0.919934238 -0.900183978
 [91] -1.448781960  0.043427215  0.113006366  1.521766241 -1.057781504
 [96] -0.580281636 -1.599992225  0.511967856 -0.033388070 -0.529879923
> rowMin(tmp2)
  [1]  0.555826169  0.655715668  0.167385560  0.452889024 -0.157935202
  [6]  0.107401338 -0.849236463  1.005558022  0.704555214 -1.683946337
 [11] -1.705727950 -0.137861318 -0.160164241 -0.745389141  1.097964306
 [16]  2.137673208 -0.682896967  0.018776076  0.267436881 -0.604896567
 [21]  0.318977178  0.299966778 -0.081529422  0.346816948  0.284906979
 [26] -0.430411743 -1.729979849 -0.309768436  0.105561404 -0.336260807
 [31]  1.433837099 -0.576573842  0.435230944  0.963118827 -0.573655641
 [36]  0.476313075 -0.369246857  1.542599858 -0.398198709 -0.403983870
 [41] -1.824590162  1.687605021  0.952724491 -0.451478765 -0.081864189
 [46]  0.477686289  0.574971627  0.737493344  0.951450164  1.667631986
 [51]  0.076969463 -0.448289839  0.582947929  1.108278088  0.016930289
 [56]  0.217645348  0.656586182 -1.184028458  0.575406296 -1.236047338
 [61] -0.056925689  2.082638218  0.921501330  0.565657211 -0.965576997
 [66] -1.170940981  0.358747812  0.004932476  0.720206633 -0.259010133
 [71] -0.958226223 -1.152360453 -0.409852252 -0.351794336 -0.193744240
 [76]  0.177042624  0.401686477 -0.578258036  1.509025656 -1.498116749
 [81] -0.820158252  0.221429276  0.725514925 -1.825150616 -0.236284785
 [86] -1.037215509  0.163568294 -0.857491838  0.919934238 -0.900183978
 [91] -1.448781960  0.043427215  0.113006366  1.521766241 -1.057781504
 [96] -0.580281636 -1.599992225  0.511967856 -0.033388070 -0.529879923
> 
> colMeans(tmp2)
[1] -0.01060469
> colSums(tmp2)
[1] -1.060469
> colVars(tmp2)
[1] 0.7860301
> colSd(tmp2)
[1] 0.8865834
> colMax(tmp2)
[1] 2.137673
> colMin(tmp2)
[1] -1.825151
> colMedians(tmp2)
[1] 0.01785318
> colRanges(tmp2)
          [,1]
[1,] -1.825151
[2,]  2.137673
> 
> 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] -4.701640  2.801637 -1.896186 -2.215110 -1.992015 -4.166101 -2.389509
 [8]  3.998704  1.606308  1.602793
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -2.0853871
[2,] -0.8715843
[3,] -0.6368444
[4,]  0.1865089
[5,]  0.8062253
> 
> rowApply(tmp,sum)
 [1] -5.0178355  0.4983606 -1.6950619  1.5463142  1.1236288 -2.9982409
 [7] -5.6820776  0.9544270  3.4558900  0.4634752
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    9    2    2    3    7    7    1    4    1     5
 [2,]   10   10    8    1    4    3    7    3   10    10
 [3,]    2    8    1    5    6   10    5    5    2     9
 [4,]    4    9    7    2   10    4    8    1    5     2
 [5,]    7    3    3    6    5    2    4    8    7     1
 [6,]    1    4    5   10    3    1    9    2    3     4
 [7,]    3    6   10    9    1    9    2    7    4     3
 [8,]    8    1    9    4    8    8   10    6    6     8
 [9,]    5    7    6    7    2    5    6   10    9     6
[10,]    6    5    4    8    9    6    3    9    8     7
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1]  2.2561458  1.1296196 -1.0401881 -2.0790577  2.6738504 -1.4106353
 [7] -2.9667195  0.9339818  0.5422532  1.1257038 -2.0902557  2.8652010
[13] -1.5910098  1.1251998  1.1083483 -0.1079099 -0.5998268  2.9572082
[19]  3.6151997  3.5168000
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -0.8474953
[2,] -0.2993028
[3,]  0.1182507
[4,]  1.3883586
[5,]  1.8963345
> 
> rowApply(tmp,sum)
[1]  3.5133486  0.4701891  0.7438402  8.0952611 -0.8587304
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]    9   20   17    3    8
[2,]    4   11   20   18    1
[3,]   12   16    7    1   13
[4,]   17    4   11    2    3
[5,]    7   13   16   17   11
> 
> 
> as.matrix(tmp)
           [,1]       [,2]       [,3]       [,4]        [,5]        [,6]
[1,]  0.1182507 -1.1887635  0.3461946  0.8563335 -0.04357084 -0.27254490
[2,]  1.8963345 -0.0642375  0.7261951 -0.9759589  0.34760490 -0.67597838
[3,]  1.3883586  2.1886170 -0.5742011 -0.1276559  0.89973549 -0.93909023
[4,] -0.8474953  1.8697498 -1.6460207 -0.8541956  1.63928591  0.03747455
[5,] -0.2993028 -1.6757462  0.1076440 -0.9775809 -0.16920510  0.43950367
           [,7]       [,8]       [,9]      [,10]       [,11]      [,12]
[1,]  0.1659602  0.1562272 -0.6134565 -1.2722188 -1.27217698  0.7302127
[2,] -1.6814286  0.2052167 -1.0151428  1.8099922 -0.24123679 -1.2894492
[3,] -1.9709766 -0.1796190  0.1501408  0.1295956 -1.13632903  1.4294185
[4,]  0.8926632 -0.2956842  2.2317099  0.0643364  0.62900765  0.4238938
[5,] -0.3729376  1.0478411 -0.2109982  0.3939984 -0.06952052  1.5711251
          [,13]       [,14]       [,15]      [,16]      [,17]      [,18]
[1,]  0.7196761  0.61716899  0.09789775  1.5230640  0.3824173  2.1667586
[2,] -0.4011362 -0.75592299  1.82417320  0.7744499  0.4816434 -0.2876937
[3,] -0.6629793 -0.01889192 -0.41633760 -0.7169744 -1.1919044 -0.4270892
[4,] -0.1496005  0.67775928 -0.16036928 -0.7288705  0.4799254  0.3250912
[5,] -1.0969699  0.60508640 -0.23701577 -0.9595789 -0.7519084  1.1801414
          [,19]      [,20]
[1,]  1.7303266 -1.4344081
[2,]  0.6010332 -0.8082689
[3,]  0.7470163  2.1730067
[4,]  1.3507544  2.1558457
[5,] -0.8139308  1.4306247
> 
> 
> 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.19-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.19-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.19-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.19-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 -1.040713 0.5986861 -1.04206 0.03538356 -2.033063 1.035285 -0.7745909
           col8      col9     col10      col11      col12    col13     col14
row1 -0.3937599 -0.950935 -1.218336 -0.2567564 -0.4995077 1.116039 -2.224827
          col15     col16      col17    col18      col19     col20
row1 -0.8567434 -1.509992 -0.1352556 1.257642 -0.6643453 0.5426464
> tmp[,"col10"]
          col10
row1 -1.2183361
row2  0.7627836
row3 -1.0002728
row4 -0.2956728
row5 -0.4806786
> tmp[c("row1","row5"),]
           col1      col2       col3       col4      col5       col6       col7
row1 -1.0407134 0.5986861 -1.0420605 0.03538356 -2.033063  1.0352849 -0.7745909
row5 -0.2891099 1.8778922 -0.3276161 0.08726515  0.848575 -0.1577214  1.3391030
           col8       col9      col10      col11      col12      col13
row1 -0.3937599 -0.9509350 -1.2183361 -0.2567564 -0.4995077  1.1160393
row5 -1.6080233  0.3186714 -0.4806786 -0.0180851 -0.4881255 -0.1011651
          col14      col15       col16      col17     col18      col19
row1 -2.2248270 -0.8567434 -1.50999192 -0.1352556 1.2576416 -0.6643453
row5  0.9425219  0.9056917  0.09033015  0.6673224 0.1266486 -2.8415306
          col20
row1  0.5426464
row5 -0.5209129
> tmp[,c("col6","col20")]
           col6       col20
row1  1.0352849  0.54264636
row2 -0.7616361  1.12485522
row3 -0.2133725  1.96432360
row4  0.8540924  0.06839847
row5 -0.1577214 -0.52091293
> tmp[c("row1","row5"),c("col6","col20")]
           col6      col20
row1  1.0352849  0.5426464
row5 -0.1577214 -0.5209129
> 
> 
> 
> 
> tmp["row1",] <- rnorm(20,mean=10)
> tmp[,"col10"] <- rnorm(5,mean=30)
> tmp[c("row1","row5"),] <- rnorm(40,mean=50)
> tmp[,c("col6","col20")] <- rnorm(10,mean=75)
> tmp[c("row1","row5"),c("col6","col20")]  <- rnorm(4,mean=105)
> 
> tmp["row1",]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 51.51764 51.56445 48.74908 48.97822 49.69027 105.2137 49.46457 50.67164
         col9    col10    col11    col12    col13    col14    col15    col16
row1 50.09262 51.35257 50.51192 50.23333 50.94256 49.74954 49.74389 50.39422
       col17    col18    col19    col20
row1 51.0273 48.73478 49.73905 106.9123
> tmp[,"col10"]
        col10
row1 51.35257
row2 29.65031
row3 30.62034
row4 29.64388
row5 49.99461
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 51.51764 51.56445 48.74908 48.97822 49.69027 105.2137 49.46457 50.67164
row5 50.00968 51.40472 50.81375 49.82548 49.60646 105.9789 47.44012 50.58917
         col9    col10    col11    col12    col13    col14    col15    col16
row1 50.09262 51.35257 50.51192 50.23333 50.94256 49.74954 49.74389 50.39422
row5 49.99757 49.99461 50.90529 50.13404 49.45991 49.84578 48.90213 48.58105
        col17    col18    col19    col20
row1 51.02730 48.73478 49.73905 106.9123
row5 49.84542 49.40975 49.76724 105.9642
> tmp[,c("col6","col20")]
          col6     col20
row1 105.21366 106.91234
row2  74.77081  75.27631
row3  74.82138  75.33371
row4  73.68808  74.00949
row5 105.97893 105.96419
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 105.2137 106.9123
row5 105.9789 105.9642
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 105.2137 106.9123
row5 105.9789 105.9642
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
          col13
[1,]  0.1618191
[2,]  0.8551250
[3,] -1.8773117
[4,] -0.0321808
[5,]  1.9110644
> tmp[,c("col17","col7")]
          col17        col7
[1,] -0.7751627 -0.04579120
[2,] -0.6679620  0.58820548
[3,]  0.3768024 -0.44941985
[4,]  1.4325594 -1.06372817
[5,]  0.4347388  0.04796337
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
           col6      col20
[1,] -1.3413969 -0.1389651
[2,]  0.7214747 -0.2131230
[3,]  1.0875860 -0.8021511
[4,] -0.1923505 -1.8237300
[5,]  0.2116784  0.1326116
> subBufferedMatrix(tmp,1,c("col6"))[,1]
          col1
[1,] -1.341397
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
           col6
[1,] -1.3413969
[2,]  0.7214747
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> 
> 
> 
> subBufferedMatrix(tmp,c("row3","row1"),)[,1:20]
             [,1]      [,2]       [,3]       [,4]      [,5]       [,6]
row3 -0.002209271 2.2134802 -0.3141717  0.6924580 1.7313934 -0.3308427
row1  1.490079675 0.4551455  0.5933109 -0.9152932 0.6535312  1.2124374
          [,7]      [,8]      [,9]       [,10]      [,11]      [,12]      [,13]
row3  1.485998 1.9646208 1.2257391  0.90145078  0.1580269 -0.2555829 0.04103264
row1 -1.028236 0.6300288 0.6276712 -0.05169995 -0.5851685  0.8846219 0.54837709
          [,14]      [,15]     [,16]       [,17]      [,18]      [,19]
row3  0.4066673 -1.9418604 1.3479706  0.02231476 -1.4821991  0.8442369
row1 -0.7658889  0.1691594 0.1004932 -0.92539380  0.3587071 -0.9354429
          [,20]
row3 -0.1554411
row1 -0.3600427
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
           [,1]     [,2]     [,3]       [,4]      [,5]        [,6]      [,7]
row2 -0.3314537 1.053741 1.121712 -0.4182315 -1.632808 -0.02814523 0.6536383
           [,8]     [,9]    [,10]
row2 -0.6339702 1.170057 0.356073
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
          [,1]     [,2]       [,3]     [,4]      [,5]      [,6]      [,7]
row5 -1.344188 1.054742 -0.5108515 1.418389 0.6563166 0.7788005 0.3569565
          [,8]       [,9]     [,10]    [,11]     [,12]      [,13]    [,14]
row5 0.9316738 -0.8813519 -1.570334 1.094398 0.2034618 0.04060115 1.916475
         [,15]     [,16]     [,17]      [,18]      [,19]     [,20]
row5 0.1506938 0.9501852 0.8279819 -0.6702958 0.02689572 0.3318471
> 
> 
> 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: 0x000001de556fed70>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "F:/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests\\BM466028eaf00" 
 [2] "F:/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests\\BM466018206788"
 [3] "F:/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests\\BM466022267c39"
 [4] "F:/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests\\BM46602e9580f" 
 [5] "F:/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests\\BM4660652f7f86"
 [6] "F:/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests\\BM4660750c69c6"
 [7] "F:/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests\\BM466062e32c19"
 [8] "F:/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests\\BM466043833214"
 [9] "F:/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests\\BM46605e237023"
[10] "F:/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests\\BM46603f492b56"
[11] "F:/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests\\BM46605fe2899" 
[12] "F:/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests\\BM46606a0f66c8"
[13] "F:/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests\\BM4660317b6238"
[14] "F:/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests\\BM4660633115a9"
[15] "F:/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests\\BM46605148bc7" 
> 
> 
> ### 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: 0x000001de57dff950>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x000001de57dff950>
Warning message:
In dir.create(new.directory) :
  'F:\biocbuild\bbs-3.19-bioc\meat\BufferedMatrix.Rcheck\tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x000001de57dff950>
> rowMedians(tmp)
  [1]  0.674177914  0.173827372 -1.000907229  0.231605664 -0.296982541
  [6] -0.107807473  0.354890042 -0.110523403  0.379626329 -0.037087221
 [11] -0.408049083 -0.449015089  0.148517788  0.217327440  0.627443947
 [16] -0.552586069 -0.004884545  0.366363280  0.281490885 -0.053908362
 [21]  0.646380560  0.194594788 -0.098828116 -0.010613155  0.197336527
 [26]  0.025268702 -0.061000468 -0.563668130 -0.144707600  0.252072466
 [31]  0.352091275 -0.087965322  0.052782371  0.132705670  0.110170848
 [36] -0.088493984  0.259536958 -0.112559213  0.451386163  0.125810963
 [41] -0.002649814  0.092743296  0.107441154 -0.081249395 -0.307661596
 [46] -0.126030766 -0.466559251  0.130931396 -0.126972919 -0.091596496
 [51] -0.244976463 -0.055793844  0.184241141  0.641369202  0.335777382
 [56]  0.022138594  0.043234198  0.237725164  0.667067338  0.115350085
 [61]  0.593095449 -0.192735381  0.042953311  0.281253854  0.037993158
 [66] -0.054091279  0.315509170  0.383163194  0.598420621 -0.078495714
 [71] -0.083002025 -0.158063505 -0.321692942  0.026938856  0.178591108
 [76]  0.380994268  0.045156990  0.421810992  0.224965145  0.219681063
 [81] -0.048137237  0.217348345  0.154812244  0.086593243 -0.317206769
 [86] -0.135048370 -0.088347018  0.024527035  0.169462200  0.314210508
 [91]  0.011426857  0.225570478  0.086697374  0.429927114 -0.251636269
 [96] -0.273151516 -0.228636404 -0.333709498 -0.188539541  0.681413298
[101] -0.077710093  0.064064345  0.600859237 -0.652133894  0.149821491
[106] -0.071461293  0.731464157 -0.458538493 -0.255954232 -0.093792584
[111] -0.168061813 -0.090412104 -0.427143202 -0.179713347  0.659028470
[116] -0.345200958 -0.312032022 -0.059269895  0.145120236 -0.446217421
[121] -0.018073570 -0.415502805  0.047035231 -0.379484279  0.063302923
[126]  0.357874037 -0.050454649 -0.179692188  0.011135704  0.034538749
[131]  0.150070241  0.530364734 -0.395994241 -0.624236810 -0.469507418
[136]  0.547280884 -0.283315464  0.111529362  0.045842595 -0.198953995
[141] -0.234695122 -0.514072228  0.361716663 -0.019918908 -0.133687575
[146] -0.228346970  0.248416974  0.044383083 -0.280308561  0.043045734
[151] -0.041611034  0.243526216  0.554348650  0.552576908 -0.090350842
[156] -0.132948488  0.164198940  0.266363473  0.021612425  0.227301413
[161]  0.268828097 -0.213643201  0.073397823  0.129998974 -0.260789830
[166]  0.381246717  0.033244041 -0.586992066 -0.075347235  0.118295286
[171] -0.310466947 -0.645051001  0.639382853  0.257160392  0.348089706
[176]  0.316620924 -0.035260042  0.106676712  0.358294971  0.034943211
[181] -0.408265163  0.004818626 -0.130187690  0.747663952 -0.319043138
[186]  0.040169260 -0.040131711  0.383177086  0.312654530  0.162060991
[191]  0.105405747  0.456362839 -0.043598772  0.186203606 -0.372099285
[196]  0.076106707  0.161195569  0.259020102 -0.169258158  0.099962322
[201] -0.250160889 -0.290029970 -0.272718528  0.259031271 -0.644422869
[206] -0.101098381 -0.004847313  0.290132493  0.079304876  0.257499132
[211]  0.372433789 -0.592568733  0.176236572 -0.257491777 -0.452079537
[216]  0.126526755  0.283885248 -0.025033804 -0.191526546  0.460919199
[221]  0.043748077  0.433386657  0.101126202  0.027611981  0.008851805
[226]  0.140095158  0.136778763  0.450626148  0.054572833 -0.249784440
> 
> proc.time()
   user  system elapsed 
   3.39   17.82   32.98 

BufferedMatrix.Rcheck/tests/rawCalltesting.Rout


R version 4.4.0 (2024-04-24 ucrt) -- "Puppy Cup"
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: 0x000002ef302f91d0>
> .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: 0x000002ef302f91d0>
> .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: 0x000002ef302f91d0>
> .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: 0x000002ef302f91d0>
> 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: 0x000002ef302f9470>
> .Call("R_bm_AddColumn",P)
<pointer: 0x000002ef302f9470>
> .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: 0x000002ef302f9470>
> .Call("R_bm_AddColumn",P)
<pointer: 0x000002ef302f9470>
> .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: 0x000002ef302f9470>
> 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: 0x000002ef302f9230>
> .Call("R_bm_AddColumn",P)
<pointer: 0x000002ef302f9230>
> .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: 0x000002ef302f9230>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x000002ef302f9230>
> .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: 0x000002ef302f9230>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x000002ef302f9230>
> .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: 0x000002ef302f9230>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x000002ef302f9230>
> .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: 0x000002ef302f9230>
> 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: 0x000002ef302f9a10>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x000002ef302f9a10>
> .Call("R_bm_AddColumn",P)
<pointer: 0x000002ef302f9a10>
> .Call("R_bm_AddColumn",P)
<pointer: 0x000002ef302f9a10>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile11e018887f5c" "BufferedMatrixFile11e0375421c" 
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile11e018887f5c" "BufferedMatrixFile11e0375421c" 
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x000002ef302f9290>
> .Call("R_bm_AddColumn",P)
<pointer: 0x000002ef302f9290>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x000002ef302f9290>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x000002ef302f9290>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x000002ef302f9290>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x000002ef302f9290>
> .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: 0x000002ef302f97d0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x000002ef302f97d0>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x000002ef302f97d0>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x000002ef302f97d0>
> 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: 0x000002ef302f9530>
> .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: 0x000002ef302f9530>
> rm(P)
> 
> proc.time()
   user  system elapsed 
   0.31    0.14    0.54 

BufferedMatrix.Rcheck/tests/Rcodetesting.Rout


R version 4.4.0 (2024-04-24 ucrt) -- "Puppy Cup"
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.23    0.07    0.29 

Example timings