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

This page was generated on 2024-05-04 11:36:21 -0400 (Sat, 04 May 2024).

HostnameOSArch (*)R versionInstalled pkgs
nebbiolo1Linux (Ubuntu 22.04.3 LTS)x86_644.4.0 beta (2024-04-15 r86425) -- "Puppy Cup" 4753
palomino3Windows Server 2022 Datacenterx644.4.0 beta (2024-04-15 r86425 ucrt) -- "Puppy Cup" 4486
lconwaymacOS 12.7.1 Montereyx86_644.4.0 beta (2024-04-14 r86421) -- "Puppy Cup" 4519
kunpeng2Linux (openEuler 22.03 LTS-SP1)aarch644.4.0 beta (2024-04-15 r86425) -- "Puppy Cup" 4479
Click on any hostname to see more info about the system (e.g. compilers)      (*) as reported by 'uname -p', except on Windows and Mac OS X

Package 249/2300HostnameOS / ArchINSTALLBUILDCHECKBUILD BIN
BufferedMatrix 1.68.0  (landing page)
Ben Bolstad
Snapshot Date: 2024-05-03 14:00:19 -0400 (Fri, 03 May 2024)
git_url: https://git.bioconductor.org/packages/BufferedMatrix
git_branch: RELEASE_3_19
git_last_commit: af6c73d
git_last_commit_date: 2024-04-30 10:16:21 -0400 (Tue, 30 Apr 2024)
nebbiolo1Linux (Ubuntu 22.04.3 LTS) / x86_64  OK    OK    OK  UNNEEDED, same version is already published
palomino3Windows Server 2022 Datacenter / x64  OK    OK    OK    OK  UNNEEDED, same version is already published
lconwaymacOS 12.7.1 Monterey / x86_64  OK    OK    WARNINGS    OK  UNNEEDED, same version is already published
kunpeng2Linux (openEuler 22.03 LTS-SP1) / aarch64  OK    OK    OK  
kjohnson3macOS 13.6.5 Ventura / arm64see weekly results here

CHECK results for BufferedMatrix on nebbiolo1


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

raw results


Summary

Package: BufferedMatrix
Version: 1.68.0
Command: /home/biocbuild/bbs-3.19-bioc/R/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/home/biocbuild/bbs-3.19-bioc/R/site-library --timings BufferedMatrix_1.68.0.tar.gz
StartedAt: 2024-05-03 21:21:13 -0400 (Fri, 03 May 2024)
EndedAt: 2024-05-03 21:21:37 -0400 (Fri, 03 May 2024)
EllapsedTime: 24.0 seconds
RetCode: 0
Status:   OK  
CheckDir: BufferedMatrix.Rcheck
Warnings: 0

Command output

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


* using log directory ‘/home/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck’
* using R version 4.4.0 beta (2024-04-15 r86425)
* 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.68.0’
* checking package namespace information ... OK
* checking package dependencies ... OK
* checking if this is a source package ... OK
* checking if there is a namespace ... OK
* checking for hidden files and directories ... OK
* checking for portable file names ... OK
* checking 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.19-bioc/meat/BufferedMatrix.Rcheck/00check.log’
for details.


Installation output

BufferedMatrix.Rcheck/00install.out

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


* installing to library ‘/home/biocbuild/bbs-3.19-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.19-bioc/R/include" -DNDEBUG   -I/usr/local/include    -fpic  -g -O2  -Wall -c RBufferedMatrix.c -o RBufferedMatrix.o
gcc -I"/home/biocbuild/bbs-3.19-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.19-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.19-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.19-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.19-bioc/R/lib -lR
installing to /home/biocbuild/bbs-3.19-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 beta (2024-04-15 r86425) -- "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.281   0.038   0.308 

BufferedMatrix.Rcheck/tests/objectTesting.Rout


R version 4.4.0 beta (2024-04-15 r86425) -- "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.19-bioc/meat/BufferedMatrix.Rcheck/tests"
> prefix(tmp3)
[1] "BM"
> 
> ## testing if we can remove these objects
> rm(tmp, tmp2, tmp3)
> gc()
         used (Mb) gc trigger (Mb) max used (Mb)
Ncells 471777 25.2    1026217 54.9   643434 34.4
Vcells 871902  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  3 21:21:28 2024"
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> date()
[1] "Fri May  3 21:21: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: 0x55fe4aee92a0>
> 
> 
> 
> 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  3 21:21:29 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  3 21:21:29 2024"
> 
> ColMode(tmp2)
<pointer: 0x55fe4aee92a0>
> 
> 
> 
> ### 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,] 98.8421728 0.4872693 0.5414392 -0.35686089
[2,] -1.5279343 0.6968304 0.3983223  0.11836833
[3,]  0.2126679 1.1056122 1.8955265 -0.37216630
[4,]  0.8962157 0.6506706 0.2362745 -0.04585253
> ewApply(tmp5,abs)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.19-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,] 98.8421728 0.4872693 0.5414392 0.35686089
[2,]  1.5279343 0.6968304 0.3983223 0.11836833
[3,]  0.2126679 1.1056122 1.8955265 0.37216630
[4,]  0.8962157 0.6506706 0.2362745 0.04585253
> ewApply(tmp5,sqrt)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.19-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,] 9.9419401 0.6980468 0.7358255 0.5973783
[2,] 1.2360964 0.8347637 0.6311278 0.3440470
[3,] 0.4611593 1.0514809 1.3767812 0.6100543
[4,] 0.9466867 0.8066415 0.4860807 0.2141320
> 
> 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.19-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,] 223.26157 32.46774 32.89969 31.33064
[2,]  38.88890 34.04447 31.70960 28.55884
[3,]  29.82426 36.62042 40.66334 31.47271
[4,]  35.36308 33.71709 30.09708 27.18717
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x55fe48f872e0>
> exp(tmp5)
<pointer: 0x55fe48f872e0>
> log(tmp5,2)
<pointer: 0x55fe48f872e0>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 464.6897
> Min(tmp5)
[1] 52.79016
> mean(tmp5)
[1] 72.34281
> Sum(tmp5)
[1] 14468.56
> Var(tmp5)
[1] 849.4823
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 90.86478 66.87405 71.32028 70.70285 71.66208 69.02567 69.31842 70.67843
 [9] 70.52010 72.46145
> rowSums(tmp5)
 [1] 1817.296 1337.481 1426.406 1414.057 1433.242 1380.513 1386.368 1413.569
 [9] 1410.402 1449.229
> rowVars(tmp5)
 [1] 7813.25077   60.47167   58.07917   91.58911   90.35516   86.95925
 [7]   72.29875   58.17484   83.13143   58.24056
> rowSd(tmp5)
 [1] 88.392595  7.776353  7.620969  9.570220  9.505533  9.325195  8.502867
 [8]  7.627243  9.117644  7.631550
> rowMax(tmp5)
 [1] 464.68971  85.02099  84.63541  87.47614  85.68622  83.24550  92.57765
 [8]  82.60464  87.87064  90.76675
> rowMin(tmp5)
 [1] 60.75715 53.85529 55.34450 56.38939 52.88663 52.79016 58.65729 55.19133
 [9] 55.01195 59.72374
> 
> colMeans(tmp5)
 [1] 112.66121  68.98974  71.10865  65.11166  67.63725  69.96435  70.22171
 [8]  73.98890  68.31267  69.99551  76.54433  69.08322  69.70027  74.79689
[15]  66.88996  72.50400  73.84711  68.72964  68.54225  68.22692
> colSums(tmp5)
 [1] 1126.6121  689.8974  711.0865  651.1166  676.3725  699.6435  702.2171
 [8]  739.8890  683.1267  699.9551  765.4433  690.8322  697.0027  747.9689
[15]  668.8996  725.0400  738.4711  687.2964  685.4225  682.2692
> colVars(tmp5)
 [1] 15352.68180    27.27347    52.26325    83.58534    65.24664    91.69186
 [7]    57.64010    36.15537   143.40076   184.12878    52.71289    58.28100
