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

This page was generated on 2024-05-17 11:36:43 -0400 (Fri, 17 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" 4515
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-16 14:00:15 -0400 (Thu, 16 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-16 23:47:12 -0400 (Thu, 16 May 2024)
EndedAt: 2024-05-16 23:48:28 -0400 (Thu, 16 May 2024)
EllapsedTime: 75.4 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.25    0.17    0.59 

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] "Thu May 16 23:47:45 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] "Thu May 16 23:47:46 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: 0x000001b4636fd8f0>
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   which.col <- sample(1:20,1)
+   if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,5,replace=TRUE)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> date()
[1] "Thu May 16 23:47:53 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] "Thu May 16 23:47:55 2024"
> 
> ColMode(tmp2)
<pointer: 0x000001b4636fd8f0>
> 
> 
> 
> ### Now testing assignments
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+ 
+   new.data <- rnorm(20)
+   tmp2[which.row,] <- new.data
+   test.matrix[which.row,] <- new.data
+   if (rep > 1){
+     if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+   
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   new.data <- rnorm(10)
+   tmp2[,which.col] <- new.data
+   test.matrix[,which.col]<- new.data
+ 
+   if (rep > 1){
+     if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.col <- which.col
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,5,replace=TRUE)
+   new.data <- matrix(rnorm(50),5,10)
+   tmp2[,which.col] <- new.data
+   test.matrix[,which.col]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.col <- which.col
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   new.data <- matrix(rnorm(50),5,10)
+   tmp2[which.row,] <- new.data
+   test.matrix[which.row,]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col  <- sample(1:20,5,replace=TRUE)
+   new.data <- matrix(rnorm(25),5,5)
+   tmp2[which.row,which.col] <- new.data
+   test.matrix[which.row,which.col]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[prev.row,prev.col] == test.matrix[prev.row,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+   prev.col <- which.col
+ }
> 
> 
> 
> 
> ###
> ###
> ### testing some more functions
> ###
> 
> 
> 
> ## duplication function
> tmp5 <- duplicate(tmp2)
> 
> # making sure really did copy everything.
> tmp5[1,1] <- tmp5[1,1] +100.00
> 
> if (tmp5[1,1] == tmp2[1,1]){
+   stop("Problem with duplication")
+ }
> 
> 
> 
> 
> ### testing elementwise applying of functions
> 
> tmp5[1:4,1:4]
           [,1]       [,2]       [,3]        [,4]
[1,] 99.1702504 -1.0209159  0.6099268  0.06585374
[2,]  0.3541043 -0.1274593 -0.5929110  1.08844495
[3,]  0.7243139  0.4260460 -0.8562775 -0.40713140
[4,] -0.3201674 -3.0613971 -0.3294195 -0.24792288
> 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,] 99.1702504 1.0209159 0.6099268 0.06585374
[2,]  0.3541043 0.1274593 0.5929110 1.08844495
[3,]  0.7243139 0.4260460 0.8562775 0.40713140
[4,]  0.3201674 3.0613971 0.3294195 0.24792288
> 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,] 9.9584261 1.0104039 0.7809781 0.2566198
[2,] 0.5950666 0.3570145 0.7700072 1.0432857
[3,] 0.8510664 0.6527220 0.9253527 0.6380685
[4,] 0.5658333 1.7496849 0.5739508 0.4979185
> 
> 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,] 223.75451 36.12495 33.41971 27.63205
[2,]  31.30477 28.69760 33.29298 36.52130
[3,]  34.23498 31.95327 35.10980 31.78782
[4,]  30.97850 45.55825 31.06893 30.22711
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x000001b4636fda10>
> exp(tmp5)
<pointer: 0x000001b4636fda10>
> log(tmp5,2)
<pointer: 0x000001b4636fda10>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 465.7157
> Min(tmp5)
[1] 54.74681
> mean(tmp5)
[1] 73.0612
> Sum(tmp5)
[1] 14612.24
> Var(tmp5)
[1] 844.8301
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 91.58397 69.33982 73.04613 71.92476 67.77723 72.10642 73.24781 71.03390
 [9] 70.18287 70.36905
> rowSums(tmp5)
 [1] 1831.679 1386.796 1460.923 1438.495 1355.545 1442.128 1464.956 1420.678
 [9] 1403.657 1407.381
> rowVars(tmp5)
 [1] 7814.30805   62.77631   72.34567   96.27027   59.65640   63.78859
 [7]   25.94378   64.90538   55.38495  104.95373
> rowSd(tmp5)
 [1] 88.398575  7.923150  8.505626  9.811741  7.723756  7.986776  5.093504
 [8]  8.056387  7.442106 10.244693
> rowMax(tmp5)
 [1] 465.71570  92.04597  94.05804  94.82352  83.76596  90.10307  82.08360
 [8]  86.49485  83.65036  85.52792
> rowMin(tmp5)
 [1] 57.51250 58.42026 57.81027 57.20333 56.76090 58.70624 62.03645 55.81394
 [9] 59.90198 54.74681
> 
> colMeans(tmp5)
 [1] 107.92675  70.61471  69.91373  68.33086  74.92674  74.01345  69.96429
 [8]  71.54597  69.88791  71.63048  74.43256  66.97366  74.84360  66.05180
[15]  68.35474  69.99645  76.96975  75.27511  67.60342  71.96795
> colSums(tmp5)
 [1] 1079.2675  706.1471  699.1373  683.3086  749.2674  740.1345  699.6429
 [8]  715.4597  698.8791  716.3048  744.3256  669.7366  748.4360  660.5180
[15]  683.5474  699.9645  769.6975  752.7511  676.0342  719.6795
> colVars(tmp5)
 [1] 15826.79626   161.00820    42.19372    83.56288    20.71719   113.68953
 [7]    57.09153    42.87597    76.21291   102.25293    72.47970    39.01784
[13]    62.66857    24.25759    54.02342   128.45920    14.77440    45.22798
[19]    50.43099    44.37203
> colSd(tmp5)
 [1] 125.804596  12.688901   6.495669   9.141273   4.551614  10.662529
 [7]   7.555894   6.547974   8.730001  10.112019   8.513501   6.246426
[13]   7.916348   4.925200   7.350062  11.333985   3.843748   6.725175
[19]   7.101478   6.661233
> colMax(tmp5)
 [1] 465.71570  94.82352  81.96701  83.65036  81.92357  94.05804  80.90470
 [8]  83.18101  81.71088  86.49485  86.69704  78.66574  92.04597  71.07851
[15]  77.17413  90.10307  83.76596  85.86653  82.69234  85.52792
> colMin(tmp5)
 [1] 60.41748 54.74681 60.63425 55.73734 69.14831 59.08693 58.08709 62.41619
 [9] 57.37722 56.76090 59.90198 57.81027 65.03921 55.81394 57.99401 57.20333
[17] 70.82577 64.09874 57.06079 63.60300
> 
> 
> ### setting a random element to NA and then testing with na.rm=TRUE or na.rm=FALSE (The default)
> 
> 
> which.row <- sample(1:10,1,replace=TRUE)
> which.col  <- sample(1:20,1,replace=TRUE)
> 
> tmp5[which.row,which.col] <- NA
> 
> Max(tmp5)
[1] NA
> Min(tmp5)
[1] NA
> mean(tmp5)
[1] NA
> Sum(tmp5)
[1] NA
> Var(tmp5)
[1] NA
> 
> rowMeans(tmp5)
 [1] 91.58397 69.33982 73.04613 71.92476 67.77723 72.10642       NA 71.03390
 [9] 70.18287 70.36905
