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

This page was generated on 2025-01-27 12:05 -0500 (Mon, 27 Jan 2025).

HostnameOSArch (*)R versionInstalled pkgs
nebbiolo2Linux (Ubuntu 24.04.1 LTS)x86_644.4.2 (2024-10-31) -- "Pile of Leaves" 4746
palomino8Windows Server 2022 Datacenterx644.4.2 (2024-10-31 ucrt) -- "Pile of Leaves" 4494
merida1macOS 12.7.5 Montereyx86_644.4.2 (2024-10-31) -- "Pile of Leaves" 4517
kjohnson1macOS 13.6.6 Venturaarm644.4.2 (2024-10-31) -- "Pile of Leaves" 4469
taishanLinux (openEuler 24.03 LTS)aarch644.4.2 (2024-10-31) -- "Pile of Leaves" 4395
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 251/2289HostnameOS / ArchINSTALLBUILDCHECKBUILD BIN
BufferedMatrix 1.70.0  (landing page)
Ben Bolstad
Snapshot Date: 2025-01-23 13:00 -0500 (Thu, 23 Jan 2025)
git_url: https://git.bioconductor.org/packages/BufferedMatrix
git_branch: RELEASE_3_20
git_last_commit: 32b6f6a
git_last_commit_date: 2024-10-29 09:27:20 -0500 (Tue, 29 Oct 2024)
nebbiolo2Linux (Ubuntu 24.04.1 LTS) / x86_64  OK    OK    OK  UNNEEDED, same version is already published
palomino8Windows Server 2022 Datacenter / x64  OK    OK    OK    OK  UNNEEDED, same version is already published
merida1macOS 12.7.5 Monterey / x86_64  OK    OK    WARNINGS    OK  UNNEEDED, same version is already published
kjohnson1macOS 13.6.6 Ventura / arm64  OK    OK    WARNINGS    OK  UNNEEDED, same version is already published
taishanLinux (openEuler 24.03 LTS) / aarch64  OK    OK    OK  


CHECK results for BufferedMatrix on nebbiolo2

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

raw results


Summary

Package: BufferedMatrix
Version: 1.70.0
Command: /home/biocbuild/bbs-3.20-bioc/R/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/home/biocbuild/bbs-3.20-bioc/R/site-library --timings BufferedMatrix_1.70.0.tar.gz
StartedAt: 2025-01-23 20:27:09 -0500 (Thu, 23 Jan 2025)
EndedAt: 2025-01-23 20:27:32 -0500 (Thu, 23 Jan 2025)
EllapsedTime: 23.0 seconds
RetCode: 0
Status:   OK  
CheckDir: BufferedMatrix.Rcheck
Warnings: 0

Command output

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


* using log directory ‘/home/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck’
* using R version 4.4.2 (2024-10-31)
* using platform: x86_64-pc-linux-gnu
* R was compiled by
    gcc (Ubuntu 13.2.0-23ubuntu4) 13.2.0
    GNU Fortran (Ubuntu 13.2.0-23ubuntu4) 13.2.0
