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

This page was generated on 2024-06-07 20:24 -0400 (Fri, 07 Jun 2024).

HostnameOSArch (*)R versionInstalled pkgs
nebbiolo1Linux (Ubuntu 22.04.3 LTS)x86_644.4.0 (2024-04-24) -- "Puppy Cup" 4755
palomino3Windows Server 2022 Datacenterx644.4.0 (2024-04-24 ucrt) -- "Puppy Cup" 4489
lconwaymacOS 12.7.1 Montereyx86_644.4.0 (2024-04-24) -- "Puppy Cup" 4520
kjohnson3macOS 13.6.5 Venturaarm644.4.0 (2024-04-24) -- "Puppy Cup" 4466
Click on any hostname to see more info about the system (e.g. compilers)      (*) as reported by 'uname -p', except on Windows and Mac OS X

Package 249/2300HostnameOS / ArchINSTALLBUILDCHECKBUILD BIN
BufferedMatrix 1.68.0  (landing page)
Ben Bolstad
Snapshot Date: 2024-06-05 14:00:26 -0400 (Wed, 05 Jun 2024)
git_url: https://git.bioconductor.org/packages/BufferedMatrix
git_branch: RELEASE_3_19
git_last_commit: af6c73d
git_last_commit_date: 2024-04-30 10:16:21 -0400 (Tue, 30 Apr 2024)
nebbiolo1Linux (Ubuntu 22.04.3 LTS) / x86_64  OK    OK    OK  UNNEEDED, same version is already published
palomino3Windows Server 2022 Datacenter / x64  OK    OK    OK    OK  UNNEEDED, same version is already published
lconwaymacOS 12.7.1 Monterey / x86_64  OK    OK    WARNINGS    OK  UNNEEDED, same version is already published
kjohnson3macOS 13.6.5 Ventura / arm64  OK    OK    WARNINGS    OK  UNNEEDED, same version is already published


CHECK results for BufferedMatrix on nebbiolo1

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

raw results


Summary

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

Command output

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


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

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


Installation output

BufferedMatrix.Rcheck/00install.out

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


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

Tests output

BufferedMatrix.Rcheck/tests/c_code_level_tests.Rout


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

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

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

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

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

Attaching package: 'BufferedMatrix'

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

    colMeans, colSums, rowMeans, rowSums

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

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

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

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

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

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

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

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

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

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

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

[[1]]
[1] 0

> 
> proc.time()
   user  system elapsed 
  0.254   0.050   0.293 

BufferedMatrix.Rcheck/tests/objectTesting.Rout


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

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

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

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

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

Attaching package: 'BufferedMatrix'

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

    colMeans, colSums, rowMeans, rowSums

> 
> 
> ### this is used to control how many repetitions in something below
> ### higher values result in more checks.
> nreps <-100 ##20000
> 
> 
> ## test creation and some simple assignments and subsetting operations
> 
> ## first on single elements
> tmp <- createBufferedMatrix(1000,10)
> 
> tmp[10,5]
[1] 0
> tmp[10,5] <- 10
> tmp[10,5]
[1] 10
> tmp[10,5] <- 12.445
> tmp[10,5]
[1] 12.445
> 
> 
> 
> ## now testing accessing multiple elements
> tmp2 <- createBufferedMatrix(10,20)
> 
> 
> tmp2[3,1] <- 51.34
> tmp2[9,2] <- 9.87654
> tmp2[,1:2]
       [,1]    [,2]
 [1,]  0.00 0.00000
 [2,]  0.00 0.00000
 [3,] 51.34 0.00000
 [4,]  0.00 0.00000
 [5,]  0.00 0.00000
 [6,]  0.00 0.00000
 [7,]  0.00 0.00000
 [8,]  0.00 0.00000
 [9,]  0.00 9.87654
[10,]  0.00 0.00000
> tmp2[,-(3:20)]
       [,1]    [,2]
 [1,]  0.00 0.00000
 [2,]  0.00 0.00000
 [3,] 51.34 0.00000
 [4,]  0.00 0.00000
 [5,]  0.00 0.00000
 [6,]  0.00 0.00000
 [7,]  0.00 0.00000
 [8,]  0.00 0.00000
 [9,]  0.00 9.87654