> rowSums(tmp5)
 [1] 1831.679 1386.796 1460.923 1438.495 1355.545 1442.128       NA 1420.678
 [9] 1403.657 1407.381
> rowVars(tmp5)
 [1] 7814.30805   62.77631   72.34567   96.27027   59.65640   63.78859
 [7]   26.78435   64.90538   55.38495  104.95373
> rowSd(tmp5)
 [1] 88.398575  7.923150  8.505626  9.811741  7.723756  7.986776  5.175360
 [8]  8.056387  7.442106 10.244693
> rowMax(tmp5)
 [1] 465.71570  92.04597  94.05804  94.82352  83.76596  90.10307        NA
 [8]  86.49485  83.65036  85.52792
> rowMin(tmp5)
 [1] 57.51250 58.42026 57.81027 57.20333 56.76090 58.70624       NA 55.81394
 [9] 59.90198 54.74681
> 
> colMeans(tmp5)
 [1] 107.92675  70.61471  69.91373  68.33086  74.92674  74.01345  69.96429
 [8]        NA  69.88791  71.63048  74.43256  66.97366  74.84360  66.05180
[15]  68.35474  69.99645  76.96975  75.27511  67.60342  71.96795
> colSums(tmp5)
 [1] 1079.2675  706.1471  699.1373  683.3086  749.2674  740.1345  699.6429
 [8]        NA  698.8791  716.3048  744.3256  669.7366  748.4360  660.5180
[15]  683.5474  699.9645  769.6975  752.7511  676.0342  719.6795
> colVars(tmp5)
 [1] 15826.79626   161.00820    42.19372    83.56288    20.71719   113.68953
 [7]    57.09153          NA    76.21291   102.25293    72.47970    39.01784
[13]    62.66857    24.25759    54.02342   128.45920    14.77440    45.22798
[19]    50.43099    44.37203
> colSd(tmp5)
 [1] 125.804596  12.688901   6.495669   9.141273   4.551614  10.662529
 [7]   7.555894         NA   8.730001  10.112019   8.513501   6.246426
[13]   7.916348   4.925200   7.350062  11.333985   3.843748   6.725175
[19]   7.101478   6.661233
> colMax(tmp5)
 [1] 465.71570  94.82352  81.96701  83.65036  81.92357  94.05804  80.90470
 [8]        NA  81.71088  86.49485  86.69704  78.66574  92.04597  71.07851
[15]  77.17413  90.10307  83.76596  85.86653  82.69234  85.52792
> colMin(tmp5)
 [1] 60.41748 54.74681 60.63425 55.73734 69.14831 59.08693 58.08709       NA
 [9] 57.37722 56.76090 59.90198 57.81027 65.03921 55.81394 57.99401 57.20333
[17] 70.82577 64.09874 57.06079 63.60300
> 
> Max(tmp5,na.rm=TRUE)
[1] 465.7157
> Min(tmp5,na.rm=TRUE)
[1] 54.74681
> mean(tmp5,na.rm=TRUE)
[1] 73.07636
> Sum(tmp5,na.rm=TRUE)
[1] 14542.2
> Var(tmp5,na.rm=TRUE)
[1] 849.0506
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 91.58397 69.33982 73.04613 71.92476 67.77723 72.10642 73.41650 71.03390
 [9] 70.18287 70.36905
> rowSums(tmp5,na.rm=TRUE)
 [1] 1831.679 1386.796 1460.923 1438.495 1355.545 1442.128 1394.913 1420.678
 [9] 1403.657 1407.381
> rowVars(tmp5,na.rm=TRUE)
 [1] 7814.30805   62.77631   72.34567   96.27027   59.65640   63.78859
 [7]   26.78435   64.90538   55.38495  104.95373
> rowSd(tmp5,na.rm=TRUE)
 [1] 88.398575  7.923150  8.505626  9.811741  7.723756  7.986776  5.175360
 [8]  8.056387  7.442106 10.244693
> rowMax(tmp5,na.rm=TRUE)
 [1] 465.71570  92.04597  94.05804  94.82352  83.76596  90.10307  82.08360
 [8]  86.49485  83.65036  85.52792
> rowMin(tmp5,na.rm=TRUE)
 [1] 57.51250 58.42026 57.81027 57.20333 56.76090 58.70624 62.03645 55.81394
 [9] 59.90198 54.74681
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 107.92675  70.61471  69.91373  68.33086  74.92674  74.01345  69.96429
 [8]  71.71300  69.88791  71.63048  74.43256  66.97366  74.84360  66.05180
[15]  68.35474  69.99645  76.96975  75.27511  67.60342  71.96795
> colSums(tmp5,na.rm=TRUE)
 [1] 1079.2675  706.1471  699.1373  683.3086  749.2674  740.1345  699.6429
 [8]  645.4170  698.8791  716.3048  744.3256  669.7366  748.4360  660.5180
[15]  683.5474  699.9645  769.6975  752.7511  676.0342  719.6795
> colVars(tmp5,na.rm=TRUE)
 [1] 15826.79626   161.00820    42.19372    83.56288    20.71719   113.68953
 [7]    57.09153    47.92160    76.21291   102.25293    72.47970    39.01784
[13]    62.66857    24.25759    54.02342   128.45920    14.77440    45.22798
[19]    50.43099    44.37203
> colSd(tmp5,na.rm=TRUE)
 [1] 125.804596  12.688901   6.495669   9.141273   4.551614  10.662529
 [7]   7.555894   6.922543   8.730001  10.112019   8.513501   6.246426
[13]   7.916348   4.925200   7.350062  11.333985   3.843748   6.725175
[19]   7.101478   6.661233
> colMax(tmp5,na.rm=TRUE)
 [1] 465.71570  94.82352  81.96701  83.65036  81.92357  94.05804  80.90470
 [8]  83.18101  81.71088  86.49485  86.69704  78.66574  92.04597  71.07851
[15]  77.17413  90.10307  83.76596  85.86653  82.69234  85.52792
> colMin(tmp5,na.rm=TRUE)
 [1] 60.41748 54.74681 60.63425 55.73734 69.14831 59.08693 58.08709 62.41619
 [9] 57.37722 56.76090 59.90198 57.81027 65.03921 55.81394 57.99401 57.20333
[17] 70.82577 64.09874 57.06079 63.60300
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1] 91.58397 69.33982 73.04613 71.92476 67.77723 72.10642      NaN 71.03390
 [9] 70.18287 70.36905
> rowSums(tmp5,na.rm=TRUE)
 [1] 1831.679 1386.796 1460.923 1438.495 1355.545 1442.128    0.000 1420.678
 [9] 1403.657 1407.381
> rowVars(tmp5,na.rm=TRUE)
 [1] 7814.30805   62.77631   72.34567   96.27027   59.65640   63.78859
 [7]         NA   64.90538   55.38495  104.95373
> rowSd(tmp5,na.rm=TRUE)
 [1] 88.398575  7.923150  8.505626  9.811741  7.723756  7.986776        NA
 [8]  8.056387  7.442106 10.244693
> rowMax(tmp5,na.rm=TRUE)
 [1] 465.71570  92.04597  94.05804  94.82352  83.76596  90.10307        NA
 [8]  86.49485  83.65036  85.52792
