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

This page was generated on 2025-11-15 11:34 -0500 (Sat, 15 Nov 2025).

HostnameOSArch (*)R versionInstalled pkgs
nebbiolo1Linux (Ubuntu 24.04.3 LTS)x86_64R Under development (unstable) (2025-10-20 r88955) -- "Unsuffered Consequences" 4826
kjohnson3macOS 13.7.7 Venturaarm64R Under development (unstable) (2025-11-04 r88984) -- "Unsuffered Consequences" 4561
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/2325HostnameOS / ArchINSTALLBUILDCHECKBUILD BIN
BufferedMatrix 1.75.0  (landing page)
Ben Bolstad
Snapshot Date: 2025-11-14 13:40 -0500 (Fri, 14 Nov 2025)
git_url: https://git.bioconductor.org/packages/BufferedMatrix
git_branch: devel
git_last_commit: ecdbf23
git_last_commit_date: 2025-10-29 09:58:55 -0500 (Wed, 29 Oct 2025)
nebbiolo1Linux (Ubuntu 24.04.3 LTS) / x86_64  OK    OK    OK  UNNEEDED, same version is already published
kjohnson3macOS 13.7.7 Ventura / arm64  OK    OK    WARNINGS    OK  UNNEEDED, same version is already published


CHECK results for BufferedMatrix on nebbiolo1

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

raw results


Summary

Package: BufferedMatrix
Version: 1.75.0
Command: /home/biocbuild/bbs-3.23-bioc/R/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/home/biocbuild/bbs-3.23-bioc/R/site-library --timings BufferedMatrix_1.75.0.tar.gz
StartedAt: 2025-11-14 21:38:12 -0500 (Fri, 14 Nov 2025)
EndedAt: 2025-11-14 21:38:37 -0500 (Fri, 14 Nov 2025)
EllapsedTime: 25.1 seconds
RetCode: 0
Status:   OK  
CheckDir: BufferedMatrix.Rcheck
Warnings: 0

Command output

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


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

Status: 1 NOTE
See
  ‘/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/00check.log’
for details.


Installation output

BufferedMatrix.Rcheck/00install.out

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


