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

This page was generated on 2024-05-31 19:28:42 -0400 (Fri, 31 May 2024).

HostnameOSArch (*)R versionInstalled pkgs
nebbiolo2Linux (Ubuntu 22.04.3 LTS)x86_644.4.0 RC (2024-04-16 r86468) -- "Puppy Cup" 4669
palomino4Windows Server 2022 Datacenterx644.4.0 RC (2024-04-16 r86468 ucrt) -- "Puppy Cup" 4404
merida1macOS 12.7.4 Montereyx86_644.4.0 Patched (2024-04-24 r86482) -- "Puppy Cup" 4431
kjohnson1macOS 13.6.6 Venturaarm644.4.0 Patched (2024-04-24 r86482) -- "Puppy Cup" 4384
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 244/2233HostnameOS / ArchINSTALLBUILDCHECKBUILD BIN
BufferedMatrix 1.69.0  (landing page)
Ben Bolstad
Snapshot Date: 2024-05-30 18:57:37 -0400 (Thu, 30 May 2024)
git_url: https://git.bioconductor.org/packages/BufferedMatrix
git_branch: devel
git_last_commit: d422a05
git_last_commit_date: 2024-04-30 10:16:21 -0400 (Tue, 30 Apr 2024)
nebbiolo2Linux (Ubuntu 22.04.3 LTS) / x86_64  OK    OK    OK  UNNEEDED, same version is already published
palomino4Windows Server 2022 Datacenter / x64  OK    OK    OK    OK  UNNEEDED, same version is already published
merida1macOS 12.7.4 Monterey / x86_64  OK    OK    WARNINGS    OK  UNNEEDED, same version is already published
kjohnson1macOS 13.6.6 Ventura / arm64  OK    OK    WARNINGS    OK  UNNEEDED, same version is already published

CHECK results for BufferedMatrix on nebbiolo2


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.69.0
Command: /home/biocbuild/bbs-3.20-bioc/R/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/home/biocbuild/bbs-3.20-bioc/R/site-library --timings BufferedMatrix_1.69.0.tar.gz
StartedAt: 2024-05-31 02:03:12 -0400 (Fri, 31 May 2024)
EndedAt: 2024-05-31 02:03:35 -0400 (Fri, 31 May 2024)
EllapsedTime: 23.1 seconds
RetCode: 0
Status:   OK  
CheckDir: BufferedMatrix.Rcheck
Warnings: 0

Command output

##############################################################################
##############################################################################
###
### Running command:
###
###   /home/biocbuild/bbs-3.20-bioc/R/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/home/biocbuild/bbs-3.20-bioc/R/site-library --timings BufferedMatrix_1.69.0.tar.gz
###
##############################################################################
##############################################################################


* using log directory ‘/home/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck’
* using R version 4.4.0 RC (2024-04-16 r86468)
* using platform: x86_64-pc-linux-gnu
* R was compiled by
    gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0
    GNU Fortran (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0
* running under: Ubuntu 22.04.4 LTS
* using session charset: UTF-8
* checking for file ‘BufferedMatrix/DESCRIPTION’ ... OK
* this is package ‘BufferedMatrix’ version ‘1.69.0’
* checking package namespace information ... OK
* checking package dependencies ... OK
* checking if this is a source package ... OK
* checking if there is a namespace ... OK
* checking for hidden files and directories ... OK
* checking for portable file names ... OK
* checking for sufficient/correct file permissions ... OK
* checking whether package ‘BufferedMatrix’ can be installed ... OK
* used C compiler: ‘gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.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 loading without being on the library search path ... 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 is not available
* 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 re-building of vignette outputs ... OK
* checking PDF version of manual ... OK
* DONE

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


Installation output

BufferedMatrix.Rcheck/00install.out

##############################################################################
##############################################################################
###
### Running command:
###
###   /home/biocbuild/bbs-3.20-bioc/R/bin/R CMD INSTALL BufferedMatrix
###
##############################################################################
##############################################################################


* installing to library ‘/home/biocbuild/bbs-3.20-bioc/R/site-library’
* installing *source* package ‘BufferedMatrix’ ...
** using staged installation
** libs
using C compiler: ‘gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0’
gcc -I"/home/biocbuild/bbs-3.20-bioc/R/include" -DNDEBUG   -I/usr/local/include    -fpic  -g -O2  -Wall -c RBufferedMatrix.c -o RBufferedMatrix.o
gcc -I"/home/biocbuild/bbs-3.20-bioc/R/include" -DNDEBUG   -I/usr/local/include    -fpic  -g -O2  -Wall -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){
      |       ^~~~~~~~~~~~~~~~~~~
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"/home/biocbuild/bbs-3.20-bioc/R/include" -DNDEBUG   -I/usr/local/include    -fpic  -g -O2  -Wall -c doubleBufferedMatrix_C_tests.c -o doubleBufferedMatrix_C_tests.o
gcc -I"/home/biocbuild/bbs-3.20-bioc/R/include" -DNDEBUG   -I/usr/local/include    -fpic  -g -O2  -Wall -c init_package.c -o init_package.o
gcc -shared -L/home/biocbuild/bbs-3.20-bioc/R/lib -L/usr/local/lib -o BufferedMatrix.so RBufferedMatrix.o doubleBufferedMatrix.o doubleBufferedMatrix_C_tests.o init_package.o -L/home/biocbuild/bbs-3.20-bioc/R/lib -lR
installing to /home/biocbuild/bbs-3.20-bioc/R/site-library/00LOCK-BufferedMatrix/00new/BufferedMatrix/libs
** R
** inst
** byte-compile and prepare package for lazy loading
Creating a new generic function for ‘rowMeans’ in package ‘BufferedMatrix’
Creating a new generic function for ‘rowSums’ in package ‘BufferedMatrix’
Creating a new generic function for ‘colMeans’ in package ‘BufferedMatrix’
Creating a new generic function for ‘colSums’ in package ‘BufferedMatrix’
Creating a generic function for ‘ncol’ from package ‘base’ in package ‘BufferedMatrix’
Creating a generic function for ‘nrow’ from package ‘base’ in package ‘BufferedMatrix’
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
** checking absolute paths in shared objects and dynamic libraries
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (BufferedMatrix)

Tests output

BufferedMatrix.Rcheck/tests/c_code_level_tests.Rout


R version 4.4.0 RC (2024-04-16 r86468) -- "Puppy Cup"
Copyright (C) 2024 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu

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.259   0.034   0.284 

BufferedMatrix.Rcheck/tests/objectTesting.Rout


R version 4.4.0 RC (2024-04-16 r86468) -- "Puppy Cup"
Copyright (C) 2024 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu

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] "/home/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests"
> prefix(tmp3)
[1] "BM"
> 
> ## testing if we can remove these objects
> rm(tmp, tmp2, tmp3)
> gc()
         used (Mb) gc trigger (Mb) max used (Mb)
Ncells 471778 25.2    1026220 54.9   643434 34.4
Vcells 871903  6.7    8388608 64.0  2046581 15.7
> 
> 
> 
> 
> ##
> ## 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] "Fri May 31 02:03:27 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] "Fri May 31 02:03:28 2024"
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,which.col] == test.matrix[which.row,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> 
> 
> RowMode(tmp2)
<pointer: 0x56274865b6b0>
> 
> 
> 
> 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] "Fri May 31 02:03:28 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] "Fri May 31 02:03:28 2024"
> 
> ColMode(tmp2)
<pointer: 0x56274865b6b0>
> 
> 
> 
> ### 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,] 101.6769446 -0.8217051  0.2422547  0.05530443
[2,]  -0.5858630 -0.1143296  1.2781584  0.32590845
[3,]   1.7278494 -0.7850418 -0.6795149  0.31686469
[4,]  -0.6751125  0.6866792 -1.5896633 -0.92913842
> ewApply(tmp5,abs)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
            [,1]      [,2]      [,3]       [,4]
[1,] 101.6769446 0.8217051 0.2422547 0.05530443
[2,]   0.5858630 0.1143296 1.2781584 0.32590845
[3,]   1.7278494 0.7850418 0.6795149 0.31686469
[4,]   0.6751125 0.6866792 1.5896633 0.92913842
> ewApply(tmp5,sqrt)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
           [,1]      [,2]      [,3]      [,4]