[13]    61.33893   115.84796    50.50600    62.65909    41.60661    31.17492
[19]    56.29665    86.13498
> colSd(tmp5)
 [1] 123.905939   5.222400   7.229332   9.142502   8.077539   9.575586
 [7]   7.592108   6.012933  11.975006  13.569406   7.260365   7.634200
[13]   7.831918  10.763269   7.106758   7.915749   6.450318   5.583450
[19]   7.503109   9.280893
> colMax(tmp5)
 [1] 464.68971  76.22061  84.63541  82.29336  80.54037  85.02099  84.12316
 [8]  85.04636  86.18476  92.57765  87.87064  79.63435  83.79247  90.76675
[15]  78.55615  79.20389  81.87084  76.28635  80.54206  87.47614
> colMin(tmp5)
 [1] 62.07529 57.13958 62.64313 55.19133 58.65729 58.43377 57.20285 67.07542
 [9] 52.88663 53.85529 65.92205 52.79016 58.14837 58.26550 57.17349 56.37599
[17] 59.56304 61.49414 59.52262 59.15499
> 
> 
> ### 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] 90.86478 66.87405 71.32028 70.70285 71.66208 69.02567 69.31842 70.67843
 [9] 70.52010       NA
> rowSums(tmp5)
 [1] 1817.296 1337.481 1426.406 1414.057 1433.242 1380.513 1386.368 1413.569
 [9] 1410.402       NA
> rowVars(tmp5)
 [1] 7813.25077   60.47167   58.07917   91.58911   90.35516   86.95925
 [7]   72.29875   58.17484   83.13143   61.14780
> rowSd(tmp5)
 [1] 88.392595  7.776353  7.620969  9.570220  9.505533  9.325195  8.502867
 [8]  7.627243  9.117644  7.819706
> rowMax(tmp5)
 [1] 464.68971  85.02099  84.63541  87.47614  85.68622  83.24550  92.57765
 [8]  82.60464  87.87064        NA
> rowMin(tmp5)
 [1] 60.75715 53.85529 55.34450 56.38939 52.88663 52.79016 58.65729 55.19133
 [9] 55.01195       NA
> 
> colMeans(tmp5)
 [1] 112.66121  68.98974  71.10865  65.11166  67.63725  69.96435  70.22171
 [8]  73.98890  68.31267  69.99551  76.54433        NA  69.70027  74.79689
[15]  66.88996  72.50400  73.84711  68.72964  68.54225  68.22692
> colSums(tmp5)
 [1] 1126.6121  689.8974  711.0865  651.1166  676.3725  699.6435  702.2171
 [8]  739.8890  683.1267  699.9551  765.4433        NA  697.0027  747.9689
[15]  668.8996  725.0400  738.4711  687.2964  685.4225  682.2692
> colVars(tmp5)
 [1] 15352.68180    27.27347    52.26325    83.58534    65.24664    91.69186
 [7]    57.64010    36.15537   143.40076   184.12878    52.71289          NA
[13]    61.33893   115.84796    50.50600    62.65909    41.60661    31.17492
[19]    56.29665    86.13498
> colSd(tmp5)
 [1] 123.905939   5.222400   7.229332   9.142502   8.077539   9.575586
 [7]   7.592108   6.012933  11.975006  13.569406   7.260365         NA
[13]   7.831918  10.763269   7.106758   7.915749   6.450318   5.583450
[19]   7.503109   9.280893
> colMax(tmp5)
 [1] 464.68971  76.22061  84.63541  82.29336  80.54037  85.02099  84.12316
 [8]  85.04636  86.18476  92.57765  87.87064        NA  83.79247  90.76675
[15]  78.55615  79.20389  81.87084  76.28635  80.54206  87.47614
> colMin(tmp5)
 [1] 62.07529 57.13958 62.64313 55.19133 58.65729 58.43377 57.20285 67.07542
 [9] 52.88663 53.85529 65.92205       NA 58.14837 58.26550 57.17349 56.37599
[17] 59.56304 61.49414 59.52262 59.15499
> 
> Max(tmp5,na.rm=TRUE)
[1] 464.6897
> Min(tmp5,na.rm=TRUE)
[1] 52.79016
> mean(tmp5,na.rm=TRUE)
[1] 72.35412
> Sum(tmp5,na.rm=TRUE)
[1] 14398.47
> Var(tmp5,na.rm=TRUE)
[1] 853.7469
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 90.86478 66.87405 71.32028 70.70285 71.66208 69.02567 69.31842 70.67843
 [9] 70.52010 72.58616
> rowSums(tmp5,na.rm=TRUE)
 [1] 1817.296 1337.481 1426.406 1414.057 1433.242 1380.513 1386.368 1413.569
 [9] 1410.402 1379.137
> rowVars(tmp5,na.rm=TRUE)
 [1] 7813.25077   60.47167   58.07917   91.58911   90.35516   86.95925
 [7]   72.29875   58.17484   83.13143   61.14780
> rowSd(tmp5,na.rm=TRUE)
 [1] 88.392595  7.776353  7.620969  9.570220  9.505533  9.325195  8.502867
 [8]  7.627243  9.117644  7.819706
> rowMax(tmp5,na.rm=TRUE)
 [1] 464.68971  85.02099  84.63541  87.47614  85.68622  83.24550  92.57765
 [8]  82.60464  87.87064  90.76675
> rowMin(tmp5,na.rm=TRUE)
 [1] 60.75715 53.85529 55.34450 56.38939 52.88663 52.79016 58.65729 55.19133
 [9] 55.01195 59.72374
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 112.66121  68.98974  71.10865  65.11166  67.63725  69.96435  70.22171
 [8]  73.98890  68.31267  69.99551  76.54433  68.97115  69.70027  74.79689
[15]  66.88996  72.50400  73.84711  68.72964  68.54225  68.22692
> colSums(tmp5,na.rm=TRUE)
 [1] 1126.6121  689.8974  711.0865  651.1166  676.3725  699.6435  702.2171
 [8]  739.8890  683.1267  699.9551  765.4433  620.7403  697.0027  747.9689
[15]  668.8996  725.0400  738.4711  687.2964  685.4225  682.2692
> colVars(tmp5,na.rm=TRUE)
 [1] 15352.68180    27.27347    52.26325    83.58534    65.24664    91.69186
 [7]    57.64010    36.15537   143.40076   184.12878    52.71289    65.42481
[13]    61.33893   115.84796    50.50600    62.65909    41.60661    31.17492
[19]    56.29665    86.13498
> colSd(tmp5,na.rm=TRUE)
 [1] 123.905939   5.222400   7.229332   9.142502   8.077539   9.575586
 [7]   7.592108   6.012933  11.975006  13.569406   7.260365   8.088560
[13]   7.831918  10.763269   7.106758   7.915749   6.450318   5.583450
[19]   7.503109   9.280893
> colMax(tmp5,na.rm=TRUE)
 [1] 464.68971  76.22061  84.63541  82.29336  80.54037  85.02099  84.12316
 [8]  85.04636  86.18476  92.57765  87.87064  79.63435  83.79247  90.76675
[15]  78.55615  79.20389  81.87084  76.28635  80.54206  87.47614
> colMin(tmp5,na.rm=TRUE)
 [1] 62.07529 57.13958 62.64313 55.19133 58.65729 58.43377 57.20285 67.07542
 [9] 52.88663 53.85529 65.92205 52.79016 58.14837 58.26550 57.17349 56.37599
[17] 59.56304 61.49414 59.52262 59.15499
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1] 90.86478 66.87405 71.32028 70.70285 71.66208 69.02567 69.31842 70.67843
 [9] 70.52010      NaN
> rowSums(tmp5,na.rm=TRUE)
 [1] 1817.296 1337.481 1426.406 1414.057 1433.242 1380.513 1386.368 1413.569
 [9] 1410.402    0.000
> rowVars(tmp5,na.rm=TRUE)
 [1] 7813.25077   60.47167   58.07917   91.58911   90.35516   86.95925
 [7]   72.29875   58.17484   83.13143         NA
