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

This page was generated on 2025-02-06 12:11 -0500 (Thu, 06 Feb 2025).

HostnameOSArch (*)R versionInstalled pkgs
nebbiolo2Linux (Ubuntu 24.04.1 LTS)x86_644.4.2 (2024-10-31) -- "Pile of Leaves" 4753
palomino8Windows Server 2022 Datacenterx644.4.2 (2024-10-31 ucrt) -- "Pile of Leaves" 4501
merida1macOS 12.7.5 Montereyx86_644.4.2 (2024-10-31) -- "Pile of Leaves" 4524
kjohnson1macOS 13.6.6 Venturaarm644.4.2 (2024-10-31) -- "Pile of Leaves" 4476
taishanLinux (openEuler 24.03 LTS)aarch644.4.2 (2024-10-31) -- "Pile of Leaves" 4407
Click on any hostname to see more info about the system (e.g. compilers)      (*) as reported by 'uname -p', except on Windows and Mac OS X

Package 251/2289HostnameOS / ArchINSTALLBUILDCHECKBUILD BIN
BufferedMatrix 1.70.0  (landing page)
Ben Bolstad
Snapshot Date: 2025-02-03 13:00 -0500 (Mon, 03 Feb 2025)
git_url: https://git.bioconductor.org/packages/BufferedMatrix
git_branch: RELEASE_3_20
git_last_commit: 32b6f6a
git_last_commit_date: 2024-10-29 09:27:20 -0500 (Tue, 29 Oct 2024)
nebbiolo2Linux (Ubuntu 24.04.1 LTS) / x86_64  OK    OK    OK  UNNEEDED, same version is already published
palomino8Windows Server 2022 Datacenter / x64  OK    OK    OK    OK  UNNEEDED, same version is already published
merida1macOS 12.7.5 Monterey / x86_64  OK    OK    WARNINGS    OK  UNNEEDED, same version is already published
kjohnson1macOS 13.6.6 Ventura / arm64  OK    OK    WARNINGS    OK  UNNEEDED, same version is already published
taishanLinux (openEuler 24.03 LTS) / aarch64  OK    OK    OK  


CHECK results for BufferedMatrix on taishan

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

raw results


Summary

Package: BufferedMatrix
Version: 1.70.0
Command: /home/biocbuild/R/R/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/home/biocbuild/R/R/site-library --no-vignettes --timings BufferedMatrix_1.70.0.tar.gz
StartedAt: 2025-02-04 05:14:49 -0000 (Tue, 04 Feb 2025)
EndedAt: 2025-02-04 05:15:12 -0000 (Tue, 04 Feb 2025)
EllapsedTime: 23.0 seconds
RetCode: 0
Status:   OK  
CheckDir: BufferedMatrix.Rcheck
Warnings: 0

Command output

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


* using log directory ‘/home/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck’
* using R version 4.4.2 (2024-10-31)
* using platform: aarch64-unknown-linux-gnu
* R was compiled by
    aarch64-unknown-linux-gnu-gcc (GCC) 14.2.0
    GNU Fortran (GCC) 12.3.1 (openEuler 12.3.1-36.oe2403)
* running under: openEuler 24.03 (LTS)
* using session charset: UTF-8
* using option ‘--no-vignettes’
* checking for file ‘BufferedMatrix/DESCRIPTION’ ... OK
* this is package ‘BufferedMatrix’ version ‘1.70.0’
* checking package namespace information ... OK
* checking package dependencies ... OK
* checking if this is a source package ... OK
* checking if there is a namespace ... OK
* checking for hidden files and directories ... OK
* checking for portable file names ... OK
* checking for sufficient/correct file permissions ... OK
* checking whether package ‘BufferedMatrix’ can be installed ... OK
* used C compiler: ‘aarch64-unknown-linux-gnu-gcc (GCC) 14.2.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 running R code from vignettes ... SKIPPED
* checking re-building of vignette outputs ... SKIPPED
* checking PDF version of manual ... OK
* DONE

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


Installation output

BufferedMatrix.Rcheck/00install.out

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


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

Tests output

BufferedMatrix.Rcheck/tests/c_code_level_tests.Rout


R version 4.4.2 (2024-10-31) -- "Pile of Leaves"
Copyright (C) 2024 The R Foundation for Statistical Computing
Platform: aarch64-unknown-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.312   0.033   0.332 

BufferedMatrix.Rcheck/tests/objectTesting.Rout


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

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

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

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

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

Attaching package: 'BufferedMatrix'

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

    colMeans, colSums, rowMeans, rowSums

> 
> 
> ### this is used to control how many repetitions in something below
> ### higher values result in more checks.
> nreps <-100 ##20000
> 
> 
> ## test creation and some simple assignments and subsetting operations
> 
> ## first on single elements
> tmp <- createBufferedMatrix(1000,10)
> 
> tmp[10,5]
[1] 0
> tmp[10,5] <- 10
> tmp[10,5]
[1] 10
> tmp[10,5] <- 12.445
> tmp[10,5]
[1] 12.445
> 
> 
> 
> ## now testing accessing multiple elements
> tmp2 <- createBufferedMatrix(10,20)
> 
> 
> tmp2[3,1] <- 51.34
> tmp2[9,2] <- 9.87654
> tmp2[,1:2]
       [,1]    [,2]
 [1,]  0.00 0.00000
 [2,]  0.00 0.00000
 [3,] 51.34 0.00000
 [4,]  0.00 0.00000
 [5,]  0.00 0.00000
 [6,]  0.00 0.00000
 [7,]  0.00 0.00000
 [8,]  0.00 0.00000
 [9,]  0.00 9.87654
[10,]  0.00 0.00000
> tmp2[,-(3:20)]
       [,1]    [,2]
 [1,]  0.00 0.00000
 [2,]  0.00 0.00000
 [3,] 51.34 0.00000
 [4,]  0.00 0.00000
 [5,]  0.00 0.00000
 [6,]  0.00 0.00000
 [7,]  0.00 0.00000
 [8,]  0.00 0.00000
 [9,]  0.00 9.87654
