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

This page was generated on 2025-12-04 11:35 -0500 (Thu, 04 Dec 2025).

HostnameOSArch (*)R versionInstalled pkgs
nebbiolo1Linux (Ubuntu 24.04.3 LTS)x86_64R Under development (unstable) (2025-10-20 r88955) -- "Unsuffered Consequences" 4869
kjohnson3macOS 13.7.7 Venturaarm64R Under development (unstable) (2025-11-04 r88984) -- "Unsuffered Consequences" 4576
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 253/2331HostnameOS / ArchINSTALLBUILDCHECKBUILD BIN
BufferedMatrix 1.75.0  (landing page)
Ben Bolstad
Snapshot Date: 2025-12-03 13:40 -0500 (Wed, 03 Dec 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 kjohnson3

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: /Library/Frameworks/R.framework/Resources/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/Library/Frameworks/R.framework/Resources/library --no-vignettes --timings BufferedMatrix_1.75.0.tar.gz
StartedAt: 2025-12-03 19:30:10 -0500 (Wed, 03 Dec 2025)
EndedAt: 2025-12-03 19:33:17 -0500 (Wed, 03 Dec 2025)
EllapsedTime: 187.0 seconds
RetCode: 0
Status:   WARNINGS  
CheckDir: BufferedMatrix.Rcheck
Warnings: 1

Command output

##############################################################################
##############################################################################
###
### Running command:
###
###   /Library/Frameworks/R.framework/Resources/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/Library/Frameworks/R.framework/Resources/library --no-vignettes --timings BufferedMatrix_1.75.0.tar.gz
###
##############################################################################
##############################################################################


* using log directory ‘/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck’
* using R Under development (unstable) (2025-11-04 r88984)
* using platform: aarch64-apple-darwin20
* R was compiled by
    Apple clang version 16.0.0 (clang-1600.0.26.6)
    GNU Fortran (GCC) 14.2.0
* running under: macOS Ventura 13.7.8
* using session charset: UTF-8
* using option ‘--no-vignettes’
* 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 ... WARNING
Found the following significant warnings:
  doubleBufferedMatrix.c:1580:7: warning: logical not is only applied to the left hand side of this bitwise operator [-Wlogical-not-parentheses]
See ‘/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/00install.out’ for details.
* used C compiler: ‘Apple clang version 15.0.0 (clang-1500.1.0.2.5)’
* used SDK: ‘MacOSX11.3.1.sdk’
* 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 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’ ... OK
* checking files in ‘vignettes’ ... OK
* checking examples ... NONE
* checking for unstated dependencies in ‘tests’ ... OK
* checking tests ...
  Running ‘Rcodetesting.R’
  Running ‘c_code_level_tests.R’
  Running ‘objectTesting.R’
  Running ‘rawCalltesting.R’
 OK
* checking for unstated dependencies in vignettes ... OK
* checking package vignettes ... OK
* checking running R code from vignettes ... SKIPPED
* checking re-building of vignette outputs ... SKIPPED
* checking PDF version of manual ... OK
* DONE

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


Installation output

BufferedMatrix.Rcheck/00install.out

##############################################################################
##############################################################################
###
### Running command:
###
###   /Library/Frameworks/R.framework/Resources/bin/R CMD INSTALL BufferedMatrix
###
##############################################################################
##############################################################################


* installing to library ‘/Library/Frameworks/R.framework/Versions/4.6-arm64/Resources/library’
* installing *source* package ‘BufferedMatrix’ ...
** this is package ‘BufferedMatrix’ version ‘1.75.0’
** using staged installation
** libs
using C compiler: ‘Apple clang version 15.0.0 (clang-1500.1.0.2.5)’
using SDK: ‘MacOSX11.3.1.sdk’
clang -arch arm64 -std=gnu2x -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/opt/R/arm64/include    -fPIC  -falign-functions=64 -Wall -g -O2  -c RBufferedMatrix.c -o RBufferedMatrix.o
clang -arch arm64 -std=gnu2x -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/opt/R/arm64/include    -fPIC  -falign-functions=64 -Wall -g -O2  -c doubleBufferedMatrix.c -o doubleBufferedMatrix.o
doubleBufferedMatrix.c:1580:7: warning: logical not is only applied to the left hand side of this bitwise operator [-Wlogical-not-parentheses]
  if (!(Matrix->readonly) & setting){
      ^                   ~
doubleBufferedMatrix.c:1580:7: note: add parentheses after the '!' to evaluate the bitwise operator first
  if (!(Matrix->readonly) & setting){
      ^
       (                           )
doubleBufferedMatrix.c:1580:7: note: add parentheses around left hand side expression to silence this warning
  if (!(Matrix->readonly) & setting){
      ^
      (                  )
doubleBufferedMatrix.c:3327:12: warning: unused function 'sort_double' [-Wunused-function]
static int sort_double(const double *a1,const double *a2){
           ^
2 warnings generated.
clang -arch arm64 -std=gnu2x -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/opt/R/arm64/include    -fPIC  -falign-functions=64 -Wall -g -O2  -c doubleBufferedMatrix_C_tests.c -o doubleBufferedMatrix_C_tests.o
clang -arch arm64 -std=gnu2x -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/opt/R/arm64/include    -fPIC  -falign-functions=64 -Wall -g -O2  -c init_package.c -o init_package.o
clang -arch arm64 -std=gnu2x -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -L/Library/Frameworks/R.framework/Resources/lib -L/opt/R/arm64/lib -o BufferedMatrix.so RBufferedMatrix.o doubleBufferedMatrix.o doubleBufferedMatrix_C_tests.o init_package.o -F/Library/Frameworks/R.framework/.. -framework R
installing to /Library/Frameworks/R.framework/Versions/4.6-arm64/Resources/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-11-04 r88984) -- "Unsuffered Consequences"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: aarch64-apple-darwin20

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.117   0.041   0.156 

BufferedMatrix.Rcheck/tests/objectTesting.Rout


R Under development (unstable) (2025-11-04 r88984) -- "Unsuffered Consequences"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: aarch64-apple-darwin20

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] "/Users/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) limit (Mb) max used (Mb)
Ncells 481248 25.8    1058085 56.6         NA   633817 33.9
Vcells 891449  6.9    8388608 64.0     196608  2110969 16.2
> 
> 
> 
> 
> ##
> ## checking reads
> ##
> 
> tmp2 <- createBufferedMatrix(10,20)
> 
> test.sample <- rnorm(10*20)
> 
> tmp2[1:10,1:20] <- test.sample
> 
> test.matrix <- matrix(test.sample,10,20)
> 
> ## testing reads
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   which.col <- sample(1:20,1)
+   if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> date()
[1] "Wed Dec  3 19:33:10 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] "Wed Dec  3 19:33:10 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: 0x6000019c0000>
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   which.col <- sample(1:20,1)
+   if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,5,replace=TRUE)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> date()
[1] "Wed Dec  3 19:33:11 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] "Wed Dec  3 19:33:11 2025"
> 
> ColMode(tmp2)
<pointer: 0x6000019c0000>
> 
> 
> 
> ### Now testing assignments
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+ 
+   new.data <- rnorm(20)
+   tmp2[which.row,] <- new.data
+   test.matrix[which.row,] <- new.data
+   if (rep > 1){
+     if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+   
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   new.data <- rnorm(10)
+   tmp2[,which.col] <- new.data
+   test.matrix[,which.col]<- new.data
+ 
+   if (rep > 1){
+     if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.col <- which.col
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,5,replace=TRUE)
+   new.data <- matrix(rnorm(50),5,10)
+   tmp2[,which.col] <- new.data
+   test.matrix[,which.col]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.col <- which.col
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   new.data <- matrix(rnorm(50),5,10)
+   tmp2[which.row,] <- new.data
+   test.matrix[which.row,]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col  <- sample(1:20,5,replace=TRUE)
+   new.data <- matrix(rnorm(25),5,5)
+   tmp2[which.row,which.col] <- new.data
+   test.matrix[which.row,which.col]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[prev.row,prev.col] == test.matrix[prev.row,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+   prev.col <- which.col
+ }
> 
> 
> 
> 
> ###
> ###
> ### testing some more functions
> ###
> 
> 
> 
> ## duplication function
> tmp5 <- duplicate(tmp2)
> 
> # making sure really did copy everything.
> tmp5[1,1] <- tmp5[1,1] +100.00
> 
> if (tmp5[1,1] == tmp2[1,1]){
+   stop("Problem with duplication")
+ }
> 
> 
> 
> 
> ### testing elementwise applying of functions
> 
> tmp5[1:4,1:4]
            [,1]       [,2]       [,3]        [,4]
[1,] 100.7348204  0.7652953  0.3415733  0.82925942
[2,]   0.1335970  0.1391485  0.3834399  0.04012894
[3,]  -0.4718894 -0.1535894  0.7460603 -1.53847586
[4,]   0.7663975 -0.2375301 -0.8430759 -0.09842782
> ewApply(tmp5,abs)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
            [,1]      [,2]      [,3]       [,4]
[1,] 100.7348204 0.7652953 0.3415733 0.82925942
[2,]   0.1335970 0.1391485 0.3834399 0.04012894
[3,]   0.4718894 0.1535894 0.7460603 1.53847586
[4,]   0.7663975 0.2375301 0.8430759 0.09842782
> ewApply(tmp5,sqrt)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
           [,1]      [,2]      [,3]      [,4]
[1,] 10.0366738 0.8748116 0.5844427 0.9106368
[2,]  0.3655093 0.3730262 0.6192253 0.2003221
[3,]  0.6869421 0.3919048 0.8637478 1.2403531
[4,]  0.8754413 0.4873706 0.9181917 0.3137321
> 
> 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:    /Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
          [,1]     [,2]     [,3]     [,4]
[1,] 226.10156 34.51341 31.18600 34.93563
[2,]  28.78869 28.86941 31.57569 27.04335
[3,]  32.34131 29.07264 34.38354 38.94201
[4,]  34.52081 30.11124 35.02499 28.23575
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x6000019c82a0>
> exp(tmp5)
<pointer: 0x6000019c82a0>
> log(tmp5,2)
<pointer: 0x6000019c82a0>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 470.6008
> Min(tmp5)
[1] 53.81703
> mean(tmp5)
[1] 71.94083
> Sum(tmp5)
[1] 14388.17
> Var(tmp5)
[1] 876.6947
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 92.35263 65.04024 68.09311 70.83767 70.85910 71.38848 72.74515 67.45050
 [9] 68.55595 72.08553
> rowSums(tmp5)
 [1] 1847.053 1300.805 1361.862 1416.753 1417.182 1427.770 1454.903 1349.010
 [9] 1371.119 1441.711
> rowVars(tmp5)
 [1] 7991.47917   47.62197   90.26823   59.74017   62.78998   47.89604
 [7]  109.43221   72.31533   76.56746   83.01289
> rowSd(tmp5)
 [1] 89.395074  6.900867  9.500960  7.729176  7.924013  6.920697 10.460985
 [8]  8.503842  8.750283  9.111141
> rowMax(tmp5)
 [1] 470.60077  83.85958  82.86577  85.04771  85.93729  80.82849  92.60886
 [8]  81.34984  91.25084  89.44300
> rowMin(tmp5)
 [1] 59.99648 56.28719 53.81703 58.76901 54.55715 54.56378 54.81880 53.95149
 [9] 54.74035 55.24027
> 
> colMeans(tmp5)
 [1] 110.85828  68.56840  69.94250  69.17533  64.48765  67.44368  70.94161
 [8]  69.65876  68.22606  71.05308  70.29677  69.69690  73.87253  70.27220
[15]  71.17242  70.89024  69.89525  73.42235  67.78431  71.15839
> colSums(tmp5)
 [1] 1108.5828  685.6840  699.4250  691.7533  644.8765  674.4368  709.4161
 [8]  696.5876  682.2606  710.5308  702.9677  696.9690  738.7253  702.7220
[15]  711.7242  708.9024  698.9525  734.2235  677.8431  711.5839
> colVars(tmp5)
 [1] 16025.28262   105.98695    74.22483    95.65936    53.14231   119.92150
 [7]    32.44785   105.82568    38.16931    59.22952    72.45813    70.59588
[13]    70.88126    44.19851    59.64217   103.69575   138.52229   100.69772
[19]    93.10381    60.60135
> colSd(tmp5)
 [1] 126.591005  10.294996   8.615383   9.780560   7.289877  10.950868
 [7]   5.696301  10.287161   6.178132   7.696072   8.512234   8.402135
[13]   8.419101   6.648196   7.722834  10.183111  11.769549  10.034825
[19]   9.649031   7.784687
> colMax(tmp5)
 [1] 470.60077  83.18413  85.93729  81.05269  79.04128  90.00474  80.97431
 [8]  85.04771  79.86776  82.39877  83.85958  85.42174  89.63914  80.57125
[15]  79.61990  89.44300  92.60886  91.25084  82.86577  82.50208
> colMin(tmp5)
 [1] 59.91989 54.56378 56.56356 54.55715 56.50907 53.81703 61.98049 53.89483
 [9] 59.89629 57.98412 59.99648 57.57474 63.92236 63.33706 54.74035 54.81880
[17] 58.30791 56.33831 53.95149 62.24643
> 
> 
> ### 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] 92.35263 65.04024 68.09311 70.83767 70.85910 71.38848       NA 67.45050
 [9] 68.55595 72.08553
> rowSums(tmp5)
 [1] 1847.053 1300.805 1361.862 1416.753 1417.182 1427.770       NA 1349.010
 [9] 1371.119 1441.711
> rowVars(tmp5)
 [1] 7991.47917   47.62197   90.26823   59.74017   62.78998   47.89604
 [7]  114.68477   72.31533   76.56746   83.01289
> rowSd(tmp5)
 [1] 89.395074  6.900867  9.500960  7.729176  7.924013  6.920697 10.709098
 [8]  8.503842  8.750283  9.111141
> rowMax(tmp5)
 [1] 470.60077  83.85958  82.86577  85.04771  85.93729  80.82849        NA
 [8]  81.34984  91.25084  89.44300
> rowMin(tmp5)
 [1] 59.99648 56.28719 53.81703 58.76901 54.55715 54.56378       NA 53.95149
 [9] 54.74035 55.24027
> 
> colMeans(tmp5)
 [1] 110.85828  68.56840  69.94250        NA  64.48765  67.44368  70.94161
 [8]  69.65876  68.22606  71.05308  70.29677  69.69690  73.87253  70.27220
[15]  71.17242  70.89024  69.89525  73.42235  67.78431  71.15839
> colSums(tmp5)
 [1] 1108.5828  685.6840  699.4250        NA  644.8765  674.4368  709.4161
 [8]  696.5876  682.2606  710.5308  702.9677  696.9690  738.7253  702.7220
[15]  711.7242  708.9024  698.9525  734.2235  677.8431  711.5839
> colVars(tmp5)
 [1] 16025.28262   105.98695    74.22483          NA    53.14231   119.92150
 [7]    32.44785   105.82568    38.16931    59.22952    72.45813    70.59588
[13]    70.88126    44.19851    59.64217   103.69575   138.52229   100.69772
[19]    93.10381    60.60135
> colSd(tmp5)
 [1] 126.591005  10.294996   8.615383         NA   7.289877  10.950868
 [7]   5.696301  10.287161   6.178132   7.696072   8.512234   8.402135
[13]   8.419101   6.648196   7.722834  10.183111  11.769549  10.034825
[19]   9.649031   7.784687
> colMax(tmp5)
 [1] 470.60077  83.18413  85.93729        NA  79.04128  90.00474  80.97431
 [8]  85.04771  79.86776  82.39877  83.85958  85.42174  89.63914  80.57125
[15]  79.61990  89.44300  92.60886  91.25084  82.86577  82.50208
> colMin(tmp5)
 [1] 59.91989 54.56378 56.56356       NA 56.50907 53.81703 61.98049 53.89483
 [9] 59.89629 57.98412 59.99648 57.57474 63.92236 63.33706 54.74035 54.81880
[17] 58.30791 56.33831 53.95149 62.24643
> 
> Max(tmp5,na.rm=TRUE)
[1] 470.6008
> Min(tmp5,na.rm=TRUE)
[1] 53.81703
> mean(tmp5,na.rm=TRUE)
[1] 71.9179
> Sum(tmp5,na.rm=TRUE)
[1] 14311.66
> Var(tmp5,na.rm=TRUE)
[1] 881.0167
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 92.35263 65.04024 68.09311 70.83767 70.85910 71.38848 72.54722 67.45050
 [9] 68.55595 72.08553
> rowSums(tmp5,na.rm=TRUE)
 [1] 1847.053 1300.805 1361.862 1416.753 1417.182 1427.770 1378.397 1349.010
 [9] 1371.119 1441.711
> rowVars(tmp5,na.rm=TRUE)
 [1] 7991.47917   47.62197   90.26823   59.74017   62.78998   47.89604
 [7]  114.68477   72.31533   76.56746   83.01289
> rowSd(tmp5,na.rm=TRUE)
 [1] 89.395074  6.900867  9.500960  7.729176  7.924013  6.920697 10.709098
 [8]  8.503842  8.750283  9.111141
> rowMax(tmp5,na.rm=TRUE)
 [1] 470.60077  83.85958  82.86577  85.04771  85.93729  80.82849  92.60886
 [8]  81.34984  91.25084  89.44300
> rowMin(tmp5,na.rm=TRUE)
 [1] 59.99648 56.28719 53.81703 58.76901 54.55715 54.56378 54.81880 53.95149
 [9] 54.74035 55.24027
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 110.85828  68.56840  69.94250  68.36084  64.48765  67.44368  70.94161
 [8]  69.65876  68.22606  71.05308  70.29677  69.69690  73.87253  70.27220
[15]  71.17242  70.89024  69.89525  73.42235  67.78431  71.15839
> colSums(tmp5,na.rm=TRUE)
 [1] 1108.5828  685.6840  699.4250  615.2476  644.8765  674.4368  709.4161
 [8]  696.5876  682.2606  710.5308  702.9677  696.9690  738.7253  702.7220
[15]  711.7242  708.9024  698.9525  734.2235  677.8431  711.5839
> colVars(tmp5,na.rm=TRUE)
 [1] 16025.28262   105.98695    74.22483   100.15367    53.14231   119.92150
 [7]    32.44785   105.82568    38.16931    59.22952    72.45813    70.59588
[13]    70.88126    44.19851    59.64217   103.69575   138.52229   100.69772
[19]    93.10381    60.60135
> colSd(tmp5,na.rm=TRUE)
 [1] 126.591005  10.294996   8.615383  10.007681   7.289877  10.950868
 [7]   5.696301  10.287161   6.178132   7.696072   8.512234   8.402135
[13]   8.419101   6.648196   7.722834  10.183111  11.769549  10.034825
[19]   9.649031   7.784687
> colMax(tmp5,na.rm=TRUE)
 [1] 470.60077  83.18413  85.93729  81.05269  79.04128  90.00474  80.97431
 [8]  85.04771  79.86776  82.39877  83.85958  85.42174  89.63914  80.57125
[15]  79.61990  89.44300  92.60886  91.25084  82.86577  82.50208
> colMin(tmp5,na.rm=TRUE)
 [1] 59.91989 54.56378 56.56356 54.55715 56.50907 53.81703 61.98049 53.89483
 [9] 59.89629 57.98412 59.99648 57.57474 63.92236 63.33706 54.74035 54.81880
[17] 58.30791 56.33831 53.95149 62.24643
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1] 92.35263 65.04024 68.09311 70.83767 70.85910 71.38848      NaN 67.45050
 [9] 68.55595 72.08553
> rowSums(tmp5,na.rm=TRUE)
 [1] 1847.053 1300.805 1361.862 1416.753 1417.182 1427.770    0.000 1349.010
 [9] 1371.119 1441.711
> rowVars(tmp5,na.rm=TRUE)
 [1] 7991.47917   47.62197   90.26823   59.74017   62.78998   47.89604
 [7]         NA   72.31533   76.56746   83.01289
> rowSd(tmp5,na.rm=TRUE)
 [1] 89.395074  6.900867  9.500960  7.729176  7.924013  6.920697        NA
 [8]  8.503842  8.750283  9.111141
> rowMax(tmp5,na.rm=TRUE)
 [1] 470.60077  83.85958  82.86577  85.04771  85.93729  80.82849        NA
 [8]  81.34984  91.25084  89.44300
> rowMin(tmp5,na.rm=TRUE)
 [1] 59.99648 56.28719 53.81703 58.76901 54.55715 54.56378       NA 53.95149
 [9] 54.74035 55.24027
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1] 113.41076  68.99940  70.03232       NaN  65.17350  66.86260  70.62827
 [8]  68.23097  68.61331  69.79244  71.13648  69.76227  72.12069  69.61725
[15]  72.24059  72.67596  67.37152  73.53331  66.85063  71.61622
> colSums(tmp5,na.rm=TRUE)
 [1] 1020.6969  620.9946  630.2909    0.0000  586.5615  601.7634  635.6544
 [8]  614.0787  617.5198  628.1320  640.2283  627.8604  649.0862  626.5552
[15]  650.1653  654.0836  606.3436  661.7998  601.6557  644.5460
> colVars(tmp5,na.rm=TRUE)
 [1] 17955.14702   117.14549    83.41218          NA    54.49322   131.11305
 [7]    35.39930    96.11994    41.25334    48.75477    73.58293    79.37229
[13]    45.21562    44.89746    54.26116    80.78394    84.18370   113.14642
[19]    94.93454    65.81845
> colSd(tmp5,na.rm=TRUE)
 [1] 133.996817  10.823377   9.133027         NA   7.381952  11.450461
 [7]   5.949731   9.804078   6.422876   6.982462   8.578049   8.909113
[13]   6.724256   6.700557   7.366217   8.987989   9.175168  10.637031
[19]   9.743436   8.112857
> colMax(tmp5,na.rm=TRUE)
 [1] 470.60077  83.18413  85.93729      -Inf  79.04128  90.00474  80.97431
 [8]  85.04771  79.86776  77.79841  83.85958  85.42174  82.60691  80.57125
[15]  79.61990  89.44300  80.82849  91.25084  82.86577  82.50208
> colMin(tmp5,na.rm=TRUE)
 [1] 59.91989 54.56378 56.56356      Inf 56.50907 53.81703 61.98049 53.89483
 [9] 59.89629 57.98412 59.99648 57.57474 63.92236 63.33706 54.74035 57.83601
[17] 58.30791 56.33831 53.95149 62.24643
> 
> 
> 
> 
> 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] 350.7201 285.0750 290.1079 283.2387 149.4424 259.7874 118.6619 236.2452
 [9] 214.1657 161.4897
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 350.7201 285.0750 290.1079 283.2387 149.4424 259.7874 118.6619 236.2452
 [9] 214.1657 161.4897