> rowMin(tmp5,na.rm=TRUE)
 [1] 57.51250 58.42026 57.81027 57.20333 56.76090 58.70624       NA 55.81394
 [9] 59.90198 54.74681
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1] 111.78477  69.34039  70.01927  69.03024  74.44438  73.28866  69.19875
 [8]       NaN  69.82789  71.87604  75.02098  66.62778  74.80441  65.49327
[15]  67.50566  69.23497  76.68694  75.62239  67.64696  71.64249
> colSums(tmp5,na.rm=TRUE)
 [1] 1006.0629  624.0635  630.1735  621.2721  669.9994  659.5979  622.7888
 [8]    0.0000  628.4510  646.8844  675.1888  599.6500  673.2397  589.4395
[15]  607.5509  623.1147  690.1825  680.6015  608.8226  644.7824
> colVars(tmp5,na.rm=TRUE)
 [1] 17637.69692   162.86540    47.34261    88.50551    20.68926   121.99088
 [7]    57.63497          NA    85.69900   114.35616    77.64450    42.54913
[13]    70.48486    23.78037    52.66572   137.99328    15.72142    49.52475
[19]    56.71354    48.72685
> colSd(tmp5,na.rm=TRUE)
 [1] 132.806991  12.761873   6.880597   9.407737   4.548545  11.044948
 [7]   7.591770         NA   9.257376  10.693744   8.811612   6.522969
[13]   8.395526   4.876512   7.257115  11.747054   3.965024   7.037382
[19]   7.530840   6.980462
> colMax(tmp5,na.rm=TRUE)
 [1] 465.71570  94.82352  81.96701  83.65036  81.92357  94.05804  80.90470
 [8]      -Inf  81.71088  86.49485  86.69704  78.66574  92.04597  70.73431
[15]  77.17413  90.10307  83.76596  85.86653  82.69234  85.52792
> colMin(tmp5,na.rm=TRUE)
 [1] 60.41748 54.74681 60.63425 55.73734 69.14831 59.08693 58.08709      Inf
 [9] 57.37722 56.76090 59.90198 57.81027 65.03921 55.81394 57.99401 57.20333
[17] 70.82577 64.09874 57.06079 63.60300
> 
> 
> 
> 
> 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] 144.1443 150.8787 239.5403 159.8919 253.5455 332.9410 301.1977 192.8987
 [9] 324.2413 200.1905
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 144.1443 150.8787 239.5403 159.8919 253.5455 332.9410 301.1977 192.8987
 [9] 324.2413 200.1905
> 
> 
> 
> 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] -3.552714e-14  1.705303e-13  0.000000e+00  1.136868e-13  8.526513e-14
 [6] -5.684342e-14  1.136868e-13 -2.842171e-14  2.842171e-14 -2.842171e-14
[11]  1.136868e-13 -2.842171e-14 -1.136868e-13  2.842171e-14  1.136868e-13
[16] -5.684342e-14  0.000000e+00  0.000000e+00 -5.684342e-14  1.421085e-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)
+ }
7   3 
5   5 
5   7 
3   2 
5   8 
3   16 
3   18 
8   4 
1   6 
8   9 
10   18 
2   5 
5   2 
10   2 
7   12 
5   4 
1   13 
10   6 
6   20 
4   8 
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.877763
> Min(tmp)
[1] -2.363981
> mean(tmp)
[1] -0.1340585
> Sum(tmp)
[1] -13.40585
> Var(tmp)
[1] 0.9386652
> 
> rowMeans(tmp)
[1] -0.1340585
> rowSums(tmp)
[1] -13.40585
> rowVars(tmp)
[1] 0.9386652
> rowSd(tmp)
[1] 0.9688473
> rowMax(tmp)
[1] 2.877763
> rowMin(tmp)
[1] -2.363981
> 
> colMeans(tmp)
  [1]  1.47001470  0.03247778  0.45551120 -0.80926010 -0.64670907 -1.03594514
  [7] -1.06943270  2.02660749 -0.33999952 -1.40746060  0.19771188 -0.20019214
 [13]  0.41217257 -1.46091363  0.03240682  0.26046498 -0.84135811 -0.66570094
 [19] -0.57405335 -1.04859797  0.61439811 -0.50145385 -0.43298429 -0.02888839
 [25] -1.00979138  0.42324168 -0.01270714  1.04368720 -0.23391281 -1.16587242
 [31] -0.89676225  1.04566353  0.39437771  0.14953136 -0.69654060  1.29871869
 [37]  0.78572076  1.43870217 -0.55757329  0.50065305 -0.44764485  0.63667136
 [43]  0.57355271  0.87478591  1.19685443 -0.98765834 -0.11417665 -0.74919342
 [49] -0.07598869  0.02439070 -0.34924917  0.65683057 -0.53962300  0.42355161
 [55]  0.32292057 -0.34129014  0.40034444 -1.31861709  0.91789085 -2.02989822
 [61]  0.67282171  0.92536513 -1.25455431 -1.45804595 -1.00638833  1.38148373
 [67] -0.99372194 -1.97985739 -0.30007372  0.66663899  2.87776254 -0.67024823
 [73] -0.80702935  0.46009361 -0.03662258 -1.13361373 -1.00138096 -2.33449281
 [79]  0.52440452 -0.16691899 -0.79202160  0.15922117 -0.14700336  0.98274786
 [85]  2.16059290  0.46538970 -0.12162274 -0.13761924 -0.11168413 -0.04500050
 [91] -0.50532966 -2.36398085 -1.44955368  1.08363404 -1.25756106  0.98285595
 [97]  0.08941147 -0.04198613 -1.34589329 -1.39647232
> colSums(tmp)
  [1]  1.47001470  0.03247778  0.45551120 -0.80926010 -0.64670907 -1.03594514
  [7] -1.06943270  2.02660749 -0.33999952 -1.40746060  0.19771188 -0.20019214
 [13]  0.41217257 -1.46091363  0.03240682  0.26046498 -0.84135811 -0.66570094
 [19] -0.57405335 -1.04859797  0.61439811 -0.50145385 -0.43298429 -0.02888839
 [25] -1.00979138  0.42324168 -0.01270714  1.04368720 -0.23391281 -1.16587242
 [31] -0.89676225  1.04566353  0.39437771  0.14953136 -0.69654060  1.29871869
 [37]  0.78572076  1.43870217 -0.55757329  0.50065305 -0.44764485  0.63667136
 [43]  0.57355271  0.87478591  1.19685443 -0.98765834 -0.11417665 -0.74919342
 [49] -0.07598869  0.02439070 -0.34924917  0.65683057 -0.53962300  0.42355161
 [55]  0.32292057 -0.34129014  0.40034444 -1.31861709  0.91789085 -2.02989822
 [61]  0.67282171  0.92536513 -1.25455431 -1.45804595 -1.00638833  1.38148373
 [67] -0.99372194 -1.97985739 -0.30007372  0.66663899  2.87776254 -0.67024823
 [73] -0.80702935  0.46009361 -0.03662258 -1.13361373 -1.00138096 -2.33449281
 [79]  0.52440452 -0.16691899 -0.79202160  0.15922117 -0.14700336  0.98274786
 [85]  2.16059290  0.46538970 -0.12162274 -0.13761924 -0.11168413 -0.04500050
 [91] -0.50532966 -2.36398085 -1.44955368  1.08363404 -1.25756106  0.98285595
 [97]  0.08941147 -0.04198613 -1.34589329 -1.39647232