[10,]  0.00 0.00000
> tmp2[3,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
[1,] 51.34    0    0    0    0    0    0    0    0     0     0     0     0
     [,14] [,15] [,16] [,17] [,18] [,19] [,20]
[1,]     0     0     0     0     0     0     0
> tmp2[-3,]
      [,1]    [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [2,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [3,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [4,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [5,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [6,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [7,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [8,]    0 9.87654    0    0    0    0    0    0    0     0     0     0     0
 [9,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
      [,14] [,15] [,16] [,17] [,18] [,19] [,20]
 [1,]     0     0     0     0     0     0     0
 [2,]     0     0     0     0     0     0     0
 [3,]     0     0     0     0     0     0     0
 [4,]     0     0     0     0     0     0     0
 [5,]     0     0     0     0     0     0     0
 [6,]     0     0     0     0     0     0     0
 [7,]     0     0     0     0     0     0     0
 [8,]     0     0     0     0     0     0     0
 [9,]     0     0     0     0     0     0     0
> tmp2[2,1:3]
     [,1] [,2] [,3]
[1,]    0    0    0
> tmp2[3:9,1:3]
      [,1]    [,2] [,3]
[1,] 51.34 0.00000    0
[2,]  0.00 0.00000    0
[3,]  0.00 0.00000    0
[4,]  0.00 0.00000    0
[5,]  0.00 0.00000    0
[6,]  0.00 0.00000    0
[7,]  0.00 9.87654    0
> tmp2[-4,-4]
       [,1]    [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [2,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [3,] 51.34 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [4,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [5,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [6,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [7,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [8,]  0.00 9.87654    0    0    0    0    0    0    0     0     0     0     0
 [9,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
      [,14] [,15] [,16] [,17] [,18] [,19]
 [1,]     0     0     0     0     0     0
 [2,]     0     0     0     0     0     0
 [3,]     0     0     0     0     0     0
 [4,]     0     0     0     0     0     0
 [5,]     0     0     0     0     0     0
 [6,]     0     0     0     0     0     0
 [7,]     0     0     0     0     0     0
 [8,]     0     0     0     0     0     0
 [9,]     0     0     0     0     0     0
> 
> ## now testing accessing/assigning multiple elements
> tmp3 <- createBufferedMatrix(10,10)
> 
> for (i in 1:10){
+   for (j in 1:10){
+     tmp3[i,j] <- (j-1)*10 + i
+   }
+ }
> 
> tmp3[2:4,2:4]
     [,1] [,2] [,3]
[1,]   12   22   32
[2,]   13   23   33
[3,]   14   24   34
> tmp3[c(-10),c(2:4,2:4,10,1,2,1:10,10:1)]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]   11   21   31   11   21   31   91    1   11     1    11    21    31
 [2,]   12   22   32   12   22   32   92    2   12     2    12    22    32
 [3,]   13   23   33   13   23   33   93    3   13     3    13    23    33
 [4,]   14   24   34   14   24   34   94    4   14     4    14    24    34
 [5,]   15   25   35   15   25   35   95    5   15     5    15    25    35
 [6,]   16   26   36   16   26   36   96    6   16     6    16    26    36
 [7,]   17   27   37   17   27   37   97    7   17     7    17    27    37
 [8,]   18   28   38   18   28   38   98    8   18     8    18    28    38
 [9,]   19   29   39   19   29   39   99    9   19     9    19    29    39
      [,14] [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24] [,25]
 [1,]    41    51    61    71    81    91    91    81    71    61    51    41
 [2,]    42    52    62    72    82    92    92    82    72    62    52    42
 [3,]    43    53    63    73    83    93    93    83    73    63    53    43
 [4,]    44    54    64    74    84    94    94    84    74    64    54    44
 [5,]    45    55    65    75    85    95    95    85    75    65    55    45
 [6,]    46    56    66    76    86    96    96    86    76    66    56    46
 [7,]    47    57    67    77    87    97    97    87    77    67    57    47
 [8,]    48    58    68    78    88    98    98    88    78    68    58    48
 [9,]    49    59    69    79    89    99    99    89    79    69    59    49
      [,26] [,27] [,28] [,29]
 [1,]    31    21    11     1
 [2,]    32    22    12     2
 [3,]    33    23    13     3
 [4,]    34    24    14     4
 [5,]    35    25    15     5
 [6,]    36    26    16     6
 [7,]    37    27    17     7
 [8,]    38    28    18     8
 [9,]    39    29    19     9
> tmp3[-c(1:5),-c(6:10)]
     [,1] [,2] [,3] [,4] [,5]
[1,]    6   16   26   36   46
[2,]    7   17   27   37   47
[3,]    8   18   28   38   48
[4,]    9   19   29   39   49
[5,]   10   20   30   40   50
> 
> ## assignment of whole columns
> tmp3[,1] <- c(1:10*100.0)
> tmp3[,1:2] <- tmp3[,1:2]*100
> tmp3[,1:2] <- tmp3[,2:1]
> tmp3[,1:2]
      [,1]  [,2]
 [1,] 1100 1e+04
 [2,] 1200 2e+04
 [3,] 1300 3e+04
 [4,] 1400 4e+04
 [5,] 1500 5e+04
 [6,] 1600 6e+04
 [7,] 1700 7e+04
 [8,] 1800 8e+04
 [9,] 1900 9e+04
[10,] 2000 1e+05
> 
> 
> tmp3[,-1] <- tmp3[,1:9]
> tmp3[,1:10]
      [,1] [,2]  [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,] 1100 1100 1e+04   21   31   41   51   61   71    81
 [2,] 1200 1200 2e+04   22   32   42   52   62   72    82
 [3,] 1300 1300 3e+04   23   33   43   53   63   73    83
 [4,] 1400 1400 4e+04   24   34   44   54   64   74    84
 [5,] 1500 1500 5e+04   25   35   45   55   65   75    85
 [6,] 1600 1600 6e+04   26   36   46   56   66   76    86
 [7,] 1700 1700 7e+04   27   37   47   57   67   77    87
 [8,] 1800 1800 8e+04   28   38   48   58   68   78    88
 [9,] 1900 1900 9e+04   29   39   49   59   69   79    89
[10,] 2000 2000 1e+05   30   40   50   60   70   80    90
> 
> tmp3[,1:2] <- rep(1,10)
> tmp3[,1:2] <- rep(1,20)
> tmp3[,1:2] <- matrix(c(1:5),1,5)
> 
> tmp3[,-c(1:8)] <- matrix(c(1:5),1,5)
> 
> tmp3[1,] <- 1:10
> tmp3[1,]
     [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,]    1    2    3    4    5    6    7    8    9    10
> tmp3[-1,] <- c(1,2)
> tmp3[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    1    2    3    4    5    6    7    8    9    10
 [2,]    1    2    1    2    1    2    1    2    1     2
 [3,]    2    1    2    1    2    1    2    1    2     1
 [4,]    1    2    1    2    1    2    1    2    1     2
 [5,]    2    1    2    1    2    1    2    1    2     1
 [6,]    1    2    1    2    1    2    1    2    1     2
 [7,]    2    1    2    1    2    1    2    1    2     1
 [8,]    1    2    1    2    1    2    1    2    1     2
 [9,]    2    1    2    1    2    1    2    1    2     1
[10,]    1    2    1    2    1    2    1    2    1     2
> tmp3[-c(1:8),] <- matrix(c(1:5),1,5)
> tmp3[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    1    2    3    4    5    6    7    8    9    10
 [2,]    1    2    1    2    1    2    1    2    1     2
 [3,]    2    1    2    1    2    1    2    1    2     1
 [4,]    1    2    1    2    1    2    1    2    1     2
 [5,]    2    1    2    1    2    1    2    1    2     1
 [6,]    1    2    1    2    1    2    1    2    1     2
 [7,]    2    1    2    1    2    1    2    1    2     1
 [8,]    1    2    1    2    1    2    1    2    1     2
 [9,]    1    3    5    2    4    1    3    5    2     4
[10,]    2    4    1    3    5    2    4    1    3     5
> 
> 
> tmp3[1:2,1:2] <- 5555.04
> tmp3[-(1:2),1:2] <- 1234.56789
> 
> 
> 
> ## testing accessors for the directory and prefix
> directory(tmp3)
[1] "/home/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests"
> prefix(tmp3)
[1] "BM"
> 
> ## testing if we can remove these objects
> rm(tmp, tmp2, tmp3)
> gc()
         used (Mb) gc trigger (Mb) max used (Mb)
Ncells 471793 25.2    1026264 54.9   643431 34.4
Vcells 871915  6.7    8388608 64.0  2046348 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] "Tue Feb  4 05:15:06 2025"
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> date()
[1] "Tue Feb  4 05:15:06 2025"
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,which.col] == test.matrix[which.row,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> 
> 
> RowMode(tmp2)
<pointer: 0x2edc3c0>
> 
> 
> 
> 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] "Tue Feb  4 05:15:07 2025"
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col <- sample(1:20,5,replace=TRUE)
+   if (!all(tmp2[which.row,which.col] == test.matrix[which.row,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> date()
[1] "Tue Feb  4 05:15:07 2025"
> 
> ColMode(tmp2)
<pointer: 0x2edc3c0>
> 
> 
> 
> ### 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,] 99.8102134 -1.5177410 -0.2704230  0.5432409
[2,] -1.6642256  0.3749382  1.1884474 -0.7807721
[3,] -0.5506818  1.2100640  1.2070617 -0.6524880
[4,]  1.3829472 -0.3079728  0.3449389 -0.1275230
> ewApply(tmp5,abs)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
           [,1]      [,2]      [,3]      [,4]
[1,] 99.8102134 1.5177410 0.2704230 0.5432409
[2,]  1.6642256 0.3749382 1.1884474 0.7807721
[3,]  0.5506818 1.2100640 1.2070617 0.6524880
[4,]  1.3829472 0.3079728 0.3449389 0.1275230
> ewApply(tmp5,sqrt)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
          [,1]     [,2]      [,3]      [,4]
[1,] 9.9905062 1.231966 0.5200221 0.7370488
[2,] 1.2900487 0.612322 1.0901593 0.8836131
[3,] 0.7420794 1.100029 1.0986636 0.8077673
[4,] 1.1759878 0.554953 0.5873150 0.3571036
> 
> my.function <- function(x,power){
+   (x+5)^power
+ }
> 
> ewApply(tmp5,my.function,power=2)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
          [,1]     [,2]     [,3]     [,4]
[1,] 224.71528 38.83740 30.47064 32.91373
[2,]  39.56471 31.49816 37.09004 34.61690
[3,]  32.97148 37.21035 37.19370 33.73016
[4,]  38.14282 30.85750 31.21809 28.69856
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x48c3ad0>
> exp(tmp5)
<pointer: 0x48c3ad0>
> log(tmp5,2)
<pointer: 0x48c3ad0>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 467.7154
> Min(tmp5)
[1] 53.07201
> mean(tmp5)
[1] 72.84075
> Sum(tmp5)
[1] 14568.15
> Var(tmp5)
[1] 864.0795
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 86.99150 72.70176 73.42035 69.56115 71.47393 69.23931 71.98470 69.50058
 [9] 71.03225 72.50200
> rowSums(tmp5)
 [1] 1739.830 1454.035 1468.407 1391.223 1429.479 1384.786 1439.694 1390.012
 [9] 1420.645 1450.040
> rowVars(tmp5)
 [1] 8077.88917   87.79197   53.53173   60.52288   73.57332   82.75117
 [7]   99.59383   96.48173   71.18961   92.59331
> rowSd(tmp5)
 [1] 89.877078  9.369737  7.316538  7.779645  8.577489  9.096767  9.979671
 [8]  9.822511  8.437393  9.622542
> rowMax(tmp5)
 [1] 467.71540  90.50584  87.26269  89.08179  86.79000  84.05541  88.35687
 [8]  84.96377  89.62238  89.85853
> rowMin(tmp5)
 [1] 57.82959 57.85706 55.43645 56.86440 57.64852 54.80562 56.78394 53.07201
 [9] 54.53339 54.45636
> 
> colMeans(tmp5)
 [1] 110.22048  69.12993  70.56346  70.65802  71.96384  69.57092  72.96599
 [8]  75.35556  68.86389  67.37960  69.34343  71.35514  73.10808  70.32077
[15]  70.03871  68.12690  71.12197  71.51155  72.93976  72.27707
> colSums(tmp5)
 [1] 1102.2048  691.2993  705.6346  706.5802  719.6384  695.7092  729.6599
 [8]  753.5556  688.6389  673.7960  693.4343  713.5514  731.0808  703.2077
[15]  700.3871  681.2690  711.2197  715.1155  729.3976  722.7707
> colVars(tmp5)
 [1] 15921.40995    74.06743    36.76147    59.24262    52.98864    51.68273
 [7]    94.58767    83.98864   114.99336    60.85832    89.85030    75.82846
[13]    94.14979   151.49366    71.85724    31.06088    73.76039   121.58252
[19]    44.07662    89.97840
> colSd(tmp5)
 [1] 126.180070   8.606243   6.063124   7.696923   7.279330   7.189070
 [7]   9.725619   9.164532  10.723496   7.801174   9.478940   8.707954
[13]   9.703081  12.308276   8.476865   5.573229   8.588387  11.026446
[19]   6.639022   9.485694
> colMax(tmp5)
 [1] 467.71540  80.83497  77.41381  79.91283  85.90398  76.60241  84.73967
 [8]  87.90628  82.95733  78.28534  83.49908  83.92439  90.50584  89.85853
[15]  80.11186  78.03656  84.05541  87.26269  89.08179  88.35687
> colMin(tmp5)
 [1] 56.70771 54.80562 59.92577 56.58192 64.75015 58.31077 60.27536 59.42000
 [9] 54.45636 54.53339 53.07201 57.82959 58.40266 55.43645 57.40919 60.46629
[17] 56.86440 57.64852 64.65149 59.40366
> 
> 
> ### 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] 86.99150 72.70176 73.42035       NA 71.47393 69.23931 71.98470 69.50058
 [9] 71.03225 72.50200
> rowSums(tmp5)
 [1] 1739.830 1454.035 1468.407       NA 1429.479 1384.786 1439.694 1390.012
 [9] 1420.645 1450.040
> rowVars(tmp5)
 [1] 8077.88917   87.79197   53.53173   63.46146   73.57332   82.75117
 [7]   99.59383   96.48173   71.18961   92.59331
> rowSd(tmp5)
 [1] 89.877078  9.369737  7.316538  7.966270  8.577489  9.096767  9.979671
 [8]  9.822511  8.437393  9.622542
> rowMax(tmp5)
 [1] 467.71540  90.50584  87.26269        NA  86.79000  84.05541  88.35687
 [8]  84.96377  89.62238  89.85853
> rowMin(tmp5)
 [1] 57.82959 57.85706 55.43645       NA 57.64852 54.80562 56.78394 53.07201
 [9] 54.53339 54.45636
> 
> colMeans(tmp5)
 [1] 110.22048  69.12993  70.56346  70.65802  71.96384  69.57092        NA
 [8]  75.35556  68.86389  67.37960  69.34343  71.35514  73.10808  70.32077
[15]  70.03871  68.12690  71.12197  71.51155  72.93976  72.27707
> colSums(tmp5)
 [1] 1102.2048  691.2993  705.6346  706.5802  719.6384  695.7092        NA
 [8]  753.5556  688.6389  673.7960  693.4343  713.5514  731.0808  703.2077
[15]  700.3871  681.2690  711.2197  715.1155  729.3976  722.7707
> colVars(tmp5)
 [1] 15921.40995    74.06743    36.76147    59.24262    52.98864    51.68273
 [7]          NA    83.98864   114.99336    60.85832    89.85030    75.82846
[13]    94.14979   151.49366    71.85724    31.06088    73.76039   121.58252
[19]    44.07662    89.97840
> colSd(tmp5)
 [1] 126.180070   8.606243   6.063124   7.696923   7.279330   7.189070
 [7]         NA   9.164532  10.723496   7.801174   9.478940   8.707954
[13]   9.703081  12.308276   8.476865   5.573229   8.588387  11.026446
[19]   6.639022   9.485694
> colMax(tmp5)
 [1] 467.71540  80.83497  77.41381  79.91283  85.90398  76.60241        NA
 [8]  87.90628  82.95733  78.28534  83.49908  83.92439  90.50584  89.85853
[15]  80.11186  78.03656  84.05541  87.26269  89.08179  88.35687
> colMin(tmp5)
 [1] 56.70771 54.80562 59.92577 56.58192 64.75015 58.31077       NA 59.42000
 [9] 54.45636 54.53339 53.07201 57.82959 58.40266 55.43645 57.40919 60.46629
[17] 56.86440 57.64852 64.65149 59.40366
> 
> Max(tmp5,na.rm=TRUE)
[1] 467.7154
> Min(tmp5,na.rm=TRUE)
[1] 53.07201
> mean(tmp5,na.rm=TRUE)
[1] 72.87076
> Sum(tmp5,na.rm=TRUE)
[1] 14501.28
> Var(tmp5,na.rm=TRUE)
[1] 868.2625
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 86.99150 72.70176 73.42035 69.70284 71.47393 69.23931 71.98470 69.50058
 [9] 71.03225 72.50200
> rowSums(tmp5,na.rm=TRUE)
 [1] 1739.830 1454.035 1468.407 1324.354 1429.479 1384.786 1439.694 1390.012
 [9] 1420.645 1450.040
> rowVars(tmp5,na.rm=TRUE)
 [1] 8077.88917   87.79197   53.53173   63.46146   73.57332   82.75117
 [7]   99.59383   96.48173   71.18961   92.59331
> rowSd(tmp5,na.rm=TRUE)
 [1] 89.877078  9.369737  7.316538  7.966270  8.577489  9.096767  9.979671
 [8]  9.822511  8.437393  9.622542
> rowMax(tmp5,na.rm=TRUE)
 [1] 467.71540  90.50584  87.26269  89.08179  86.79000  84.05541  88.35687
 [8]  84.96377  89.62238  89.85853
> rowMin(tmp5,na.rm=TRUE)
 [1] 57.82959 57.85706 55.43645 56.86440 57.64852 54.80562 56.78394 53.07201
 [9] 54.53339 54.45636
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 110.22048  69.12993  70.56346  70.65802  71.96384  69.57092  73.64342
 [8]  75.35556  68.86389  67.37960  69.34343  71.35514  73.10808  70.32077
[15]  70.03871  68.12690  71.12197  71.51155  72.93976  72.27707
> colSums(tmp5,na.rm=TRUE)
 [1] 1102.2048  691.2993  705.6346  706.5802  719.6384  695.7092  662.7908
 [8]  753.5556  688.6389  673.7960  693.4343  713.5514  731.0808  703.2077
[15]  700.3871  681.2690  711.2197  715.1155  729.3976  722.7707
> colVars(tmp5,na.rm=TRUE)
 [1] 15921.40995    74.06743    36.76147    59.24262    52.98864    51.68273
 [7]   101.24837    83.98864   114.99336    60.85832    89.85030    75.82846
[13]    94.14979   151.49366    71.85724    31.06088    73.76039   121.58252
[19]    44.07662    89.97840
> colSd(tmp5,na.rm=TRUE)
 [1] 126.180070   8.606243   6.063124   7.696923   7.279330   7.189070
 [7]  10.062225   9.164532  10.723496   7.801174   9.478940   8.707954
[13]   9.703081  12.308276   8.476865   5.573229   8.588387  11.026446
[19]   6.639022   9.485694
> colMax(tmp5,na.rm=TRUE)
 [1] 467.71540  80.83497  77.41381  79.91283  85.90398  76.60241  84.73967
 [8]  87.90628  82.95733  78.28534  83.49908  83.92439  90.50584  89.85853
[15]  80.11186  78.03656  84.05541  87.26269  89.08179  88.35687
> colMin(tmp5,na.rm=TRUE)
 [1] 56.70771 54.80562 59.92577 56.58192 64.75015 58.31077 60.27536 59.42000
 [9] 54.45636 54.53339 53.07201 57.82959 58.40266 55.43645 57.40919 60.46629
[17] 56.86440 57.64852 64.65149 59.40366
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1] 86.99150 72.70176 73.42035      NaN 71.47393 69.23931 71.98470 69.50058
 [9] 71.03225 72.50200
> rowSums(tmp5,na.rm=TRUE)
 [1] 1739.830 1454.035 1468.407    0.000 1429.479 1384.786 1439.694 1390.012
 [9] 1420.645 1450.040
> rowVars(tmp5,na.rm=TRUE)
 [1] 8077.88917   87.79197   53.53173         NA   73.57332   82.75117
 [7]   99.59383   96.48173   71.18961   92.59331
> rowSd(tmp5,na.rm=TRUE)
 [1] 89.877078  9.369737  7.316538        NA  8.577489  9.096767  9.979671
 [8]  9.822511  8.437393  9.622542
> rowMax(tmp5,na.rm=TRUE)
 [1] 467.71540  90.50584  87.26269        NA  86.79000  84.05541  88.35687
 [8]  84.96377  89.62238  89.85853
> rowMin(tmp5,na.rm=TRUE)
 [1] 57.82959 57.85706 55.43645       NA 57.64852 54.80562 56.78394 53.07201
 [9] 54.53339 54.45636
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1] 113.64616  69.67483  71.18425  71.87199  71.64567  70.08868       NaN
 [8]  74.90766  68.68607  68.07440  69.71394  70.84341  73.32262  70.78530
[15]  70.54956  67.46955  72.70614  72.10338  71.14620  72.03983
> colSums(tmp5,na.rm=TRUE)
 [1] 1022.8155  627.0735  640.6582  646.8479  644.8110  630.7981    0.0000
 [8]  674.1690  618.1746  612.6696  627.4254  637.5907  659.9035  637.0677
[15]  634.9461  607.2259  654.3553  648.9304  640.3158  648.3585
> colVars(tmp5,na.rm=TRUE)
 [1] 17779.56372    79.98557    37.02115    50.06857    58.47337    55.12715
 [7]          NA    92.23033   129.01179    63.03471    99.53721    82.36103
[13]   105.40071   168.00277    77.90349    30.08217    54.74734   132.83988
[19]    13.39660   100.59253
> colSd(tmp5,na.rm=TRUE)
 [1] 133.340030   8.943465   6.084501   7.075914   7.646788   7.424766
 [7]         NA   9.603662  11.358336   7.939440   9.976834   9.075298
[13]  10.266485  12.961588   8.826296   5.484722   7.399145  11.525618
[19]   3.660136  10.029583
> colMax(tmp5,na.rm=TRUE)
 [1] 467.71540  80.83497  77.41381  79.91283  85.90398  76.60241      -Inf
 [8]  87.90628  82.95733  78.28534  83.49908  83.92439  90.50584  89.85853
[15]  80.11186  78.03656  84.05541  87.26269  75.83753  88.35687
> colMin(tmp5,na.rm=TRUE)
 [1] 56.70771 54.80562 59.92577 56.58192 64.75015 58.31077      Inf 59.42000
 [9] 54.45636 54.53339 53.07201 57.82959 58.40266 55.43645 57.40919 60.46629
[17] 61.01065 57.64852 64.65149 59.40366
> 
> 
> 
> 
> 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] 345.5974 320.4744 267.0759 145.7875 192.6162 221.6654 198.3897 271.5442
 [9] 211.2812 255.0281
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 345.5974 320.4744 267.0759 145.7875 192.6162 221.6654 198.3897 271.5442
 [9] 211.2812 255.0281
> 
> 
> 
> 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.842171e-14 -5.684342e-14 -2.842171e-14  1.705303e-13  0.000000e+00
 [6] -1.136868e-13  0.000000e+00  0.000000e+00  2.842171e-14  1.421085e-14
[11]  8.526513e-14  8.526513e-14  2.557954e-13  0.000000e+00 -2.842171e-14
[16]  1.705303e-13  8.526513e-14  8.526513e-14  5.684342e-14  2.842171e-14
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> ## making sure these things agree
> ##
> ## first when there is no NA
> 
> 
> 
> agree.checks <- function(buff.matrix,r.matrix,err.tol=1e-10){
+ 
+   if (Max(buff.matrix,na.rm=TRUE) != max(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Max")
+   }
+   
+ 
+   if (Min(buff.matrix,na.rm=TRUE) != min(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Min")
+   }
+ 
+ 
+   if (abs(Sum(buff.matrix,na.rm=TRUE)- sum(r.matrix,na.rm=TRUE)) > err.tol){
+ 
+     cat(Sum(buff.matrix,na.rm=TRUE),"\n")
+     cat(sum(r.matrix,na.rm=TRUE),"\n")
+     cat(Sum(buff.matrix,na.rm=TRUE) - sum(r.matrix,na.rm=TRUE),"\n")
+     
+     stop("No agreement in Sum")
+   }
+   
+   if (abs(mean(buff.matrix,na.rm=TRUE) - mean(r.matrix,na.rm=TRUE)) > err.tol){
+     stop("No agreement in mean")
+   }
+   
+   
+   if(abs(Var(buff.matrix,na.rm=TRUE) - var(as.vector(r.matrix),na.rm=TRUE)) > err.tol){
+     stop("No agreement in Var")
+   }
+   
+   
+ 
+   if(any(abs(rowMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,mean,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowMeans")
+   }
+   
+   
+   if(any(abs(colMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,mean,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colMeans")
+   }
+   
+   
+   if(any(abs(rowSums(buff.matrix,na.rm=TRUE)  -  apply(r.matrix,1,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in rowSums")
+   }
+   
+   
+   if(any(abs(colSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colSums")
+   }
+   
+   ### this is to get around the fact that R doesn't like to compute NA on an entire vector of NA when 
+   ### computing variance
+   my.Var <- function(x,na.rm=FALSE){
+    if (all(is.na(x))){
+      return(NA)
+    } else {
+      var(x,na.rm=na.rm)
+    }
+ 
+   }
+   
+   if(any(abs(rowVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+   
+   
+   if(any(abs(colVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+ 
+ 
+   if(any(abs(rowMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+ 
+   if(any(abs(colMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+   
+   
+   if(any(abs(rowMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+   
+ 
+   if(any(abs(colMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+ 
+   if(any(abs(colMedians(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,median,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMedian")
+   }
+ 
+   if(any(abs(colRanges(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,range,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colRanges")
+   }
+ 
+ 
+   
+ }
> 
> 
> 
> 
> 
> 
> 
> 
> 
> for (rep in 1:20){
+   copymatrix <- matrix(rnorm(200,150,15),10,20)
+   
+   tmp5[1:10,1:20] <- copymatrix
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ## now lets assign some NA values and check agreement
+ 
+   which.row <- sample(1:10,1,replace=TRUE)
+   which.col  <- sample(1:20,1,replace=TRUE)
+   
+   cat(which.row," ",which.col,"\n")
+   
+   tmp5[which.row,which.col] <- NA
+   copymatrix[which.row,which.col] <- NA
+   
+   agree.checks(tmp5,copymatrix)
+ 
+   ## make an entire row NA
+   tmp5[which.row,] <- NA
+   copymatrix[which.row,] <- NA
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ### also make an entire col NA
+   tmp5[,which.col] <- NA
+   copymatrix[,which.col] <- NA
+ 
+   agree.checks(tmp5,copymatrix)
+ 
+   ### now make 1 element non NA with NA in the rest of row and column
+ 
+   tmp5[which.row,which.col] <- rnorm(1,150,15)
+   copymatrix[which.row,which.col] <- tmp5[which.row,which.col]
+ 
+   agree.checks(tmp5,copymatrix)
+ }
3   19 
6   13 
7   13 
6   12 
1   1 
5   2 
8   1 
4   3 
4   13 
8   9 
3   18 
10   3 
2   8 
5   17 
6   18 
3   8 
6   6 
2   4 
1   12 
7   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] 1.958262
> Min(tmp)
[1] -2.974176
> mean(tmp)
[1] -0.07454819
> Sum(tmp)
[1] -7.454819
> Var(tmp)
[1] 0.8981142
> 
> rowMeans(tmp)
[1] -0.07454819
> rowSums(tmp)
[1] -7.454819
> rowVars(tmp)
[1] 0.8981142
> rowSd(tmp)
[1] 0.9476889
> rowMax(tmp)
[1] 1.958262
> rowMin(tmp)
[1] -2.974176
> 
> colMeans(tmp)
  [1]  0.043308836 -0.693322398 -0.902715051 -1.333602805  0.830324159
  [6]  1.360490291  0.383222446 -1.255205845 -0.081071354  0.850456132
 [11] -1.046001426  0.017262182  0.707343524 -1.327973018  0.974527619
 [16]  1.619095765  1.662691171 -0.709102595  0.448129444 -0.050973674
 [21] -0.224304654 -0.290706199  1.958262316  0.540521496 -0.551084464
 [26] -1.617234116  0.011220819 -1.793772042  1.143802361 -1.024760246
 [31]  1.615743901 -0.060883363 -0.591007058 -0.398848941  0.659097655
 [36] -1.011769016 -0.510933041  0.022407266  1.518823595  0.380113116
 [41] -2.974175684 -1.988489060  0.452440668 -0.416828307  0.505917266
 [46] -0.323373022  0.013090492  0.337604557 -1.140291979  0.374250350
 [51]  0.156043826 -1.375795190 -0.360724314 -1.724320476 -0.192262509
 [56]  0.050856226  0.559414109 -1.235159111  0.348922484 -1.312976278
 [61]  1.580762182 -1.386603696 -0.575159393 -0.018867043 -0.282075857
 [66]  0.751974946 -0.680165737  1.386134793  0.301345854 -0.998850180
 [71] -0.374677260 -0.006331397 -0.722182863  1.388668597  0.292156789
 [76]  0.153963431  0.506904090  1.641514649  0.343848140  0.292184427
 [81] -0.398896135  0.192471589  0.050952517  0.237375480 -1.467022338
 [86] -0.090246738  0.036760712 -0.708361939 -0.022506415 -0.747403809
 [91]  1.072905342  0.128214273 -1.604912049  0.221001619  1.570118116
 [96] -0.431430517 -0.996786555  0.867113030 -0.592369300  0.607942674
> colSums(tmp)
  [1]  0.043308836 -0.693322398 -0.902715051 -1.333602805  0.830324159
  [6]  1.360490291  0.383222446 -1.255205845 -0.081071354  0.850456132
 [11] -1.046001426  0.017262182  0.707343524 -1.327973018  0.974527619
 [16]  1.619095765  1.662691171 -0.709102595  0.448129444 -0.050973674
 [21] -0.224304654 -0.290706199  1.958262316  0.540521496 -0.551084464
 [26] -1.617234116  0.011220819 -1.793772042  1.143802361 -1.024760246
 [31]  1.615743901 -0.060883363 -0.591007058 -0.398848941  0.659097655
 [36] -1.011769016 -0.510933041  0.022407266  1.518823595  0.380113116
 [41] -2.974175684 -1.988489060  0.452440668 -0.416828307  0.505917266
 [46] -0.323373022  0.013090492  0.337604557 -1.140291979  0.374250350
 [51]  0.156043826 -1.375795190 -0.360724314 -1.724320476 -0.192262509
 [56]  0.050856226  0.559414109 -1.235159111  0.348922484 -1.312976278
 [61]  1.580762182 -1.386603696 -0.575159393 -0.018867043 -0.282075857
 [66]  0.751974946 -0.680165737  1.386134793  0.301345854 -0.998850180
 [71] -0.374677260 -0.006331397 -0.722182863  1.388668597  0.292156789
 [76]  0.153963431  0.506904090  1.641514649  0.343848140  0.292184427
 [81] -0.398896135  0.192471589  0.050952517  0.237375480 -1.467022338
 [86] -0.090246738  0.036760712 -0.708361939 -0.022506415 -0.747403809
 [91]  1.072905342  0.128214273 -1.604912049  0.221001619  1.570118116
 [96] -0.431430517 -0.996786555  0.867113030 -0.592369300  0.607942674
> 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.043308836 -0.693322398 -0.902715051 -1.333602805  0.830324159
  [6]  1.360490291  0.383222446 -1.255205845 -0.081071354  0.850456132
 [11] -1.046001426  0.017262182  0.707343524 -1.327973018  0.974527619
 [16]  1.619095765  1.662691171 -0.709102595  0.448129444 -0.050973674
 [21] -0.224304654 -0.290706199  1.958262316  0.540521496 -0.551084464
 [26] -1.617234116  0.011220819 -1.793772042  1.143802361 -1.024760246
 [31]  1.615743901 -0.060883363 -0.591007058 -0.398848941  0.659097655
 [36] -1.011769016 -0.510933041  0.022407266  1.518823595  0.380113116
 [41] -2.974175684 -1.988489060  0.452440668 -0.416828307  0.505917266
 [46] -0.323373022  0.013090492  0.337604557 -1.140291979  0.374250350
 [51]  0.156043826 -1.375795190 -0.360724314 -1.724320476 -0.192262509
 [56]  0.050856226  0.559414109 -1.235159111  0.348922484 -1.312976278
 [61]  1.580762182 -1.386603696 -0.575159393 -0.018867043 -0.282075857
 [66]  0.751974946 -0.680165737  1.386134793  0.301345854 -0.998850180
 [71] -0.374677260 -0.006331397 -0.722182863  1.388668597  0.292156789
 [76]  0.153963431  0.506904090  1.641514649  0.343848140  0.292184427
 [81] -0.398896135  0.192471589  0.050952517  0.237375480 -1.467022338
 [86] -0.090246738  0.036760712 -0.708361939 -0.022506415 -0.747403809
 [91]  1.072905342  0.128214273 -1.604912049  0.221001619  1.570118116
 [96] -0.431430517 -0.996786555  0.867113030 -0.592369300  0.607942674
> colMin(tmp)
  [1]  0.043308836 -0.693322398 -0.902715051 -1.333602805  0.830324159
  [6]  1.360490291  0.383222446 -1.255205845 -0.081071354  0.850456132
 [11] -1.046001426  0.017262182  0.707343524 -1.327973018  0.974527619
 [16]  1.619095765  1.662691171 -0.709102595  0.448129444 -0.050973674
 [21] -0.224304654 -0.290706199  1.958262316  0.540521496 -0.551084464
 [26] -1.617234116  0.011220819 -1.793772042  1.143802361 -1.024760246
 [31]  1.615743901 -0.060883363 -0.591007058 -0.398848941  0.659097655
 [36] -1.011769016 -0.510933041  0.022407266  1.518823595  0.380113116
 [41] -2.974175684 -1.988489060  0.452440668 -0.416828307  0.505917266
 [46] -0.323373022  0.013090492  0.337604557 -1.140291979  0.374250350
 [51]  0.156043826 -1.375795190 -0.360724314 -1.724320476 -0.192262509
 [56]  0.050856226  0.559414109 -1.235159111  0.348922484 -1.312976278
 [61]  1.580762182 -1.386603696 -0.575159393 -0.018867043 -0.282075857
 [66]  0.751974946 -0.680165737  1.386134793  0.301345854 -0.998850180
 [71] -0.374677260 -0.006331397 -0.722182863  1.388668597  0.292156789
 [76]  0.153963431  0.506904090  1.641514649  0.343848140  0.292184427
 [81] -0.398896135  0.192471589  0.050952517  0.237375480 -1.467022338
 [86] -0.090246738  0.036760712 -0.708361939 -0.022506415 -0.747403809
 [91]  1.072905342  0.128214273 -1.604912049  0.221001619  1.570118116
 [96] -0.431430517 -0.996786555  0.867113030 -0.592369300  0.607942674
> colMedians(tmp)
  [1]  0.043308836 -0.693322398 -0.902715051 -1.333602805  0.830324159
  [6]  1.360490291  0.383222446 -1.255205845 -0.081071354  0.850456132
 [11] -1.046001426  0.017262182  0.707343524 -1.327973018  0.974527619
 [16]  1.619095765  1.662691171 -0.709102595  0.448129444 -0.050973674
 [21] -0.224304654 -0.290706199  1.958262316  0.540521496 -0.551084464
 [26] -1.617234116  0.011220819 -1.793772042  1.143802361 -1.024760246
 [31]  1.615743901 -0.060883363 -0.591007058 -0.398848941  0.659097655
 [36] -1.011769016 -0.510933041  0.022407266  1.518823595  0.380113116
 [41] -2.974175684 -1.988489060  0.452440668 -0.416828307  0.505917266
 [46] -0.323373022  0.013090492  0.337604557 -1.140291979  0.374250350
 [51]  0.156043826 -1.375795190 -0.360724314 -1.724320476 -0.192262509
 [56]  0.050856226  0.559414109 -1.235159111  0.348922484 -1.312976278
 [61]  1.580762182 -1.386603696 -0.575159393 -0.018867043 -0.282075857
 [66]  0.751974946 -0.680165737  1.386134793  0.301345854 -0.998850180
 [71] -0.374677260 -0.006331397 -0.722182863  1.388668597  0.292156789
 [76]  0.153963431  0.506904090  1.641514649  0.343848140  0.292184427
 [81] -0.398896135  0.192471589  0.050952517  0.237375480 -1.467022338
 [86] -0.090246738  0.036760712 -0.708361939 -0.022506415 -0.747403809
 [91]  1.072905342  0.128214273 -1.604912049  0.221001619  1.570118116
 [96] -0.431430517 -0.996786555  0.867113030 -0.592369300  0.607942674
> colRanges(tmp)
           [,1]       [,2]       [,3]      [,4]      [,5]    [,6]      [,7]
[1,] 0.04330884 -0.6933224 -0.9027151 -1.333603 0.8303242 1.36049 0.3832224
[2,] 0.04330884 -0.6933224 -0.9027151 -1.333603 0.8303242 1.36049 0.3832224
          [,8]        [,9]     [,10]     [,11]      [,12]     [,13]     [,14]
[1,] -1.255206 -0.08107135 0.8504561 -1.046001 0.01726218 0.7073435 -1.327973
[2,] -1.255206 -0.08107135 0.8504561 -1.046001 0.01726218 0.7073435 -1.327973
         [,15]    [,16]    [,17]      [,18]     [,19]       [,20]      [,21]
[1,] 0.9745276 1.619096 1.662691 -0.7091026 0.4481294 -0.05097367 -0.2243047
[2,] 0.9745276 1.619096 1.662691 -0.7091026 0.4481294 -0.05097367 -0.2243047
          [,22]    [,23]     [,24]      [,25]     [,26]      [,27]     [,28]
[1,] -0.2907062 1.958262 0.5405215 -0.5510845 -1.617234 0.01122082 -1.793772
[2,] -0.2907062 1.958262 0.5405215 -0.5510845 -1.617234 0.01122082 -1.793772
        [,29]    [,30]    [,31]       [,32]      [,33]      [,34]     [,35]
[1,] 1.143802 -1.02476 1.615744 -0.06088336 -0.5910071 -0.3988489 0.6590977
[2,] 1.143802 -1.02476 1.615744 -0.06088336 -0.5910071 -0.3988489 0.6590977
         [,36]     [,37]      [,38]    [,39]     [,40]     [,41]     [,42]
[1,] -1.011769 -0.510933 0.02240727 1.518824 0.3801131 -2.974176 -1.988489
[2,] -1.011769 -0.510933 0.02240727 1.518824 0.3801131 -2.974176 -1.988489
         [,43]      [,44]     [,45]     [,46]      [,47]     [,48]     [,49]
[1,] 0.4524407 -0.4168283 0.5059173 -0.323373 0.01309049 0.3376046 -1.140292
[2,] 0.4524407 -0.4168283 0.5059173 -0.323373 0.01309049 0.3376046 -1.140292
         [,50]     [,51]     [,52]      [,53]    [,54]      [,55]      [,56]
[1,] 0.3742503 0.1560438 -1.375795 -0.3607243 -1.72432 -0.1922625 0.05085623
[2,] 0.3742503 0.1560438 -1.375795 -0.3607243 -1.72432 -0.1922625 0.05085623
         [,57]     [,58]     [,59]     [,60]    [,61]     [,62]      [,63]
[1,] 0.5594141 -1.235159 0.3489225 -1.312976 1.580762 -1.386604 -0.5751594
[2,] 0.5594141 -1.235159 0.3489225 -1.312976 1.580762 -1.386604 -0.5751594
           [,64]      [,65]     [,66]      [,67]    [,68]     [,69]      [,70]
[1,] -0.01886704 -0.2820759 0.7519749 -0.6801657 1.386135 0.3013459 -0.9988502
[2,] -0.01886704 -0.2820759 0.7519749 -0.6801657 1.386135 0.3013459 -0.9988502
          [,71]        [,72]      [,73]    [,74]     [,75]     [,76]     [,77]
[1,] -0.3746773 -0.006331397 -0.7221829 1.388669 0.2921568 0.1539634 0.5069041
[2,] -0.3746773 -0.006331397 -0.7221829 1.388669 0.2921568 0.1539634 0.5069041
        [,78]     [,79]     [,80]      [,81]     [,82]      [,83]     [,84]
[1,] 1.641515 0.3438481 0.2921844 -0.3988961 0.1924716 0.05095252 0.2373755
[2,] 1.641515 0.3438481 0.2921844 -0.3988961 0.1924716 0.05095252 0.2373755
         [,85]       [,86]      [,87]      [,88]       [,89]      [,90]
[1,] -1.467022 -0.09024674 0.03676071 -0.7083619 -0.02250641 -0.7474038
[2,] -1.467022 -0.09024674 0.03676071 -0.7083619 -0.02250641 -0.7474038
        [,91]     [,92]     [,93]     [,94]    [,95]      [,96]      [,97]
[1,] 1.072905 0.1282143 -1.604912 0.2210016 1.570118 -0.4314305 -0.9967866
[2,] 1.072905 0.1282143 -1.604912 0.2210016 1.570118 -0.4314305 -0.9967866
        [,98]      [,99]    [,100]
[1,] 0.867113 -0.5923693 0.6079427
[2,] 0.867113 -0.5923693 0.6079427
> 
> 
> Max(tmp2)
[1] 2.340683
> Min(tmp2)
[1] -2.505556
> mean(tmp2)
[1] -0.1619875
> Sum(tmp2)
[1] -16.19875
> Var(tmp2)
[1] 0.9166773
> 
> rowMeans(tmp2)
  [1] -0.472216754  0.937508978 -1.070111779  0.983959710 -0.314806201
  [6]  0.044854090  0.019703258 -0.008013715 -0.118763343 -0.030466135
 [11]  1.395275753 -1.483955253 -0.399065622  1.004562730  0.062257686
 [16]  1.138988308  0.263344192  0.316847929 -0.271919122 -0.744490754
 [21]  0.017469906 -1.909356246  0.462879899 -0.228827662 -1.270446833
 [26] -1.496454355  1.063192936  0.464142488 -1.549572052 -0.831094184
 [31] -0.914224535 -0.331255875 -0.365718204 -0.435238344 -1.682057597
 [36] -0.845361581  1.546244540  0.938066005  0.329122244 -0.402744999
 [41]  0.191638405 -2.018634824  0.120197927 -0.821642569 -0.403723278
 [46] -0.058673418 -0.056770559 -0.098458219 -0.822611036  1.166880272
 [51] -2.505555569 -1.290949105  1.014917390  1.175712125 -0.098940910
 [56] -1.177133852 -0.793343068  2.340683443  0.977740238 -0.028818723
 [61] -0.794143723  1.984076746  0.142900375 -0.818726206  0.377746057
 [66]  0.326798145 -0.199331830  2.069126812 -0.104885298 -1.336026349
 [71] -0.361920544 -2.154760237 -0.525308208 -0.134245794  0.656255836
 [76] -0.093856224 -0.039805066 -0.336958096 -0.654526012 -1.354977540
 [81] -0.690162355 -0.963210970  0.198068291  1.034369861  0.152960194
 [86]  0.716613599 -0.219286257  1.463838330 -1.150774157 -0.701028225
 [91] -0.073138047 -1.739641223 -1.030442671  1.018818584 -1.511642148
 [96] -1.031408900  0.053584118  0.976058852 -0.325419433  0.350883374
> rowSums(tmp2)
  [1] -0.472216754  0.937508978 -1.070111779  0.983959710 -0.314806201
  [6]  0.044854090  0.019703258 -0.008013715 -0.118763343 -0.030466135
 [11]  1.395275753 -1.483955253 -0.399065622  1.004562730  0.062257686
 [16]  1.138988308  0.263344192  0.316847929 -0.271919122 -0.744490754
 [21]  0.017469906 -1.909356246  0.462879899 -0.228827662 -1.270446833
 [26] -1.496454355  1.063192936  0.464142488 -1.549572052 -0.831094184
 [31] -0.914224535 -0.331255875 -0.365718204 -0.435238344 -1.682057597
 [36] -0.845361581  1.546244540  0.938066005  0.329122244 -0.402744999
 [41]  0.191638405 -2.018634824  0.120197927 -0.821642569 -0.403723278
 [46] -0.058673418 -0.056770559 -0.098458219 -0.822611036  1.166880272
 [51] -2.505555569 -1.290949105  1.014917390  1.175712125 -0.098940910
 [56] -1.177133852 -0.793343068  2.340683443  0.977740238 -0.028818723
 [61] -0.794143723  1.984076746  0.142900375 -0.818726206  0.377746057
 [66]  0.326798145 -0.199331830  2.069126812 -0.104885298 -1.336026349
 [71] -0.361920544 -2.154760237 -0.525308208 -0.134245794  0.656255836
 [76] -0.093856224 -0.039805066 -0.336958096 -0.654526012 -1.354977540
 [81] -0.690162355 -0.963210970  0.198068291  1.034369861  0.152960194
 [86]  0.716613599 -0.219286257  1.463838330 -1.150774157 -0.701028225
 [91] -0.073138047 -1.739641223 -1.030442671  1.018818584 -1.511642148
 [96] -1.031408900  0.053584118  0.976058852 -0.325419433  0.350883374
> rowVars(tmp2)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowSd(tmp2)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowMax(tmp2)
  [1] -0.472216754  0.937508978 -1.070111779  0.983959710 -0.314806201
  [6]  0.044854090  0.019703258 -0.008013715 -0.118763343 -0.030466135
 [11]  1.395275753 -1.483955253 -0.399065622  1.004562730  0.062257686
 [16]  1.138988308  0.263344192  0.316847929 -0.271919122 -0.744490754
 [21]  0.017469906 -1.909356246  0.462879899 -0.228827662 -1.270446833
 [26] -1.496454355  1.063192936  0.464142488 -1.549572052 -0.831094184
 [31] -0.914224535 -0.331255875 -0.365718204 -0.435238344 -1.682057597
 [36] -0.845361581  1.546244540  0.938066005  0.329122244 -0.402744999
 [41]  0.191638405 -2.018634824  0.120197927 -0.821642569 -0.403723278
 [46] -0.058673418 -0.056770559 -0.098458219 -0.822611036  1.166880272
 [51] -2.505555569 -1.290949105  1.014917390  1.175712125 -0.098940910
 [56] -1.177133852 -0.793343068  2.340683443  0.977740238 -0.028818723
 [61] -0.794143723  1.984076746  0.142900375 -0.818726206  0.377746057
 [66]  0.326798145 -0.199331830  2.069126812 -0.104885298 -1.336026349
 [71] -0.361920544 -2.154760237 -0.525308208 -0.134245794  0.656255836
 [76] -0.093856224 -0.039805066 -0.336958096 -0.654526012 -1.354977540
 [81] -0.690162355 -0.963210970  0.198068291  1.034369861  0.152960194
 [86]  0.716613599 -0.219286257  1.463838330 -1.150774157 -0.701028225
 [91] -0.073138047 -1.739641223 -1.030442671  1.018818584 -1.511642148
 [96] -1.031408900  0.053584118  0.976058852 -0.325419433  0.350883374
> rowMin(tmp2)
  [1] -0.472216754  0.937508978 -1.070111779  0.983959710 -0.314806201
  [6]  0.044854090  0.019703258 -0.008013715 -0.118763343 -0.030466135
 [11]  1.395275753 -1.483955253 -0.399065622  1.004562730  0.062257686
 [16]  1.138988308  0.263344192  0.316847929 -0.271919122 -0.744490754
 [21]  0.017469906 -1.909356246  0.462879899 -0.228827662 -1.270446833
 [26] -1.496454355  1.063192936  0.464142488 -1.549572052 -0.831094184
 [31] -0.914224535 -0.331255875 -0.365718204 -0.435238344 -1.682057597
 [36] -0.845361581  1.546244540  0.938066005  0.329122244 -0.402744999
 [41]  0.191638405 -2.018634824  0.120197927 -0.821642569 -0.403723278
 [46] -0.058673418 -0.056770559 -0.098458219 -0.822611036  1.166880272
 [51] -2.505555569 -1.290949105  1.014917390  1.175712125 -0.098940910
 [56] -1.177133852 -0.793343068  2.340683443  0.977740238 -0.028818723
 [61] -0.794143723  1.984076746  0.142900375 -0.818726206  0.377746057
 [66]  0.326798145 -0.199331830  2.069126812 -0.104885298 -1.336026349
 [71] -0.361920544 -2.154760237 -0.525308208 -0.134245794  0.656255836
 [76] -0.093856224 -0.039805066 -0.336958096 -0.654526012 -1.354977540
 [81] -0.690162355 -0.963210970  0.198068291  1.034369861  0.152960194
 [86]  0.716613599 -0.219286257  1.463838330 -1.150774157 -0.701028225
 [91] -0.073138047 -1.739641223 -1.030442671  1.018818584 -1.511642148
 [96] -1.031408900  0.053584118  0.976058852 -0.325419433  0.350883374
> 
> colMeans(tmp2)
[1] -0.1619875
> colSums(tmp2)
[1] -16.19875
> colVars(tmp2)
[1] 0.9166773
> colSd(tmp2)
[1] 0.9574327
> colMax(tmp2)
[1] 2.340683
> colMin(tmp2)
[1] -2.505556
> colMedians(tmp2)
[1] -0.1118243
> colRanges(tmp2)
          [,1]
[1,] -2.505556
[2,]  2.340683
> 
> 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]  5.0861554 -1.6064342  0.4194899 -0.3021636 -4.6319470  4.5368330
 [7] -1.9913922 -8.3401776 -3.2698243  1.3002985
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -0.5325803
[2,] -0.1883647
[3,]  0.2143613
[4,]  1.1361450
[5,]  2.2979327
> 
> rowApply(tmp,sum)
 [1]  1.0669227 -1.9276706  0.3925547  2.6971664  1.5379465 -3.9487805
 [7] -0.9792723 -1.6901194 -6.1972640  0.2493544
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    7    5   10    5   10    7   10    5    8     5
 [2,]    4    4    6    3    3    9    8    3    7     4
 [3,]    9    8    2    9    9    8    6    9    2     8
 [4,]    1    6    4   10    8    2    3    6   10     3
 [5,]    2    3    3    4    1    5    7   10    1    10
 [6,]   10    1    9    8    4    4    9    8    6     9
 [7,]    8    2    7    1    7    6    5    4    5     7
 [8,]    3   10    5    2    5    1    1    1    3     1
 [9,]    6    7    1    7    2    3    2    7    9     2
[10,]    5    9    8    6    6   10    4    2    4     6
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1] -1.0163878 -0.3167488 -4.0291422 -4.0755414 -2.6125650 -0.9089731
 [7] -1.5488620  1.6161642  0.8888747  0.5803644  0.1558635  0.6610960
[13] -0.3868078  0.1541428  0.5867860 -2.1557888 -1.1769459  0.9987819
[19] -2.4405396 -3.9128568
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -1.2103342
[2,] -0.6384104
[3,] -0.1122589
[4,]  0.4057603
[5,]  0.5388554
> 
> rowApply(tmp,sum)
[1] -4.939143 -6.811784 -3.707623  4.061446 -7.541983
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]   17    7    3   13   12
[2,]    9    1   19   12   14
[3,]   15    2    8    1    9
[4,]    4   10   10    4    3
[5,]   11   17   13    3    2
> 
> 
> as.matrix(tmp)
           [,1]       [,2]       [,3]       [,4]       [,5]        [,6]
[1,]  0.4057603 -0.4115175  0.1859135 -0.7193203 -0.2908943 -0.26363443
[2,] -0.6384104 -1.8752840 -1.5530855 -0.4166393  0.4251443  0.22531986
[3,] -1.2103342  1.2651169 -0.4865445 -0.4392686  0.1855078 -0.99865243
[4,]  0.5388554  0.5383258 -1.3842043 -0.8802999 -0.9176432 -0.02489483
[5,] -0.1122589  0.1666100 -0.7912214 -1.6200133 -2.0146797  0.15288872
            [,7]       [,8]       [,9]      [,10]       [,11]       [,12]
[1,] -0.45936210 -1.8819010 -0.4446520  1.6650688  0.18715413 -0.08601482
[2,] -0.43513607  0.1090159 -0.1797748 -0.8835220  0.06556599 -0.34219898
[3,] -0.23452894  1.7112672  1.0151044  0.1684775 -1.97747760 -0.83202767
[4,] -0.01350357  0.4044243  1.4670810  1.0797032  1.64350147  0.25840483
[5,] -0.40633130  1.2733579 -0.9688839 -1.4493632  0.23711954  1.66293265
          [,13]      [,14]      [,15]      [,16]      [,17]       [,18]
[1,] -0.4993944  0.8470944 -0.6721362 -0.3961012 -0.9918849 -0.01997357
[2,]  1.2760163  0.7470854 -0.7795537 -1.4926518 -1.0769183  0.47347924
[3,] -2.0165229  1.1911042  0.2929583  0.2017623 -1.2062240  0.75070625
[4,]  1.7064026 -0.4668047  0.7054418  0.6523077  0.9609930 -0.39136395
[5,] -0.8533095 -2.1643365  1.0400759 -1.1211058  1.1370883  0.18593395
          [,19]       [,20]
[1,]  0.5577633 -1.65111081
[2,] -0.5336074  0.07337148
[3,] -0.6288115 -0.45923505
[4,] -0.6671924 -1.14808780
[5,] -1.1686916 -0.72779458
> 
> 
> is.BufferedMatrix(tmp)
[1] TRUE
> 
> as.BufferedMatrix(as.matrix(tmp))
BufferedMatrix object
Matrix size:  5 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  800  bytes.
> 
> 
> 
> subBufferedMatrix(tmp,1:5,1:5)
BufferedMatrix object
Matrix size:  5 5 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  653  bytes.
Disk usage :  200  bytes.
> subBufferedMatrix(tmp,,5:8)
BufferedMatrix object
Matrix size:  5 4 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  565  bytes.
Disk usage :  160  bytes.
> subBufferedMatrix(tmp,1:3,)
BufferedMatrix object
Matrix size:  3 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  480  bytes.
> 
> 
> rm(tmp)
> 
> 
> ###
> ### Testing colnames and rownames
> ###
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> 
> 
> colnames(tmp)
NULL
> rownames(tmp)
NULL
> 
> 
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> colnames(tmp)
 [1] "col1"  "col2"  "col3"  "col4"  "col5"  "col6"  "col7"  "col8"  "col9" 
[10] "col10" "col11" "col12" "col13" "col14" "col15" "col16" "col17" "col18"
[19] "col19" "col20"
> rownames(tmp)
[1] "row1" "row2" "row3" "row4" "row5"
> 
> 
> tmp["row1",]
           col1      col2       col3     col4     col5       col6     col7
row1 -0.2179285 0.5861326 -0.6417031 2.133818 1.466575 -0.2377997 -1.22659
           col8      col9     col10      col11     col12    col13     col14
row1 -0.5677203 0.5416046 0.5658411 -0.5624129 -1.701492 1.798978 -1.961791
          col15    col16      col17      col18      col19     col20
row1 -0.2131635 1.087938 0.07646379 0.04185231 -0.8775368 0.5181975
> tmp[,"col10"]
           col10
row1  0.56584107
row2 -0.24410521
row3  0.66647218
row4  0.63309524
row5  0.04042793
> tmp[c("row1","row5"),]
           col1       col2       col3       col4       col5       col6
row1 -0.2179285  0.5861326 -0.6417031  2.1338184  1.4665749 -0.2377997
row5 -2.3046938 -0.6095029  0.9049358 -0.4402905 -0.5836086  0.7900228
           col7       col8      col9      col10       col11     col12
row1 -1.2265903 -0.5677203 0.5416046 0.56584107 -0.56241294 -1.701492
row5  0.1397363  1.1174351 0.1245346 0.04042793  0.09542079  1.052320
          col13      col14      col15    col16       col17       col18
row1 1.79897835 -1.9617914 -0.2131635 1.087938  0.07646379  0.04185231
row5 0.03814043  0.5196647  1.4522751 1.530776 -1.15695032 -0.04187349
           col19     col20
row1 -0.87753683 0.5181975
row5 -0.02280777 1.8302507
> tmp[,c("col6","col20")]
           col6      col20
row1 -0.2377997  0.5181975
row2 -0.5138020 -0.3823035
row3  1.5465859 -0.9569891
row4 -2.7565371  0.2051704
row5  0.7900228  1.8302507
> tmp[c("row1","row5"),c("col6","col20")]
           col6     col20
row1 -0.2377997 0.5181975
row5  0.7900228 1.8302507
> 
> 
> 
> 
> 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 48.77532 50.74227 49.97551 50.60433 50.30915 104.7828 51.86344 50.72222
         col9    col10    col11    col12    col13    col14    col15    col16
row1 49.09439 50.41448 49.90033 51.66297 50.28425 49.11459 50.89635 49.80487
        col17    col18   col19    col20
row1 50.12236 50.91023 51.4609 104.6852
> tmp[,"col10"]
        col10
row1 50.41448
row2 30.48516
row3 28.51502
row4 30.97215
row5 49.80248
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 48.77532 50.74227 49.97551 50.60433 50.30915 104.7828 51.86344 50.72222
row5 49.17492 49.90696 50.62489 49.81389 49.35850 105.2576 48.34963 50.42099
         col9    col10    col11    col12    col13    col14    col15    col16
row1 49.09439 50.41448 49.90033 51.66297 50.28425 49.11459 50.89635 49.80487
row5 49.14490 49.80248 50.63590 52.66029 49.26416 49.95834 48.68095 51.29928
        col17    col18    col19    col20
row1 50.12236 50.91023 51.46090 104.6852
row5 50.64390 50.27806 48.93014 103.6253
> tmp[,c("col6","col20")]
          col6     col20
row1 104.78281 104.68521
row2  76.02782  74.14971
row3  74.92907  75.64945
row4  76.41082  75.44593
row5 105.25758 103.62527
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 104.7828 104.6852
row5 105.2576 103.6253
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 104.7828 104.6852
row5 105.2576 103.6253
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
          col13
[1,]  0.1458373
[2,]  0.1763394
[3,]  0.6109178
[4,]  0.2467420
[5,] -0.1744767
> tmp[,c("col17","col7")]
          col17        col7
[1,]  0.6094648 -0.08670102
[2,] -1.1926808  1.37786963
[3,] -0.8470168  2.17625774
[4,]  1.0866147  0.11168332
[5,]  2.0264852 -0.45934422
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
           col6      col20
[1,] -1.1732522 -2.2645268
[2,]  1.9589959  0.7331206
[3,] -1.2398062 -1.2982026
[4,]  1.0672631  0.1940705
[5,]  0.9237867  0.8923935
> subBufferedMatrix(tmp,1,c("col6"))[,1]
          col1
[1,] -1.173252
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
          col6
[1,] -1.173252
[2,]  1.958996
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> 
> 
> 
> subBufferedMatrix(tmp,c("row3","row1"),)[,1:20]
          [,1]       [,2]      [,3]       [,4]       [,5]      [,6]      [,7]
row3 -1.650581 -0.1884864 0.2783538 -0.1270167 -0.5936152  1.360676 0.7775746
row1 -1.818451 -0.6456398 1.2365653  0.1322991 -1.7483076 -1.541844 1.3972396
           [,8]      [,9]      [,10]    [,11]      [,12]      [,13]      [,14]
row3  0.8477099 0.6191835 -0.9903833 0.842107 -0.9001047 -0.1642408 -0.7927246
row1 -0.5055393 0.1738448  0.1297537 1.273665  1.0461080  0.6560038  0.8903584
         [,15]      [,16]      [,17]      [,18]      [,19]      [,20]
row3 0.1951126 0.93943160  0.9417784 -0.6439113 -1.3895639 -0.3094732
row1 1.0106562 0.01962753 -0.8692332  0.2781718  0.3051989 -0.9761142
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
         [,1]      [,2]     [,3]       [,4]       [,5]      [,6]       [,7]
row2 1.895691 0.1609186 1.117002 -0.4704831 -0.8170678 0.8701621 -0.4781998
          [,8]       [,9]     [,10]
row2 0.5633394 -0.6495207 -0.417023
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
           [,1]      [,2]        [,3]      [,4]      [,5]     [,6]       [,7]
row5 -0.6321499 0.5640441 -0.04378241 0.5865931 0.3760933 1.713963 -0.2330407
          [,8]      [,9]     [,10]     [,11]    [,12]    [,13]     [,14]
row5 -1.077875 -1.033257 -0.763697 0.6737367 -1.28884 1.408491 0.4397947
          [,15]     [,16]    [,17]      [,18]     [,19]     [,20]
row5 -0.2130539 -1.170033 1.227901 -0.5529803 0.3105059 0.9814877
> 
> 
> 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: 0x481ffe0>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "/home/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM18444016ecc22b"
 [2] "/home/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM1844402778867a"
 [3] "/home/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM1844401d4d3ddc"
 [4] "/home/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM1844407ed08dff"
 [5] "/home/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM1844408457d77" 
 [6] "/home/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM1844403cd7c867"
 [7] "/home/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM184440693160d9"
 [8] "/home/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM18444078eec4c7"
 [9] "/home/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM18444050714117"
[10] "/home/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM1844404f31ce96"
[11] "/home/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM1844402fa320c1"
[12] "/home/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM184440eb435a8" 
[13] "/home/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM184440398505ab"
[14] "/home/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM184440527da47e"
[15] "/home/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM1844405ea4933f"
> 
> 
> ### 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: 0x48c9050>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x48c9050>
Warning message:
In dir.create(new.directory) :
  '/home/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x48c9050>
> rowMedians(tmp)
  [1]  0.016999825  0.463705456 -0.144095859 -0.030269853 -0.640771438
  [6] -0.226524222  0.020546989  0.222732191 -0.355176300 -0.421198165
 [11] -0.070735513 -0.262067015  0.465269878  0.233262038  0.132993008
 [16] -0.223793506  0.051364511  0.001260708 -0.052574470  0.593205775
 [21]  0.095520063 -0.157437555 -0.134403701  0.113876233  0.050447774
 [26]  0.252362420 -0.301668284 -0.263528401 -0.015887134  0.261660085
 [31] -0.080611376  0.353338338 -0.163044682 -0.082083169  1.049153303
 [36]  0.272489317  0.011851163  0.003833875 -0.167839244  0.132951172
 [41]  0.405047236  0.119304893 -0.014349987  0.301388975  0.828021282
 [46] -0.340093980 -0.229611246  0.245798232  0.510886625 -0.012912505
 [51]  0.321077103 -0.520285605  0.443373891 -0.931297782  0.012420799
 [56] -0.041566146  0.012379523  0.196110050 -0.687018843  0.084728945
 [61] -0.326635889 -0.636975385  0.629154631 -0.192547771  0.020168260
 [66]  0.748340702  0.337224764 -0.265557023  0.258143368 -0.059736455
 [71] -0.290613922  0.146069415 -0.338241988 -0.152667751 -0.290963469
 [76] -0.210781794 -0.208989033  0.527564497 -0.221398435  0.274893924
 [81] -0.052648598 -0.166611482  0.326197860  0.076712926  0.221744842
 [86]  0.379730229 -0.079536535 -0.347764304 -0.474664449  0.495380215
 [91] -0.020068948 -0.573262198  0.073802701 -0.012727068  0.390909833
 [96]  0.138676805 -0.174935790  0.144548831  0.137996335  0.684715616
[101]  0.521467577  0.019217322  0.063208096  0.351204335  0.131721704
[106] -0.259042873 -0.136391158  0.212560448 -0.289520628  0.171794905
[111] -0.258353493  0.100239434  0.199591860 -0.175152387 -0.106120935
[116]  0.092912357  0.367709671  0.027400276 -0.003561458  0.142342041
[121]  0.236911356  0.095434605 -0.144893372 -0.231990923 -0.047845906
[126] -0.052579087  0.097519890 -0.520641154  0.529015775  0.667286966
[131] -0.061433442 -0.328127345  0.389121159 -0.236300600  0.234709104
[136] -0.352239737 -0.300378175 -0.348719637 -0.195227540 -0.367637150
[141] -0.072076135  0.333041952 -0.059281524 -0.219091270 -0.409388666
[146] -0.006468078  0.219974569 -0.158883089 -0.057922105 -0.594670620
[151] -0.388796036 -0.298643223 -0.004039964 -0.220418500  0.363090188
[156]  0.289017013  0.533258237  0.238535559  0.498174225  0.495730523
[161]  0.384671416  0.564039409 -0.163767004  0.297184301  0.491047824
[166]  0.521024082 -0.302525148  0.290601779  0.231505467  0.416447956
[171] -0.023804991  0.050470740  0.017371397 -0.599212821  0.038854904
[176] -0.471364143  0.324194456  0.657910217 -0.027707785  0.180007737
[181] -0.421448087 -0.100193481  0.610743167 -0.358584033  0.081593752
[186] -0.186642736 -0.016377003 -0.212057220  0.285417814  0.754914659
[191]  0.447125946  0.007341515 -0.130982190  0.006767842 -0.480075521
[196] -0.109223146 -0.174340774  0.046737855  0.851143210 -0.492485890
[201]  0.092454551  0.575047941  0.023964235  0.448441303 -0.268705374
[206] -0.555386260  0.609751217  0.019429544 -0.231249753 -0.427548760
[211]  0.331800929 -0.075204057  0.227123428  0.136034324 -0.198603533
[216] -0.428256880  0.109971658  0.081235337 -0.146909298 -0.535466361
[221] -0.172408871 -0.420435057 -0.709005938 -0.236174627  0.227479820
[226] -0.106954644 -0.238725448 -0.311731082 -0.643120891 -0.017737360
> 
> proc.time()
   user  system elapsed 
  1.824   0.806   2.655 

BufferedMatrix.Rcheck/tests/rawCalltesting.Rout


R version 4.4.2 (2024-10-31) -- "Pile of Leaves"
Copyright (C) 2024 The R Foundation for Statistical Computing
Platform: aarch64-unknown-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: 0x21f813c0>
> .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: 0x21f813c0>
> .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: 0x21f813c0>
> .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: 0x21f813c0>
> 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: 0x21a63d60>
> .Call("R_bm_AddColumn",P)
<pointer: 0x21a63d60>
> .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: 0x21a63d60>
> .Call("R_bm_AddColumn",P)
<pointer: 0x21a63d60>
> .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: 0x21a63d60>
> 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: 0x220957e0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x220957e0>
> .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: 0x220957e0>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x220957e0>
> .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: 0x220957e0>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x220957e0>
> .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: 0x220957e0>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x220957e0>
> .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: 0x220957e0>
> 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: 0x2298afd0>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x2298afd0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x2298afd0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x2298afd0>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile1845da4b3e946"  "BufferedMatrixFile1845da708f2829"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile1845da4b3e946"  "BufferedMatrixFile1845da708f2829"
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x22207da0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x22207da0>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x22207da0>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x22207da0>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x22207da0>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x22207da0>
> .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: 0x24276990>
> .Call("R_bm_AddColumn",P)
<pointer: 0x24276990>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x24276990>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x24276990>
> 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: 0x242c3cc0>
> .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: 0x242c3cc0>
> rm(P)
> 
> proc.time()
   user  system elapsed 
  0.343   0.029   0.357 

BufferedMatrix.Rcheck/tests/Rcodetesting.Rout


R version 4.4.2 (2024-10-31) -- "Pile of Leaves"
Copyright (C) 2024 The R Foundation for Statistical Computing
Platform: aarch64-unknown-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.319   0.026   0.330 

Example timings