[10,]  0.00 0.00000
> tmp2[3,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
[1,] 51.34    0    0    0    0    0    0    0    0     0     0     0     0
     [,14] [,15] [,16] [,17] [,18] [,19] [,20]
[1,]     0     0     0     0     0     0     0
> tmp2[-3,]
      [,1]    [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [2,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [3,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [4,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [5,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [6,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [7,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [8,]    0 9.87654    0    0    0    0    0    0    0     0     0     0     0
 [9,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
      [,14] [,15] [,16] [,17] [,18] [,19] [,20]
 [1,]     0     0     0     0     0     0     0
 [2,]     0     0     0     0     0     0     0
 [3,]     0     0     0     0     0     0     0
 [4,]     0     0     0     0     0     0     0
 [5,]     0     0     0     0     0     0     0
 [6,]     0     0     0     0     0     0     0
 [7,]     0     0     0     0     0     0     0
 [8,]     0     0     0     0     0     0     0
 [9,]     0     0     0     0     0     0     0
> tmp2[2,1:3]
     [,1] [,2] [,3]
[1,]    0    0    0
> tmp2[3:9,1:3]
      [,1]    [,2] [,3]
[1,] 51.34 0.00000    0
[2,]  0.00 0.00000    0
[3,]  0.00 0.00000    0
[4,]  0.00 0.00000    0
[5,]  0.00 0.00000    0
[6,]  0.00 0.00000    0
[7,]  0.00 9.87654    0
> tmp2[-4,-4]
       [,1]    [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [2,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [3,] 51.34 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [4,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [5,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [6,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [7,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [8,]  0.00 9.87654    0    0    0    0    0    0    0     0     0     0     0
 [9,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
      [,14] [,15] [,16] [,17] [,18] [,19]
 [1,]     0     0     0     0     0     0
 [2,]     0     0     0     0     0     0
 [3,]     0     0     0     0     0     0
 [4,]     0     0     0     0     0     0
 [5,]     0     0     0     0     0     0
 [6,]     0     0     0     0     0     0
 [7,]     0     0     0     0     0     0
 [8,]     0     0     0     0     0     0
 [9,]     0     0     0     0     0     0
> 
> ## now testing accessing/assigning multiple elements
> tmp3 <- createBufferedMatrix(10,10)
> 
> for (i in 1:10){
+   for (j in 1:10){
+     tmp3[i,j] <- (j-1)*10 + i
+   }
+ }
> 
> tmp3[2:4,2:4]
     [,1] [,2] [,3]
[1,]   12   22   32
[2,]   13   23   33
[3,]   14   24   34
> tmp3[c(-10),c(2:4,2:4,10,1,2,1:10,10:1)]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]   11   21   31   11   21   31   91    1   11     1    11    21    31
 [2,]   12   22   32   12   22   32   92    2   12     2    12    22    32
 [3,]   13   23   33   13   23   33   93    3   13     3    13    23    33
 [4,]   14   24   34   14   24   34   94    4   14     4    14    24    34
 [5,]   15   25   35   15   25   35   95    5   15     5    15    25    35
 [6,]   16   26   36   16   26   36   96    6   16     6    16    26    36
 [7,]   17   27   37   17   27   37   97    7   17     7    17    27    37
 [8,]   18   28   38   18   28   38   98    8   18     8    18    28    38
 [9,]   19   29   39   19   29   39   99    9   19     9    19    29    39
      [,14] [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24] [,25]
 [1,]    41    51    61    71    81    91    91    81    71    61    51    41
 [2,]    42    52    62    72    82    92    92    82    72    62    52    42
 [3,]    43    53    63    73    83    93    93    83    73    63    53    43
 [4,]    44    54    64    74    84    94    94    84    74    64    54    44
 [5,]    45    55    65    75    85    95    95    85    75    65    55    45
 [6,]    46    56    66    76    86    96    96    86    76    66    56    46
 [7,]    47    57    67    77    87    97    97    87    77    67    57    47
 [8,]    48    58    68    78    88    98    98    88    78    68    58    48
 [9,]    49    59    69    79    89    99    99    89    79    69    59    49
      [,26] [,27] [,28] [,29]
 [1,]    31    21    11     1
 [2,]    32    22    12     2
 [3,]    33    23    13     3
 [4,]    34    24    14     4
 [5,]    35    25    15     5
 [6,]    36    26    16     6
 [7,]    37    27    17     7
 [8,]    38    28    18     8
 [9,]    39    29    19     9
> tmp3[-c(1:5),-c(6:10)]
     [,1] [,2] [,3] [,4] [,5]
[1,]    6   16   26   36   46
[2,]    7   17   27   37   47
[3,]    8   18   28   38   48
[4,]    9   19   29   39   49
[5,]   10   20   30   40   50
> 
> ## assignment of whole columns
> tmp3[,1] <- c(1:10*100.0)
> tmp3[,1:2] <- tmp3[,1:2]*100
> tmp3[,1:2] <- tmp3[,2:1]
> tmp3[,1:2]
      [,1]  [,2]
 [1,] 1100 1e+04
 [2,] 1200 2e+04
 [3,] 1300 3e+04
 [4,] 1400 4e+04
 [5,] 1500 5e+04
 [6,] 1600 6e+04
 [7,] 1700 7e+04
 [8,] 1800 8e+04
 [9,] 1900 9e+04
[10,] 2000 1e+05
> 
> 
> tmp3[,-1] <- tmp3[,1:9]
> tmp3[,1:10]
      [,1] [,2]  [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,] 1100 1100 1e+04   21   31   41   51   61   71    81
 [2,] 1200 1200 2e+04   22   32   42   52   62   72    82
 [3,] 1300 1300 3e+04   23   33   43   53   63   73    83
 [4,] 1400 1400 4e+04   24   34   44   54   64   74    84
 [5,] 1500 1500 5e+04   25   35   45   55   65   75    85
 [6,] 1600 1600 6e+04   26   36   46   56   66   76    86
 [7,] 1700 1700 7e+04   27   37   47   57   67   77    87
 [8,] 1800 1800 8e+04   28   38   48   58   68   78    88
 [9,] 1900 1900 9e+04   29   39   49   59   69   79    89
[10,] 2000 2000 1e+05   30   40   50   60   70   80    90
> 
> tmp3[,1:2] <- rep(1,10)
> tmp3[,1:2] <- rep(1,20)
> tmp3[,1:2] <- matrix(c(1:5),1,5)
> 
> tmp3[,-c(1:8)] <- matrix(c(1:5),1,5)
> 
> tmp3[1,] <- 1:10
> tmp3[1,]
     [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,]    1    2    3    4    5    6    7    8    9    10
> tmp3[-1,] <- c(1,2)
> tmp3[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    1    2    3    4    5    6    7    8    9    10
 [2,]    1    2    1    2    1    2    1    2    1     2
 [3,]    2    1    2    1    2    1    2    1    2     1
 [4,]    1    2    1    2    1    2    1    2    1     2
 [5,]    2    1    2    1    2    1    2    1    2     1
 [6,]    1    2    1    2    1    2    1    2    1     2
 [7,]    2    1    2    1    2    1    2    1    2     1
 [8,]    1    2    1    2    1    2    1    2    1     2
 [9,]    2    1    2    1    2    1    2    1    2     1
[10,]    1    2    1    2    1    2    1    2    1     2
> tmp3[-c(1:8),] <- matrix(c(1:5),1,5)
> tmp3[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    1    2    3    4    5    6    7    8    9    10
 [2,]    1    2    1    2    1    2    1    2    1     2
 [3,]    2    1    2    1    2    1    2    1    2     1
 [4,]    1    2    1    2    1    2    1    2    1     2
 [5,]    2    1    2    1    2    1    2    1    2     1
 [6,]    1    2    1    2    1    2    1    2    1     2
 [7,]    2    1    2    1    2    1    2    1    2     1
 [8,]    1    2    1    2    1    2    1    2    1     2
 [9,]    1    3    5    2    4    1    3    5    2     4
[10,]    2    4    1    3    5    2    4    1    3     5
> 
> 
> tmp3[1:2,1:2] <- 5555.04
> tmp3[-(1:2),1:2] <- 1234.56789
> 
> 
> 
> ## testing accessors for the directory and prefix
> directory(tmp3)
[1] "/home/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests"
> prefix(tmp3)
[1] "BM"
> 
> ## testing if we can remove these objects
> rm(tmp, tmp2, tmp3)
> gc()
         used (Mb) gc trigger (Mb) max used (Mb)
Ncells 471778 25.2    1026221 54.9   643431 34.4
Vcells 871899  6.7    8388608 64.0  2046580 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] "Wed Jun  5 21:11:26 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] "Wed Jun  5 21:11:26 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: 0x55633a849440>
> 
> 
> 
> 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] "Wed Jun  5 21:11:26 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] "Wed Jun  5 21:11:26 2024"
> 
> ColMode(tmp2)
<pointer: 0x55633a849440>
> 
> 
> 
> ### 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.2178634 -0.3268447  0.2194538 -0.1043740
[2,]  -0.9811115  0.0337887 -1.4449222 -0.6213913
[3,]   0.4362262  0.8112260  0.5340964  1.5469756
[4,]  -2.4126687  1.0792537  2.0051480  1.1111074
> ewApply(tmp5,abs)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
            [,1]      [,2]      [,3]      [,4]
[1,] 100.2178634 0.3268447 0.2194538 0.1043740
[2,]   0.9811115 0.0337887 1.4449222 0.6213913
[3,]   0.4362262 0.8112260 0.5340964 1.5469756
[4,]   2.4126687 1.0792537 2.0051480 1.1111074
> ewApply(tmp5,sqrt)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
           [,1]      [,2]     [,3]      [,4]
[1,] 10.0108872 0.5717034 0.468459 0.3230696
[2,]  0.9905108 0.1838170 1.202049 0.7882838
[3,]  0.6604742 0.9006809 0.730819 1.2437747
[4,]  1.5532768 1.0388714 1.416032 1.0540908
> 
> my.function <- function(x,power){
+   (x+5)^power
+ }
> 
> ewApply(tmp5,my.function,power=2)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
          [,1]     [,2]     [,3]     [,4]
[1,] 225.32674 31.04388 29.90404 28.33507
[2,]  35.88622 26.87196 38.46541 33.50423
[3,]  32.04097 34.81803 32.84229 38.98472
[4,]  42.94544 36.46797 41.16547 36.65202
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x55633a3bb3b0>
> exp(tmp5)
<pointer: 0x55633a3bb3b0>
> log(tmp5,2)
<pointer: 0x55633a3bb3b0>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 468.9881
> Min(tmp5)
[1] 52.45139
> mean(tmp5)
[1] 72.26512
> Sum(tmp5)
[1] 14453.02
> Var(tmp5)
[1] 876.8655
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 89.28130 67.84948 69.58337 76.75346 68.63480 71.08124 70.77988 70.78016
 [9] 67.75831 70.14916
> rowSums(tmp5)
 [1] 1785.626 1356.990 1391.667 1535.069 1372.696 1421.625 1415.598 1415.603
 [9] 1355.166 1402.983
> rowVars(tmp5)
 [1] 8067.28811   57.26995   73.06396  107.64245   84.82183   68.07258
 [7]   92.73632   48.89741   64.65522  119.39005
> rowSd(tmp5)
 [1] 89.818083  7.567691  8.547746 10.375088  9.209877  8.250611  9.629970
 [8]  6.992668  8.040847 10.926575
> rowMax(tmp5)
 [1] 468.98808  80.06072  91.54176  99.61094  85.01793  84.67457  95.44125
 [8]  80.96641  80.60139  90.92814
> rowMin(tmp5)
 [1] 52.45139 55.15245 54.01841 61.56884 56.18443 53.12924 58.12387 58.47575
 [9] 54.58244 54.87939
> 
> colMeans(tmp5)
 [1] 108.26101  67.29007  70.40980  70.81319  69.32448  70.18324  71.47765
 [8]  74.58547  71.08780  71.28606  67.51364  67.39337  69.56101  71.91252
[15]  73.11210  68.76639  67.01572  68.49767  77.09837  69.71275
> colSums(tmp5)
 [1] 1082.6101  672.9007  704.0980  708.1319  693.2448  701.8324  714.7765
 [8]  745.8547  710.8780  712.8606  675.1364  673.9337  695.6101  719.1252
[15]  731.1210  687.6639  670.1572  684.9767  770.9837  697.1275
> colVars(tmp5)
 [1] 16161.22358    55.33406   109.86068    59.57190   100.87622   136.32110
 [7]    18.98605    72.63286    76.21995    49.91363    29.32163    72.57908
[13]    48.99004   129.12824   118.49156   119.15220    56.23155   154.57768
[19]    62.25351   106.06492
> colSd(tmp5)
 [1] 127.126801   7.438687  10.481445   7.718284  10.043715  11.675663
 [7]   4.357298   8.522491   8.730404   7.064958   5.414945   8.519336
[13]   6.999289  11.363461  10.885383  10.915686   7.498770  12.432927
[19]   7.890089  10.298783
> colMax(tmp5)
 [1] 468.98808  77.76801  85.68054  81.14159  85.53531  91.54176  78.26090
 [8]  85.00836  85.20471  82.98161  74.44292  80.69389  81.69851  88.92457
[15]  92.46355  95.44125  76.27917  99.61094  90.92814  84.68441
> colMin(tmp5)
 [1] 53.12924 55.93046 54.87939 56.18443 52.45139 58.12387 63.90824 58.06729
 [9] 63.94390 56.65692 60.24726 56.03569 56.95480 54.58244 57.02624 58.66273
[17] 55.15245 59.18704 62.76466 54.01841
> 
> 
> ### 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.28130 67.84948       NA 76.75346 68.63480 71.08124 70.77988 70.78016
 [9] 67.75831 70.14916
> rowSums(tmp5)
 [1] 1785.626 1356.990       NA 1535.069 1372.696 1421.625 1415.598 1415.603
 [9] 1355.166 1402.983
> rowVars(tmp5)
 [1] 8067.28811   57.26995   76.98247  107.64245   84.82183   68.07258
 [7]   92.73632   48.89741   64.65522  119.39005
> rowSd(tmp5)
 [1] 89.818083  7.567691  8.773965 10.375088  9.209877  8.250611  9.629970
 [8]  6.992668  8.040847 10.926575
> rowMax(tmp5)
 [1] 468.98808  80.06072        NA  99.61094  85.01793  84.67457  95.44125
 [8]  80.96641  80.60139  90.92814
> rowMin(tmp5)
 [1] 52.45139 55.15245       NA 61.56884 56.18443 53.12924 58.12387 58.47575
 [9] 54.58244 54.87939
> 
> colMeans(tmp5)
 [1] 108.26101  67.29007  70.40980  70.81319  69.32448  70.18324  71.47765
 [8]  74.58547  71.08780  71.28606  67.51364  67.39337        NA  71.91252
[15]  73.11210  68.76639  67.01572  68.49767  77.09837  69.71275
> colSums(tmp5)
 [1] 1082.6101  672.9007  704.0980  708.1319  693.2448  701.8324  714.7765
 [8]  745.8547  710.8780  712.8606  675.1364  673.9337        NA  719.1252
[15]  731.1210  687.6639  670.1572  684.9767  770.9837  697.1275
> colVars(tmp5)
 [1] 16161.22358    55.33406   109.86068    59.57190   100.87622   136.32110
 [7]    18.98605    72.63286    76.21995    49.91363    29.32163    72.57908
[13]          NA   129.12824   118.49156   119.15220    56.23155   154.57768
[19]    62.25351   106.06492
> colSd(tmp5)
 [1] 127.126801   7.438687  10.481445   7.718284  10.043715  11.675663
 [7]   4.357298   8.522491   8.730404   7.064958   5.414945   8.519336
[13]         NA  11.363461  10.885383  10.915686   7.498770  12.432927
[19]   7.890089  10.298783
> colMax(tmp5)
 [1] 468.98808  77.76801  85.68054  81.14159  85.53531  91.54176  78.26090
 [8]  85.00836  85.20471  82.98161  74.44292  80.69389        NA  88.92457
[15]  92.46355  95.44125  76.27917  99.61094  90.92814  84.68441
> colMin(tmp5)
 [1] 53.12924 55.93046 54.87939 56.18443 52.45139 58.12387 63.90824 58.06729
 [9] 63.94390 56.65692 60.24726 56.03569       NA 54.58244 57.02624 58.66273
[17] 55.15245 59.18704 62.76466 54.01841
> 
> Max(tmp5,na.rm=TRUE)
[1] 468.9881
> Min(tmp5,na.rm=TRUE)
[1] 52.45139
> mean(tmp5,na.rm=TRUE)
[1] 72.2708
> Sum(tmp5,na.rm=TRUE)
[1] 14381.89
> Var(tmp5,na.rm=TRUE)
[1] 881.2876
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 89.28130 67.84948 69.50177 76.75346 68.63480 71.08124 70.77988 70.78016
 [9] 67.75831 70.14916
> rowSums(tmp5,na.rm=TRUE)
 [1] 1785.626 1356.990 1320.534 1535.069 1372.696 1421.625 1415.598 1415.603
 [9] 1355.166 1402.983
> rowVars(tmp5,na.rm=TRUE)
 [1] 8067.28811   57.26995   76.98247  107.64245   84.82183   68.07258
 [7]   92.73632   48.89741   64.65522  119.39005
> rowSd(tmp5,na.rm=TRUE)
 [1] 89.818083  7.567691  8.773965 10.375088  9.209877  8.250611  9.629970
 [8]  6.992668  8.040847 10.926575
> rowMax(tmp5,na.rm=TRUE)
 [1] 468.98808  80.06072  91.54176  99.61094  85.01793  84.67457  95.44125
 [8]  80.96641  80.60139  90.92814
> rowMin(tmp5,na.rm=TRUE)
 [1] 52.45139 55.15245 54.01841 61.56884 56.18443 53.12924 58.12387 58.47575
 [9] 54.58244 54.87939
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 108.26101  67.29007  70.40980  70.81319  69.32448  70.18324  71.47765
 [8]  74.58547  71.08780  71.28606  67.51364  67.39337  69.38624  71.91252
[15]  73.11210  68.76639  67.01572  68.49767  77.09837  69.71275
> colSums(tmp5,na.rm=TRUE)
 [1] 1082.6101  672.9007  704.0980  708.1319  693.2448  701.8324  714.7765
 [8]  745.8547  710.8780  712.8606  675.1364  673.9337  624.4762  719.1252
[15]  731.1210  687.6639  670.1572  684.9767  770.9837  697.1275
> colVars(tmp5,na.rm=TRUE)
 [1] 16161.22358    55.33406   109.86068    59.57190   100.87622   136.32110
 [7]    18.98605    72.63286    76.21995    49.91363    29.32163    72.57908
[13]    54.77017   129.12824   118.49156   119.15220    56.23155   154.57768
[19]    62.25351   106.06492
> colSd(tmp5,na.rm=TRUE)
 [1] 127.126801   7.438687  10.481445   7.718284  10.043715  11.675663
 [7]   4.357298   8.522491   8.730404   7.064958   5.414945   8.519336
[13]   7.400687  11.363461  10.885383  10.915686   7.498770  12.432927
[19]   7.890089  10.298783
> colMax(tmp5,na.rm=TRUE)
 [1] 468.98808  77.76801  85.68054  81.14159  85.53531  91.54176  78.26090
 [8]  85.00836  85.20471  82.98161  74.44292  80.69389  81.69851  88.92457
[15]  92.46355  95.44125  76.27917  99.61094  90.92814  84.68441
> colMin(tmp5,na.rm=TRUE)
 [1] 53.12924 55.93046 54.87939 56.18443 52.45139 58.12387 63.90824 58.06729
 [9] 63.94390 56.65692 60.24726 56.03569 56.95480 54.58244 57.02624 58.66273
[17] 55.15245 59.18704 62.76466 54.01841
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1] 89.28130 67.84948      NaN 76.75346 68.63480 71.08124 70.77988 70.78016
 [9] 67.75831 70.14916
> rowSums(tmp5,na.rm=TRUE)
 [1] 1785.626 1356.990    0.000 1535.069 1372.696 1421.625 1415.598 1415.603
 [9] 1355.166 1402.983
> rowVars(tmp5,na.rm=TRUE)
 [1] 8067.28811   57.26995         NA  107.64245   84.82183   68.07258
 [7]   92.73632   48.89741   64.65522  119.39005
> rowSd(tmp5,na.rm=TRUE)
 [1] 89.818083  7.567691        NA 10.375088  9.209877  8.250611  9.629970
 [8]  6.992668  8.040847 10.926575
> rowMax(tmp5,na.rm=TRUE)
 [1] 468.98808  80.06072        NA  99.61094  85.01793  84.67457  95.44125
 [8]  80.96641  80.60139  90.92814
> rowMin(tmp5,na.rm=TRUE)
 [1] 52.45139 55.15245       NA 61.56884 56.18443 53.12924 58.12387 58.47575
 [9] 54.58244 54.87939
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1] 112.88011  66.71461  70.63790  69.66559  70.13498  67.81007  72.31870
 [8]  74.50022  71.80060  71.15925  67.39204  67.98584       NaN  72.94461
[15]  72.24190  69.59206  65.98645  68.66385  77.99015  71.45656
> colSums(tmp5,na.rm=TRUE)
 [1] 1015.9210  600.4315  635.7411  626.9903  631.2148  610.2906  650.8683
 [8]  670.5020  646.2054  640.4333  606.5283  611.8725    0.0000  656.5015
[15]  650.1771  626.3285  593.8781  617.9746  701.9113  643.1091
> colVars(tmp5,na.rm=TRUE)
 [1] 17941.34520    58.52538   123.00794    52.20228   106.09559    90.00201
 [7]    13.40152    81.63020    80.03143    55.97194    32.82049    77.70257
[13]          NA   133.28549   124.78400   126.37678    51.34224   173.58920
[19]    61.08847    85.11302
> colSd(tmp5,na.rm=TRUE)
 [1] 133.945307   7.650188  11.090895   7.225115  10.300271   9.486939
 [7]   3.660809   9.034943   8.946028   7.481440   5.728917   8.814906
[13]         NA  11.544933  11.170676  11.241743   7.165350  13.175326
[19]   7.815911   9.225672
> colMax(tmp5,na.rm=TRUE)
 [1] 468.98808  77.76801  85.68054  76.42821  85.53531  87.11732  78.26090
 [8]  85.00836  85.20471  82.98161  74.44292  80.69389      -Inf  88.92457
[15]  92.46355  95.44125  76.11388  99.61094  90.92814  84.68441
> colMin(tmp5,na.rm=TRUE)
 [1] 53.12924 55.93046 54.87939 56.18443 52.45139 58.12387 65.23151 58.06729
 [9] 63.94390 56.65692 60.24726 56.03569      Inf 54.58244 57.02624 58.66273
[17] 55.15245 59.18704 62.76466 59.88055
> 
> 
> 
> 
> 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] 135.3574 144.5133 125.6562 387.1852 271.3956 242.4365 245.1594 233.7619
 [9] 305.7130 237.2662
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 135.3574 144.5133 125.6562 387.1852 271.3956 242.4365 245.1594 233.7619
 [9] 305.7130 237.2662
> 
> 
> 
> 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]  2.273737e-13  5.684342e-14 -8.526513e-14  0.000000e+00 -2.842171e-14
 [6]  5.684342e-14  1.421085e-14  4.263256e-14 -1.136868e-13  8.526513e-14
[11] -2.273737e-13 -8.526513e-14  5.684342e-14 -2.842171e-14  5.684342e-14
[16] -5.684342e-14  8.526513e-14 -2.842171e-14 -2.842171e-14 -8.526513e-14
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> ## making sure these things agree
> ##
> ## first when there is no NA
> 
> 
> 
> agree.checks <- function(buff.matrix,r.matrix,err.tol=1e-10){
+ 
+   if (Max(buff.matrix,na.rm=TRUE) != max(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Max")
+   }
+   
+ 
+   if (Min(buff.matrix,na.rm=TRUE) != min(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Min")
+   }
+ 
+ 
+   if (abs(Sum(buff.matrix,na.rm=TRUE)- sum(r.matrix,na.rm=TRUE)) > err.tol){
+ 
+     cat(Sum(buff.matrix,na.rm=TRUE),"\n")
+     cat(sum(r.matrix,na.rm=TRUE),"\n")
+     cat(Sum(buff.matrix,na.rm=TRUE) - sum(r.matrix,na.rm=TRUE),"\n")
+     
+     stop("No agreement in Sum")
+   }
+   
+   if (abs(mean(buff.matrix,na.rm=TRUE) - mean(r.matrix,na.rm=TRUE)) > err.tol){
+     stop("No agreement in mean")
+   }
+   
+   
+   if(abs(Var(buff.matrix,na.rm=TRUE) - var(as.vector(r.matrix),na.rm=TRUE)) > err.tol){
+     stop("No agreement in Var")
+   }
+   
+   
+ 
+   if(any(abs(rowMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,mean,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowMeans")
+   }
+   
+   
+   if(any(abs(colMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,mean,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colMeans")
+   }
+   
+   
+   if(any(abs(rowSums(buff.matrix,na.rm=TRUE)  -  apply(r.matrix,1,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in rowSums")
+   }
+   
+   
+   if(any(abs(colSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colSums")
+   }
+   
+   ### this is to get around the fact that R doesn't like to compute NA on an entire vector of NA when 
+   ### computing variance
+   my.Var <- function(x,na.rm=FALSE){
+    if (all(is.na(x))){
+      return(NA)
+    } else {
+      var(x,na.rm=na.rm)
+    }
+ 
+   }
+   
+   if(any(abs(rowVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+   
+   
+   if(any(abs(colVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+ 
+ 
+   if(any(abs(rowMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+ 
+   if(any(abs(colMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+   
+   
+   if(any(abs(rowMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+   
+ 
+   if(any(abs(colMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+ 
+   if(any(abs(colMedians(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,median,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMedian")
+   }
+ 
+   if(any(abs(colRanges(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,range,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colRanges")
+   }
+ 
+ 
+   
+ }
> 
> 
> 
> 
> 
> 
> 
> 
> 
> for (rep in 1:20){
+   copymatrix <- matrix(rnorm(200,150,15),10,20)
+   
+   tmp5[1:10,1:20] <- copymatrix
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ## now lets assign some NA values and check agreement
+ 
+   which.row <- sample(1:10,1,replace=TRUE)
+   which.col  <- sample(1:20,1,replace=TRUE)
+   
+   cat(which.row," ",which.col,"\n")
+   
+   tmp5[which.row,which.col] <- NA
+   copymatrix[which.row,which.col] <- NA
+   
+   agree.checks(tmp5,copymatrix)
+ 
+   ## make an entire row NA
+   tmp5[which.row,] <- NA
+   copymatrix[which.row,] <- NA
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ### also make an entire col NA
+   tmp5[,which.col] <- NA
+   copymatrix[,which.col] <- NA
+ 
+   agree.checks(tmp5,copymatrix)
+ 
+   ### now make 1 element non NA with NA in the rest of row and column
+ 
+   tmp5[which.row,which.col] <- rnorm(1,150,15)
+   copymatrix[which.row,which.col] <- tmp5[which.row,which.col]
+ 
+   agree.checks(tmp5,copymatrix)
+ }
8   10 
4   19 
1   18 
7   4 
4   17 
7   15 
7   4 
2   4 
2   14 
6   13 
7   1 
2   18 
9   9 
9   1 
6   17 
2   11 
8   15 
4   2 
5   4 
1   20 
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.685686
> Min(tmp)
[1] -2.434939
> mean(tmp)
[1] -0.05807649
> Sum(tmp)
[1] -5.807649
> Var(tmp)
[1] 1.087019
> 
> rowMeans(tmp)
[1] -0.05807649
> rowSums(tmp)
[1] -5.807649
> rowVars(tmp)
[1] 1.087019
> rowSd(tmp)
[1] 1.042602
> rowMax(tmp)
[1] 2.685686
> rowMin(tmp)
[1] -2.434939
> 
> colMeans(tmp)
  [1] -0.11555630  0.67379644 -0.61749520 -0.72111077 -1.33191524  0.07524809
  [7] -0.10865056 -2.35754210  0.28286594  0.09483582 -0.07809666  1.03857845
 [13] -0.99398625  0.15485237 -0.39679989  0.78474260 -0.44247463  0.80675494
 [19]  0.37715687  1.90884389  0.81610813 -0.78155804 -1.29313706  0.63953293
 [25]  0.05173363  0.69519687  0.32858828 -0.86935222 -0.61760184  0.34778060
 [31] -1.44583307  0.82273895  0.26776798  0.69948461  0.17192093  0.74733731
 [37]  0.92140793 -1.08111071  0.20161032 -0.36497841  0.30479290 -2.43493878
 [43] -0.62416048 -0.10342430 -0.66453948  0.54684155  0.07425754 -0.02067601
 [49] -0.87962646  2.63218698 -1.73983165  1.04454421  1.17578354 -0.05395172
 [55]  1.55953036  0.91074945 -1.56197988 -0.07406391 -2.16089168 -1.30116981
 [61] -0.68869796  0.70552342 -0.17656314 -1.46798273 -0.48068115 -2.17750202
 [67] -0.11545614  1.54094394 -0.47458508 -2.11612431 -0.00694896 -0.41204518
 [73] -0.12531377 -0.35823909 -0.97180463  0.97025604 -1.30465139  0.33241240
 [79] -0.84122832  0.50353122 -0.84176155  2.68568617 -1.50436750  1.37297435
 [85] -1.48842968  1.32984174  1.40038728 -1.44007099 -0.84169863  0.41470721
 [91]  0.89384012 -0.08954248 -0.39633946  0.43463218 -0.28738456  2.03600365
 [97]  0.69591224  0.60268444  0.36153165  0.59778413
> colSums(tmp)
  [1] -0.11555630  0.67379644 -0.61749520 -0.72111077 -1.33191524  0.07524809
  [7] -0.10865056 -2.35754210  0.28286594  0.09483582 -0.07809666  1.03857845
 [13] -0.99398625  0.15485237 -0.39679989  0.78474260 -0.44247463  0.80675494
 [19]  0.37715687  1.90884389  0.81610813 -0.78155804 -1.29313706  0.63953293
 [25]  0.05173363  0.69519687  0.32858828 -0.86935222 -0.61760184  0.34778060
 [31] -1.44583307  0.82273895  0.26776798  0.69948461  0.17192093  0.74733731
 [37]  0.92140793 -1.08111071  0.20161032 -0.36497841  0.30479290 -2.43493878
 [43] -0.62416048 -0.10342430 -0.66453948  0.54684155  0.07425754 -0.02067601
 [49] -0.87962646  2.63218698 -1.73983165  1.04454421  1.17578354 -0.05395172
 [55]  1.55953036  0.91074945 -1.56197988 -0.07406391 -2.16089168 -1.30116981
 [61] -0.68869796  0.70552342 -0.17656314 -1.46798273 -0.48068115 -2.17750202
 [67] -0.11545614  1.54094394 -0.47458508 -2.11612431 -0.00694896 -0.41204518
 [73] -0.12531377 -0.35823909 -0.97180463  0.97025604 -1.30465139  0.33241240
 [79] -0.84122832  0.50353122 -0.84176155  2.68568617 -1.50436750  1.37297435
 [85] -1.48842968  1.32984174  1.40038728 -1.44007099 -0.84169863  0.41470721
 [91]  0.89384012 -0.08954248 -0.39633946  0.43463218 -0.28738456  2.03600365
 [97]  0.69591224  0.60268444  0.36153165  0.59778413
> 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.11555630  0.67379644 -0.61749520 -0.72111077 -1.33191524  0.07524809
  [7] -0.10865056 -2.35754210  0.28286594  0.09483582 -0.07809666  1.03857845
 [13] -0.99398625  0.15485237 -0.39679989  0.78474260 -0.44247463  0.80675494
 [19]  0.37715687  1.90884389  0.81610813 -0.78155804 -1.29313706  0.63953293
 [25]  0.05173363  0.69519687  0.32858828 -0.86935222 -0.61760184  0.34778060
 [31] -1.44583307  0.82273895  0.26776798  0.69948461  0.17192093  0.74733731
 [37]  0.92140793 -1.08111071  0.20161032 -0.36497841  0.30479290 -2.43493878
 [43] -0.62416048 -0.10342430 -0.66453948  0.54684155  0.07425754 -0.02067601
 [49] -0.87962646  2.63218698 -1.73983165  1.04454421  1.17578354 -0.05395172
 [55]  1.55953036  0.91074945 -1.56197988 -0.07406391 -2.16089168 -1.30116981
 [61] -0.68869796  0.70552342 -0.17656314 -1.46798273 -0.48068115 -2.17750202
 [67] -0.11545614  1.54094394 -0.47458508 -2.11612431 -0.00694896 -0.41204518
 [73] -0.12531377 -0.35823909 -0.97180463  0.97025604 -1.30465139  0.33241240
 [79] -0.84122832  0.50353122 -0.84176155  2.68568617 -1.50436750  1.37297435
 [85] -1.48842968  1.32984174  1.40038728 -1.44007099 -0.84169863  0.41470721
 [91]  0.89384012 -0.08954248 -0.39633946  0.43463218 -0.28738456  2.03600365
 [97]  0.69591224  0.60268444  0.36153165  0.59778413
> colMin(tmp)
  [1] -0.11555630  0.67379644 -0.61749520 -0.72111077 -1.33191524  0.07524809
  [7] -0.10865056 -2.35754210  0.28286594  0.09483582 -0.07809666  1.03857845
 [13] -0.99398625  0.15485237 -0.39679989  0.78474260 -0.44247463  0.80675494
 [19]  0.37715687  1.90884389  0.81610813 -0.78155804 -1.29313706  0.63953293
 [25]  0.05173363  0.69519687  0.32858828 -0.86935222 -0.61760184  0.34778060
 [31] -1.44583307  0.82273895  0.26776798  0.69948461  0.17192093  0.74733731
 [37]  0.92140793 -1.08111071  0.20161032 -0.36497841  0.30479290 -2.43493878
 [43] -0.62416048 -0.10342430 -0.66453948  0.54684155  0.07425754 -0.02067601
 [49] -0.87962646  2.63218698 -1.73983165  1.04454421  1.17578354 -0.05395172
 [55]  1.55953036  0.91074945 -1.56197988 -0.07406391 -2.16089168 -1.30116981
 [61] -0.68869796  0.70552342 -0.17656314 -1.46798273 -0.48068115 -2.17750202
 [67] -0.11545614  1.54094394 -0.47458508 -2.11612431 -0.00694896 -0.41204518
 [73] -0.12531377 -0.35823909 -0.97180463  0.97025604 -1.30465139  0.33241240
 [79] -0.84122832  0.50353122 -0.84176155  2.68568617 -1.50436750  1.37297435
 [85] -1.48842968  1.32984174  1.40038728 -1.44007099 -0.84169863  0.41470721
 [91]  0.89384012 -0.08954248 -0.39633946  0.43463218 -0.28738456  2.03600365
 [97]  0.69591224  0.60268444  0.36153165  0.59778413
> colMedians(tmp)
  [1] -0.11555630  0.67379644 -0.61749520 -0.72111077 -1.33191524  0.07524809
  [7] -0.10865056 -2.35754210  0.28286594  0.09483582 -0.07809666  1.03857845
 [13] -0.99398625  0.15485237 -0.39679989  0.78474260 -0.44247463  0.80675494
 [19]  0.37715687  1.90884389  0.81610813 -0.78155804 -1.29313706  0.63953293
 [25]  0.05173363  0.69519687  0.32858828 -0.86935222 -0.61760184  0.34778060
 [31] -1.44583307  0.82273895  0.26776798  0.69948461  0.17192093  0.74733731
 [37]  0.92140793 -1.08111071  0.20161032 -0.36497841  0.30479290 -2.43493878
 [43] -0.62416048 -0.10342430 -0.66453948  0.54684155  0.07425754 -0.02067601
 [49] -0.87962646  2.63218698 -1.73983165  1.04454421  1.17578354 -0.05395172
 [55]  1.55953036  0.91074945 -1.56197988 -0.07406391 -2.16089168 -1.30116981
 [61] -0.68869796  0.70552342 -0.17656314 -1.46798273 -0.48068115 -2.17750202
 [67] -0.11545614  1.54094394 -0.47458508 -2.11612431 -0.00694896 -0.41204518
 [73] -0.12531377 -0.35823909 -0.97180463  0.97025604 -1.30465139  0.33241240
 [79] -0.84122832  0.50353122 -0.84176155  2.68568617 -1.50436750  1.37297435
 [85] -1.48842968  1.32984174  1.40038728 -1.44007099 -0.84169863  0.41470721
 [91]  0.89384012 -0.08954248 -0.39633946  0.43463218 -0.28738456  2.03600365
 [97]  0.69591224  0.60268444  0.36153165  0.59778413
> colRanges(tmp)
           [,1]      [,2]       [,3]       [,4]      [,5]       [,6]       [,7]
[1,] -0.1155563 0.6737964 -0.6174952 -0.7211108 -1.331915 0.07524809 -0.1086506
[2,] -0.1155563 0.6737964 -0.6174952 -0.7211108 -1.331915 0.07524809 -0.1086506
          [,8]      [,9]      [,10]       [,11]    [,12]      [,13]     [,14]
[1,] -2.357542 0.2828659 0.09483582 -0.07809666 1.038578 -0.9939863 0.1548524
[2,] -2.357542 0.2828659 0.09483582 -0.07809666 1.038578 -0.9939863 0.1548524
          [,15]     [,16]      [,17]     [,18]     [,19]    [,20]     [,21]
[1,] -0.3967999 0.7847426 -0.4424746 0.8067549 0.3771569 1.908844 0.8161081
[2,] -0.3967999 0.7847426 -0.4424746 0.8067549 0.3771569 1.908844 0.8161081
         [,22]     [,23]     [,24]      [,25]     [,26]     [,27]      [,28]
[1,] -0.781558 -1.293137 0.6395329 0.05173363 0.6951969 0.3285883 -0.8693522
[2,] -0.781558 -1.293137 0.6395329 0.05173363 0.6951969 0.3285883 -0.8693522
          [,29]     [,30]     [,31]     [,32]    [,33]     [,34]     [,35]
[1,] -0.6176018 0.3477806 -1.445833 0.8227389 0.267768 0.6994846 0.1719209
[2,] -0.6176018 0.3477806 -1.445833 0.8227389 0.267768 0.6994846 0.1719209
         [,36]     [,37]     [,38]     [,39]      [,40]     [,41]     [,42]
[1,] 0.7473373 0.9214079 -1.081111 0.2016103 -0.3649784 0.3047929 -2.434939
[2,] 0.7473373 0.9214079 -1.081111 0.2016103 -0.3649784 0.3047929 -2.434939
          [,43]      [,44]      [,45]     [,46]      [,47]       [,48]
[1,] -0.6241605 -0.1034243 -0.6645395 0.5468416 0.07425754 -0.02067601
[2,] -0.6241605 -0.1034243 -0.6645395 0.5468416 0.07425754 -0.02067601
          [,49]    [,50]     [,51]    [,52]    [,53]       [,54]   [,55]
[1,] -0.8796265 2.632187 -1.739832 1.044544 1.175784 -0.05395172 1.55953
[2,] -0.8796265 2.632187 -1.739832 1.044544 1.175784 -0.05395172 1.55953
         [,56]    [,57]       [,58]     [,59]    [,60]     [,61]     [,62]
[1,] 0.9107495 -1.56198 -0.07406391 -2.160892 -1.30117 -0.688698 0.7055234
[2,] 0.9107495 -1.56198 -0.07406391 -2.160892 -1.30117 -0.688698 0.7055234
          [,63]     [,64]      [,65]     [,66]      [,67]    [,68]      [,69]
[1,] -0.1765631 -1.467983 -0.4806812 -2.177502 -0.1154561 1.540944 -0.4745851
[2,] -0.1765631 -1.467983 -0.4806812 -2.177502 -0.1154561 1.540944 -0.4745851
         [,70]       [,71]      [,72]      [,73]      [,74]      [,75]    [,76]
[1,] -2.116124 -0.00694896 -0.4120452 -0.1253138 -0.3582391 -0.9718046 0.970256
[2,] -2.116124 -0.00694896 -0.4120452 -0.1253138 -0.3582391 -0.9718046 0.970256
         [,77]     [,78]      [,79]     [,80]      [,81]    [,82]     [,83]
[1,] -1.304651 0.3324124 -0.8412283 0.5035312 -0.8417615 2.685686 -1.504367
[2,] -1.304651 0.3324124 -0.8412283 0.5035312 -0.8417615 2.685686 -1.504367
        [,84]    [,85]    [,86]    [,87]     [,88]      [,89]     [,90]
[1,] 1.372974 -1.48843 1.329842 1.400387 -1.440071 -0.8416986 0.4147072
[2,] 1.372974 -1.48843 1.329842 1.400387 -1.440071 -0.8416986 0.4147072
         [,91]       [,92]      [,93]     [,94]      [,95]    [,96]     [,97]
[1,] 0.8938401 -0.08954248 -0.3963395 0.4346322 -0.2873846 2.036004 0.6959122
[2,] 0.8938401 -0.08954248 -0.3963395 0.4346322 -0.2873846 2.036004 0.6959122
         [,98]     [,99]    [,100]
[1,] 0.6026844 0.3615316 0.5977841
[2,] 0.6026844 0.3615316 0.5977841
> 
> 
> Max(tmp2)
[1] 2.25775
> Min(tmp2)
[1] -2.724296
> mean(tmp2)
[1] -0.02999068
> Sum(tmp2)
[1] -2.999068
> Var(tmp2)
[1] 1.014232
> 
> rowMeans(tmp2)
  [1] -1.712053853 -0.624915448  0.116028325  1.808513903 -0.403047101
  [6] -1.119850566 -0.966094494  0.590718950  1.456402124  0.831493376
 [11]  0.332042833 -0.591433998 -0.954806930 -0.728453916  0.625976965
 [16]  0.980920196 -0.596028671  0.139377785 -0.183355429 -1.053635053
 [21]  0.088933801  2.257749798  0.819801591 -2.724295791 -0.243872749
 [26] -0.858023256 -0.569615895  0.007915375 -0.888615750  0.700371506
 [31] -2.346164803 -0.186134830 -1.013197537 -0.017232699  0.378763930
 [36] -0.469535278  1.017072194 -1.866076601 -0.266812482 -0.038979082
 [41]  0.170761805 -0.309976396  2.184453007  1.732035128  0.386868011
 [46]  1.788268382  1.286041000 -1.052875264 -0.038220052 -0.818046086
 [51] -0.761360468  0.535352323  0.692963396 -1.320934242 -0.203899555
 [56]  0.222736142 -0.537600266  0.439339725 -0.563752192  0.431913157
 [61]  1.358103787  0.051627163  0.387828858 -0.042165471 -0.024267286
 [66] -1.457852712  1.293008525  0.125546723 -0.058975562 -1.752611423
 [71]  0.474236027 -1.366518532 -0.950838969 -1.481517900 -0.635803107
 [76] -0.414715167  1.007898762  0.804137610 -0.968847849 -0.422779258
 [81]  0.955699460  0.095244280 -0.059251435  0.504438942 -1.547097495
 [86]  0.914899606  0.534303644 -0.238271175 -1.448815302  0.164764998
 [91]  1.122306035 -0.798701374 -0.600821862  1.434486555  1.157092500
 [96] -0.847636758  2.186306098 -0.230640884  0.376827857  1.406385799
> rowSums(tmp2)
  [1] -1.712053853 -0.624915448  0.116028325  1.808513903 -0.403047101
  [6] -1.119850566 -0.966094494  0.590718950  1.456402124  0.831493376
 [11]  0.332042833 -0.591433998 -0.954806930 -0.728453916  0.625976965
 [16]  0.980920196 -0.596028671  0.139377785 -0.183355429 -1.053635053
 [21]  0.088933801  2.257749798  0.819801591 -2.724295791 -0.243872749
 [26] -0.858023256 -0.569615895  0.007915375 -0.888615750  0.700371506
 [31] -2.346164803 -0.186134830 -1.013197537 -0.017232699  0.378763930
 [36] -0.469535278  1.017072194 -1.866076601 -0.266812482 -0.038979082
 [41]  0.170761805 -0.309976396  2.184453007  1.732035128  0.386868011
 [46]  1.788268382  1.286041000 -1.052875264 -0.038220052 -0.818046086
 [51] -0.761360468  0.535352323  0.692963396 -1.320934242 -0.203899555
 [56]  0.222736142 -0.537600266  0.439339725 -0.563752192  0.431913157
 [61]  1.358103787  0.051627163  0.387828858 -0.042165471 -0.024267286
 [66] -1.457852712  1.293008525  0.125546723 -0.058975562 -1.752611423
 [71]  0.474236027 -1.366518532 -0.950838969 -1.481517900 -0.635803107
 [76] -0.414715167  1.007898762  0.804137610 -0.968847849 -0.422779258
 [81]  0.955699460  0.095244280 -0.059251435  0.504438942 -1.547097495
 [86]  0.914899606  0.534303644 -0.238271175 -1.448815302  0.164764998
 [91]  1.122306035 -0.798701374 -0.600821862  1.434486555  1.157092500
 [96] -0.847636758  2.186306098 -0.230640884  0.376827857  1.406385799
> 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] -1.712053853 -0.624915448  0.116028325  1.808513903 -0.403047101
  [6] -1.119850566 -0.966094494  0.590718950  1.456402124  0.831493376
 [11]  0.332042833 -0.591433998 -0.954806930 -0.728453916  0.625976965
 [16]  0.980920196 -0.596028671  0.139377785 -0.183355429 -1.053635053
 [21]  0.088933801  2.257749798  0.819801591 -2.724295791 -0.243872749
 [26] -0.858023256 -0.569615895  0.007915375 -0.888615750  0.700371506
 [31] -2.346164803 -0.186134830 -1.013197537 -0.017232699  0.378763930
 [36] -0.469535278  1.017072194 -1.866076601 -0.266812482 -0.038979082
 [41]  0.170761805 -0.309976396  2.184453007  1.732035128  0.386868011
 [46]  1.788268382  1.286041000 -1.052875264 -0.038220052 -0.818046086
 [51] -0.761360468  0.535352323  0.692963396 -1.320934242 -0.203899555
 [56]  0.222736142 -0.537600266  0.439339725 -0.563752192  0.431913157
 [61]  1.358103787  0.051627163  0.387828858 -0.042165471 -0.024267286
 [66] -1.457852712  1.293008525  0.125546723 -0.058975562 -1.752611423
 [71]  0.474236027 -1.366518532 -0.950838969 -1.481517900 -0.635803107
 [76] -0.414715167  1.007898762  0.804137610 -0.968847849 -0.422779258
 [81]  0.955699460  0.095244280 -0.059251435  0.504438942 -1.547097495
 [86]  0.914899606  0.534303644 -0.238271175 -1.448815302  0.164764998
 [91]  1.122306035 -0.798701374 -0.600821862  1.434486555  1.157092500
 [96] -0.847636758  2.186306098 -0.230640884  0.376827857  1.406385799
> rowMin(tmp2)
  [1] -1.712053853 -0.624915448  0.116028325  1.808513903 -0.403047101
  [6] -1.119850566 -0.966094494  0.590718950  1.456402124  0.831493376
 [11]  0.332042833 -0.591433998 -0.954806930 -0.728453916  0.625976965
 [16]  0.980920196 -0.596028671  0.139377785 -0.183355429 -1.053635053
 [21]  0.088933801  2.257749798  0.819801591 -2.724295791 -0.243872749
 [26] -0.858023256 -0.569615895  0.007915375 -0.888615750  0.700371506
 [31] -2.346164803 -0.186134830 -1.013197537 -0.017232699  0.378763930
 [36] -0.469535278  1.017072194 -1.866076601 -0.266812482 -0.038979082
 [41]  0.170761805 -0.309976396  2.184453007  1.732035128  0.386868011
 [46]  1.788268382  1.286041000 -1.052875264 -0.038220052 -0.818046086
 [51] -0.761360468  0.535352323  0.692963396 -1.320934242 -0.203899555
 [56]  0.222736142 -0.537600266  0.439339725 -0.563752192  0.431913157
 [61]  1.358103787  0.051627163  0.387828858 -0.042165471 -0.024267286
 [66] -1.457852712  1.293008525  0.125546723 -0.058975562 -1.752611423
 [71]  0.474236027 -1.366518532 -0.950838969 -1.481517900 -0.635803107
 [76] -0.414715167  1.007898762  0.804137610 -0.968847849 -0.422779258
 [81]  0.955699460  0.095244280 -0.059251435  0.504438942 -1.547097495
 [86]  0.914899606  0.534303644 -0.238271175 -1.448815302  0.164764998
 [91]  1.122306035 -0.798701374 -0.600821862  1.434486555  1.157092500
 [96] -0.847636758  2.186306098 -0.230640884  0.376827857  1.406385799
> 
> colMeans(tmp2)
[1] -0.02999068
> colSums(tmp2)
[1] -2.999068
> colVars(tmp2)
[1] 1.014232
> colSd(tmp2)
[1] 1.007091
> colMax(tmp2)
[1] 2.25775
> colMin(tmp2)
[1] -2.724296
> colMedians(tmp2)
[1] -0.03859957
> colRanges(tmp2)
          [,1]
[1,] -2.724296
[2,]  2.257750
> 
> 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] -0.5333683  1.9495824  5.5905780 -1.6559529  1.2288060  1.0648037
 [7]  1.6420272 -4.4924846 -2.4513739  5.0921295
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -0.9170560
[2,] -0.3578661
[3,] -0.1816542
[4,]  0.1353290
[5,]  1.3223675
> 
> rowApply(tmp,sum)
 [1]  1.0472506  3.2026585  8.6221308 -1.4263987  3.4363895  0.7940592
 [7] -3.0788782  0.5870259 -3.2017884 -2.5477020
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    4    2    1    9    7    4    5    8    3     7
 [2,]    9    1    8    8    9    2    3    2    6    10
 [3,]    8    5   10   10    6    5    4    9    9     1
 [4,]    3   10    5    6    1    1    9    3    7     2
 [5,]    7    7    6    5    3    9    8    6    4     5
 [6,]    2    6    7    2   10    7    2    1   10     6
 [7,]    1    3    2    4    4    8   10   10    8     9
 [8,]    6    9    4    1    5    3    1    4    5     3
 [9,]   10    8    3    3    2    6    6    7    1     4
[10,]    5    4    9    7    8   10    7    5    2     8
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1] -1.2472875  2.5151388 -1.4723673  0.9737350 -0.8475556 -1.9613959
 [7] -1.0756255 -3.0488851  2.5111675  1.2005275  1.8752516  0.2634763
[13] -1.7078991 -2.8373965  0.3138169 -1.4270688  0.3157886  0.3767359
[19]  2.3301307 -1.7263816
> colApply(tmp,quantile)[,1]
            [,1]
[1,] -1.61317638
[2,] -0.13929652
[3,] -0.05765423
[4,] -0.03699366
[5,]  0.59983325
> 
> rowApply(tmp,sum)
[1]   1.830949 -13.110815   3.950622  -1.342899   3.996048
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]    6    4    6   13   15
[2,]   10   20   18    9   12
[3,]   13    8    7    1   16
[4,]    3   18   11   16   10
[5,]   20   11    5    4    8
> 
> 
> as.matrix(tmp)
            [,1]        [,2]       [,3]       [,4]       [,5]        [,6]
[1,] -0.13929652  0.07396239  0.2513453 -0.6264369  1.2330605 -0.09311089
[2,] -1.61317638  0.94974570 -0.9023494  0.5292611 -0.6333364 -0.83160330
[3,] -0.05765423  1.44522959 -0.0566018  0.5573906 -0.9274184  0.38719047
[4,] -0.03699366 -0.39119800 -1.4620344  0.2512224 -0.6384322 -0.07973498
[5,]  0.59983325  0.43739911  0.6972730  0.2622977  0.1185710 -1.34413717
            [,7]        [,8]       [,9]      [,10]       [,11]      [,12]
[1,] -0.06210835 -1.34648265  0.3679583 -0.4143777 -0.12984882  0.6574486
[2,] -0.51940164 -0.90696949 -0.3782216 -0.6277029 -0.15561926 -0.8886322
[3,]  0.72535014 -1.23946247  0.6076495  0.5676237  0.82636848  0.6896887
[4,]  0.11757371 -0.04339942  0.8330054  2.2392489 -0.07891215 -0.5066307
[5,] -1.33703939  0.48742892  1.0807760 -0.5642645  1.41326333  0.3116019
           [,13]      [,14]       [,15]      [,16]      [,17]      [,18]
[1,] -0.48812826  0.6393076  0.60203652  0.1894457  1.0635337 -0.8179722
[2,] -1.17446090 -1.8856387 -0.05718256  0.6979578 -1.7817482  0.4112198
[3,]  0.32665013 -1.2689297 -0.93303712 -2.4284866  2.0170753  0.1509508
[4,]  0.02771706 -0.7912836 -0.45437113  0.2853356 -0.4180646 -0.3938445
[5,] -0.39967717  0.4691479  1.15637122 -0.1713213 -0.5650075  1.0263821
          [,19]      [,20]
[1,]  0.7535304  0.1170826
[2,] -1.1610545 -2.1819021
[3,]  1.5435252  1.0175202
[4,]  0.9576065 -0.7597087
[5,]  0.2365231  0.0806264
> 
> 
> is.BufferedMatrix(tmp)
[1] TRUE
> 
> as.BufferedMatrix(as.matrix(tmp))
BufferedMatrix object
Matrix size:  5 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  800  bytes.
> 
> 
> 
> subBufferedMatrix(tmp,1:5,1:5)
BufferedMatrix object
Matrix size:  5 5 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  644  bytes.
Disk usage :  200  bytes.
> subBufferedMatrix(tmp,,5:8)
BufferedMatrix object
Matrix size:  5 4 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  562  bytes.
Disk usage :  160  bytes.
> subBufferedMatrix(tmp,1:3,)
BufferedMatrix object
Matrix size:  3 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  480  bytes.
> 
> 
> rm(tmp)
> 
> 
> ###
> ### Testing colnames and rownames
> ###
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> 
> 
> colnames(tmp)
NULL
> rownames(tmp)
NULL
> 
> 
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> colnames(tmp)
 [1] "col1"  "col2"  "col3"  "col4"  "col5"  "col6"  "col7"  "col8"  "col9" 
[10] "col10" "col11" "col12" "col13" "col14" "col15" "col16" "col17" "col18"
[19] "col19" "col20"
> rownames(tmp)
[1] "row1" "row2" "row3" "row4" "row5"
> 
> 
> tmp["row1",]
          col1       col2     col3     col4     col5      col6      col7
row1 0.3042102 0.03380082 0.283129 2.307689 1.915638 -1.300643 0.6364027
        col8      col9    col10      col11     col12    col13   col14    col15
row1 -1.4197 0.3479598 1.636185 -0.6147785 0.5309488 1.747187 1.31944 0.375534
          col16     col17     col18      col19     col20
row1 -0.2520696 0.9543232 -1.595232 -0.5221602 -1.861379
> tmp[,"col10"]
          col10
row1  1.6361850
row2  1.2705425
row3  1.3429971
row4  0.6420492
row5 -1.0674284
> tmp[c("row1","row5"),]
          col1       col2      col3      col4      col5      col6      col7
row1 0.3042102 0.03380082  0.283129  2.307689  1.915638 -1.300643 0.6364027
row5 0.8414195 0.69858868 -1.224771 -1.621612 -1.718020 -1.909352 0.9438082
          col8      col9     col10      col11     col12     col13     col14
row1 -1.419700 0.3479598  1.636185 -0.6147785 0.5309488 1.7471875  1.319440
row5  1.463971 0.4705869 -1.067428 -0.8920360 1.0996871 0.1963202 -1.448473
          col15      col16      col17      col18      col19      col20
row1  0.3755340 -0.2520696  0.9543232 -1.5952317 -0.5221602 -1.8613793
row5 -0.2852591  0.7261688 -0.3400636 -0.4765768  1.0934675  0.2288516
> tmp[,c("col6","col20")]
           col6      col20
row1 -1.3006435 -1.8613793
row2 -2.4080061  0.5349793
row3  3.1755337  2.6134365
row4 -0.9182905 -1.6030076
row5 -1.9093524  0.2288516
> tmp[c("row1","row5"),c("col6","col20")]
          col6      col20
row1 -1.300643 -1.8613793
row5 -1.909352  0.2288516
> 
> 
> 
> 
> tmp["row1",] <- rnorm(20,mean=10)
> tmp[,"col10"] <- rnorm(5,mean=30)
> tmp[c("row1","row5"),] <- rnorm(40,mean=50)
> tmp[,c("col6","col20")] <- rnorm(10,mean=75)
> tmp[c("row1","row5"),c("col6","col20")]  <- rnorm(4,mean=105)
> 
> tmp["row1",]
         col1     col2     col3     col4     col5     col6    col7     col8
row1 50.44297 48.90839 48.42376 49.56827 49.56765 103.3965 52.0023 49.71598
         col9    col10    col11    col12    col13    col14   col15    col16
row1 51.39565 50.09516 48.04754 50.92698 50.11839 50.55422 50.6741 49.94073
        col17    col18    col19    col20
row1 49.96166 47.61019 49.33053 105.6534
> tmp[,"col10"]
        col10
row1 50.09516
row2 30.49081
row3 29.46232
row4 28.25989
row5 48.94105
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 50.44297 48.90839 48.42376 49.56827 49.56765 103.3965 52.00230 49.71598
row5 51.58420 48.98854 49.87702 48.86293 48.89728 104.4836 52.53198 49.90035
         col9    col10    col11    col12    col13    col14    col15    col16
row1 51.39565 50.09516 48.04754 50.92698 50.11839 50.55422 50.67410 49.94073
row5 49.58956 48.94105 49.31949 49.53685 49.85966 51.70489 49.46902 49.89288
        col17    col18    col19    col20
row1 49.96166 47.61019 49.33053 105.6534
row5 50.84978 50.09963 51.11618 104.0239
> tmp[,c("col6","col20")]
          col6     col20
row1 103.39654 105.65335
row2  74.10038  75.70813
row3  74.85359  74.91010
row4  75.64856  74.61166
row5 104.48364 104.02387
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 103.3965 105.6534
row5 104.4836 104.0239
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 103.3965 105.6534
row5 104.4836 104.0239
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
           col13
[1,]  0.26017240
[2,]  0.43189284
[3,]  1.03159374
[4,]  1.41739565
[5,] -0.08328064
> tmp[,c("col17","col7")]
          col17       col7
[1,] -1.5013891  1.4034557
[2,]  0.3535986  0.6343811
[3,]  0.6007301 -0.7032471
[4,] -0.3448235 -0.1514491
[5,]  0.6069600  0.1522176
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
           col6      col20
[1,]  0.5650995 -0.1945559
[2,] -2.2494411 -0.5952126
[3,] -0.7970577 -0.4930617
[4,] -0.4795459 -2.2805411
[5,]  0.4795271  0.3736762
> subBufferedMatrix(tmp,1,c("col6"))[,1]
          col1
[1,] 0.5650995
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
           col6
[1,]  0.5650995
[2,] -2.2494411
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> 
> 
> 
> subBufferedMatrix(tmp,c("row3","row1"),)[,1:20]
          [,1]       [,2]      [,3]       [,4]       [,5]       [,6]      [,7]
row3 -0.116540 -1.1646584  1.682768 -0.7073249 -0.1463693 -0.1500886 0.5139702
row1 -1.513292 -0.4814543 -2.495022 -0.6023165  1.2386459 -1.1016600 1.2325293
           [,8]      [,9]    [,10]      [,11]      [,12]     [,13]      [,14]
row3  1.4241615 -1.359081 1.972014 -0.8891318 -0.1938842 1.8566998  0.5547853
row1 -0.4332207 -1.207277 1.197258  0.4011264  0.2574840 0.1236656 -0.8638794
          [,15]     [,16]     [,17]      [,18]      [,19]     [,20]
row3 -0.6382571 0.2516431 0.2335248 -0.4671640 -0.2979834 0.2311978
row1  0.1996776 0.5128405 0.6784090 -0.4823052 -0.6345610 1.5506993
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
          [,1]       [,2]      [,3]       [,4]     [,5]      [,6]       [,7]
row2 0.6394509 -0.8931439 -0.568851 -0.2557265 1.213242 0.2036723 -0.4181541
         [,8]     [,9]       [,10]
row2 1.056599 0.694154 -0.01769401
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
           [,1]      [,2]       [,3]      [,4]      [,5]       [,6]     [,7]
row5 -0.3960511 -1.455011 0.02185965 -2.093485 0.2303758 0.06779888 1.019669
          [,8]      [,9]      [,10]    [,11]     [,12]     [,13]      [,14]
row5 -1.030726 -0.968707 -0.8213531 -2.12462 0.1859841 0.8812366 0.08230739
          [,15]     [,16]    [,17]      [,18]      [,19]      [,20]
row5 -0.9208021 0.6624538 -2.38479 -0.3763229 -0.3028949 -0.6598878
> 
> 
> 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: 0x55633bc18020>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "/home/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests/BM841bb38c41f2e"
 [2] "/home/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests/BM841bb84e6998" 
 [3] "/home/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests/BM841bb5a90b75a"
 [4] "/home/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests/BM841bb46f40461"
 [5] "/home/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests/BM841bb3989105e"
 [6] "/home/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests/BM841bbc3e69e9" 
 [7] "/home/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests/BM841bb796c5c93"
 [8] "/home/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests/BM841bb5b4658bf"
 [9] "/home/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests/BM841bb18f57e2d"
[10] "/home/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests/BM841bb429bc25e"
[11] "/home/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests/BM841bb5ccdc6e8"
[12] "/home/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests/BM841bb287eb818"
[13] "/home/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests/BM841bb63d05254"
[14] "/home/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests/BM841bb27fa78a1"
[15] "/home/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests/BM841bb44c2d65c"
> 
> 
> ### 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: 0x55633a8eb7a0>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x55633a8eb7a0>
Warning message:
In dir.create(new.directory) :
  '/home/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x55633a8eb7a0>
> rowMedians(tmp)
  [1] -0.0897431796 -0.0074096244 -0.4615275751  0.5240099748  0.6238447027
  [6] -0.3307206160 -0.1669259957  0.5469336474  0.5122529319 -0.3007235216
 [11]  0.1940002696  0.6515117975  0.3858286406  0.3360616706 -0.1161530770
 [16]  0.2559652884 -0.4456317276 -0.2085011461 -0.0717674782  0.1322469990
 [21] -0.1913257312 -0.1757678407  0.5702030926 -0.0697031378  0.0219915325
 [26] -0.3010790773 -0.2051167329 -0.1137911677 -0.2575981015  0.4746684649
 [31]  0.3170478036 -0.0147382424 -0.2381128770  0.0170850695 -0.2300250963
 [36] -0.0326674354  0.0486643176 -0.2095127708 -0.0044832989  0.0837041514
 [41]  0.2015843145  0.3237163833 -0.2707865909  0.1933855871 -0.3246070974
 [46]  0.1672911239  0.3846671732  0.0398616831  0.4362839843 -0.3816966993
 [51]  0.1010967320 -0.2098529339 -0.1273789472  0.1264398837  0.2568666727
 [56]  0.3970513469 -0.3233179820  0.4242804086  0.1571671206 -0.5077571661
 [61] -0.0067952370  0.1273522718 -0.1598302331  0.5542622570 -0.0004425680
 [66]  0.2856419155 -0.0374082522 -0.0304287666 -0.3454632783 -0.3999690793
 [71]  0.2661451143  0.2199231667 -0.2086433762 -0.3513316840  0.7785635489
 [76]  0.2219992291 -0.2834573580 -0.3913367684  0.2380960337  0.0402656420
 [81]  0.0897107234 -0.3425969059 -0.2519190922  0.0649027045 -0.1104828716
 [86] -0.0653771930  0.2197518468 -0.0637321149  0.2869178015  0.4576287381
 [91] -0.1335789474  0.0971937079  0.3051930903 -0.8282665784  0.0532013826
 [96]  0.1721498702  0.2395829266 -0.2530494982  0.1507547696 -0.1215543235
[101] -0.0228127319 -0.3443400905  0.2260489031  0.1674140251 -0.2950218278
[106] -0.5351429404 -0.0424205241  0.0796849997  0.4591024917 -0.5666630090
[111]  0.4462872924 -0.1366298803 -0.4308183300 -0.1881089507 -0.3626386748
[116] -0.5407651355 -0.1880000120 -0.0052898330  0.2838375413  0.0143211691
[121] -0.3149473868 -0.4571494587  0.4534030161  0.1673709999 -0.2723194861
[126] -0.1531508389  0.0291395750  0.0037106954 -0.2454877656  0.3452301356
[131]  0.5048601024 -0.3302760489 -0.3146723832  0.0630479365 -0.0737439085
[136]  0.0575237166 -0.1115672373 -0.1510674064  0.3113278344  0.0491217071
[141] -0.0001234148 -0.0084881371  0.5230379707  0.2199352436  0.3681484841
[146]  0.1448363353  0.2014445726  0.0807680470  0.3788976888  0.2254135989
[151] -0.6222379172  0.2602859200  0.3089240755  0.3220458484  0.1116353364
[156] -0.0448288851 -0.1737717325 -0.1446219456 -0.0389080668 -0.0014995862
[161] -0.2033259767 -0.0084367504 -0.0252957912 -0.1511121778  0.5247792228
[166] -0.2969542130 -0.2047066034  0.2418779337  0.1935782506 -0.3986353802
[171] -0.1801464961  0.0031790938 -0.1390825188 -0.0716254736  0.1218770247
[176] -0.1746858306  0.2396271741 -0.0053267355 -0.2768940453  0.0978072831
[181]  0.4391439390  0.3152618795  0.0286447739  0.1814603308  0.1095336383
[186]  0.1681590873  0.3863626864  0.2048109834  0.3772357485  0.4706635482
[191] -0.6849339585 -0.0293762788 -0.2080626565  0.1679422130 -0.0720761113
[196]  0.8752896380 -0.3347680223 -0.0768180146 -0.5879220594 -0.0506001363
[201]  0.0577555564  0.4729293082  0.3429690077 -0.3182897271 -0.0139313908
[206] -0.3721528551  0.1263282958 -0.1576993458  0.3878310874 -0.7297713267
[211] -0.5034453171 -0.8503515667 -0.0073353408  0.3261027395  0.3702247025
[216]  0.0886725818 -0.1674326180 -0.0388529166 -0.5426807825  0.4204121354
[221] -0.0412003591 -0.1491062159 -0.1968893310  0.4655794072  0.0056913382
[226] -0.2733571098  0.0805103788  0.3750509876 -0.3955215901  0.2897122935
> 
> proc.time()
   user  system elapsed 
  1.411   1.649   3.083 

BufferedMatrix.Rcheck/tests/rawCalltesting.Rout


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

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

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

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

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

Attaching package: 'BufferedMatrix'

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

    colMeans, colSums, rowMeans, rowSums

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

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

<pointer: 0x5599076f6b80>
> .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: 0x5599076f6b80>
> .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: 0x5599076f6b80>
> .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: 0x5599076f6b80>
> 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: 0x559906d6c290>
> .Call("R_bm_AddColumn",P)
<pointer: 0x559906d6c290>
> .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: 0x559906d6c290>
> .Call("R_bm_AddColumn",P)
<pointer: 0x559906d6c290>
> .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: 0x559906d6c290>
> 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: 0x559907b2b1a0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x559907b2b1a0>
> .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: 0x559907b2b1a0>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x559907b2b1a0>
> .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: 0x559907b2b1a0>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x559907b2b1a0>
> .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: 0x559907b2b1a0>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x559907b2b1a0>
> .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: 0x559907b2b1a0>
> 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: 0x559907501440>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x559907501440>
> .Call("R_bm_AddColumn",P)
<pointer: 0x559907501440>
> .Call("R_bm_AddColumn",P)
<pointer: 0x559907501440>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile847f3618c9c38" "BufferedMatrixFile847f3e16dd03" 
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile847f3618c9c38" "BufferedMatrixFile847f3e16dd03" 
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x559907932aa0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x559907932aa0>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x559907932aa0>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x559907932aa0>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x559907932aa0>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x559907932aa0>
> .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: 0x559907c09fc0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x559907c09fc0>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x559907c09fc0>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x559907c09fc0>
> 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: 0x559908876770>
> .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: 0x559908876770>
> rm(P)
> 
> proc.time()
   user  system elapsed 
  0.267   0.044   0.300 

BufferedMatrix.Rcheck/tests/Rcodetesting.Rout


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

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

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

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

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

Attaching package: 'BufferedMatrix'

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

    colMeans, colSums, rowMeans, rowSums

> 
> Temp <- createBufferedMatrix(100)
> dim(Temp)
[1] 100   0
> buffer.dim(Temp)
[1] 1 1
> 
> 
> proc.time()
   user  system elapsed 
  0.254   0.042   0.285 

Example timings