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

This page was generated on 2023-11-02 11:40:29 -0400 (Thu, 02 Nov 2023).

HostnameOSArch (*)R versionInstalled pkgs
nebbiolo2Linux (Ubuntu 22.04.2 LTS)x86_644.3.1 (2023-06-16) -- "Beagle Scouts" 4729
palomino4Windows Server 2022 Datacenterx644.3.1 (2023-06-16 ucrt) -- "Beagle Scouts" 4463
lconwaymacOS 12.6.5 Montereyx86_644.3.1 Patched (2023-06-17 r84564) -- "Beagle Scouts" 4478
kunpeng2Linux (openEuler 22.03 LTS-SP1)aarch644.3.1 (2023-06-16) -- "Beagle Scouts" 4464
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 246/2266HostnameOS / ArchINSTALLBUILDCHECKBUILD BIN
BufferedMatrix 1.66.0  (landing page)
Ben Bolstad
Snapshot Date: 2023-11-01 14:05:06 -0400 (Wed, 01 Nov 2023)
git_url: https://git.bioconductor.org/packages/BufferedMatrix
git_branch: RELEASE_3_18
git_last_commit: 1feca44
git_last_commit_date: 2023-10-24 09:37:50 -0400 (Tue, 24 Oct 2023)
nebbiolo2Linux (Ubuntu 22.04.2 LTS) / x86_64  OK    OK    OK  UNNEEDED, same version is already published
palomino4Windows Server 2022 Datacenter / x64  OK    OK    OK    OK  UNNEEDED, same version is already published
lconwaymacOS 12.6.5 Monterey / x86_64  OK    OK    WARNINGS    OK  UNNEEDED, same version is already published
kjohnson1macOS 13.6.1 Ventura / arm64see weekly results here
kunpeng2Linux (openEuler 22.03 LTS-SP1) / aarch64  OK    OK    OK  

CHECK results for BufferedMatrix on kunpeng2


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.
- See Martin Grigorov's blog post for how to debug Linux ARM64 related issues on a x86_64 host.

raw results


Summary

Package: BufferedMatrix
Version: 1.66.0
Command: /home/biocbuild/R/R-4.3.1/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/home/biocbuild/R/R-4.3.1/site-library --no-vignettes --timings BufferedMatrix_1.66.0.tar.gz
StartedAt: 2023-11-02 08:55:12 -0000 (Thu, 02 Nov 2023)
EndedAt: 2023-11-02 08:55:38 -0000 (Thu, 02 Nov 2023)
EllapsedTime: 25.9 seconds
RetCode: 0
Status:   OK  
CheckDir: BufferedMatrix.Rcheck
Warnings: 0

Command output

##############################################################################
##############################################################################
###
### Running command:
###
###   /home/biocbuild/R/R-4.3.1/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/home/biocbuild/R/R-4.3.1/site-library --no-vignettes --timings BufferedMatrix_1.66.0.tar.gz
###
##############################################################################
##############################################################################


* using log directory ‘/home/biocbuild/bbs-3.18-bioc/meat/BufferedMatrix.Rcheck’
* using R version 4.3.1 (2023-06-16)
* using platform: aarch64-unknown-linux-gnu (64-bit)
* R was compiled by
    gcc (GCC) 10.3.1
    GNU Fortran (GCC) 10.3.1
* running under: openEuler 22.03 (LTS-SP1)
* using session charset: UTF-8
* using option ‘--no-vignettes’
* checking for file ‘BufferedMatrix/DESCRIPTION’ ... OK
* this is package ‘BufferedMatrix’ version ‘1.66.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 (GCC) 10.3.1’
* 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 R 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
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 in ‘inst/doc’ ... OK
* checking running R code from vignettes ... SKIPPED
* checking re-building of vignette outputs ... SKIPPED
* checking PDF version of manual ... OK
* DONE

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



Installation output

BufferedMatrix.Rcheck/00install.out

##############################################################################
##############################################################################
###
### Running command:
###
###   /home/biocbuild/R/R-4.3.1/bin/R CMD INSTALL BufferedMatrix
###
##############################################################################
##############################################################################


* installing to library ‘/home/biocbuild/R/R-4.3.1/site-library’
* installing *source* package ‘BufferedMatrix’ ...
** using staged installation
** libs
using C compiler: ‘gcc (GCC) 10.3.1’
gcc -I"/home/biocbuild/R/R-4.3.1/include" -DNDEBUG   -I/usr/local/include    -fPIC  -g -O2  -Wall -c RBufferedMatrix.c -o RBufferedMatrix.o
gcc -I"/home/biocbuild/R/R-4.3.1/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/R/R-4.3.1/include" -DNDEBUG   -I/usr/local/include    -fPIC  -g -O2  -Wall -c doubleBufferedMatrix_C_tests.c -o doubleBufferedMatrix_C_tests.o
gcc -I"/home/biocbuild/R/R-4.3.1/include" -DNDEBUG   -I/usr/local/include    -fPIC  -g -O2  -Wall -c init_package.c -o init_package.o
gcc -shared -L/home/biocbuild/R/R-4.3.1/lib -L/usr/local/lib -o BufferedMatrix.so RBufferedMatrix.o doubleBufferedMatrix.o doubleBufferedMatrix_C_tests.o init_package.o -L/home/biocbuild/R/R-4.3.1/lib -lR
installing to /home/biocbuild/R/R-4.3.1/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.3.1 (2023-06-16) -- "Beagle Scouts"
Copyright (C) 2023 The R Foundation for Statistical Computing
Platform: aarch64-unknown-linux-gnu (64-bit)

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.282   0.062   0.333 

BufferedMatrix.Rcheck/tests/objectTesting.Rout