* installing to library ‘/home/biocbuild/bbs-3.23-bioc/R/site-library’
* installing *source* package ‘BufferedMatrix’ ...
** this is package ‘BufferedMatrix’ version ‘1.75.0’
** using staged installation
** libs
using C compiler: ‘gcc (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0’
gcc -std=gnu2x -I"/home/biocbuild/bbs-3.23-bioc/R/include" -DNDEBUG   -I/usr/local/include    -fpic  -g -O2  -Wall -Werror=format-security -c RBufferedMatrix.c -o RBufferedMatrix.o
gcc -std=gnu2x -I"/home/biocbuild/bbs-3.23-bioc/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){
      |            ^~~~~~~~~~~
gcc -std=gnu2x -I"/home/biocbuild/bbs-3.23-bioc/R/include" -DNDEBUG   -I/usr/local/include    -fpic  -g -O2  -Wall -Werror=format-security -c doubleBufferedMatrix_C_tests.c -o doubleBufferedMatrix_C_tests.o
gcc -std=gnu2x -I"/home/biocbuild/bbs-3.23-bioc/R/include" -DNDEBUG   -I/usr/local/include    -fpic  -g -O2  -Wall -Werror=format-security -c init_package.c -o init_package.o
gcc -std=gnu2x -shared -L/home/biocbuild/bbs-3.23-bioc/R/lib -L/usr/local/lib -o BufferedMatrix.so RBufferedMatrix.o doubleBufferedMatrix.o doubleBufferedMatrix_C_tests.o init_package.o -L/home/biocbuild/bbs-3.23-bioc/R/lib -lR
installing to /home/biocbuild/bbs-3.23-bioc/R/site-library/00LOCK-BufferedMatrix/00new/BufferedMatrix/libs
** R
** inst
** byte-compile and prepare package for lazy loading
Creating a new generic function for ‘rowMeans’ in package ‘BufferedMatrix’
Creating a new generic function for ‘rowSums’ in package ‘BufferedMatrix’
Creating a new generic function for ‘colMeans’ in package ‘BufferedMatrix’
Creating a new generic function for ‘colSums’ in package ‘BufferedMatrix’
Creating a generic function for ‘ncol’ from package ‘base’ in package ‘BufferedMatrix’
Creating a generic function for ‘nrow’ from package ‘base’ in package ‘BufferedMatrix’
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
** checking absolute paths in shared objects and dynamic libraries
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (BufferedMatrix)

Tests output

BufferedMatrix.Rcheck/tests/c_code_level_tests.Rout


R Under development (unstable) (2025-10-20 r88955) -- "Unsuffered Consequences"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu

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

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

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

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

Attaching package: 'BufferedMatrix'

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

    colMeans, colSums, rowMeans, rowSums

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

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

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

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

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

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

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

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

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

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

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

[[1]]
[1] 0

> 
> proc.time()
   user  system elapsed 
  0.261   0.039   0.287 

BufferedMatrix.Rcheck/tests/objectTesting.Rout


R Under development (unstable) (2025-10-20 r88955) -- "Unsuffered Consequences"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu

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

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

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

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

Attaching package: 'BufferedMatrix'

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

    colMeans, colSums, rowMeans, rowSums

> 
> 
> ### this is used to control how many repetitions in something below
> ### higher values result in more checks.
> nreps <-100 ##20000
> 
> 
> ## test creation and some simple assignments and subsetting operations
> 
> ## first on single elements
> tmp <- createBufferedMatrix(1000,10)
> 
> tmp[10,5]
[1] 0
> tmp[10,5] <- 10
> tmp[10,5]
[1] 10
> tmp[10,5] <- 12.445
> tmp[10,5]
[1] 12.445
> 
> 
> 
> ## now testing accessing multiple elements
> tmp2 <- createBufferedMatrix(10,20)
> 
> 
> tmp2[3,1] <- 51.34
> tmp2[9,2] <- 9.87654
> tmp2[,1:2]
       [,1]    [,2]
 [1,]  0.00 0.00000
 [2,]  0.00 0.00000
 [3,] 51.34 0.00000
 [4,]  0.00 0.00000
 [5,]  0.00 0.00000
 [6,]  0.00 0.00000
 [7,]  0.00 0.00000
 [8,]  0.00 0.00000
 [9,]  0.00 9.87654
[10,]  0.00 0.00000
> tmp2[,-(3:20)]
       [,1]    [,2]
 [1,]  0.00 0.00000
 [2,]  0.00 0.00000
 [3,] 51.34 0.00000
 [4,]  0.00 0.00000
 [5,]  0.00 0.00000
 [6,]  0.00 0.00000
 [7,]  0.00 0.00000
 [8,]  0.00 0.00000
 [9,]  0.00 9.87654
[10,]  0.00 0.00000
> tmp2[3,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
[1,] 51.34    0    0    0    0    0    0    0    0     0     0     0     0
     [,14] [,15] [,16] [,17] [,18] [,19] [,20]
[1,]     0     0     0     0     0     0     0
> tmp2[-3,]
      [,1]    [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [2,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [3,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [4,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [5,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [6,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [7,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [8,]    0 9.87654    0    0    0    0    0    0    0     0     0     0     0
 [9,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
      [,14] [,15] [,16] [,17] [,18] [,19] [,20]
 [1,]     0     0     0     0     0     0     0
 [2,]     0     0     0     0     0     0     0
 [3,]     0     0     0     0     0     0     0
 [4,]     0     0     0     0     0     0     0
 [5,]     0     0     0     0     0     0     0
 [6,]     0     0     0     0     0     0     0
 [7,]     0     0     0     0     0     0     0
 [8,]     0     0     0     0     0     0     0
 [9,]     0     0     0     0     0     0     0
> tmp2[2,1:3]
     [,1] [,2] [,3]
[1,]    0    0    0
> tmp2[3:9,1:3]
      [,1]    [,2] [,3]
[1,] 51.34 0.00000    0
[2,]  0.00 0.00000    0
[3,]  0.00 0.00000    0
[4,]  0.00 0.00000    0
[5,]  0.00 0.00000    0
[6,]  0.00 0.00000    0
[7,]  0.00 9.87654    0
> tmp2[-4,-4]
       [,1]    [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [2,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [3,] 51.34 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [4,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [5,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [6,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [7,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [8,]  0.00 9.87654    0    0    0    0    0    0    0     0     0     0     0
 [9,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
      [,14] [,15] [,16] [,17] [,18] [,19]
 [1,]     0     0     0     0     0     0
 [2,]     0     0     0     0     0     0
 [3,]     0     0     0     0     0     0
 [4,]     0     0     0     0     0     0
 [5,]     0     0     0     0     0     0
 [6,]     0     0     0     0     0     0
 [7,]     0     0     0     0     0     0
 [8,]     0     0     0     0     0     0
 [9,]     0     0     0     0     0     0
> 
> ## now testing accessing/assigning multiple elements
> tmp3 <- createBufferedMatrix(10,10)
> 
> for (i in 1:10){
+   for (j in 1:10){
+     tmp3[i,j] <- (j-1)*10 + i
+   }
+ }
> 
> tmp3[2:4,2:4]
     [,1] [,2] [,3]
[1,]   12   22   32
[2,]   13   23   33
[3,]   14   24   34
> tmp3[c(-10),c(2:4,2:4,10,1,2,1:10,10:1)]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]   11   21   31   11   21   31   91    1   11     1    11    21    31
 [2,]   12   22   32   12   22   32   92    2   12     2    12    22    32
 [3,]   13   23   33   13   23   33   93    3   13     3    13    23    33
 [4,]   14   24   34   14   24   34   94    4   14     4    14    24    34
 [5,]   15   25   35   15   25   35   95    5   15     5    15    25    35
 [6,]   16   26   36   16   26   36   96    6   16     6    16    26    36
 [7,]   17   27   37   17   27   37   97    7   17     7    17    27    37
 [8,]   18   28   38   18   28   38   98    8   18     8    18    28    38
 [9,]   19   29   39   19   29   39   99    9   19     9    19    29    39
      [,14] [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24] [,25]
 [1,]    41    51    61    71    81    91    91    81    71    61    51    41
 [2,]    42    52    62    72    82    92    92    82    72    62    52    42
 [3,]    43    53    63    73    83    93    93    83    73    63    53    43
 [4,]    44    54    64    74    84    94    94    84    74    64    54    44
 [5,]    45    55    65    75    85    95    95    85    75    65    55    45
 [6,]    46    56    66    76    86    96    96    86    76    66    56    46
 [7,]    47    57    67    77    87    97    97    87    77    67    57    47
 [8,]    48    58    68    78    88    98    98    88    78    68    58    48
 [9,]    49    59    69    79    89    99    99    89    79    69    59    49
      [,26] [,27] [,28] [,29]
 [1,]    31    21    11     1
 [2,]    32    22    12     2
 [3,]    33    23    13     3
 [4,]    34    24    14     4
 [5,]    35    25    15     5
 [6,]    36    26    16     6
 [7,]    37    27    17     7
 [8,]    38    28    18     8
 [9,]    39    29    19     9
> tmp3[-c(1:5),-c(6:10)]
     [,1] [,2] [,3] [,4] [,5]
[1,]    6   16   26   36   46
[2,]    7   17   27   37   47
[3,]    8   18   28   38   48
[4,]    9   19   29   39   49
[5,]   10   20   30   40   50
> 
> ## assignment of whole columns
> tmp3[,1] <- c(1:10*100.0)
> tmp3[,1:2] <- tmp3[,1:2]*100
> tmp3[,1:2] <- tmp3[,2:1]
> tmp3[,1:2]
      [,1]  [,2]
 [1,] 1100 1e+04
 [2,] 1200 2e+04
 [3,] 1300 3e+04
 [4,] 1400 4e+04
 [5,] 1500 5e+04
 [6,] 1600 6e+04
 [7,] 1700 7e+04
 [8,] 1800 8e+04
 [9,] 1900 9e+04
[10,] 2000 1e+05
> 
> 
> tmp3[,-1] <- tmp3[,1:9]
> tmp3[,1:10]
      [,1] [,2]  [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,] 1100 1100 1e+04   21   31   41   51   61   71    81
 [2,] 1200 1200 2e+04   22   32   42   52   62   72    82
 [3,] 1300 1300 3e+04   23   33   43   53   63   73    83
 [4,] 1400 1400 4e+04   24   34   44   54   64   74    84
 [5,] 1500 1500 5e+04   25   35   45   55   65   75    85
 [6,] 1600 1600 6e+04   26   36   46   56   66   76    86
 [7,] 1700 1700 7e+04   27   37   47   57   67   77    87
 [8,] 1800 1800 8e+04   28   38   48   58   68   78    88
 [9,] 1900 1900 9e+04   29   39   49   59   69   79    89
[10,] 2000 2000 1e+05   30   40   50   60   70   80    90
> 
> tmp3[,1:2] <- rep(1,10)
> tmp3[,1:2] <- rep(1,20)
> tmp3[,1:2] <- matrix(c(1:5),1,5)
> 
> tmp3[,-c(1:8)] <- matrix(c(1:5),1,5)
> 
> tmp3[1,] <- 1:10
> tmp3[1,]
     [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,]    1    2    3    4    5    6    7    8    9    10
> tmp3[-1,] <- c(1,2)
> tmp3[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    1    2    3    4    5    6    7    8    9    10
 [2,]    1    2    1    2    1    2    1    2    1     2
 [3,]    2    1    2    1    2    1    2    1    2     1
 [4,]    1    2    1    2    1    2    1    2    1     2
 [5,]    2    1    2    1    2    1    2    1    2     1
 [6,]    1    2    1    2    1    2    1    2    1     2
 [7,]    2    1    2    1    2    1    2    1    2     1
 [8,]    1    2    1    2    1    2    1    2    1     2
 [9,]    2    1    2    1    2    1    2    1    2     1
[10,]    1    2    1    2    1    2    1    2    1     2
> tmp3[-c(1:8),] <- matrix(c(1:5),1,5)
> tmp3[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    1    2    3    4    5    6    7    8    9    10
 [2,]    1    2    1    2    1    2    1    2    1     2
 [3,]    2    1    2    1    2    1    2    1    2     1
 [4,]    1    2    1    2    1    2    1    2    1     2
 [5,]    2    1    2    1    2    1    2    1    2     1
 [6,]    1    2    1    2    1    2    1    2    1     2
 [7,]    2    1    2    1    2    1    2    1    2     1
 [8,]    1    2    1    2    1    2    1    2    1     2
 [9,]    1    3    5    2    4    1    3    5    2     4
[10,]    2    4    1    3    5    2    4    1    3     5
> 
> 
> tmp3[1:2,1:2] <- 5555.04
> tmp3[-(1:2),1:2] <- 1234.56789
> 
> 
> 
> ## testing accessors for the directory and prefix
> directory(tmp3)
[1] "/home/biocbuild/bbs-3.23-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 478818 25.6    1048392   56   639317 34.2
Vcells 885623  6.8    8388608   64  2082728 15.9
> 
> 
> 
> 
> ##
> ## 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] "Fri Nov 14 21:38:27 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] "Fri Nov 14 21:38:27 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: 0x5d63183a15e0>
> 
> 
> 
> 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] "Fri Nov 14 21:38:28 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] "Fri Nov 14 21:38:28 2025"
> 
> ColMode(tmp2)
<pointer: 0x5d63183a15e0>
> 
> 
> 
> ### 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,] 98.5485744 -0.9726366 -0.2439268  0.08704278
[2,] -0.7063267 -0.7144686 -1.7499327  0.30163689
[3,] -1.9184168  0.3992329 -2.0677351 -0.43741741
[4,] -0.3375121 -0.1965696 -0.4810779  0.17159904
> ewApply(tmp5,abs)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.23-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,] 98.5485744 0.9726366 0.2439268 0.08704278
[2,]  0.7063267 0.7144686 1.7499327 0.30163689
[3,]  1.9184168 0.3992329 2.0677351 0.43741741
[4,]  0.3375121 0.1965696 0.4810779 0.17159904
> ewApply(tmp5,sqrt)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.23-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.9271635 0.9862234 0.4938895 0.2950301
[2,] 0.8404325 0.8452625 1.3228502 0.5492148
[3,] 1.3850693 0.6318488 1.4379621 0.6613754
[4,] 0.5809579 0.4433617 0.6935978 0.4142451
> 
> 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.23-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,] 222.82021 35.83487 30.18282 28.03734
[2,]  34.11065 34.16709 39.97843 30.79378
[3,]  40.76911 31.71772 41.44736 32.05117
[4,]  31.14709 29.63019 32.41706 29.31405
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x5d6317f2c840>
> exp(tmp5)
<pointer: 0x5d6317f2c840>
> log(tmp5,2)
<pointer: 0x5d6317f2c840>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 463.7711
> Min(tmp5)
[1] 52.6729
> mean(tmp5)
[1] 72.25553
> Sum(tmp5)
[1] 14451.11
> Var(tmp5)
[1] 853.0128
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 90.25187 70.28855 69.00185 70.24760 66.90445 69.50691 70.58680 73.05784
 [9] 72.57704 70.13239
> rowSums(tmp5)
 [1] 1805.037 1405.771 1380.037 1404.952 1338.089 1390.138 1411.736 1461.157
 [9] 1451.541 1402.648
> rowVars(tmp5)
 [1] 7818.88470   71.21693   88.00799   87.67340   75.82041   81.22583
 [7]  113.22715  100.75529   44.39415   46.05044
> rowSd(tmp5)
 [1] 88.424458  8.439012  9.381258  9.363408  8.707492  9.012537 10.640825
 [8] 10.037694  6.662893  6.786047
> rowMax(tmp5)
 [1] 463.77107  83.57509  86.26724  91.99054  82.77532  84.83521  88.17133
 [8]  92.39496  85.89280  83.32464
> rowMin(tmp5)
 [1] 56.71078 54.98913 55.27711 54.20777 53.76308 53.78669 52.67290 53.52521
 [9] 59.78744 58.47456
> 
> colMeans(tmp5)
 [1] 113.11884  70.60738  72.59543  63.00446  74.10792  68.51013  72.05748
 [8]  67.84331  69.20512  64.00467  66.50232  71.14510  74.26993  72.66416
[15]  69.62407  76.71378  69.96143  64.58083  70.05573  74.53851
> colSums(tmp5)
 [1] 1131.1884  706.0738  725.9543  630.0446  741.0792  685.1013  720.5748
 [8]  678.4331  692.0512  640.0467  665.0232  711.4510  742.6993  726.6416
[15]  696.2407  767.1378  699.6143  645.8083  700.5573  745.3851
> colVars(tmp5)
 [1] 15284.69153    51.81648    86.79879    22.43333    67.01492    67.05584
 [7]    42.91471    75.46182    88.22127    58.47717    69.31872    53.56076
[13]    93.59292    80.90259    40.74296    61.13628   113.87334    63.82651
[19]    65.50036   138.00287
> colSd(tmp5)
 [1] 123.631272   7.198366   9.316587   4.736384   8.186264   8.188763
 [7]   6.550932   8.686876   9.392618   7.647037   8.325787   7.318522
[13]   9.674343   8.994586   6.383021   7.818970  10.671145   7.989150
[19]   8.093229  11.747462
> colMax(tmp5)
 [1] 463.77107  79.46829  86.26724  71.60943  81.52665  81.86418  84.08376
 [8]  81.64529  80.81628  76.88510  81.82256  78.18056  91.99054  85.59794
[15]  77.49900  86.03674  83.36802  78.66047  81.95847  90.52977
> colMin(tmp5)
 [1] 58.94642 57.33078 56.19242 54.48697 56.71078 59.35420 62.56703 57.21673
 [9] 56.07452 54.20777 52.67290 59.78744 63.65076 60.95634 56.35805 62.01990
[17] 53.78669 53.76308 57.53645 53.52521
> 
> 
> ### 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] 90.25187 70.28855 69.00185 70.24760 66.90445 69.50691 70.58680       NA
 [9] 72.57704 70.13239
> rowSums(tmp5)
 [1] 1805.037 1405.771 1380.037 1404.952 1338.089 1390.138 1411.736       NA
 [9] 1451.541 1402.648
> rowVars(tmp5)
 [1] 7818.88470   71.21693   88.00799   87.67340   75.82041   81.22583
 [7]  113.22715   84.04150   44.39415   46.05044
> rowSd(tmp5)
 [1] 88.424458  8.439012  9.381258  9.363408  8.707492  9.012537 10.640825
 [8]  9.167415  6.662893  6.786047
> rowMax(tmp5)
 [1] 463.77107  83.57509  86.26724  91.99054  82.77532  84.83521  88.17133
 [8]        NA  85.89280  83.32464
> rowMin(tmp5)
 [1] 56.71078 54.98913 55.27711 54.20777 53.76308 53.78669 52.67290       NA
 [9] 59.78744 58.47456
> 
> colMeans(tmp5)
 [1] 113.11884  70.60738  72.59543  63.00446  74.10792  68.51013  72.05748
 [8]  67.84331  69.20512  64.00467  66.50232  71.14510  74.26993  72.66416
[15]  69.62407  76.71378  69.96143  64.58083  70.05573        NA
> colSums(tmp5)
 [1] 1131.1884  706.0738  725.9543  630.0446  741.0792  685.1013  720.5748
 [8]  678.4331  692.0512  640.0467  665.0232  711.4510  742.6993  726.6416
[15]  696.2407  767.1378  699.6143  645.8083  700.5573        NA
> colVars(tmp5)
 [1] 15284.69153    51.81648    86.79879    22.43333    67.01492    67.05584
 [7]    42.91471    75.46182    88.22127    58.47717    69.31872    53.56076
[13]    93.59292    80.90259    40.74296    61.13628   113.87334    63.82651
[19]    65.50036          NA
> colSd(tmp5)
 [1] 123.631272   7.198366   9.316587   4.736384   8.186264   8.188763
 [7]   6.550932   8.686876   9.392618   7.647037   8.325787   7.318522
[13]   9.674343   8.994586   6.383021   7.818970  10.671145   7.989150
[19]   8.093229         NA
> colMax(tmp5)
 [1] 463.77107  79.46829  86.26724  71.60943  81.52665  81.86418  84.08376
 [8]  81.64529  80.81628  76.88510  81.82256  78.18056  91.99054  85.59794
[15]  77.49900  86.03674  83.36802  78.66047  81.95847        NA
> colMin(tmp5)
 [1] 58.94642 57.33078 56.19242 54.48697 56.71078 59.35420 62.56703 57.21673
 [9] 56.07452 54.20777 52.67290 59.78744 63.65076 60.95634 56.35805 62.01990
[17] 53.78669 53.76308 57.53645       NA
> 
> Max(tmp5,na.rm=TRUE)
[1] 463.7711
> Min(tmp5,na.rm=TRUE)
[1] 52.6729
> mean(tmp5,na.rm=TRUE)
[1] 72.34965
> Sum(tmp5,na.rm=TRUE)
[1] 14397.58
> Var(tmp5,na.rm=TRUE)
[1] 855.5402
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 90.25187 70.28855 69.00185 70.24760 66.90445 69.50691 70.58680 74.08587
 [9] 72.57704 70.13239
> rowSums(tmp5,na.rm=TRUE)
 [1] 1805.037 1405.771 1380.037 1404.952 1338.089 1390.138 1411.736 1407.632
 [9] 1451.541 1402.648
> rowVars(tmp5,na.rm=TRUE)
 [1] 7818.88470   71.21693   88.00799   87.67340   75.82041   81.22583
 [7]  113.22715   84.04150   44.39415   46.05044
> rowSd(tmp5,na.rm=TRUE)
 [1] 88.424458  8.439012  9.381258  9.363408  8.707492  9.012537 10.640825
 [8]  9.167415  6.662893  6.786047
> rowMax(tmp5,na.rm=TRUE)
 [1] 463.77107  83.57509  86.26724  91.99054  82.77532  84.83521  88.17133
 [8]  92.39496  85.89280  83.32464
> rowMin(tmp5,na.rm=TRUE)
 [1] 56.71078 54.98913 55.27711 54.20777 53.76308 53.78669 52.67290 58.32819
 [9] 59.78744 58.47456
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 113.11884  70.60738  72.59543  63.00446  74.10792  68.51013  72.05748
 [8]  67.84331  69.20512  64.00467  66.50232  71.14510  74.26993  72.66416
[15]  69.62407  76.71378  69.96143  64.58083  70.05573  76.87333
> colSums(tmp5,na.rm=TRUE)
 [1] 1131.1884  706.0738  725.9543  630.0446  741.0792  685.1013  720.5748
 [8]  678.4331  692.0512  640.0467  665.0232  711.4510  742.6993  726.6416
[15]  696.2407  767.1378  699.6143  645.8083  700.5573  691.8599
> colVars(tmp5,na.rm=TRUE)
 [1] 15284.69153    51.81648    86.79879    22.43333    67.01492    67.05584
 [7]    42.91471    75.46182    88.22127    58.47717    69.31872    53.56076
[13]    93.59292    80.90259    40.74296    61.13628   113.87334    63.82651
[19]    65.50036    93.92562
> colSd(tmp5,na.rm=TRUE)
 [1] 123.631272   7.198366   9.316587   4.736384   8.186264   8.188763
 [7]   6.550932   8.686876   9.392618   7.647037   8.325787   7.318522
[13]   9.674343   8.994586   6.383021   7.818970  10.671145   7.989150
[19]   8.093229   9.691523
> colMax(tmp5,na.rm=TRUE)
 [1] 463.77107  79.46829  86.26724  71.60943  81.52665  81.86418  84.08376
 [8]  81.64529  80.81628  76.88510  81.82256  78.18056  91.99054  85.59794
[15]  77.49900  86.03674  83.36802  78.66047  81.95847  90.52977
> colMin(tmp5,na.rm=TRUE)
 [1] 58.94642 57.33078 56.19242 54.48697 56.71078 59.35420 62.56703 57.21673
 [9] 56.07452 54.20777 52.67290 59.78744 63.65076 60.95634 56.35805 62.01990
[17] 53.78669 53.76308 57.53645 63.11337
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1] 90.25187 70.28855 69.00185 70.24760 66.90445 69.50691 70.58680      NaN
 [9] 72.57704 70.13239
> rowSums(tmp5,na.rm=TRUE)
 [1] 1805.037 1405.771 1380.037 1404.952 1338.089 1390.138 1411.736    0.000
 [9] 1451.541 1402.648
> rowVars(tmp5,na.rm=TRUE)
 [1] 7818.88470   71.21693   88.00799   87.67340   75.82041   81.22583
 [7]  113.22715         NA   44.39415   46.05044
> rowSd(tmp5,na.rm=TRUE)
 [1] 88.424458  8.439012  9.381258  9.363408  8.707492  9.012537 10.640825
 [8]        NA  6.662893  6.786047
> rowMax(tmp5,na.rm=TRUE)
 [1] 463.77107  83.57509  86.26724  91.99054  82.77532  84.83521  88.17133
 [8]        NA  85.89280  83.32464
> rowMin(tmp5,na.rm=TRUE)
 [1] 56.71078 54.98913 55.27711 54.20777 53.76308 53.78669 52.67290       NA
 [9] 59.78744 58.47456
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1] 115.42150  69.62284  71.83913  62.82492  73.39169  67.23737  71.16826
 [8]  66.63412  70.38623  62.57351  65.89613  72.37367  74.47270  71.25805
[15]  69.49117  77.40295  71.25401  64.10196  69.10416       NaN
> colSums(tmp5,na.rm=TRUE)
 [1] 1038.7935  626.6055  646.5522  565.4243  660.5252  605.1363  640.5143
 [8]  599.7071  633.4761  563.1616  593.0652  651.3630  670.2543  641.3224
[15]  625.4205  696.6266  641.2861  576.9176  621.9374    0.0000
> colVars(tmp5,na.rm=TRUE)
 [1] 17135.62806    47.38857    91.21371    24.87487    69.62072    57.21374
 [7]    39.38342    68.44546    83.55479    42.74437    73.84951    43.27515
[13]   104.82946    68.77232    45.63714    63.43502   109.31135    69.22502
[19]    63.50122          NA
> colSd(tmp5,na.rm=TRUE)
 [1] 130.903125   6.883936   9.550587   4.987471   8.343903   7.563977
 [7]   6.275621   8.273177   9.140831   6.537918   8.593574   6.578385
[13]  10.238626   8.292908   6.755526   7.964611  10.455207   8.320157
[19]   7.968765         NA
> colMax(tmp5,na.rm=TRUE)
 [1] 463.77107  79.08952  86.26724  71.60943  81.52665  81.86418  84.08376
 [8]  81.64529  80.81628  70.96030  81.82256  78.18056  91.99054  85.59794
[15]  77.49900  86.03674  83.36802  78.66047  81.95847      -Inf
> colMin(tmp5,na.rm=TRUE)
 [1] 58.94642 57.33078 56.19242 54.48697 56.71078 59.35420 62.56703 57.21673
 [9] 56.07452 54.20777 52.67290 59.78744 63.65076 60.95634 56.35805 62.01990
[17] 53.78669 53.76308 57.53645      Inf
> 
> 
> 
> 
> 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] 295.2126 136.4714 164.5787 333.8298 178.1137 139.6739 291.2643 200.2707
 [9] 248.3855 189.5214
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 295.2126 136.4714 164.5787 333.8298 178.1137 139.6739 291.2643 200.2707
 [9] 248.3855 189.5214
> 
> 
> 
> 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-13  2.557954e-13 -5.684342e-14  5.684342e-14  1.136868e-13
 [6]  2.842171e-14  0.000000e+00 -5.684342e-14  1.278977e-13  1.421085e-13
[11]  0.000000e+00 -2.273737e-13  5.684342e-14  2.842171e-14  0.000000e+00
[16] -5.684342e-14  2.842171e-14  8.526513e-14  0.000000e+00  0.000000e+00
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> ## 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)
+ }
6   14 
7   12 
1   14 
5   15 
2   17 
1   8 
9   17 
1   10 
7   2 
3   5 
4   19 
3   1 
5   1 
7   17 
6   2 
10   3 
2   19 
4   18 
7   18 
10   13 
There were 50 or more warnings (use warnings() to see the first 50)
> 
> 
> ### now test 1 by n and n by 1 matrix
> 
> 
> err.tol <- 1e-12
> 
> rm(tmp5)
> 
> dataset1 <- rnorm(100)
> dataset2 <- rnorm(100)
> 
> tmp <- createBufferedMatrix(1,100)
> tmp[1,] <- dataset1
> 
> tmp2 <- createBufferedMatrix(100,1)
> tmp2[,1] <- dataset2
> 
> 
> 
> 
> 
> Max(tmp)
[1] 2.164643
> Min(tmp)
[1] -2.32508
> mean(tmp)
[1] 0.1029274
> Sum(tmp)
[1] 10.29274
> Var(tmp)
[1] 0.94427
> 
> rowMeans(tmp)
[1] 0.1029274
> rowSums(tmp)
[1] 10.29274
> rowVars(tmp)
[1] 0.94427
> rowSd(tmp)
[1] 0.9717356
> rowMax(tmp)
[1] 2.164643
> rowMin(tmp)
[1] -2.32508
> 
> colMeans(tmp)
  [1]  1.204899088  0.187213554 -1.441011509 -1.675717809 -0.335716152
  [6]  0.611069390 -0.500848854  0.123416655  0.036372286 -0.767282143
 [11]  0.859109063  0.433716080  0.299727766 -1.026829043  1.640113866
 [16]  1.584357050  0.162209605 -0.292422124  0.748086143 -1.294290019
 [21] -0.205681369  1.405153988  1.193455303  0.021570197 -0.399397726
 [26]  0.593469391  0.890359163 -0.776024179 -0.035698811 -0.600965671
 [31] -1.519077905  1.095839832 -0.500009973 -0.404127134 -0.463529129
 [36] -0.615731124  0.365376945  0.651423741  1.429390610 -0.598661144
 [41] -0.686286759 -1.530293305  0.571164116 -0.647601723  1.347637246
 [46]  0.723545458 -1.170999695  1.221344820  0.610858336  0.054065868
 [51]  0.924534577  0.189367259  1.357062881 -0.177920336 -0.264676782
 [56] -0.335634532 -0.831118805 -1.438269599 -1.014635118  1.077997276
 [61]  0.645590009 -0.918099459  1.566057821 -0.291618145  0.259895554
 [66]  0.917526115 -0.006461096  1.744550269  0.212478997  0.221294484
 [71] -0.069068285  0.448030912 -0.245571204 -1.136184575 -0.418759851
 [76]  1.911706777  1.008770281  0.819390713 -0.974106314 -0.808384396
 [81] -0.973376506 -1.295161871  1.553452073  1.084664361 -1.237312132
 [86]  1.093759214 -0.128507878 -0.013245557 -0.634302117  0.657625564
 [91]  1.194818576  2.164643018  0.820759414  0.231560485  1.773037944
 [96] -0.665733640 -2.325079501 -0.260808560 -1.386846136  1.688306144
> colSums(tmp)
  [1]  1.204899088  0.187213554 -1.441011509 -1.675717809 -0.335716152
  [6]  0.611069390 -0.500848854  0.123416655  0.036372286 -0.767282143
 [11]  0.859109063  0.433716080  0.299727766 -1.026829043  1.640113866
 [16]  1.584357050  0.162209605 -0.292422124  0.748086143 -1.294290019
 [21] -0.205681369  1.405153988  1.193455303  0.021570197 -0.399397726
 [26]  0.593469391  0.890359163 -0.776024179 -0.035698811 -0.600965671
 [31] -1.519077905  1.095839832 -0.500009973 -0.404127134 -0.463529129
 [36] -0.615731124  0.365376945  0.651423741  1.429390610 -0.598661144
 [41] -0.686286759 -1.530293305  0.571164116 -0.647601723  1.347637246
 [46]  0.723545458 -1.170999695  1.221344820  0.610858336  0.054065868
 [51]  0.924534577  0.189367259  1.357062881 -0.177920336 -0.264676782
 [56] -0.335634532 -0.831118805 -1.438269599 -1.014635118  1.077997276
 [61]  0.645590009 -0.918099459  1.566057821 -0.291618145  0.259895554
 [66]  0.917526115 -0.006461096  1.744550269  0.212478997  0.221294484
 [71] -0.069068285  0.448030912 -0.245571204 -1.136184575 -0.418759851
 [76]  1.911706777  1.008770281  0.819390713 -0.974106314 -0.808384396
 [81] -0.973376506 -1.295161871  1.553452073  1.084664361 -1.237312132
 [86]  1.093759214 -0.128507878 -0.013245557 -0.634302117  0.657625564
 [91]  1.194818576  2.164643018  0.820759414  0.231560485  1.773037944
 [96] -0.665733640 -2.325079501 -0.260808560 -1.386846136  1.688306144
> 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]  1.204899088  0.187213554 -1.441011509 -1.675717809 -0.335716152
  [6]  0.611069390 -0.500848854  0.123416655  0.036372286 -0.767282143
 [11]  0.859109063  0.433716080  0.299727766 -1.026829043  1.640113866
 [16]  1.584357050  0.162209605 -0.292422124  0.748086143 -1.294290019
 [21] -0.205681369  1.405153988  1.193455303  0.021570197 -0.399397726
 [26]  0.593469391  0.890359163 -0.776024179 -0.035698811 -0.600965671
 [31] -1.519077905  1.095839832 -0.500009973 -0.404127134 -0.463529129
 [36] -0.615731124  0.365376945  0.651423741  1.429390610 -0.598661144
 [41] -0.686286759 -1.530293305  0.571164116 -0.647601723  1.347637246
 [46]  0.723545458 -1.170999695  1.221344820  0.610858336  0.054065868
 [51]  0.924534577  0.189367259  1.357062881 -0.177920336 -0.264676782
 [56] -0.335634532 -0.831118805 -1.438269599 -1.014635118  1.077997276
 [61]  0.645590009 -0.918099459  1.566057821 -0.291618145  0.259895554
 [66]  0.917526115 -0.006461096  1.744550269  0.212478997  0.221294484
 [71] -0.069068285  0.448030912 -0.245571204 -1.136184575 -0.418759851
 [76]  1.911706777  1.008770281  0.819390713 -0.974106314 -0.808384396
 [81] -0.973376506 -1.295161871  1.553452073  1.084664361 -1.237312132
 [86]  1.093759214 -0.128507878 -0.013245557 -0.634302117  0.657625564
 [91]  1.194818576  2.164643018  0.820759414  0.231560485  1.773037944
 [96] -0.665733640 -2.325079501 -0.260808560 -1.386846136  1.688306144
> colMin(tmp)
  [1]  1.204899088  0.187213554 -1.441011509 -1.675717809 -0.335716152
  [6]  0.611069390 -0.500848854  0.123416655  0.036372286 -0.767282143
 [11]  0.859109063  0.433716080  0.299727766 -1.026829043  1.640113866
 [16]  1.584357050  0.162209605 -0.292422124  0.748086143 -1.294290019
 [21] -0.205681369  1.405153988  1.193455303  0.021570197 -0.399397726
 [26]  0.593469391  0.890359163 -0.776024179 -0.035698811 -0.600965671
 [31] -1.519077905  1.095839832 -0.500009973 -0.404127134 -0.463529129
 [36] -0.615731124  0.365376945  0.651423741  1.429390610 -0.598661144
 [41] -0.686286759 -1.530293305  0.571164116 -0.647601723  1.347637246
 [46]  0.723545458 -1.170999695  1.221344820  0.610858336  0.054065868
 [51]  0.924534577  0.189367259  1.357062881 -0.177920336 -0.264676782
 [56] -0.335634532 -0.831118805 -1.438269599 -1.014635118  1.077997276
 [61]  0.645590009 -0.918099459  1.566057821 -0.291618145  0.259895554
 [66]  0.917526115 -0.006461096  1.744550269  0.212478997  0.221294484
 [71] -0.069068285  0.448030912 -0.245571204 -1.136184575 -0.418759851
 [76]  1.911706777  1.008770281  0.819390713 -0.974106314 -0.808384396
 [81] -0.973376506 -1.295161871  1.553452073  1.084664361 -1.237312132
 [86]  1.093759214 -0.128507878 -0.013245557 -0.634302117  0.657625564
 [91]  1.194818576  2.164643018  0.820759414  0.231560485  1.773037944
 [96] -0.665733640 -2.325079501 -0.260808560 -1.386846136  1.688306144
> colMedians(tmp)
  [1]  1.204899088  0.187213554 -1.441011509 -1.675717809 -0.335716152
  [6]  0.611069390 -0.500848854  0.123416655  0.036372286 -0.767282143
 [11]  0.859109063  0.433716080  0.299727766 -1.026829043  1.640113866
 [16]  1.584357050  0.162209605 -0.292422124  0.748086143 -1.294290019
 [21] -0.205681369  1.405153988  1.193455303  0.021570197 -0.399397726
 [26]  0.593469391  0.890359163 -0.776024179 -0.035698811 -0.600965671
 [31] -1.519077905  1.095839832 -0.500009973 -0.404127134 -0.463529129
 [36] -0.615731124  0.365376945  0.651423741  1.429390610 -0.598661144
 [41] -0.686286759 -1.530293305  0.571164116 -0.647601723  1.347637246
 [46]  0.723545458 -1.170999695  1.221344820  0.610858336  0.054065868
 [51]  0.924534577  0.189367259  1.357062881 -0.177920336 -0.264676782
 [56] -0.335634532 -0.831118805 -1.438269599 -1.014635118  1.077997276
 [61]  0.645590009 -0.918099459  1.566057821 -0.291618145  0.259895554
 [66]  0.917526115 -0.006461096  1.744550269  0.212478997  0.221294484
 [71] -0.069068285  0.448030912 -0.245571204 -1.136184575 -0.418759851
 [76]  1.911706777  1.008770281  0.819390713 -0.974106314 -0.808384396
 [81] -0.973376506 -1.295161871  1.553452073  1.084664361 -1.237312132
 [86]  1.093759214 -0.128507878 -0.013245557 -0.634302117  0.657625564
 [91]  1.194818576  2.164643018  0.820759414  0.231560485  1.773037944
 [96] -0.665733640 -2.325079501 -0.260808560 -1.386846136  1.688306144
> colRanges(tmp)
         [,1]      [,2]      [,3]      [,4]       [,5]      [,6]       [,7]
[1,] 1.204899 0.1872136 -1.441012 -1.675718 -0.3357162 0.6110694 -0.5008489
[2,] 1.204899 0.1872136 -1.441012 -1.675718 -0.3357162 0.6110694 -0.5008489
          [,8]       [,9]      [,10]     [,11]     [,12]     [,13]     [,14]
[1,] 0.1234167 0.03637229 -0.7672821 0.8591091 0.4337161 0.2997278 -1.026829
[2,] 0.1234167 0.03637229 -0.7672821 0.8591091 0.4337161 0.2997278 -1.026829
        [,15]    [,16]     [,17]      [,18]     [,19]    [,20]      [,21]
[1,] 1.640114 1.584357 0.1622096 -0.2924221 0.7480861 -1.29429 -0.2056814
[2,] 1.640114 1.584357 0.1622096 -0.2924221 0.7480861 -1.29429 -0.2056814
        [,22]    [,23]     [,24]      [,25]     [,26]     [,27]      [,28]
[1,] 1.405154 1.193455 0.0215702 -0.3993977 0.5934694 0.8903592 -0.7760242
[2,] 1.405154 1.193455 0.0215702 -0.3993977 0.5934694 0.8903592 -0.7760242
           [,29]      [,30]     [,31]   [,32]    [,33]      [,34]      [,35]
[1,] -0.03569881 -0.6009657 -1.519078 1.09584 -0.50001 -0.4041271 -0.4635291
[2,] -0.03569881 -0.6009657 -1.519078 1.09584 -0.50001 -0.4041271 -0.4635291
          [,36]     [,37]     [,38]    [,39]      [,40]      [,41]     [,42]
[1,] -0.6157311 0.3653769 0.6514237 1.429391 -0.5986611 -0.6862868 -1.530293
[2,] -0.6157311 0.3653769 0.6514237 1.429391 -0.5986611 -0.6862868 -1.530293
         [,43]      [,44]    [,45]     [,46]  [,47]    [,48]     [,49]
[1,] 0.5711641 -0.6476017 1.347637 0.7235455 -1.171 1.221345 0.6108583
[2,] 0.5711641 -0.6476017 1.347637 0.7235455 -1.171 1.221345 0.6108583
          [,50]     [,51]     [,52]    [,53]      [,54]      [,55]      [,56]
[1,] 0.05406587 0.9245346 0.1893673 1.357063 -0.1779203 -0.2646768 -0.3356345
[2,] 0.05406587 0.9245346 0.1893673 1.357063 -0.1779203 -0.2646768 -0.3356345
          [,57]    [,58]     [,59]    [,60]   [,61]      [,62]    [,63]
[1,] -0.8311188 -1.43827 -1.014635 1.077997 0.64559 -0.9180995 1.566058
[2,] -0.8311188 -1.43827 -1.014635 1.077997 0.64559 -0.9180995 1.566058
          [,64]     [,65]     [,66]        [,67]   [,68]    [,69]     [,70]
[1,] -0.2916181 0.2598956 0.9175261 -0.006461096 1.74455 0.212479 0.2212945
[2,] -0.2916181 0.2598956 0.9175261 -0.006461096 1.74455 0.212479 0.2212945
           [,71]     [,72]      [,73]     [,74]      [,75]    [,76]   [,77]
[1,] -0.06906829 0.4480309 -0.2455712 -1.136185 -0.4187599 1.911707 1.00877
[2,] -0.06906829 0.4480309 -0.2455712 -1.136185 -0.4187599 1.911707 1.00877
         [,78]      [,79]      [,80]      [,81]     [,82]    [,83]    [,84]
[1,] 0.8193907 -0.9741063 -0.8083844 -0.9733765 -1.295162 1.553452 1.084664
[2,] 0.8193907 -0.9741063 -0.8083844 -0.9733765 -1.295162 1.553452 1.084664
         [,85]    [,86]      [,87]       [,88]      [,89]     [,90]    [,91]
[1,] -1.237312 1.093759 -0.1285079 -0.01324556 -0.6343021 0.6576256 1.194819
[2,] -1.237312 1.093759 -0.1285079 -0.01324556 -0.6343021 0.6576256 1.194819
        [,92]     [,93]     [,94]    [,95]      [,96]    [,97]      [,98]
[1,] 2.164643 0.8207594 0.2315605 1.773038 -0.6657336 -2.32508 -0.2608086
[2,] 2.164643 0.8207594 0.2315605 1.773038 -0.6657336 -2.32508 -0.2608086
         [,99]   [,100]
[1,] -1.386846 1.688306
[2,] -1.386846 1.688306
> 
> 
> Max(tmp2)
[1] 1.499012
> Min(tmp2)
[1] -2.174197
> mean(tmp2)
[1] -0.1506428
> Sum(tmp2)
[1] -15.06428
> Var(tmp2)
[1] 0.7075737
> 
> rowMeans(tmp2)
  [1] -1.532804777  0.755305355 -1.411890174  0.239015695 -1.375045780
  [6]  0.506682569  1.146436647 -0.250834906  0.596658352  0.618276084
 [11] -0.139631057 -0.171916250 -0.339079757 -0.574472931 -0.681591679
 [16]  0.439459054 -0.385969759  0.194056024  0.991194156 -1.405111367
 [21]  0.727740314 -0.327163575  0.465415737  0.372331567 -0.400682607
 [26] -1.120942296  1.223014971 -0.003302725 -0.360256367 -1.349402956
 [31] -1.712623826 -1.322719067  0.521124873  1.444062702 -0.009374256
 [36] -0.526724241 -1.360089687 -0.229818702 -0.076928987  0.765668637
 [41]  1.045373107 -1.031411602 -0.191313755  0.688696384  0.911875745
 [46] -0.819684569 -0.756479973  0.632452866  0.235994244 -0.123197879
 [51]  0.024994429 -0.600639657  1.386387277  1.436545508 -0.852029798
 [56]  0.783306715 -2.174197299  0.872509136 -0.243774431 -0.128612590
 [61]  0.194868670 -0.321580057 -0.628308048 -1.098350723 -0.951663280
 [66] -1.103975669  0.078699409 -0.379626404  0.982268176  1.056193362
 [71] -1.689289902 -0.058173272 -0.589121905 -0.174007480 -1.042292464
 [76] -1.674498143 -0.183158421  0.361478493  0.636928398 -0.701831659
 [81] -0.593986611  0.323398200  0.241901138  1.499011627 -0.523637050
 [86] -0.928415658 -1.369311706 -0.475884878  0.515431075 -0.672333875
 [91] -0.823294657  1.009261779 -0.114921849  0.018901432 -1.549462348
 [96]  0.703280124 -0.401736401  0.270176871  0.666695043 -0.608771327
> rowSums(tmp2)
  [1] -1.532804777  0.755305355 -1.411890174  0.239015695 -1.375045780
  [6]  0.506682569  1.146436647 -0.250834906  0.596658352  0.618276084
 [11] -0.139631057 -0.171916250 -0.339079757 -0.574472931 -0.681591679
 [16]  0.439459054 -0.385969759  0.194056024  0.991194156 -1.405111367
 [21]  0.727740314 -0.327163575  0.465415737  0.372331567 -0.400682607
 [26] -1.120942296  1.223014971 -0.003302725 -0.360256367 -1.349402956
 [31] -1.712623826 -1.322719067  0.521124873  1.444062702 -0.009374256
 [36] -0.526724241 -1.360089687 -0.229818702 -0.076928987  0.765668637
 [41]  1.045373107 -1.031411602 -0.191313755  0.688696384  0.911875745
 [46] -0.819684569 -0.756479973  0.632452866  0.235994244 -0.123197879
 [51]  0.024994429 -0.600639657  1.386387277  1.436545508 -0.852029798
 [56]  0.783306715 -2.174197299  0.872509136 -0.243774431 -0.128612590
 [61]  0.194868670 -0.321580057 -0.628308048 -1.098350723 -0.951663280
 [66] -1.103975669  0.078699409 -0.379626404  0.982268176  1.056193362
 [71] -1.689289902 -0.058173272 -0.589121905 -0.174007480 -1.042292464
 [76] -1.674498143 -0.183158421  0.361478493  0.636928398 -0.701831659
 [81] -0.593986611  0.323398200  0.241901138  1.499011627 -0.523637050
 [86] -0.928415658 -1.369311706 -0.475884878  0.515431075 -0.672333875
 [91] -0.823294657  1.009261779 -0.114921849  0.018901432 -1.549462348
 [96]  0.703280124 -0.401736401  0.270176871  0.666695043 -0.608771327
> rowVars(tmp2)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowSd(tmp2)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowMax(tmp2)
  [1] -1.532804777  0.755305355 -1.411890174  0.239015695 -1.375045780
  [6]  0.506682569  1.146436647 -0.250834906  0.596658352  0.618276084
 [11] -0.139631057 -0.171916250 -0.339079757 -0.574472931 -0.681591679
 [16]  0.439459054 -0.385969759  0.194056024  0.991194156 -1.405111367
 [21]  0.727740314 -0.327163575  0.465415737  0.372331567 -0.400682607
 [26] -1.120942296  1.223014971 -0.003302725 -0.360256367 -1.349402956
 [31] -1.712623826 -1.322719067  0.521124873  1.444062702 -0.009374256
 [36] -0.526724241 -1.360089687 -0.229818702 -0.076928987  0.765668637
 [41]  1.045373107 -1.031411602 -0.191313755  0.688696384  0.911875745
 [46] -0.819684569 -0.756479973  0.632452866  0.235994244 -0.123197879
 [51]  0.024994429 -0.600639657  1.386387277  1.436545508 -0.852029798
 [56]  0.783306715 -2.174197299  0.872509136 -0.243774431 -0.128612590
 [61]  0.194868670 -0.321580057 -0.628308048 -1.098350723 -0.951663280
 [66] -1.103975669  0.078699409 -0.379626404  0.982268176  1.056193362
 [71] -1.689289902 -0.058173272 -0.589121905 -0.174007480 -1.042292464
 [76] -1.674498143 -0.183158421  0.361478493  0.636928398 -0.701831659
 [81] -0.593986611  0.323398200  0.241901138  1.499011627 -0.523637050
 [86] -0.928415658 -1.369311706 -0.475884878  0.515431075 -0.672333875
 [91] -0.823294657  1.009261779 -0.114921849  0.018901432 -1.549462348
 [96]  0.703280124 -0.401736401  0.270176871  0.666695043 -0.608771327
> rowMin(tmp2)
  [1] -1.532804777  0.755305355 -1.411890174  0.239015695 -1.375045780
  [6]  0.506682569  1.146436647 -0.250834906  0.596658352  0.618276084
 [11] -0.139631057 -0.171916250 -0.339079757 -0.574472931 -0.681591679
 [16]  0.439459054 -0.385969759  0.194056024  0.991194156 -1.405111367
 [21]  0.727740314 -0.327163575  0.465415737  0.372331567 -0.400682607
 [26] -1.120942296  1.223014971 -0.003302725 -0.360256367 -1.349402956
 [31] -1.712623826 -1.322719067  0.521124873  1.444062702 -0.009374256
 [36] -0.526724241 -1.360089687 -0.229818702 -0.076928987  0.765668637
 [41]  1.045373107 -1.031411602 -0.191313755  0.688696384  0.911875745
 [46] -0.819684569 -0.756479973  0.632452866  0.235994244 -0.123197879
 [51]  0.024994429 -0.600639657  1.386387277  1.436545508 -0.852029798
 [56]  0.783306715 -2.174197299  0.872509136 -0.243774431 -0.128612590
 [61]  0.194868670 -0.321580057 -0.628308048 -1.098350723 -0.951663280
 [66] -1.103975669  0.078699409 -0.379626404  0.982268176  1.056193362
 [71] -1.689289902 -0.058173272 -0.589121905 -0.174007480 -1.042292464
 [76] -1.674498143 -0.183158421  0.361478493  0.636928398 -0.701831659
 [81] -0.593986611  0.323398200  0.241901138  1.499011627 -0.523637050
 [86] -0.928415658 -1.369311706 -0.475884878  0.515431075 -0.672333875
 [91] -0.823294657  1.009261779 -0.114921849  0.018901432 -1.549462348
 [96]  0.703280124 -0.401736401  0.270176871  0.666695043 -0.608771327
> 
> colMeans(tmp2)
[1] -0.1506428
> colSums(tmp2)
[1] -15.06428
> colVars(tmp2)
[1] 0.7075737
> colSd(tmp2)
[1] 0.841174
> colMax(tmp2)
[1] 1.499012
> colMin(tmp2)
[1] -2.174197
> colMedians(tmp2)
[1] -0.1729619
> colRanges(tmp2)
          [,1]
[1,] -2.174197
[2,]  1.499012
> 
> 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]  1.6017551 -3.1504674  0.2713777  0.4596625 -3.7146181  5.0621287
 [7] -6.8429537 -2.1944742 -3.5182267 -3.1818331
> colApply(tmp,quantile)[,1]
            [,1]
[1,] -1.00015494
[2,] -0.09003388
[3,]  0.20145768
[4,]  0.46639903
[5,]  1.39266047
> 
> rowApply(tmp,sum)
 [1] -4.369545 -1.335145 -1.223746 -2.776441 -3.988478 -1.314796  1.231512
 [8] -1.918013 -1.082510  1.569511
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    7    9    7    6    4    7    9    9    8     6
 [2,]    8    6    1    4    2    3   10    7    4     3
 [3,]    9   10    4    3    9    9    7    5    1     5
 [4,]    5    2   10    5    6    8    1   10    7     8
 [5,]    1    8    9    2    5    6    3    2    9     4
 [6,]    6    4    6    8    7   10    8    4   10    10
 [7,]    2    3    5   10    1    4    6    3    3     1
 [8,]    3    5    3    9   10    1    4    6    6     2
 [9,]    4    1    2    7    8    5    5    1    5     9
[10,]   10    7    8    1    3    2    2    8    2     7
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1] -0.31602075 -0.10218193 -0.33834274 -1.24716490 -4.56149701 -0.21172103
 [7] -0.89661715  1.39514566  0.37454071 -0.58962471  0.04060276 -1.35396462
[13] -3.90034105 -2.09238487 -1.61121250  2.74841780 -3.72408881  2.72892936
[19] -4.01256452  2.09930180
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -0.8048281
[2,] -0.5183303
[3,] -0.1667254
[4,]  0.5675167
[5,]  0.6063465
> 
> rowApply(tmp,sum)
[1] -10.76791234  -1.08470812   0.87507984  -4.57255294  -0.02069495
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]   13   16    6    9   13
[2,]    9    8    5   16   15
[3,]    7   14   14    6   16
[4,]    8   17   19    8    2
[5,]    2   11    2    7   10
> 
> 
> as.matrix(tmp)
           [,1]       [,2]       [,3]       [,4]       [,5]        [,6]
[1,] -0.1667254 -0.5065475 -0.8412639 -0.7562563 -2.5866193  0.14770565
[2,]  0.6063465 -0.3614809  0.1474830  0.8681110 -0.1336759 -1.10587503
[3,] -0.5183303 -0.5840065  0.3289404  1.4477261 -1.0405094 -0.09038399
[4,] -0.8048281  0.6570741 -0.9390907 -0.8777316 -0.9347744  0.18482405
[5,]  0.5675167  0.6927788  0.9655884 -1.9290141  0.1340820  0.65200828
           [,7]       [,8]         [,9]        [,10]      [,11]      [,12]
[1,] -0.4850215 -0.1843438  0.001221155  0.111370520 -0.3452686 -1.5125287
[2,] -0.7228352  2.0319026  1.384112275  1.177784539 -0.2241718 -0.2043436
[3,] -1.2485245 -0.2276278  1.299033478 -0.901729760 -0.6455178  0.1414460
[4,]  1.7677364  1.0231701 -1.047098912 -0.003521164 -0.4138044  0.8772900
[5,] -0.2079722 -1.2479555 -1.262727283 -0.973528841  1.6693653 -0.6558284
          [,13]       [,14]       [,15]      [,16]      [,17]       [,18]
[1,] -2.0590027 -0.04129845 -1.20229984  0.7270562 -2.8450316  1.49166530
[2,] -1.7993122 -1.39783140  0.09026814 -0.3723350 -0.9781257  0.08794134
[3,] -0.2657666 -0.29840931 -0.39825816  1.6746877 -0.1181702  0.97276624
[4,] -0.2435112 -1.49530779 -1.35441272  0.4414495 -1.0441376  0.70799652
[5,]  0.4672516  1.14046208  1.25349008  0.2775594  1.2613763 -0.53144003
          [,19]      [,20]
[1,] -1.4761964  1.7614726
[2,]  0.2254271 -0.4040979
[3,]  0.4085407  0.9391736
[4,] -1.2086353  0.1347602
[5,] -1.9617006 -0.3320068
> 
> 
> 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.23-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.23-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  654  bytes.
Disk usage :  200  bytes.
> subBufferedMatrix(tmp,,5:8)
BufferedMatrix object
Matrix size:  5 4 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  566  bytes.
Disk usage :  160  bytes.
> subBufferedMatrix(tmp,1:3,)
BufferedMatrix object
Matrix size:  3 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.23-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.7398656 0.7654879 1.963517 0.772078 1.044553 -0.5856934 0.1780359
          col8      col9     col10     col11    col12    col13     col14  col15
row1 -0.600441 0.1238977 -0.384021 0.9725737 2.048986 -1.35337 -1.480991 1.4221
          col16      col17    col18     col19    col20
row1 -0.3279237 -0.5815999 1.606738 -1.552467 1.027538
> tmp[,"col10"]
          col10
row1 -0.3840210
row2  0.9263594
row3 -0.1908025
row4 -0.4074666
row5 -1.6480934
> tmp[c("row1","row5"),]
           col1      col2      col3      col4       col5       col6        col7
row1 -0.7398656 0.7654879 1.9635170 0.7720780  1.0445530 -0.5856934  0.17803591
row5 -0.2813905 0.4914126 0.2732324 0.6925799 -0.4148018  0.1736405 -0.06856295
           col8       col9     col10       col11      col12      col13
row1 -0.6004410  0.1238977 -0.384021 0.972573744  2.0489863 -1.3533696
row5 -0.5930223 -0.3466954 -1.648093 0.001711295 -0.2645906 -0.9892354
          col14     col15      col16      col17      col18      col19    col20
row1 -1.4809915  1.422100 -0.3279237 -0.5815999  1.6067384 -1.5524669 1.027538
row5 -0.6480057 -2.493634 -1.9204460 -0.1546314 -0.4700981  0.3772878 1.681434
> tmp[,c("col6","col20")]
           col6      col20
row1 -0.5856934  1.0275382
row2 -0.3010327  1.4078624
row3 -0.5986304 -0.9006316
row4  0.3688578  0.9747542
row5  0.1736405  1.6814345
> tmp[c("row1","row5"),c("col6","col20")]
           col6    col20
row1 -0.5856934 1.027538
row5  0.1736405 1.681434
> 
> 
> 
> 
> tmp["row1",] <- rnorm(20,mean=10)
> tmp[,"col10"] <- rnorm(5,mean=30)
> tmp[c("row1","row5"),] <- rnorm(40,mean=50)
> tmp[,c("col6","col20")] <- rnorm(10,mean=75)
> tmp[c("row1","row5"),c("col6","col20")]  <- rnorm(4,mean=105)
> 
> tmp["row1",]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 49.18476 50.34458 50.84465 50.71622 50.05551 105.5156 50.69878 49.92838
         col9    col10    col11    col12    col13    col14    col15    col16
row1 50.49628 48.51089 49.50664 49.97635 49.25411 50.02754 51.10944 50.21854
        col17    col18    col19    col20
row1 50.06075 50.40931 47.62072 104.8493
> tmp[,"col10"]
        col10
row1 48.51089
row2 31.60250
row3 29.53089
row4 29.37842
row5 49.18924
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 49.18476 50.34458 50.84465 50.71622 50.05551 105.5156 50.69878 49.92838
row5 50.25760 50.93457 50.66228 48.96042 50.10826 105.8906 50.27854 50.73976
         col9    col10    col11    col12    col13    col14    col15    col16
row1 50.49628 48.51089 49.50664 49.97635 49.25411 50.02754 51.10944 50.21854
row5 49.01513 49.18924 51.04160 49.87496 52.06480 49.99056 49.25731 48.81149
        col17    col18    col19    col20
row1 50.06075 50.40931 47.62072 104.8493
row5 50.29471 50.12110 52.59967 104.0370
> tmp[,c("col6","col20")]
          col6     col20
row1 105.51559 104.84935
row2  75.49711  75.57323
row3  74.36191  75.18758
row4  75.63107  73.78615
row5 105.89059 104.03703
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 105.5156 104.8493
row5 105.8906 104.0370
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 105.5156 104.8493
row5 105.8906 104.0370
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
          col13
[1,]  0.8197768
[2,] -0.1612456
[3,]  0.4629231
[4,]  0.6032684
[5,] -0.4461606
> tmp[,c("col17","col7")]
          col17       col7
[1,]  0.1573924 1.08120502
[2,] -0.6181036 0.08718765
[3,]  1.4471911 0.04409273
[4,] -0.4665503 1.46332975
[5,] -2.0824030 1.28317545
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
           col6       col20
[1,] -0.8333298  2.23635799
[2,]  1.1774434 -0.09952232
[3,] -0.1859869 -0.73186608
[4,]  0.5753311  0.21675646
[5,]  0.7570335 -0.08169479
> subBufferedMatrix(tmp,1,c("col6"))[,1]
           col1
[1,] -0.8333298
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
           col6
[1,] -0.8333298
[2,]  1.1774434
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> 
> 
> 
> subBufferedMatrix(tmp,c("row3","row1"),)[,1:20]
          [,1]       [,2]       [,3]       [,4]       [,5]       [,6]      [,7]
row3 0.3174311 -0.6476394 -0.1705399 -0.5583441 -0.1173769 1.25415806 0.2980339
row1 1.7625446  0.2504984  0.5778301  1.1836811 -0.4549098 0.04621704 0.2565094
          [,8]      [,9]    [,10]     [,11]      [,12]      [,13]      [,14]
row3 0.8185140 0.7634782 1.310485 0.6677870 -1.7850860  1.9467121 -0.5662762
row1 0.3044849 0.9807236 1.083051 0.6493871 -0.3721455 -0.6213742  1.4650389
          [,15]       [,16]       [,17]     [,18]      [,19]      [,20]
row3  0.5367402 -0.05024006 -0.08194205 0.5862334 -1.2863768 -0.3871559
row1 -1.5835439  0.10519887 -0.56739286 1.0576313 -0.5237004  0.1026002
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
          [,1]      [,2]     [,3]       [,4]      [,5]      [,6]       [,7]
row2 0.8728303 0.1108796 1.183679 -0.5291344 -0.703692 -1.170109 -0.1685034
           [,8]      [,9]      [,10]
row2 -0.6506615 0.3582688 -0.4436657
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
        [,1]      [,2]      [,3]     [,4]     [,5]       [,6]       [,7]
row5 0.81804 0.1632118 0.7371106 1.011774 1.491002 -0.9843111 -0.8349718
          [,8]     [,9]    [,10]     [,11]     [,12]     [,13]     [,14]
row5 0.7094888 1.041275 2.529229 -1.091338 0.3264525 0.4175182 0.4457303
        [,15]      [,16]     [,17]      [,18]    [,19]    [,20]
row5 0.724222 0.07086711 0.3435669 -0.1244846 1.106503 1.081491
> 
> 
> 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: 0x5d6317cf15b0>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1a56a9cf8cde9" 
 [2] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1a56a9de2769a" 
 [3] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1a56a93a44d38b"
 [4] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1a56a93ff16f70"
 [5] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1a56a918a92a84"
 [6] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1a56a9793ebd4e"
 [7] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1a56a9572caed" 
 [8] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1a56a9120d8970"
 [9] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1a56a966935bac"
[10] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1a56a94a2d069f"
[11] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1a56a92ed01601"
[12] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1a56a9696a8719"
[13] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1a56a94e8591f1"
[14] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1a56a9667c37cc"
[15] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1a56a944421731"
> 
> 
> ### 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: 0x5d6317b94db0>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x5d6317b94db0>
Warning message:
In dir.create(new.directory) :
  '/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x5d6317b94db0>
> rowMedians(tmp)
  [1] -0.2619576217  0.6069478046 -0.0226468320  0.0453240382  0.4390034411
  [6] -0.1047335610  0.2479553562 -0.7690133281 -0.1268271508 -0.1744845622
 [11]  0.3227162343  0.0791200271  0.0411427455 -0.1856971980 -0.0478562058
 [16] -0.2093833129  0.4608150944  0.4278214791  0.3657850680 -0.3928790265
 [21] -0.0715773890  0.1793802825  0.5927130669  0.1178135870 -0.0009171177
 [26]  0.3872562051 -0.0507904743 -0.6928488147  0.1234980489 -0.2857417364
 [31] -0.0572305057 -0.1014098343  0.0890669370  0.3362453090 -0.6811494974
 [36] -0.7356461235 -0.1133673567  0.4872049885  0.6524960645  0.3293351447
 [41] -0.4446550660 -0.1929603581 -0.0475563260 -0.2062600467 -0.2211354513
 [46] -0.2201577027  0.5933595401  0.0019853104  0.2364876132 -0.5558156171
 [51] -0.0218541252 -0.1902155127  0.0350686829  0.4631848100 -0.2671817358
 [56]  0.1935397118  0.0599212976  0.1675262117 -0.0925180138 -0.1544544521
 [61] -0.5069250709 -0.3535602899  0.1107874555 -0.1524519928 -0.3621889227
 [66] -0.3405633649  0.0265902962  0.2298102699  0.6463561030 -0.1617700724
 [71]  0.0495537103  0.1629519480  0.0686673274 -0.5458616351  0.2065334996
 [76] -0.2050550638  0.1118893930 -0.2876128625 -0.0879444606  0.2620016026
 [81]  0.2908501485  0.0462777444 -0.4549262249 -0.4996909468  0.1483094817
 [86]  0.1457247171  0.0817613565 -0.0612240326 -0.0422229690 -0.2092438693
 [91]  0.1933092421 -0.3313987962 -0.0344689841  0.4401815795 -0.2809806263
 [96]  0.1001455551 -0.2764819977 -0.0615214278 -0.1563872140 -0.1373950887
[101]  0.5413428273 -0.0761865514 -0.2062142271 -0.5995656564  0.2667059483
[106] -0.0996615585  0.5148114212  0.0408146946  0.0782103952 -0.0360057257
[111]  0.1252079992  0.3298152511  0.2376777528  0.1302866802 -0.1734997574
[116] -0.1533118296  0.2397706515 -0.3905999755  0.6703490348 -0.1000641803
[121] -0.3290447336 -0.3496836519  0.1794853889 -0.7102179207 -0.0946200343
[126] -0.3294848013  0.0688130622  0.2247687250  0.3210174346  0.2205696057
[131]  0.3214176006  0.2059250851  0.3389577529 -0.0525500296 -0.0208311357
[136] -0.0397431230 -0.4858748940  0.1652236727 -0.1506779183  0.0241716366
[141] -0.5617545691 -0.2531169993 -0.1009172240 -0.2893879029 -0.2290899070
[146] -0.1370036499 -0.0479330659  0.1490937545 -0.0869270292 -0.1368246327
[151] -0.1713952884 -0.0376909920 -0.1664035487  0.6167978427  0.1781477600
[156]  0.1678062871 -0.5021830935  0.0558022295 -0.3067562460  0.2578551059
[161] -0.4922147830  0.2208831554 -0.1138508809  0.2263930156  0.3741046278
[166] -0.0491799974  0.2570477882  0.1109761516  0.1161900719 -0.1531541992
[171] -0.1150408227 -0.0625169482 -0.2719509984  0.3602663716 -0.0421124660
[176] -0.0160633311 -0.1719880805 -0.3857488217  0.4147502651  0.0679778560
[181]  0.2044138416 -0.3343789584 -0.6059452023 -0.1277233872 -0.5385390843
[186] -0.2912239948  0.2790846947  0.1738515036 -0.0479569247 -0.5357351190
[191]  0.1020473134 -0.1401639139 -0.1321869534  0.0168472950 -0.3078363626
[196]  0.1940060268 -0.4791874127 -0.0793698636  0.7791187078  0.4407573971
[201] -0.4412177184  0.2257501813 -0.3646177276 -0.3243357242  0.2564653147
[206]  0.5801994989 -0.7272568107 -0.8268606574 -0.0596186491  0.0810961749
[211]  0.0362441444 -0.1037012567 -0.3293730051 -0.0552951298  0.3428610618
[216]  0.3418437890  0.4917465607 -0.0334434549  0.6944481589 -0.0771939272
[221]  0.5538798959  0.6137163099 -0.1285879740  0.0078887381  0.2010030401
[226]  0.2797650297 -0.1142357912 -0.7384487482 -0.7789681950  0.1223071877
> 
> proc.time()
   user  system elapsed 
  1.427   1.435   2.850 

BufferedMatrix.Rcheck/tests/rawCalltesting.Rout


R Under development (unstable) (2025-10-20 r88955) -- "Unsuffered Consequences"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu

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

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

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

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

Attaching package: 'BufferedMatrix'

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

    colMeans, colSums, rowMeans, rowSums

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

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

<pointer: 0x56efc5397b20>
> .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: 0x56efc5397b20>
> .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: 0x56efc5397b20>
> .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: 0x56efc5397b20>
> 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: 0x56efc5378410>
> .Call("R_bm_AddColumn",P)
<pointer: 0x56efc5378410>
> .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: 0x56efc5378410>
> .Call("R_bm_AddColumn",P)
<pointer: 0x56efc5378410>
> .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: 0x56efc5378410>
> 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: 0x56efc3c257a0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x56efc3c257a0>
> .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: 0x56efc3c257a0>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x56efc3c257a0>
> .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: 0x56efc3c257a0>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x56efc3c257a0>
> .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: 0x56efc3c257a0>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x56efc3c257a0>
> .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: 0x56efc3c257a0>
> 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: 0x56efc4bf7680>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x56efc4bf7680>
> .Call("R_bm_AddColumn",P)
<pointer: 0x56efc4bf7680>
> .Call("R_bm_AddColumn",P)
<pointer: 0x56efc4bf7680>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile1a583b667fa194" "BufferedMatrixFile1a583b73ffe5af"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile1a583b667fa194" "BufferedMatrixFile1a583b73ffe5af"
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x56efc498b490>
> .Call("R_bm_AddColumn",P)
<pointer: 0x56efc498b490>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x56efc498b490>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x56efc498b490>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x56efc498b490>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x56efc498b490>
> .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: 0x56efc5fe7110>
> .Call("R_bm_AddColumn",P)
<pointer: 0x56efc5fe7110>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x56efc5fe7110>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x56efc5fe7110>
> 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: 0x56efc608a5e0>
> .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: 0x56efc608a5e0>
> rm(P)
> 
> proc.time()
   user  system elapsed 
  0.248   0.064   0.299 

BufferedMatrix.Rcheck/tests/Rcodetesting.Rout


R Under development (unstable) (2025-10-20 r88955) -- "Unsuffered Consequences"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu

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

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

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

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

Attaching package: 'BufferedMatrix'

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

    colMeans, colSums, rowMeans, rowSums

> 
> Temp <- createBufferedMatrix(100)
> dim(Temp)
[1] 100   0
> buffer.dim(Temp)
[1] 1 1
> 
> 
> proc.time()
   user  system elapsed 
  0.237   0.045   0.271 

Example timings