> 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]  1.47001470  0.03247778  0.45551120 -0.80926010 -0.64670907 -1.03594514
  [7] -1.06943270  2.02660749 -0.33999952 -1.40746060  0.19771188 -0.20019214
 [13]  0.41217257 -1.46091363  0.03240682  0.26046498 -0.84135811 -0.66570094
 [19] -0.57405335 -1.04859797  0.61439811 -0.50145385 -0.43298429 -0.02888839
 [25] -1.00979138  0.42324168 -0.01270714  1.04368720 -0.23391281 -1.16587242
 [31] -0.89676225  1.04566353  0.39437771  0.14953136 -0.69654060  1.29871869
 [37]  0.78572076  1.43870217 -0.55757329  0.50065305 -0.44764485  0.63667136
 [43]  0.57355271  0.87478591  1.19685443 -0.98765834 -0.11417665 -0.74919342
 [49] -0.07598869  0.02439070 -0.34924917  0.65683057 -0.53962300  0.42355161
 [55]  0.32292057 -0.34129014  0.40034444 -1.31861709  0.91789085 -2.02989822
 [61]  0.67282171  0.92536513 -1.25455431 -1.45804595 -1.00638833  1.38148373
 [67] -0.99372194 -1.97985739 -0.30007372  0.66663899  2.87776254 -0.67024823
 [73] -0.80702935  0.46009361 -0.03662258 -1.13361373 -1.00138096 -2.33449281
 [79]  0.52440452 -0.16691899 -0.79202160  0.15922117 -0.14700336  0.98274786
 [85]  2.16059290  0.46538970 -0.12162274 -0.13761924 -0.11168413 -0.04500050
 [91] -0.50532966 -2.36398085 -1.44955368  1.08363404 -1.25756106  0.98285595
 [97]  0.08941147 -0.04198613 -1.34589329 -1.39647232
> colMin(tmp)
  [1]  1.47001470  0.03247778  0.45551120 -0.80926010 -0.64670907 -1.03594514
  [7] -1.06943270  2.02660749 -0.33999952 -1.40746060  0.19771188 -0.20019214
 [13]  0.41217257 -1.46091363  0.03240682  0.26046498 -0.84135811 -0.66570094
 [19] -0.57405335 -1.04859797  0.61439811 -0.50145385 -0.43298429 -0.02888839
 [25] -1.00979138  0.42324168 -0.01270714  1.04368720 -0.23391281 -1.16587242
 [31] -0.89676225  1.04566353  0.39437771  0.14953136 -0.69654060  1.29871869
 [37]  0.78572076  1.43870217 -0.55757329  0.50065305 -0.44764485  0.63667136
 [43]  0.57355271  0.87478591  1.19685443 -0.98765834 -0.11417665 -0.74919342
 [49] -0.07598869  0.02439070 -0.34924917  0.65683057 -0.53962300  0.42355161
 [55]  0.32292057 -0.34129014  0.40034444 -1.31861709  0.91789085 -2.02989822
 [61]  0.67282171  0.92536513 -1.25455431 -1.45804595 -1.00638833  1.38148373
 [67] -0.99372194 -1.97985739 -0.30007372  0.66663899  2.87776254 -0.67024823
 [73] -0.80702935  0.46009361 -0.03662258 -1.13361373 -1.00138096 -2.33449281
 [79]  0.52440452 -0.16691899 -0.79202160  0.15922117 -0.14700336  0.98274786
 [85]  2.16059290  0.46538970 -0.12162274 -0.13761924 -0.11168413 -0.04500050
 [91] -0.50532966 -2.36398085 -1.44955368  1.08363404 -1.25756106  0.98285595
 [97]  0.08941147 -0.04198613 -1.34589329 -1.39647232
> colMedians(tmp)
  [1]  1.47001470  0.03247778  0.45551120 -0.80926010 -0.64670907 -1.03594514
  [7] -1.06943270  2.02660749 -0.33999952 -1.40746060  0.19771188 -0.20019214
 [13]  0.41217257 -1.46091363  0.03240682  0.26046498 -0.84135811 -0.66570094
 [19] -0.57405335 -1.04859797  0.61439811 -0.50145385 -0.43298429 -0.02888839
 [25] -1.00979138  0.42324168 -0.01270714  1.04368720 -0.23391281 -1.16587242
 [31] -0.89676225  1.04566353  0.39437771  0.14953136 -0.69654060  1.29871869
 [37]  0.78572076  1.43870217 -0.55757329  0.50065305 -0.44764485  0.63667136
 [43]  0.57355271  0.87478591  1.19685443 -0.98765834 -0.11417665 -0.74919342
 [49] -0.07598869  0.02439070 -0.34924917  0.65683057 -0.53962300  0.42355161
 [55]  0.32292057 -0.34129014  0.40034444 -1.31861709  0.91789085 -2.02989822
 [61]  0.67282171  0.92536513 -1.25455431 -1.45804595 -1.00638833  1.38148373
 [67] -0.99372194 -1.97985739 -0.30007372  0.66663899  2.87776254 -0.67024823
 [73] -0.80702935  0.46009361 -0.03662258 -1.13361373 -1.00138096 -2.33449281
 [79]  0.52440452 -0.16691899 -0.79202160  0.15922117 -0.14700336  0.98274786
 [85]  2.16059290  0.46538970 -0.12162274 -0.13761924 -0.11168413 -0.04500050
 [91] -0.50532966 -2.36398085 -1.44955368  1.08363404 -1.25756106  0.98285595
 [97]  0.08941147 -0.04198613 -1.34589329 -1.39647232
> colRanges(tmp)
         [,1]       [,2]      [,3]       [,4]       [,5]      [,6]      [,7]
[1,] 1.470015 0.03247778 0.4555112 -0.8092601 -0.6467091 -1.035945 -1.069433
[2,] 1.470015 0.03247778 0.4555112 -0.8092601 -0.6467091 -1.035945 -1.069433
         [,8]       [,9]     [,10]     [,11]      [,12]     [,13]     [,14]
[1,] 2.026607 -0.3399995 -1.407461 0.1977119 -0.2001921 0.4121726 -1.460914
[2,] 2.026607 -0.3399995 -1.407461 0.1977119 -0.2001921 0.4121726 -1.460914
          [,15]    [,16]      [,17]      [,18]      [,19]     [,20]     [,21]
[1,] 0.03240682 0.260465 -0.8413581 -0.6657009 -0.5740533 -1.048598 0.6143981
[2,] 0.03240682 0.260465 -0.8413581 -0.6657009 -0.5740533 -1.048598 0.6143981
          [,22]      [,23]       [,24]     [,25]     [,26]       [,27]    [,28]
[1,] -0.5014539 -0.4329843 -0.02888839 -1.009791 0.4232417 -0.01270714 1.043687
[2,] -0.5014539 -0.4329843 -0.02888839 -1.009791 0.4232417 -0.01270714 1.043687
          [,29]     [,30]      [,31]    [,32]     [,33]     [,34]      [,35]
[1,] -0.2339128 -1.165872 -0.8967623 1.045664 0.3943777 0.1495314 -0.6965406
[2,] -0.2339128 -1.165872 -0.8967623 1.045664 0.3943777 0.1495314 -0.6965406
        [,36]     [,37]    [,38]      [,39]    [,40]      [,41]     [,42]