R version 4.3.1 (2023-06-16) -- "Beagle Scouts"
Copyright (C) 2023 The R Foundation for Statistical Computing
Platform: aarch64-unknown-linux-gnu (64-bit)

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.18-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 457529 24.5     981817 52.5   650817 34.8
Vcells 842781  6.5    8388608 64.0  2061648 15.8
> 
> 
> 
> 
> ##
> ## checking reads
> ##
> 
> tmp2 <- createBufferedMatrix(10,20)
> 
> test.sample <- rnorm(10*20)
> 
> tmp2[1:10,1:20] <- test.sample
> 
> test.matrix <- matrix(test.sample,10,20)
> 
> ## testing reads
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   which.col <- sample(1:20,1)
+   if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> date()
[1] "Thu Nov  2 08:55:33 2023"
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> date()
[1] "Thu Nov  2 08:55:33 2023"
> 
> 
> 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: 0x281ca990>
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   which.col <- sample(1:20,1)
+   if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,5,replace=TRUE)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> date()
[1] "Thu Nov  2 08:55:33 2023"
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col <- sample(1:20,5,replace=TRUE)
+   if (!all(tmp2[which.row,which.col] == test.matrix[which.row,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> date()
[1] "Thu Nov  2 08:55:33 2023"
> 
> ColMode(tmp2)
<pointer: 0x281ca990>
> 
> 
> 
> ### Now testing assignments
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+ 
+   new.data <- rnorm(20)
+   tmp2[which.row,] <- new.data
+   test.matrix[which.row,] <- new.data
+   if (rep > 1){
+     if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+   
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   new.data <- rnorm(10)
+   tmp2[,which.col] <- new.data
+   test.matrix[,which.col]<- new.data
+ 
+   if (rep > 1){
+     if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.col <- which.col
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,5,replace=TRUE)
+   new.data <- matrix(rnorm(50),5,10)
+   tmp2[,which.col] <- new.data
+   test.matrix[,which.col]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.col <- which.col
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   new.data <- matrix(rnorm(50),5,10)
+   tmp2[which.row,] <- new.data
+   test.matrix[which.row,]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col  <- sample(1:20,5,replace=TRUE)
+   new.data <- matrix(rnorm(25),5,5)
+   tmp2[which.row,which.col] <- new.data
+   test.matrix[which.row,which.col]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[prev.row,prev.col] == test.matrix[prev.row,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+   prev.col <- which.col
+ }
> 
> 
> 
> 
> ###
> ###
> ### testing some more functions
> ###
> 
> 
> 
> ## duplication function
> tmp5 <- duplicate(tmp2)
> 
> # making sure really did copy everything.
> tmp5[1,1] <- tmp5[1,1] +100.00
> 
> if (tmp5[1,1] == tmp2[1,1]){
+   stop("Problem with duplication")
+ }
> 
> 
> 
> 
> ### testing elementwise applying of functions
> 
> tmp5[1:4,1:4]
             [,1]       [,2]       [,3]         [,4]
[1,] 101.28790601 -0.6259419  0.9414516 -1.542804227
[2,]  -1.22279566 -0.9313893 -0.1228438 -0.004749671
[3,]  -0.97163912  0.1679657 -0.2808444 -1.994270518
[4,]  -0.02047474  0.3248567  1.1847121  0.877797487
> ewApply(tmp5,abs)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.18-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
             [,1]      [,2]      [,3]        [,4]
[1,] 101.28790601 0.6259419 0.9414516 1.542804227
[2,]   1.22279566 0.9313893 0.1228438 0.004749671
[3,]   0.97163912 0.1679657 0.2808444 1.994270518
[4,]   0.02047474 0.3248567 1.1847121 0.877797487
> ewApply(tmp5,sqrt)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.18-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
           [,1]      [,2]      [,3]       [,4]
[1,] 10.0641893 0.7911649 0.9702843 1.24209671
[2,]  1.1058009 0.9650851 0.3504908 0.06891786
[3,]  0.9857176 0.4098362 0.5299476 1.41218643
[4,]  0.1430900 0.5699620 1.0884448 0.93690847
> 
> 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.18-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
          [,1]     [,2]     [,3]     [,4]
[1,] 226.92980 33.53759 35.64429 38.96377
[2,]  37.28080 35.58224 28.62775 25.69393
[3,]  35.82881 29.26633 30.58032 41.11613
[4,]  26.45137 31.02448 37.06916 35.24688
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x2a5403b0>
> exp(tmp5)
<pointer: 0x2a5403b0>
> log(tmp5,2)
<pointer: 0x2a5403b0>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 472.3246
> Min(tmp5)
[1] 53.07172
> mean(tmp5)
[1] 73.55093
> Sum(tmp5)
[1] 14710.19
> Var(tmp5)
[1] 882.4255
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 91.70104 70.26383 76.62032 70.02487 70.82077 70.99349 72.36721 70.12646
 [9] 72.48297 70.10841
> rowSums(tmp5)
 [1] 1834.021 1405.277 1532.406 1400.497 1416.415 1419.870 1447.344 1402.529
 [9] 1449.659 1402.168
> rowVars(tmp5)
 [1] 8112.07353   76.96892  100.81379   51.96296   61.49492   89.27246
 [7]   82.86310   91.61933   64.95643   86.85219
> rowSd(tmp5)
 [1] 90.067050  8.773193 10.040607  7.208534  7.841870  9.448411  9.102917
 [8]  9.571799  8.059555  9.319452
> rowMax(tmp5)
 [1] 472.32464  85.37343  93.10113  81.64525  94.52360  88.83559  89.95394
 [8]  88.43887  86.56070  87.84751
> rowMin(tmp5)
 [1] 53.63005 53.47855 57.99862 55.05507 59.38956 56.91226 57.12964 54.85703
 [9] 60.17866 53.07172
> 
> colMeans(tmp5)
 [1] 110.07265  73.19591  71.52273  71.21972  73.46592  76.00074  72.13008
 [8]  70.10991  69.10310  69.84416  72.22815  69.91670  71.53843  73.51444
[15]  71.05644  73.99607  72.21088  69.96939  67.91296  72.01031
> colSums(tmp5)
 [1] 1100.7265  731.9591  715.2273  712.1972  734.6592  760.0074  721.3008
 [8]  701.0991  691.0310  698.4416  722.2815  699.1670  715.3843  735.1444
[15]  710.5644  739.9607  722.1088  699.6939  679.1296  720.1031
> colVars(tmp5)
 [1] 16272.00669    81.05939    86.08537    86.71638    85.94960   142.80051
 [7]   103.39881    35.46751    84.74250    61.40759    78.59812   121.60880
[13]    38.56198    38.22649    67.72474   122.31525    58.25356   148.53325
[19]    60.54350   102.83610
> colSd(tmp5)
 [1] 127.561776   9.003299   9.278220   9.312163   9.270901  11.949917
 [7]  10.168520   5.955461   9.205569   7.836300   8.865558  11.027638
[13]   6.209829   6.182757   8.229504  11.059622   7.632402  12.187422
[19]   7.780970  10.140813
> colMax(tmp5)
 [1] 472.32464  88.83559  89.95394  85.57785  86.56070  94.52360  93.10113
 [8]  82.87379  80.25222  81.54388  85.95477  88.43887  82.58936  81.64525
[15]  80.23980  88.92625  84.18710  91.30518  79.15743  90.23761
> colMin(tmp5)
 [1] 55.05507 60.91403 59.58491 53.47855 61.75872 57.12964 60.30322 64.58518
 [9] 53.56938 56.91226 57.99862 53.07172 61.63352 61.45013 55.84547 54.85703
[17] 60.67851 53.63005 56.40549 56.50085
> 
> 
> ### setting a random element to NA and then testing with na.rm=TRUE or na.rm=FALSE (The default)
> 
> 
> which.row <- sample(1:10,1,replace=TRUE)
> which.col  <- sample(1:20,1,replace=TRUE)
> 
> tmp5[which.row,which.col] <- NA
> 
> Max(tmp5)
[1] NA
> Min(tmp5)
[1] NA
> mean(tmp5)
[1] NA
> Sum(tmp5)
[1] NA
> Var(tmp5)
[1] NA
> 
> rowMeans(tmp5)
 [1] 91.70104 70.26383 76.62032 70.02487 70.82077 70.99349 72.36721 70.12646
 [9]       NA 70.10841
> rowSums(tmp5)
 [1] 1834.021 1405.277 1532.406 1400.497 1416.415 1419.870 1447.344 1402.529
 [9]       NA 1402.168
> rowVars(tmp5)
 [1] 8112.07353   76.96892  100.81379   51.96296   61.49492   89.27246
 [7]   82.86310   91.61933   59.91816   86.85219
> rowSd(tmp5)
 [1] 90.067050  8.773193 10.040607  7.208534  7.841870  9.448411  9.102917
 [8]  9.571799  7.740682  9.319452
> rowMax(tmp5)
 [1] 472.32464  85.37343  93.10113  81.64525  94.52360  88.83559  89.95394
 [8]  88.43887        NA  87.84751
> rowMin(tmp5)
 [1] 53.63005 53.47855 57.99862 55.05507 59.38956 56.91226 57.12964 54.85703
 [9]       NA 53.07172
> 
> colMeans(tmp5)
 [1] 110.07265  73.19591  71.52273  71.21972  73.46592  76.00074  72.13008
 [8]  70.10991  69.10310  69.84416  72.22815  69.91670  71.53843  73.51444
[15]  71.05644  73.99607  72.21088        NA  67.91296  72.01031
> colSums(tmp5)
 [1] 1100.7265  731.9591  715.2273  712.1972  734.6592  760.0074  721.3008
 [8]  701.0991  691.0310  698.4416  722.2815  699.1670  715.3843  735.1444
[15]  710.5644  739.9607  722.1088        NA  679.1296  720.1031
> colVars(tmp5)
 [1] 16272.00669    81.05939    86.08537    86.71638    85.94960   142.80051
 [7]   103.39881    35.46751    84.74250    61.40759    78.59812   121.60880
[13]    38.56198    38.22649    67.72474   122.31525    58.25356          NA
[19]    60.54350   102.83610
> colSd(tmp5)
 [1] 127.561776   9.003299   9.278220   9.312163   9.270901  11.949917
 [7]  10.168520   5.955461   9.205569   7.836300   8.865558  11.027638
[13]   6.209829   6.182757   8.229504  11.059622   7.632402         NA
[19]   7.780970  10.140813
> colMax(tmp5)
 [1] 472.32464  88.83559  89.95394  85.57785  86.56070  94.52360  93.10113
 [8]  82.87379  80.25222  81.54388  85.95477  88.43887  82.58936  81.64525
[15]  80.23980  88.92625  84.18710        NA  79.15743  90.23761
> colMin(tmp5)
 [1] 55.05507 60.91403 59.58491 53.47855 61.75872 57.12964 60.30322 64.58518
 [9] 53.56938 56.91226 57.99862 53.07172 61.63352 61.45013 55.84547 54.85703
[17] 60.67851       NA 56.40549 56.50085
> 
> Max(tmp5,na.rm=TRUE)
[1] 472.3246
> Min(tmp5,na.rm=TRUE)
[1] 53.07172
> mean(tmp5,na.rm=TRUE)
[1] 73.61741
> Sum(tmp5,na.rm=TRUE)
[1] 14649.86
> Var(tmp5,na.rm=TRUE)
[1] 885.994
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 91.70104 70.26383 76.62032 70.02487 70.82077 70.99349 72.36721 70.12646
 [9] 73.12296 70.10841
> rowSums(tmp5,na.rm=TRUE)
 [1] 1834.021 1405.277 1532.406 1400.497 1416.415 1419.870 1447.344 1402.529
 [9] 1389.336 1402.168
> rowVars(tmp5,na.rm=TRUE)
 [1] 8112.07353   76.96892  100.81379   51.96296   61.49492   89.27246
 [7]   82.86310   91.61933   59.91816   86.85219
> rowSd(tmp5,na.rm=TRUE)
 [1] 90.067050  8.773193 10.040607  7.208534  7.841870  9.448411  9.102917
 [8]  9.571799  7.740682  9.319452
> rowMax(tmp5,na.rm=TRUE)
 [1] 472.32464  85.37343  93.10113  81.64525  94.52360  88.83559  89.95394
 [8]  88.43887  86.56070  87.84751
> rowMin(tmp5,na.rm=TRUE)
 [1] 53.63005 53.47855 57.99862 55.05507 59.38956 56.91226 57.12964 54.85703
 [9] 60.17866 53.07172
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 110.07265  73.19591  71.52273  71.21972  73.46592  76.00074  72.13008
 [8]  70.10991  69.10310  69.84416  72.22815  69.91670  71.53843  73.51444
[15]  71.05644  73.99607  72.21088  71.04120  67.91296  72.01031
> colSums(tmp5,na.rm=TRUE)
 [1] 1100.7265  731.9591  715.2273  712.1972  734.6592  760.0074  721.3008
 [8]  701.0991  691.0310  698.4416  722.2815  699.1670  715.3843  735.1444
[15]  710.5644  739.9607  722.1088  639.3708  679.1296  720.1031
> colVars(tmp5,na.rm=TRUE)
 [1] 16272.00669    81.05939    86.08537    86.71638    85.94960   142.80051
 [7]   103.39881    35.46751    84.74250    61.40759    78.59812   121.60880
[13]    38.56198    38.22649    67.72474   122.31525    58.25356   154.17611
[19]    60.54350   102.83610
> colSd(tmp5,na.rm=TRUE)
 [1] 127.561776   9.003299   9.278220   9.312163   9.270901  11.949917
 [7]  10.168520   5.955461   9.205569   7.836300   8.865558  11.027638
[13]   6.209829   6.182757   8.229504  11.059622   7.632402  12.416767
[19]   7.780970  10.140813
> colMax(tmp5,na.rm=TRUE)
 [1] 472.32464  88.83559  89.95394  85.57785  86.56070  94.52360  93.10113
 [8]  82.87379  80.25222  81.54388  85.95477  88.43887  82.58936  81.64525
[15]  80.23980  88.92625  84.18710  91.30518  79.15743  90.23761
> colMin(tmp5,na.rm=TRUE)
 [1] 55.05507 60.91403 59.58491 53.47855 61.75872 57.12964 60.30322 64.58518
 [9] 53.56938 56.91226 57.99862 53.07172 61.63352 61.45013 55.84547 54.85703
[17] 60.67851 53.63005 56.40549 56.50085
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1] 91.70104 70.26383 76.62032 70.02487 70.82077 70.99349 72.36721 70.12646
 [9]      NaN 70.10841
> rowSums(tmp5,na.rm=TRUE)
 [1] 1834.021 1405.277 1532.406 1400.497 1416.415 1419.870 1447.344 1402.529
 [9]    0.000 1402.168
> rowVars(tmp5,na.rm=TRUE)
 [1] 8112.07353   76.96892  100.81379   51.96296   61.49492   89.27246
 [7]   82.86310   91.61933         NA   86.85219
> rowSd(tmp5,na.rm=TRUE)
 [1] 90.067050  8.773193 10.040607  7.208534  7.841870  9.448411  9.102917
 [8]  9.571799        NA  9.319452
> rowMax(tmp5,na.rm=TRUE)
 [1] 472.32464  85.37343  93.10113  81.64525  94.52360  88.83559  89.95394
 [8]  88.43887        NA  87.84751
> rowMin(tmp5,na.rm=TRUE)
 [1] 53.63005 53.47855 57.99862 55.05507 59.38956 56.91226 57.12964 54.85703
 [9]       NA 53.07172
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1] 114.02829  73.18827  72.34851  72.06460  72.01094  76.99872  72.95177
 [8]  69.48184  68.47975  70.91810  73.29535  68.99316  70.31055  73.68425
[15]  70.03607  73.05551  71.15705       NaN  67.35699  71.99104
> colSums(tmp5,na.rm=TRUE)
 [1] 1026.2546  658.6944  651.1366  648.5814  648.0985  692.9885  656.5659
 [8]  625.3365  616.3178  638.2629  659.6581  620.9385  632.7950  663.1583
[15]  630.3246  657.4996  640.4134    0.0000  606.2129  647.9194
> colVars(tmp5,na.rm=TRUE)
 [1] 18129.97829    91.19116    89.17453    89.52548    72.87757   149.44593
 [7]   108.72799    35.46312    90.96393    56.10830    75.61009   127.21450
[13]    26.42070    42.68039    64.47727   127.65223    53.04134          NA
[19]    64.63405   115.68644
> colSd(tmp5,na.rm=TRUE)
 [1] 134.647608   9.549406   9.443227   9.461790   8.536836  12.224808
 [7]  10.427271   5.955092   9.537501   7.490548   8.695406  11.278941
[13]   5.140107   6.533023   8.029774  11.298329   7.282948         NA
[19]   8.039531  10.755763
> colMax(tmp5,na.rm=TRUE)
 [1] 472.32464  88.83559  89.95394  85.57785  85.37343  94.52360  93.10113
 [8]  82.87379  80.25222  81.54388  85.95477  88.43887  79.24474  81.64525
[15]  79.77029  88.92625  84.18710      -Inf  79.15743  90.23761
> colMin(tmp5,na.rm=TRUE)
 [1] 55.05507 60.91403 59.58491 53.47855 61.75872 57.12964 60.30322 64.58518
 [9] 53.56938 56.91226 57.99862 53.07172 61.63352 61.45013 55.84547 54.85703
[17] 60.67851      Inf 56.40549 56.50085
> 
> 
> 
> 
> 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] 260.1337 179.9195 190.6077 171.1772 209.5510 359.5484 157.6151 315.7714
 [9] 202.1509 304.8451
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 260.1337 179.9195 190.6077 171.1772 209.5510 359.5484 157.6151 315.7714
 [9] 202.1509 304.8451
> 
> 
> 
> copymatrix <- matrix(rnorm(200,150,15),10,20)
> 
> tmp5[1:10,1:20] <- copymatrix
> which.row <- 1
> which.col  <- 3
> cat(which.row," ",which.col,"\n")
1   3 
> tmp5[which.row,which.col] <- NA
> copymatrix[which.row,which.col] <- NA
> 
> colVars(tmp5,na.rm=TRUE)-apply(copymatrix,2,var,na.rm=TRUE)
 [1]  0.000000e+00 -2.273737e-13  5.684342e-14  5.684342e-14 -5.684342e-14
 [6] -1.421085e-14  2.842171e-14  8.526513e-14  5.684342e-14 -5.684342e-14
[11] -2.842171e-14  5.684342e-14  0.000000e+00  2.842171e-14  0.000000e+00
[16]  1.136868e-13  1.136868e-13  1.136868e-13 -2.273737e-13  5.684342e-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)
+ }
8   3 
10   14 
10   16 
3   13 
8   17 
4   15 
6   17 
9   6 
4   7 
10   2 
3   18 
4   2 
2   15 
9   14 
9   7 
3   17 
3   20 
6   4 
4   10 
2   14 
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.16193
> Min(tmp)
[1] -2.303883
> mean(tmp)
[1] 0.02748082
> Sum(tmp)
[1] 2.748082
> Var(tmp)
[1] 0.8469492
> 
> rowMeans(tmp)
[1] 0.02748082
> rowSums(tmp)
[1] 2.748082
> rowVars(tmp)
[1] 0.8469492
> rowSd(tmp)
[1] 0.9202984
> rowMax(tmp)
[1] 2.16193
> rowMin(tmp)
[1] -2.303883
> 
> colMeans(tmp)
  [1]  0.44182961 -0.03476540 -0.58678839 -1.25015885  0.77923065 -0.97027371
  [7]  0.05278601 -1.01565077  0.42382434  0.69347218 -0.83851422 -1.91923076
 [13] -0.23156080  0.49260956  0.28379907 -0.09112402 -0.74729251  0.40891712
 [19]  1.91389244  0.31414593 -0.03578916  1.57739245 -0.27875906  1.53996472
 [25] -0.37246972 -0.60604168  0.89147073  0.36413514  0.50125947  1.81816781
 [31]  0.42973042  1.16210103 -1.48731087  1.49869295  0.08517462 -0.18659299
 [37] -0.06642323 -0.67508626 -1.79595102 -1.28246794  0.07134563 -0.86412190
 [43]  0.16377002  0.48734710  1.45210962 -0.40965184 -0.71206594 -0.02553298
 [49] -0.89094402  0.80226213  0.16514238  2.16192987 -1.62348766  0.14340935
 [55]  0.50073246  1.56930262 -1.05248120  1.17596715  1.17986145 -0.14910411
 [61]  0.18146874 -1.46416785 -0.14857276 -0.64270566 -0.31629621 -1.00305979
 [67]  0.70053990 -1.43509019  1.69665435 -0.97255638  0.08476879  0.77790220
 [73] -2.30388336  0.01335980  0.77614917  0.62439755  0.07250802 -0.68316334
 [79]  1.32504893 -0.80195913 -0.76870310 -0.65813671  0.01858989 -0.03561010
 [85] -0.45155724  0.02639805  0.96932154  0.96117539  0.59194361  0.45605975
 [91] -0.65174178  1.47331430 -0.30867336  0.11986197 -0.62677620 -0.56624110
 [97]  1.24373963 -0.27330112 -0.47444593 -0.12461310