[1,] 10.0834986 0.9064795 0.4921938 0.2351689
[2,]  0.7654169 0.3381266 1.1305567 0.5708839
[3,]  1.3144769 0.8860258 0.8243269 0.5629074
[4,]  0.8216523 0.8286611 1.2608185 0.9639183
> 
> 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:    /home/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
          [,1]     [,2]     [,3]     [,4]
[1,] 227.51193 34.88650 30.16419 27.40699
[2,]  33.24003 28.49560 37.58373 31.03475
[3,]  39.87262 34.64530 33.92278 30.94594
[4,]  33.89164 33.97329 39.19785 35.56832
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x56274750c530>
> exp(tmp5)
<pointer: 0x56274750c530>
> log(tmp5,2)
<pointer: 0x56274750c530>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 473.5363
> Min(tmp5)
[1] 54.3891
> mean(tmp5)
[1] 71.45336
> Sum(tmp5)
[1] 14290.67
> Var(tmp5)
[1] 878.4627
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 89.73725 70.11865 69.38054 67.87043 69.68651 69.10518 71.06093 69.94240
 [9] 68.08015 69.55160
> rowSums(tmp5)
 [1] 1794.745 1402.373 1387.611 1357.409 1393.730 1382.104 1421.219 1398.848
 [9] 1361.603 1391.032
> rowVars(tmp5)
 [1] 8217.24169   44.40166   40.76554   70.58772  107.21898   54.77081
 [7]   61.33131   35.41393   84.88415   84.87870
> rowSd(tmp5)
 [1] 90.649003  6.663457  6.384790  8.401650 10.354660  7.400730  7.831431
 [8]  5.950960  9.213260  9.212964
> rowMax(tmp5)
 [1] 473.53628  80.29548  82.98963  92.64781  89.33946  90.47666  85.87125
 [8]  79.31017  91.43643  88.16632
> rowMin(tmp5)
 [1] 57.04407 59.30985 57.49901 54.38910 54.46750 56.87122 55.80980 57.19926
 [9] 54.47547 55.96660
> 
> colMeans(tmp5)
 [1] 108.17714  71.98048  69.24573  70.24941  67.95051  70.11946  67.31418
 [8]  66.45897  69.87140  69.50380  69.68957  70.84890  71.38298  65.97849
[15]  70.60462  67.79053  69.95409  72.62351  69.32358  69.99993
> colSums(tmp5)
 [1] 1081.7714  719.8048  692.4573  702.4941  679.5051  701.1946  673.1418
 [8]  664.5897  698.7140  695.0380  696.8957  708.4890  713.8298  659.7849
[15]  706.0462  677.9053  699.5409  726.2351  693.2358  699.9993
> colVars(tmp5)
 [1] 16533.27377    69.38894   104.01376    74.30957    34.89506    53.42207
 [7]    15.16006    63.78695    33.21972   120.36759    18.26978    72.87095
[13]   133.01796    49.57443    66.61316    43.39931    78.83912    64.04114
[19]    49.86647   105.98486
> colSd(tmp5)
 [1] 128.581779   8.330002  10.198714   8.620300   5.907204   7.309040
 [7]   3.893592   7.986673   5.763655  10.971216   4.274316   8.536448
[13]  11.533341   7.040911   8.161688   6.587815   8.879140   8.002571
[19]   7.061620  10.294895
> colMax(tmp5)
 [1] 473.53628  85.80689  83.86949  88.16632  77.78591  80.38661  76.66692
 [8]  79.64810  82.40429  87.36468  76.19193  90.47666  92.64781  77.94739
[15]  82.07841  77.80338  85.87125  86.54254  79.31017  91.43643
> colMin(tmp5)
 [1] 57.79595 58.57917 54.47547 57.04407 56.16488 55.80980 62.02136 54.38910
 [9] 64.77587 56.87122 63.31363 57.73316 57.98204 54.46750 55.96660 59.43149
[17] 59.36992 59.67869 60.51280 57.17098
> 
> 
> ### 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] 89.73725 70.11865       NA 67.87043 69.68651 69.10518 71.06093 69.94240
 [9] 68.08015 69.55160
> rowSums(tmp5)
 [1] 1794.745 1402.373       NA 1357.409 1393.730 1382.104 1421.219 1398.848
 [9] 1361.603 1391.032
> rowVars(tmp5)
 [1] 8217.24169   44.40166   34.77470   70.58772  107.21898   54.77081
 [7]   61.33131   35.41393   84.88415   84.87870
> rowSd(tmp5)
 [1] 90.649003  6.663457  5.897008  8.401650 10.354660  7.400730  7.831431
 [8]  5.950960  9.213260  9.212964
> rowMax(tmp5)
 [1] 473.53628  80.29548        NA  92.64781  89.33946  90.47666  85.87125
 [8]  79.31017  91.43643  88.16632
> rowMin(tmp5)
 [1] 57.04407 59.30985       NA 54.38910 54.46750 56.87122 55.80980 57.19926
 [9] 54.47547 55.96660
> 
> colMeans(tmp5)
 [1] 108.17714  71.98048  69.24573  70.24941  67.95051  70.11946  67.31418
 [8]  66.45897  69.87140        NA  69.68957  70.84890  71.38298  65.97849
[15]  70.60462  67.79053  69.95409  72.62351  69.32358  69.99993
> colSums(tmp5)
 [1] 1081.7714  719.8048  692.4573  702.4941  679.5051  701.1946  673.1418
 [8]  664.5897  698.7140        NA  696.8957  708.4890  713.8298  659.7849
[15]  706.0462  677.9053  699.5409  726.2351  693.2358  699.9993
> colVars(tmp5)
 [1] 16533.27377    69.38894   104.01376    74.30957    34.89506    53.42207
 [7]    15.16006    63.78695    33.21972          NA    18.26978    72.87095
[13]   133.01796    49.57443    66.61316    43.39931    78.83912    64.04114
[19]    49.86647   105.98486
> colSd(tmp5)
 [1] 128.581779   8.330002  10.198714   8.620300   5.907204   7.309040
 [7]   3.893592   7.986673   5.763655         NA   4.274316   8.536448
[13]  11.533341   7.040911   8.161688   6.587815   8.879140   8.002571
[19]   7.061620  10.294895
> colMax(tmp5)
 [1] 473.53628  85.80689  83.86949  88.16632  77.78591  80.38661  76.66692
 [8]  79.64810  82.40429        NA  76.19193  90.47666  92.64781  77.94739
[15]  82.07841  77.80338  85.87125  86.54254  79.31017  91.43643
> colMin(tmp5)
 [1] 57.79595 58.57917 54.47547 57.04407 56.16488 55.80980 62.02136 54.38910
 [9] 64.77587       NA 63.31363 57.73316 57.98204 54.46750 55.96660 59.43149
[17] 59.36992 59.67869 60.51280 57.17098
> 
> Max(tmp5,na.rm=TRUE)
[1] 473.5363
> Min(tmp5,na.rm=TRUE)
[1] 54.3891
> mean(tmp5,na.rm=TRUE)
[1] 71.52349
> Sum(tmp5,na.rm=TRUE)
[1] 14233.17
> Var(tmp5,na.rm=TRUE)
[1] 881.911
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 89.73725 70.11865 70.00588 67.87043 69.68651 69.10518 71.06093 69.94240
 [9] 68.08015 69.55160
> rowSums(tmp5,na.rm=TRUE)
 [1] 1794.745 1402.373 1330.112 1357.409 1393.730 1382.104 1421.219 1398.848
 [9] 1361.603 1391.032
> rowVars(tmp5,na.rm=TRUE)
 [1] 8217.24169   44.40166   34.77470   70.58772  107.21898   54.77081
 [7]   61.33131   35.41393   84.88415   84.87870
> rowSd(tmp5,na.rm=TRUE)
 [1] 90.649003  6.663457  5.897008  8.401650 10.354660  7.400730  7.831431
 [8]  5.950960  9.213260  9.212964
> rowMax(tmp5,na.rm=TRUE)
 [1] 473.53628  80.29548  82.98963  92.64781  89.33946  90.47666  85.87125
 [8]  79.31017  91.43643  88.16632
> rowMin(tmp5,na.rm=TRUE)
 [1] 57.04407 59.30985 59.43149 54.38910 54.46750 56.87122 55.80980 57.19926
 [9] 54.47547 55.96660
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 108.17714  71.98048  69.24573  70.24941  67.95051  70.11946  67.31418
 [8]  66.45897  69.87140  70.83766  69.68957  70.84890  71.38298  65.97849