[1,] 1.298719 0.7857208 1.438702 -0.5575733 0.500653 -0.4476449 0.6366714
[2,] 1.298719 0.7857208 1.438702 -0.5575733 0.500653 -0.4476449 0.6366714
         [,43]     [,44]    [,45]      [,46]      [,47]      [,48]       [,49]
[1,] 0.5735527 0.8747859 1.196854 -0.9876583 -0.1141766 -0.7491934 -0.07598869
[2,] 0.5735527 0.8747859 1.196854 -0.9876583 -0.1141766 -0.7491934 -0.07598869
         [,50]      [,51]     [,52]     [,53]     [,54]     [,55]      [,56]
[1,] 0.0243907 -0.3492492 0.6568306 -0.539623 0.4235516 0.3229206 -0.3412901
[2,] 0.0243907 -0.3492492 0.6568306 -0.539623 0.4235516 0.3229206 -0.3412901
         [,57]     [,58]     [,59]     [,60]     [,61]     [,62]     [,63]
[1,] 0.4003444 -1.318617 0.9178909 -2.029898 0.6728217 0.9253651 -1.254554
[2,] 0.4003444 -1.318617 0.9178909 -2.029898 0.6728217 0.9253651 -1.254554
         [,64]     [,65]    [,66]      [,67]     [,68]      [,69]    [,70]
[1,] -1.458046 -1.006388 1.381484 -0.9937219 -1.979857 -0.3000737 0.666639
[2,] -1.458046 -1.006388 1.381484 -0.9937219 -1.979857 -0.3000737 0.666639
        [,71]      [,72]      [,73]     [,74]       [,75]     [,76]     [,77]
[1,] 2.877763 -0.6702482 -0.8070294 0.4600936 -0.03662258 -1.133614 -1.001381
[2,] 2.877763 -0.6702482 -0.8070294 0.4600936 -0.03662258 -1.133614 -1.001381
         [,78]     [,79]     [,80]      [,81]     [,82]      [,83]     [,84]
[1,] -2.334493 0.5244045 -0.166919 -0.7920216 0.1592212 -0.1470034 0.9827479
[2,] -2.334493 0.5244045 -0.166919 -0.7920216 0.1592212 -0.1470034 0.9827479
        [,85]     [,86]      [,87]      [,88]      [,89]      [,90]      [,91]
[1,] 2.160593 0.4653897 -0.1216227 -0.1376192 -0.1116841 -0.0450005 -0.5053297
[2,] 2.160593 0.4653897 -0.1216227 -0.1376192 -0.1116841 -0.0450005 -0.5053297
         [,92]     [,93]    [,94]     [,95]    [,96]      [,97]       [,98]
[1,] -2.363981 -1.449554 1.083634 -1.257561 0.982856 0.08941147 -0.04198613
[2,] -2.363981 -1.449554 1.083634 -1.257561 0.982856 0.08941147 -0.04198613
         [,99]    [,100]
[1,] -1.345893 -1.396472
[2,] -1.345893 -1.396472
> 
> 
> Max(tmp2)
[1] 2.467096
> Min(tmp2)
[1] -3.111855
> mean(tmp2)
[1] 0.01192728
> Sum(tmp2)
[1] 1.192728
> Var(tmp2)
[1] 0.8609944
> 
> rowMeans(tmp2)
  [1] -0.230641920 -0.059494628  0.357235022 -1.048712791  0.150203114
  [6] -0.269720744 -3.111854596  0.869869164  0.385851746  0.545476807
 [11]  0.795293847  0.608725627  1.350036125 -0.770833584  0.453122038
 [16] -0.579188443 -0.837657179  0.935889101  0.137537019  0.022550772
 [21]  0.623478816 -0.420036299  0.440768755  0.218119839 -0.294081276
 [26] -0.626048049  0.390966519  0.350360694  0.076522598  0.420243871
 [31] -0.691271741  1.290289119  1.539081008 -0.189952267  0.156244272
 [36]  2.258558215  0.924834502 -0.089124688 -1.193506462 -1.221272789
 [41] -0.271661244 -0.389619919  0.032051310 -1.887757435 -0.231325095
 [46]  1.528734109 -0.773417030 -0.908890778  0.956401144  1.431198110
 [51] -0.580566482  0.629870768 -0.366461936 -0.160691030  1.414692804
 [56] -0.755798188  1.304418052 -0.187196163  0.917279624  1.057450767
 [61]  2.467096421  0.564324795  0.056730322  0.919788106 -2.727842643
 [66]  0.358273036 -0.030999772 -0.001229277  0.573294605 -0.599522066
 [71]  0.782606158 -0.005273818 -0.227299951  1.542238519  0.218902436
 [76] -0.565481787 -1.199708756 -0.378075951 -0.306420797 -0.446555013
 [81] -1.093978197 -0.998686254 -1.398531588  0.774168803 -0.072777616
 [86]  0.898359151  0.125468718 -0.618031394 -0.402359445 -0.470345723
 [91] -0.623610431 -0.246646577  0.610440115 -0.436879408 -1.857686563
 [96]  0.178291287 -1.402394936 -0.070822675  0.942908801 -0.065574986
> rowSums(tmp2)
  [1] -0.230641920 -0.059494628  0.357235022 -1.048712791  0.150203114
  [6] -0.269720744 -3.111854596  0.869869164  0.385851746  0.545476807
 [11]  0.795293847  0.608725627  1.350036125 -0.770833584  0.453122038
 [16] -0.579188443 -0.837657179  0.935889101  0.137537019  0.022550772
 [21]  0.623478816 -0.420036299  0.440768755  0.218119839 -0.294081276
 [26] -0.626048049  0.390966519  0.350360694  0.076522598  0.420243871
 [31] -0.691271741  1.290289119  1.539081008 -0.189952267  0.156244272
 [36]  2.258558215  0.924834502 -0.089124688 -1.193506462 -1.221272789
 [41] -0.271661244 -0.389619919  0.032051310 -1.887757435 -0.231325095
 [46]  1.528734109 -0.773417030 -0.908890778  0.956401144  1.431198110
 [51] -0.580566482  0.629870768 -0.366461936 -0.160691030  1.414692804
 [56] -0.755798188  1.304418052 -0.187196163  0.917279624  1.057450767
 [61]  2.467096421  0.564324795  0.056730322  0.919788106 -2.727842643
 [66]  0.358273036 -0.030999772 -0.001229277  0.573294605 -0.599522066
 [71]  0.782606158 -0.005273818 -0.227299951  1.542238519  0.218902436
 [76] -0.565481787 -1.199708756 -0.378075951 -0.306420797 -0.446555013
 [81] -1.093978197 -0.998686254 -1.398531588  0.774168803 -0.072777616
 [86]  0.898359151  0.125468718 -0.618031394 -0.402359445 -0.470345723
 [91] -0.623610431 -0.246646577  0.610440115 -0.436879408 -1.857686563
 [96]  0.178291287 -1.402394936 -0.070822675  0.942908801 -0.065574986