> colSums(tmp)
  [1]  0.44182961 -0.03476540 -0.58678839 -1.25015885  0.77923065 -0.97027371
  [7]  0.05278601 -1.01565077  0.42382434  0.69347218 -0.83851422 -1.91923076
 [13] -0.23156080  0.49260956  0.28379907 -0.09112402 -0.74729251  0.40891712
 [19]  1.91389244  0.31414593 -0.03578916  1.57739245 -0.27875906  1.53996472
 [25] -0.37246972 -0.60604168  0.89147073  0.36413514  0.50125947  1.81816781
 [31]  0.42973042  1.16210103 -1.48731087  1.49869295  0.08517462 -0.18659299
 [37] -0.06642323 -0.67508626 -1.79595102 -1.28246794  0.07134563 -0.86412190
 [43]  0.16377002  0.48734710  1.45210962 -0.40965184 -0.71206594 -0.02553298
 [49] -0.89094402  0.80226213  0.16514238  2.16192987 -1.62348766  0.14340935
 [55]  0.50073246  1.56930262 -1.05248120  1.17596715  1.17986145 -0.14910411
 [61]  0.18146874 -1.46416785 -0.14857276 -0.64270566 -0.31629621 -1.00305979
 [67]  0.70053990 -1.43509019  1.69665435 -0.97255638  0.08476879  0.77790220
 [73] -2.30388336  0.01335980  0.77614917  0.62439755  0.07250802 -0.68316334
 [79]  1.32504893 -0.80195913 -0.76870310 -0.65813671  0.01858989 -0.03561010
 [85] -0.45155724  0.02639805  0.96932154  0.96117539  0.59194361  0.45605975
 [91] -0.65174178  1.47331430 -0.30867336  0.11986197 -0.62677620 -0.56624110
 [97]  1.24373963 -0.27330112 -0.47444593 -0.12461310