[15]  70.60462  67.79053  69.95409  72.62351  69.32358  69.99993
> colSums(tmp5,na.rm=TRUE)
 [1] 1081.7714  719.8048  692.4573  702.4941  679.5051  701.1946  673.1418
 [8]  664.5897  698.7140  637.5390  696.8957  708.4890  713.8298  659.7849
[15]  706.0462  677.9053  699.5409  726.2351  693.2358  699.9993
> colVars(tmp5,na.rm=TRUE)
 [1] 16533.27377    69.38894   104.01376    74.30957    34.89506    53.42207
 [7]    15.16006    63.78695    33.21972   115.39758    18.26978    72.87095
[13]   133.01796    49.57443    66.61316    43.39931    78.83912    64.04114
[19]    49.86647   105.98486
> colSd(tmp5,na.rm=TRUE)
 [1] 128.581779   8.330002  10.198714   8.620300   5.907204   7.309040
 [7]   3.893592   7.986673   5.763655  10.742326   4.274316   8.536448
[13]  11.533341   7.040911   8.161688   6.587815   8.879140   8.002571
[19]   7.061620  10.294895
> colMax(tmp5,na.rm=TRUE)
 [1] 473.53628  85.80689  83.86949  88.16632  77.78591  80.38661  76.66692
 [8]  79.64810  82.40429  87.36468  76.19193  90.47666  92.64781  77.94739
[15]  82.07841  77.80338  85.87125  86.54254  79.31017  91.43643
> colMin(tmp5,na.rm=TRUE)
 [1] 57.79595 58.57917 54.47547 57.04407 56.16488 55.80980 62.02136 54.38910
 [9] 64.77587 56.87122 63.31363 57.73316 57.98204 54.46750 55.96660 59.43149
[17] 59.36992 59.67869 60.51280 57.17098
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1] 89.73725 70.11865      NaN 67.87043 69.68651 69.10518 71.06093 69.94240
 [9] 68.08015 69.55160
> rowSums(tmp5,na.rm=TRUE)
 [1] 1794.745 1402.373    0.000 1357.409 1393.730 1382.104 1421.219 1398.848
 [9] 1361.603 1391.032
> rowVars(tmp5,na.rm=TRUE)
 [1] 8217.24169   44.40166         NA   70.58772  107.21898   54.77081
 [7]   61.33131   35.41393   84.88415   84.87870
> rowSd(tmp5,na.rm=TRUE)
 [1] 90.649003  6.663457        NA  8.401650 10.354660  7.400730  7.831431
 [8]  5.950960  9.213260  9.212964
> rowMax(tmp5,na.rm=TRUE)
 [1] 473.53628  80.29548        NA  92.64781  89.33946  90.47666  85.87125
 [8]  79.31017  91.43643  88.16632
> rowMin(tmp5,na.rm=TRUE)
 [1] 57.04407 59.30985       NA 54.38910 54.46750 56.87122 55.80980 57.19926
 [9] 54.47547 55.96660
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1] 110.97575  71.96613  69.09460  70.89825  68.00212  70.49158  67.24427
 [8]  67.04249  70.03058       NaN  69.23646  70.57707  71.62539  66.28575
[15]  70.17188  68.71931  69.77855  71.86881  68.69953  70.12736
> colSums(tmp5,na.rm=TRUE)
 [1] 998.7818 647.6951 621.8514 638.0842 612.0191 634.4242 605.1984 603.3824
 [9] 630.2752   0.0000 623.1282 635.1936 644.6285 596.5718 631.5469 618.4738
[17] 628.0069 646.8193 618.2958 631.1463
> colVars(tmp5,na.rm=TRUE)
 [1] 18511.82040    78.06024   116.75856    78.86219    39.22697    58.54205
 [7]    17.00009    67.92974    37.08714          NA    18.24385    81.14852
[13]   148.98415    54.70910    72.83308    39.11958    88.34733    65.63871
[19]    51.71868   119.05026
> colSd(tmp5,na.rm=TRUE)
 [1] 136.058151   8.835171  10.805487   8.880439   6.263144   7.651277
 [7]   4.123116   8.241950   6.089921         NA   4.271282   9.008248
[13]  12.205906   7.396560   8.534230   6.254565   9.399326   8.101772
[19]   7.191570  10.911016
> colMax(tmp5,na.rm=TRUE)
 [1] 473.53628  85.80689  83.86949  88.16632  77.78591  80.38661  76.66692
 [8]  79.64810  82.40429      -Inf  76.19193  90.47666  92.64781  77.94739
[15]  82.07841  77.80338  85.87125  86.54254  79.31017  91.43643
> colMin(tmp5,na.rm=TRUE)
 [1] 57.79595 58.57917 54.47547 57.04407 56.16488 55.80980 62.02136 54.38910
 [9] 64.77587      Inf 63.31363 57.73316 57.98204 54.46750 55.96660 60.18725
[17] 59.36992 59.67869 60.51280 57.17098
> 
> 
> 
> 
> 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] 310.9031 187.7499 276.4035 167.5056 260.2815 200.3063 415.4608 103.6307
 [9] 163.1533 363.2345
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 310.9031 187.7499 276.4035 167.5056 260.2815 200.3063 415.4608 103.6307
 [9] 163.1533 363.2345
> 
> 
> 
> copymatrix <- matrix(rnorm(200,150,15),10,20)
> 
> tmp5[1:10,1:20] <- copymatrix
> which.row <- 1
> which.col  <- 3
> cat(which.row," ",which.col,"\n")
1   3 
> tmp5[which.row,which.col] <- NA
> copymatrix[which.row,which.col] <- NA
> 
> colVars(tmp5,na.rm=TRUE)-apply(copymatrix,2,var,na.rm=TRUE)
 [1]  0.000000e+00  8.526513e-14  2.842171e-14 -1.989520e-13  1.705303e-13
 [6]  5.684342e-14 -8.526513e-14  5.684342e-14  0.000000e+00 -8.526513e-14
[11]  0.000000e+00  8.526513e-14  0.000000e+00  5.684342e-14  2.842171e-14
[16]  1.136868e-13  2.842171e-14 -1.136868e-13  0.000000e+00  0.000000e+00
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> ## 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)
+ }
1   7 
3   9 
7   5 
7   10 
2   3 
1   5 
1   6 
1   4 
2   3 
10   8 
3   20 
8   9 
9   19 
3   10 
9   12 
6   2 
5   8 
10   20 
1   8 
7   18 
There were 50 or more warnings (use warnings() to see the first 50)
> 
> 
> ### now test 1 by n and n by 1 matrix
> 
> 
> err.tol <- 1e-12
> 
> rm(tmp5)
> 
> dataset1 <- rnorm(100)
> dataset2 <- rnorm(100)
> 
> tmp <- createBufferedMatrix(1,100)
> tmp[1,] <- dataset1
> 
> tmp2 <- createBufferedMatrix(100,1)
> tmp2[,1] <- dataset2
> 
> 
> 
> 
> 
> Max(tmp)
[1] 2.838848
> Min(tmp)
[1] -2.333339
> mean(tmp)
[1] 0.1279512
> Sum(tmp)
[1] 12.79512
> Var(tmp)
[1] 1.324883
> 
> rowMeans(tmp)
[1] 0.1279512
> rowSums(tmp)
[1] 12.79512
> rowVars(tmp)
[1] 1.324883
> rowSd(tmp)
[1] 1.151036
> rowMax(tmp)
[1] 2.838848
> rowMin(tmp)
[1] -2.333339
> 
> colMeans(tmp)
  [1]  0.34439970 -0.50310339  0.80135119  0.90760996  2.63937114 -1.19144164
  [7] -0.26568177 -2.01100998 -1.89943934 -1.32234022  0.15982975 -2.32171283
 [13]  1.47041815  0.99146671 -0.82906211  0.06969365 -0.96571277 -0.25266348
 [19] -0.97381343  0.88672380 -1.36878232 -0.51018611  2.33739225 -1.37773009
 [25] -0.31178684 -1.01673090 -1.04647940 -0.21597792  1.32314464 -0.31199180
 [31]  0.78140367 -0.09994701 -1.16060306  1.91990257 -0.76093852  0.13491258
 [37] -0.27826981  1.08687710  1.56287545  1.28194805 -0.16983671  0.94607708
 [43] -0.31278542  1.61390447  0.71102415 -2.33333918 -0.50033264  1.40522227
 [49]  0.20513274 -0.41037541  0.20845461 -0.56133185  1.06965780  0.76626386
 [55]  1.53239520  1.82499866 -0.04158603  1.09269421  0.20079901  0.28553737
 [61]  2.83884848  1.95302298 -1.60511925  0.97765111  0.15053480  0.07632675
 [67]  0.71644943 -0.78335428 -0.91897832  0.46918768  0.13001130 -0.25455345
 [73]  0.14042525  2.28957217 -0.76840317  1.45249568  0.64418261  0.14558554
 [79]  0.46443395  1.90620270  0.11821520 -0.23218870  1.72804734  0.77292047
 [85] -1.21676922  0.64173658 -1.76108908  1.85450215 -1.99739526  0.93908787
 [91] -0.57647006  1.12765729 -0.04587682  1.05426564 -0.41407137 -0.71989996
 [97] -1.06854528 -0.59219808 -1.68799519 -0.38982853