> 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.230641920 -0.059494628  0.357235022 -1.048712791  0.150203114
  [6] -0.269720744 -3.111854596  0.869869164  0.385851746  0.545476807
 [11]  0.795293847  0.608725627  1.350036125 -0.770833584  0.453122038
 [16] -0.579188443 -0.837657179  0.935889101  0.137537019  0.022550772
 [21]  0.623478816 -0.420036299  0.440768755  0.218119839 -0.294081276
 [26] -0.626048049  0.390966519  0.350360694  0.076522598  0.420243871
 [31] -0.691271741  1.290289119  1.539081008 -0.189952267  0.156244272
 [36]  2.258558215  0.924834502 -0.089124688 -1.193506462 -1.221272789
 [41] -0.271661244 -0.389619919  0.032051310 -1.887757435 -0.231325095
 [46]  1.528734109 -0.773417030 -0.908890778  0.956401144  1.431198110
 [51] -0.580566482  0.629870768 -0.366461936 -0.160691030  1.414692804
 [56] -0.755798188  1.304418052 -0.187196163  0.917279624  1.057450767
 [61]  2.467096421  0.564324795  0.056730322  0.919788106 -2.727842643
 [66]  0.358273036 -0.030999772 -0.001229277  0.573294605 -0.599522066
 [71]  0.782606158 -0.005273818 -0.227299951  1.542238519  0.218902436
 [76] -0.565481787 -1.199708756 -0.378075951 -0.306420797 -0.446555013
 [81] -1.093978197 -0.998686254 -1.398531588  0.774168803 -0.072777616
 [86]  0.898359151  0.125468718 -0.618031394 -0.402359445 -0.470345723
 [91] -0.623610431 -0.246646577  0.610440115 -0.436879408 -1.857686563
 [96]  0.178291287 -1.402394936 -0.070822675  0.942908801 -0.065574986
> rowMin(tmp2)
  [1] -0.230641920 -0.059494628  0.357235022 -1.048712791  0.150203114
  [6] -0.269720744 -3.111854596  0.869869164  0.385851746  0.545476807
 [11]  0.795293847  0.608725627  1.350036125 -0.770833584  0.453122038
 [16] -0.579188443 -0.837657179  0.935889101  0.137537019  0.022550772
 [21]  0.623478816 -0.420036299  0.440768755  0.218119839 -0.294081276
 [26] -0.626048049  0.390966519  0.350360694  0.076522598  0.420243871
 [31] -0.691271741  1.290289119  1.539081008 -0.189952267  0.156244272
 [36]  2.258558215  0.924834502 -0.089124688 -1.193506462 -1.221272789
 [41] -0.271661244 -0.389619919  0.032051310 -1.887757435 -0.231325095
 [46]  1.528734109 -0.773417030 -0.908890778  0.956401144  1.431198110
 [51] -0.580566482  0.629870768 -0.366461936 -0.160691030  1.414692804
 [56] -0.755798188  1.304418052 -0.187196163  0.917279624  1.057450767
 [61]  2.467096421  0.564324795  0.056730322  0.919788106 -2.727842643
 [66]  0.358273036 -0.030999772 -0.001229277  0.573294605 -0.599522066
 [71]  0.782606158 -0.005273818 -0.227299951  1.542238519  0.218902436
 [76] -0.565481787 -1.199708756 -0.378075951 -0.306420797 -0.446555013
 [81] -1.093978197 -0.998686254 -1.398531588  0.774168803 -0.072777616
 [86]  0.898359151  0.125468718 -0.618031394 -0.402359445 -0.470345723
 [91] -0.623610431 -0.246646577  0.610440115 -0.436879408 -1.857686563
 [96]  0.178291287 -1.402394936 -0.070822675  0.942908801 -0.065574986
> 
> colMeans(tmp2)
[1] 0.01192728
> colSums(tmp2)
[1] 1.192728
> colVars(tmp2)
[1] 0.8609944
> colSd(tmp2)
[1] 0.9278978
> colMax(tmp2)
[1] 2.467096
> colMin(tmp2)
[1] -3.111855
> colMedians(tmp2)
[1] -0.0181368
> colRanges(tmp2)
          [,1]
[1,] -3.111855
[2,]  2.467096
> 
> dataset1 <- matrix(dataset1,1,100)
> 
> agree.checks(tmp,dataset1)
> 
> dataset2 <- matrix(dataset2,100,1)
> agree.checks(tmp2,dataset2)
>   
> 
> tmp <- createBufferedMatrix(10,10)
> 
> tmp[1:10,1:10] <- rnorm(100)
> colApply(tmp,sum)
 [1] -1.9916483  3.5376113 -0.8385374  0.8842515  0.5391171 -1.1211752
 [7] -3.4818895 -3.5638108  1.4820475 -0.7957777
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -1.5784693
[2,] -0.5510894
[3,] -0.1252096
[4,]  0.0348603
[5,]  1.3079443
> 
> rowApply(tmp,sum)
 [1] -1.47388656  4.69165760 -1.05679570 -4.05361443 -0.17951949 -4.64716530
 [7]  0.14286223  1.93819184 -0.79588952  0.08434782
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    1    4    5    8   10    6    4    5    4     3
 [2,]    8    9    8    9    2    5   10    6    3     9
 [3,]   10   10    1    4    8    4    7    2    8     1
 [4,]    6    7    3   10    4    7    5    7    5     7
 [5,]    5    2   10    5    3   10    6    4    1    10
 [6,]    9    3    9    2    5    9    1    8    7     2
 [7,]    2    8    4    3    9    1    3    3    2     8
 [8,]    3    5    6    6    1    8    2    1    6     6
 [9,]    7    6    2    7    7    2    8   10    9     5
[10,]    4    1    7    1    6    3    9    9   10     4
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1]  1.31214781  0.05233853 -5.18852506 -2.66382954  3.24747778  4.06161895
 [7] -5.38174258  1.70080134 -0.61922137 -1.87270576  1.78048365  0.54702737
[13] -2.71893501  1.43323827 -0.24137778 -0.15524888 -1.27808215  2.94019036
[19] -0.11766077  1.20210680
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -0.7987641
[2,] -0.6168743
[3,] -0.5056868
[4,]  0.6978070
[5,]  2.5356659
> 
> rowApply(tmp,sum)
[1]  3.08735558 -7.22528664 -0.05378343 -2.72147751  4.95329397
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]   16    9    4    8   20
[2,]   10   18    8    7   12
[3,]    1   19    2    1    5
[4,]   13    5   17    2    4
[5,]   18   11   10   20   11
> 
> 
> as.matrix(tmp)
           [,1]       [,2]       [,3]       [,4]       [,5]       [,6]
[1,]  0.6978070  0.3474485 -2.0959597  0.5065494  0.7888584  1.6415561
[2,] -0.5056868  0.5276271  1.1136367 -1.3829276 -0.2887487 -0.9613292
[3,] -0.6168743 -0.1782334 -1.5016189  0.7395678 -0.0434335  2.3138912
[4,] -0.7987641 -0.9128797 -2.0363918 -1.5341485  2.5341521 -0.4416532
[5,]  2.5356659  0.2683761 -0.6681914 -0.9928707  0.2566496  1.5091540
            [,7]        [,8]        [,9]      [,10]       [,11]       [,12]
[1,] -1.41264583  1.30648591  0.53175887  0.3435802  0.70246181  0.17800324
[2,] -1.68964342 -0.73874321 -0.15975012 -0.2504150 -0.35941620 -2.27874914
[3,]  0.02998943 -0.07622679  0.02851587 -0.3735680  0.29014293  0.95136147
[4,] -1.17957762  0.70774511  0.03773860 -1.3386078  1.21968866 -0.01312576
[5,] -1.12986515  0.50154031 -1.05748459 -0.2536952 -0.07239355  1.70953757
          [,13]      [,14]      [,15]      [,16]      [,17]      [,18]