> 
> 
> 
> copymatrix <- matrix(rnorm(200,150,15),10,20)
> 
> tmp5[1:10,1:20] <- copymatrix
> which.row <- 1
> which.col  <- 3
> cat(which.row," ",which.col,"\n")
1   3 
> tmp5[which.row,which.col] <- NA
> copymatrix[which.row,which.col] <- NA
> 
> colVars(tmp5,na.rm=TRUE)-apply(copymatrix,2,var,na.rm=TRUE)
 [1] -5.684342e-14  0.000000e+00 -5.684342e-14  1.136868e-13 -1.421085e-13
 [6] -2.273737e-13  2.842171e-13  1.421085e-13  1.136868e-13  5.684342e-14
[11]  5.684342e-14  1.421085e-14 -1.421085e-14  2.273737e-13 -8.526513e-14
[16]  1.705303e-13  2.842171e-14  1.136868e-13  0.000000e+00 -2.842171e-14
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> ## making sure these things agree
> ##
> ## first when there is no NA
> 
> 
> 
> agree.checks <- function(buff.matrix,r.matrix,err.tol=1e-10){
+ 
+   if (Max(buff.matrix,na.rm=TRUE) != max(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Max")
+   }
+   
+ 
+   if (Min(buff.matrix,na.rm=TRUE) != min(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Min")
+   }
+ 
+ 
+   if (abs(Sum(buff.matrix,na.rm=TRUE)- sum(r.matrix,na.rm=TRUE)) > err.tol){
+ 
+     cat(Sum(buff.matrix,na.rm=TRUE),"\n")
+     cat(sum(r.matrix,na.rm=TRUE),"\n")
+     cat(Sum(buff.matrix,na.rm=TRUE) - sum(r.matrix,na.rm=TRUE),"\n")
+     
+     stop("No agreement in Sum")
+   }
+   
+   if (abs(mean(buff.matrix,na.rm=TRUE) - mean(r.matrix,na.rm=TRUE)) > err.tol){
+     stop("No agreement in mean")
+   }
+   
+   
+   if(abs(Var(buff.matrix,na.rm=TRUE) - var(as.vector(r.matrix),na.rm=TRUE)) > err.tol){
+     stop("No agreement in Var")
+   }
+   
+   
+ 
+   if(any(abs(rowMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,mean,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowMeans")
+   }
+   
+   
+   if(any(abs(colMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,mean,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colMeans")
+   }
+   
+   
+   if(any(abs(rowSums(buff.matrix,na.rm=TRUE)  -  apply(r.matrix,1,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in rowSums")
+   }
+   
+   
+   if(any(abs(colSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colSums")
+   }
+   
+   ### this is to get around the fact that R doesn't like to compute NA on an entire vector of NA when 
+   ### computing variance
+   my.Var <- function(x,na.rm=FALSE){
+    if (all(is.na(x))){
+      return(NA)
+    } else {
+      var(x,na.rm=na.rm)
+    }
+ 
+   }
+   
+   if(any(abs(rowVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+   
+   
+   if(any(abs(colVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+ 
+ 
+   if(any(abs(rowMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+ 
+   if(any(abs(colMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+   
+   
+   if(any(abs(rowMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+   
+ 
+   if(any(abs(colMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+ 
+   if(any(abs(colMedians(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,median,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMedian")
+   }
+ 
+   if(any(abs(colRanges(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,range,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colRanges")
+   }
+ 
+ 
+   
+ }
> 
> 
> 
> 
> 
> 
> 
> 
> 
> for (rep in 1:20){
+   copymatrix <- matrix(rnorm(200,150,15),10,20)
+   
+   tmp5[1:10,1:20] <- copymatrix
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ## now lets assign some NA values and check agreement
+ 
+   which.row <- sample(1:10,1,replace=TRUE)
+   which.col  <- sample(1:20,1,replace=TRUE)
+   
+   cat(which.row," ",which.col,"\n")
+   
+   tmp5[which.row,which.col] <- NA
+   copymatrix[which.row,which.col] <- NA
+   
+   agree.checks(tmp5,copymatrix)
+ 
+   ## make an entire row NA
+   tmp5[which.row,] <- NA
+   copymatrix[which.row,] <- NA
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ### also make an entire col NA
+   tmp5[,which.col] <- NA
+   copymatrix[,which.col] <- NA
+ 
+   agree.checks(tmp5,copymatrix)
+ 
+   ### now make 1 element non NA with NA in the rest of row and column
+ 
+   tmp5[which.row,which.col] <- rnorm(1,150,15)
+   copymatrix[which.row,which.col] <- tmp5[which.row,which.col]
+ 
+   agree.checks(tmp5,copymatrix)
+ }
8   4 
8   16 
2   8 
6   14 
8   11 
5   15 
8   18 
10   12 
3   10 
1   19 
3   20 
2   17 
10   9 
7   4 
6   12 
7   11 
9   14 
5   20 
10   5 
2   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] 3.045808
> Min(tmp)
[1] -2.752912
> mean(tmp)
[1] 0.0318047
> Sum(tmp)
[1] 3.18047
> Var(tmp)
[1] 1.156106
> 
> rowMeans(tmp)
[1] 0.0318047
> rowSums(tmp)
[1] 3.18047
> rowVars(tmp)
[1] 1.156106
> rowSd(tmp)
[1] 1.075224
> rowMax(tmp)
[1] 3.045808
> rowMin(tmp)
[1] -2.752912
> 
> colMeans(tmp)
  [1]  0.07886301 -1.14178809 -1.76606995 -0.60841598  0.98431080  1.46556369
  [7] -2.75291219 -0.19546029 -0.31183286  0.39645461 -0.10427822  0.21198623
 [13]  0.01237807 -0.19446972  1.02509640  0.02140839 -0.38639454  0.26141488
 [19] -0.92212015  0.99377696  1.53466768 -0.99394613  0.63338727 -0.17634002
 [25] -1.14152483  0.22314211 -1.16495214 -0.53655149 -1.26692645 -0.55640532
 [31] -0.17162970  0.53014637  0.01992630  1.63940413 -0.45867040  0.01772521
 [37] -1.43913902 -0.47749261 -1.21049618 -0.13596134 -0.74053734  1.66976526
 [43]  1.85328445  0.79040221 -0.13845711  1.95733465  0.40236687 -2.29204837
 [49] -0.12326990  0.76309147  0.12912124  1.01842606 -2.28724639  0.69084937
 [55]  0.49636678 -0.56018955  1.26355604 -0.33054064  1.36662640 -2.69317074
 [61] -1.21143608 -1.13396342 -0.72700191  1.57788077 -0.61569672  1.02331209
 [67]  0.51175252  0.77803027  1.59610466  0.02266781 -0.26568790  3.04580784
 [73] -1.17487266 -0.91644655  0.81706300  0.58093232  0.63193050 -0.57814660
 [79] -0.59524402  0.25203498  2.06893386  0.86621918  0.01983528 -0.48388960
 [85]  0.27982833  0.32240912  1.75676227  0.81076117  0.42611912 -0.41735058
 [91]  1.07349795 -0.55389655 -0.52887558 -2.34572021  0.71471815 -0.88815360
 [97]  0.96195481  0.88383453  0.01220027 -0.58934400
> colSums(tmp)
  [1]  0.07886301 -1.14178809 -1.76606995 -0.60841598  0.98431080  1.46556369
  [7] -2.75291219 -0.19546029 -0.31183286  0.39645461 -0.10427822  0.21198623
 [13]  0.01237807 -0.19446972  1.02509640  0.02140839 -0.38639454  0.26141488
 [19] -0.92212015  0.99377696  1.53466768 -0.99394613  0.63338727 -0.17634002
 [25] -1.14152483  0.22314211 -1.16495214 -0.53655149 -1.26692645 -0.55640532
 [31] -0.17162970  0.53014637  0.01992630  1.63940413 -0.45867040  0.01772521
 [37] -1.43913902 -0.47749261 -1.21049618 -0.13596134 -0.74053734  1.66976526
 [43]  1.85328445  0.79040221 -0.13845711  1.95733465  0.40236687 -2.29204837
 [49] -0.12326990  0.76309147  0.12912124  1.01842606 -2.28724639  0.69084937
 [55]  0.49636678 -0.56018955  1.26355604 -0.33054064  1.36662640 -2.69317074
 [61] -1.21143608 -1.13396342 -0.72700191  1.57788077 -0.61569672  1.02331209
 [67]  0.51175252  0.77803027  1.59610466  0.02266781 -0.26568790  3.04580784
 [73] -1.17487266 -0.91644655  0.81706300  0.58093232  0.63193050 -0.57814660
 [79] -0.59524402  0.25203498  2.06893386  0.86621918  0.01983528 -0.48388960
 [85]  0.27982833  0.32240912  1.75676227  0.81076117  0.42611912 -0.41735058
 [91]  1.07349795 -0.55389655 -0.52887558 -2.34572021  0.71471815 -0.88815360
 [97]  0.96195481  0.88383453  0.01220027 -0.58934400
> colVars(tmp)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> colSd(tmp)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> colMax(tmp)
  [1]  0.07886301 -1.14178809 -1.76606995 -0.60841598  0.98431080  1.46556369
  [7] -2.75291219 -0.19546029 -0.31183286  0.39645461 -0.10427822  0.21198623
 [13]  0.01237807 -0.19446972  1.02509640  0.02140839 -0.38639454  0.26141488
 [19] -0.92212015  0.99377696  1.53466768 -0.99394613  0.63338727 -0.17634002
 [25] -1.14152483  0.22314211 -1.16495214 -0.53655149 -1.26692645 -0.55640532
 [31] -0.17162970  0.53014637  0.01992630  1.63940413 -0.45867040  0.01772521
 [37] -1.43913902 -0.47749261 -1.21049618 -0.13596134 -0.74053734  1.66976526
 [43]  1.85328445  0.79040221 -0.13845711  1.95733465  0.40236687 -2.29204837
 [49] -0.12326990  0.76309147  0.12912124  1.01842606 -2.28724639  0.69084937
 [55]  0.49636678 -0.56018955  1.26355604 -0.33054064  1.36662640 -2.69317074
 [61] -1.21143608 -1.13396342 -0.72700191  1.57788077 -0.61569672  1.02331209
 [67]  0.51175252  0.77803027  1.59610466  0.02266781 -0.26568790  3.04580784
 [73] -1.17487266 -0.91644655  0.81706300  0.58093232  0.63193050 -0.57814660
 [79] -0.59524402  0.25203498  2.06893386  0.86621918  0.01983528 -0.48388960
 [85]  0.27982833  0.32240912  1.75676227  0.81076117  0.42611912 -0.41735058
 [91]  1.07349795 -0.55389655 -0.52887558 -2.34572021  0.71471815 -0.88815360
 [97]  0.96195481  0.88383453  0.01220027 -0.58934400
> colMin(tmp)
  [1]  0.07886301 -1.14178809 -1.76606995 -0.60841598  0.98431080  1.46556369
  [7] -2.75291219 -0.19546029 -0.31183286  0.39645461 -0.10427822  0.21198623
 [13]  0.01237807 -0.19446972  1.02509640  0.02140839 -0.38639454  0.26141488
 [19] -0.92212015  0.99377696  1.53466768 -0.99394613  0.63338727 -0.17634002
 [25] -1.14152483  0.22314211 -1.16495214 -0.53655149 -1.26692645 -0.55640532
 [31] -0.17162970  0.53014637  0.01992630  1.63940413 -0.45867040  0.01772521
 [37] -1.43913902 -0.47749261 -1.21049618 -0.13596134 -0.74053734  1.66976526
 [43]  1.85328445  0.79040221 -0.13845711  1.95733465  0.40236687 -2.29204837
 [49] -0.12326990  0.76309147  0.12912124  1.01842606 -2.28724639  0.69084937
 [55]  0.49636678 -0.56018955  1.26355604 -0.33054064  1.36662640 -2.69317074
 [61] -1.21143608 -1.13396342 -0.72700191  1.57788077 -0.61569672  1.02331209
 [67]  0.51175252  0.77803027  1.59610466  0.02266781 -0.26568790  3.04580784
 [73] -1.17487266 -0.91644655  0.81706300  0.58093232  0.63193050 -0.57814660
 [79] -0.59524402  0.25203498  2.06893386  0.86621918  0.01983528 -0.48388960
 [85]  0.27982833  0.32240912  1.75676227  0.81076117  0.42611912 -0.41735058
 [91]  1.07349795 -0.55389655 -0.52887558 -2.34572021  0.71471815 -0.88815360
 [97]  0.96195481  0.88383453  0.01220027 -0.58934400
> colMedians(tmp)
  [1]  0.07886301 -1.14178809 -1.76606995 -0.60841598  0.98431080  1.46556369
  [7] -2.75291219 -0.19546029 -0.31183286  0.39645461 -0.10427822  0.21198623
 [13]  0.01237807 -0.19446972  1.02509640  0.02140839 -0.38639454  0.26141488
 [19] -0.92212015  0.99377696  1.53466768 -0.99394613  0.63338727 -0.17634002
 [25] -1.14152483  0.22314211 -1.16495214 -0.53655149 -1.26692645 -0.55640532
 [31] -0.17162970  0.53014637  0.01992630  1.63940413 -0.45867040  0.01772521
 [37] -1.43913902 -0.47749261 -1.21049618 -0.13596134 -0.74053734  1.66976526
 [43]  1.85328445  0.79040221 -0.13845711  1.95733465  0.40236687 -2.29204837
 [49] -0.12326990  0.76309147  0.12912124  1.01842606 -2.28724639  0.69084937
 [55]  0.49636678 -0.56018955  1.26355604 -0.33054064  1.36662640 -2.69317074
 [61] -1.21143608 -1.13396342 -0.72700191  1.57788077 -0.61569672  1.02331209
 [67]  0.51175252  0.77803027  1.59610466  0.02266781 -0.26568790  3.04580784
 [73] -1.17487266 -0.91644655  0.81706300  0.58093232  0.63193050 -0.57814660
 [79] -0.59524402  0.25203498  2.06893386  0.86621918  0.01983528 -0.48388960
 [85]  0.27982833  0.32240912  1.75676227  0.81076117  0.42611912 -0.41735058
 [91]  1.07349795 -0.55389655 -0.52887558 -2.34572021  0.71471815 -0.88815360
 [97]  0.96195481  0.88383453  0.01220027 -0.58934400
> colRanges(tmp)
           [,1]      [,2]     [,3]      [,4]      [,5]     [,6]      [,7]
[1,] 0.07886301 -1.141788 -1.76607 -0.608416 0.9843108 1.465564 -2.752912
[2,] 0.07886301 -1.141788 -1.76607 -0.608416 0.9843108 1.465564 -2.752912
           [,8]       [,9]     [,10]      [,11]     [,12]      [,13]      [,14]
[1,] -0.1954603 -0.3118329 0.3964546 -0.1042782 0.2119862 0.01237807 -0.1944697
[2,] -0.1954603 -0.3118329 0.3964546 -0.1042782 0.2119862 0.01237807 -0.1944697
        [,15]      [,16]      [,17]     [,18]      [,19]    [,20]    [,21]
[1,] 1.025096 0.02140839 -0.3863945 0.2614149 -0.9221201 0.993777 1.534668
[2,] 1.025096 0.02140839 -0.3863945 0.2614149 -0.9221201 0.993777 1.534668
          [,22]     [,23]    [,24]     [,25]     [,26]     [,27]      [,28]
[1,] -0.9939461 0.6333873 -0.17634 -1.141525 0.2231421 -1.164952 -0.5365515
[2,] -0.9939461 0.6333873 -0.17634 -1.141525 0.2231421 -1.164952 -0.5365515
         [,29]      [,30]      [,31]     [,32]     [,33]    [,34]      [,35]
[1,] -1.266926 -0.5564053 -0.1716297 0.5301464 0.0199263 1.639404 -0.4586704
[2,] -1.266926 -0.5564053 -0.1716297 0.5301464 0.0199263 1.639404 -0.4586704
          [,36]     [,37]      [,38]     [,39]      [,40]      [,41]    [,42]
[1,] 0.01772521 -1.439139 -0.4774926 -1.210496 -0.1359613 -0.7405373 1.669765
[2,] 0.01772521 -1.439139 -0.4774926 -1.210496 -0.1359613 -0.7405373 1.669765
        [,43]     [,44]      [,45]    [,46]     [,47]     [,48]      [,49]
[1,] 1.853284 0.7904022 -0.1384571 1.957335 0.4023669 -2.292048 -0.1232699
[2,] 1.853284 0.7904022 -0.1384571 1.957335 0.4023669 -2.292048 -0.1232699
         [,50]     [,51]    [,52]     [,53]     [,54]     [,55]      [,56]
[1,] 0.7630915 0.1291212 1.018426 -2.287246 0.6908494 0.4963668 -0.5601895
[2,] 0.7630915 0.1291212 1.018426 -2.287246 0.6908494 0.4963668 -0.5601895
        [,57]      [,58]    [,59]     [,60]     [,61]     [,62]      [,63]
[1,] 1.263556 -0.3305406 1.366626 -2.693171 -1.211436 -1.133963 -0.7270019
[2,] 1.263556 -0.3305406 1.366626 -2.693171 -1.211436 -1.133963 -0.7270019
        [,64]      [,65]    [,66]     [,67]     [,68]    [,69]      [,70]
[1,] 1.577881 -0.6156967 1.023312 0.5117525 0.7780303 1.596105 0.02266781
[2,] 1.577881 -0.6156967 1.023312 0.5117525 0.7780303 1.596105 0.02266781
          [,71]    [,72]     [,73]      [,74]    [,75]     [,76]     [,77]
[1,] -0.2656879 3.045808 -1.174873 -0.9164466 0.817063 0.5809323 0.6319305
[2,] -0.2656879 3.045808 -1.174873 -0.9164466 0.817063 0.5809323 0.6319305
          [,78]     [,79]    [,80]    [,81]     [,82]      [,83]      [,84]
[1,] -0.5781466 -0.595244 0.252035 2.068934 0.8662192 0.01983528 -0.4838896
[2,] -0.5781466 -0.595244 0.252035 2.068934 0.8662192 0.01983528 -0.4838896
         [,85]     [,86]    [,87]     [,88]     [,89]      [,90]    [,91]
[1,] 0.2798283 0.3224091 1.756762 0.8107612 0.4261191 -0.4173506 1.073498
[2,] 0.2798283 0.3224091 1.756762 0.8107612 0.4261191 -0.4173506 1.073498
          [,92]      [,93]    [,94]     [,95]      [,96]     [,97]     [,98]
[1,] -0.5538966 -0.5288756 -2.34572 0.7147182 -0.8881536 0.9619548 0.8838345
[2,] -0.5538966 -0.5288756 -2.34572 0.7147182 -0.8881536 0.9619548 0.8838345
          [,99]    [,100]
[1,] 0.01220027 -0.589344
[2,] 0.01220027 -0.589344
> 
> 
> Max(tmp2)
[1] 2.436379
> Min(tmp2)
[1] -2.663276
> mean(tmp2)
[1] -0.1536935
> Sum(tmp2)
[1] -15.36935
> Var(tmp2)
[1] 1.094881
> 
> rowMeans(tmp2)
  [1] -0.98148186 -1.68848760 -1.44054528  0.31707553 -0.68632394 -0.31656643
  [7] -0.12847172  0.56765921  2.43637921  0.48981216  0.16880330 -1.61874127
 [13] -0.27288747  1.06621505  0.27858806 -0.75978344  0.91828003 -0.78812831
 [19]  0.84334538  0.95678804  0.05271181 -1.22961172  1.56971768 -1.16378365
 [25]  0.35488857 -0.41208103 -2.01919296  1.20323689 -2.36472181 -1.15705565
 [31]  0.62540697 -1.22380398  1.30597122  1.86931405  1.21866674 -0.87704986
 [37]  0.30141641 -0.09449328  0.47388278 -0.77591936 -1.28124590  0.43160356
 [43] -0.96537091 -0.26832931  0.65396181 -0.11085036 -2.27183074 -0.44126254
 [49]  0.61331631 -0.74408254  1.24965511  0.85332516 -0.34537904 -0.32021520
 [55] -1.79765986 -0.98014010  1.76421161 -0.03677897  1.40033923 -0.65290139
 [61]  1.83501983  0.82707156 -1.06513842  0.43810607 -0.07234336 -0.57262673
 [67] -1.43629769  0.60181443 -1.00925631 -1.60000682 -1.58955765  0.47188725
 [73] -0.63748582 -0.37732456 -0.07559043 -0.65088855 -0.39595692  0.27460359
 [79] -0.92240127 -0.42416261  1.72799453 -1.25914386  0.14861213 -0.56687056
 [85]  0.14976214  1.10531729 -0.66646018 -1.89635312  0.76735790  1.67113642
 [91] -0.62791464  0.35240529 -0.31702926 -0.34725144 -0.10620832  0.15823388
 [97] -0.93384864 -2.66327560 -0.35240061  0.89772857
> rowSums(tmp2)
  [1] -0.98148186 -1.68848760 -1.44054528  0.31707553 -0.68632394 -0.31656643
  [7] -0.12847172  0.56765921  2.43637921  0.48981216  0.16880330 -1.61874127
 [13] -0.27288747  1.06621505  0.27858806 -0.75978344  0.91828003 -0.78812831
 [19]  0.84334538  0.95678804  0.05271181 -1.22961172  1.56971768 -1.16378365
 [25]  0.35488857 -0.41208103 -2.01919296  1.20323689 -2.36472181 -1.15705565
 [31]  0.62540697 -1.22380398  1.30597122  1.86931405  1.21866674 -0.87704986
 [37]  0.30141641 -0.09449328  0.47388278 -0.77591936 -1.28124590  0.43160356
 [43] -0.96537091 -0.26832931  0.65396181 -0.11085036 -2.27183074 -0.44126254
 [49]  0.61331631 -0.74408254  1.24965511  0.85332516 -0.34537904 -0.32021520
 [55] -1.79765986 -0.98014010  1.76421161 -0.03677897  1.40033923 -0.65290139
 [61]  1.83501983  0.82707156 -1.06513842  0.43810607 -0.07234336 -0.57262673
 [67] -1.43629769  0.60181443 -1.00925631 -1.60000682 -1.58955765  0.47188725
 [73] -0.63748582 -0.37732456 -0.07559043 -0.65088855 -0.39595692  0.27460359
 [79] -0.92240127 -0.42416261  1.72799453 -1.25914386  0.14861213 -0.56687056
 [85]  0.14976214  1.10531729 -0.66646018 -1.89635312  0.76735790  1.67113642
 [91] -0.62791464  0.35240529 -0.31702926 -0.34725144 -0.10620832  0.15823388
 [97] -0.93384864 -2.66327560 -0.35240061  0.89772857
> rowVars(tmp2)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowSd(tmp2)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowMax(tmp2)
  [1] -0.98148186 -1.68848760 -1.44054528  0.31707553 -0.68632394 -0.31656643
  [7] -0.12847172  0.56765921  2.43637921  0.48981216  0.16880330 -1.61874127
 [13] -0.27288747  1.06621505  0.27858806 -0.75978344  0.91828003 -0.78812831
 [19]  0.84334538  0.95678804  0.05271181 -1.22961172  1.56971768 -1.16378365
 [25]  0.35488857 -0.41208103 -2.01919296  1.20323689 -2.36472181 -1.15705565
 [31]  0.62540697 -1.22380398  1.30597122  1.86931405  1.21866674 -0.87704986
 [37]  0.30141641 -0.09449328  0.47388278 -0.77591936 -1.28124590  0.43160356
 [43] -0.96537091 -0.26832931  0.65396181 -0.11085036 -2.27183074 -0.44126254
 [49]  0.61331631 -0.74408254  1.24965511  0.85332516 -0.34537904 -0.32021520
 [55] -1.79765986 -0.98014010  1.76421161 -0.03677897  1.40033923 -0.65290139
 [61]  1.83501983  0.82707156 -1.06513842  0.43810607 -0.07234336 -0.57262673
 [67] -1.43629769  0.60181443 -1.00925631 -1.60000682 -1.58955765  0.47188725
 [73] -0.63748582 -0.37732456 -0.07559043 -0.65088855 -0.39595692  0.27460359
 [79] -0.92240127 -0.42416261  1.72799453 -1.25914386  0.14861213 -0.56687056
 [85]  0.14976214  1.10531729 -0.66646018 -1.89635312  0.76735790  1.67113642
 [91] -0.62791464  0.35240529 -0.31702926 -0.34725144 -0.10620832  0.15823388
 [97] -0.93384864 -2.66327560 -0.35240061  0.89772857
> rowMin(tmp2)
  [1] -0.98148186 -1.68848760 -1.44054528  0.31707553 -0.68632394 -0.31656643
  [7] -0.12847172  0.56765921  2.43637921  0.48981216  0.16880330 -1.61874127
 [13] -0.27288747  1.06621505  0.27858806 -0.75978344  0.91828003 -0.78812831
 [19]  0.84334538  0.95678804  0.05271181 -1.22961172  1.56971768 -1.16378365
 [25]  0.35488857 -0.41208103 -2.01919296  1.20323689 -2.36472181 -1.15705565
 [31]  0.62540697 -1.22380398  1.30597122  1.86931405  1.21866674 -0.87704986
 [37]  0.30141641 -0.09449328  0.47388278 -0.77591936 -1.28124590  0.43160356
 [43] -0.96537091 -0.26832931  0.65396181 -0.11085036 -2.27183074 -0.44126254
 [49]  0.61331631 -0.74408254  1.24965511  0.85332516 -0.34537904 -0.32021520
 [55] -1.79765986 -0.98014010  1.76421161 -0.03677897  1.40033923 -0.65290139
 [61]  1.83501983  0.82707156 -1.06513842  0.43810607 -0.07234336 -0.57262673
 [67] -1.43629769  0.60181443 -1.00925631 -1.60000682 -1.58955765  0.47188725
 [73] -0.63748582 -0.37732456 -0.07559043 -0.65088855 -0.39595692  0.27460359
 [79] -0.92240127 -0.42416261  1.72799453 -1.25914386  0.14861213 -0.56687056
 [85]  0.14976214  1.10531729 -0.66646018 -1.89635312  0.76735790  1.67113642
 [91] -0.62791464  0.35240529 -0.31702926 -0.34725144 -0.10620832  0.15823388
 [97] -0.93384864 -2.66327560 -0.35240061  0.89772857
> 
> colMeans(tmp2)
[1] -0.1536935
> colSums(tmp2)
[1] -15.36935
> colVars(tmp2)
[1] 1.094881
> colSd(tmp2)
[1] 1.046365
> colMax(tmp2)
[1] 2.436379
> colMin(tmp2)
[1] -2.663276
> colMedians(tmp2)
[1] -0.2706084
> colRanges(tmp2)
          [,1]
[1,] -2.663276
[2,]  2.436379
> 
> dataset1 <- matrix(dataset1,1,100)
> 
> agree.checks(tmp,dataset1)
> 
> dataset2 <- matrix(dataset2,100,1)
> agree.checks(tmp2,dataset2)
>   
> 
> tmp <- createBufferedMatrix(10,10)
> 
> tmp[1:10,1:10] <- rnorm(100)
> colApply(tmp,sum)
 [1] -2.2011815 -0.3888474 -0.2736166 -7.4813669  0.0169153  2.0607229
 [7]  2.1112714  0.5618923  6.2862404  2.1608467
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -1.8237097
[2,] -0.7472519
[3,] -0.2457289
[4,]  0.4977771
[5,]  1.0127271
> 
> rowApply(tmp,sum)
 [1]  2.1428461  1.4208183  4.2243423  0.2774840 -3.0318501 -3.0781704
 [7] -1.6118404 -0.8698551  1.7948561  1.5842458
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    3    3    1    8    5    3    2   10    8     6
 [2,]    9    8    8    1    4    8    4    2    7     2
 [3,]    5    9    5    3    8    4    6    3    6     5
 [4,]    4    2    2    2    2    6    3    8    3     1
 [5,]    6    4    9    4    3    1    9    5    2     7
 [6,]    2    6    6   10   10    2    7    4    1     9
 [7,]    8    1    3    9    7    9    8    7    4     4
 [8,]    7    7    7    5    1    5    5    9    5     8
 [9,]   10    5    4    7    9   10   10    1    9    10
[10,]    1   10   10    6    6    7    1    6   10     3
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1] -0.9743112 -0.1992454 -2.8537879  0.7115612 -1.9340613 -1.1256673
 [7] -5.3356895 -2.8259391  0.2078500  2.3475987  4.3169381  1.6561161
[13] -0.2237367  3.0402477  2.0422934  1.3411810  0.1546701  0.9853383
[19] -4.4109076 -2.5927672
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -2.0187822
[2,] -0.6701202
[3,]  0.3842769
[4,]  0.5269080
[5,]  0.8034062
> 
> rowApply(tmp,sum)
[1]  0.59440854  0.09924148 -5.00630433 -2.30303166  0.94336737
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]    1   13   18    7   12
[2,]   12    9   13    6    9
[3,]    3    1    5   12   15
[4,]   10   12   15    1   20
[5,]   11   16    4    2   18
> 
> 
> as.matrix(tmp)
           [,1]        [,2]       [,3]       [,4]       [,5]       [,6]
[1,] -2.0187822  0.27171608 -0.9492235  0.1082467  0.1705579 -0.2553162
[2,]  0.5269080 -0.04308572 -1.1920049  0.2984089  0.7974381 -1.1023240
[3,]  0.8034062  0.29233217 -1.1905354  0.4887097 -1.7669594  1.3529961
[4,] -0.6701202 -0.74319686 -0.1118439 -2.1348337 -1.9906796 -0.5537596
[5,]  0.3842769  0.02298896  0.5898197  1.9510296  0.8555818 -0.5672635
           [,7]       [,8]       [,9]      [,10]      [,11]       [,12]
[1,] -0.2460697  0.6565019  1.6645335 -0.4710243 1.04023464  0.83357236
[2,] -1.0799538  0.2302701 -0.3429142 -0.5769405 1.20232307  0.56195094
[3,] -2.5612775 -0.3349314 -0.1386191  1.3531600 0.01061737  0.58212492
[4,] -1.1532621 -1.2371439  0.7180321  1.2059732 1.20863866 -0.33254459
[5,] -0.2951264 -2.1406357 -1.6931824  0.8364303 0.85512437  0.01101242
          [,13]      [,14]      [,15]      [,16]      [,17]       [,18]
[1,] -0.5692615  0.8330782  0.7764187  0.7508445 -0.9331089  0.47519857
[2,] -1.0868637  0.8145346  0.9084352  0.6731544  0.9082119 -1.08416006
[3,]  0.6679572  0.4518626 -0.4613687  0.2879061  0.1595844  0.06378972
[4,]  0.4375049  1.9654333 -0.5205480  1.4741027 -0.3909578  0.97655639
[5,]  0.3269264 -1.0246611  1.3393561 -1.8448266  0.4109405  0.55395370
          [,19]       [,20]
[1,] -1.1111425 -0.43256580
[2,] -0.3767428  0.06259592
[3,] -2.1566430 -2.91041631
[4,] -0.7722655  0.32188294
[5,]  0.0058862  0.36573601
> 
> 
> is.BufferedMatrix(tmp)
[1] TRUE
> 
> as.BufferedMatrix(as.matrix(tmp))
BufferedMatrix object
Matrix size:  5 20 
Buffer size:  1 1 
Directory:    /Users/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:    /Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  649  bytes.
Disk usage :  200  bytes.
> subBufferedMatrix(tmp,,5:8)
BufferedMatrix object
Matrix size:  5 4 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  563  bytes.
Disk usage :  160  bytes.
> subBufferedMatrix(tmp,1:3,)
BufferedMatrix object
Matrix size:  3 20 
Buffer size:  1 1 
Directory:    /Users/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.05369435 0.3511795 0.5602645 0.8756766 1.040334 -0.8479456 0.3208948
          col8     col9     col10      col11     col12      col13      col14
row1 0.6218033 1.661843 0.2078401 -0.4332953 0.1917064 -0.1832776 -0.7496876
          col15     col16     col17     col18    col19     col20
row1 -0.5848135 -1.334582 0.5831589 -1.404827 1.102281 -1.251573
> tmp[,"col10"]
          col10
row1  0.2078401
row2  1.0144114
row3  0.6595440
row4 -1.2629733
row5 -0.3831563
> tmp[c("row1","row5"),]
           col1      col2      col3      col4      col5        col6      col7
row1 0.05369435 0.3511795 0.5602645 0.8756766  1.040334 -0.84794563 0.3208948
row5 0.55789640 1.0032970 1.1802815 0.1436462 -1.071109 -0.09319987 0.5331116
          col8       col9      col10      col11      col12       col13
row1 0.6218033  1.6618432  0.2078401 -0.4332953  0.1917064 -0.18327759
row5 0.3421853 -0.6415915 -0.3831563  1.3331485 -1.6265226 -0.08067978
          col14      col15      col16      col17       col18      col19
row1 -0.7496876 -0.5848135 -1.3345821  0.5831589 -1.40482706  1.1022806
row5 -0.3188035 -0.1039074 -0.2870822 -1.5988090 -0.07760007 -0.5051306
         col20
row1 -1.251573
row5  1.399583
> tmp[,c("col6","col20")]
            col6      col20
row1 -0.84794563 -1.2515727
row2 -0.96609411 -1.3882156
row3 -0.82570043 -1.6398512
row4  1.03117448 -0.1294714
row5 -0.09319987  1.3995831
> tmp[c("row1","row5"),c("col6","col20")]
            col6     col20
row1 -0.84794563 -1.251573
row5 -0.09319987  1.399583
> 
> 
> 
> 
> tmp["row1",] <- rnorm(20,mean=10)
> tmp[,"col10"] <- rnorm(5,mean=30)
> tmp[c("row1","row5"),] <- rnorm(40,mean=50)
> tmp[,c("col6","col20")] <- rnorm(10,mean=75)
> tmp[c("row1","row5"),c("col6","col20")]  <- rnorm(4,mean=105)
> 
> tmp["row1",]
         col1     col2 col3     col4     col5     col6     col7     col8
row1 50.23422 49.18067 50.2 50.48679 48.95643 103.8021 50.25397 49.60697
         col9    col10    col11    col12    col13    col14   col15    col16
row1 50.52047 47.68195 51.14844 48.47479 50.37208 48.78775 47.9068 49.29417
        col17    col18    col19    col20
row1 51.43635 49.51896 50.79916 104.2724
> tmp[,"col10"]
        col10
row1 47.68195
row2 29.56796
row3 30.79487
row4 29.01207
row5 46.93438
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 50.23422 49.18067 50.20000 50.48679 48.95643 103.8021 50.25397 49.60697
row5 49.27415 50.93068 51.13882 48.56711 48.92660 106.6801 50.86578 49.10415
         col9    col10    col11    col12    col13    col14    col15    col16
row1 50.52047 47.68195 51.14844 48.47479 50.37208 48.78775 47.90680 49.29417
row5 51.42310 46.93438 49.46619 49.51569 50.32565 48.32883 48.08628 50.57387
        col17    col18    col19    col20
row1 51.43635 49.51896 50.79916 104.2724
row5 50.63796 48.88968 49.16025 104.2898
> tmp[,c("col6","col20")]
          col6     col20
row1 103.80212 104.27243
row2  71.72313  74.50998
row3  73.78548  76.87293
row4  75.22690  74.43454
row5 106.68009 104.28983
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 103.8021 104.2724
row5 106.6801 104.2898
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 103.8021 104.2724
row5 106.6801 104.2898
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
          col13
[1,]  0.9144484
[2,] -0.8098312
[3,] -0.9876174
[4,]  1.7515589
[5,] -1.8122512
> tmp[,c("col17","col7")]
           col17       col7
[1,] -0.18319259 -0.5497676
[2,]  0.18989148  0.6839980
[3,] -0.04259938 -0.2806942
[4,]  0.83880399 -0.8321479
[5,] -0.16391177  1.7356768
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
           col6      col20
[1,] -0.1816252  0.8202691
[2,]  0.1422928 -0.9964073
[3,]  1.4109349  0.1253409
[4,]  1.2003303  0.9868190
[5,] -0.1431036 -0.8323068
> subBufferedMatrix(tmp,1,c("col6"))[,1]
           col1
[1,] -0.1816252
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
           col6
[1,] -0.1816252
[2,]  0.1422928
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> 
> 
> 
> subBufferedMatrix(tmp,c("row3","row1"),)[,1:20]
           [,1]       [,2]      [,3]       [,4]       [,5]      [,6]      [,7]
row3 -1.1608075  0.6076032 -1.028853 -1.2137554  1.7192526 0.5077116  1.232977
row1  0.6892089 -0.1413828  1.249041 -0.1825488 -0.2977208 1.1869643 -1.027071
           [,8]       [,9]      [,10]     [,11]     [,12]       [,13]
row3 -0.5069974 -1.9729607  0.2970421  1.256723 2.2023696 -0.56633695
row1 -0.1802151 -0.4333251 -0.8919139 -2.842386 0.1717993  0.01723998
          [,14]      [,15]       [,16]      [,17]      [,18]     [,19]
row3  0.6736778  0.5987979 -0.05873249 -0.5666230  0.9293307 0.8136792
row1 -0.6095234 -0.7452325  2.11961258 -0.3743716 -0.8216198 0.6605915
         [,20]
row3 0.9532788
row1 0.9700914
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
          [,1]      [,2]       [,3]       [,4]     [,5]     [,6]      [,7]
row2 0.9591425 -1.627807 -0.2801145 0.03293707 1.394125 1.574516 0.9613006
           [,8]     [,9]      [,10]
row2 -0.8537588 0.508594 -0.3718054
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
           [,1]      [,2]     [,3]       [,4]       [,5]      [,6]     [,7]
row5 -0.3689807 0.6166892 1.019362 -0.2427398 -0.6914355 0.2784231 1.072596
          [,8]    [,9]    [,10]     [,11]     [,12]     [,13]      [,14]
row5 -1.577243 1.26385 0.384982 0.2199381 0.2766866 0.9822821 -0.7803756
         [,15]   [,16]       [,17]     [,18]      [,19]     [,20]
row5 -2.070585 2.70738 -0.09739114 0.3670552 -0.3792679 0.5245631
> 
> 
> 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: 0x6000019d4d20>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM50a443ce69cb"
 [2] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM50a42483b134"
 [3] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM50a441e6dfa6"
 [4] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM50a41c652d17"
 [5] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM50a436734f91"
 [6] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM50a44c6cd484"
 [7] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM50a47cf44d4e"
 [8] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM50a4aff7bf9" 
 [9] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM50a4b241e13" 
[10] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM50a47032771b"
[11] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM50a4129c729" 
[12] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM50a45dd25557"
[13] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM50a41be0f2e0"
[14] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM50a44d695e6c"
[15] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM50a440b62c28"
> 
> 
> ### 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: 0x6000019d8300>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x6000019d8300>
Warning message:
In dir.create(new.directory) :
  '/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x6000019d8300>
> rowMedians(tmp)
  [1] -0.5269435089  0.0016479676 -0.2499792621  0.1166488272  0.1203767697
  [6] -0.1870961259  0.0097678355 -0.3854182332 -0.1810897804 -0.0747229094
 [11] -0.6544599269 -0.5963717339  0.0104584174  0.2553377013  0.1986673770
 [16]  0.2550845182  0.1977094342 -0.5677894379  0.0972943540 -0.2736271722
 [21]  0.1190422771  0.5432976642 -0.0792669076  0.0652473161 -0.3174475979
 [26]  0.2859374723 -0.0614754000 -0.3934335237  0.0881201638  0.0693727855
 [31] -0.4896583960  0.7201917231  0.2376611305  0.2276135758  0.5261463220
 [36] -0.0026568283 -0.0703018005 -0.5186373420  0.3715989599  0.4029793613
 [41] -0.0422320255 -0.4439739161  0.1570819481  0.2465414047 -0.2973232083
 [46] -0.0800393463  0.0938615930  0.3151826166 -0.2617931752 -0.1613684601
 [51]  0.2138731970  0.0501758369 -0.1406963672 -0.1656747779  0.3342539501
 [56]  0.0549384127 -0.3816515240 -0.2883535962 -0.6341181784 -0.0006156303
 [61] -0.2182542484  0.1382631989  0.4002943654 -0.1264262787  0.2962769667
 [66] -0.3172420143  0.1469257381  0.6245555658 -0.6370187683  0.3769254609
 [71]  0.0184814433  0.5869144452  0.2495078270  0.0467885910 -0.2296643426
 [76]  0.2435109092 -0.3553186915  0.1422531468 -0.4345749180 -0.1197130311
 [81]  0.2728741701 -0.4026182893 -0.3495811977 -0.6214432756  0.2865923035
 [86]  0.2678262512  0.3653503578 -0.3894678304  0.1172220116 -0.0678751483
 [91]  0.0461345265  0.8108825804  0.1758521911  0.2985013796 -0.4630860242
 [96]  0.3973914811 -0.3692234776 -0.3452905506  0.7502486736 -0.1256775877
[101]  0.5475120905 -0.2678935157  0.3068665491  0.1738316319 -0.3568360583
[106]  0.0382417006  0.0028947092  0.2337803293 -0.0366761600 -0.0261967604
[111] -0.1044045834  0.0091187081 -0.1981085926 -0.1455571503  0.0517156626
[116] -0.5636844560  0.6436269461  0.1969538012 -0.1137006835 -0.2448390331
[121] -0.0462809530 -0.5233842588 -0.0555506951 -0.5851800492 -0.1812787918
[126]  0.4335553407 -0.2414187617  0.0371795306  0.1662518877 -0.3505812357
[131]  0.4891955352  0.1620749677 -0.0456569996  0.2353758936  0.3181040547
[136] -0.1084151928 -0.5489272448 -0.1972398925 -0.3234171515  0.2564701252
[141] -0.2639790003 -0.5764029559  0.1440029294  0.0799351719  0.3238654681
[146] -0.2502534834 -0.4327144662 -0.6005695192 -0.0000848372 -0.0705019636
[151] -0.4476295616  0.4494401872  0.2849854615  0.0211303214  0.1181198054
[156] -0.1752692840 -0.0577194311 -0.2106485395 -0.4634163066 -0.2399060047
[161]  0.0637361866 -0.0926491820  0.1158659083  0.1835588469  0.0673956795
[166]  0.0182314981 -0.5462161982  0.4151313637  0.0001250986 -0.5291794624
[171] -0.0254629739  0.1393242388  0.3048902571 -0.6145046583  0.2314551016
[176] -0.1181316130  0.4775405649  0.1808921386  0.5803889588  0.0446739209
[181]  0.4175896815  0.4261515497 -0.0990079590  0.1331765003  0.9785906188
[186]  0.3339047289 -0.2864551747  0.4847628252 -0.1135198542 -0.4610777219
[191] -0.1107315517 -0.2686471861 -0.0474750313 -0.2468832457 -0.2577486209
[196] -0.0304776915 -0.6534176027  0.3236237668 -0.3876721915  0.0476811887
[201]  0.2182288626 -0.0423543022 -0.2385792188 -0.2279851202 -0.1385729678
[206] -0.1186518038  0.1443121356  0.0251083331  0.0243136199  0.0029862459
[211]  0.1130935002  0.1370955236  0.3338650242 -0.1479393266  0.3596473067
[216]  0.0345405270  0.2176656090  0.0684023103  0.1573192833 -0.3100080061
[221] -0.3303893032  0.0834519852  0.4703353633 -0.2749815020  0.3562706908
[226] -0.4499800352  0.1326379489  0.1704270971  0.0423293511  0.1103356042
> 
> proc.time()
   user  system elapsed 
  0.674   3.312   4.068 

BufferedMatrix.Rcheck/tests/rawCalltesting.Rout


R Under development (unstable) (2025-11-04 r88984) -- "Unsuffered Consequences"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: aarch64-apple-darwin20

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: 0x60000386c000>
> .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: 0x60000386c000>
> .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: 0x60000386c000>
> .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: 0x60000386c000>
> 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: 0x600003864060>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600003864060>
> .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: 0x600003864060>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600003864060>
> .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: 0x600003864060>
> 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: 0x600003864240>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600003864240>
> .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: 0x600003864240>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x600003864240>
> .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: 0x600003864240>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x600003864240>
> .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: 0x600003864240>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x600003864240>
> .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: 0x600003864240>
> 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: 0x600003864420>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x600003864420>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600003864420>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600003864420>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile52cc1296eefc" "BufferedMatrixFile52cc7323ebec"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile52cc1296eefc" "BufferedMatrixFile52cc7323ebec"
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000038646c0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000038646c0>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x6000038646c0>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x6000038646c0>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x6000038646c0>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x6000038646c0>
> .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: 0x6000038648a0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000038648a0>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x6000038648a0>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x6000038648a0>
> 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: 0x600003860000>
> .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: 0x600003860000>
> rm(P)
> 
> proc.time()
   user  system elapsed 
  0.118   0.040   0.156 

BufferedMatrix.Rcheck/tests/Rcodetesting.Rout


R Under development (unstable) (2025-11-04 r88984) -- "Unsuffered Consequences"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: aarch64-apple-darwin20

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.116   0.025   0.138 

Example timings