> colSums(tmp)
  [1]  0.34439970 -0.50310339  0.80135119  0.90760996  2.63937114 -1.19144164
  [7] -0.26568177 -2.01100998 -1.89943934 -1.32234022  0.15982975 -2.32171283
 [13]  1.47041815  0.99146671 -0.82906211  0.06969365 -0.96571277 -0.25266348
 [19] -0.97381343  0.88672380 -1.36878232 -0.51018611  2.33739225 -1.37773009
 [25] -0.31178684 -1.01673090 -1.04647940 -0.21597792  1.32314464 -0.31199180
 [31]  0.78140367 -0.09994701 -1.16060306  1.91990257 -0.76093852  0.13491258
 [37] -0.27826981  1.08687710  1.56287545  1.28194805 -0.16983671  0.94607708
 [43] -0.31278542  1.61390447  0.71102415 -2.33333918 -0.50033264  1.40522227
 [49]  0.20513274 -0.41037541  0.20845461 -0.56133185  1.06965780  0.76626386
 [55]  1.53239520  1.82499866 -0.04158603  1.09269421  0.20079901  0.28553737
 [61]  2.83884848  1.95302298 -1.60511925  0.97765111  0.15053480  0.07632675
 [67]  0.71644943 -0.78335428 -0.91897832  0.46918768  0.13001130 -0.25455345
 [73]  0.14042525  2.28957217 -0.76840317  1.45249568  0.64418261  0.14558554
 [79]  0.46443395  1.90620270  0.11821520 -0.23218870  1.72804734  0.77292047
 [85] -1.21676922  0.64173658 -1.76108908  1.85450215 -1.99739526  0.93908787
 [91] -0.57647006  1.12765729 -0.04587682  1.05426564 -0.41407137 -0.71989996
 [97] -1.06854528 -0.59219808 -1.68799519 -0.38982853
> colVars(tmp)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> colSd(tmp)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> colMax(tmp)
  [1]  0.34439970 -0.50310339  0.80135119  0.90760996  2.63937114 -1.19144164
  [7] -0.26568177 -2.01100998 -1.89943934 -1.32234022  0.15982975 -2.32171283
 [13]  1.47041815  0.99146671 -0.82906211  0.06969365 -0.96571277 -0.25266348
 [19] -0.97381343  0.88672380 -1.36878232 -0.51018611  2.33739225 -1.37773009
 [25] -0.31178684 -1.01673090 -1.04647940 -0.21597792  1.32314464 -0.31199180
 [31]  0.78140367 -0.09994701 -1.16060306  1.91990257 -0.76093852  0.13491258
 [37] -0.27826981  1.08687710  1.56287545  1.28194805 -0.16983671  0.94607708
 [43] -0.31278542  1.61390447  0.71102415 -2.33333918 -0.50033264  1.40522227
 [49]  0.20513274 -0.41037541  0.20845461 -0.56133185  1.06965780  0.76626386
 [55]  1.53239520  1.82499866 -0.04158603  1.09269421  0.20079901  0.28553737
 [61]  2.83884848  1.95302298 -1.60511925  0.97765111  0.15053480  0.07632675
 [67]  0.71644943 -0.78335428 -0.91897832  0.46918768  0.13001130 -0.25455345
 [73]  0.14042525  2.28957217 -0.76840317  1.45249568  0.64418261  0.14558554
 [79]  0.46443395  1.90620270  0.11821520 -0.23218870  1.72804734  0.77292047
 [85] -1.21676922  0.64173658 -1.76108908  1.85450215 -1.99739526  0.93908787
 [91] -0.57647006  1.12765729 -0.04587682  1.05426564 -0.41407137 -0.71989996
 [97] -1.06854528 -0.59219808 -1.68799519 -0.38982853
> colMin(tmp)
  [1]  0.34439970 -0.50310339  0.80135119  0.90760996  2.63937114 -1.19144164
  [7] -0.26568177 -2.01100998 -1.89943934 -1.32234022  0.15982975 -2.32171283
 [13]  1.47041815  0.99146671 -0.82906211  0.06969365 -0.96571277 -0.25266348
 [19] -0.97381343  0.88672380 -1.36878232 -0.51018611  2.33739225 -1.37773009
 [25] -0.31178684 -1.01673090 -1.04647940 -0.21597792  1.32314464 -0.31199180
 [31]  0.78140367 -0.09994701 -1.16060306  1.91990257 -0.76093852  0.13491258
 [37] -0.27826981  1.08687710  1.56287545  1.28194805 -0.16983671  0.94607708
 [43] -0.31278542  1.61390447  0.71102415 -2.33333918 -0.50033264  1.40522227
 [49]  0.20513274 -0.41037541  0.20845461 -0.56133185  1.06965780  0.76626386
 [55]  1.53239520  1.82499866 -0.04158603  1.09269421  0.20079901  0.28553737
 [61]  2.83884848  1.95302298 -1.60511925  0.97765111  0.15053480  0.07632675
 [67]  0.71644943 -0.78335428 -0.91897832  0.46918768  0.13001130 -0.25455345
 [73]  0.14042525  2.28957217 -0.76840317  1.45249568  0.64418261  0.14558554
 [79]  0.46443395  1.90620270  0.11821520 -0.23218870  1.72804734  0.77292047
 [85] -1.21676922  0.64173658 -1.76108908  1.85450215 -1.99739526  0.93908787
 [91] -0.57647006  1.12765729 -0.04587682  1.05426564 -0.41407137 -0.71989996
 [97] -1.06854528 -0.59219808 -1.68799519 -0.38982853
> colMedians(tmp)
  [1]  0.34439970 -0.50310339  0.80135119  0.90760996  2.63937114 -1.19144164
  [7] -0.26568177 -2.01100998 -1.89943934 -1.32234022  0.15982975 -2.32171283
 [13]  1.47041815  0.99146671 -0.82906211  0.06969365 -0.96571277 -0.25266348
 [19] -0.97381343  0.88672380 -1.36878232 -0.51018611  2.33739225 -1.37773009
 [25] -0.31178684 -1.01673090 -1.04647940 -0.21597792  1.32314464 -0.31199180
 [31]  0.78140367 -0.09994701 -1.16060306  1.91990257 -0.76093852  0.13491258
 [37] -0.27826981  1.08687710  1.56287545  1.28194805 -0.16983671  0.94607708
 [43] -0.31278542  1.61390447  0.71102415 -2.33333918 -0.50033264  1.40522227
 [49]  0.20513274 -0.41037541  0.20845461 -0.56133185  1.06965780  0.76626386
 [55]  1.53239520  1.82499866 -0.04158603  1.09269421  0.20079901  0.28553737
 [61]  2.83884848  1.95302298 -1.60511925  0.97765111  0.15053480  0.07632675
 [67]  0.71644943 -0.78335428 -0.91897832  0.46918768  0.13001130 -0.25455345
 [73]  0.14042525  2.28957217 -0.76840317  1.45249568  0.64418261  0.14558554
 [79]  0.46443395  1.90620270  0.11821520 -0.23218870  1.72804734  0.77292047
 [85] -1.21676922  0.64173658 -1.76108908  1.85450215 -1.99739526  0.93908787
 [91] -0.57647006  1.12765729 -0.04587682  1.05426564 -0.41407137 -0.71989996
 [97] -1.06854528 -0.59219808 -1.68799519 -0.38982853