> rowSd(tmp5,na.rm=TRUE)
 [1] 88.392595  7.776353  7.620969  9.570220  9.505533  9.325195  8.502867
 [8]  7.627243  9.117644        NA
> rowMax(tmp5,na.rm=TRUE)
 [1] 464.68971  85.02099  84.63541  87.47614  85.68622  83.24550  92.57765
 [8]  82.60464  87.87064        NA
> rowMin(tmp5,na.rm=TRUE)
 [1] 60.75715 53.85529 55.34450 56.38939 52.88663 52.79016 58.65729 55.19133
 [9] 55.01195       NA
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1] 116.74057  69.28101  70.85042  63.49087  67.25518  70.66673  71.38815
 [8]  73.47932  68.52011  70.75530  76.32435       NaN  69.90813  73.02246
[15]  65.72102  71.94374  73.74313  67.89001  67.67866  68.96229
> colSums(tmp5,na.rm=TRUE)
 [1] 1050.6651  623.5291  637.6538  571.4178  605.2966  636.0006  642.4934
 [8]  661.3139  616.6810  636.7977  686.9191    0.0000  629.1732  657.2021
[15]  591.4892  647.4937  663.6882  611.0100  609.1080  620.6606
> colVars(tmp5,na.rm=TRUE)
 [1] 17084.55408    29.72820    58.04601    64.48001    71.76018    97.60333
 [7]    49.53852    37.75357   160.84178   200.65045    58.75762          NA
[13]    68.52024    94.90721    41.44704    66.96024    46.68581    27.14069
[19]    54.94361    90.81821
> colSd(tmp5,na.rm=TRUE)
 [1] 130.707896   5.452358   7.618793   8.029944   8.471138   9.879440
 [7]   7.038361   6.144393  12.682341  14.165114   7.665352         NA
[13]   8.277695   9.742033   6.437937   8.182924   6.832702   5.209672
[19]   7.412396   9.529859
> colMax(tmp5,na.rm=TRUE)
 [1] 464.68971  76.22061  84.63541  82.29336  80.54037  85.02099  84.12316
 [8]  85.04636  86.18476  92.57765  87.87064      -Inf  83.79247  85.68622
[15]  78.55615  79.20389  81.87084  76.05781  80.54206  87.47614
> colMin(tmp5,na.rm=TRUE)
 [1] 62.07529 57.13958 62.64313 55.19133 58.65729 58.43377 57.20285 67.07542
 [9] 52.88663 53.85529 65.92205      Inf 58.14837 58.26550 57.17349 56.37599
[17] 59.56304 61.49414 59.52262 59.15499
> 
> 
> 
> 
> 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] 233.1367 265.0658 186.4606 165.3668 213.8066 154.8842 127.5700 160.9807
 [9] 125.3742 228.6781
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 233.1367 265.0658 186.4606 165.3668 213.8066 154.8842 127.5700 160.9807
 [9] 125.3742 228.6781
> 
> 
> 
> 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] -5.684342e-14 -2.842171e-14  1.421085e-14 -5.684342e-14  0.000000e+00
 [6]  5.684342e-14 -1.421085e-13 -5.684342e-14 -8.526513e-14  5.684342e-14