> 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.44182961 -0.03476540 -0.58678839 -1.25015885  0.77923065 -0.97027371
  [7]  0.05278601 -1.01565077  0.42382434  0.69347218 -0.83851422 -1.91923076
 [13] -0.23156080  0.49260956  0.28379907 -0.09112402 -0.74729251  0.40891712
 [19]  1.91389244  0.31414593 -0.03578916  1.57739245 -0.27875906  1.53996472
 [25] -0.37246972 -0.60604168  0.89147073  0.36413514  0.50125947  1.81816781
 [31]  0.42973042  1.16210103 -1.48731087  1.49869295  0.08517462 -0.18659299
 [37] -0.06642323 -0.67508626 -1.79595102 -1.28246794  0.07134563 -0.86412190
 [43]  0.16377002  0.48734710  1.45210962 -0.40965184 -0.71206594 -0.02553298
 [49] -0.89094402  0.80226213  0.16514238  2.16192987 -1.62348766  0.14340935
 [55]  0.50073246  1.56930262 -1.05248120  1.17596715  1.17986145 -0.14910411
 [61]  0.18146874 -1.46416785 -0.14857276 -0.64270566 -0.31629621 -1.00305979
 [67]  0.70053990 -1.43509019  1.69665435 -0.97255638  0.08476879  0.77790220
 [73] -2.30388336  0.01335980  0.77614917  0.62439755  0.07250802 -0.68316334
 [79]  1.32504893 -0.80195913 -0.76870310 -0.65813671  0.01858989 -0.03561010
 [85] -0.45155724  0.02639805  0.96932154  0.96117539  0.59194361  0.45605975
 [91] -0.65174178  1.47331430 -0.30867336  0.11986197 -0.62677620 -0.56624110
 [97]  1.24373963 -0.27330112 -0.47444593 -0.12461310
> colMin(tmp)
  [1]  0.44182961 -0.03476540 -0.58678839 -1.25015885  0.77923065 -0.97027371
  [7]  0.05278601 -1.01565077  0.42382434  0.69347218 -0.83851422 -1.91923076
 [13] -0.23156080  0.49260956  0.28379907 -0.09112402 -0.74729251  0.40891712
 [19]  1.91389244  0.31414593 -0.03578916  1.57739245 -0.27875906  1.53996472
 [25] -0.37246972 -0.60604168  0.89147073  0.36413514  0.50125947  1.81816781
 [31]  0.42973042  1.16210103 -1.48731087  1.49869295  0.08517462 -0.18659299
 [37] -0.06642323 -0.67508626 -1.79595102 -1.28246794  0.07134563 -0.86412190
 [43]  0.16377002  0.48734710  1.45210962 -0.40965184 -0.71206594 -0.02553298
 [49] -0.89094402  0.80226213  0.16514238  2.16192987 -1.62348766  0.14340935
 [55]  0.50073246  1.56930262 -1.05248120  1.17596715  1.17986145 -0.14910411
 [61]  0.18146874 -1.46416785 -0.14857276 -0.64270566 -0.31629621 -1.00305979
 [67]  0.70053990 -1.43509019  1.69665435 -0.97255638  0.08476879  0.77790220
 [73] -2.30388336  0.01335980  0.77614917  0.62439755  0.07250802 -0.68316334
 [79]  1.32504893 -0.80195913 -0.76870310 -0.65813671  0.01858989 -0.03561010
 [85] -0.45155724  0.02639805  0.96932154  0.96117539  0.59194361  0.45605975
 [91] -0.65174178  1.47331430 -0.30867336  0.11986197 -0.62677620 -0.56624110
 [97]  1.24373963 -0.27330112 -0.47444593 -0.12461310
> colMedians(tmp)
  [1]  0.44182961 -0.03476540 -0.58678839 -1.25015885  0.77923065 -0.97027371
  [7]  0.05278601 -1.01565077  0.42382434  0.69347218 -0.83851422 -1.91923076
 [13] -0.23156080  0.49260956  0.28379907 -0.09112402 -0.74729251  0.40891712
 [19]  1.91389244  0.31414593 -0.03578916  1.57739245 -0.27875906  1.53996472
 [25] -0.37246972 -0.60604168  0.89147073  0.36413514  0.50125947  1.81816781
 [31]  0.42973042  1.16210103 -1.48731087  1.49869295  0.08517462 -0.18659299
 [37] -0.06642323 -0.67508626 -1.79595102 -1.28246794  0.07134563 -0.86412190
 [43]  0.16377002  0.48734710  1.45210962 -0.40965184 -0.71206594 -0.02553298
 [49] -0.89094402  0.80226213  0.16514238  2.16192987 -1.62348766  0.14340935
 [55]  0.50073246  1.56930262 -1.05248120  1.17596715  1.17986145 -0.14910411
 [61]  0.18146874 -1.46416785 -0.14857276 -0.64270566 -0.31629621 -1.00305979
 [67]  0.70053990 -1.43509019  1.69665435 -0.97255638  0.08476879  0.77790220
 [73] -2.30388336  0.01335980  0.77614917  0.62439755  0.07250802 -0.68316334
 [79]  1.32504893 -0.80195913 -0.76870310 -0.65813671  0.01858989 -0.03561010
 [85] -0.45155724  0.02639805  0.96932154  0.96117539  0.59194361  0.45605975
 [91] -0.65174178  1.47331430 -0.30867336  0.11986197 -0.62677620 -0.56624110
 [97]  1.24373963 -0.27330112 -0.47444593 -0.12461310