> colRanges(tmp)
          [,1]       [,2]      [,3]    [,4]     [,5]      [,6]       [,7]
[1,] 0.3443997 -0.5031034 0.8013512 0.90761 2.639371 -1.191442 -0.2656818
[2,] 0.3443997 -0.5031034 0.8013512 0.90761 2.639371 -1.191442 -0.2656818
         [,8]      [,9]    [,10]     [,11]     [,12]    [,13]     [,14]
[1,] -2.01101 -1.899439 -1.32234 0.1598297 -2.321713 1.470418 0.9914667
[2,] -2.01101 -1.899439 -1.32234 0.1598297 -2.321713 1.470418 0.9914667
          [,15]      [,16]      [,17]      [,18]      [,19]     [,20]     [,21]
[1,] -0.8290621 0.06969365 -0.9657128 -0.2526635 -0.9738134 0.8867238 -1.368782
[2,] -0.8290621 0.06969365 -0.9657128 -0.2526635 -0.9738134 0.8867238 -1.368782
          [,22]    [,23]    [,24]      [,25]     [,26]     [,27]      [,28]
[1,] -0.5101861 2.337392 -1.37773 -0.3117868 -1.016731 -1.046479 -0.2159779
[2,] -0.5101861 2.337392 -1.37773 -0.3117868 -1.016731 -1.046479 -0.2159779
        [,29]      [,30]     [,31]       [,32]     [,33]    [,34]      [,35]
[1,] 1.323145 -0.3119918 0.7814037 -0.09994701 -1.160603 1.919903 -0.7609385
[2,] 1.323145 -0.3119918 0.7814037 -0.09994701 -1.160603 1.919903 -0.7609385
         [,36]      [,37]    [,38]    [,39]    [,40]      [,41]     [,42]
[1,] 0.1349126 -0.2782698 1.086877 1.562875 1.281948 -0.1698367 0.9460771
[2,] 0.1349126 -0.2782698 1.086877 1.562875 1.281948 -0.1698367 0.9460771
          [,43]    [,44]     [,45]     [,46]      [,47]    [,48]     [,49]
[1,] -0.3127854 1.613904 0.7110242 -2.333339 -0.5003326 1.405222 0.2051327
[2,] -0.3127854 1.613904 0.7110242 -2.333339 -0.5003326 1.405222 0.2051327
          [,50]     [,51]      [,52]    [,53]     [,54]    [,55]    [,56]
[1,] -0.4103754 0.2084546 -0.5613319 1.069658 0.7662639 1.532395 1.824999
[2,] -0.4103754 0.2084546 -0.5613319 1.069658 0.7662639 1.532395 1.824999
           [,57]    [,58]    [,59]     [,60]    [,61]    [,62]     [,63]
[1,] -0.04158603 1.092694 0.200799 0.2855374 2.838848 1.953023 -1.605119
[2,] -0.04158603 1.092694 0.200799 0.2855374 2.838848 1.953023 -1.605119
         [,64]     [,65]      [,66]     [,67]      [,68]      [,69]     [,70]
[1,] 0.9776511 0.1505348 0.07632675 0.7164494 -0.7833543 -0.9189783 0.4691877
[2,] 0.9776511 0.1505348 0.07632675 0.7164494 -0.7833543 -0.9189783 0.4691877
         [,71]      [,72]     [,73]    [,74]      [,75]    [,76]     [,77]
[1,] 0.1300113 -0.2545534 0.1404253 2.289572 -0.7684032 1.452496 0.6441826
[2,] 0.1300113 -0.2545534 0.1404253 2.289572 -0.7684032 1.452496 0.6441826
         [,78]    [,79]    [,80]     [,81]      [,82]    [,83]     [,84]
[1,] 0.1455855 0.464434 1.906203 0.1182152 -0.2321887 1.728047 0.7729205
[2,] 0.1455855 0.464434 1.906203 0.1182152 -0.2321887 1.728047 0.7729205
         [,85]     [,86]     [,87]    [,88]     [,89]     [,90]      [,91]
[1,] -1.216769 0.6417366 -1.761089 1.854502 -1.997395 0.9390879 -0.5764701
[2,] -1.216769 0.6417366 -1.761089 1.854502 -1.997395 0.9390879 -0.5764701
        [,92]       [,93]    [,94]      [,95]   [,96]     [,97]      [,98]
[1,] 1.127657 -0.04587682 1.054266 -0.4140714 -0.7199 -1.068545 -0.5921981
[2,] 1.127657 -0.04587682 1.054266 -0.4140714 -0.7199 -1.068545 -0.5921981
         [,99]     [,100]
[1,] -1.687995 -0.3898285
[2,] -1.687995 -0.3898285
> 
> 
> Max(tmp2)
[1] 2.25327
> Min(tmp2)
[1] -2.187369
> mean(tmp2)
[1] 0.02308285
> Sum(tmp2)
[1] 2.308285
> Var(tmp2)
[1] 0.8732222
> 
> rowMeans(tmp2)
  [1]  0.78719905 -1.17147324  0.56855304  0.99376703  0.19135240 -0.93817816
  [7]  0.38457338 -1.42891150  1.24529530  0.91409289  1.05558138 -2.18736874
 [13]  0.58097493 -0.50509158 -0.01596164 -1.09007078 -0.64478388  0.19538314
 [19] -0.21569776  2.14783268 -0.05919088 -0.99017925  2.25326970 -0.95978612
 [25]  0.25238438 -0.65971630 -0.05351659 -1.24530106  0.78073203  0.13459247
 [31]  0.17959651  0.52836984  1.75774356  1.16805994  0.70344996  0.15906463
 [37]  0.85101524  0.05274414 -1.52678577 -1.08589653 -0.50358751  0.61190425
 [43] -0.66693416  1.56601267  0.67391540 -0.65465611 -0.86331958 -0.40507116
 [49]  1.38976762  0.87162609  0.36504630 -0.57766911 -0.83822190  1.21563017
 [55]  1.13125579  0.14002646 -1.09598777 -1.07006019  1.13511336 -0.27033715
 [61]  0.21295492  0.83518836 -1.14263102 -0.26977180  0.12222695  0.83838709
 [67] -1.21690286  0.21687840 -0.18548135 -0.89282561  0.86088373  0.14702827
 [73]  0.55316511 -0.60766770  0.22030395  1.21379915 -0.48874489 -0.42851270
 [79] -0.29934133 -0.45058861 -0.48240726 -1.03622311 -0.96575172 -0.99063698
 [85] -1.10932337  1.18933023 -0.61015194 -1.68224197  0.34673321 -1.70684109
 [91] -0.16481467  1.20167373  0.68943721 -0.69029089  1.84267743 -0.15954312
 [97]  1.17632845  1.26757691 -0.47628405  0.16851895
> rowSums(tmp2)
  [1]  0.78719905 -1.17147324  0.56855304  0.99376703  0.19135240 -0.93817816
  [7]  0.38457338 -1.42891150  1.24529530  0.91409289  1.05558138 -2.18736874
 [13]  0.58097493 -0.50509158 -0.01596164 -1.09007078 -0.64478388  0.19538314
 [19] -0.21569776  2.14783268 -0.05919088 -0.99017925  2.25326970 -0.95978612
 [25]  0.25238438 -0.65971630 -0.05351659 -1.24530106  0.78073203  0.13459247
 [31]  0.17959651  0.52836984  1.75774356  1.16805994  0.70344996  0.15906463
 [37]  0.85101524  0.05274414 -1.52678577 -1.08589653 -0.50358751  0.61190425
 [43] -0.66693416  1.56601267  0.67391540 -0.65465611 -0.86331958 -0.40507116
 [49]  1.38976762  0.87162609  0.36504630 -0.57766911 -0.83822190  1.21563017
 [55]  1.13125579  0.14002646 -1.09598777 -1.07006019  1.13511336 -0.27033715
 [61]  0.21295492  0.83518836 -1.14263102 -0.26977180  0.12222695  0.83838709
 [67] -1.21690286  0.21687840 -0.18548135 -0.89282561  0.86088373  0.14702827
 [73]  0.55316511 -0.60766770  0.22030395  1.21379915 -0.48874489 -0.42851270
 [79] -0.29934133 -0.45058861 -0.48240726 -1.03622311 -0.96575172 -0.99063698
 [85] -1.10932337  1.18933023 -0.61015194 -1.68224197  0.34673321 -1.70684109
 [91] -0.16481467  1.20167373  0.68943721 -0.69029089  1.84267743 -0.15954312
 [97]  1.17632845  1.26757691 -0.47628405  0.16851895