* running under: Ubuntu 24.04.1 LTS
* using session charset: UTF-8
* checking for file ‘BufferedMatrix/DESCRIPTION’ ... OK
* this is package ‘BufferedMatrix’ version ‘1.70.0’
* checking package namespace information ... OK
* checking package dependencies ... OK
* checking if this is a source package ... OK
* checking if there is a namespace ... OK
* checking for hidden files and directories ... OK
* checking for portable file names ... OK
* checking for sufficient/correct file permissions ... OK
* checking whether package ‘BufferedMatrix’ can be installed ... OK
* used C compiler: ‘gcc (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0’
* checking installed package size ... OK
* checking package directory ... OK
* checking ‘build’ directory ... OK
* checking DESCRIPTION meta-information ... OK
* checking top-level files ... OK
* checking for left-over files ... OK
* checking index information ... OK
* checking package subdirectories ... OK
* checking code files for non-ASCII characters ... OK
* checking R files for syntax errors ... OK
* checking whether the package can be loaded ... OK
* checking whether the package can be loaded with stated dependencies ... OK
* checking whether the package can be unloaded cleanly ... OK
* checking whether the namespace can be loaded with stated dependencies ... OK
* checking whether the namespace can be unloaded cleanly ... OK
* checking loading without being on the library search path ... OK
* checking dependencies in R code ... OK
* checking S3 generic/method consistency ... OK
* checking replacement functions ... OK
* checking foreign function calls ... OK
* checking R code for possible problems ... OK
* checking Rd files ... NOTE
checkRd: (-1) BufferedMatrix-class.Rd:209: Lost braces; missing escapes or markup?
   209 |     $x^{power}$ elementwise of the matrix
       |        ^
prepare_Rd: createBufferedMatrix.Rd:26: Dropping empty section \keyword
prepare_Rd: createBufferedMatrix.Rd:17-18: Dropping empty section \details
prepare_Rd: createBufferedMatrix.Rd:15-16: Dropping empty section \value
prepare_Rd: createBufferedMatrix.Rd:19-20: Dropping empty section \references
prepare_Rd: createBufferedMatrix.Rd:21-22: Dropping empty section \seealso
prepare_Rd: createBufferedMatrix.Rd:23-24: Dropping empty section \examples
* checking Rd metadata ... OK
* checking Rd cross-references ... OK
* checking for missing documentation entries ... OK
* checking for code/documentation mismatches ... OK
* checking Rd \usage sections ... OK
* checking Rd contents ... OK
* checking for unstated dependencies in examples ... OK
* checking line endings in C/C++/Fortran sources/headers ... OK
* checking compiled code ... NOTE
Note: information on .o files is not available
* checking files in ‘vignettes’ ... OK
* checking examples ... NONE
* checking for unstated dependencies in ‘tests’ ... OK
* checking tests ...
  Running ‘Rcodetesting.R’
  Running ‘c_code_level_tests.R’
  Running ‘objectTesting.R’
  Running ‘rawCalltesting.R’
 OK
* checking for unstated dependencies in vignettes ... OK
* checking package vignettes ... OK
* checking re-building of vignette outputs ... OK
* checking PDF version of manual ... OK
* DONE

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


Installation output

BufferedMatrix.Rcheck/00install.out

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


* installing to library ‘/home/biocbuild/bbs-3.20-bioc/R/site-library’
* installing *source* package ‘BufferedMatrix’ ...
** using staged installation
** libs
using C compiler: ‘gcc (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0’
gcc -I"/home/biocbuild/bbs-3.20-bioc/R/include" -DNDEBUG   -I/usr/local/include    -fpic  -g -O2  -Wall -c RBufferedMatrix.c -o RBufferedMatrix.o
gcc -I"/home/biocbuild/bbs-3.20-bioc/R/include" -DNDEBUG   -I/usr/local/include    -fpic  -g -O2  -Wall -c doubleBufferedMatrix.c -o doubleBufferedMatrix.o
doubleBufferedMatrix.c: In function ‘dbm_ReadOnlyMode’:
doubleBufferedMatrix.c:1580:7: warning: suggest parentheses around operand of ‘!’ or change ‘&’ to ‘&&’ or ‘!’ to ‘~’ [-Wparentheses]
 1580 |   if (!(Matrix->readonly) & setting){
      |       ^~~~~~~~~~~~~~~~~~~
doubleBufferedMatrix.c: At top level:
doubleBufferedMatrix.c:3327:12: warning: ‘sort_double’ defined but not used [-Wunused-function]
 3327 | static int sort_double(const double *a1,const double *a2){
      |            ^~~~~~~~~~~
gcc -I"/home/biocbuild/bbs-3.20-bioc/R/include" -DNDEBUG   -I/usr/local/include    -fpic  -g -O2  -Wall -c doubleBufferedMatrix_C_tests.c -o doubleBufferedMatrix_C_tests.o
gcc -I"/home/biocbuild/bbs-3.20-bioc/R/include" -DNDEBUG   -I/usr/local/include    -fpic  -g -O2  -Wall -c init_package.c -o init_package.o
gcc -shared -L/home/biocbuild/bbs-3.20-bioc/R/lib -L/usr/local/lib -o BufferedMatrix.so RBufferedMatrix.o doubleBufferedMatrix.o doubleBufferedMatrix_C_tests.o init_package.o -L/home/biocbuild/bbs-3.20-bioc/R/lib -lR
installing to /home/biocbuild/bbs-3.20-bioc/R/site-library/00LOCK-BufferedMatrix/00new/BufferedMatrix/libs
** R
** inst
** byte-compile and prepare package for lazy loading
Creating a new generic function for ‘rowMeans’ in package ‘BufferedMatrix’
Creating a new generic function for ‘rowSums’ in package ‘BufferedMatrix’
Creating a new generic function for ‘colMeans’ in package ‘BufferedMatrix’
Creating a new generic function for ‘colSums’ in package ‘BufferedMatrix’
Creating a generic function for ‘ncol’ from package ‘base’ in package ‘BufferedMatrix’
Creating a generic function for ‘nrow’ from package ‘base’ in package ‘BufferedMatrix’
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
** checking absolute paths in shared objects and dynamic libraries
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (BufferedMatrix)

Tests output

BufferedMatrix.Rcheck/tests/c_code_level_tests.Rout


R version 4.4.2 (2024-10-31) -- "Pile of Leaves"
Copyright (C) 2024 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(BufferedMatrix);library.dynam("BufferedMatrix", "BufferedMatrix", .libPaths());.C("dbm_c_tester",integer(1))

Attaching package: 'BufferedMatrix'

The following objects are masked from 'package:base':

    colMeans, colSums, rowMeans, rowSums

Checking dimensions
Rows: 5
Cols: 5
Buffer Rows: 1
Buffer Cols: 1

Assigning Values
0.000000 1.000000 2.000000 3.000000 4.000000 
1.000000 2.000000 3.000000 4.000000 5.000000 
2.000000 3.000000 4.000000 5.000000 6.000000 
3.000000 4.000000 5.000000 6.000000 7.000000 
4.000000 5.000000 6.000000 7.000000 8.000000 

Adding Additional Column
Checking dimensions
Rows: 5
Cols: 6
Buffer Rows: 1
Buffer Cols: 1
0.000000 1.000000 2.000000 3.000000 4.000000 0.000000 
1.000000 2.000000 3.000000 4.000000 5.000000 0.000000 
2.000000 3.000000 4.000000 5.000000 6.000000 0.000000 
3.000000 4.000000 5.000000 6.000000 7.000000 0.000000 
4.000000 5.000000 6.000000 7.000000 8.000000 0.000000 

Reassigning values
1.000000 6.000000 11.000000 16.000000 21.000000 26.000000 
2.000000 7.000000 12.000000 17.000000 22.000000 27.000000 
3.000000 8.000000 13.000000 18.000000 23.000000 28.000000 
4.000000 9.000000 14.000000 19.000000 24.000000 29.000000 
5.000000 10.000000 15.000000 20.000000 25.000000 30.000000 

Resizing Buffers
Checking dimensions
Rows: 5
Cols: 6
Buffer Rows: 3
Buffer Cols: 3
1.000000 6.000000 11.000000 16.000000 21.000000 26.000000 
2.000000 7.000000 12.000000 17.000000 22.000000 27.000000 
3.000000 8.000000 13.000000 18.000000 23.000000 28.000000 
4.000000 9.000000 14.000000 19.000000 24.000000 29.000000 
5.000000 10.000000 15.000000 20.000000 25.000000 30.000000 

Activating Row Buffer
In row mode: 1
1.000000 6.000000 11.000000 16.000000 21.000000 26.000000 
2.000000 7.000000 12.000000 17.000000 22.000000 27.000000 
3.000000 8.000000 13.000000 18.000000 23.000000 28.000000 
4.000000 9.000000 14.000000 19.000000 24.000000 29.000000 
5.000000 10.000000 15.000000 20.000000 25.000000 30.000000 

Squaring Last Column
1.000000 6.000000 11.000000 16.000000 21.000000 676.000000 
2.000000 7.000000 12.000000 17.000000 22.000000 729.000000 
3.000000 8.000000 13.000000 18.000000 23.000000 784.000000 
4.000000 9.000000 14.000000 19.000000 24.000000 841.000000 
5.000000 10.000000 15.000000 20.000000 25.000000 900.000000 

Square rooting Last Row, then turing off Row Buffer
In row mode: 0
Checking on value that should be not be in column buffer2.236068 
1.000000 6.000000 11.000000 16.000000 21.000000 676.000000 
2.000000 7.000000 12.000000 17.000000 22.000000 729.000000 
3.000000 8.000000 13.000000 18.000000 23.000000 784.000000 
4.000000 9.000000 14.000000 19.000000 24.000000 841.000000 
2.236068 3.162278 3.872983 4.472136 5.000000 30.000000 

Single Indexing. Assign each value its square
1.000000 36.000000 121.000000 256.000000 441.000000 676.000000 
4.000000 49.000000 144.000000 289.000000 484.000000 729.000000 
9.000000 64.000000 169.000000 324.000000 529.000000 784.000000 
16.000000 81.000000 196.000000 361.000000 576.000000 841.000000 
25.000000 100.000000 225.000000 400.000000 625.000000 900.000000 

Resizing Buffers Smaller
Checking dimensions
Rows: 5
Cols: 6
Buffer Rows: 1
Buffer Cols: 1
1.000000 36.000000 121.000000 256.000000 441.000000 676.000000 
4.000000 49.000000 144.000000 289.000000 484.000000 729.000000 
9.000000 64.000000 169.000000 324.000000 529.000000 784.000000 
16.000000 81.000000 196.000000 361.000000 576.000000 841.000000 
25.000000 100.000000 225.000000 400.000000 625.000000 900.000000 

Activating Row Mode.
Resizing Buffers
Checking dimensions
Rows: 5
Cols: 6
Buffer Rows: 1
Buffer Cols: 1
Activating ReadOnly Mode.
The results of assignment is: 0
Printing matrix reversed.
900.000000 625.000000 400.000000 225.000000 100.000000 25.000000 
841.000000 576.000000 361.000000 196.000000 81.000000 16.000000 
784.000000 529.000000 324.000000 169.000000 64.000000 9.000000 
729.000000 484.000000 289.000000 144.000000 49.000000 -30.000000 
676.000000 441.000000 256.000000 121.000000 -20.000000 -10.000000 

[[1]]
[1] 0

> 
> proc.time()
   user  system elapsed 
  0.242   0.043   0.274 

BufferedMatrix.Rcheck/tests/objectTesting.Rout


R version 4.4.2 (2024-10-31) -- "Pile of Leaves"
Copyright (C) 2024 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(BufferedMatrix);library.dynam("BufferedMatrix","BufferedMatrix", .libPaths());

Attaching package: 'BufferedMatrix'

The following objects are masked from 'package:base':

    colMeans, colSums, rowMeans, rowSums

> 
> 
> ### this is used to control how many repetitions in something below
> ### higher values result in more checks.
> nreps <-100 ##20000
> 
> 
> ## test creation and some simple assignments and subsetting operations
> 
> ## first on single elements
> tmp <- createBufferedMatrix(1000,10)
> 
> tmp[10,5]
[1] 0
> tmp[10,5] <- 10
> tmp[10,5]
[1] 10
> tmp[10,5] <- 12.445
> tmp[10,5]
[1] 12.445
> 
> 
> 
> ## now testing accessing multiple elements
> tmp2 <- createBufferedMatrix(10,20)
> 
> 
> tmp2[3,1] <- 51.34
> tmp2[9,2] <- 9.87654
> tmp2[,1:2]
       [,1]    [,2]
 [1,]  0.00 0.00000
 [2,]  0.00 0.00000
 [3,] 51.34 0.00000
 [4,]  0.00 0.00000
 [5,]  0.00 0.00000
 [6,]  0.00 0.00000
 [7,]  0.00 0.00000
 [8,]  0.00 0.00000
 [9,]  0.00 9.87654
[10,]  0.00 0.00000
> tmp2[,-(3:20)]
       [,1]    [,2]
 [1,]  0.00 0.00000
 [2,]  0.00 0.00000
 [3,] 51.34 0.00000
 [4,]  0.00 0.00000
 [5,]  0.00 0.00000
 [6,]  0.00 0.00000
 [7,]  0.00 0.00000
 [8,]  0.00 0.00000
 [9,]  0.00 9.87654
[10,]  0.00 0.00000
> tmp2[3,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
[1,] 51.34    0    0    0    0    0    0    0    0     0     0     0     0
     [,14] [,15] [,16] [,17] [,18] [,19] [,20]
[1,]     0     0     0     0     0     0     0
> tmp2[-3,]
      [,1]    [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [2,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [3,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [4,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [5,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [6,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [7,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [8,]    0 9.87654    0    0    0    0    0    0    0     0     0     0     0
 [9,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
      [,14] [,15] [,16] [,17] [,18] [,19] [,20]
 [1,]     0     0     0     0     0     0     0
 [2,]     0     0     0     0     0     0     0
 [3,]     0     0     0     0     0     0     0
 [4,]     0     0     0     0     0     0     0
 [5,]     0     0     0     0     0     0     0
 [6,]     0     0     0     0     0     0     0
 [7,]     0     0     0     0     0     0     0
 [8,]     0     0     0     0     0     0     0
 [9,]     0     0     0     0     0     0     0
> tmp2[2,1:3]
     [,1] [,2] [,3]
[1,]    0    0    0
> tmp2[3:9,1:3]
      [,1]    [,2] [,3]
[1,] 51.34 0.00000    0
[2,]  0.00 0.00000    0
[3,]  0.00 0.00000    0
[4,]  0.00 0.00000    0
[5,]  0.00 0.00000    0
[6,]  0.00 0.00000    0
[7,]  0.00 9.87654    0
> tmp2[-4,-4]
       [,1]    [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [2,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [3,] 51.34 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [4,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [5,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [6,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [7,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [8,]  0.00 9.87654    0    0    0    0    0    0    0     0     0     0     0
 [9,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
      [,14] [,15] [,16] [,17] [,18] [,19]
 [1,]     0     0     0     0     0     0
 [2,]     0     0     0     0     0     0
 [3,]     0     0     0     0     0     0
 [4,]     0     0     0     0     0     0
 [5,]     0     0     0     0     0     0
 [6,]     0     0     0     0     0     0
 [7,]     0     0     0     0     0     0
 [8,]     0     0     0     0     0     0
 [9,]     0     0     0     0     0     0
> 
> ## now testing accessing/assigning multiple elements
> tmp3 <- createBufferedMatrix(10,10)
> 
> for (i in 1:10){
+   for (j in 1:10){
+     tmp3[i,j] <- (j-1)*10 + i
+   }
+ }
> 
> tmp3[2:4,2:4]
     [,1] [,2] [,3]
[1,]   12   22   32
[2,]   13   23   33
[3,]   14   24   34
> tmp3[c(-10),c(2:4,2:4,10,1,2,1:10,10:1)]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]   11   21   31   11   21   31   91    1   11     1    11    21    31
 [2,]   12   22   32   12   22   32   92    2   12     2    12    22    32
 [3,]   13   23   33   13   23   33   93    3   13     3    13    23    33
 [4,]   14   24   34   14   24   34   94    4   14     4    14    24    34
 [5,]   15   25   35   15   25   35   95    5   15     5    15    25    35
 [6,]   16   26   36   16   26   36   96    6   16     6    16    26    36
 [7,]   17   27   37   17   27   37   97    7   17     7    17    27    37
 [8,]   18   28   38   18   28   38   98    8   18     8    18    28    38
 [9,]   19   29   39   19   29   39   99    9   19     9    19    29    39
      [,14] [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24] [,25]
 [1,]    41    51    61    71    81    91    91    81    71    61    51    41
 [2,]    42    52    62    72    82    92    92    82    72    62    52    42
 [3,]    43    53    63    73    83    93    93    83    73    63    53    43
 [4,]    44    54    64    74    84    94    94    84    74    64    54    44
 [5,]    45    55    65    75    85    95    95    85    75    65    55    45
 [6,]    46    56    66    76    86    96    96    86    76    66    56    46
 [7,]    47    57    67    77    87    97    97    87    77    67    57    47
 [8,]    48    58    68    78    88    98    98    88    78    68    58    48
 [9,]    49    59    69    79    89    99    99    89    79    69    59    49
      [,26] [,27] [,28] [,29]
 [1,]    31    21    11     1
 [2,]    32    22    12     2
 [3,]    33    23    13     3
 [4,]    34    24    14     4
 [5,]    35    25    15     5
 [6,]    36    26    16     6
 [7,]    37    27    17     7
 [8,]    38    28    18     8
 [9,]    39    29    19     9
> tmp3[-c(1:5),-c(6:10)]
     [,1] [,2] [,3] [,4] [,5]
[1,]    6   16   26   36   46
[2,]    7   17   27   37   47
[3,]    8   18   28   38   48
[4,]    9   19   29   39   49
[5,]   10   20   30   40   50
> 
> ## assignment of whole columns
> tmp3[,1] <- c(1:10*100.0)
> tmp3[,1:2] <- tmp3[,1:2]*100
> tmp3[,1:2] <- tmp3[,2:1]
> tmp3[,1:2]
      [,1]  [,2]
 [1,] 1100 1e+04
 [2,] 1200 2e+04
 [3,] 1300 3e+04
 [4,] 1400 4e+04
 [5,] 1500 5e+04
 [6,] 1600 6e+04
 [7,] 1700 7e+04
 [8,] 1800 8e+04
 [9,] 1900 9e+04
[10,] 2000 1e+05
> 
> 
> tmp3[,-1] <- tmp3[,1:9]
> tmp3[,1:10]
      [,1] [,2]  [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,] 1100 1100 1e+04   21   31   41   51   61   71    81
 [2,] 1200 1200 2e+04   22   32   42   52   62   72    82
 [3,] 1300 1300 3e+04   23   33   43   53   63   73    83
 [4,] 1400 1400 4e+04   24   34   44   54   64   74    84
 [5,] 1500 1500 5e+04   25   35   45   55   65   75    85
 [6,] 1600 1600 6e+04   26   36   46   56   66   76    86
 [7,] 1700 1700 7e+04   27   37   47   57   67   77    87
 [8,] 1800 1800 8e+04   28   38   48   58   68   78    88
 [9,] 1900 1900 9e+04   29   39   49   59   69   79    89
[10,] 2000 2000 1e+05   30   40   50   60   70   80    90
> 
> tmp3[,1:2] <- rep(1,10)
> tmp3[,1:2] <- rep(1,20)
> tmp3[,1:2] <- matrix(c(1:5),1,5)
> 
> tmp3[,-c(1:8)] <- matrix(c(1:5),1,5)
> 
> tmp3[1,] <- 1:10
> tmp3[1,]
     [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,]    1    2    3    4    5    6    7    8    9    10
> tmp3[-1,] <- c(1,2)
> tmp3[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    1    2    3    4    5    6    7    8    9    10
 [2,]    1    2    1    2    1    2    1    2    1     2
 [3,]    2    1    2    1    2    1    2    1    2     1
 [4,]    1    2    1    2    1    2    1    2    1     2
 [5,]    2    1    2    1    2    1    2    1    2     1
 [6,]    1    2    1    2    1    2    1    2    1     2
 [7,]    2    1    2    1    2    1    2    1    2     1
 [8,]    1    2    1    2    1    2    1    2    1     2
 [9,]    2    1    2    1    2    1    2    1    2     1
[10,]    1    2    1    2    1    2    1    2    1     2
> tmp3[-c(1:8),] <- matrix(c(1:5),1,5)
> tmp3[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    1    2    3    4    5    6    7    8    9    10
 [2,]    1    2    1    2    1    2    1    2    1     2
 [3,]    2    1    2    1    2    1    2    1    2     1
 [4,]    1    2    1    2    1    2    1    2    1     2
 [5,]    2    1    2    1    2    1    2    1    2     1
 [6,]    1    2    1    2    1    2    1    2    1     2
 [7,]    2    1    2    1    2    1    2    1    2     1
 [8,]    1    2    1    2    1    2    1    2    1     2
 [9,]    1    3    5    2    4    1    3    5    2     4
[10,]    2    4    1    3    5    2    4    1    3     5
> 
> 
> tmp3[1:2,1:2] <- 5555.04
> tmp3[-(1:2),1:2] <- 1234.56789
> 
> 
> 
> ## testing accessors for the directory and prefix
> directory(tmp3)
[1] "/home/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests"
> prefix(tmp3)
[1] "BM"
> 
> ## testing if we can remove these objects
> rm(tmp, tmp2, tmp3)
> gc()
         used (Mb) gc trigger (Mb) max used (Mb)
Ncells 471792 25.2    1026261 54.9   643431 34.4
Vcells 871947  6.7    8388608 64.0  2046621 15.7
> 
> 
> 
> 
> ##
> ## checking reads
> ##
> 
> tmp2 <- createBufferedMatrix(10,20)
> 
> test.sample <- rnorm(10*20)
> 
> tmp2[1:10,1:20] <- test.sample
> 
> test.matrix <- matrix(test.sample,10,20)
> 
> ## testing reads
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   which.col <- sample(1:20,1)
+   if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> date()
[1] "Thu Jan 23 20:27:23 2025"
> 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 Jan 23 20:27:23 2025"
> 
> 
> 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: 0x5c02480042a0>
> 
> 
> 
> 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 Jan 23 20:27:23 2025"
> 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 Jan 23 20:27:23 2025"
> 
> ColMode(tmp2)
<pointer: 0x5c02480042a0>
> 
> 
> 
> ### Now testing assignments
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+ 
+   new.data <- rnorm(20)
+   tmp2[which.row,] <- new.data
+   test.matrix[which.row,] <- new.data
+   if (rep > 1){
+     if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+   
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   new.data <- rnorm(10)
+   tmp2[,which.col] <- new.data
+   test.matrix[,which.col]<- new.data
+ 
+   if (rep > 1){
+     if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.col <- which.col
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,5,replace=TRUE)
+   new.data <- matrix(rnorm(50),5,10)
+   tmp2[,which.col] <- new.data
+   test.matrix[,which.col]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.col <- which.col
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   new.data <- matrix(rnorm(50),5,10)
+   tmp2[which.row,] <- new.data
+   test.matrix[which.row,]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col  <- sample(1:20,5,replace=TRUE)
+   new.data <- matrix(rnorm(25),5,5)
+   tmp2[which.row,which.col] <- new.data
+   test.matrix[which.row,which.col]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[prev.row,prev.col] == test.matrix[prev.row,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+   prev.col <- which.col
+ }
> 
> 
> 
> 
> ###
> ###
> ### testing some more functions
> ###
> 
> 
> 
> ## duplication function
> tmp5 <- duplicate(tmp2)
> 
> # making sure really did copy everything.
> tmp5[1,1] <- tmp5[1,1] +100.00
> 
> if (tmp5[1,1] == tmp2[1,1]){
+   stop("Problem with duplication")
+ }
> 
> 
> 
> 
> ### testing elementwise applying of functions
> 
> tmp5[1:4,1:4]
            [,1]      [,2]        [,3]       [,4]
[1,] 100.0673789 0.7378160  0.36752089 -0.6508511
[2,]  -0.1583652 0.7199826 -0.63153501 -1.6179819
[3,]   0.3646913 0.3367841  0.53331006 -0.4614837
[4,]  -0.8313854 0.2424515 -0.01886966  1.4022000
> ewApply(tmp5,abs)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
            [,1]      [,2]       [,3]      [,4]
[1,] 100.0673789 0.7378160 0.36752089 0.6508511
[2,]   0.1583652 0.7199826 0.63153501 1.6179819
[3,]   0.3646913 0.3367841 0.53331006 0.4614837
[4,]   0.8313854 0.2424515 0.01886966 1.4022000
> ewApply(tmp5,sqrt)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
           [,1]      [,2]      [,3]      [,4]
[1,] 10.0033684 0.8589622 0.6062350 0.8067534
[2,]  0.3979513 0.8485179 0.7946918 1.2719992
[3,]  0.6038968 0.5803310 0.7302808 0.6793259
[4,]  0.9118034 0.4923937 0.1373669 1.1841453
> 
> my.function <- function(x,power){
+   (x+5)^power
+ }
> 
> ewApply(tmp5,my.function,power=2)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
          [,1]     [,2]     [,3]     [,4]
[1,] 225.10106 34.32744 31.42987 33.71839
[2,]  29.13788 34.20516 33.57845 39.33797
[3,]  31.40366 31.14009 32.83612 32.25474
[4,]  34.94942 30.16639 26.39254 38.24365
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x5c024801c510>
> exp(tmp5)
<pointer: 0x5c024801c510>
> log(tmp5,2)
<pointer: 0x5c024801c510>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 468.5184
> Min(tmp5)
[1] 52.82061
> mean(tmp5)
[1] 72.78284
> Sum(tmp5)
[1] 14556.57
> Var(tmp5)
[1] 866.0809
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 93.98882 68.91977 71.54117 67.97942 72.43478 69.33253 72.93452 71.54527
 [9] 71.58716 67.56496
> rowSums(tmp5)
 [1] 1879.776 1378.395 1430.823 1359.588 1448.696 1386.651 1458.690 1430.905
 [9] 1431.743 1351.299
> rowVars(tmp5)
 [1] 7820.79308   86.61478  106.96288   61.92127   50.42017   73.68819
 [7]   51.62291   61.62392  123.25517   74.71600
> rowSd(tmp5)
 [1] 88.435248  9.306706 10.342286  7.869007  7.100716  8.584183  7.184909
 [8]  7.850090 11.102035  8.643841
> rowMax(tmp5)
 [1] 468.51837  87.25550  91.25555  82.07288  88.08475  82.72412  92.09056
 [8]  87.36354  92.07400  85.71079
> rowMin(tmp5)
 [1] 60.39404 55.43762 52.82061 54.93261 61.75939 56.27076 56.75703 56.29492
 [9] 55.81166 56.93576
> 
> colMeans(tmp5)
 [1] 109.20927  66.80516  69.96474  72.41186  75.21781  68.69234  73.52979
 [8]  72.82687  72.03316  69.17321  69.41876  72.63111  71.06892  75.97938
[15]  78.15645  68.44271  67.46684  67.19944  69.54357  65.88537
> colSums(tmp5)
 [1] 1092.0927  668.0516  699.6474  724.1186  752.1781  686.9234  735.2979
 [8]  728.2687  720.3316  691.7321  694.1876  726.3111  710.6892  759.7938
[15]  781.5645  684.4271  674.6684  671.9944  695.4357  658.8537
> colVars(tmp5)
 [1] 15993.05930    18.64389    65.94839    47.62042   107.60463    49.11182
 [7]    65.72079   157.40837   121.33928   125.78719    49.53605    67.34637
[13]    91.63808    49.46271    49.65568    47.51174    88.08609    87.04597
[19]    28.75412    64.04239
> colSd(tmp5)
 [1] 126.463668   4.317857   8.120861   6.900755  10.373265   7.007983
 [7]   8.106836  12.546249  11.015411  11.215489   7.038185   8.206483
[13]   9.572778   7.032973   7.046679   6.892876   9.385419   9.329843
[19]   5.362287   8.002649
> colMax(tmp5)
 [1] 468.51837  71.69563  83.21700  81.87684  88.08475  80.93704  87.36354
 [8]  92.09056  92.07400  88.50966  79.85731  88.02548  85.31777  88.44406
[15]  91.25555  78.64152  82.68186  79.07675  75.35277  78.79638
> colMin(tmp5)
 [1] 60.64668 58.01004 54.93261 59.98331 57.45242 59.12908 62.58267 56.27076
 [9] 55.43762 56.75703 56.65757 62.62406 56.93576 66.73882 66.34172 59.07979
[17] 56.29492 52.82061 60.83721 55.81166
> 
> 
> ### 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] 93.98882 68.91977 71.54117 67.97942 72.43478 69.33253 72.93452 71.54527
 [9] 71.58716       NA
> rowSums(tmp5)
 [1] 1879.776 1378.395 1430.823 1359.588 1448.696 1386.651 1458.690 1430.905
 [9] 1431.743       NA
> rowVars(tmp5)
 [1] 7820.79308   86.61478  106.96288   61.92127   50.42017   73.68819
 [7]   51.62291   61.62392  123.25517   67.34138
> rowSd(tmp5)
 [1] 88.435248  9.306706 10.342286  7.869007  7.100716  8.584183  7.184909
 [8]  7.850090 11.102035  8.206179
> rowMax(tmp5)
 [1] 468.51837  87.25550  91.25555  82.07288  88.08475  82.72412  92.09056
 [8]  87.36354  92.07400        NA
> rowMin(tmp5)
 [1] 60.39404 55.43762 52.82061 54.93261 61.75939 56.27076 56.75703 56.29492
 [9] 55.81166       NA
> 
> colMeans(tmp5)
 [1] 109.20927  66.80516  69.96474  72.41186  75.21781  68.69234  73.52979
 [8]  72.82687  72.03316  69.17321  69.41876        NA  71.06892  75.97938
[15]  78.15645  68.44271  67.46684  67.19944  69.54357  65.88537
> colSums(tmp5)
 [1] 1092.0927  668.0516  699.6474  724.1186  752.1781  686.9234  735.2979
 [8]  728.2687  720.3316  691.7321  694.1876        NA  710.6892  759.7938
[15]  781.5645  684.4271  674.6684  671.9944  695.4357  658.8537
> colVars(tmp5)
 [1] 15993.05930    18.64389    65.94839    47.62042   107.60463    49.11182
 [7]    65.72079   157.40837   121.33928   125.78719    49.53605          NA
[13]    91.63808    49.46271    49.65568    47.51174    88.08609    87.04597
[19]    28.75412    64.04239
> colSd(tmp5)
 [1] 126.463668   4.317857   8.120861   6.900755  10.373265   7.007983
 [7]   8.106836  12.546249  11.015411  11.215489   7.038185         NA
[13]   9.572778   7.032973   7.046679   6.892876   9.385419   9.329843
[19]   5.362287   8.002649
> colMax(tmp5)
 [1] 468.51837  71.69563  83.21700  81.87684  88.08475  80.93704  87.36354
 [8]  92.09056  92.07400  88.50966  79.85731        NA  85.31777  88.44406
[15]  91.25555  78.64152  82.68186  79.07675  75.35277  78.79638
> colMin(tmp5)
 [1] 60.64668 58.01004 54.93261 59.98331 57.45242 59.12908 62.58267 56.27076
 [9] 55.43762 56.75703 56.65757       NA 56.93576 66.73882 66.34172 59.07979
[17] 56.29492 52.82061 60.83721 55.81166
> 
> Max(tmp5,na.rm=TRUE)
[1] 468.5184
> Min(tmp5,na.rm=TRUE)
[1] 52.82061
> mean(tmp5,na.rm=TRUE)
[1] 72.73851
> Sum(tmp5,na.rm=TRUE)
[1] 14474.96
> Var(tmp5,na.rm=TRUE)
[1] 870.0601
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 93.98882 68.91977 71.54117 67.97942 72.43478 69.33253 72.93452 71.54527
 [9] 71.58716 66.82608
> rowSums(tmp5,na.rm=TRUE)
 [1] 1879.776 1378.395 1430.823 1359.588 1448.696 1386.651 1458.690 1430.905
 [9] 1431.743 1269.696
> rowVars(tmp5,na.rm=TRUE)
 [1] 7820.79308   86.61478  106.96288   61.92127   50.42017   73.68819
 [7]   51.62291   61.62392  123.25517   67.34138
> rowSd(tmp5,na.rm=TRUE)
 [1] 88.435248  9.306706 10.342286  7.869007  7.100716  8.584183  7.184909
 [8]  7.850090 11.102035  8.206179
> rowMax(tmp5,na.rm=TRUE)
 [1] 468.51837  87.25550  91.25555  82.07288  88.08475  82.72412  92.09056
 [8]  87.36354  92.07400  85.71079
> rowMin(tmp5,na.rm=TRUE)
 [1] 60.39404 55.43762 52.82061 54.93261 61.75939 56.27076 56.75703 56.29492
 [9] 55.81166 56.93576
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 109.20927  66.80516  69.96474  72.41186  75.21781  68.69234  73.52979
 [8]  72.82687  72.03316  69.17321  69.41876  71.63415  71.06892  75.97938
[15]  78.15645  68.44271  67.46684  67.19944  69.54357  65.88537
> colSums(tmp5,na.rm=TRUE)
 [1] 1092.0927  668.0516  699.6474  724.1186  752.1781  686.9234  735.2979
 [8]  728.2687  720.3316  691.7321  694.1876  644.7074  710.6892  759.7938
[15]  781.5645  684.4271  674.6684  671.9944  695.4357  658.8537
> colVars(tmp5,na.rm=TRUE)
 [1] 15993.05930    18.64389    65.94839    47.62042   107.60463    49.11182
 [7]    65.72079   157.40837   121.33928   125.78719    49.53605    64.58307
[13]    91.63808    49.46271    49.65568    47.51174    88.08609    87.04597
[19]    28.75412    64.04239
> colSd(tmp5,na.rm=TRUE)
 [1] 126.463668   4.317857   8.120861   6.900755  10.373265   7.007983
 [7]   8.106836  12.546249  11.015411  11.215489   7.038185   8.036359
[13]   9.572778   7.032973   7.046679   6.892876   9.385419   9.329843
[19]   5.362287   8.002649
> colMax(tmp5,na.rm=TRUE)
 [1] 468.51837  71.69563  83.21700  81.87684  88.08475  80.93704  87.36354
 [8]  92.09056  92.07400  88.50966  79.85731  88.02548  85.31777  88.44406
[15]  91.25555  78.64152  82.68186  79.07675  75.35277  78.79638
> colMin(tmp5,na.rm=TRUE)
 [1] 60.64668 58.01004 54.93261 59.98331 57.45242 59.12908 62.58267 56.27076
 [9] 55.43762 56.75703 56.65757 62.62406 56.93576 66.73882 66.34172 59.07979
[17] 56.29492 52.82061 60.83721 55.81166
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1] 93.98882 68.91977 71.54117 67.97942 72.43478 69.33253 72.93452 71.54527
 [9] 71.58716      NaN
> rowSums(tmp5,na.rm=TRUE)
 [1] 1879.776 1378.395 1430.823 1359.588 1448.696 1386.651 1458.690 1430.905
 [9] 1431.743    0.000
> rowVars(tmp5,na.rm=TRUE)
 [1] 7820.79308   86.61478  106.96288   61.92127   50.42017   73.68819
 [7]   51.62291   61.62392  123.25517         NA
> rowSd(tmp5,na.rm=TRUE)
 [1] 88.435248  9.306706 10.342286  7.869007  7.100716  8.584183  7.184909
 [8]  7.850090 11.102035        NA
> rowMax(tmp5,na.rm=TRUE)
 [1] 468.51837  87.25550  91.25555  82.07288  88.08475  82.72412  92.09056
 [8]  87.36354  92.07400        NA
> rowMin(tmp5,na.rm=TRUE)
 [1] 60.39404 55.43762 52.82061 54.93261 61.75939 56.27076 56.75703 56.29492
 [9] 55.81166       NA
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1] 114.27795  66.26177  69.11096  73.79281  76.93880  69.67312  74.32626
 [8]  74.13373  73.49058  69.35094  70.23909       NaN  72.63928  74.89812
[15]  77.68859  69.02989  67.33973  67.50264  68.89811  66.02554
> colSums(tmp5,na.rm=TRUE)
 [1] 1028.5015  596.3560  621.9987  664.1353  692.4492  627.0581  668.9364
 [8]  667.2036  661.4152  624.1585  632.1518    0.0000  653.7535  674.0830
[15]  699.1973  621.2690  606.0576  607.5238  620.0830  594.2298
> colVars(tmp5,na.rm=TRUE)
 [1] 17703.16267    17.65261    65.99139    32.11895    87.73517    44.42919
 [7]    66.79928   157.87085   112.61083   141.15520    48.15736          NA
[13]    75.35030    42.49272    53.40006    49.57194    98.91508    96.89250
[19]    27.66135    71.82664
> colSd(tmp5,na.rm=TRUE)
 [1] 133.053232   4.201501   8.123508   5.667359   9.366705   6.665523
 [7]   8.173083  12.564667  10.611825  11.880875   6.939550         NA
[13]   8.680455   6.518644   7.307535   7.040735   9.945606   9.843399
[19]   5.259405   8.475060
> colMax(tmp5,na.rm=TRUE)
 [1] 468.51837  71.44806  83.21700  81.87684  88.08475  80.93704  87.36354
 [8]  92.09056  92.07400  88.50966  79.85731      -Inf  85.31777  88.44406
[15]  91.25555  78.64152  82.68186  79.07675  75.10715  78.79638
> colMin(tmp5,na.rm=TRUE)
 [1] 60.64668 58.01004 54.93261 65.28861 57.45242 59.12908 62.58267 56.27076
 [9] 55.43762 56.75703 56.65757      Inf 57.01080 66.73882 66.34172 59.07979
[17] 56.29492 52.82061 60.83721 55.81166
> 
> 
> 
> 
> 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] 254.2449 158.0604 202.8239 325.3186 185.0685 302.2977 357.4338 157.8688
 [9] 273.8527 234.2045
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 254.2449 158.0604 202.8239 325.3186 185.0685 302.2977 357.4338 157.8688
 [9] 273.8527 234.2045
> 
> 
> 
> copymatrix <- matrix(rnorm(200,150,15),10,20)
> 
> tmp5[1:10,1:20] <- copymatrix
> which.row <- 1
> which.col  <- 3
> cat(which.row," ",which.col,"\n")
1   3 
> tmp5[which.row,which.col] <- NA
> copymatrix[which.row,which.col] <- NA
> 
> colVars(tmp5,na.rm=TRUE)-apply(copymatrix,2,var,na.rm=TRUE)
 [1]  5.684342e-14  2.842171e-14  8.526513e-14 -2.557954e-13  1.136868e-13
 [6] -2.842171e-14 -2.842171e-14  2.273737e-13  1.705303e-13 -4.263256e-14
[11]  5.684342e-14 -5.684342e-14  0.000000e+00 -5.684342e-14 -1.136868e-13
[16]  4.263256e-14  1.989520e-13 -2.273737e-13  0.000000e+00 -9.947598e-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)
+ }
5   2 
8   20 
3   2 
3   3 
3   10 
3   10 
10   11 
3   20 
10   10 
3   5 
7   15 
3   20 
8   7 
5   2 
5   10 
1   18 
3   7 
2   20 
1   17 
2   12 
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] 3.064125
> Min(tmp)
[1] -2.665161
> mean(tmp)
[1] 0.02880785
> Sum(tmp)
[1] 2.880785
> Var(tmp)
[1] 1.085441
> 
> rowMeans(tmp)
[1] 0.02880785
> rowSums(tmp)
[1] 2.880785
> rowVars(tmp)
[1] 1.085441
> rowSd(tmp)
[1] 1.041845
> rowMax(tmp)
[1] 3.064125
> rowMin(tmp)
[1] -2.665161
> 
> colMeans(tmp)
  [1] -0.45952361 -0.86611818  1.18600788  0.59833140  0.74195507  0.30050090
  [7] -0.27954585  0.47242470  0.26367106 -2.03438334  0.33028427  0.38257691
 [13]  0.34882786  0.63691554 -1.52859491 -0.98780117 -0.37319575  0.14150309
 [19]  1.33462616  0.02290010  0.39716197 -0.06140156 -2.04324649  0.70847596
 [25] -0.21936595  0.19854576 -0.40438585  1.72653034 -0.80799505 -0.27859669
 [31]  0.61734025  0.87212399  0.43579201  0.20302921  0.91289050  1.14896206
 [37] -0.38204712  0.53515942  1.78449847  1.47121840 -0.53673631 -0.12630167
 [43] -1.05515790  0.89677896  2.17315442 -1.60352588  0.46916892 -0.20700279
 [49] -0.42184098 -0.39087754 -1.06777698 -0.91731360 -0.15418522  1.00425341
 [55] -0.12997240 -1.37686031 -0.74578026  0.71803140 -0.75044574 -2.66516095
 [61] -0.79624650  0.11628001 -0.91970279  2.72836629 -0.24342449  0.46949671
 [67]  0.23470000  0.25544541 -1.41784436 -1.55406694  0.31625762  1.59031220
 [73]  1.03833050 -0.99120413 -0.22323873  0.16181718 -1.36718498 -1.54362632
 [79]  1.31339303 -1.31604631 -0.20165394 -0.55161868 -0.98419149  1.35303380
 [85]  0.26852759 -0.91332033  1.00807248 -0.11513874  0.23642682  0.65962217
 [91] -0.77449361  1.81746956 -0.08792307 -0.38420635 -0.14223848 -1.41395571
 [97]  1.99249482  0.52020802 -0.48076805  3.06412485
> colSums(tmp)
  [1] -0.45952361 -0.86611818  1.18600788  0.59833140  0.74195507  0.30050090
  [7] -0.27954585  0.47242470  0.26367106 -2.03438334  0.33028427  0.38257691
 [13]  0.34882786  0.63691554 -1.52859491 -0.98780117 -0.37319575  0.14150309
 [19]  1.33462616  0.02290010  0.39716197 -0.06140156 -2.04324649  0.70847596
 [25] -0.21936595  0.19854576 -0.40438585  1.72653034 -0.80799505 -0.27859669
 [31]  0.61734025  0.87212399  0.43579201  0.20302921  0.91289050  1.14896206
 [37] -0.38204712  0.53515942  1.78449847  1.47121840 -0.53673631 -0.12630167
 [43] -1.05515790  0.89677896  2.17315442 -1.60352588  0.46916892 -0.20700279
 [49] -0.42184098 -0.39087754 -1.06777698 -0.91731360 -0.15418522  1.00425341
 [55] -0.12997240 -1.37686031 -0.74578026  0.71803140 -0.75044574 -2.66516095
 [61] -0.79624650  0.11628001 -0.91970279  2.72836629 -0.24342449  0.46949671
 [67]  0.23470000  0.25544541 -1.41784436 -1.55406694  0.31625762  1.59031220
 [73]  1.03833050 -0.99120413 -0.22323873  0.16181718 -1.36718498 -1.54362632
 [79]  1.31339303 -1.31604631 -0.20165394 -0.55161868 -0.98419149  1.35303380
 [85]  0.26852759 -0.91332033  1.00807248 -0.11513874  0.23642682  0.65962217
 [91] -0.77449361  1.81746956 -0.08792307 -0.38420635 -0.14223848 -1.41395571
 [97]  1.99249482  0.52020802 -0.48076805  3.06412485
> 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.45952361 -0.86611818  1.18600788  0.59833140  0.74195507  0.30050090
  [7] -0.27954585  0.47242470  0.26367106 -2.03438334  0.33028427  0.38257691
 [13]  0.34882786  0.63691554 -1.52859491 -0.98780117 -0.37319575  0.14150309
 [19]  1.33462616  0.02290010  0.39716197 -0.06140156 -2.04324649  0.70847596
 [25] -0.21936595  0.19854576 -0.40438585  1.72653034 -0.80799505 -0.27859669
 [31]  0.61734025  0.87212399  0.43579201  0.20302921  0.91289050  1.14896206
 [37] -0.38204712  0.53515942  1.78449847  1.47121840 -0.53673631 -0.12630167
 [43] -1.05515790  0.89677896  2.17315442 -1.60352588  0.46916892 -0.20700279
 [49] -0.42184098 -0.39087754 -1.06777698 -0.91731360 -0.15418522  1.00425341
 [55] -0.12997240 -1.37686031 -0.74578026  0.71803140 -0.75044574 -2.66516095
 [61] -0.79624650  0.11628001 -0.91970279  2.72836629 -0.24342449  0.46949671
 [67]  0.23470000  0.25544541 -1.41784436 -1.55406694  0.31625762  1.59031220
 [73]  1.03833050 -0.99120413 -0.22323873  0.16181718 -1.36718498 -1.54362632
 [79]  1.31339303 -1.31604631 -0.20165394 -0.55161868 -0.98419149  1.35303380
 [85]  0.26852759 -0.91332033  1.00807248 -0.11513874  0.23642682  0.65962217
 [91] -0.77449361  1.81746956 -0.08792307 -0.38420635 -0.14223848 -1.41395571
 [97]  1.99249482  0.52020802 -0.48076805  3.06412485
> colMin(tmp)
  [1] -0.45952361 -0.86611818  1.18600788  0.59833140  0.74195507  0.30050090
  [7] -0.27954585  0.47242470  0.26367106 -2.03438334  0.33028427  0.38257691
 [13]  0.34882786  0.63691554 -1.52859491 -0.98780117 -0.37319575  0.14150309
 [19]  1.33462616  0.02290010  0.39716197 -0.06140156 -2.04324649  0.70847596
 [25] -0.21936595  0.19854576 -0.40438585  1.72653034 -0.80799505 -0.27859669
 [31]  0.61734025  0.87212399  0.43579201  0.20302921  0.91289050  1.14896206
 [37] -0.38204712  0.53515942  1.78449847  1.47121840 -0.53673631 -0.12630167
 [43] -1.05515790  0.89677896  2.17315442 -1.60352588  0.46916892 -0.20700279
 [49] -0.42184098 -0.39087754 -1.06777698 -0.91731360 -0.15418522  1.00425341
 [55] -0.12997240 -1.37686031 -0.74578026  0.71803140 -0.75044574 -2.66516095
 [61] -0.79624650  0.11628001 -0.91970279  2.72836629 -0.24342449  0.46949671
 [67]  0.23470000  0.25544541 -1.41784436 -1.55406694  0.31625762  1.59031220
 [73]  1.03833050 -0.99120413 -0.22323873  0.16181718 -1.36718498 -1.54362632
 [79]  1.31339303 -1.31604631 -0.20165394 -0.55161868 -0.98419149  1.35303380
 [85]  0.26852759 -0.91332033  1.00807248 -0.11513874  0.23642682  0.65962217
 [91] -0.77449361  1.81746956 -0.08792307 -0.38420635 -0.14223848 -1.41395571
 [97]  1.99249482  0.52020802 -0.48076805  3.06412485
> colMedians(tmp)
  [1] -0.45952361 -0.86611818  1.18600788  0.59833140  0.74195507  0.30050090
  [7] -0.27954585  0.47242470  0.26367106 -2.03438334  0.33028427  0.38257691
 [13]  0.34882786  0.63691554 -1.52859491 -0.98780117 -0.37319575  0.14150309
 [19]  1.33462616  0.02290010  0.39716197 -0.06140156 -2.04324649  0.70847596
 [25] -0.21936595  0.19854576 -0.40438585  1.72653034 -0.80799505 -0.27859669
 [31]  0.61734025  0.87212399  0.43579201  0.20302921  0.91289050  1.14896206
 [37] -0.38204712  0.53515942  1.78449847  1.47121840 -0.53673631 -0.12630167
 [43] -1.05515790  0.89677896  2.17315442 -1.60352588  0.46916892 -0.20700279
 [49] -0.42184098 -0.39087754 -1.06777698 -0.91731360 -0.15418522  1.00425341
 [55] -0.12997240 -1.37686031 -0.74578026  0.71803140 -0.75044574 -2.66516095
 [61] -0.79624650  0.11628001 -0.91970279  2.72836629 -0.24342449  0.46949671
 [67]  0.23470000  0.25544541 -1.41784436 -1.55406694  0.31625762  1.59031220
 [73]  1.03833050 -0.99120413 -0.22323873  0.16181718 -1.36718498 -1.54362632
 [79]  1.31339303 -1.31604631 -0.20165394 -0.55161868 -0.98419149  1.35303380
 [85]  0.26852759 -0.91332033  1.00807248 -0.11513874  0.23642682  0.65962217
 [91] -0.77449361  1.81746956 -0.08792307 -0.38420635 -0.14223848 -1.41395571
 [97]  1.99249482  0.52020802 -0.48076805  3.06412485
> colRanges(tmp)
           [,1]       [,2]     [,3]      [,4]      [,5]      [,6]       [,7]
[1,] -0.4595236 -0.8661182 1.186008 0.5983314 0.7419551 0.3005009 -0.2795458
[2,] -0.4595236 -0.8661182 1.186008 0.5983314 0.7419551 0.3005009 -0.2795458
          [,8]      [,9]     [,10]     [,11]     [,12]     [,13]     [,14]
[1,] 0.4724247 0.2636711 -2.034383 0.3302843 0.3825769 0.3488279 0.6369155
[2,] 0.4724247 0.2636711 -2.034383 0.3302843 0.3825769 0.3488279 0.6369155
         [,15]      [,16]      [,17]     [,18]    [,19]     [,20]    [,21]
[1,] -1.528595 -0.9878012 -0.3731957 0.1415031 1.334626 0.0229001 0.397162
[2,] -1.528595 -0.9878012 -0.3731957 0.1415031 1.334626 0.0229001 0.397162
           [,22]     [,23]    [,24]     [,25]     [,26]      [,27]   [,28]
[1,] -0.06140156 -2.043246 0.708476 -0.219366 0.1985458 -0.4043859 1.72653
[2,] -0.06140156 -2.043246 0.708476 -0.219366 0.1985458 -0.4043859 1.72653
         [,29]      [,30]     [,31]    [,32]    [,33]     [,34]     [,35]
[1,] -0.807995 -0.2785967 0.6173403 0.872124 0.435792 0.2030292 0.9128905
[2,] -0.807995 -0.2785967 0.6173403 0.872124 0.435792 0.2030292 0.9128905
        [,36]      [,37]     [,38]    [,39]    [,40]      [,41]      [,42]
[1,] 1.148962 -0.3820471 0.5351594 1.784498 1.471218 -0.5367363 -0.1263017
[2,] 1.148962 -0.3820471 0.5351594 1.784498 1.471218 -0.5367363 -0.1263017
         [,43]    [,44]    [,45]     [,46]     [,47]      [,48]     [,49]
[1,] -1.055158 0.896779 2.173154 -1.603526 0.4691689 -0.2070028 -0.421841
[2,] -1.055158 0.896779 2.173154 -1.603526 0.4691689 -0.2070028 -0.421841
          [,50]     [,51]      [,52]      [,53]    [,54]      [,55]    [,56]
[1,] -0.3908775 -1.067777 -0.9173136 -0.1541852 1.004253 -0.1299724 -1.37686
[2,] -0.3908775 -1.067777 -0.9173136 -0.1541852 1.004253 -0.1299724 -1.37686
          [,57]     [,58]      [,59]     [,60]      [,61]   [,62]      [,63]
[1,] -0.7457803 0.7180314 -0.7504457 -2.665161 -0.7962465 0.11628 -0.9197028
[2,] -0.7457803 0.7180314 -0.7504457 -2.665161 -0.7962465 0.11628 -0.9197028
        [,64]      [,65]     [,66]  [,67]     [,68]     [,69]     [,70]
[1,] 2.728366 -0.2434245 0.4694967 0.2347 0.2554454 -1.417844 -1.554067
[2,] 2.728366 -0.2434245 0.4694967 0.2347 0.2554454 -1.417844 -1.554067
         [,71]    [,72]   [,73]      [,74]      [,75]     [,76]     [,77]
[1,] 0.3162576 1.590312 1.03833 -0.9912041 -0.2232387 0.1618172 -1.367185
[2,] 0.3162576 1.590312 1.03833 -0.9912041 -0.2232387 0.1618172 -1.367185
         [,78]    [,79]     [,80]      [,81]      [,82]      [,83]    [,84]
[1,] -1.543626 1.313393 -1.316046 -0.2016539 -0.5516187 -0.9841915 1.353034
[2,] -1.543626 1.313393 -1.316046 -0.2016539 -0.5516187 -0.9841915 1.353034
         [,85]      [,86]    [,87]      [,88]     [,89]     [,90]      [,91]
[1,] 0.2685276 -0.9133203 1.008072 -0.1151387 0.2364268 0.6596222 -0.7744936
[2,] 0.2685276 -0.9133203 1.008072 -0.1151387 0.2364268 0.6596222 -0.7744936
       [,92]       [,93]      [,94]      [,95]     [,96]    [,97]    [,98]
[1,] 1.81747 -0.08792307 -0.3842064 -0.1422385 -1.413956 1.992495 0.520208
[2,] 1.81747 -0.08792307 -0.3842064 -0.1422385 -1.413956 1.992495 0.520208
          [,99]   [,100]
[1,] -0.4807681 3.064125
[2,] -0.4807681 3.064125
> 
> 
> Max(tmp2)
[1] 3.34371
> Min(tmp2)
[1] -2.369733
> mean(tmp2)
[1] 0.03493987
> Sum(tmp2)
[1] 3.493987
> Var(tmp2)
[1] 1.265055
> 
> rowMeans(tmp2)
  [1]  0.410792985 -2.153846840 -1.415684591  0.526182404 -0.543262664
  [6] -0.792437357  0.437411703  3.343710216 -0.195913093 -0.359515083
 [11] -0.086045631  1.703589222 -1.576934242 -0.201884776  0.255220180
 [16] -1.630835204  0.675888083  0.426084725  0.267432721 -0.525657872
 [21] -0.739704964  1.091036067 -0.084098129 -0.670670634  1.239637546
 [26]  0.918580536  1.144538612 -1.125866472 -1.754546586 -1.606577141
 [31] -0.090624863  1.197082094 -0.692206403 -1.194649838 -0.135869866
 [36] -1.480184965 -1.127152580 -1.048190581  0.562835580  1.997801921
 [41]  0.523249274  0.547796949  0.662918347  0.893916618  0.536044859
 [46]  0.845193320 -1.081163319  0.491222837 -0.933549777  0.799380014
 [51]  1.152741432 -1.154025681  0.939426329 -0.868930852  1.336213613
 [56]  0.303793578  0.235776569 -0.235477356 -1.010985650  1.453829387
 [61] -1.263845531 -0.329559492  0.008326412  0.766652177 -0.939498702
 [66] -0.248471024  0.249056891 -0.287425021  1.178579954 -0.942099900
 [71] -0.184001504 -0.701946668 -0.596726404  1.055712123  0.923502651
 [76]  0.941705571  1.782316304 -2.369732667  1.865859604  2.342727895
 [81]  1.714976430 -0.869294576 -0.407495027 -1.798433318 -0.278218082
 [86] -1.585070083  1.690652600  0.079453540 -1.086018314  1.723596217
 [91] -0.646549419 -0.248195058 -1.794675847 -0.654814152  1.226616297
 [96] -0.449596997  0.542609047  2.471687563 -0.306606602  0.515395645
> rowSums(tmp2)
  [1]  0.410792985 -2.153846840 -1.415684591  0.526182404 -0.543262664
  [6] -0.792437357  0.437411703  3.343710216 -0.195913093 -0.359515083
 [11] -0.086045631  1.703589222 -1.576934242 -0.201884776  0.255220180
 [16] -1.630835204  0.675888083  0.426084725  0.267432721 -0.525657872
 [21] -0.739704964  1.091036067 -0.084098129 -0.670670634  1.239637546
 [26]  0.918580536  1.144538612 -1.125866472 -1.754546586 -1.606577141
 [31] -0.090624863  1.197082094 -0.692206403 -1.194649838 -0.135869866
 [36] -1.480184965 -1.127152580 -1.048190581  0.562835580  1.997801921
 [41]  0.523249274  0.547796949  0.662918347  0.893916618  0.536044859
 [46]  0.845193320 -1.081163319  0.491222837 -0.933549777  0.799380014
 [51]  1.152741432 -1.154025681  0.939426329 -0.868930852  1.336213613
 [56]  0.303793578  0.235776569 -0.235477356 -1.010985650  1.453829387
 [61] -1.263845531 -0.329559492  0.008326412  0.766652177 -0.939498702
 [66] -0.248471024  0.249056891 -0.287425021  1.178579954 -0.942099900
 [71] -0.184001504 -0.701946668 -0.596726404  1.055712123  0.923502651
 [76]  0.941705571  1.782316304 -2.369732667  1.865859604  2.342727895
 [81]  1.714976430 -0.869294576 -0.407495027 -1.798433318 -0.278218082
 [86] -1.585070083  1.690652600  0.079453540 -1.086018314  1.723596217
 [91] -0.646549419 -0.248195058 -1.794675847 -0.654814152  1.226616297
 [96] -0.449596997  0.542609047  2.471687563 -0.306606602  0.515395645
> 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.410792985 -2.153846840 -1.415684591  0.526182404 -0.543262664
  [6] -0.792437357  0.437411703  3.343710216 -0.195913093 -0.359515083
 [11] -0.086045631  1.703589222 -1.576934242 -0.201884776  0.255220180
 [16] -1.630835204  0.675888083  0.426084725  0.267432721 -0.525657872
 [21] -0.739704964  1.091036067 -0.084098129 -0.670670634  1.239637546
 [26]  0.918580536  1.144538612 -1.125866472 -1.754546586 -1.606577141
 [31] -0.090624863  1.197082094 -0.692206403 -1.194649838 -0.135869866
 [36] -1.480184965 -1.127152580 -1.048190581  0.562835580  1.997801921
 [41]  0.523249274  0.547796949  0.662918347  0.893916618  0.536044859
 [46]  0.845193320 -1.081163319  0.491222837 -0.933549777  0.799380014
 [51]  1.152741432 -1.154025681  0.939426329 -0.868930852  1.336213613
 [56]  0.303793578  0.235776569 -0.235477356 -1.010985650  1.453829387
 [61] -1.263845531 -0.329559492  0.008326412  0.766652177 -0.939498702
 [66] -0.248471024  0.249056891 -0.287425021  1.178579954 -0.942099900
 [71] -0.184001504 -0.701946668 -0.596726404  1.055712123  0.923502651
 [76]  0.941705571  1.782316304 -2.369732667  1.865859604  2.342727895
 [81]  1.714976430 -0.869294576 -0.407495027 -1.798433318 -0.278218082
 [86] -1.585070083  1.690652600  0.079453540 -1.086018314  1.723596217
 [91] -0.646549419 -0.248195058 -1.794675847 -0.654814152  1.226616297
 [96] -0.449596997  0.542609047  2.471687563 -0.306606602  0.515395645
> rowMin(tmp2)
  [1]  0.410792985 -2.153846840 -1.415684591  0.526182404 -0.543262664
  [6] -0.792437357  0.437411703  3.343710216 -0.195913093 -0.359515083
 [11] -0.086045631  1.703589222 -1.576934242 -0.201884776  0.255220180
 [16] -1.630835204  0.675888083  0.426084725  0.267432721 -0.525657872
 [21] -0.739704964  1.091036067 -0.084098129 -0.670670634  1.239637546
 [26]  0.918580536  1.144538612 -1.125866472 -1.754546586 -1.606577141
 [31] -0.090624863  1.197082094 -0.692206403 -1.194649838 -0.135869866
 [36] -1.480184965 -1.127152580 -1.048190581  0.562835580  1.997801921
 [41]  0.523249274  0.547796949  0.662918347  0.893916618  0.536044859
 [46]  0.845193320 -1.081163319  0.491222837 -0.933549777  0.799380014
 [51]  1.152741432 -1.154025681  0.939426329 -0.868930852  1.336213613
 [56]  0.303793578  0.235776569 -0.235477356 -1.010985650  1.453829387
 [61] -1.263845531 -0.329559492  0.008326412  0.766652177 -0.939498702
 [66] -0.248471024  0.249056891 -0.287425021  1.178579954 -0.942099900
 [71] -0.184001504 -0.701946668 -0.596726404  1.055712123  0.923502651
 [76]  0.941705571  1.782316304 -2.369732667  1.865859604  2.342727895
 [81]  1.714976430 -0.869294576 -0.407495027 -1.798433318 -0.278218082
 [86] -1.585070083  1.690652600  0.079453540 -1.086018314  1.723596217
 [91] -0.646549419 -0.248195058 -1.794675847 -0.654814152  1.226616297
 [96] -0.449596997  0.542609047  2.471687563 -0.306606602  0.515395645
> 
> colMeans(tmp2)
[1] 0.03493987
> colSums(tmp2)
[1] 3.493987
> colVars(tmp2)
[1] 1.265055
> colSd(tmp2)
[1] 1.124747
> colMax(tmp2)
[1] 3.34371
> colMin(tmp2)
[1] -2.369733
> colMedians(tmp2)
[1] -0.08833525
> colRanges(tmp2)
          [,1]
[1,] -2.369733
[2,]  3.343710
> 
> 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.90321421  0.55303553  0.06006065 -1.06019711 -5.39864799  2.79206532
 [7] -1.18518736  0.23661419 -2.35643615  2.70233553
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -1.7167334
[2,] -1.0534373
[3,]  0.8792834
[4,]  1.3291471
[5,]  1.7011647
> 
> rowApply(tmp,sum)
 [1] -1.2381110 -5.5693007 -2.9784271 -0.8762896  0.3555279 -0.9584894
 [7] -1.3440903  3.8404704  0.3295105  7.6860560
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    7    9    5   10    1    8    1    8    2    10
 [2,]    3    2    2    7    9    7    9    9    8     1
 [3,]    9    7   10    6    2    6    5    6    3     5
 [4,]    5    8    1    5    5    9    6    2   10     3
 [5,]    2    1    9    1    7    4    4    7    4     2
 [6,]   10    3    4    2    6    3   10   10    7     9
 [7,]    8    4    6    4    8    1    2    3    9     6
 [8,]    6    5    7    3    4   10    3    1    6     4
 [9,]    1    6    3    8   10    2    7    5    1     7
[10,]    4   10    8    9    3    5    8    4    5     8
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1]  1.93786167  0.58142053 -2.45967161  1.38496570  0.68133885  2.49492138
 [7] -1.26311561 -1.71204733 -0.52832135  0.15518655 -1.73842638  2.72361029
[13] -3.38823289 -3.17165855  0.56217343 -1.27939838 -0.12080541 -0.02592554
[19] -0.58521916 -2.81928293
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -2.0646992
[2,] -0.3016661
[3,]  0.4541736
[4,]  1.8224167
[5,]  2.0276366
> 
> rowApply(tmp,sum)
[1] -3.5380147 -1.7091627 -1.6865197  0.5114004 -2.1483299
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]    1   14   20   20   10
[2,]    4    8   19   19    2
[3,]    7    5    9    2   17
[4,]   10   20   15    8   12
[5,]   19    2    2   18   20
> 
> 
> as.matrix(tmp)
           [,1]       [,2]       [,3]        [,4]      [,5]       [,6]
[1,] -2.0646992 -0.7608957 -0.6994668 -0.38585838  1.082993  1.0766126
[2,]  0.4541736 -0.6740044 -0.8454214  1.71576153 -1.552189  1.0226274
[3,]  1.8224167  1.5899824 -0.1527516  0.50530934 -1.787763  0.7382908
[4,]  2.0276366  1.7338780 -1.4811895 -0.36392551  1.261534  0.5675898
[5,] -0.3016661 -1.3075399  0.7191577 -0.08632128  1.676765 -0.9101992
            [,7]       [,8]        [,9]      [,10]      [,11]      [,12]
[1,]  0.04276579 -0.2100720 -0.75144151 -0.5460099 -0.7459752  1.4331318
[2,] -0.75961033  1.2337037 -0.16520806  0.1322438 -0.5374323  1.5645035
[3,]  0.06726766 -1.9516974  0.27159962 -0.1311848 -0.9353069 -0.6084106
[4,]  0.99056937 -0.6801857 -0.03711302  1.1050809  0.8548630 -0.4742824
[5,] -1.60410809 -0.1037959  0.15384162 -0.4049434 -0.3745751  0.8086679
          [,13]       [,14]       [,15]      [,16]      [,17]      [,18]
[1,] -0.2974664 -0.81949384  0.34980099 -1.4965303 -0.6747923  0.6999523
[2,] -0.4804403 -1.42320191 -0.73350973  0.5419469  1.6512281 -1.6246455
[3,]  0.2944268 -1.19806499  0.79796211  0.4671166 -1.0232571  0.6438106
[4,] -2.4832893 -0.03022116 -0.09477449 -0.1806814 -1.4009056  0.8201742
[5,] -0.4214636  0.29932334  0.24269456 -0.6112502  1.3269215 -0.5652171
          [,19]      [,20]
[1,]  0.7561818  0.4732490
[2,] -0.8949314 -0.3347568
[3,] -0.4044117 -0.6918541
[4,] -0.5377183 -1.0856391
[5,]  0.4956605 -1.1802820
> 
> 
> is.BufferedMatrix(tmp)
[1] TRUE
> 
> as.BufferedMatrix(as.matrix(tmp))
BufferedMatrix object
Matrix size:  5 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  800  bytes.
> 
> 
> 
> subBufferedMatrix(tmp,1:5,1:5)
BufferedMatrix object
Matrix size:  5 5 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  653  bytes.
Disk usage :  200  bytes.
> subBufferedMatrix(tmp,,5:8)
BufferedMatrix object
Matrix size:  5 4 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  566  bytes.
Disk usage :  160  bytes.
> subBufferedMatrix(tmp,1:3,)
BufferedMatrix object
Matrix size:  3 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  480  bytes.
> 
> 
> rm(tmp)
> 
> 
> ###
> ### Testing colnames and rownames
> ###
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> 
> 
> colnames(tmp)
NULL
> rownames(tmp)
NULL
> 
> 
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> colnames(tmp)
 [1] "col1"  "col2"  "col3"  "col4"  "col5"  "col6"  "col7"  "col8"  "col9" 
[10] "col10" "col11" "col12" "col13" "col14" "col15" "col16" "col17" "col18"
[19] "col19" "col20"
> rownames(tmp)
[1] "row1" "row2" "row3" "row4" "row5"
> 
> 
> tmp["row1",]
          col1       col2      col3      col4     col5      col6       col7
row1 -1.413345 0.02311463 0.1743926 -1.175193 1.983735 -1.147002 -0.7007807
        col8      col9     col10    col11     col12      col13     col14
row1 1.44153 0.4292802 -1.245339 -1.17327 0.3114464 -0.5942393 0.3088296
          col15      col16     col17     col18    col19     col20
row1 -0.6830937 0.09315442 0.5962796 -1.219265 1.540194 0.4240831
> tmp[,"col10"]
          col10
row1 -1.2453388
row2 -0.5908774
row3 -1.6223807
row4  1.8856123
row5 -0.2328131
> tmp[c("row1","row5"),]
          col1        col2      col3      col4       col5       col6       col7
row1 -1.413345  0.02311463 0.1743926 -1.175193 1.98373489 -1.1470015 -0.7007807
row5 -1.740906 -1.67001623 0.8982302 -1.722991 0.07207801  0.9330117  1.4701277
            col8       col9      col10      col11     col12      col13
row1  1.44152961  0.4292802 -1.2453388 -1.1732696 0.3114464 -0.5942393
row5 -0.09898201 -0.7352398 -0.2328131  0.7286445 1.1901583  0.4670793
         col14      col15      col16      col17     col18     col19     col20
row1 0.3088296 -0.6830937 0.09315442  0.5962796 -1.219265 1.5401938 0.4240831
row5 0.2051780 -0.4823789 0.79803341 -1.3130856 -2.348589 0.2832766 0.8478910
> tmp[,c("col6","col20")]
           col6       col20
row1 -1.1470015 0.424083141
row2  0.7020283 0.067518248
row3 -0.2599374 0.004306276
row4 -1.4678238 0.176667690
row5  0.9330117 0.847890991
> tmp[c("row1","row5"),c("col6","col20")]
           col6     col20
row1 -1.1470015 0.4240831
row5  0.9330117 0.8478910
> 
> 
> 
> 
> tmp["row1",] <- rnorm(20,mean=10)
> tmp[,"col10"] <- rnorm(5,mean=30)
> tmp[c("row1","row5"),] <- rnorm(40,mean=50)
> tmp[,c("col6","col20")] <- rnorm(10,mean=75)
> tmp[c("row1","row5"),c("col6","col20")]  <- rnorm(4,mean=105)
> 
> tmp["row1",]
         col1    col2     col3     col4     col5     col6    col7     col8
row1 49.95161 50.7647 49.68179 50.74509 49.03538 105.1785 52.3057 49.02319
         col9    col10    col11    col12    col13    col14    col15    col16
row1 50.25734 51.52828 48.81017 49.85032 49.08245 51.51225 50.08628 49.46157
       col17    col18    col19    col20
row1 49.7203 49.47482 51.53559 105.1965
> tmp[,"col10"]
        col10
row1 51.52828
row2 29.60878
row3 30.50173
row4 30.40431
row5 47.76530
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 49.95161 50.76470 49.68179 50.74509 49.03538 105.1785 52.30570 49.02319
row5 48.77405 49.32431 52.86860 50.77981 48.61784 104.5356 51.10892 52.51679
         col9    col10    col11    col12    col13    col14    col15    col16
row1 50.25734 51.52828 48.81017 49.85032 49.08245 51.51225 50.08628 49.46157
row5 49.76073 47.76530 50.36718 52.58340 48.91893 51.88500 49.16797 49.44978
        col17    col18    col19    col20
row1 49.72030 49.47482 51.53559 105.1965
row5 50.60567 51.55164 50.96913 107.0549
> tmp[,c("col6","col20")]
          col6     col20
row1 105.17854 105.19650
row2  74.65128  74.97299
row3  74.77154  73.58922
row4  75.08179  74.62717
row5 104.53564 107.05488
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 105.1785 105.1965
row5 104.5356 107.0549
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 105.1785 105.1965
row5 104.5356 107.0549
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
          col13
[1,]  1.5654465
[2,]  0.6456950
[3,] -1.0562163
[4,] -0.4665957
[5,]  0.1046191
> tmp[,c("col17","col7")]
           col17       col7
[1,] -0.12230494 -0.1224298
[2,]  0.09225485  0.5213340
[3,] -0.79793146 -0.7775219
[4,]  1.29192061 -0.9801348
[5,]  1.00898875 -0.5244977
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
           col6       col20
[1,] -0.1157619 -1.24064032
[2,] -0.7080717 -0.09646693
[3,]  1.8410540  1.43552380
[4,] -0.1552134  0.34983154
[5,] -0.6983913 -0.69886084
> subBufferedMatrix(tmp,1,c("col6"))[,1]
           col1
[1,] -0.1157619
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
           col6
[1,] -0.1157619
[2,] -0.7080717
> 
> 
> 
> 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 -1.488061  1.694429 1.7849434  0.1092851 -0.397498 -0.1630881  1.1919036
row1 -0.568061 -1.064023 0.3170222 -0.2671569  1.562688 -0.5493752 -0.3035737
           [,8]       [,9]      [,10]      [,11]      [,12]     [,13]
row3  0.7896128 -0.4644234 -0.7339697  1.9988340 0.03655601 0.7295929
row1 -1.0801015 -0.6179196 -1.5085749 -0.8784836 0.40129735 0.1354333
          [,14]      [,15]      [,16]     [,17]     [,18]     [,19]      [,20]
row3  0.3166851 -1.5371878 -2.7391087 0.9280158 0.1308433 0.1658024  0.0915611
row1 -0.7523492  0.3777399 -0.1469046 0.4776341 1.6784185 0.4922835 -0.5847796
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
          [,1]        [,2]       [,3]      [,4]       [,5]      [,6]     [,7]
row2 -1.260869 -0.01683949 0.06803107 -1.974525 -0.2879341 0.6226623 2.356096
           [,8]      [,9]     [,10]
row2 -0.8297427 0.2981178 -0.832717
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
         [,1]       [,2]      [,3]     [,4]      [,5]      [,6]       [,7]
row5 1.601227 -0.1079251 0.7140358 -1.36717 0.1254525 0.3167442 -0.2173431
            [,8]     [,9]      [,10]      [,11]      [,12]      [,13]
row5 -0.07945149 1.159802 -0.6485197 -0.2818446 -0.8464632 -0.1269034
          [,14]     [,15]     [,16]      [,17]     [,18]    [,19]      [,20]
row5 -0.5163808 0.2020084 -2.222944 -0.1113588 -1.028228 1.045396 -0.9600002
> 
> 
> 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: 0x5c02470bf600>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "/home/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM311a493c4b58c8"
 [2] "/home/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM311a497d02e45c"
 [3] "/home/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM311a492ea221b3"
 [4] "/home/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM311a4926b11721"
 [5] "/home/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM311a4979070142"
 [6] "/home/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM311a4936e38bce"
 [7] "/home/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM311a4946fb878a"
 [8] "/home/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM311a492f9e13dd"
 [9] "/home/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM311a492a054f7d"
[10] "/home/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM311a492d62324d"
[11] "/home/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM311a495537c264"
[12] "/home/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM311a493de8d49a"
[13] "/home/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM311a495bd2cffe"
[14] "/home/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM311a4964402dc3"
[15] "/home/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM311a492a5e56ad"
> 
> 
> ### 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: 0x5c0246db8f10>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x5c0246db8f10>
Warning message:
In dir.create(new.directory) :
  '/home/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x5c0246db8f10>
> rowMedians(tmp)
  [1] -0.201418194  0.072130948 -0.105640905  0.118084681  0.007030350
  [6] -0.329598568 -0.141266232 -0.068921137 -0.269325185 -0.143522402
 [11] -0.547567892 -0.028455285 -0.278396285 -0.483191351 -0.225337392
 [16]  0.050322275  0.440453209 -0.830050037  0.186367112 -0.233167482
 [21]  0.271246313  0.088348160 -0.167525751  0.351710276 -0.483930125
 [26]  0.173518726 -0.226072617  0.126557879  0.893203031 -0.134595262
 [31]  0.514404945 -0.104965926  0.269525317 -0.117016217 -0.257163921
 [36] -0.383627315  0.561164037 -0.389826931 -0.231952654 -0.417676631
 [41]  0.244425978 -0.293363513  0.022680077 -0.029248025 -0.255727565
 [46]  0.078110261 -0.037924268 -0.335215466 -0.355871389 -0.045102519
 [51] -0.553454328 -0.388268605 -0.158103498  0.295935769 -0.343002872
 [56] -0.156962072 -0.293615122 -0.174967269 -0.154846926  0.087979874
 [61] -0.587161517  0.244843001 -0.107156205  0.039711272 -0.138358305
 [66]  0.092544906  0.183390955  0.037703694 -0.057776366 -0.125867224
 [71] -0.170248512 -0.006974548 -0.760326621  0.208226944 -0.012328904
 [76]  0.120980352  0.111007146  0.664495662  0.256448483 -0.566084017
 [81] -0.313248733  0.270467493 -0.003354828 -0.428131278  0.075264357
 [86]  0.197064449 -0.061641457 -0.205153223  0.638373032  0.465839532
 [91]  0.054096042  0.285156150  0.276012022  0.430328250  0.045398008
 [96]  0.153524238  0.045881942 -0.047562707 -0.195446168  0.374987152
[101] -0.050092621  0.140284526 -0.062195752 -0.160281924 -0.544054369
[106] -0.023808544 -0.636792875  0.331341065 -0.243014146  0.252771510
[111]  0.649189327  0.022086201 -0.461091662  0.343432033  0.252872295
[116] -0.450195334  0.633141014  0.223868906  0.364242835 -0.380040356
[121]  0.370519370  0.722900592 -0.141685379  0.201008358 -0.315965291
[126]  0.230392761  0.283905085  0.074488978  0.030206138 -0.359845259
[131]  0.013831497  0.007688149  0.398611787 -0.062996145 -0.111426221
[136] -0.150125180 -0.027977918  0.531877575  0.411282072  0.146803268
[141]  0.072323775  0.097609256 -0.147880826 -0.000902812  0.042861619
[146] -0.022191403  0.020135452  0.195247321  0.037779120  0.352726172
[151] -0.308588084  0.421468256  0.092761880  0.089939438 -0.270774298
[156] -0.045936150 -0.370364021  0.058734056 -0.195795579  0.286235627
[161]  0.155367052 -0.052362505 -0.539481096  0.543548419  0.200425029
[166]  0.172895035 -0.224901908 -0.077367224 -0.323598753  0.077083951
[171] -0.678268052  0.279048302  0.027205013  0.510310172 -0.114314988
[176]  0.052196206 -0.032551925 -0.148916979 -0.497293524 -0.514544625
[181] -0.046175527  0.235700576  0.657157308 -0.259485027  0.028588112
[186] -0.086792703  0.055634021 -0.108013929 -0.306736830 -0.119060280
[191]  0.482470593 -0.226180619 -0.451501968 -0.317777118 -0.033624514
[196] -0.111552571  0.165330401 -0.082853319 -0.223521262  0.295938338
[201]  0.251518313 -0.167511507 -0.266612296 -0.259026248 -0.301291857
[206]  0.164408265 -0.048031253 -0.474919757 -0.246266325 -0.290783064
[211]  0.238694598 -0.415974607  0.029761686  0.094852201 -0.147544311
[216]  0.247327731  0.368626016  0.623628976 -0.377312571 -0.143422187
[221] -0.056358661  0.085617770 -0.579398723 -0.501149143 -0.051205557
[226]  0.271579940  0.167288078 -0.011954844  0.199211278  0.127031004
> 
> proc.time()
   user  system elapsed 
  1.261   0.652   1.902 

BufferedMatrix.Rcheck/tests/rawCalltesting.Rout


R version 4.4.2 (2024-10-31) -- "Pile of Leaves"
Copyright (C) 2024 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(BufferedMatrix);library.dynam("BufferedMatrix","BufferedMatrix", .libPaths());

Attaching package: 'BufferedMatrix'

The following objects are masked from 'package:base':

    colMeans, colSums, rowMeans, rowSums

> 
> prefix <- "dbmtest"
> directory <- getwd()
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_Test_C",P)
RBufferedMatrix
Checking dimensions
Rows: 5
Cols: 5
Buffer Rows: 1
Buffer Cols: 1

Assigning Values
0.000000 1.000000 2.000000 3.000000 4.000000 
1.000000 2.000000 3.000000 4.000000 5.000000 
2.000000 3.000000 4.000000 5.000000 6.000000 
3.000000 4.000000 5.000000 6.000000 7.000000 
4.000000 5.000000 6.000000 7.000000 8.000000 

<pointer: 0x5826aa7262a0>
> .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: 0x5826aa7262a0>
> .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: 0x5826aa7262a0>
> .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: 0x5826aa7262a0>
> 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: 0x5826a9d9d920>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5826a9d9d920>
> .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: 0x5826a9d9d920>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5826a9d9d920>
> .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: 0x5826a9d9d920>
> 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: 0x5826aa72bd80>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5826aa72bd80>
> .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: 0x5826aa72bd80>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x5826aa72bd80>
> .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: 0x5826aa72bd80>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x5826aa72bd80>
> .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: 0x5826aa72bd80>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x5826aa72bd80>
> .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: 0x5826aa72bd80>
> 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: 0x5826aa72f0b0>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x5826aa72f0b0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5826aa72f0b0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5826aa72f0b0>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile311b1515abfac0" "BufferedMatrixFile311b155b0f259c"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile311b1515abfac0" "BufferedMatrixFile311b155b0f259c"
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x5826aa8871d0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5826aa8871d0>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x5826aa8871d0>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x5826aa8871d0>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x5826aa8871d0>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x5826aa8871d0>
> .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: 0x5826a94a4ba0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5826a94a4ba0>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x5826a94a4ba0>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x5826a94a4ba0>
> 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: 0x5826a956a180>
> .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: 0x5826a956a180>
> rm(P)
> 
> proc.time()
   user  system elapsed 
  0.241   0.046   0.275 

BufferedMatrix.Rcheck/tests/Rcodetesting.Rout


R version 4.4.2 (2024-10-31) -- "Pile of Leaves"
Copyright (C) 2024 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(BufferedMatrix);library.dynam("BufferedMatrix","BufferedMatrix", .libPaths());

Attaching package: 'BufferedMatrix'

The following objects are masked from 'package:base':

    colMeans, colSums, rowMeans, rowSums

> 
> Temp <- createBufferedMatrix(100)
> dim(Temp)
[1] 100   0
> buffer.dim(Temp)
[1] 1 1
> 
> 
> proc.time()
   user  system elapsed 
  0.230   0.039   0.257 

Example timings