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

This page was generated on 2024-04-17 11:35:49 -0400 (Wed, 17 Apr 2024).

HostnameOSArch (*)R versionInstalled pkgs
nebbiolo2Linux (Ubuntu 22.04.3 LTS)x86_644.3.3 (2024-02-29) -- "Angel Food Cake" 4676
palomino4Windows Server 2022 Datacenterx644.3.3 (2024-02-29 ucrt) -- "Angel Food Cake" 4414
merida1macOS 12.7.1 Montereyx86_644.3.3 (2024-02-29) -- "Angel Food Cake" 4437
Click on any hostname to see more info about the system (e.g. compilers)      (*) as reported by 'uname -p', except on Windows and Mac OS X

Package 246/2266HostnameOS / ArchINSTALLBUILDCHECKBUILD BIN
BufferedMatrix 1.66.0  (landing page)
Ben Bolstad
Snapshot Date: 2024-04-15 14:05:01 -0400 (Mon, 15 Apr 2024)
git_url: https://git.bioconductor.org/packages/BufferedMatrix
git_branch: RELEASE_3_18
git_last_commit: 1feca44
git_last_commit_date: 2023-10-24 09:37:50 -0400 (Tue, 24 Oct 2023)
nebbiolo2Linux (Ubuntu 22.04.3 LTS) / x86_64  OK    OK    OK  UNNEEDED, same version is already published
palomino4Windows Server 2022 Datacenter / x64  OK    OK    OK    OK  UNNEEDED, same version is already published
merida1macOS 12.7.1 Monterey / x86_64  OK    OK    WARNINGS    OK  UNNEEDED, same version is already published
kjohnson1macOS 13.6.1 Ventura / arm64see weekly results here

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.66.0
Command: /home/biocbuild/bbs-3.18-bioc/R/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/home/biocbuild/bbs-3.18-bioc/R/site-library --timings BufferedMatrix_1.66.0.tar.gz
StartedAt: 2024-04-15 20:46:23 -0400 (Mon, 15 Apr 2024)
EndedAt: 2024-04-15 20:46:45 -0400 (Mon, 15 Apr 2024)
EllapsedTime: 22.3 seconds
RetCode: 0
Status:   OK  
CheckDir: BufferedMatrix.Rcheck
Warnings: 0

Command output

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