> 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.78719905 -1.17147324  0.56855304  0.99376703  0.19135240 -0.93817816
  [7]  0.38457338 -1.42891150  1.24529530  0.91409289  1.05558138 -2.18736874
 [13]  0.58097493 -0.50509158 -0.01596164 -1.09007078 -0.64478388  0.19538314
 [19] -0.21569776  2.14783268 -0.05919088 -0.99017925  2.25326970 -0.95978612
 [25]  0.25238438 -0.65971630 -0.05351659 -1.24530106  0.78073203  0.13459247
 [31]  0.17959651  0.52836984  1.75774356  1.16805994  0.70344996  0.15906463
 [37]  0.85101524  0.05274414 -1.52678577 -1.08589653 -0.50358751  0.61190425
 [43] -0.66693416  1.56601267  0.67391540 -0.65465611 -0.86331958 -0.40507116
 [49]  1.38976762  0.87162609  0.36504630 -0.57766911 -0.83822190  1.21563017
 [55]  1.13125579  0.14002646 -1.09598777 -1.07006019  1.13511336 -0.27033715
 [61]  0.21295492  0.83518836 -1.14263102 -0.26977180  0.12222695  0.83838709
 [67] -1.21690286  0.21687840 -0.18548135 -0.89282561  0.86088373  0.14702827
 [73]  0.55316511 -0.60766770  0.22030395  1.21379915 -0.48874489 -0.42851270
 [79] -0.29934133 -0.45058861 -0.48240726 -1.03622311 -0.96575172 -0.99063698
 [85] -1.10932337  1.18933023 -0.61015194 -1.68224197  0.34673321 -1.70684109
 [91] -0.16481467  1.20167373  0.68943721 -0.69029089  1.84267743 -0.15954312
 [97]  1.17632845  1.26757691 -0.47628405  0.16851895
> rowMin(tmp2)
  [1]  0.78719905 -1.17147324  0.56855304  0.99376703  0.19135240 -0.93817816
  [7]  0.38457338 -1.42891150  1.24529530  0.91409289  1.05558138 -2.18736874
 [13]  0.58097493 -0.50509158 -0.01596164 -1.09007078 -0.64478388  0.19538314
 [19] -0.21569776  2.14783268 -0.05919088 -0.99017925  2.25326970 -0.95978612
 [25]  0.25238438 -0.65971630 -0.05351659 -1.24530106  0.78073203  0.13459247
 [31]  0.17959651  0.52836984  1.75774356  1.16805994  0.70344996  0.15906463
 [37]  0.85101524  0.05274414 -1.52678577 -1.08589653 -0.50358751  0.61190425
 [43] -0.66693416  1.56601267  0.67391540 -0.65465611 -0.86331958 -0.40507116
 [49]  1.38976762  0.87162609  0.36504630 -0.57766911 -0.83822190  1.21563017
 [55]  1.13125579  0.14002646 -1.09598777 -1.07006019  1.13511336 -0.27033715
 [61]  0.21295492  0.83518836 -1.14263102 -0.26977180  0.12222695  0.83838709
 [67] -1.21690286  0.21687840 -0.18548135 -0.89282561  0.86088373  0.14702827
 [73]  0.55316511 -0.60766770  0.22030395  1.21379915 -0.48874489 -0.42851270
 [79] -0.29934133 -0.45058861 -0.48240726 -1.03622311 -0.96575172 -0.99063698
 [85] -1.10932337  1.18933023 -0.61015194 -1.68224197  0.34673321 -1.70684109
 [91] -0.16481467  1.20167373  0.68943721 -0.69029089  1.84267743 -0.15954312
 [97]  1.17632845  1.26757691 -0.47628405  0.16851895
> 
> colMeans(tmp2)
[1] 0.02308285
> colSums(tmp2)
[1] 2.308285
> colVars(tmp2)
[1] 0.8732222
> colSd(tmp2)
[1] 0.9344636
> colMax(tmp2)
[1] 2.25327
> colMin(tmp2)
[1] -2.187369
> colMedians(tmp2)
[1] 0.08748555
> colRanges(tmp2)
          [,1]
[1,] -2.187369
[2,]  2.253270
> 
> dataset1 <- matrix(dataset1,1,100)
> 
> agree.checks(tmp,dataset1)
> 
> dataset2 <- matrix(dataset2,100,1)
> agree.checks(tmp2,dataset2)
>   
> 
> tmp <- createBufferedMatrix(10,10)
> 
> tmp[1:10,1:10] <- rnorm(100)
> colApply(tmp,sum)
 [1]  2.3899135  0.5724590  2.9708960 -0.8756505  0.6682220 -0.9095832
 [7] -0.6155334 -7.7771090  3.4568131  2.2599130
> colApply(tmp,quantile)[,1]
            [,1]
[1,] -1.60583102
[2,] -0.69027339
[3,] -0.01695966
[4,]  0.95575498
[5,]  3.40841882
> 
> rowApply(tmp,sum)
 [1]  2.477503654  1.388992400  0.002507165 -2.050983363  1.789606308
 [6] -1.667126426 -0.547285269  0.761430501  1.445080170 -1.459384724
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    7    8    5    9   10    4    4    2    4     1
 [2,]    5    3    8    8    6    5   10    3    6     4
 [3,]    2    7    6    6    5    8    6    8   10     8
 [4,]    9    4    4   10    2    2    3    6    9     2
 [5,]    8   10    7    1    9    6    1    1    8     5
 [6,]    3    2    9    2    7    9    7    5    3     3
 [7,]    4    9    1    3    4    3    9   10    5     6
 [8,]    1    5    3    7    1    1    2    4    2     7
 [9,]    6    1   10    5    8    7    5    7    7    10
[10,]   10    6    2    4    3   10    8    9    1     9
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1]  1.5444435 -1.7181585 -1.6357745 -0.3299123 -0.5393683 -4.1679858
 [7]  3.0822250 -1.8256692 -1.8406631  1.2303483  2.0119718 -1.6001267
[13] -3.5011073  2.3338059 -1.5108883 -2.0889670 -0.4470630 -3.5798166
[19]  0.4085182  0.7578223
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -1.2771009
[2,] -0.3761432
[3,]  0.3824557
[4,]  0.9676712
[5,]  1.8475607
> 
> rowApply(tmp,sum)
[1] -2.9808876 -3.7320658 -9.3938294 -0.1925472  2.8829643
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]   18   15    5    8   19
[2,]   13   16    8    6    4
[3,]    9   17   10   10    3
[4,]    4   12   15   16    9
[5,]   10    7    6   19   10
> 
> 
> as.matrix(tmp)
           [,1]       [,2]       [,3]        [,4]       [,5]        [,6]
[1,]  0.9676712  0.1577678 -0.3924664 -0.96270426 -0.3608383  0.02085409
[2,]  0.3824557  0.7618877  0.8154927  0.05268613 -0.5578133 -2.63599795
[3,] -1.2771009 -0.8992795 -0.5809966  0.32352488 -1.2302236  0.41288884
[4,] -0.3761432 -0.5831963 -0.1444931  0.70533718  1.4611856 -0.60946448
[5,]  1.8475607 -1.1553381 -1.3333112 -0.44875627  0.1483213 -1.35626630
           [,7]          [,8]        [,9]      [,10]      [,11]      [,12]
[1,]  1.1004302 -2.1273122696 -0.11152970 -0.4037146  1.4348264  0.3859512
[2,]  1.4750835 -0.4047942940  1.19663167  1.8410013 -0.1272048 -1.1984572
[3,]  0.4874158 -1.3272531705 -1.87837660  1.0602776 -0.9141938 -0.6221531
[4,]  1.5578822  0.0006620617 -0.05461112 -0.7420825  0.9658084 -0.4383104
[5,] -1.5385867  2.0330284609 -0.99277738 -0.5251335  0.6527357  0.2728428
          [,13]       [,14]      [,15]      [,16]      [,17]       [,18]