> colRanges(tmp)
          [,1]       [,2]       [,3]      [,4]      [,5]       [,6]       [,7]
[1,] 0.4418296 -0.0347654 -0.5867884 -1.250159 0.7792306 -0.9702737 0.05278601
[2,] 0.4418296 -0.0347654 -0.5867884 -1.250159 0.7792306 -0.9702737 0.05278601
          [,8]      [,9]     [,10]      [,11]     [,12]      [,13]     [,14]
[1,] -1.015651 0.4238243 0.6934722 -0.8385142 -1.919231 -0.2315608 0.4926096
[2,] -1.015651 0.4238243 0.6934722 -0.8385142 -1.919231 -0.2315608 0.4926096
         [,15]       [,16]      [,17]     [,18]    [,19]     [,20]       [,21]
[1,] 0.2837991 -0.09112402 -0.7472925 0.4089171 1.913892 0.3141459 -0.03578916
[2,] 0.2837991 -0.09112402 -0.7472925 0.4089171 1.913892 0.3141459 -0.03578916
        [,22]      [,23]    [,24]      [,25]      [,26]     [,27]     [,28]
[1,] 1.577392 -0.2787591 1.539965 -0.3724697 -0.6060417 0.8914707 0.3641351
[2,] 1.577392 -0.2787591 1.539965 -0.3724697 -0.6060417 0.8914707 0.3641351
         [,29]    [,30]     [,31]    [,32]     [,33]    [,34]      [,35]
[1,] 0.5012595 1.818168 0.4297304 1.162101 -1.487311 1.498693 0.08517462
[2,] 0.5012595 1.818168 0.4297304 1.162101 -1.487311 1.498693 0.08517462
         [,36]       [,37]      [,38]     [,39]     [,40]      [,41]      [,42]
[1,] -0.186593 -0.06642323 -0.6750863 -1.795951 -1.282468 0.07134563 -0.8641219
[2,] -0.186593 -0.06642323 -0.6750863 -1.795951 -1.282468 0.07134563 -0.8641219
       [,43]     [,44]   [,45]      [,46]      [,47]       [,48]     [,49]
[1,] 0.16377 0.4873471 1.45211 -0.4096518 -0.7120659 -0.02553298 -0.890944
[2,] 0.16377 0.4873471 1.45211 -0.4096518 -0.7120659 -0.02553298 -0.890944
         [,50]     [,51]   [,52]     [,53]     [,54]     [,55]    [,56]
[1,] 0.8022621 0.1651424 2.16193 -1.623488 0.1434094 0.5007325 1.569303
[2,] 0.8022621 0.1651424 2.16193 -1.623488 0.1434094 0.5007325 1.569303
         [,57]    [,58]    [,59]      [,60]     [,61]     [,62]      [,63]
[1,] -1.052481 1.175967 1.179861 -0.1491041 0.1814687 -1.464168 -0.1485728
[2,] -1.052481 1.175967 1.179861 -0.1491041 0.1814687 -1.464168 -0.1485728
          [,64]      [,65]    [,66]     [,67]    [,68]    [,69]      [,70]
[1,] -0.6427057 -0.3162962 -1.00306 0.7005399 -1.43509 1.696654 -0.9725564
[2,] -0.6427057 -0.3162962 -1.00306 0.7005399 -1.43509 1.696654 -0.9725564
          [,71]     [,72]     [,73]     [,74]     [,75]     [,76]      [,77]
[1,] 0.08476879 0.7779022 -2.303883 0.0133598 0.7761492 0.6243976 0.07250802
[2,] 0.08476879 0.7779022 -2.303883 0.0133598 0.7761492 0.6243976 0.07250802
          [,78]    [,79]      [,80]      [,81]      [,82]      [,83]      [,84]
[1,] -0.6831633 1.325049 -0.8019591 -0.7687031 -0.6581367 0.01858989 -0.0356101
[2,] -0.6831633 1.325049 -0.8019591 -0.7687031 -0.6581367 0.01858989 -0.0356101
          [,85]      [,86]     [,87]     [,88]     [,89]     [,90]      [,91]
[1,] -0.4515572 0.02639805 0.9693215 0.9611754 0.5919436 0.4560597 -0.6517418
[2,] -0.4515572 0.02639805 0.9693215 0.9611754 0.5919436 0.4560597 -0.6517418
        [,92]      [,93]    [,94]      [,95]      [,96]   [,97]      [,98]
[1,] 1.473314 -0.3086734 0.119862 -0.6267762 -0.5662411 1.24374 -0.2733011
[2,] 1.473314 -0.3086734 0.119862 -0.6267762 -0.5662411 1.24374 -0.2733011
          [,99]     [,100]
[1,] -0.4744459 -0.1246131
[2,] -0.4744459 -0.1246131
> 
> 
> Max(tmp2)
[1] 2.252792
> Min(tmp2)
[1] -2.874687
> mean(tmp2)
[1] 0.01465905
> Sum(tmp2)
[1] 1.465905
> Var(tmp2)
[1] 1.05169
> 
> rowMeans(tmp2)
  [1]  0.398004360  1.320620002  0.933229030 -1.260658883  0.160508261
  [6] -1.242638272  1.687854960  2.252792069  1.053093753  0.945673212
 [11] -0.232203164 -2.874686840 -2.538616850 -1.351657374  0.457179922
 [16] -0.503687222 -0.227706098 -0.713333057 -2.371142898  1.106949228
 [21] -0.236999139  1.079018592  1.221367175 -0.425297822  0.112644958
 [26] -1.196887328 -0.687248156 -0.007729514 -0.078368740 -0.855425815
 [31]  0.750429485 -0.233610215  1.205741336 -1.398630665 -0.998394185
 [36]  0.606506367 -0.188881570 -1.212429564 -0.171547617  0.959764121
 [41]  0.629266925  0.942940875 -1.169350721  0.144390719 -0.395863383
 [46] -0.576565631  0.781862114  0.375202182  0.250527122 -0.407878821
 [51]  0.083171156 -0.466122634  0.129974171  0.216672585 -0.766685788
 [56]  0.293768979  0.676902541  0.417044729  0.938793074 -0.655945861
 [61] -0.502832988 -0.704360992  0.143178469 -0.651551177  1.048518889
 [66] -2.403372660  0.038346331  1.460434776  0.414576097 -1.205628741
 [71]  0.900222736 -0.439322055 -0.114977853  0.302804237  1.482216211
 [76]  0.391002960 -0.386774473 -1.255433041  0.015624176  1.423772362
 [81]  0.545580299  0.394590449  1.124755999 -0.096013713  1.463296446
 [86] -0.945524308 -1.371355771 -1.763899852  1.788391974  2.214993606
 [91] -0.484899270  0.882150581  0.072108213 -0.130648621  1.652567438
 [96] -1.481062439  0.462585716 -0.207590563  0.411873884  0.291861088
> rowSums(tmp2)
  [1]  0.398004360  1.320620002  0.933229030 -1.260658883  0.160508261
  [6] -1.242638272  1.687854960  2.252792069  1.053093753  0.945673212
 [11] -0.232203164 -2.874686840 -2.538616850 -1.351657374  0.457179922
 [16] -0.503687222 -0.227706098 -0.713333057 -2.371142898  1.106949228
 [21] -0.236999139  1.079018592  1.221367175 -0.425297822  0.112644958
 [26] -1.196887328 -0.687248156 -0.007729514 -0.078368740 -0.855425815
 [31]  0.750429485 -0.233610215  1.205741336 -1.398630665 -0.998394185
 [36]  0.606506367 -0.188881570 -1.212429564 -0.171547617  0.959764121
 [41]  0.629266925  0.942940875 -1.169350721  0.144390719 -0.395863383
 [46] -0.576565631  0.781862114  0.375202182  0.250527122 -0.407878821
 [51]  0.083171156 -0.466122634  0.129974171  0.216672585 -0.766685788
 [56]  0.293768979  0.676902541  0.417044729  0.938793074 -0.655945861
 [61] -0.502832988 -0.704360992  0.143178469 -0.651551177  1.048518889
 [66] -2.403372660  0.038346331  1.460434776  0.414576097 -1.205628741
 [71]  0.900222736 -0.439322055 -0.114977853  0.302804237  1.482216211
 [76]  0.391002960 -0.386774473 -1.255433041  0.015624176  1.423772362
 [81]  0.545580299  0.394590449  1.124755999 -0.096013713  1.463296446
 [86] -0.945524308 -1.371355771 -1.763899852  1.788391974  2.214993606
 [91] -0.484899270  0.882150581  0.072108213 -0.130648621  1.652567438
 [96] -1.481062439  0.462585716 -0.207590563  0.411873884  0.291861088