[1,] -0.6131199 -0.3425370  0.5131807 -0.7595601 -0.1074191 0.49307619
[2,]  2.0680789  0.4083429 -1.5499601  0.3656170 -0.6173674 0.05794563
[3,] -1.9253285  0.8662812 -0.4295807  0.5578201  0.5260119 0.43579787
[4,] -0.9967507  1.0693561  0.5487933 -1.2387878 -0.6752952 0.99674203
[5,] -1.2518148 -0.5682048  0.6761890  0.9196619 -0.4040124 0.95662863
           [,19]      [,20]
[1,] -0.04794012  0.4157709
[2,]  0.50445145 -1.4882493
[3,] -1.15293625 -0.4953630
[4,]  0.83608313  0.4942056
[5,] -0.25731898  2.2757426
> 
> 
> 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 :  541  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 -0.712828 0.3468902 0.5032788 0.4861797 -0.09583008 1.430157 0.191492
          col8       col9     col10      col11     col12     col13    col14
row1 0.3858786 -0.8647999 0.3671482 -0.3917724 -1.020274 0.2790958 1.002814
         col15     col16     col17     col18    col19     col20
row1 0.5381602 0.5854534 0.2151633 -1.432727 0.721069 0.8198343
> tmp[,"col10"]
          col10
row1  0.3671482
row2  1.1883270
row3 -0.4162536
row4  1.2868228
row5 -2.1275863
> tmp[c("row1","row5"),]
           col1      col2      col3       col4        col5      col6     col7
row1 -0.7128280 0.3468902 0.5032788  0.4861797 -0.09583008 1.4301571 0.191492
row5  0.9530108 1.3402713 1.8588784 -1.3648529  0.70314534 0.4203984 2.110615
          col8       col9      col10      col11      col12     col13      col14
row1 0.3858786 -0.8647999  0.3671482 -0.3917724 -1.0202735 0.2790958 1.00281442
row5 2.3265091 -0.6145140 -2.1275863 -1.2221206  0.1836594 1.1150472 0.08374449
         col15      col16      col17      col18      col19      col20
row1 0.5381602  0.5854534 0.21516334 -1.4327269  0.7210690  0.8198343
row5 0.2111699 -1.7634153 0.09361132 -0.8233105 -0.5856158 -0.4017160
> tmp[,c("col6","col20")]
            col6      col20
row1  1.43015709  0.8198343
row2  0.07241647  0.7524496
row3 -0.83397645  0.2588748
row4 -0.52480855 -1.1819097
row5  0.42039839 -0.4017160
> tmp[c("row1","row5"),c("col6","col20")]
          col6      col20
row1 1.4301571  0.8198343
row5 0.4203984 -0.4017160
> 
> 
> 
> 
> tmp["row1",] <- rnorm(20,mean=10)
> tmp[,"col10"] <- rnorm(5,mean=30)
> tmp[c("row1","row5"),] <- rnorm(40,mean=50)
> tmp[,c("col6","col20")] <- rnorm(10,mean=75)
> tmp[c("row1","row5"),c("col6","col20")]  <- rnorm(4,mean=105)
> 
> tmp["row1",]
         col1     col2     col3     col4    col5     col6     col7     col8
row1 49.36537 51.58408 49.26473 49.08403 49.1583 103.8329 50.40098 47.11419
         col9    col10    col11    col12    col13    col14   col15    col16
row1 50.21677 52.05671 49.05208 51.22376 48.39722 49.82702 49.7949 52.25578
        col17    col18    col19    col20
row1 49.35334 48.56046 48.97239 105.8416
> tmp[,"col10"]
        col10
row1 52.05671
row2 30.10764
row3 31.46315
row4 30.07463
row5 51.30528
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 49.36537 51.58408 49.26473 49.08403 49.15830 103.8329 50.40098 47.11419
row5 48.87635 49.60461 50.15227 48.34579 47.78729 103.5117 48.09030 47.44730
         col9    col10    col11    col12    col13    col14    col15    col16
row1 50.21677 52.05671 49.05208 51.22376 48.39722 49.82702 49.79490 52.25578
row5 50.12495 51.30528 47.97744 49.18119 49.51528 49.96275 48.26854 50.33634
        col17    col18    col19    col20
row1 49.35334 48.56046 48.97239 105.8416
row5 50.85708 50.08356 49.24277 105.9291
> tmp[,c("col6","col20")]
          col6     col20
row1 103.83293 105.84158
row2  77.11910  74.55121
row3  75.26761  76.51490
row4  72.98702  74.68697
row5 103.51168 105.92909
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 103.8329 105.8416
row5 103.5117 105.9291
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 103.8329 105.8416
row5 103.5117 105.9291
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
          col13
[1,]  0.3041934
[2,]  1.5160165
[3,] -0.3213563
[4,] -0.7623237
[5,] -0.9702956
> tmp[,c("col17","col7")]
            col17       col7
[1,]  1.023702186  1.3585628
[2,]  0.574943789 -0.1924532
[3,]  0.631120767  0.1524371
[4,] -0.009133221 -0.3152127
[5,]  1.988453575 -1.7128124
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
            col6       col20
[1,] -0.01722296 -0.55891721
[2,]  0.20661988 -1.62963426
[3,] -0.25066534  0.14865176
[4,] -0.05528690  0.27540880
[5,] -1.57126774 -0.01151077
> subBufferedMatrix(tmp,1,c("col6"))[,1]
            col1
[1,] -0.01722296
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
            col6
[1,] -0.01722296
[2,]  0.20661988
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> 
> 
> 
> subBufferedMatrix(tmp,c("row3","row1"),)[,1:20]
          [,1]       [,2]       [,3]       [,4]       [,5]       [,6]      [,7]
row3 0.1126673 -1.2681009 -0.7019434 -0.6791806 -1.2418710  1.7183439 1.2820814
row1 0.5031108  0.1802954 -0.8045298 -0.1575854  0.2947703 -0.6520306 0.1073961
           [,8]       [,9]     [,10]      [,11]      [,12]   [,13]    [,14]
row3 -0.5623251  0.5899265 0.7539296 -0.4067490 -0.4521149 1.45310 1.594029
row1  0.7535113 -1.3799146 0.8877638  0.6836083  1.0605110 1.70532 2.219555
         [,15]     [,16]      [,17]       [,18]      [,19]      [,20]
row3 0.5890979  1.319851 -0.6521583 -0.01711037  1.2194603 0.01070924
row1 1.1478674 -1.010181  0.1301660  0.16372389 -0.4198443 0.40844954
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
            [,1]      [,2]       [,3]       [,4]       [,5]       [,6]
row2 -0.05195507 0.6325032 -0.5472355 -0.6591799 0.06860744 -0.5273091
          [,7]       [,8]      [,9]    [,10]
row2 -0.721211 -0.4307493 -1.425226 1.078169
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
          [,1]       [,2]     [,3]     [,4]      [,5]       [,6]       [,7]
row5 0.9651937 0.06714546 1.338149 2.049852 -1.366571 -0.7720222 -0.6748581
          [,8]       [,9]    [,10]     [,11]    [,12]     [,13]     [,14]
row5 -1.115199 -0.5601785 1.623178 0.7579456 1.535009 -0.746851 0.8966914
         [,15]     [,16]     [,17]    [,18]    [,19]     [,20]