* using log directory ‘/home/biocbuild/bbs-3.18-bioc/meat/BufferedMatrix.Rcheck’
* using R version 4.3.3 (2024-02-29)
* using platform: x86_64-pc-linux-gnu (64-bit)
* R was compiled by
    gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0
    GNU Fortran (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0
* running under: Ubuntu 22.04.4 LTS
* using session charset: UTF-8
* checking for file ‘BufferedMatrix/DESCRIPTION’ ... OK
* this is package ‘BufferedMatrix’ version ‘1.66.0’
* checking package namespace information ... OK
* checking package dependencies ... OK
* checking if this is a source package ... OK
* checking if there is a namespace ... OK
* checking for hidden files and directories ... OK
* checking for portable file names ... OK
* checking for sufficient/correct file permissions ... OK
* checking whether package ‘BufferedMatrix’ can be installed ... OK
* used C compiler: ‘gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0’
* checking installed package size ... OK
* checking package directory ... OK
* checking ‘build’ directory ... OK
* checking DESCRIPTION meta-information ... OK
* checking top-level files ... OK
* checking for left-over files ... OK
* checking index information ... OK
* checking package subdirectories ... OK
* checking R files for non-ASCII characters ... OK
* checking R files for syntax errors ... OK
* checking whether the package can be loaded ... OK
* checking whether the package can be loaded with stated dependencies ... OK
* checking whether the package can be unloaded cleanly ... OK
* checking whether the namespace can be loaded with stated dependencies ... OK
* checking whether the namespace can be unloaded cleanly ... OK
* checking loading without being on the library search path ... OK
* checking dependencies in R code ... OK
* checking S3 generic/method consistency ... OK
* checking replacement functions ... OK
* checking foreign function calls ... OK
* checking R code for possible problems ... OK
* checking Rd files ... NOTE
prepare_Rd: createBufferedMatrix.Rd:26: Dropping empty section \keyword
prepare_Rd: createBufferedMatrix.Rd:17-18: Dropping empty section \details
prepare_Rd: createBufferedMatrix.Rd:15-16: Dropping empty section \value
prepare_Rd: createBufferedMatrix.Rd:19-20: Dropping empty section \references
prepare_Rd: createBufferedMatrix.Rd:21-22: Dropping empty section \seealso
prepare_Rd: createBufferedMatrix.Rd:23-24: Dropping empty section \examples
* checking Rd metadata ... OK
* checking Rd cross-references ... OK
* checking for missing documentation entries ... OK
* checking for code/documentation mismatches ... OK
* checking Rd \usage sections ... OK
* checking Rd contents ... OK
* checking for unstated dependencies in examples ... OK
* checking line endings in C/C++/Fortran sources/headers ... OK
* checking compiled code ... NOTE
Note: information on .o files is not available
* checking files in ‘vignettes’ ... OK
* checking examples ... NONE
* checking for unstated dependencies in ‘tests’ ... OK
* checking tests ...
  Running ‘Rcodetesting.R’
  Running ‘c_code_level_tests.R’
  Running ‘objectTesting.R’
  Running ‘rawCalltesting.R’
 OK
* checking for unstated dependencies in vignettes ... OK
* checking package vignettes in ‘inst/doc’ ... OK
* checking running R code from vignettes ...
  ‘BufferedMatrix.Rnw’... OK
 OK
* checking re-building of vignette outputs ... OK
* checking PDF version of manual ... OK
* DONE

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



Installation output

BufferedMatrix.Rcheck/00install.out

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


* installing to library ‘/home/biocbuild/bbs-3.18-bioc/R/site-library’
* installing *source* package ‘BufferedMatrix’ ...
** using staged installation
** libs
using C compiler: ‘gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0’
gcc -I"/home/biocbuild/bbs-3.18-bioc/R/include" -DNDEBUG   -I/usr/local/include    -fpic  -g -O2  -Wall -c RBufferedMatrix.c -o RBufferedMatrix.o
gcc -I"/home/biocbuild/bbs-3.18-bioc/R/include" -DNDEBUG   -I/usr/local/include    -fpic  -g -O2  -Wall -c doubleBufferedMatrix.c -o doubleBufferedMatrix.o
doubleBufferedMatrix.c: In function ‘dbm_ReadOnlyMode’:
doubleBufferedMatrix.c:1580:7: warning: suggest parentheses around operand of ‘!’ or change ‘&’ to ‘&&’ or ‘!’ to ‘~’ [-Wparentheses]
 1580 |   if (!(Matrix->readonly) & setting){
      |       ^~~~~~~~~~~~~~~~~~~
At top level:
doubleBufferedMatrix.c:3327:12: warning: ‘sort_double’ defined but not used [-Wunused-function]
 3327 | static int sort_double(const double *a1,const double *a2){
      |            ^~~~~~~~~~~
gcc -I"/home/biocbuild/bbs-3.18-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.18-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.18-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.18-bioc/R/lib -lR
installing to /home/biocbuild/bbs-3.18-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.3.3 (2024-02-29) -- "Angel Food Cake"
Copyright (C) 2024 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

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

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

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

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

Attaching package: 'BufferedMatrix'

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

    colMeans, colSums, rowMeans, rowSums

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

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

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

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

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

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

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

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

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

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

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

[[1]]
[1] 0

> 
> proc.time()
   user  system elapsed 
  0.231   0.054   0.275 

BufferedMatrix.Rcheck/tests/objectTesting.Rout


R version 4.3.3 (2024-02-29) -- "Angel Food Cake"
Copyright (C) 2024 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

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

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

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

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

Attaching package: 'BufferedMatrix'

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

    colMeans, colSums, rowMeans, rowSums

> 
> 
> ### this is used to control how many repetitions in something below
> ### higher values result in more checks.
> nreps <-100 ##20000
> 
> 
> ## test creation and some simple assignments and subsetting operations
> 
> ## first on single elements
> tmp <- createBufferedMatrix(1000,10)
> 
> tmp[10,5]
[1] 0
> tmp[10,5] <- 10
> tmp[10,5]
[1] 10
> tmp[10,5] <- 12.445
> tmp[10,5]
[1] 12.445
> 
> 
> 
> ## now testing accessing multiple elements
> tmp2 <- createBufferedMatrix(10,20)
> 
> 
> tmp2[3,1] <- 51.34
> tmp2[9,2] <- 9.87654
> tmp2[,1:2]
       [,1]    [,2]
 [1,]  0.00 0.00000
 [2,]  0.00 0.00000
 [3,] 51.34 0.00000
 [4,]  0.00 0.00000
 [5,]  0.00 0.00000
 [6,]  0.00 0.00000
 [7,]  0.00 0.00000
 [8,]  0.00 0.00000
 [9,]  0.00 9.87654
[10,]  0.00 0.00000
> tmp2[,-(3:20)]
       [,1]    [,2]
 [1,]  0.00 0.00000
 [2,]  0.00 0.00000
 [3,] 51.34 0.00000
 [4,]  0.00 0.00000
 [5,]  0.00 0.00000
 [6,]  0.00 0.00000
 [7,]  0.00 0.00000
 [8,]  0.00 0.00000
 [9,]  0.00 9.87654
[10,]  0.00 0.00000
> tmp2[3,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
[1,] 51.34    0    0    0    0    0    0    0    0     0     0     0     0
     [,14] [,15] [,16] [,17] [,18] [,19] [,20]
[1,]     0     0     0     0     0     0     0
> tmp2[-3,]
      [,1]    [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [2,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [3,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [4,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [5,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [6,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [7,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [8,]    0 9.87654    0    0    0    0    0    0    0     0     0     0     0
 [9,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
      [,14] [,15] [,16] [,17] [,18] [,19] [,20]
 [1,]     0     0     0     0     0     0     0
 [2,]     0     0     0     0     0     0     0
 [3,]     0     0     0     0     0     0     0
 [4,]     0     0     0     0     0     0     0
 [5,]     0     0     0     0     0     0     0
 [6,]     0     0     0     0     0     0     0
 [7,]     0     0     0     0     0     0     0
 [8,]     0     0     0     0     0     0     0
 [9,]     0     0     0     0     0     0     0
> tmp2[2,1:3]
     [,1] [,2] [,3]
[1,]    0    0    0
> tmp2[3:9,1:3]
      [,1]    [,2] [,3]
[1,] 51.34 0.00000    0
[2,]  0.00 0.00000    0
[3,]  0.00 0.00000    0
[4,]  0.00 0.00000    0
[5,]  0.00 0.00000    0
[6,]  0.00 0.00000    0
[7,]  0.00 9.87654    0
> tmp2[-4,-4]
       [,1]    [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [2,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [3,] 51.34 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [4,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [5,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [6,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [7,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [8,]  0.00 9.87654    0    0    0    0    0    0    0     0     0     0     0
 [9,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
      [,14] [,15] [,16] [,17] [,18] [,19]
 [1,]     0     0     0     0     0     0
 [2,]     0     0     0     0     0     0
 [3,]     0     0     0     0     0     0
 [4,]     0     0     0     0     0     0
 [5,]     0     0     0     0     0     0
 [6,]     0     0     0     0     0     0
 [7,]     0     0     0     0     0     0
 [8,]     0     0     0     0     0     0
 [9,]     0     0     0     0     0     0
> 
> ## now testing accessing/assigning multiple elements
> tmp3 <- createBufferedMatrix(10,10)
> 
> for (i in 1:10){
+   for (j in 1:10){
+     tmp3[i,j] <- (j-1)*10 + i
+   }
+ }
> 
> tmp3[2:4,2:4]
     [,1] [,2] [,3]
[1,]   12   22   32
[2,]   13   23   33
[3,]   14   24   34
> tmp3[c(-10),c(2:4,2:4,10,1,2,1:10,10:1)]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]   11   21   31   11   21   31   91    1   11     1    11    21    31
 [2,]   12   22   32   12   22   32   92    2   12     2    12    22    32
 [3,]   13   23   33   13   23   33   93    3   13     3    13    23    33
 [4,]   14   24   34   14   24   34   94    4   14     4    14    24    34
 [5,]   15   25   35   15   25   35   95    5   15     5    15    25    35
 [6,]   16   26   36   16   26   36   96    6   16     6    16    26    36
 [7,]   17   27   37   17   27   37   97    7   17     7    17    27    37
 [8,]   18   28   38   18   28   38   98    8   18     8    18    28    38
 [9,]   19   29   39   19   29   39   99    9   19     9    19    29    39
      [,14] [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24] [,25]
 [1,]    41    51    61    71    81    91    91    81    71    61    51    41
 [2,]    42    52    62    72    82    92    92    82    72    62    52    42
 [3,]    43    53    63    73    83    93    93    83    73    63    53    43
 [4,]    44    54    64    74    84    94    94    84    74    64    54    44
 [5,]    45    55    65    75    85    95    95    85    75    65    55    45
 [6,]    46    56    66    76    86    96    96    86    76    66    56    46
 [7,]    47    57    67    77    87    97    97    87    77    67    57    47
 [8,]    48    58    68    78    88    98    98    88    78    68    58    48
 [9,]    49    59    69    79    89    99    99    89    79    69    59    49
      [,26] [,27] [,28] [,29]
 [1,]    31    21    11     1
 [2,]    32    22    12     2
 [3,]    33    23    13     3
 [4,]    34    24    14     4
 [5,]    35    25    15     5
 [6,]    36    26    16     6
 [7,]    37    27    17     7
 [8,]    38    28    18     8
 [9,]    39    29    19     9
> tmp3[-c(1:5),-c(6:10)]
     [,1] [,2] [,3] [,4] [,5]
[1,]    6   16   26   36   46
[2,]    7   17   27   37   47
[3,]    8   18   28   38   48
[4,]    9   19   29   39   49
[5,]   10   20   30   40   50
> 
> ## assignment of whole columns
> tmp3[,1] <- c(1:10*100.0)
> tmp3[,1:2] <- tmp3[,1:2]*100
> tmp3[,1:2] <- tmp3[,2:1]
> tmp3[,1:2]
      [,1]  [,2]
 [1,] 1100 1e+04
 [2,] 1200 2e+04
 [3,] 1300 3e+04
 [4,] 1400 4e+04
 [5,] 1500 5e+04
 [6,] 1600 6e+04
 [7,] 1700 7e+04
 [8,] 1800 8e+04
 [9,] 1900 9e+04
[10,] 2000 1e+05
> 
> 
> tmp3[,-1] <- tmp3[,1:9]
> tmp3[,1:10]
      [,1] [,2]  [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,] 1100 1100 1e+04   21   31   41   51   61   71    81
 [2,] 1200 1200 2e+04   22   32   42   52   62   72    82
 [3,] 1300 1300 3e+04   23   33   43   53   63   73    83
 [4,] 1400 1400 4e+04   24   34   44   54   64   74    84
 [5,] 1500 1500 5e+04   25   35   45   55   65   75    85
 [6,] 1600 1600 6e+04   26   36   46   56   66   76    86
 [7,] 1700 1700 7e+04   27   37   47   57   67   77    87
 [8,] 1800 1800 8e+04   28   38   48   58   68   78    88
 [9,] 1900 1900 9e+04   29   39   49   59   69   79    89
[10,] 2000 2000 1e+05   30   40   50   60   70   80    90
> 
> tmp3[,1:2] <- rep(1,10)
> tmp3[,1:2] <- rep(1,20)
> tmp3[,1:2] <- matrix(c(1:5),1,5)
> 
> tmp3[,-c(1:8)] <- matrix(c(1:5),1,5)
> 
> tmp3[1,] <- 1:10
> tmp3[1,]
     [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,]    1    2    3    4    5    6    7    8    9    10
> tmp3[-1,] <- c(1,2)
> tmp3[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    1    2    3    4    5    6    7    8    9    10
 [2,]    1    2    1    2    1    2    1    2    1     2
 [3,]    2    1    2    1    2    1    2    1    2     1
 [4,]    1    2    1    2    1    2    1    2    1     2
 [5,]    2    1    2    1    2    1    2    1    2     1
 [6,]    1    2    1    2    1    2    1    2    1     2
 [7,]    2    1    2    1    2    1    2    1    2     1
 [8,]    1    2    1    2    1    2    1    2    1     2
 [9,]    2    1    2    1    2    1    2    1    2     1
[10,]    1    2    1    2    1    2    1    2    1     2
> tmp3[-c(1:8),] <- matrix(c(1:5),1,5)
> tmp3[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    1    2    3    4    5    6    7    8    9    10
 [2,]    1    2    1    2    1    2    1    2    1     2
 [3,]    2    1    2    1    2    1    2    1    2     1
 [4,]    1    2    1    2    1    2    1    2    1     2
 [5,]    2    1    2    1    2    1    2    1    2     1
 [6,]    1    2    1    2    1    2    1    2    1     2
 [7,]    2    1    2    1    2    1    2    1    2     1
 [8,]    1    2    1    2    1    2    1    2    1     2
 [9,]    1    3    5    2    4    1    3    5    2     4
[10,]    2    4    1    3    5    2    4    1    3     5
> 
> 
> tmp3[1:2,1:2] <- 5555.04
> tmp3[-(1:2),1:2] <- 1234.56789
> 
> 
> 
> ## testing accessors for the directory and prefix
> directory(tmp3)
[1] "/home/biocbuild/bbs-3.18-bioc/meat/BufferedMatrix.Rcheck/tests"
> prefix(tmp3)
[1] "BM"
> 
> ## testing if we can remove these objects
> rm(tmp, tmp2, tmp3)
> gc()
         used (Mb) gc trigger (Mb) max used (Mb)
Ncells 457988 24.5     983265 52.6   650542 34.8
Vcells 843172  6.5    8388608 64.0  2057435 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] "Mon Apr 15 20:46:37 2024"
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> date()
[1] "Mon Apr 15 20:46:37 2024"
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,which.col] == test.matrix[which.row,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> 
> 
> RowMode(tmp2)
<pointer: 0x55edc40f2010>
> 
> 
> 
> 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] "Mon Apr 15 20:46:37 2024"
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col <- sample(1:20,5,replace=TRUE)
+   if (!all(tmp2[which.row,which.col] == test.matrix[which.row,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> date()
[1] "Mon Apr 15 20:46:38 2024"
> 
> ColMode(tmp2)
<pointer: 0x55edc40f2010>
> 
> 
> 
> ### 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.3461781 -0.2579965 -1.4087720 -0.20131962
[2,]   0.7084476  0.4685277 -0.1133205  1.11565570
[3,]  -0.9791654  0.2520434  1.5342847 -1.86216941
[4,]   1.1482091 -0.2875651  0.5108231  0.02100524
> ewApply(tmp5,abs)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.18-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
            [,1]      [,2]      [,3]       [,4]
[1,] 100.3461781 0.2579965 1.4087720 0.20131962
[2,]   0.7084476 0.4685277 0.1133205 1.11565570
[3,]   0.9791654 0.2520434 1.5342847 1.86216941
[4,]   1.1482091 0.2875651 0.5108231 0.02100524
> ewApply(tmp5,sqrt)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.18-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
           [,1]      [,2]      [,3]      [,4]
[1,] 10.0172940 0.5079336 1.1869170 0.4486865
[2,]  0.8416933 0.6844908 0.3366311 1.0562460
[3,]  0.9895278 0.5020393 1.2386625 1.3646133
[4,]  1.0715452 0.5362510 0.7147189 0.1449318
> 
> my.function <- function(x,power){
+   (x+5)^power
+ }
> 
> ewApply(tmp5,my.function,power=2)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.18-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
          [,1]     [,2]     [,3]     [,4]
[1,] 225.51912 30.33733 38.27794 29.68819
[2,]  34.12538 32.31344 28.47963 36.67812
[3,]  35.87444 30.27244 38.92091 40.50830
[4,]  36.86366 30.65007 32.65801 26.47032
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x55edc44b86a0>
> exp(tmp5)
<pointer: 0x55edc44b86a0>
> log(tmp5,2)
<pointer: 0x55edc44b86a0>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 469.3885
> Min(tmp5)
[1] 54.34079
> mean(tmp5)
[1] 73.79146
> Sum(tmp5)
[1] 14758.29
> Var(tmp5)
[1] 861.0765
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 89.85943 69.69978 72.44661 71.07608 72.41382 72.73607 72.89287 73.52546
 [9] 72.38166 70.88285
> rowSums(tmp5)
 [1] 1797.189 1393.996 1448.932 1421.522 1448.276 1454.721 1457.857 1470.509
 [9] 1447.633 1417.657
> rowVars(tmp5)
 [1] 8038.15207   65.32300   86.57727   75.78116   90.59520   46.74288
 [7]   66.07367   51.02019  111.50633   72.72288
> rowSd(tmp5)
 [1] 89.655742  8.082265  9.304691  8.705238  9.518151  6.836877  8.128571
 [8]  7.142842 10.559656  8.527771
> rowMax(tmp5)
 [1] 469.38850  86.74394  88.76230  84.87879  90.52905  86.65493  88.87357
 [8]  88.96227  96.54761  83.47950
> rowMin(tmp5)
 [1] 57.40275 56.68603 56.53034 55.09451 54.34079 59.91660 56.16933 60.88818
 [9] 54.91377 55.54641
> 
> colMeans(tmp5)
 [1] 113.42699  68.95810  67.30675  70.28668  69.10275  73.26042  75.03478
 [8]  68.39331  76.50259  70.51377  74.93785  71.56360  71.99496  73.53021
[15]  70.25026  66.90638  78.83590  70.16002  76.90458  67.95932
> colSums(tmp5)
 [1] 1134.2699  689.5810  673.0675  702.8668  691.0275  732.6042  750.3478
 [8]  683.9331  765.0259  705.1377  749.3785  715.6360  719.9496  735.3021
[15]  702.5026  669.0638  788.3590  701.6002  769.0458  679.5932
> colVars(tmp5)
 [1] 15721.77320    98.75390    81.39763   100.24189    63.61073    63.89291
 [7]    54.72634    66.88229    46.58234    30.95368    67.84664    52.77263
[13]    98.10200    67.64618   102.31458    43.23547    16.46674    77.19541
[19]    49.53041    55.90582
> colSd(tmp5)
 [1] 125.386495   9.937500   9.022063  10.012087   7.975634   7.993304
 [7]   7.397725   8.178159   6.825126   5.563603   8.236907   7.264478
[13]   9.904645   8.224730  10.115067   6.575369   4.057923   8.786092
[19]   7.037784   7.477020
> colMax(tmp5)
 [1] 469.38850  88.96227  81.00877  84.31272  82.85941  85.80995  88.87357
 [8]  81.58150  86.65493  83.47950  87.59103  86.74394  85.88405  84.87879
[15]  88.76230  76.13391  83.65305  90.52905  85.04879  79.32464
> colMin(tmp5)
 [1] 63.34949 56.20740 54.91377 54.34079 58.09227 57.65115 64.44849 57.40275
 [9] 67.65555 63.12080 62.48870 62.30805 56.16933 56.68603 57.44786 56.53034
[17] 71.03181 60.56204 63.91992 55.54641
> 
> 
> ### setting a random element to NA and then testing with na.rm=TRUE or na.rm=FALSE (The default)
> 
> 
> which.row <- sample(1:10,1,replace=TRUE)
> which.col  <- sample(1:20,1,replace=TRUE)
> 
> tmp5[which.row,which.col] <- NA
> 
> Max(tmp5)
[1] NA
> Min(tmp5)
[1] NA
> mean(tmp5)
[1] NA
> Sum(tmp5)
[1] NA
> Var(tmp5)
[1] NA
> 
> rowMeans(tmp5)
 [1] 89.85943 69.69978       NA 71.07608 72.41382 72.73607 72.89287 73.52546
 [9] 72.38166 70.88285
> rowSums(tmp5)
 [1] 1797.189 1393.996       NA 1421.522 1448.276 1454.721 1457.857 1470.509
 [9] 1447.633 1417.657
> rowVars(tmp5)
 [1] 8038.15207   65.32300   90.76578   75.78116   90.59520   46.74288
 [7]   66.07367   51.02019  111.50633   72.72288
> rowSd(tmp5)
 [1] 89.655742  8.082265  9.527108  8.705238  9.518151  6.836877  8.128571
 [8]  7.142842 10.559656  8.527771
> rowMax(tmp5)
 [1] 469.38850  86.74394        NA  84.87879  90.52905  86.65493  88.87357
 [8]  88.96227  96.54761  83.47950
> rowMin(tmp5)
 [1] 57.40275 56.68603       NA 55.09451 54.34079 59.91660 56.16933 60.88818
 [9] 54.91377 55.54641
> 
> colMeans(tmp5)
 [1] 113.42699  68.95810  67.30675  70.28668  69.10275        NA  75.03478
 [8]  68.39331  76.50259  70.51377  74.93785  71.56360  71.99496  73.53021
[15]  70.25026  66.90638  78.83590  70.16002  76.90458  67.95932
> colSums(tmp5)
 [1] 1134.2699  689.5810  673.0675  702.8668  691.0275        NA  750.3478
 [8]  683.9331  765.0259  705.1377  749.3785  715.6360  719.9496  735.3021
[15]  702.5026  669.0638  788.3590  701.6002  769.0458  679.5932
> colVars(tmp5)
 [1] 15721.77320    98.75390    81.39763   100.24189    63.61073          NA
 [7]    54.72634    66.88229    46.58234    30.95368    67.84664    52.77263
[13]    98.10200    67.64618   102.31458    43.23547    16.46674    77.19541
[19]    49.53041    55.90582
> colSd(tmp5)
 [1] 125.386495   9.937500   9.022063  10.012087   7.975634         NA
 [7]   7.397725   8.178159   6.825126   5.563603   8.236907   7.264478
[13]   9.904645   8.224730  10.115067   6.575369   4.057923   8.786092
[19]   7.037784   7.477020
> colMax(tmp5)
 [1] 469.38850  88.96227  81.00877  84.31272  82.85941        NA  88.87357
 [8]  81.58150  86.65493  83.47950  87.59103  86.74394  85.88405  84.87879
[15]  88.76230  76.13391  83.65305  90.52905  85.04879  79.32464
> colMin(tmp5)
 [1] 63.34949 56.20740 54.91377 54.34079 58.09227       NA 64.44849 57.40275
 [9] 67.65555 63.12080 62.48870 62.30805 56.16933 56.68603 57.44786 56.53034
[17] 71.03181 60.56204 63.91992 55.54641
> 
> Max(tmp5,na.rm=TRUE)
[1] 469.3885
> Min(tmp5,na.rm=TRUE)
[1] 54.34079
> mean(tmp5,na.rm=TRUE)
[1] 73.8146
> Sum(tmp5,na.rm=TRUE)
[1] 14689.11
> Var(tmp5,na.rm=TRUE)
[1] 865.3177
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 89.85943 69.69978 72.61816 71.07608 72.41382 72.73607 72.89287 73.52546
 [9] 72.38166 70.88285
> rowSums(tmp5,na.rm=TRUE)
 [1] 1797.189 1393.996 1379.745 1421.522 1448.276 1454.721 1457.857 1470.509
 [9] 1447.633 1417.657
> rowVars(tmp5,na.rm=TRUE)
 [1] 8038.15207   65.32300   90.76578   75.78116   90.59520   46.74288
 [7]   66.07367   51.02019  111.50633   72.72288
> rowSd(tmp5,na.rm=TRUE)
 [1] 89.655742  8.082265  9.527108  8.705238  9.518151  6.836877  8.128571
 [8]  7.142842 10.559656  8.527771
> rowMax(tmp5,na.rm=TRUE)
 [1] 469.38850  86.74394  88.76230  84.87879  90.52905  86.65493  88.87357
 [8]  88.96227  96.54761  83.47950
> rowMin(tmp5,na.rm=TRUE)
 [1] 57.40275 56.68603 56.53034 55.09451 54.34079 59.91660 56.16933 60.88818
 [9] 54.91377 55.54641
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 113.42699  68.95810  67.30675  70.28668  69.10275  73.71302  75.03478
 [8]  68.39331  76.50259  70.51377  74.93785  71.56360  71.99496  73.53021
[15]  70.25026  66.90638  78.83590  70.16002  76.90458  67.95932
> colSums(tmp5,na.rm=TRUE)
 [1] 1134.2699  689.5810  673.0675  702.8668  691.0275  663.4172  750.3478
 [8]  683.9331  765.0259  705.1377  749.3785  715.6360  719.9496  735.3021
[15]  702.5026  669.0638  788.3590  701.6002  769.0458  679.5932
> colVars(tmp5,na.rm=TRUE)
 [1] 15721.77320    98.75390    81.39763   100.24189    63.61073    69.57503
 [7]    54.72634    66.88229    46.58234    30.95368    67.84664    52.77263
[13]    98.10200    67.64618   102.31458    43.23547    16.46674    77.19541
[19]    49.53041    55.90582
> colSd(tmp5,na.rm=TRUE)
 [1] 125.386495   9.937500   9.022063  10.012087   7.975634   8.341165
 [7]   7.397725   8.178159   6.825126   5.563603   8.236907   7.264478
[13]   9.904645   8.224730  10.115067   6.575369   4.057923   8.786092
[19]   7.037784   7.477020
> colMax(tmp5,na.rm=TRUE)
 [1] 469.38850  88.96227  81.00877  84.31272  82.85941  85.80995  88.87357
 [8]  81.58150  86.65493  83.47950  87.59103  86.74394  85.88405  84.87879
[15]  88.76230  76.13391  83.65305  90.52905  85.04879  79.32464
> colMin(tmp5,na.rm=TRUE)
 [1] 63.34949 56.20740 54.91377 54.34079 58.09227 57.65115 64.44849 57.40275
 [9] 67.65555 63.12080 62.48870 62.30805 56.16933 56.68603 57.44786 56.53034
[17] 71.03181 60.56204 63.91992 55.54641
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1] 89.85943 69.69978      NaN 71.07608 72.41382 72.73607 72.89287 73.52546
 [9] 72.38166 70.88285
> rowSums(tmp5,na.rm=TRUE)
 [1] 1797.189 1393.996    0.000 1421.522 1448.276 1454.721 1457.857 1470.509
 [9] 1447.633 1417.657
> rowVars(tmp5,na.rm=TRUE)
 [1] 8038.15207   65.32300         NA   75.78116   90.59520   46.74288
 [7]   66.07367   51.02019  111.50633   72.72288
> rowSd(tmp5,na.rm=TRUE)
 [1] 89.655742  8.082265        NA  8.705238  9.518151  6.836877  8.128571
 [8]  7.142842 10.559656  8.527771
> rowMax(tmp5,na.rm=TRUE)
 [1] 469.38850  86.74394        NA  84.87879  90.52905  86.65493  88.87357
 [8]  88.96227  96.54761  83.47950
> rowMin(tmp5,na.rm=TRUE)
 [1] 57.40275 56.68603       NA 55.09451 54.34079 59.91660 56.16933 60.88818
 [9] 54.91377 55.54641
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1] 117.73355  69.61921  65.78430  68.72823  68.65907       NaN  74.68299
 [8]  69.16767  75.91953  71.33522  74.01844  72.09677  72.62349  74.36251
[15]  68.19337  68.05927  78.93165  69.16425  77.11608  68.90917
> colSums(tmp5,na.rm=TRUE)
 [1] 1059.6020  626.5729  592.0587  618.5541  617.9316    0.0000  672.1469
 [8]  622.5090  683.2758  642.0169  666.1660  648.8709  653.6115  669.2626
[15]  613.7403  612.5335  710.3849  622.4783  694.0447  620.1826
> colVars(tmp5,na.rm=TRUE)
 [1] 17478.34722   106.18114    65.49657    85.44853    69.34747          NA
 [7]    60.17487    68.49685    48.58055    27.23176    66.81778    56.17117
[13]   105.92043    68.30881    67.50730    33.68682    18.42193    75.68985
[19]    55.21846    52.74397
> colSd(tmp5,na.rm=TRUE)
 [1] 132.205700  10.304423   8.092995   9.243837   8.327513         NA
 [7]   7.757246   8.276282   6.969975   5.218406   8.174215   7.494743
[13]  10.291765   8.264914   8.216283   5.804035   4.292078   8.699991
[19]   7.430912   7.262505
> colMax(tmp5,na.rm=TRUE)
 [1] 469.38850  88.96227  79.67052  79.26275  82.85941      -Inf  88.87357
 [8]  81.58150  86.65493  83.47950  87.59103  86.74394  85.88405  84.87879
[15]  76.94774  76.13391  83.65305  90.52905  85.04879  79.32464
> colMin(tmp5,na.rm=TRUE)
 [1] 63.34949 56.20740 54.91377 54.34079 58.09227      Inf 64.44849 57.40275
 [9] 67.65555 65.63301 62.48870 62.30805 56.16933 56.68603 57.44786 59.91660
[17] 71.03181 60.56204 63.91992 55.54641
> 
> 
> 
> 
> 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] 362.8318 454.1541 233.1669 283.9874 185.8858 289.4368 320.7182 124.1943
 [9] 231.7858 251.9178
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 362.8318 454.1541 233.1669 283.9874 185.8858 289.4368 320.7182 124.1943
 [9] 231.7858 251.9178
> 
> 
> 
> 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 -1.136868e-13 -1.136868e-13  5.684342e-14  0.000000e+00
 [6] -1.989520e-13  1.278977e-13  0.000000e+00 -5.684342e-14  8.526513e-14
[11] -1.136868e-13  0.000000e+00  0.000000e+00  5.684342e-14  8.526513e-14
[16]  1.421085e-14  5.684342e-14 -7.105427e-14 -7.105427e-14 -2.842171e-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)
+ }
3   16 
7   16 
1   18 
7   20 
10   8 
8   13 
6   20 
5   3 
5   7 
10   8 
7   9 
2   4 
5   2 
1   3 
7   19 
7   2 
7   13 
1   13 
5   10 
1   14 
There were 50 or more warnings (use warnings() to see the first 50)
> 
> 
> ### now test 1 by n and n by 1 matrix
> 
> 
> err.tol <- 1e-12
> 
> rm(tmp5)
> 
> dataset1 <- rnorm(100)
> dataset2 <- rnorm(100)
> 
> tmp <- createBufferedMatrix(1,100)
> tmp[1,] <- dataset1
> 
> tmp2 <- createBufferedMatrix(100,1)
> tmp2[,1] <- dataset2
> 
> 
> 
> 
> 
> Max(tmp)
[1] 2.495052
> Min(tmp)
[1] -2.43404
> mean(tmp)
[1] 0.03875809
> Sum(tmp)
[1] 3.875809
> Var(tmp)
[1] 0.9822139
> 
> rowMeans(tmp)
[1] 0.03875809
> rowSums(tmp)
[1] 3.875809
> rowVars(tmp)
[1] 0.9822139
> rowSd(tmp)
[1] 0.991067
> rowMax(tmp)
[1] 2.495052
> rowMin(tmp)
[1] -2.43404
> 
> colMeans(tmp)
  [1] -0.87026885 -0.53187245 -1.64394809 -0.76037477  0.46429842 -1.46613161
  [7]  0.96082115  0.16645147 -0.76294893  0.20062451  1.46855531 -0.08338690
 [13]  1.23755667  0.47398980  0.39188849 -0.33704788  0.92268133 -0.44256493
 [19] -0.64759514  1.34144519  1.89835225  0.22026766 -0.26008122 -1.16325420
 [25]  0.06712221 -0.54671103 -0.34252326  2.00024680  0.02944657  0.21145346
 [31]  1.46176200 -0.33281578 -0.90253553  1.05721482 -0.18923887 -1.53637278
 [37] -0.62525697 -0.02019847  1.07572302  0.03287294  0.29188158  0.25061969
 [43] -2.43403976 -0.24173411  0.91591061 -0.60850148 -1.71561211  1.90279739
 [49] -1.25652886  1.53934503  0.50612014  1.04302389 -0.34435765  1.10406561
 [55]  0.18402334  0.19152214  1.77586140 -0.40426545  0.03593680 -1.03128727
 [61]  1.00956250 -0.77647770 -0.29537489 -0.25623798 -2.12019609  0.32841630
 [67] -1.65221116 -1.65767039  0.37807440 -0.55296802  0.28594554 -0.18587551
 [73]  1.85491106 -0.15076244 -0.46367049  0.20536027 -0.33768072  0.62621065
 [79]  0.09449402 -0.12385797  0.70558482  1.92603770 -0.28498859  1.65032242
 [85]  1.73456023 -1.18692654 -0.97399383 -1.09696565  0.50055655 -0.22685057
 [91]  0.03362763 -0.57141993  0.03968816  0.35140592  0.58049756 -0.66635286
 [97] -0.34515575 -0.94344407  2.49505195  0.02215533
> colSums(tmp)
  [1] -0.87026885 -0.53187245 -1.64394809 -0.76037477  0.46429842 -1.46613161
  [7]  0.96082115  0.16645147 -0.76294893  0.20062451  1.46855531 -0.08338690
 [13]  1.23755667  0.47398980  0.39188849 -0.33704788  0.92268133 -0.44256493
 [19] -0.64759514  1.34144519  1.89835225  0.22026766 -0.26008122 -1.16325420
 [25]  0.06712221 -0.54671103 -0.34252326  2.00024680  0.02944657  0.21145346
 [31]  1.46176200 -0.33281578 -0.90253553  1.05721482 -0.18923887 -1.53637278
 [37] -0.62525697 -0.02019847  1.07572302  0.03287294  0.29188158  0.25061969
 [43] -2.43403976 -0.24173411  0.91591061 -0.60850148 -1.71561211  1.90279739
 [49] -1.25652886  1.53934503  0.50612014  1.04302389 -0.34435765  1.10406561
 [55]  0.18402334  0.19152214  1.77586140 -0.40426545  0.03593680 -1.03128727
 [61]  1.00956250 -0.77647770 -0.29537489 -0.25623798 -2.12019609  0.32841630
 [67] -1.65221116 -1.65767039  0.37807440 -0.55296802  0.28594554 -0.18587551
 [73]  1.85491106 -0.15076244 -0.46367049  0.20536027 -0.33768072  0.62621065
 [79]  0.09449402 -0.12385797  0.70558482  1.92603770 -0.28498859  1.65032242
 [85]  1.73456023 -1.18692654 -0.97399383 -1.09696565  0.50055655 -0.22685057
 [91]  0.03362763 -0.57141993  0.03968816  0.35140592  0.58049756 -0.66635286
 [97] -0.34515575 -0.94344407  2.49505195  0.02215533
> 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.87026885 -0.53187245 -1.64394809 -0.76037477  0.46429842 -1.46613161
  [7]  0.96082115  0.16645147 -0.76294893  0.20062451  1.46855531 -0.08338690
 [13]  1.23755667  0.47398980  0.39188849 -0.33704788  0.92268133 -0.44256493
 [19] -0.64759514  1.34144519  1.89835225  0.22026766 -0.26008122 -1.16325420
 [25]  0.06712221 -0.54671103 -0.34252326  2.00024680  0.02944657  0.21145346
 [31]  1.46176200 -0.33281578 -0.90253553  1.05721482 -0.18923887 -1.53637278
 [37] -0.62525697 -0.02019847  1.07572302  0.03287294  0.29188158  0.25061969
 [43] -2.43403976 -0.24173411  0.91591061 -0.60850148 -1.71561211  1.90279739
 [49] -1.25652886  1.53934503  0.50612014  1.04302389 -0.34435765  1.10406561
 [55]  0.18402334  0.19152214  1.77586140 -0.40426545  0.03593680 -1.03128727
 [61]  1.00956250 -0.77647770 -0.29537489 -0.25623798 -2.12019609  0.32841630
 [67] -1.65221116 -1.65767039  0.37807440 -0.55296802  0.28594554 -0.18587551
 [73]  1.85491106 -0.15076244 -0.46367049  0.20536027 -0.33768072  0.62621065
 [79]  0.09449402 -0.12385797  0.70558482  1.92603770 -0.28498859  1.65032242
 [85]  1.73456023 -1.18692654 -0.97399383 -1.09696565  0.50055655 -0.22685057
 [91]  0.03362763 -0.57141993  0.03968816  0.35140592  0.58049756 -0.66635286
 [97] -0.34515575 -0.94344407  2.49505195  0.02215533
> colMin(tmp)
  [1] -0.87026885 -0.53187245 -1.64394809 -0.76037477  0.46429842 -1.46613161
  [7]  0.96082115  0.16645147 -0.76294893  0.20062451  1.46855531 -0.08338690
 [13]  1.23755667  0.47398980  0.39188849 -0.33704788  0.92268133 -0.44256493
 [19] -0.64759514  1.34144519  1.89835225  0.22026766 -0.26008122 -1.16325420
 [25]  0.06712221 -0.54671103 -0.34252326  2.00024680  0.02944657  0.21145346
 [31]  1.46176200 -0.33281578 -0.90253553  1.05721482 -0.18923887 -1.53637278
 [37] -0.62525697 -0.02019847  1.07572302  0.03287294  0.29188158  0.25061969
 [43] -2.43403976 -0.24173411  0.91591061 -0.60850148 -1.71561211  1.90279739
 [49] -1.25652886  1.53934503  0.50612014  1.04302389 -0.34435765  1.10406561
 [55]  0.18402334  0.19152214  1.77586140 -0.40426545  0.03593680 -1.03128727
 [61]  1.00956250 -0.77647770 -0.29537489 -0.25623798 -2.12019609  0.32841630
 [67] -1.65221116 -1.65767039  0.37807440 -0.55296802  0.28594554 -0.18587551
 [73]  1.85491106 -0.15076244 -0.46367049  0.20536027 -0.33768072  0.62621065
 [79]  0.09449402 -0.12385797  0.70558482  1.92603770 -0.28498859  1.65032242
 [85]  1.73456023 -1.18692654 -0.97399383 -1.09696565  0.50055655 -0.22685057
 [91]  0.03362763 -0.57141993  0.03968816  0.35140592  0.58049756 -0.66635286
 [97] -0.34515575 -0.94344407  2.49505195  0.02215533
> colMedians(tmp)
  [1] -0.87026885 -0.53187245 -1.64394809 -0.76037477  0.46429842 -1.46613161
  [7]  0.96082115  0.16645147 -0.76294893  0.20062451  1.46855531 -0.08338690
 [13]  1.23755667  0.47398980  0.39188849 -0.33704788  0.92268133 -0.44256493
 [19] -0.64759514  1.34144519  1.89835225  0.22026766 -0.26008122 -1.16325420
 [25]  0.06712221 -0.54671103 -0.34252326  2.00024680  0.02944657  0.21145346
 [31]  1.46176200 -0.33281578 -0.90253553  1.05721482 -0.18923887 -1.53637278
 [37] -0.62525697 -0.02019847  1.07572302  0.03287294  0.29188158  0.25061969
 [43] -2.43403976 -0.24173411  0.91591061 -0.60850148 -1.71561211  1.90279739
 [49] -1.25652886  1.53934503  0.50612014  1.04302389 -0.34435765  1.10406561
 [55]  0.18402334  0.19152214  1.77586140 -0.40426545  0.03593680 -1.03128727
 [61]  1.00956250 -0.77647770 -0.29537489 -0.25623798 -2.12019609  0.32841630
 [67] -1.65221116 -1.65767039  0.37807440 -0.55296802  0.28594554 -0.18587551
 [73]  1.85491106 -0.15076244 -0.46367049  0.20536027 -0.33768072  0.62621065
 [79]  0.09449402 -0.12385797  0.70558482  1.92603770 -0.28498859  1.65032242
 [85]  1.73456023 -1.18692654 -0.97399383 -1.09696565  0.50055655 -0.22685057
 [91]  0.03362763 -0.57141993  0.03968816  0.35140592  0.58049756 -0.66635286
 [97] -0.34515575 -0.94344407  2.49505195  0.02215533
> colRanges(tmp)
           [,1]       [,2]      [,3]       [,4]      [,5]      [,6]      [,7]
[1,] -0.8702688 -0.5318724 -1.643948 -0.7603748 0.4642984 -1.466132 0.9608211
[2,] -0.8702688 -0.5318724 -1.643948 -0.7603748 0.4642984 -1.466132 0.9608211
          [,8]       [,9]     [,10]    [,11]      [,12]    [,13]     [,14]
[1,] 0.1664515 -0.7629489 0.2006245 1.468555 -0.0833869 1.237557 0.4739898
[2,] 0.1664515 -0.7629489 0.2006245 1.468555 -0.0833869 1.237557 0.4739898
         [,15]      [,16]     [,17]      [,18]      [,19]    [,20]    [,21]
[1,] 0.3918885 -0.3370479 0.9226813 -0.4425649 -0.6475951 1.341445 1.898352
[2,] 0.3918885 -0.3370479 0.9226813 -0.4425649 -0.6475951 1.341445 1.898352
         [,22]      [,23]     [,24]      [,25]     [,26]      [,27]    [,28]
[1,] 0.2202677 -0.2600812 -1.163254 0.06712221 -0.546711 -0.3425233 2.000247
[2,] 0.2202677 -0.2600812 -1.163254 0.06712221 -0.546711 -0.3425233 2.000247
          [,29]     [,30]    [,31]      [,32]      [,33]    [,34]      [,35]
[1,] 0.02944657 0.2114535 1.461762 -0.3328158 -0.9025355 1.057215 -0.1892389
[2,] 0.02944657 0.2114535 1.461762 -0.3328158 -0.9025355 1.057215 -0.1892389
         [,36]     [,37]       [,38]    [,39]      [,40]     [,41]     [,42]
[1,] -1.536373 -0.625257 -0.02019847 1.075723 0.03287294 0.2918816 0.2506197
[2,] -1.536373 -0.625257 -0.02019847 1.075723 0.03287294 0.2918816 0.2506197
        [,43]      [,44]     [,45]      [,46]     [,47]    [,48]     [,49]
[1,] -2.43404 -0.2417341 0.9159106 -0.6085015 -1.715612 1.902797 -1.256529
[2,] -2.43404 -0.2417341 0.9159106 -0.6085015 -1.715612 1.902797 -1.256529
        [,50]     [,51]    [,52]      [,53]    [,54]     [,55]     [,56]
[1,] 1.539345 0.5061201 1.043024 -0.3443576 1.104066 0.1840233 0.1915221
[2,] 1.539345 0.5061201 1.043024 -0.3443576 1.104066 0.1840233 0.1915221
        [,57]      [,58]     [,59]     [,60]    [,61]      [,62]      [,63]
[1,] 1.775861 -0.4042655 0.0359368 -1.031287 1.009563 -0.7764777 -0.2953749
[2,] 1.775861 -0.4042655 0.0359368 -1.031287 1.009563 -0.7764777 -0.2953749
         [,64]     [,65]     [,66]     [,67]    [,68]     [,69]     [,70]
[1,] -0.256238 -2.120196 0.3284163 -1.652211 -1.65767 0.3780744 -0.552968
[2,] -0.256238 -2.120196 0.3284163 -1.652211 -1.65767 0.3780744 -0.552968
         [,71]      [,72]    [,73]      [,74]      [,75]     [,76]      [,77]
[1,] 0.2859455 -0.1858755 1.854911 -0.1507624 -0.4636705 0.2053603 -0.3376807
[2,] 0.2859455 -0.1858755 1.854911 -0.1507624 -0.4636705 0.2053603 -0.3376807
         [,78]      [,79]     [,80]     [,81]    [,82]      [,83]    [,84]
[1,] 0.6262106 0.09449402 -0.123858 0.7055848 1.926038 -0.2849886 1.650322
[2,] 0.6262106 0.09449402 -0.123858 0.7055848 1.926038 -0.2849886 1.650322
       [,85]     [,86]      [,87]     [,88]     [,89]      [,90]      [,91]
[1,] 1.73456 -1.186927 -0.9739938 -1.096966 0.5005565 -0.2268506 0.03362763
[2,] 1.73456 -1.186927 -0.9739938 -1.096966 0.5005565 -0.2268506 0.03362763
          [,92]      [,93]     [,94]     [,95]      [,96]      [,97]      [,98]
[1,] -0.5714199 0.03968816 0.3514059 0.5804976 -0.6663529 -0.3451558 -0.9434441
[2,] -0.5714199 0.03968816 0.3514059 0.5804976 -0.6663529 -0.3451558 -0.9434441
        [,99]     [,100]
[1,] 2.495052 0.02215533
[2,] 2.495052 0.02215533
> 
> 
> Max(tmp2)
[1] 2.1545
> Min(tmp2)
[1] -1.936139
> mean(tmp2)
[1] -0.073904
> Sum(tmp2)
[1] -7.3904
> Var(tmp2)
[1] 0.8131338
> 
> rowMeans(tmp2)
  [1]  0.05187960 -1.32990675 -1.21867354 -0.04347586 -1.52361124 -0.46379306
  [7] -1.57258786 -1.10318683 -0.49898339 -0.98055708  0.52357316  0.24909781
 [13]  1.33026553  0.64761495  0.37240897  0.23135985 -0.45804995 -0.23388070
 [19]  0.79111230 -0.43234716  0.46266027 -0.71489904  0.53947478 -0.61812605
 [25]  0.00856151 -0.30182872  0.88081157 -1.42361435  0.72551152 -0.54034569
 [31] -0.50710224  0.08816186 -0.92961426  0.90418844  1.48808643 -1.64445128
 [37]  1.30587900 -0.05048954  0.56592226  0.37443875 -0.74139363  1.30836857
 [43] -0.42285743 -0.22028331 -0.04890839  0.36769859 -0.38101758 -0.22741143
 [49]  1.35765864  0.87000105 -1.36971195  0.83428187 -0.47451946 -0.79709680
 [55]  0.45270444  0.60055702  0.60705167  0.73799136 -0.75686048  1.48658973
 [61] -1.37407109  0.68952435 -0.75516429 -0.09172925  1.86214993  0.85552659
 [67] -0.49563051  1.37506369 -0.82273655  2.15450011 -0.62713395  0.38972976
 [73]  1.22310610  0.10027311 -1.06514448 -1.09325234  0.72823443 -1.25355739
 [79] -0.70756983  0.05922828  0.19586559 -0.35539320  0.45287143  1.56767437
 [85]  0.16852735 -1.93613932 -1.93367718 -0.74293369 -0.66759044 -0.63241427
 [91] -0.46089361 -0.56978008 -0.87840911 -0.41195297  1.48819034  0.22280599
 [97] -1.15893822 -0.26692383 -0.89143830  0.13447566
> rowSums(tmp2)
  [1]  0.05187960 -1.32990675 -1.21867354 -0.04347586 -1.52361124 -0.46379306
  [7] -1.57258786 -1.10318683 -0.49898339 -0.98055708  0.52357316  0.24909781
 [13]  1.33026553  0.64761495  0.37240897  0.23135985 -0.45804995 -0.23388070
 [19]  0.79111230 -0.43234716  0.46266027 -0.71489904  0.53947478 -0.61812605
 [25]  0.00856151 -0.30182872  0.88081157 -1.42361435  0.72551152 -0.54034569
 [31] -0.50710224  0.08816186 -0.92961426  0.90418844  1.48808643 -1.64445128
 [37]  1.30587900 -0.05048954  0.56592226  0.37443875 -0.74139363  1.30836857
 [43] -0.42285743 -0.22028331 -0.04890839  0.36769859 -0.38101758 -0.22741143
 [49]  1.35765864  0.87000105 -1.36971195  0.83428187 -0.47451946 -0.79709680
 [55]  0.45270444  0.60055702  0.60705167  0.73799136 -0.75686048  1.48658973
 [61] -1.37407109  0.68952435 -0.75516429 -0.09172925  1.86214993  0.85552659
 [67] -0.49563051  1.37506369 -0.82273655  2.15450011 -0.62713395  0.38972976
 [73]  1.22310610  0.10027311 -1.06514448 -1.09325234  0.72823443 -1.25355739
 [79] -0.70756983  0.05922828  0.19586559 -0.35539320  0.45287143  1.56767437
 [85]  0.16852735 -1.93613932 -1.93367718 -0.74293369 -0.66759044 -0.63241427
 [91] -0.46089361 -0.56978008 -0.87840911 -0.41195297  1.48819034  0.22280599
 [97] -1.15893822 -0.26692383 -0.89143830  0.13447566
> 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.05187960 -1.32990675 -1.21867354 -0.04347586 -1.52361124 -0.46379306
  [7] -1.57258786 -1.10318683 -0.49898339 -0.98055708  0.52357316  0.24909781
 [13]  1.33026553  0.64761495  0.37240897  0.23135985 -0.45804995 -0.23388070
 [19]  0.79111230 -0.43234716  0.46266027 -0.71489904  0.53947478 -0.61812605
 [25]  0.00856151 -0.30182872  0.88081157 -1.42361435  0.72551152 -0.54034569
 [31] -0.50710224  0.08816186 -0.92961426  0.90418844  1.48808643 -1.64445128
 [37]  1.30587900 -0.05048954  0.56592226  0.37443875 -0.74139363  1.30836857
 [43] -0.42285743 -0.22028331 -0.04890839  0.36769859 -0.38101758 -0.22741143
 [49]  1.35765864  0.87000105 -1.36971195  0.83428187 -0.47451946 -0.79709680
 [55]  0.45270444  0.60055702  0.60705167  0.73799136 -0.75686048  1.48658973
 [61] -1.37407109  0.68952435 -0.75516429 -0.09172925  1.86214993  0.85552659
 [67] -0.49563051  1.37506369 -0.82273655  2.15450011 -0.62713395  0.38972976
 [73]  1.22310610  0.10027311 -1.06514448 -1.09325234  0.72823443 -1.25355739
 [79] -0.70756983  0.05922828  0.19586559 -0.35539320  0.45287143  1.56767437
 [85]  0.16852735 -1.93613932 -1.93367718 -0.74293369 -0.66759044 -0.63241427
 [91] -0.46089361 -0.56978008 -0.87840911 -0.41195297  1.48819034  0.22280599
 [97] -1.15893822 -0.26692383 -0.89143830  0.13447566
> rowMin(tmp2)
  [1]  0.05187960 -1.32990675 -1.21867354 -0.04347586 -1.52361124 -0.46379306
  [7] -1.57258786 -1.10318683 -0.49898339 -0.98055708  0.52357316  0.24909781
 [13]  1.33026553  0.64761495  0.37240897  0.23135985 -0.45804995 -0.23388070
 [19]  0.79111230 -0.43234716  0.46266027 -0.71489904  0.53947478 -0.61812605
 [25]  0.00856151 -0.30182872  0.88081157 -1.42361435  0.72551152 -0.54034569
 [31] -0.50710224  0.08816186 -0.92961426  0.90418844  1.48808643 -1.64445128
 [37]  1.30587900 -0.05048954  0.56592226  0.37443875 -0.74139363  1.30836857
 [43] -0.42285743 -0.22028331 -0.04890839  0.36769859 -0.38101758 -0.22741143
 [49]  1.35765864  0.87000105 -1.36971195  0.83428187 -0.47451946 -0.79709680
 [55]  0.45270444  0.60055702  0.60705167  0.73799136 -0.75686048  1.48658973
 [61] -1.37407109  0.68952435 -0.75516429 -0.09172925  1.86214993  0.85552659
 [67] -0.49563051  1.37506369 -0.82273655  2.15450011 -0.62713395  0.38972976
 [73]  1.22310610  0.10027311 -1.06514448 -1.09325234  0.72823443 -1.25355739
 [79] -0.70756983  0.05922828  0.19586559 -0.35539320  0.45287143  1.56767437
 [85]  0.16852735 -1.93613932 -1.93367718 -0.74293369 -0.66759044 -0.63241427
 [91] -0.46089361 -0.56978008 -0.87840911 -0.41195297  1.48819034  0.22280599
 [97] -1.15893822 -0.26692383 -0.89143830  0.13447566
> 
> colMeans(tmp2)
[1] -0.073904
> colSums(tmp2)
[1] -7.3904
> colVars(tmp2)
[1] 0.8131338
> colSd(tmp2)
[1] 0.9017393
> colMax(tmp2)
[1] 2.1545
> colMin(tmp2)
[1] -1.936139
> colMedians(tmp2)
[1] -0.1560063
> colRanges(tmp2)
          [,1]
[1,] -1.936139
[2,]  2.154500
> 
> dataset1 <- matrix(dataset1,1,100)
> 
> agree.checks(tmp,dataset1)
> 
> dataset2 <- matrix(dataset2,100,1)
> agree.checks(tmp2,dataset2)
>   
> 
> tmp <- createBufferedMatrix(10,10)
> 
> tmp[1:10,1:10] <- rnorm(100)
> colApply(tmp,sum)
 [1]  4.2373250  4.1599818  1.0187081  0.1970061 -5.1844897  3.4574921
 [7] -2.8794815 -0.7815305 -2.2779939  4.9484907
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -1.4871274
[2,] -0.3594472
[3,]  0.4049110
[4,]  1.2428725
[5,]  2.2343470
> 
> rowApply(tmp,sum)
 [1] -0.01312156  1.74552367  0.30944300 -1.44622955  1.00966584  5.19480207
 [7] -4.56722667 -0.48817973  2.67958644  2.47124449
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    4    7   10   10    4    5    3    2    9    10
 [2,]    5    8    4    5    5    2    9    8    8     9
 [3,]    6    9    5    4    8    1    2    7   10     4
 [4,]    7    4    2    3    3    7    8    4    7     8
 [5,]    2    5    9    2    1    4    6    1    1     5
 [6,]    9    3    1    9   10    9    5    6    5     6
 [7,]    8    6    3    7    2    3    7    5    4     1
 [8,]    3    1    6    6    7   10   10    3    3     2
 [9,]    1    2    7    1    9    8    4    9    2     3
[10,]   10   10    8    8    6    6    1   10    6     7
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1]  0.7927628  1.1333692 -3.4819368 -5.8351292 -0.9335636 -1.8285011
 [7]  1.5057874  1.1372740  1.7526882  1.0141457  5.7425175 -0.7448093
[13]  0.1126119  1.0425788  1.6274369 -0.7817657 -3.5832691 -0.2576606
[19]  2.7897653  1.5158707
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -0.9470354
[2,] -0.6487577
[3,]  0.5342497
[4,]  0.6930203
[5,]  1.1612857
> 
> rowApply(tmp,sum)
[1] -7.864286  2.151018  8.661846  1.733271 -1.961677
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]    8   14   14   17    5
[2,]   16    6   11   14   16
[3,]   17   10    3    2    2
[4,]    7    1    1    4    6
[5,]   10    7   12    3   18
> 
> 
> as.matrix(tmp)
           [,1]       [,2]        [,3]       [,4]       [,5]       [,6]
[1,] -0.6487577  0.3066219  0.37391725 -1.0047569 -0.3752337 -1.6157380
[2,]  0.6930203 -0.7745323  0.02444568 -1.7639011 -0.3352985  1.0354012
[3,]  0.5342497  0.4060084 -0.27794458 -1.1267373  0.4156794 -0.1528323
[4,]  1.1612857  0.6646866 -1.66255676 -1.1257777 -1.6338119  0.5215767
[5,] -0.9470354  0.5305845 -1.93979841 -0.8139562  0.9951010 -1.6169086
            [,7]       [,8]       [,9]      [,10]      [,11]       [,12]
[1,]  0.61798889 -1.2579011 -1.4152291 -1.1125708  0.8361134 -0.59073681
[2,] -1.33720500  0.7041045  2.1769258  0.4104791 -0.7918747 -1.54115847
[3,] -0.06243208  1.4263833 -0.6442422  1.9005727  3.0722021  0.05888299
[4,]  1.99672102 -0.6918143  0.1211543 -0.4687761  1.2146961  0.80896607
[5,]  0.29071456  0.9565015  1.5140795  0.2844408  1.4113806  0.51923689
           [,13]      [,14]       [,15]       [,16]       [,17]      [,18]
[1,]  0.05680678 0.18180796  0.97773480 -0.31925230  0.19858420 -2.1181863
[2,]  0.43283463 0.29550278 -0.30831642  1.47216120 -0.89760396  1.4610983
[3,]  0.96384798 0.35141101 -0.08664948 -0.04696865 -0.03692721  0.7203664
[4,] -0.18521928 0.18202146  0.93314092 -1.87385227 -0.48596567 -0.5982603
[5,] -1.15565818 0.03183562  0.11152704 -0.01385373 -2.36135648  0.2773213
            [,19]       [,20]
[1,]  0.225694925 -1.18119305
[2,] -0.268183232  1.46311783
[3,]  0.433332715  0.81364321
[4,]  2.404679206  0.45037741
[5,] -0.005758286 -0.03007469
> 
> 
> is.BufferedMatrix(tmp)
[1] TRUE
> 
> as.BufferedMatrix(as.matrix(tmp))
BufferedMatrix object
Matrix size:  5 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.18-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  800  bytes.
> 
> 
> 
> subBufferedMatrix(tmp,1:5,1:5)
BufferedMatrix object
Matrix size:  5 5 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.18-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  654  bytes.
Disk usage :  200  bytes.
> subBufferedMatrix(tmp,,5:8)
BufferedMatrix object
Matrix size:  5 4 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.18-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  565  bytes.
Disk usage :  160  bytes.
> subBufferedMatrix(tmp,1:3,)
BufferedMatrix object
Matrix size:  3 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.18-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  480  bytes.
> 
> 
> rm(tmp)
> 
> 
> ###
> ### Testing colnames and rownames
> ###
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> 
> 
> colnames(tmp)
NULL
> rownames(tmp)
NULL
> 
> 
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> colnames(tmp)
 [1] "col1"  "col2"  "col3"  "col4"  "col5"  "col6"  "col7"  "col8"  "col9" 
[10] "col10" "col11" "col12" "col13" "col14" "col15" "col16" "col17" "col18"
[19] "col19" "col20"
> rownames(tmp)
[1] "row1" "row2" "row3" "row4" "row5"
> 
> 
> tmp["row1",]
          col1     col2       col3      col4       col5     col6     col7
row1 0.8283981 1.313946 -0.2819822 -1.483308 -0.4627753 1.046628 1.149075
          col8       col9      col10      col11       col12     col13     col14
row1 -1.828595 -0.7972727 -0.2845487 -0.2694148 -0.06301855 0.6436895 -1.760495
         col15     col16       col17     col18    col19    col20
row1 -1.317129 0.8741899 -0.01873731 0.1871643 1.186937 1.121237
> tmp[,"col10"]
          col10
row1 -0.2845487
row2 -0.3517277
row3 -0.4109703
row4 -1.5052516
row5 -0.2142395
> tmp[c("row1","row5"),]
          col1       col2       col3      col4       col5       col6       col7
row1 0.8283981  1.3139462 -0.2819822 -1.483308 -0.4627753  1.0466283  1.1490749
row5 0.2182492 -0.7692544 -0.6474035  1.888591 -0.3438922 -0.6176382 -0.7388707
          col8       col9      col10      col11       col12     col13
row1 -1.828595 -0.7972727 -0.2845487 -0.2694148 -0.06301855 0.6436895
row5  1.919966  0.9004562 -0.2142395  0.8743827 -1.17220140 0.2919370
           col14      col15      col16       col17     col18    col19     col20
row1 -1.76049524 -1.3171295  0.8741899 -0.01873731 0.1871643 1.186937  1.121237
row5 -0.07793687  0.2590319 -0.1309118 -0.53901098 0.2470654 1.108010 -1.644345
> tmp[,c("col6","col20")]
           col6      col20
row1  1.0466283  1.1212373
row2 -0.1887374 -1.9185567
row3 -0.1353483 -1.1754689
row4 -1.7205422  0.1249938
row5 -0.6176382 -1.6443452
> tmp[c("row1","row5"),c("col6","col20")]
           col6     col20
row1  1.0466283  1.121237
row5 -0.6176382 -1.644345
> 
> 
> 
> 
> 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 52.47462 49.62973 49.82642 48.42027 50.78443 104.86 50.90929 49.69124
         col9    col10    col11    col12    col13    col14    col15    col16
row1 48.50605 50.51518 49.93774 48.23236 48.20377 50.62164 49.73581 50.07681
        col17    col18    col19    col20
row1 52.24496 49.81114 49.57543 105.1634
> tmp[,"col10"]
        col10
row1 50.51518
row2 28.54235
row3 30.85175
row4 29.18763
row5 50.06648
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 52.47462 49.62973 49.82642 48.42027 50.78443 104.8600 50.90929 49.69124
row5 49.72600 48.90609 50.58459 50.28659 48.18166 104.8064 50.48116 51.36825
         col9    col10    col11    col12    col13    col14    col15    col16
row1 48.50605 50.51518 49.93774 48.23236 48.20377 50.62164 49.73581 50.07681
row5 50.30077 50.06648 50.80123 48.96738 49.36854 49.29003 50.26947 49.89678
        col17    col18    col19    col20
row1 52.24496 49.81114 49.57543 105.1634
row5 48.97028 51.40390 51.08969 105.0236
> tmp[,c("col6","col20")]
          col6     col20
row1 104.85998 105.16339
row2  74.74991  73.69739
row3  74.31567  77.85471
row4  74.93439  74.53709
row5 104.80638 105.02360
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 104.8600 105.1634
row5 104.8064 105.0236
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 104.8600 105.1634
row5 104.8064 105.0236
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
          col13
[1,]  2.1891406
[2,] -1.1576426
[3,]  0.2218613
[4,]  0.9838115
[5,] -1.7749379
> tmp[,c("col17","col7")]
           col17        col7
[1,]  0.87334387 -0.14019918
[2,] -1.45768823 -0.36077109
[3,]  0.07059002 -0.02845363
[4,]  0.17954874  2.03490047
[5,]  1.32928969  1.51736515
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
             col6      col20
[1,] -0.367447280 -0.5452461
[2,]  0.004532309 -2.4316122
[3,] -0.082174520 -1.3821067
[4,] -0.862028007 -0.1629212
[5,]  0.181911201  1.0048503
> subBufferedMatrix(tmp,1,c("col6"))[,1]
           col1
[1,] -0.3674473
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
             col6
[1,] -0.367447280
[2,]  0.004532309
> 
> 
> 
> 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]
row3 -1.3199607  0.456076 -0.2707662  0.7298219 0.008032333 -0.2689902
row1 -0.8515279 -1.251140 -0.8149424 -2.1725724 0.097756116  0.9515200
           [,7]       [,8]        [,9]      [,10]      [,11]      [,12]
row3 -0.4219423  0.7818009  0.05225566 -0.6473065  0.4037991  0.8235632
row1 -0.4420061 -0.4235928 -0.48631887 -0.4717060 -0.8329338 -1.5567057
         [,13]     [,14]       [,15]     [,16]      [,17]      [,18]      [,19]
row3 0.4949322 -1.112438 -0.08089107  0.698013 -0.4078098 -0.1800428 -0.6757478
row1 0.6076563  1.268473  0.14889337 -2.256058  0.9459686  0.2782430  0.1364585
          [,20]
row3  0.1785968
row1 -0.9059002
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
         [,1]      [,2]      [,3]       [,4]      [,5]      [,6]     [,7]
row2 1.760226 -1.806137 0.6235788 0.07249388 -1.705732 -1.206734 1.226458
          [,8]       [,9]      [,10]
row2 0.1196487 -0.6058871 -0.4355586
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
          [,1]       [,2]       [,3]     [,4]       [,5]    [,6]      [,7]
row5 -0.395265 -0.5217258 -0.6084144 -2.07267 -0.3306047 1.05956 0.5444887
         [,8]     [,9]    [,10]      [,11]      [,12]     [,13]    [,14]
row5 1.326054 1.006161 0.279859 -0.4293815 -0.5160042 0.2496768 1.020818
         [,15]      [,16]      [,17]     [,18]     [,19]      [,20]
row5 -1.136433 -0.3067831 0.06986245 -1.253199 0.3120444 -0.7023519
> 
> 
> 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: 0x55edc34f9a90>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "/home/biocbuild/bbs-3.18-bioc/meat/BufferedMatrix.Rcheck/tests/BM2ad63f36358453"
 [2] "/home/biocbuild/bbs-3.18-bioc/meat/BufferedMatrix.Rcheck/tests/BM2ad63f77bbad65"
 [3] "/home/biocbuild/bbs-3.18-bioc/meat/BufferedMatrix.Rcheck/tests/BM2ad63f775309cc"
 [4] "/home/biocbuild/bbs-3.18-bioc/meat/BufferedMatrix.Rcheck/tests/BM2ad63f22a94a4c"
 [5] "/home/biocbuild/bbs-3.18-bioc/meat/BufferedMatrix.Rcheck/tests/BM2ad63f3a422837"
 [6] "/home/biocbuild/bbs-3.18-bioc/meat/BufferedMatrix.Rcheck/tests/BM2ad63f7256636a"
 [7] "/home/biocbuild/bbs-3.18-bioc/meat/BufferedMatrix.Rcheck/tests/BM2ad63f2b5665aa"
 [8] "/home/biocbuild/bbs-3.18-bioc/meat/BufferedMatrix.Rcheck/tests/BM2ad63f39c3ab6d"
 [9] "/home/biocbuild/bbs-3.18-bioc/meat/BufferedMatrix.Rcheck/tests/BM2ad63f408f0893"
[10] "/home/biocbuild/bbs-3.18-bioc/meat/BufferedMatrix.Rcheck/tests/BM2ad63f44f696fc"
[11] "/home/biocbuild/bbs-3.18-bioc/meat/BufferedMatrix.Rcheck/tests/BM2ad63f20157c18"
[12] "/home/biocbuild/bbs-3.18-bioc/meat/BufferedMatrix.Rcheck/tests/BM2ad63f33a32c2e"
[13] "/home/biocbuild/bbs-3.18-bioc/meat/BufferedMatrix.Rcheck/tests/BM2ad63f74682626"
[14] "/home/biocbuild/bbs-3.18-bioc/meat/BufferedMatrix.Rcheck/tests/BM2ad63f37e6cc97"
[15] "/home/biocbuild/bbs-3.18-bioc/meat/BufferedMatrix.Rcheck/tests/BM2ad63f3acd41e7"
> 
> 
> ### 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: 0x55edc43173c0>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x55edc43173c0>
Warning message:
In dir.create(new.directory) :
  '/home/biocbuild/bbs-3.18-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x55edc43173c0>
> rowMedians(tmp)
  [1] -0.2195608720 -0.2564332886 -0.0126865822  0.1672510889  0.5509162824
  [6]  0.0442110491  0.0977169743 -0.3422163297 -0.2004013640 -0.3657452646
 [11] -0.2316222536 -0.1292094226  0.0469716090  0.0904495681  0.2325156699
 [16]  0.3162808048  0.5846625426 -0.1108277406  0.0227621871  0.0868806095
 [21] -0.5235975084 -0.3672691568  0.3036585007 -0.2034380854  0.0713707035
 [26]  0.0475663782  0.0013433559  0.2664759541 -0.1259174626 -0.3748338811
 [31] -0.3662357745 -0.5236962479 -0.3715541388 -0.4445952315  0.3190070327
 [36]  0.1547969813  0.8524065144 -0.2670404356  0.1355928273 -0.2694010997
 [41]  0.3333592665 -0.0373789729 -0.0076923318 -0.1275947414 -0.0025268764
 [46] -0.2997429857  0.0478861221 -0.6702805293  0.4256407355  0.3229816877
 [51] -0.3951212725 -0.0722907236  0.2113395201  0.0895962760  0.1278733788
 [56] -0.1197457843  0.6249101690  0.1292392186 -0.0583432063  0.2233704067
 [61]  0.1265555191 -0.1269454346 -0.3425629232  0.2550146264  0.3585110742
 [66]  0.2318855640 -0.1919585849 -0.1267933318 -0.0177720671 -0.2741530740
 [71]  0.3168638182 -0.5031653729 -0.4613251739  0.1682123238 -0.6172521238
 [76] -0.2773897653  0.3020583272 -0.4330747890  0.2649480685  0.7207616809
 [81] -0.4612224291 -0.1781114398  0.0145974758  0.1994981973 -0.2445790719
 [86] -0.2351925363  0.3558882514  0.2105573033 -0.1247133596 -0.2854995440
 [91]  0.4957738919  0.0329701583  0.0888228888 -0.2291244461  0.2991384264
 [96]  0.0591858052 -0.2433273898  0.1301042516 -0.0064472926  0.0188374392
[101] -0.3080674683  0.3394863133  0.6408650466  0.2683189370  0.3228039726
[106] -0.1448574180 -0.1844749396  0.0552832766 -0.1551689284 -0.0313631799
[111] -0.5271895780 -0.5217890328  0.1277374232 -0.8230743870 -0.5697050613
[116]  0.0441438495 -0.9096147233 -0.5040228894  1.0227248155 -0.1092852232
[121] -0.4034792680 -0.1379273867  0.3567028353  0.5341709254  0.1900447951
[126]  0.0331066658  0.0271860729  0.2956146872 -0.3490668709  0.2965308471
[131] -0.5237894010 -0.1942237177  0.2278554252  0.3063464051 -0.6315212513
[136]  0.2068880952 -0.1329535974 -0.5536632138 -0.4416317132  0.6445666228
[141] -0.2758576607 -0.3169148305 -0.1345417385 -0.0007817262  0.1160625213
[146]  0.1117896455  0.5559332372 -0.4433698795  0.0067169195  0.0958235104
[151] -0.5290802824 -0.0459372283  0.3350491680  0.1141071311 -0.2781170166
[156]  0.3427391207  0.2599554472  0.7278607546 -0.1877864548  0.2775202048
[161]  0.1308714708  0.4960978122 -0.0033442870 -0.4050676483  0.1693863696
[166] -0.4644406526  0.1607446696 -0.1073497930 -0.2062441003  0.3168923848
[171]  0.2529105583 -0.2675672330 -0.4196016547  0.0213372380  0.1221255359
[176] -0.1996434554  0.3111077251 -0.4745088381  0.2040580933  0.2710251652
[181]  0.2959736265 -0.3535757989 -0.6447852645 -0.3242808717 -0.3694503756
[186]  0.3317236782 -0.0869290744 -0.4338370149 -0.4833666742 -0.1630313547
[191]  0.5932233503 -0.2805349078 -0.4919591759 -0.8659531296  0.1424956450
[196] -0.2211610589  0.1612683653 -0.0811139508 -0.2987869170 -0.2802425212
[201] -0.0101243281  0.0743370614  0.3174649354  0.0820709282 -0.1826452318
[206]  0.1285330784  0.4676667014  0.2159075679 -0.0509561449  0.3238500902
[211] -0.2644404174  0.2826380808 -0.4590444996  0.0097500617 -0.2468003139
[216]  0.2486410626  0.0498227770 -0.1523931674 -0.1056498889 -0.4252827413
[221]  0.1103401438 -0.2602561139  0.2033776424  0.0906689261  0.1967668813
[226]  0.3245975510  0.0632318862 -0.0178470270 -0.1595880767  0.0284838649
> 
> proc.time()
   user  system elapsed 
  1.305   0.604   1.906 

BufferedMatrix.Rcheck/tests/rawCalltesting.Rout


R version 4.3.3 (2024-02-29) -- "Angel Food Cake"
Copyright (C) 2024 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

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

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

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

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

Attaching package: 'BufferedMatrix'

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

    colMeans, colSums, rowMeans, rowSums

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

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

<pointer: 0x55ad94be6010>
> .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: 0x55ad94be6010>
> .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: 0x55ad94be6010>
> .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: 0x55ad94be6010>
> 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: 0x55ad94fac6a0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x55ad94fac6a0>
> .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: 0x55ad94fac6a0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x55ad94fac6a0>
> .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: 0x55ad94fac6a0>
> 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: 0x55ad940ef1c0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x55ad940ef1c0>
> .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: 0x55ad940ef1c0>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x55ad940ef1c0>
> .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: 0x55ad940ef1c0>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x55ad940ef1c0>
> .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: 0x55ad940ef1c0>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x55ad940ef1c0>
> .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: 0x55ad940ef1c0>
> 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: 0x55ad96a165e0>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x55ad96a165e0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x55ad96a165e0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x55ad96a165e0>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile2ad6867670ef1d" "BufferedMatrixFile2ad686b8c8e1b" 
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile2ad6867670ef1d" "BufferedMatrixFile2ad686b8c8e1b" 
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x55ad94e53280>
> .Call("R_bm_AddColumn",P)
<pointer: 0x55ad94e53280>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x55ad94e53280>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x55ad94e53280>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x55ad94e53280>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x55ad94e53280>
> .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: 0x55ad960a5920>
> .Call("R_bm_AddColumn",P)
<pointer: 0x55ad960a5920>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x55ad960a5920>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x55ad960a5920>
> 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: 0x55ad95383c00>
> .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: 0x55ad95383c00>
> rm(P)
> 
> proc.time()
   user  system elapsed 
  0.265   0.036   0.290 

BufferedMatrix.Rcheck/tests/Rcodetesting.Rout


R version 4.3.3 (2024-02-29) -- "Angel Food Cake"
Copyright (C) 2024 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

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

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

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

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

Attaching package: 'BufferedMatrix'

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

    colMeans, colSums, rowMeans, rowSums

> 
> Temp <- createBufferedMatrix(100)
> dim(Temp)
[1] 100   0
> buffer.dim(Temp)
[1] 1 1
> 
> 
> proc.time()
   user  system elapsed 
  0.235   0.051   0.275 

Example timings