> 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.398004360  1.320620002  0.933229030 -1.260658883  0.160508261
  [6] -1.242638272  1.687854960  2.252792069  1.053093753  0.945673212
 [11] -0.232203164 -2.874686840 -2.538616850 -1.351657374  0.457179922
 [16] -0.503687222 -0.227706098 -0.713333057 -2.371142898  1.106949228
 [21] -0.236999139  1.079018592  1.221367175 -0.425297822  0.112644958
 [26] -1.196887328 -0.687248156 -0.007729514 -0.078368740 -0.855425815
 [31]  0.750429485 -0.233610215  1.205741336 -1.398630665 -0.998394185
 [36]  0.606506367 -0.188881570 -1.212429564 -0.171547617  0.959764121
 [41]  0.629266925  0.942940875 -1.169350721  0.144390719 -0.395863383
 [46] -0.576565631  0.781862114  0.375202182  0.250527122 -0.407878821
 [51]  0.083171156 -0.466122634  0.129974171  0.216672585 -0.766685788
 [56]  0.293768979  0.676902541  0.417044729  0.938793074 -0.655945861
 [61] -0.502832988 -0.704360992  0.143178469 -0.651551177  1.048518889
 [66] -2.403372660  0.038346331  1.460434776  0.414576097 -1.205628741
 [71]  0.900222736 -0.439322055 -0.114977853  0.302804237  1.482216211
 [76]  0.391002960 -0.386774473 -1.255433041  0.015624176  1.423772362
 [81]  0.545580299  0.394590449  1.124755999 -0.096013713  1.463296446
 [86] -0.945524308 -1.371355771 -1.763899852  1.788391974  2.214993606
 [91] -0.484899270  0.882150581  0.072108213 -0.130648621  1.652567438
 [96] -1.481062439  0.462585716 -0.207590563  0.411873884  0.291861088
> rowMin(tmp2)
  [1]  0.398004360  1.320620002  0.933229030 -1.260658883  0.160508261
  [6] -1.242638272  1.687854960  2.252792069  1.053093753  0.945673212
 [11] -0.232203164 -2.874686840 -2.538616850 -1.351657374  0.457179922
 [16] -0.503687222 -0.227706098 -0.713333057 -2.371142898  1.106949228
 [21] -0.236999139  1.079018592  1.221367175 -0.425297822  0.112644958
 [26] -1.196887328 -0.687248156 -0.007729514 -0.078368740 -0.855425815
 [31]  0.750429485 -0.233610215  1.205741336 -1.398630665 -0.998394185
 [36]  0.606506367 -0.188881570 -1.212429564 -0.171547617  0.959764121
 [41]  0.629266925  0.942940875 -1.169350721  0.144390719 -0.395863383
 [46] -0.576565631  0.781862114  0.375202182  0.250527122 -0.407878821
 [51]  0.083171156 -0.466122634  0.129974171  0.216672585 -0.766685788
 [56]  0.293768979  0.676902541  0.417044729  0.938793074 -0.655945861
 [61] -0.502832988 -0.704360992  0.143178469 -0.651551177  1.048518889
 [66] -2.403372660  0.038346331  1.460434776  0.414576097 -1.205628741
 [71]  0.900222736 -0.439322055 -0.114977853  0.302804237  1.482216211
 [76]  0.391002960 -0.386774473 -1.255433041  0.015624176  1.423772362
 [81]  0.545580299  0.394590449  1.124755999 -0.096013713  1.463296446
 [86] -0.945524308 -1.371355771 -1.763899852  1.788391974  2.214993606
 [91] -0.484899270  0.882150581  0.072108213 -0.130648621  1.652567438
 [96] -1.481062439  0.462585716 -0.207590563  0.411873884  0.291861088
> 
> colMeans(tmp2)
[1] 0.01465905
> colSums(tmp2)
[1] 1.465905
> colVars(tmp2)
[1] 1.05169
> colSd(tmp2)
[1] 1.025519
> colMax(tmp2)
[1] 2.252792
> colMin(tmp2)
[1] -2.874687
> colMedians(tmp2)
[1] 0.07763968
> colRanges(tmp2)
          [,1]
[1,] -2.874687
[2,]  2.252792
> 
> dataset1 <- matrix(dataset1,1,100)
> 
> agree.checks(tmp,dataset1)
> 
> dataset2 <- matrix(dataset2,100,1)
> agree.checks(tmp2,dataset2)
>   
> 
> tmp <- createBufferedMatrix(10,10)
> 
> tmp[1:10,1:10] <- rnorm(100)
> colApply(tmp,sum)
 [1]  2.7969252 -4.4749928 -0.4602618  3.2457381  2.0500060  3.4186623
 [7]  2.2258465  0.9235435  2.0539604  1.6380040
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -0.8991891
[2,] -0.2816147
[3,]  0.2226968
[4,]  0.7525109
[5,]  1.9685742
> 
> rowApply(tmp,sum)
 [1]  0.4404119 -4.8306307  6.7096396  2.0329161  2.4727886 -0.6415718
 [7] -1.9582586 -0.9348853  2.2528948  7.8741268
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    3    7    3    8    6    8   10    7    4     1
 [2,]    5    2    1    9    7    2    5    1    2     4
 [3,]   10    8    2    3    1    6    6    3    6     5
 [4,]    7    4    4   10    3    9    1    6   10     7
 [5,]    1    1   10    7    5   10    2    5    7     6
 [6,]    2   10    7    2    8    5    9    8    1     9
 [7,]    6    5    8    6    2    3    8   10    3     8
 [8,]    4    9    5    1   10    1    4    9    8     3
 [9,]    8    6    6    5    4    4    7    2    9    10
[10,]    9    3    9    4    9    7    3    4    5     2
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1] -2.3216001  1.0590150  5.1024386 -0.8076979  1.8872386  2.5908136
 [7] -2.9918656 -0.5173536  0.3366415 -0.4992355 -5.5854796  1.1358168
[13]  1.6187084 -2.8233262 -2.6023202 -3.8064341  1.0913510 -1.7708385
[19]  3.7864763  0.6616542
> colApply(tmp,quantile)[,1]
            [,1]
[1,] -2.26479097
[2,] -0.51945430
[3,] -0.13561879
[4,]  0.09105647
[5,]  0.50720750
> 
> rowApply(tmp,sum)
[1] -1.7518468  4.2255258 -1.4849043 -0.5268185 -4.9179535
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]    2   10   11    9   17
[2,]   10    7   16   16   18
[3,]   17   18    7   20    9
[4,]   16   15    5    2    7
[5,]    9   17   18   11   12
> 
> 
> as.matrix(tmp)
            [,1]       [,2]        [,3]       [,4]       [,5]        [,6]
[1,] -2.26479097 -0.1420170  0.85284521  0.4925267 -0.2398470 -0.85088701
[2,] -0.13561879 -0.3041349  1.75411436  0.9750438  1.3359008  2.37471605
[3,]  0.09105647  0.4882519 -0.44118776 -0.5950256  0.9070083  1.13393626
[4,] -0.51945430  0.3892587  3.02752686 -1.3096035 -0.2865206  0.08933745
[5,]  0.50720750  0.6276563 -0.09086004 -0.3706393  0.1706971 -0.15628914
           [,7]       [,8]        [,9]      [,10]      [,11]       [,12]
[1,]  1.9957353  0.2815007  0.05642135  2.0013678 -0.9557921  0.06487237
[2,] -0.5793103 -0.9690910  0.27079142 -0.6178745 -1.0916585  0.85395853
[3,] -0.7931808  0.4337482  0.12186153 -0.1686653 -1.3930034  0.13052404
[4,] -1.1834036 -0.5239787 -0.91054707 -0.6402208 -1.3555514 -0.54889373
[5,] -2.4317062  0.2604672  0.79811426 -1.0738427 -0.7894743  0.63535561
           [,13]      [,14]      [,15]       [,16]      [,17]       [,18]