[1,] -0.4558616  0.44766688 -0.6201289 -1.4881909  0.5260341 -1.63791498
[2,] -0.8432775 -0.83817839 -0.2646798 -1.5371381 -0.2914328  0.07726692
[3,] -2.8406130  0.01631446 -2.1369334 -0.2111579  0.1593149  0.97124070
[4,] -0.5979389  1.42903349 -0.1610649  0.1940608  0.2115400 -1.93645391
[5,]  1.2365837  1.27896951  1.6719188  0.9534590 -1.0525193 -1.05395537
           [,19]     [,20]
[1,]  0.95529543 -0.416723
[2,] -1.90032610  0.264729
[3,]  0.04563757  1.047837
[4,]  0.56029663 -1.634595
[5,]  0.74761465  1.496574
> 
> 
> is.BufferedMatrix(tmp)
[1] TRUE
> 
> as.BufferedMatrix(as.matrix(tmp))
BufferedMatrix object
Matrix size:  5 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  800  bytes.
> 
> 
> 
> subBufferedMatrix(tmp,1:5,1:5)
BufferedMatrix object
Matrix size:  5 5 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  654  bytes.
Disk usage :  200  bytes.
> subBufferedMatrix(tmp,,5:8)
BufferedMatrix object
Matrix size:  5 4 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  565  bytes.
Disk usage :  160  bytes.
> subBufferedMatrix(tmp,1:3,)
BufferedMatrix object
Matrix size:  3 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  480  bytes.
> 
> 
> rm(tmp)
> 
> 
> ###
> ### Testing colnames and rownames
> ###
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> 
> 
> colnames(tmp)
NULL
> rownames(tmp)
NULL
> 
> 
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> colnames(tmp)
 [1] "col1"  "col2"  "col3"  "col4"  "col5"  "col6"  "col7"  "col8"  "col9" 
[10] "col10" "col11" "col12" "col13" "col14" "col15" "col16" "col17" "col18"
[19] "col19" "col20"
> rownames(tmp)
[1] "row1" "row2" "row3" "row4" "row5"
> 
> 
> tmp["row1",]
          col1      col2        col3     col4       col5       col6       col7
row1 0.5703736 -1.837586 -0.07014745 1.048369 -0.5815251 -0.4674158 -0.8119541
          col8      col9    col10     col11      col12      col13     col14
row1 -1.475427 -0.693162 -0.94371 -1.358652 -0.9280934 -0.6601939 -1.288403
         col15   col16      col17      col18     col19      col20
row1 0.9263812 1.21276 -0.8336813 -0.8994359 0.9060116 -0.4009701
> tmp[,"col10"]
          col10
row1 -0.9437100
row2  0.6911499
row3  0.4215545
row4  1.6309368
row5  0.8421802
> tmp[c("row1","row5"),]
           col1       col2        col3       col4       col5       col6
row1  0.5703736 -1.8375857 -0.07014745  1.0483686 -0.5815251 -0.4674158
row5 -0.1004228 -0.2069567  0.26095666 -0.2236117  1.4460379  0.9297905
           col7       col8      col9      col10      col11      col12
row1 -0.8119541 -1.4754272 -0.693162 -0.9437100 -1.3586516 -0.9280934
row5 -2.1408964  0.7467463  1.166572  0.8421802  0.9345004 -1.1096843
          col13      col14      col15       col16      col17      col18
row1 -0.6601939 -1.2884032  0.9263812  1.21275987 -0.8336813 -0.8994359
row5 -1.8355871  0.1323834 -0.3446477 -0.09767506 -1.9480821  0.3620029
          col19      col20
row1  0.9060116 -0.4009701
row5 -2.3576987 -1.4325440
> tmp[,c("col6","col20")]
           col6      col20
row1 -0.4674158 -0.4009701
row2 -1.0993389  0.2158561
row3  0.8432113 -0.8520471
row4  0.5240728  1.7578674
row5  0.9297905 -1.4325440
> tmp[c("row1","row5"),c("col6","col20")]
           col6      col20
row1 -0.4674158 -0.4009701
row5  0.9297905 -1.4325440
> 
> 
> 
> 
> tmp["row1",] <- rnorm(20,mean=10)
> tmp[,"col10"] <- rnorm(5,mean=30)
> tmp[c("row1","row5"),] <- rnorm(40,mean=50)
> tmp[,c("col6","col20")] <- rnorm(10,mean=75)
> tmp[c("row1","row5"),c("col6","col20")]  <- rnorm(4,mean=105)
> 
> tmp["row1",]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 51.13267 48.28676 48.73111 49.57162 50.72202 103.4456 49.86999 51.78693
         col9    col10    col11    col12   col13    col14    col15    col16
row1 49.78393 47.45268 50.90575 47.49857 47.8397 49.22541 50.56126 48.06228
        col17    col18    col19    col20
row1 50.83119 48.96951 50.01869 105.1098
> tmp[,"col10"]
        col10
row1 47.45268
row2 30.66354
row3 31.75056
row4 29.75235
row5 48.97510
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 51.13267 48.28676 48.73111 49.57162 50.72202 103.4456 49.86999 51.78693
row5 50.13208 49.96209 49.00542 52.23649 49.58431 105.5884 49.69901 51.07494
         col9    col10    col11    col12   col13    col14    col15    col16
row1 49.78393 47.45268 50.90575 47.49857 47.8397 49.22541 50.56126 48.06228
row5 50.21316 48.97510 49.14828 50.16238 49.5212 50.84419 49.62744 50.45846
        col17    col18    col19    col20
row1 50.83119 48.96951 50.01869 105.1098
row5 48.90296 49.95012 50.12894 105.5999
> tmp[,c("col6","col20")]
          col6     col20
row1 103.44560 105.10983
row2  74.64740  74.44852
row3  75.40795  73.88471
row4  74.24548  75.23256
row5 105.58838 105.59987
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 103.4456 105.1098
row5 105.5884 105.5999
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 103.4456 105.1098
row5 105.5884 105.5999
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
          col13
[1,] -0.7365561
[2,]  0.5343265
[3,] -0.2007881
[4,] -0.4508347
[5,]  1.1795831
> tmp[,c("col17","col7")]
          col17        col7
[1,]  2.5422914  0.05869537
[2,]  0.9358422  0.97937914
[3,] -0.7307338  0.04374093
[4,]  0.7005390  0.86668592
[5,] -1.0568334 -0.84174320
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
           col6      col20
[1,] -0.3860972  0.7707754
[2,] -0.5080268 -0.9069586
[3,]  0.9526823  0.9263933
[4,]  0.1682416  0.3634027
[5,] -0.3807110 -1.0387400
> subBufferedMatrix(tmp,1,c("col6"))[,1]
           col1
[1,] -0.3860972
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
           col6
[1,] -0.3860972
[2,] -0.5080268
> 
> 
> 
> 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.1704275 -0.5613262 -2.4815249 1.5152867  0.7938181  0.1847018 1.9225278
row1 -0.1859549 -2.0931427  0.4709032 0.1914951 -0.1090012 -0.8591785 0.5081302
           [,8]       [,9]     [,10]      [,11]     [,12]      [,13]      [,14]
row3  0.4176263  0.4051509 -2.064808 -0.4305248 1.7254509 -0.3327988  0.8897191
row1 -0.1039924 -0.6775098  1.531704  0.4293067 0.7788134  0.4936417 -1.2092894
          [,15]     [,16]      [,17]      [,18]      [,19]      [,20]
row3 -0.8536477  0.508504 -0.3676630 -0.4335322 -0.4407061  0.5038567
row1  0.6638338 -0.733905  0.9812674 -0.5256779  1.7631995 -0.9836812
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
          [,1]     [,2]      [,3]      [,4]        [,5]       [,6]      [,7]
row2 0.7865253 1.164161 -1.971526 -0.632742 -0.03290069 -0.5803871 0.0230741
          [,8]     [,9]     [,10]
row2 -1.187392 1.810121 0.2716555
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
            [,1]     [,2]      [,3]    [,4]     [,5]      [,6]      [,7]
row5 -0.05376889 1.152586 -1.581651 1.54635 2.041915 0.1628128 0.1879411
          [,8]      [,9]      [,10]      [,11]     [,12]     [,13]    [,14]