row5 0.5588583 0.9004602 -1.397114 1.605572 1.184567 -1.547722
> 
> 
> 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: 0x000001b4636fdd10>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "F:/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests\\BM365051586e8e"
 [2] "F:/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests\\BM3650d916f07" 
 [3] "F:/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests\\BM365067da5bb3"
 [4] "F:/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests\\BM36503626813" 
 [5] "F:/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests\\BM3650367066fc"
 [6] "F:/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests\\BM3650fa37f3b" 
 [7] "F:/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests\\BM36506a79569c"
 [8] "F:/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests\\BM365034cd6de0"
 [9] "F:/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests\\BM365055607da5"
[10] "F:/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests\\BM365063b76350"
[11] "F:/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests\\BM365023cc6671"
[12] "F:/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests\\BM3650c662247" 
[13] "F:/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests\\BM365015167c42"
[14] "F:/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests\\BM3650312617b6"
[15] "F:/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests\\BM365047007825"
> 
> 
> ### 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: 0x000001b465dff110>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x000001b465dff110>
Warning message:
In dir.create(new.directory) :
  'F:\biocbuild\bbs-3.19-bioc\meat\BufferedMatrix.Rcheck\tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x000001b465dff110>
> rowMedians(tmp)
  [1] -0.101428724 -0.250850036  0.234164677 -0.506847280  0.182193683
  [6]  0.526114853 -0.153988858 -0.084328936 -0.823022990  0.200020889
 [11]  0.220700819 -0.177813548 -0.702407610  0.391021167 -0.038135286
 [16] -0.258601349 -0.297152080  0.222719282  0.192193568  0.235492077
 [21] -0.104377630  0.269777190 -0.127635144  0.138679662 -0.056464448
 [26]  0.092566132  0.071780758 -0.354926944 -0.316114961 -0.156741486
 [31]  0.475060336 -0.250450022  0.082857883 -0.026526916  0.563755283
 [36]  0.022444991 -0.006919366 -0.139439932 -0.169185098 -0.154434151
 [41] -0.371725861 -0.028433955 -0.246523217  0.014098171  0.013557220
 [46]  0.282131286  0.195367248 -0.177759616 -0.538110495  0.030269419
 [51]  0.315561027  0.170605505 -0.309241832  0.155569085 -0.864322358
 [56] -0.280614634 -0.086837779 -0.009489430 -0.102992766  0.581269437
 [61]  0.510786135 -0.534982974  0.072790889  0.131501686 -0.267796993
 [66]  0.272979041  0.276527338  0.195481199  0.437429750  0.864592037
 [71]  0.146381886  0.434659426  0.344596361 -0.225150934 -0.131663393
 [76]  0.246773924 -0.512198815 -0.308725091 -0.060845246  0.780953854
 [81] -0.065748398 -0.018141271 -0.335178229  0.803813341  0.440977407
 [86]  0.303748317 -0.343383832 -0.118520050 -0.233273145  0.023892887
 [91] -0.381586469 -0.343336977 -0.176340167 -0.163333614 -0.362264693
 [96] -0.318478036 -0.212629166 -0.321186926  0.087987653 -0.164756314
[101] -0.141885563 -0.513394600  0.032648999 -0.512626438  0.274962767
[106]  0.535481723 -0.182607300 -0.125498245  0.227878056  0.062632286
[111] -0.339061196  0.024372383  0.140165054  0.045270355 -0.043694056
[116]  0.522297267 -0.267116585  0.121500004  0.277702340  0.332953124
[121]  0.030962072  0.322797271  0.646011999 -0.024847041  0.047730828
[126] -0.419470290  0.189276243  0.025816234  0.184323431 -0.237282973
[131]  0.101286514 -0.193571572  0.095986388  0.168708965  0.069389038
[136] -0.076530589  0.106584211 -0.358070594  0.317263057 -0.291336604
[141] -0.284618287  0.245912058 -0.356513517  0.051873596 -0.790823796
[146] -0.514355678 -0.710424594  0.182059683 -0.225842186 -0.322455060
[151] -0.273460332  0.070102327  0.030700952  0.128827671 -0.130547924
[156] -0.183942149 -0.568246196  0.316086099  0.274477012 -0.074965455
[161] -0.147821446 -0.095031893 -0.175201932 -0.216627941 -0.549308847
[166]  0.671711332  0.267091060  0.094233101 -0.239776078 -0.152552337
[171]  0.469856026  0.367017289 -0.897061164 -0.443014181  0.014896205
[176]  0.191193724 -0.004201269 -0.184902047 -0.202540691 -0.274634088
[181]  0.251398935 -0.149954603  0.013787440 -0.587050562  0.033258739
[186] -0.224117998 -0.246634815  0.093873490  0.268988714 -0.021729967
[191] -0.209522982  0.031479947 -0.155481525  0.259576314  0.356450429
[196]  0.209354469 -0.101148473 -0.022636767  0.129767340 -0.088022292
[201] -0.625127850  0.209942143  0.086712060  0.170827723 -0.288346618
[206] -0.275075191 -0.135324961  0.856283381 -0.025850333  0.057777045
[211]  0.466377986  0.232560030 -0.493939397 -0.027600778  0.029083982
[216] -0.049471138  0.048414922  0.115347954 -0.217378018  0.498439625
[221]  0.303644433  0.337447173 -0.280215064  0.150380642  0.125306816
[226] -0.221555372  0.046460735 -0.127734729  0.501678924 -0.202459163
> 
> proc.time()
   user  system elapsed 
   3.43   17.93   34.40 

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: 0x000002d15c2fd1d0>
> .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: 0x000002d15c2fd1d0>
> .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: 0x000002d15c2fd1d0>
> .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: 0x000002d15c2fd1d0>
> 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: 0x000002d15c2fd230>
> .Call("R_bm_AddColumn",P)
<pointer: 0x000002d15c2fd230>
> .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: 0x000002d15c2fd230>
> .Call("R_bm_AddColumn",P)
<pointer: 0x000002d15c2fd230>
> .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: 0x000002d15c2fd230>
> 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: 0x000002d15c2fdbf0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x000002d15c2fdbf0>
> .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: 0x000002d15c2fdbf0>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x000002d15c2fdbf0>
> .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: 0x000002d15c2fdbf0>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x000002d15c2fdbf0>
> .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: 0x000002d15c2fdbf0>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x000002d15c2fdbf0>
> .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: 0x000002d15c2fdbf0>
> 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: 0x000002d15c2fdad0>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x000002d15c2fdad0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x000002d15c2fdad0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x000002d15c2fdad0>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile3ab42b71cb6"  "BufferedMatrixFile3ab43a254a7e"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile3ab42b71cb6"  "BufferedMatrixFile3ab43a254a7e"
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x000002d15c2fd470>
> .Call("R_bm_AddColumn",P)
<pointer: 0x000002d15c2fd470>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x000002d15c2fd470>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x000002d15c2fd470>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x000002d15c2fd470>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x000002d15c2fd470>
> .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: 0x000002d15c2fdb90>
> .Call("R_bm_AddColumn",P)
<pointer: 0x000002d15c2fdb90>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x000002d15c2fdb90>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x000002d15c2fdb90>
> 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: 0x000002d15c2fd650>
> .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: 0x000002d15c2fd650>
> rm(P)
> 
> proc.time()
   user  system elapsed 
   0.34    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.21    0.07    1.12 

Example timings