[1,] -0.62043366 -2.5478951  2.2775967 -1.06552036  0.2342986 -0.88683342
[2,] -0.03066796  1.2252481 -1.7337124 -0.29626115  0.6127505 -1.08149687
[3,]  1.26312278 -1.8932458 -1.0472512  0.07258953 -0.3186798  0.61564003
[4,]  0.55070044  0.1456240 -0.9852637 -0.26045968  0.1317545 -0.45246241
[5,]  0.45598676  0.2469425 -1.1136896 -2.25678248  0.4312273  0.03431417
          [,19]       [,20]
[1,]  0.1203228 -0.55531764
[2,]  1.9289822 -0.26615342
[3,]  0.3586321 -0.45103591
[4,]  2.2078576  1.90748137
[5,] -0.8293184  0.02667985
> 
> 
> 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.18-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.18-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  648  bytes.
Disk usage :  200  bytes.
> subBufferedMatrix(tmp,,5:8)
BufferedMatrix object
Matrix size:  5 4 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.18-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  562  bytes.
Disk usage :  160  bytes.
> subBufferedMatrix(tmp,1:3,)
BufferedMatrix object
Matrix size:  3 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.18-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  480  bytes.
> 
> 
> rm(tmp)
> 
> 
> ###
> ### Testing colnames and rownames
> ###
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> 
> 
> colnames(tmp)
NULL
> rownames(tmp)
NULL
> 
> 
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> colnames(tmp)
 [1] "col1"  "col2"  "col3"  "col4"  "col5"  "col6"  "col7"  "col8"  "col9" 
[10] "col10" "col11" "col12" "col13" "col14" "col15" "col16" "col17" "col18"
[19] "col19" "col20"
> rownames(tmp)
[1] "row1" "row2" "row3" "row4" "row5"
> 
> 
> tmp["row1",]
          col1      col2      col3      col4      col5     col6       col7
row1 0.4889718 -1.003536 -1.280695 0.1812963 0.8993539 1.935454 -0.1255411
          col8      col9    col10      col11    col12     col13     col14
row1 -1.065111 0.3978782 2.323195 -0.2147036 1.086833 0.3968196 0.9962809
         col15    col16    col17      col18      col19   col20
row1 0.4914252 1.319078 1.877677 -0.2527656 -0.9461138 1.82861
> tmp[,"col10"]
            col10
row1  2.323194814
row2 -0.007595023
row3 -0.226716378
row4  0.091737476
row5  2.762596407
> tmp[c("row1","row5"),]
          col1       col2      col3      col4       col5      col6       col7
row1 0.4889718 -1.0035363 -1.280695 0.1812963  0.8993539 1.9354545 -0.1255411
row5 0.7663837 -0.1819082  0.238164 1.2131628 -0.4389573 0.5751858  0.1773631
          col8      col9    col10       col11    col12     col13      col14
row1 -1.065111 0.3978782 2.323195 -0.21470360 1.086833 0.3968196  0.9962809
row5 -1.789330 1.5443068 2.762596 -0.08965097 0.625061 1.8901827 -0.4763358
         col15     col16     col17      col18      col19     col20
row1 0.4914252 1.3190784 1.8776773 -0.2527656 -0.9461138  1.828610
row5 0.8680934 0.6342231 0.2473076 -0.3226033 -0.2633529 -1.467251
> tmp[,c("col6","col20")]
           col6     col20
row1  1.9354545  1.828610
row2  0.8730803  2.064117
row3 -0.8034094 -1.194325
row4  1.7006833  1.264998
row5  0.5751858 -1.467251
> tmp[c("row1","row5"),c("col6","col20")]
          col6     col20
row1 1.9354545  1.828610
row5 0.5751858 -1.467251
> 
> 
> 
> 
> 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.168 48.87267 49.60903 50.98213 48.42543 104.4121 50.96938 48.81316
         col9    col10    col11    col12    col13    col14    col15   col16
row1 50.13495 49.17107 50.84391 48.86398 49.38691 50.35565 49.97112 49.9041
       col17   col18   col19    col20
row1 50.2552 50.5517 48.4672 105.2507
> tmp[,"col10"]
        col10
row1 49.17107
row2 30.37276
row3 28.32526
row4 29.40581
row5 49.31278
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 50.16800 48.87267 49.60903 50.98213 48.42543 104.4121 50.96938 48.81316
row5 50.51999 48.39866 50.63949 50.55971 49.46429 104.0085 51.93519 51.06191
         col9    col10    col11    col12    col13    col14    col15    col16
row1 50.13495 49.17107 50.84391 48.86398 49.38691 50.35565 49.97112 49.90410
row5 50.02607 49.31278 50.54132 52.17242 50.52082 49.49069 51.41368 50.43635
        col17    col18    col19    col20
row1 50.25520 50.55170 48.46720 105.2507
row5 49.63995 49.30577 49.46085 106.2511
> tmp[,c("col6","col20")]
          col6     col20
row1 104.41207 105.25069
row2  74.42828  74.10028
row3  75.87572  74.46711
row4  74.19275  72.47563
row5 104.00853 106.25106
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 104.4121 105.2507
row5 104.0085 106.2511
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 104.4121 105.2507
row5 104.0085 106.2511
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
            col13
[1,] -1.826857964
[2,] -0.312209860
[3,]  0.007996488
[4,]  0.500086696
[5,]  1.127956620
> tmp[,c("col17","col7")]
           col17       col7
[1,]  0.39350059  0.4387078
[2,] -0.67381618 -0.2161369
[3,] -0.06168884 -0.2271525
[4,] -0.23736963  0.4698814
[5,] -0.16899843  0.4675848
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
           col6       col20
[1,]  1.0052317  0.07013231
[2,] -0.2661973  0.15895310
[3,] -0.8226139  0.84866919
[4,]  1.9175413  0.28044074
[5,]  0.5502551 -0.16756169
> subBufferedMatrix(tmp,1,c("col6"))[,1]
         col1
[1,] 1.005232
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
           col6
[1,]  1.0052317
[2,] -0.2661973
> 
> 
> 
> 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.1086093 2.1474190  0.1968104 -1.2537746 0.1012310 -1.509782  1.341511
row1 -1.2298063 0.5503504 -0.2200106 -0.1829441 0.9688412 -1.576549 -1.554668
          [,8]      [,9]      [,10]      [,11]     [,12]       [,13]      [,14]
row3 1.5144625 0.1324446  0.9050938  0.2009485 0.3070879 -1.04618807 -0.5154507
row1 0.8628731 0.4170821 -0.4684021 -1.4692257 0.1663628 -0.04329888 -0.4641255
          [,15]       [,16]      [,17]      [,18]     [,19]      [,20]
row3  0.5191451  0.03703779 -0.4857522  0.0988101 -1.246316  0.3314848
row1 -0.8689121 -1.69250595 -0.4202528 -0.5971086  2.260781 -0.5496871
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
          [,1]      [,2]       [,3]      [,4]     [,5]       [,6]     [,7]
row2 -1.072818 -3.072418 -0.7967002 0.7799494 1.539017 -0.4457664 1.918577
          [,8]      [,9]    [,10]
row2 -1.158964 -1.909605 1.629145
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
          [,1]      [,2]      [,3]     [,4]      [,5]      [,6]      [,7]
row5 0.5384444 -1.071038 0.3588673 1.266238 -0.232476 -1.583568 0.1092354
         [,8]     [,9]   [,10]     [,11]      [,12]     [,13]    [,14]
row5 1.421512 1.282231 -1.7397 0.3882904 -0.3320347 -0.440799 1.411381
         [,15]    [,16]    [,17]   [,18]     [,19]   [,20]
row5 0.1432103 1.484817 1.622342 0.68272 -1.425494 1.82835
> 
> 
> 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: 0x28e10240>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "/home/biocbuild/bbs-3.18-bioc/meat/BufferedMatrix.Rcheck/tests/BM6d2da129375dd"
 [2] "/home/biocbuild/bbs-3.18-bioc/meat/BufferedMatrix.Rcheck/tests/BM6d2daa0e5841" 
 [3] "/home/biocbuild/bbs-3.18-bioc/meat/BufferedMatrix.Rcheck/tests/BM6d2da29bacfe7"
 [4] "/home/biocbuild/bbs-3.18-bioc/meat/BufferedMatrix.Rcheck/tests/BM6d2da3e232c6f"
 [5] "/home/biocbuild/bbs-3.18-bioc/meat/BufferedMatrix.Rcheck/tests/BM6d2da15afdfda"
 [6] "/home/biocbuild/bbs-3.18-bioc/meat/BufferedMatrix.Rcheck/tests/BM6d2da63c25b7f"
 [7] "/home/biocbuild/bbs-3.18-bioc/meat/BufferedMatrix.Rcheck/tests/BM6d2da486a1381"
 [8] "/home/biocbuild/bbs-3.18-bioc/meat/BufferedMatrix.Rcheck/tests/BM6d2da8c6bdd4" 
 [9] "/home/biocbuild/bbs-3.18-bioc/meat/BufferedMatrix.Rcheck/tests/BM6d2da5b5f47ac"