[11]  5.684342e-14 -8.526513e-14  1.989520e-13 -2.842171e-14 -8.526513e-14
[16]  2.842171e-14 -1.705303e-13  1.705303e-13  2.842171e-14 -7.105427e-14
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> ## making sure these things agree
> ##
> ## first when there is no NA
> 
> 
> 
> agree.checks <- function(buff.matrix,r.matrix,err.tol=1e-10){
+ 
+   if (Max(buff.matrix,na.rm=TRUE) != max(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Max")
+   }
+   
+ 
+   if (Min(buff.matrix,na.rm=TRUE) != min(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Min")
+   }
+ 
+ 
+   if (abs(Sum(buff.matrix,na.rm=TRUE)- sum(r.matrix,na.rm=TRUE)) > err.tol){
+ 
+     cat(Sum(buff.matrix,na.rm=TRUE),"\n")
+     cat(sum(r.matrix,na.rm=TRUE),"\n")
+     cat(Sum(buff.matrix,na.rm=TRUE) - sum(r.matrix,na.rm=TRUE),"\n")
+     
+     stop("No agreement in Sum")
+   }
+   
+   if (abs(mean(buff.matrix,na.rm=TRUE) - mean(r.matrix,na.rm=TRUE)) > err.tol){
+     stop("No agreement in mean")
+   }
+   
+   
+   if(abs(Var(buff.matrix,na.rm=TRUE) - var(as.vector(r.matrix),na.rm=TRUE)) > err.tol){
+     stop("No agreement in Var")
+   }
+   
+   
+ 
+   if(any(abs(rowMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,mean,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowMeans")
+   }
+   
+   
+   if(any(abs(colMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,mean,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colMeans")
+   }
+   
+   
+   if(any(abs(rowSums(buff.matrix,na.rm=TRUE)  -  apply(r.matrix,1,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in rowSums")
+   }
+   
+   
+   if(any(abs(colSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colSums")
+   }
+   
+   ### this is to get around the fact that R doesn't like to compute NA on an entire vector of NA when 
+   ### computing variance
+   my.Var <- function(x,na.rm=FALSE){
+    if (all(is.na(x))){
+      return(NA)
+    } else {
+      var(x,na.rm=na.rm)
+    }
+ 
+   }
+   
+   if(any(abs(rowVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+   
+   
+   if(any(abs(colVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+ 
+ 
+   if(any(abs(rowMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+ 
+   if(any(abs(colMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+   
+   
+   if(any(abs(rowMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+   
+ 
+   if(any(abs(colMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+ 
+   if(any(abs(colMedians(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,median,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMedian")
+   }
+ 
+   if(any(abs(colRanges(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,range,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colRanges")
+   }
+ 
+ 
+   
+ }
> 
> 
> 
> 
> 
> 
> 
> 
> 
> for (rep in 1:20){
+   copymatrix <- matrix(rnorm(200,150,15),10,20)
+   
+   tmp5[1:10,1:20] <- copymatrix
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ## now lets assign some NA values and check agreement
+ 
+   which.row <- sample(1:10,1,replace=TRUE)
+   which.col  <- sample(1:20,1,replace=TRUE)
+   
+   cat(which.row," ",which.col,"\n")
+   
+   tmp5[which.row,which.col] <- NA
+   copymatrix[which.row,which.col] <- NA
+   
+   agree.checks(tmp5,copymatrix)
+ 
+   ## make an entire row NA
+   tmp5[which.row,] <- NA
+   copymatrix[which.row,] <- NA
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ### also make an entire col NA
+   tmp5[,which.col] <- NA
+   copymatrix[,which.col] <- NA
+ 
+   agree.checks(tmp5,copymatrix)
+ 
+   ### now make 1 element non NA with NA in the rest of row and column
+ 
+   tmp5[which.row,which.col] <- rnorm(1,150,15)
+   copymatrix[which.row,which.col] <- tmp5[which.row,which.col]
+ 
+   agree.checks(tmp5,copymatrix)
+ }
10   13 
8   13 
9   9 
6   18 
9   7 
9   1 
6   8 
8   15 
3   1 
10   19 
1   16 
7   5 
9   7 
1   17 
4   14 
4   5 
1   1 
5   3 
4   15 
8   13 
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.419556
> Min(tmp)
[1] -2.177475
> mean(tmp)
[1] -0.0545071
> Sum(tmp)
[1] -5.45071
> Var(tmp)
[1] 0.7882957
> 
> rowMeans(tmp)
[1] -0.0545071
> rowSums(tmp)
[1] -5.45071
> rowVars(tmp)
[1] 0.7882957
> rowSd(tmp)
[1] 0.8878602
> rowMax(tmp)
[1] 2.419556
> rowMin(tmp)
[1] -2.177475
> 
> colMeans(tmp)
  [1]  0.39581988 -0.58802873  1.33372235  1.52216449  2.33469211  0.83412436
  [7] -0.69257961 -0.84673589  0.54366696 -0.98114840  1.33329331 -0.27192644
 [13]  2.41955597 -0.74671133  0.20332392  0.03138877 -0.45134603  1.17890427
 [19] -1.12004276 -0.40065429 -0.93675173  0.30694825  0.35930069  1.28833288
 [25] -0.53506194 -0.20415145  1.16962021 -0.69141465 -1.00702349 -0.26888882
 [31]  0.36736622 -0.69471962 -1.10398334 -0.72934699  0.87778534 -0.90587413
 [37] -0.04519204 -0.43239248 -0.93674630 -0.65107496 -1.19218568  1.24054823
 [43]  0.88367495 -0.19358544  1.25147119 -0.90967378 -1.31953353  0.15319004
 [49] -0.10045601 -0.83191616 -2.17747451 -0.72725638 -0.13257479  0.84731778
 [55]  0.78198063  0.14421063  0.33957840  0.81461790 -0.31349594  0.71998269
 [61] -0.70176268 -0.81853304 -0.11368793  0.22397182 -0.87994966  0.01966952
 [67] -1.36807499  0.46667207 -0.06312468  0.85953374 -0.38488489 -1.55399800
 [73] -0.72658876 -1.33833137  0.01520236  0.90442043  0.13168172  1.00099134
 [79] -1.24427180 -1.33357542  0.69095771  0.32627770  0.07608671 -0.53822166
 [85]  0.58512409  0.97802103 -0.85879132  0.07574278 -0.33477754  0.09391974
 [91]  1.20349535 -0.41791123  0.77257823 -0.26389293  1.13701321 -0.53474747
 [97] -1.68300387  0.09741134  0.43799381 -0.92598040
> colSums(tmp)
  [1]  0.39581988 -0.58802873  1.33372235  1.52216449  2.33469211  0.83412436
  [7] -0.69257961 -0.84673589  0.54366696 -0.98114840  1.33329331 -0.27192644
 [13]  2.41955597 -0.74671133  0.20332392  0.03138877 -0.45134603  1.17890427
 [19] -1.12004276 -0.40065429 -0.93675173  0.30694825  0.35930069  1.28833288
 [25] -0.53506194 -0.20415145  1.16962021 -0.69141465 -1.00702349 -0.26888882
 [31]  0.36736622 -0.69471962 -1.10398334 -0.72934699  0.87778534 -0.90587413
 [37] -0.04519204 -0.43239248 -0.93674630 -0.65107496 -1.19218568  1.24054823
 [43]  0.88367495 -0.19358544  1.25147119 -0.90967378 -1.31953353  0.15319004
 [49] -0.10045601 -0.83191616 -2.17747451 -0.72725638 -0.13257479  0.84731778
 [55]  0.78198063  0.14421063  0.33957840  0.81461790 -0.31349594  0.71998269
 [61] -0.70176268 -0.81853304 -0.11368793  0.22397182 -0.87994966  0.01966952
 [67] -1.36807499  0.46667207 -0.06312468  0.85953374 -0.38488489 -1.55399800
 [73] -0.72658876 -1.33833137  0.01520236  0.90442043  0.13168172  1.00099134
 [79] -1.24427180 -1.33357542  0.69095771  0.32627770  0.07608671 -0.53822166
 [85]  0.58512409  0.97802103 -0.85879132  0.07574278 -0.33477754  0.09391974
 [91]  1.20349535 -0.41791123  0.77257823 -0.26389293  1.13701321 -0.53474747
 [97] -1.68300387  0.09741134  0.43799381 -0.92598040
> 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.39581988 -0.58802873  1.33372235  1.52216449  2.33469211  0.83412436
  [7] -0.69257961 -0.84673589  0.54366696 -0.98114840  1.33329331 -0.27192644
 [13]  2.41955597 -0.74671133  0.20332392  0.03138877 -0.45134603  1.17890427
 [19] -1.12004276 -0.40065429 -0.93675173  0.30694825  0.35930069  1.28833288
 [25] -0.53506194 -0.20415145  1.16962021 -0.69141465 -1.00702349 -0.26888882
 [31]  0.36736622 -0.69471962 -1.10398334 -0.72934699  0.87778534 -0.90587413
 [37] -0.04519204 -0.43239248 -0.93674630 -0.65107496 -1.19218568  1.24054823
 [43]  0.88367495 -0.19358544  1.25147119 -0.90967378 -1.31953353  0.15319004
 [49] -0.10045601 -0.83191616 -2.17747451 -0.72725638 -0.13257479  0.84731778
 [55]  0.78198063  0.14421063  0.33957840  0.81461790 -0.31349594  0.71998269
 [61] -0.70176268 -0.81853304 -0.11368793  0.22397182 -0.87994966  0.01966952
 [67] -1.36807499  0.46667207 -0.06312468  0.85953374 -0.38488489 -1.55399800
 [73] -0.72658876 -1.33833137  0.01520236  0.90442043  0.13168172  1.00099134
 [79] -1.24427180 -1.33357542  0.69095771  0.32627770  0.07608671 -0.53822166
 [85]  0.58512409  0.97802103 -0.85879132  0.07574278 -0.33477754  0.09391974
 [91]  1.20349535 -0.41791123  0.77257823 -0.26389293  1.13701321 -0.53474747
 [97] -1.68300387  0.09741134  0.43799381 -0.92598040
> colMin(tmp)
  [1]  0.39581988 -0.58802873  1.33372235  1.52216449  2.33469211  0.83412436
  [7] -0.69257961 -0.84673589  0.54366696 -0.98114840  1.33329331 -0.27192644
 [13]  2.41955597 -0.74671133  0.20332392  0.03138877 -0.45134603  1.17890427
 [19] -1.12004276 -0.40065429 -0.93675173  0.30694825  0.35930069  1.28833288
 [25] -0.53506194 -0.20415145  1.16962021 -0.69141465 -1.00702349 -0.26888882
 [31]  0.36736622 -0.69471962 -1.10398334 -0.72934699  0.87778534 -0.90587413
 [37] -0.04519204 -0.43239248 -0.93674630 -0.65107496 -1.19218568  1.24054823
 [43]  0.88367495 -0.19358544  1.25147119 -0.90967378 -1.31953353  0.15319004
 [49] -0.10045601 -0.83191616 -2.17747451 -0.72725638 -0.13257479  0.84731778
 [55]  0.78198063  0.14421063  0.33957840  0.81461790 -0.31349594  0.71998269
 [61] -0.70176268 -0.81853304 -0.11368793  0.22397182 -0.87994966  0.01966952
 [67] -1.36807499  0.46667207 -0.06312468  0.85953374 -0.38488489 -1.55399800
 [73] -0.72658876 -1.33833137  0.01520236  0.90442043  0.13168172  1.00099134
 [79] -1.24427180 -1.33357542  0.69095771  0.32627770  0.07608671 -0.53822166
 [85]  0.58512409  0.97802103 -0.85879132  0.07574278 -0.33477754  0.09391974
 [91]  1.20349535 -0.41791123  0.77257823 -0.26389293  1.13701321 -0.53474747
 [97] -1.68300387  0.09741134  0.43799381 -0.92598040
> colMedians(tmp)
  [1]  0.39581988 -0.58802873  1.33372235  1.52216449  2.33469211  0.83412436
  [7] -0.69257961 -0.84673589  0.54366696 -0.98114840  1.33329331 -0.27192644
 [13]  2.41955597 -0.74671133  0.20332392  0.03138877 -0.45134603  1.17890427
 [19] -1.12004276 -0.40065429 -0.93675173  0.30694825  0.35930069  1.28833288
 [25] -0.53506194 -0.20415145  1.16962021 -0.69141465 -1.00702349 -0.26888882
 [31]  0.36736622 -0.69471962 -1.10398334 -0.72934699  0.87778534 -0.90587413
 [37] -0.04519204 -0.43239248 -0.93674630 -0.65107496 -1.19218568  1.24054823
 [43]  0.88367495 -0.19358544  1.25147119 -0.90967378 -1.31953353  0.15319004
 [49] -0.10045601 -0.83191616 -2.17747451 -0.72725638 -0.13257479  0.84731778
 [55]  0.78198063  0.14421063  0.33957840  0.81461790 -0.31349594  0.71998269
 [61] -0.70176268 -0.81853304 -0.11368793  0.22397182 -0.87994966  0.01966952
 [67] -1.36807499  0.46667207 -0.06312468  0.85953374 -0.38488489 -1.55399800
 [73] -0.72658876 -1.33833137  0.01520236  0.90442043  0.13168172  1.00099134
 [79] -1.24427180 -1.33357542  0.69095771  0.32627770  0.07608671 -0.53822166
 [85]  0.58512409  0.97802103 -0.85879132  0.07574278 -0.33477754  0.09391974
 [91]  1.20349535 -0.41791123  0.77257823 -0.26389293  1.13701321 -0.53474747
 [97] -1.68300387  0.09741134  0.43799381 -0.92598040
> colRanges(tmp)
          [,1]       [,2]     [,3]     [,4]     [,5]      [,6]       [,7]
[1,] 0.3958199 -0.5880287 1.333722 1.522164 2.334692 0.8341244 -0.6925796
[2,] 0.3958199 -0.5880287 1.333722 1.522164 2.334692 0.8341244 -0.6925796
           [,8]     [,9]      [,10]    [,11]      [,12]    [,13]      [,14]
[1,] -0.8467359 0.543667 -0.9811484 1.333293 -0.2719264 2.419556 -0.7467113
[2,] -0.8467359 0.543667 -0.9811484 1.333293 -0.2719264 2.419556 -0.7467113
         [,15]      [,16]     [,17]    [,18]     [,19]      [,20]      [,21]
[1,] 0.2033239 0.03138877 -0.451346 1.178904 -1.120043 -0.4006543 -0.9367517
[2,] 0.2033239 0.03138877 -0.451346 1.178904 -1.120043 -0.4006543 -0.9367517
         [,22]     [,23]    [,24]      [,25]      [,26]   [,27]      [,28]
[1,] 0.3069483 0.3593007 1.288333 -0.5350619 -0.2041515 1.16962 -0.6914147
[2,] 0.3069483 0.3593007 1.288333 -0.5350619 -0.2041515 1.16962 -0.6914147
         [,29]      [,30]     [,31]      [,32]     [,33]     [,34]     [,35]
[1,] -1.007023 -0.2688888 0.3673662 -0.6947196 -1.103983 -0.729347 0.8777853
[2,] -1.007023 -0.2688888 0.3673662 -0.6947196 -1.103983 -0.729347 0.8777853
          [,36]       [,37]      [,38]      [,39]     [,40]     [,41]    [,42]
[1,] -0.9058741 -0.04519204 -0.4323925 -0.9367463 -0.651075 -1.192186 1.240548
[2,] -0.9058741 -0.04519204 -0.4323925 -0.9367463 -0.651075 -1.192186 1.240548
        [,43]      [,44]    [,45]      [,46]     [,47]   [,48]     [,49]
[1,] 0.883675 -0.1935854 1.251471 -0.9096738 -1.319534 0.15319 -0.100456
[2,] 0.883675 -0.1935854 1.251471 -0.9096738 -1.319534 0.15319 -0.100456
          [,50]     [,51]      [,52]      [,53]     [,54]     [,55]     [,56]
[1,] -0.8319162 -2.177475 -0.7272564 -0.1325748 0.8473178 0.7819806 0.1442106
[2,] -0.8319162 -2.177475 -0.7272564 -0.1325748 0.8473178 0.7819806 0.1442106
         [,57]     [,58]      [,59]     [,60]      [,61]     [,62]      [,63]
[1,] 0.3395784 0.8146179 -0.3134959 0.7199827 -0.7017627 -0.818533 -0.1136879
[2,] 0.3395784 0.8146179 -0.3134959 0.7199827 -0.7017627 -0.818533 -0.1136879
         [,64]      [,65]      [,66]     [,67]     [,68]       [,69]     [,70]
[1,] 0.2239718 -0.8799497 0.01966952 -1.368075 0.4666721 -0.06312468 0.8595337
[2,] 0.2239718 -0.8799497 0.01966952 -1.368075 0.4666721 -0.06312468 0.8595337
          [,71]     [,72]      [,73]     [,74]      [,75]     [,76]     [,77]
[1,] -0.3848849 -1.553998 -0.7265888 -1.338331 0.01520236 0.9044204 0.1316817
[2,] -0.3848849 -1.553998 -0.7265888 -1.338331 0.01520236 0.9044204 0.1316817
        [,78]     [,79]     [,80]     [,81]     [,82]      [,83]      [,84]
[1,] 1.000991 -1.244272 -1.333575 0.6909577 0.3262777 0.07608671 -0.5382217
[2,] 1.000991 -1.244272 -1.333575 0.6909577 0.3262777 0.07608671 -0.5382217
         [,85]    [,86]      [,87]      [,88]      [,89]      [,90]    [,91]
[1,] 0.5851241 0.978021 -0.8587913 0.07574278 -0.3347775 0.09391974 1.203495
[2,] 0.5851241 0.978021 -0.8587913 0.07574278 -0.3347775 0.09391974 1.203495
          [,92]     [,93]      [,94]    [,95]      [,96]     [,97]      [,98]
[1,] -0.4179112 0.7725782 -0.2638929 1.137013 -0.5347475 -1.683004 0.09741134
[2,] -0.4179112 0.7725782 -0.2638929 1.137013 -0.5347475 -1.683004 0.09741134
         [,99]     [,100]
[1,] 0.4379938 -0.9259804
[2,] 0.4379938 -0.9259804
> 
> 
> Max(tmp2)
[1] 3.027798
> Min(tmp2)
[1] -2.957567
> mean(tmp2)
[1] -0.04864743
> Sum(tmp2)
[1] -4.864743
> Var(tmp2)
[1] 1.320538
> 
> rowMeans(tmp2)
  [1]  0.547685710 -0.101734537  0.983813060  0.422990735  1.499264883
  [6] -1.543239712 -0.701105659  0.206766073  1.538675997  1.087742924
 [11] -0.100075579 -0.413937728 -1.508560787  0.643411953  0.110047640
 [16]  0.625694954 -0.318276768  0.817918946  0.624330202  0.575309518
 [21] -1.481472641 -1.828003218  0.250052028  0.767400973  1.496164508
 [26]  0.287854278  1.858105464 -0.444601356 -0.205841173 -0.326073071
 [31]  0.583739057 -1.892858629  0.634904394 -2.957566820  0.339083084
 [36] -2.850813227  2.129859553  0.707617118  0.196012373  0.950425827
 [41]  1.148154208 -0.631106434 -0.991053189 -0.865163035 -0.930604737
 [46] -0.679533038 -1.041162860 -1.174341382 -0.100855274  0.685170698
 [51] -0.552084862 -2.407375551 -1.154647602  3.027797531 -0.147921038
 [56] -1.200696900  1.681796319 -0.703073425  0.386568371 -1.907006498
 [61] -0.287473168  1.617335907 -0.931405501 -0.437738361  0.765795870
 [66]  1.233448616 -1.560224105 -0.566722135 -0.532279210  0.876905520
 [71]  1.913899406 -0.131183136 -0.552690883  0.251394821  0.300952415
 [76]  1.141232375  0.667704947 -1.405953541 -1.501744537 -1.337309244
 [81] -1.301229465  0.009643464 -1.559707784  0.503514813 -1.035313449
 [86] -0.252626868  0.794632868  0.517716389  0.420575550  1.121321048
 [91] -1.296733587  0.012697951  1.295425854  1.650338864  0.178721455
 [96]  1.689970953 -1.676752845  0.757316714 -0.946744262 -0.925028280
> rowSums(tmp2)
  [1]  0.547685710 -0.101734537  0.983813060  0.422990735  1.499264883
  [6] -1.543239712 -0.701105659  0.206766073  1.538675997  1.087742924
 [11] -0.100075579 -0.413937728 -1.508560787  0.643411953  0.110047640
 [16]  0.625694954 -0.318276768  0.817918946  0.624330202  0.575309518
 [21] -1.481472641 -1.828003218  0.250052028  0.767400973  1.496164508
 [26]  0.287854278  1.858105464 -0.444601356 -0.205841173 -0.326073071
 [31]  0.583739057 -1.892858629  0.634904394 -2.957566820  0.339083084
 [36] -2.850813227  2.129859553  0.707617118  0.196012373  0.950425827
 [41]  1.148154208 -0.631106434 -0.991053189 -0.865163035 -0.930604737
 [46] -0.679533038 -1.041162860 -1.174341382 -0.100855274  0.685170698
 [51] -0.552084862 -2.407375551 -1.154647602  3.027797531 -0.147921038
 [56] -1.200696900  1.681796319 -0.703073425  0.386568371 -1.907006498
 [61] -0.287473168  1.617335907 -0.931405501 -0.437738361  0.765795870
 [66]  1.233448616 -1.560224105 -0.566722135 -0.532279210  0.876905520
 [71]  1.913899406 -0.131183136 -0.552690883  0.251394821  0.300952415
 [76]  1.141232375  0.667704947 -1.405953541 -1.501744537 -1.337309244
 [81] -1.301229465  0.009643464 -1.559707784  0.503514813 -1.035313449
 [86] -0.252626868  0.794632868  0.517716389  0.420575550  1.121321048
 [91] -1.296733587  0.012697951  1.295425854  1.650338864  0.178721455
 [96]  1.689970953 -1.676752845  0.757316714 -0.946744262 -0.925028280
> 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.547685710 -0.101734537  0.983813060  0.422990735  1.499264883
  [6] -1.543239712 -0.701105659  0.206766073  1.538675997  1.087742924
 [11] -0.100075579 -0.413937728 -1.508560787  0.643411953  0.110047640
 [16]  0.625694954 -0.318276768  0.817918946  0.624330202  0.575309518
 [21] -1.481472641 -1.828003218  0.250052028  0.767400973  1.496164508
 [26]  0.287854278  1.858105464 -0.444601356 -0.205841173 -0.326073071
 [31]  0.583739057 -1.892858629  0.634904394 -2.957566820  0.339083084
 [36] -2.850813227  2.129859553  0.707617118  0.196012373  0.950425827
 [41]  1.148154208 -0.631106434 -0.991053189 -0.865163035 -0.930604737
 [46] -0.679533038 -1.041162860 -1.174341382 -0.100855274  0.685170698
 [51] -0.552084862 -2.407375551 -1.154647602  3.027797531 -0.147921038
 [56] -1.200696900  1.681796319 -0.703073425  0.386568371 -1.907006498
 [61] -0.287473168  1.617335907 -0.931405501 -0.437738361  0.765795870
 [66]  1.233448616 -1.560224105 -0.566722135 -0.532279210  0.876905520
 [71]  1.913899406 -0.131183136 -0.552690883  0.251394821  0.300952415
 [76]  1.141232375  0.667704947 -1.405953541 -1.501744537 -1.337309244
 [81] -1.301229465  0.009643464 -1.559707784  0.503514813 -1.035313449
 [86] -0.252626868  0.794632868  0.517716389  0.420575550  1.121321048
 [91] -1.296733587  0.012697951  1.295425854  1.650338864  0.178721455
 [96]  1.689970953 -1.676752845  0.757316714 -0.946744262 -0.925028280
> rowMin(tmp2)
  [1]  0.547685710 -0.101734537  0.983813060  0.422990735  1.499264883
  [6] -1.543239712 -0.701105659  0.206766073  1.538675997  1.087742924
 [11] -0.100075579 -0.413937728 -1.508560787  0.643411953  0.110047640
 [16]  0.625694954 -0.318276768  0.817918946  0.624330202  0.575309518
 [21] -1.481472641 -1.828003218  0.250052028  0.767400973  1.496164508
 [26]  0.287854278  1.858105464 -0.444601356 -0.205841173 -0.326073071
 [31]  0.583739057 -1.892858629  0.634904394 -2.957566820  0.339083084
 [36] -2.850813227  2.129859553  0.707617118  0.196012373  0.950425827
 [41]  1.148154208 -0.631106434 -0.991053189 -0.865163035 -0.930604737
 [46] -0.679533038 -1.041162860 -1.174341382 -0.100855274  0.685170698
 [51] -0.552084862 -2.407375551 -1.154647602  3.027797531 -0.147921038
 [56] -1.200696900  1.681796319 -0.703073425  0.386568371 -1.907006498
 [61] -0.287473168  1.617335907 -0.931405501 -0.437738361  0.765795870
 [66]  1.233448616 -1.560224105 -0.566722135 -0.532279210  0.876905520
 [71]  1.913899406 -0.131183136 -0.552690883  0.251394821  0.300952415
 [76]  1.141232375  0.667704947 -1.405953541 -1.501744537 -1.337309244
 [81] -1.301229465  0.009643464 -1.559707784  0.503514813 -1.035313449
 [86] -0.252626868  0.794632868  0.517716389  0.420575550  1.121321048
 [91] -1.296733587  0.012697951  1.295425854  1.650338864  0.178721455
 [96]  1.689970953 -1.676752845  0.757316714 -0.946744262 -0.925028280
> 
> colMeans(tmp2)
[1] -0.04864743
> colSums(tmp2)
[1] -4.864743
> colVars(tmp2)
[1] 1.320538
> colSd(tmp2)
[1] 1.149147
> colMax(tmp2)
[1] 3.027798
> colMin(tmp2)
[1] -2.957567
> colMedians(tmp2)
[1] 0.01117071
> colRanges(tmp2)
          [,1]
[1,] -2.957567
[2,]  3.027798
> 
> dataset1 <- matrix(dataset1,1,100)
> 
> agree.checks(tmp,dataset1)
> 
> dataset2 <- matrix(dataset2,100,1)
> agree.checks(tmp2,dataset2)
>   
> 
> tmp <- createBufferedMatrix(10,10)
> 
> tmp[1:10,1:10] <- rnorm(100)
> colApply(tmp,sum)
 [1]  4.8988703 -1.2008952  0.3981593 -6.6597366 -1.4151087 10.1640286
 [7] -1.3577388  0.1187381  0.3498071  4.5146099
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -1.3523686
[2,] -0.3576861
[3,]  0.8578152
[4,]  1.0287236
[5,]  1.9919462
> 
> rowApply(tmp,sum)
 [1] -1.9229380 -0.7302314 -5.5198843  0.9505373  2.3593929  0.9663822
 [7]  0.9600448  7.6850350  5.6266318 -0.5642362
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    5    8   10    2    7    9    1    7    7     8
 [2,]    8    3    5    7    9    5    4    4    2     5
 [3,]    6    2    3    4    3    7    9    9    9     4
 [4,]    1    1    1    5    6    1    5    3    1     2
 [5,]    3    7    2    6    8    6    8    1    6     1
 [6,]    7    6    8    9   10   10   10    8    4     9
 [7,]    2   10    7    1    4    3    2    2    5     7
 [8,]    9    5    4    3    1    4    3   10   10    10
 [9,]   10    4    6    8    5    2    6    6    3     3
[10,]    4    9    9   10    2    8    7    5    8     6
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1] -0.12377047  0.66452395 -3.07360052 -2.89784705  0.04294543  6.42841858
 [7]  2.55147868 -3.09786141 -5.67806202  3.17301169 -0.20408322 -4.74718994
[13] -3.01742030  1.56769700  2.57723329 -0.58168998 -1.14634663  0.53584617
[19] -1.62304327 -4.48184275
> colApply(tmp,quantile)[,1]
            [,1]
[1,] -1.85258629
[2,] -0.14907609
[3,] -0.07098375
[4,]  0.73480120
[5,]  1.21407446
> 
> rowApply(tmp,sum)
[1] -2.072386 -6.230981  3.827111 -9.736112  1.080766
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]   16    4   10   15   17
[2,]   18    5   17   12   11
[3,]   15    7    7    9    1
[4,]    6   15    3    5    9
[5,]    8   17    4   13   12
> 
> 
> as.matrix(tmp)
            [,1]       [,2]       [,3]       [,4]       [,5]       [,6]
[1,]  0.73480120  1.3305003  0.6667560 -0.5075306 -0.3431442  1.5929108
[2,] -1.85258629 -1.4710547 -0.8449294  0.5068580  0.9423874  2.9028532
[3,] -0.07098375  1.1573110 -0.4006166 -1.2854413 -0.7045785  0.7965058
[4,] -0.14907609 -0.6214142 -0.7907093 -1.3784407 -0.2962209  1.2470278
[5,]  1.21407446  0.2691815 -1.7041013 -0.2332925  0.4445016 -0.1108790
           [,7]       [,8]       [,9]      [,10]      [,11]      [,12]
[1,]  1.8392020 -1.0902176 -0.1522700  0.2136329 -0.4545699  0.3745353
[2,]  1.2211549 -2.7286482 -0.9441463  0.8121684 -0.6245593 -2.9628484
[3,]  0.5877801  0.7007646 -0.2481839  1.0444859 -0.5445528 -0.2161291
[4,] -0.7387211  1.5337836 -2.9021284  1.8940790  0.5027777 -1.0838277
[5,] -0.3579371 -1.5135439 -1.4313334 -0.7913545  0.9168210 -0.8589200
          [,13]      [,14]      [,15]      [,16]       [,17]       [,18]
[1,] -2.2818012 -2.3921826  0.4258453 -1.7236419 -1.51760296  0.08937378
[2,] -0.3032026 -0.1498015  0.9696356 -0.1430431 -0.02984325  0.26913168
[3,]  1.5276166  2.4710039 -1.6396745  0.6516128  1.45183924  0.29113925
[4,] -1.0747837 -0.2865996  1.6956111 -0.7502493 -1.97497736 -1.64539882
[5,] -0.8852493  1.9252767  1.1258158  1.3836314  0.92423770  1.53160028
            [,19]      [,20]
[1,] -0.005768929  1.1287860
[2,]  0.218486141 -2.0189932
[3,] -0.414566609 -1.3282216
[4,] -1.946006431 -0.9708379
[5,]  0.524812560 -1.2925761
> 
> 
> 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.19-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.19-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.19-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  566  bytes.
Disk usage :  160  bytes.
> subBufferedMatrix(tmp,1:3,)
BufferedMatrix object
Matrix size:  3 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.19-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 1.854898 0.9754459 -1.478383 0.884351 -1.683536 0.0230431 -2.867646
          col8     col9     col10    col11    col12      col13      col14
row1 -0.923078 2.272056 0.9678272 2.181075 1.045384 -0.4385748 -0.9526382
         col15      col16       col17      col18       col19      col20
row1 -0.779617 -0.2339619 -0.09823418 -0.7476343 -0.06489575 -0.2830363
> tmp[,"col10"]
          col10
row1 0.96782719
row2 0.06179989
row3 0.75497361
row4 1.01820777
row5 0.95306405
> tmp[c("row1","row5"),]
          col1      col2        col3      col4       col5       col6      col7
row1 1.8548983 0.9754459 -1.47838292  0.884351 -1.6835355  0.0230431 -2.867646
row5 0.2166501 0.4224217  0.01723733 -1.777695  0.6619821 -0.7431580  1.181908
           col8      col9     col10      col11     col12      col13      col14
row1 -0.9230780  2.272056 0.9678272  2.1810753  1.045384 -0.4385748 -0.9526382
row5 -0.7201973 -1.258208 0.9530641 -0.8455358 -2.126681 -1.9866702  0.7416062
         col15      col16       col17      col18       col19      col20
row1 -0.779617 -0.2339619 -0.09823418 -0.7476343 -0.06489575 -0.2830363
row5 -1.046003 -0.3845266 -0.01949927 -1.1537003  2.12068087  0.5889516
> tmp[,c("col6","col20")]
           col6      col20
row1  0.0230431 -0.2830363
row2 -1.0031281 -0.9075479
row3 -0.1574544  1.3311940
row4  1.3188096 -0.5868342
row5 -0.7431580  0.5889516
> tmp[c("row1","row5"),c("col6","col20")]
           col6      col20
row1  0.0230431 -0.2830363
row5 -0.7431580  0.5889516
> 
> 
> 
> 
> 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 50.04047 48.8525 48.91537 49.87559 48.50139 105.3983 50.02974 49.76008
         col9    col10    col11    col12    col13    col14    col15   col16
row1 50.27365 49.11248 51.64005 50.50205 50.10658 49.25076 51.10062 46.9316
        col17    col18    col19    col20
row1 48.29278 50.01709 50.01941 105.2475
> tmp[,"col10"]
        col10
row1 49.11248
row2 30.19833
row3 30.13529
row4 30.00833
row5 51.38601
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 50.04047 48.85250 48.91537 49.87559 48.50139 105.3983 50.02974 49.76008
row5 51.24119 51.00532 50.56537 49.55354 50.37157 104.6359 48.75273 50.62755
         col9    col10    col11    col12    col13    col14    col15    col16
row1 50.27365 49.11248 51.64005 50.50205 50.10658 49.25076 51.10062 46.93160
row5 50.31450 51.38601 50.32100 49.40341 50.88642 49.18475 50.79908 49.14522
        col17    col18    col19    col20
row1 48.29278 50.01709 50.01941 105.2475
row5 49.76227 49.44760 50.62101 104.5513
> tmp[,c("col6","col20")]
          col6     col20
row1 105.39828 105.24745
row2  73.71100  73.61676
row3  75.26537  74.42987
row4  74.41969  75.40286
row5 104.63587 104.55131
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 105.3983 105.2475
row5 104.6359 104.5513
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 105.3983 105.2475
row5 104.6359 104.5513
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
           col13
[1,]  0.75973733
[2,] -0.65178937
[3,]  0.04856532
[4,] -1.11583871
[5,]  1.98513992
> tmp[,c("col17","col7")]
          col17        col7
[1,]  1.7564508  0.97495806
[2,] -0.7626684 -0.38501012
[3,] -1.3545337  0.08878102
[4,]  0.8867298 -1.50945788
[5,] -0.3130282 -0.62644818
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
            col6       col20
[1,]  0.01937701  1.36535643
[2,]  0.94817598 -0.66221575
[3,]  0.22481594  0.05567491
[4,] -0.50112895 -0.11551487
[5,] -0.61389549  1.02549445
> subBufferedMatrix(tmp,1,c("col6"))[,1]
           col1
[1,] 0.01937701
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
           col6
[1,] 0.01937701
[2,] 0.94817598
> 
> 
> 
> 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.1744096 1.535646 -0.03276707 0.1803503 1.139275 -1.8338084 0.341901
row1 -0.1413368 2.088203 -0.63834888 0.6152854 2.178245 -0.7650048 1.010197
           [,8]       [,9]      [,10]      [,11]      [,12]       [,13]
row3 -1.2031596  0.3864236 -0.8277044  1.0730216 -0.5097399 -1.48617998
row1  0.3531779 -2.0815875 -0.1384659 -0.4375639  0.4964463 -0.09900803
          [,14]      [,15]     [,16]     [,17]      [,18]       [,19]
row3 -1.0666705  0.3126795 1.5661706 0.1804110  0.9055581 0.001717239
row1 -0.8677452 -1.0896631 0.0807609 0.7585054 -0.8007040 1.282590158
          [,20]
row3 -1.0017361
row1  0.3456969
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
           [,1]       [,2]        [,3]      [,4]      [,5]      [,6]       [,7]
row2 -0.2403108 0.09487479 -0.09991576 -2.264129 -2.535004 -1.910064 -0.1409716
           [,8]     [,9]      [,10]
row2 -0.6443069 0.800235 -0.9562909
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
           [,1]       [,2]      [,3]    [,4]      [,5]      [,6]       [,7]
row5 -0.2758859 -0.8097635 0.6251316 2.19939 0.1925933 -1.758483 0.01973626
         [,8]       [,9]     [,10]   [,11]     [,12]     [,13]     [,14]
row5 1.359705 -0.0328878 -0.974449 1.17158 0.1715051 0.4162136 -1.115815
          [,15]    [,16]    [,17]     [,18]    [,19]      [,20]
row5 -0.2474891 1.250419 1.732424 0.6266758 1.255233 -0.9528359
> 
> 
> 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: 0x55fe4adb1020>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "/home/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests/BM392c415d17173c"
 [2] "/home/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests/BM392c414f8e43e2"
 [3] "/home/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests/BM392c413093b197"
 [4] "/home/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests/BM392c4149608b08"
 [5] "/home/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests/BM392c412700deba"
 [6] "/home/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests/BM392c413a984773"
 [7] "/home/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests/BM392c4158c2945" 
 [8] "/home/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests/BM392c41663ac59d"
 [9] "/home/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests/BM392c41549c02c6"
[10] "/home/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests/BM392c415ec6d157"
[11] "/home/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests/BM392c4133e5a37d"
[12] "/home/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests/BM392c41534498fa"
[13] "/home/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests/BM392c416e6009eb"
[14] "/home/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests/BM392c411fcb5fb3"
[15] "/home/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests/BM392c41c454ec5" 
> 
> 
> ### 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: 0x55fe49ce1ca0>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x55fe49ce1ca0>
Warning message:
In dir.create(new.directory) :
  '/home/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x55fe49ce1ca0>
> rowMedians(tmp)
  [1]  0.431649036 -0.042020562 -0.418753697  0.127744939  0.417295206
  [6]  0.117814198  0.105882277 -0.228207344 -0.160387872  0.581019264
 [11] -0.612163547  0.248137473  0.087267993  0.017976586  0.648455378
 [16] -0.425846449  0.747691949  0.140317407  0.174051715  0.009119733
 [21] -0.409256097  0.165565657  0.100039693 -0.448474572 -0.217907991
 [26] -0.602829508  0.295787868 -0.086485288  0.467170511 -0.507950637
 [31]  0.244197768 -0.070095319  0.039522479  0.395282336  0.337308570
 [36] -0.684406630  0.214438887 -0.035934974  0.236355201  0.274118559
 [41] -0.414575476 -0.117423068  0.242565504 -0.072203570 -0.490618537
 [46]  0.115148393 -0.379546726  0.036400033  0.667074497 -0.128519644
 [51]  0.055280751  0.328932116  0.140557852  0.232742827 -0.232596543
 [56] -0.317585709  0.080644884  0.054899652 -0.268082352 -0.098101102
 [61] -0.123757962 -0.406313435 -0.188994177 -0.157288875 -0.106357089
 [66] -0.167937042  0.235590759 -0.118961224  0.396170531 -0.308480090
 [71] -0.272684722 -0.576202998 -0.631270924 -0.178958431  0.338651427
 [76]  0.259626616  0.366954025  0.242955106  0.034017482 -0.023989360
 [81]  0.065590232  0.294306341 -0.396058713 -0.228413519  0.229055612
 [86] -0.540836557  0.556811582  0.190517036  0.181354213 -0.179548840
 [91] -0.307618628 -0.198859323 -0.078654242 -0.096796663  0.227582284
 [96] -0.194353381  0.217846931  0.056808037 -0.049804981 -0.416379355
[101] -0.041043205  0.011713733 -0.605426655  0.459768562 -0.213405985
[106]  0.002305022 -0.458499111  0.050747276  0.082393836 -0.793739777
[111]  0.779211878 -0.372000981  0.169140309 -0.356913776  0.624638182
[116]  0.161586786 -0.107287751 -0.086470095  0.208477625 -0.194221114
[121]  0.570849178 -0.228010672  0.279010621 -0.005592513 -0.455240964
[126] -0.109948838 -0.396198993  0.192507368  0.039681473  0.119925133
[131]  0.308203639  0.395754620 -0.715368546  0.229467322 -0.201176227
[136]  0.070465873 -0.009393212 -0.078890017  0.200044580 -0.594605342
[141] -0.705723791  0.020934129 -0.102977930 -0.155527188 -0.304885526
[146]  0.410118673 -0.739019784  0.307839446  0.474129341  0.168647973
[151]  0.222050894  0.167906889 -0.107525301 -0.180597835  0.329003513
[156]  0.218520000  0.114819170  0.026601118 -0.068327797 -0.356452644
[161] -0.386866293  0.076847751 -0.047232794 -0.282029528  0.080839664
[166]  0.356935064 -0.461263458  0.405438172 -0.158492347  0.320853636
[171]  0.235840694  0.243796457  0.346147139 -0.619401302 -0.190867173
[176] -0.841753789 -0.172075254  0.148540109  0.234862779  0.109545930
[181] -0.403640324  0.136740589  0.003091633  0.017151430 -0.432347054
[186] -0.450635391  0.160018677 -0.232381649 -0.176890776  0.164912190
[191]  0.187512875 -0.101716491 -0.197519748  0.152934068 -0.146859601
[196] -0.072147264  0.133568764  0.018070707  0.281567091  0.341737662
[201] -0.370839787 -0.191849106  0.189106830 -0.095445321 -0.352381468
[206] -0.453290861  0.260521569  0.253982020  0.080027006 -0.220788594
[211]  0.029272183  0.659160484 -0.019842566  0.056431895  0.002858771
[216]  0.414834019  0.207176618 -0.373953522  0.172640164 -0.241137661
[221]  0.628365054  0.077057501 -0.192954608  0.151359317  0.009872430
[226] -0.278931652 -0.303963454  0.090690921  0.180184193  0.066505279
> 
> proc.time()
   user  system elapsed 
  1.340   1.522   2.880 

BufferedMatrix.Rcheck/tests/rawCalltesting.Rout


R version 4.4.0 beta (2024-04-15 r86425) -- "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: 0x55bfc64bab20>
> .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: 0x55bfc64bab20>
> .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: 0x55bfc64bab20>
> .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: 0x55bfc64bab20>
> 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: 0x55bfc44e4430>
> .Call("R_bm_AddColumn",P)
<pointer: 0x55bfc44e4430>
> .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: 0x55bfc44e4430>
> .Call("R_bm_AddColumn",P)
<pointer: 0x55bfc44e4430>
> .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: 0x55bfc44e4430>
> 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: 0x55bfc44cfc60>
> .Call("R_bm_AddColumn",P)
<pointer: 0x55bfc44cfc60>
> .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: 0x55bfc44cfc60>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x55bfc44cfc60>
> .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: 0x55bfc44cfc60>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x55bfc44cfc60>
> .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: 0x55bfc44cfc60>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x55bfc44cfc60>
> .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: 0x55bfc44cfc60>
> 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: 0x55bfc432a030>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x55bfc432a030>
> .Call("R_bm_AddColumn",P)
<pointer: 0x55bfc432a030>
> .Call("R_bm_AddColumn",P)
<pointer: 0x55bfc432a030>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile3931833781d41c" "BufferedMatrixFile393183638ad6c8"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile3931833781d41c" "BufferedMatrixFile393183638ad6c8"
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x55bfc545aac0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x55bfc545aac0>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x55bfc545aac0>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x55bfc545aac0>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x55bfc545aac0>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x55bfc545aac0>
> .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: 0x55bfc4f61b90>
> .Call("R_bm_AddColumn",P)
<pointer: 0x55bfc4f61b90>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x55bfc4f61b90>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x55bfc4f61b90>
> 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: 0x55bfc5121430>
> .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: 0x55bfc5121430>
> rm(P)
> 
> proc.time()
   user  system elapsed 
  0.256   0.055   0.300 

BufferedMatrix.Rcheck/tests/Rcodetesting.Rout


R version 4.4.0 beta (2024-04-15 r86425) -- "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.258   0.042   0.287 

Example timings