row5 -1.222923 -0.298082 -0.9680419 -0.2174006 0.7711277 -1.786409 1.441308
          [,15]       [,16]    [,17]     [,18]     [,19]     [,20]
row5 0.04947766 -0.05555992 -1.08673 -1.407326 -1.662586 -1.231378
> 
> 
> 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: 0x5627498de2a0>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "/home/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM244d56410efae8"
 [2] "/home/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM244d563ada009b"
 [3] "/home/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM244d564ca45bef"
 [4] "/home/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM244d5648b04dd2"
 [5] "/home/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM244d5664ad8fe0"
 [6] "/home/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM244d56de60028" 
 [7] "/home/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM244d566dd880e9"
 [8] "/home/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM244d56b89a236" 
 [9] "/home/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM244d5620b13ca8"
[10] "/home/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM244d56536b4f52"
[11] "/home/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM244d561a0561ca"
[12] "/home/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM244d567cbcc4ad"
[13] "/home/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM244d562201eed6"
[14] "/home/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM244d567f6c1823"
[15] "/home/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM244d56382489f9"
> 
> 
> ### 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: 0x562746d640e0>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x562746d640e0>
Warning message:
In dir.create(new.directory) :
  '/home/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x562746d640e0>
> rowMedians(tmp)
  [1] -0.4849866687  0.6639600142  0.4319543142  0.1617090711  0.1151112756
  [6] -0.7492641496  0.1657912225  0.3431792863 -0.9329098318 -0.3208375836
 [11]  0.0678575080 -0.1467323359 -0.2520785767 -0.1038912948 -0.0326170719
 [16]  0.3080770854  0.4007075131  0.1278985987 -0.6722724348 -0.0611377054
 [21]  0.0620078527 -0.1364758775 -0.1657107607  0.3159978602  0.4931284039
 [26]  0.1206449840 -0.1350023180 -0.2164237408  0.2733279569 -0.6186428573
 [31] -0.7189033528  0.4094982505 -0.0365799977 -0.0758293278 -0.3772932587
 [36]  0.4101562980 -0.2288027328 -0.1328739980  0.5306543417 -0.1664605838
 [41]  0.4065898796  0.3964684274  0.2791747362 -0.2497512410 -0.3724229474
 [46]  0.3404012625 -0.0894536029 -0.3915529807 -0.1631911376  0.3220827986
 [51] -0.1154998764  0.2476621390  0.0497507063 -0.3178350001 -0.3677828792
 [56] -0.0848171138  0.2713723374  0.2998213360  0.1028643353  0.1628787899
 [61] -0.2484742287 -0.0331572596 -0.0747246041  0.0795099749 -0.1291984016
 [66]  0.1957114264 -0.1563552180 -0.0659683357  0.1090960393 -0.2309273632
 [71]  0.6260048746  0.3206725514  0.1655666625  0.5551387367  0.4687608918
 [76]  0.0544781384  0.5312117400  0.1361623549  0.3899454261 -0.0411583998
 [81]  0.0431740206  0.2275556912  0.2903610788  0.2688157175  0.1124221665
 [86] -0.0381240794  0.0067251777  0.0824109328 -0.0200184165 -0.1355174711
 [91]  0.2213000682 -0.5613156886  0.4088025754  0.2879344451 -0.2673595713
 [96]  0.1457778752 -0.0801715203 -0.2831613799  0.3280557983  0.3236009201
[101] -0.4340321691 -0.2033579732 -0.1744259541  0.0945876117 -0.1170595783
[106]  0.0163358840 -0.1319460455 -0.1316211008 -0.1237206212 -0.0566056219
[111]  0.1661210030  0.2848435326  0.1390594729 -0.0507382588  0.1639247558
[116] -0.0847065115 -0.0198171579 -0.0657042511  0.2052533355 -0.3519695643
[121] -0.3085132663 -0.0914124976  0.5539608918 -0.0137503861 -0.1561600780
[126] -0.1889024594  0.2676211223 -0.1399116435  0.1109516222 -0.0748984100
[131] -0.3130645034 -0.3039747140  0.4288158233 -0.1759742511 -0.2821204848
[136] -0.0657530660 -0.0009431537 -0.0206361544 -0.4030043104 -0.3569731905
[141] -0.3416215813 -0.3190084602 -0.3315398959 -0.1727589125  0.5761503166
[146] -0.1197414857  0.0772233956  0.2869075494 -0.9910348256  0.0758191508
[151]  0.4654107831 -0.0220275558  0.3268074001  0.1309991538  0.0606209167
[156]  0.1524571970  0.2012452792  0.4842707928 -0.2654959319 -0.0493394260
[161] -0.2285814247 -0.1637607640 -0.1420707723  0.2031926839  0.2870653148
[166]  0.0532740032  0.0770648777  0.4668677765  0.0696730021 -0.1670952096
[171]  0.1803039853  0.3240847508  0.3566799077  0.0002643209 -0.1085976817
[176] -0.0482743678 -0.0038531745 -0.4400524221 -0.2252488660 -0.5050275862
[181]  0.1900468496 -0.2299529807 -0.1595652646 -0.3147436142  0.7539593191
[186]  0.1995257419 -0.6043676760  0.4768848228  0.2810731679 -0.1562857724
[191]  0.1697929606  0.0011737908 -0.0376224065  0.0445736712 -0.4166964822
[196]  0.1413589918 -0.0502096453  0.0090370809  0.0574324618 -0.2580711133
[201] -0.2066080987 -0.1279911435  0.1191044241  0.0773198506  0.1093870691
[206] -0.1577153305 -0.6484624958  0.1705106597  0.3057783700 -0.1801191250
[211] -0.5511931934 -0.3723949292  0.4889571687  0.1062042159  0.4281475589
[216]  0.3334392021  0.3388760079  0.2703079653 -0.2347797614  0.2678826803
[221]  0.8492442162 -0.5128808771  0.3850426650 -0.0659285071  0.2211076286
[226]  0.0397983214 -0.2618300787  0.3531812634 -0.0898530207 -0.0721911438
> 
> proc.time()
   user  system elapsed 
  1.251   0.673   1.923 

BufferedMatrix.Rcheck/tests/rawCalltesting.Rout


R version 4.4.0 RC (2024-04-16 r86468) -- "Puppy Cup"
Copyright (C) 2024 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu

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: 0x55d5d69d56b0>
> .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: 0x55d5d69d56b0>
> .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: 0x55d5d69d56b0>
> .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: 0x55d5d69d56b0>
> 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: 0x55d5d6ac1990>
> .Call("R_bm_AddColumn",P)
<pointer: 0x55d5d6ac1990>
> .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: 0x55d5d6ac1990>
> .Call("R_bm_AddColumn",P)
<pointer: 0x55d5d6ac1990>
> .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: 0x55d5d6ac1990>
> 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: 0x55d5d69c9f20>
> .Call("R_bm_AddColumn",P)
<pointer: 0x55d5d69c9f20>
> .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: 0x55d5d69c9f20>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x55d5d69c9f20>
> .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: 0x55d5d69c9f20>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x55d5d69c9f20>
> .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: 0x55d5d69c9f20>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x55d5d69c9f20>
> .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: 0x55d5d69c9f20>
> 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: 0x55d5d5384650>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x55d5d5384650>
> .Call("R_bm_AddColumn",P)
<pointer: 0x55d5d5384650>
> .Call("R_bm_AddColumn",P)
<pointer: 0x55d5d5384650>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile244dfc1765ec7c" "BufferedMatrixFile244dfc4934d195"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile244dfc1765ec7c" "BufferedMatrixFile244dfc4934d195"
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x55d5d5768080>
> .Call("R_bm_AddColumn",P)
<pointer: 0x55d5d5768080>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x55d5d5768080>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x55d5d5768080>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x55d5d5768080>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x55d5d5768080>
> .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: 0x55d5d63c79e0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x55d5d63c79e0>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x55d5d63c79e0>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x55d5d63c79e0>
> 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: 0x55d5d640bcc0>
> .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: 0x55d5d640bcc0>
> rm(P)
> 
> proc.time()
   user  system elapsed 
  0.298   0.009   0.295 

BufferedMatrix.Rcheck/tests/Rcodetesting.Rout


R version 4.4.0 RC (2024-04-16 r86468) -- "Puppy Cup"
Copyright (C) 2024 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu

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.251   0.050   0.291 

Example timings