[10] "/home/biocbuild/bbs-3.18-bioc/meat/BufferedMatrix.Rcheck/tests/BM6d2dabdaa885" 
[11] "/home/biocbuild/bbs-3.18-bioc/meat/BufferedMatrix.Rcheck/tests/BM6d2da578a53a6"
[12] "/home/biocbuild/bbs-3.18-bioc/meat/BufferedMatrix.Rcheck/tests/BM6d2da7e4b1aa6"
[13] "/home/biocbuild/bbs-3.18-bioc/meat/BufferedMatrix.Rcheck/tests/BM6d2da353e0961"
[14] "/home/biocbuild/bbs-3.18-bioc/meat/BufferedMatrix.Rcheck/tests/BM6d2da3eaff2f9"
[15] "/home/biocbuild/bbs-3.18-bioc/meat/BufferedMatrix.Rcheck/tests/BM6d2da7ed9b740"
> 
> 
> ### 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: 0x285613b0>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x285613b0>
Warning message:
In dir.create(new.directory) :
  '/home/biocbuild/bbs-3.18-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x285613b0>
> rowMedians(tmp)
  [1]  0.1315268948  0.3943010024 -0.0362354136  0.5190065736  0.4819924059
  [6] -0.4737170637 -0.0951971405 -0.3474014278 -0.1704928795 -0.7866171116
 [11] -0.3420929775 -0.5628138601 -0.0746268636  0.0248133489 -0.5611366332
 [16] -0.0978306419 -0.3546830876  0.4229927935  0.0112641197 -0.0588866488
 [21]  0.0096375528 -0.0071208248 -0.1223998643 -0.0850247275 -0.4536215867
 [26] -0.6267057320 -0.1999488640 -0.3170196458  0.0021187755  0.0288399309
 [31]  0.0178184224  0.1641254165  0.0292658330  0.1086145997 -0.3988763735
 [36]  0.1250437541 -0.0374668229 -0.7480877143  0.1359026109  0.4211896792
 [41] -0.1460826228 -0.0080849454 -0.4506007631 -0.1382832718  0.1392556521
 [46] -0.3293919667  0.1473927204  0.1956023827 -0.2285454986 -0.0188658324
 [51]  0.2056641608  0.0421399467  0.0300585388 -0.2736672671 -0.5737389735
 [56]  0.9043893713 -0.1250111581 -0.5515343281 -0.0787657245 -0.0007756854
 [61]  0.0516571327 -0.0272237358  0.4776124161  0.3035941003  0.0650635102
 [66]  0.4782139558 -0.0326003572 -0.0233177094 -0.1461053513 -0.1057357392
 [71]  0.3535122641 -0.2943494479 -0.4368080311 -0.3062240588 -0.3922191405
 [76] -0.4890564659 -0.3459209304  0.2373455544  0.2170235283  0.4501190777
 [81] -0.1466498381 -0.0978475615 -0.5982709275  0.0148884885 -0.0385753720
 [86]  0.1383231617  0.0682983822  0.0367998318  0.1829461023 -0.0157024969
 [91] -0.0288824115 -0.1900776550 -0.2353305485 -0.0128765605  0.0248813307
 [96] -0.2564001116 -0.1569702999  0.0350321543 -0.3898115504  0.5491358445
[101] -0.0546987838 -0.3462618244 -0.2077082732 -0.3192862223 -0.2417612543
[106] -0.2458071960  0.0448125406  0.1492830397  0.1255170682 -0.3021632426
[111]  0.2460485880 -0.0417641409  0.7008708883 -0.6854812267  0.6776845795
[116] -0.4087368949 -0.4207396394 -0.3987628120  0.1972431732  0.1062826806
[121] -0.4665129018  0.3857419209 -0.7257273090  0.1112961901  0.2755059691
[126]  0.3112226354  0.2456645007  0.0726830071 -0.1641611677 -0.2965326578
[131]  0.0407363115 -0.0864225071 -0.0325665142 -0.5549030922  0.0111833404
[136] -0.2552875995  0.2481332092  0.0205703144  0.5101722412 -0.2196208641
[141]  0.2608850627 -0.4486970813 -0.2658602691  0.2541791269  0.0899630900
[146] -0.2816713403 -0.0552727975  0.0994980326  0.3964881254 -0.1382496131
[151] -0.3086270176 -0.0799700021 -0.2450312950 -0.5253870170 -0.3015731848
[156]  0.3651084909 -0.0185867184 -0.0379360419  0.1822323537  0.4068564818
[161] -0.5193823335  0.0813270637 -0.0514321295  0.0627031643  0.3383716274
[166] -0.2616861826 -0.1137881165  0.5780458599 -0.0043737704 -0.2783273450
[171] -0.0545551145 -0.0573651547 -0.1710523051  0.4675994714  0.2314813358
[176] -0.2558093649 -0.5063751765 -0.7161643615  0.1616653017  0.2880022565
[181] -0.1271161360 -0.4575025394 -0.2986094771 -0.1342087128  0.0742528774
[186] -0.0981849738  0.0850867505 -0.6898292584  0.4137346668 -0.0417149331
[191] -0.1581043577 -0.3469072920  0.1244493469  0.3197363419  0.1916174510
[196]  0.4178441026 -0.0499300767  0.2955207676  0.2633664578 -0.2118892819
[201] -0.0520942398 -0.0044753904  0.0620512551  0.5153409981  0.1277956329
[206] -0.3167784423 -0.0718262755 -0.6641729491  0.0377919069 -0.0278705731
[211] -0.1363252213 -0.0239033303 -0.4877648298  0.3542310095 -0.0188543240
[216]  0.0484488071  0.0420078578 -0.1128893498 -0.7026089495  0.3902027025
[221]  0.1184454714 -0.0225950484 -0.3439206272 -0.0221601551 -0.3192787245
[226] -0.0306462694 -0.2430061332 -0.1943775348 -0.2978017085  0.3078946590
> 
> proc.time()
   user  system elapsed 
  1.822   1.001   2.845 

BufferedMatrix.Rcheck/tests/rawCalltesting.Rout


R version 4.3.1 (2023-06-16) -- "Beagle Scouts"
Copyright (C) 2023 The R Foundation for Statistical Computing
Platform: aarch64-unknown-linux-gnu (64-bit)

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: 0x1f54c990>
> .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: 0x1f54c990>
> .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: 0x1f54c990>
> .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: 0x1f54c990>
> 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: 0x1faaae70>
> .Call("R_bm_AddColumn",P)
<pointer: 0x1faaae70>
> .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: 0x1faaae70>
> .Call("R_bm_AddColumn",P)
<pointer: 0x1faaae70>
> .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: 0x1faaae70>
> 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: 0x1f51b640>
> .Call("R_bm_AddColumn",P)
<pointer: 0x1f51b640>
> .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: 0x1f51b640>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x1f51b640>
> .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: 0x1f51b640>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x1f51b640>
> .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: 0x1f51b640>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x1f51b640>
> .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: 0x1f51b640>
> 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: 0x204d5820>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x204d5820>
> .Call("R_bm_AddColumn",P)
<pointer: 0x204d5820>
> .Call("R_bm_AddColumn",P)
<pointer: 0x204d5820>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile6d35a2fd0a7cc" "BufferedMatrixFile6d35a73760c37"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile6d35a2fd0a7cc" "BufferedMatrixFile6d35a73760c37"
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x1ff093e0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x1ff093e0>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x1ff093e0>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x1ff093e0>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x1ff093e0>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x1ff093e0>
> .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: 0x210416e0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x210416e0>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x210416e0>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x210416e0>
> 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: 0x21076ee0>
> .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: 0x21076ee0>
> rm(P)
> 
> proc.time()
   user  system elapsed 
  0.329   0.040   0.358 

BufferedMatrix.Rcheck/tests/Rcodetesting.Rout


R version 4.3.1 (2023-06-16) -- "Beagle Scouts"
Copyright (C) 2023 The R Foundation for Statistical Computing
Platform: aarch64-unknown-linux-gnu (64-bit)

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.313   0.032   0.333 

Example timings