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

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

HostnameOSArch (*)R versionInstalled pkgs
nebbiolo2Linux (Ubuntu 24.04.3 LTS)x86_644.5.1 Patched (2025-08-23 r88802) -- "Great Square Root" 4902
kjohnson3macOS 13.7.7 Venturaarm644.5.1 Patched (2025-09-10 r88807) -- "Great Square Root" 4638
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 257/2361HostnameOS / ArchINSTALLBUILDCHECKBUILD BIN
BufferedMatrix 1.74.0  (landing page)
Ben Bolstad
Snapshot Date: 2025-11-05 13:45 -0500 (Wed, 05 Nov 2025)
git_url: https://git.bioconductor.org/packages/BufferedMatrix
git_branch: RELEASE_3_22
git_last_commit: d2ce144
git_last_commit_date: 2025-10-29 09:58:55 -0500 (Wed, 29 Oct 2025)
nebbiolo2Linux (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.74.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.74.0.tar.gz
StartedAt: 2025-11-05 19:17:52 -0500 (Wed, 05 Nov 2025)
EndedAt: 2025-11-05 19:18:08 -0500 (Wed, 05 Nov 2025)
EllapsedTime: 16.2 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.74.0.tar.gz
###
##############################################################################
##############################################################################


* using log directory ‘/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck’
* using R version 4.5.1 Patched (2025-09-10 r88807)
* 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.7
* using session charset: UTF-8
* using option ‘--no-vignettes’
* checking for file ‘BufferedMatrix/DESCRIPTION’ ... OK
* this is package ‘BufferedMatrix’ version ‘1.74.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.22-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 ... NOTE
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, 2 NOTEs
See
  ‘/Users/biocbuild/bbs-3.22-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.5-arm64/Resources/library’
* installing *source* package ‘BufferedMatrix’ ...
** this is package ‘BufferedMatrix’ version ‘1.74.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.5-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 version 4.5.1 Patched (2025-09-10 r88807) -- "Great Square Root"
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.112   0.035   0.144 

BufferedMatrix.Rcheck/tests/objectTesting.Rout


R version 4.5.1 Patched (2025-09-10 r88807) -- "Great Square Root"
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.22-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 480828 25.7    1056614 56.5         NA   634360 33.9
Vcells 891019  6.8    8388608 64.0     196608  2109493 16.1
> 
> 
> 
> 
> ##
> ## 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 Nov  5 19:18:01 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 Nov  5 19:18:01 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: 0x600000fdc000>
> 
> 
> 
> 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 Nov  5 19:18:02 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 Nov  5 19:18:02 2025"
> 
> ColMode(tmp2)
<pointer: 0x600000fdc000>
> 
> 
> 
> ### 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.4718672 -0.6019741 -0.01793912 -0.7734290
[2,]  -0.5234133 -1.0264783 -0.35195642  0.1382367
[3,]   0.3199994  1.3645927 -1.72791096 -1.3536986
[4,]  -0.8324462 -0.6275955 -1.41537990 -0.4910269
> ewApply(tmp5,abs)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.22-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.4718672 0.6019741 0.01793912 0.7734290
[2,]   0.5234133 1.0264783 0.35195642 0.1382367
[3,]   0.3199994 1.3645927 1.72791096 1.3536986
[4,]   0.8324462 0.6275955 1.41537990 0.4910269
> ewApply(tmp5,sqrt)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.22-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.0235656 0.7758699 0.1339370 0.8794481
[2,]  0.7234731 1.0131526 0.5932591 0.3718019
[3,]  0.5656849 1.1681578 1.3145003 1.1634855
[4,]  0.9123849 0.7922093 1.1896974 0.7007331
> 
> 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.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
          [,1]     [,2]     [,3]     [,4]
[1,] 225.70752 33.36067 26.35731 34.56791
[2,]  32.75814 36.15800 31.28455 28.85626
[3,]  30.97685 38.04617 39.87291 37.98855
[4,]  34.95630 33.54969 38.31235 32.49836
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x600000fd8000>
> exp(tmp5)
<pointer: 0x600000fd8000>
> log(tmp5,2)
<pointer: 0x600000fd8000>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 469.7806
> Min(tmp5)
[1] 54.85929
> mean(tmp5)
[1] 74.21304
> Sum(tmp5)
[1] 14842.61
> Var(tmp5)
[1] 858.4568
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 92.76510 71.56585 71.67629 74.11728 71.14527 73.57907 72.54774 72.72255
 [9] 71.89323 70.11803
> rowSums(tmp5)
 [1] 1855.302 1431.317 1433.526 1482.346 1422.905 1471.581 1450.955 1454.451
 [9] 1437.865 1402.361
> rowVars(tmp5)
 [1] 7941.21136   70.33679   67.43882   60.76445   57.85575   57.62481
 [7]   40.06712   85.83665  137.60185   57.11135
> rowSd(tmp5)
 [1] 89.113475  8.386703  8.212114  7.795156  7.606297  7.591101  6.329860
 [8]  9.264807 11.730381  7.557205
> rowMax(tmp5)
 [1] 469.78064  87.35904  82.99025  87.08279  86.23738  89.70033  85.15006
 [8]  89.53153  90.13691  86.62836
> rowMin(tmp5)
 [1] 54.85929 60.06052 55.56397 56.34743 55.10292 62.63048 57.72704 58.56214
 [9] 56.93634 57.46084
> 
> colMeans(tmp5)
 [1] 111.40360  72.51180  72.75938  71.41940  68.86884  70.71955  70.96685
 [8]  74.50129  75.54674  78.27394  69.53799  75.00985  71.09031  78.58942
[15]  67.83366  70.94214  71.45624  69.52305  72.57102  70.73574
> colSums(tmp5)
 [1] 1114.0360  725.1180  727.5938  714.1940  688.6884  707.1955  709.6685
 [8]  745.0129  755.4674  782.7394  695.3799  750.0985  710.9031  785.8942
[15]  678.3366  709.4214  714.5624  695.2305  725.7102  707.3574
> colVars(tmp5)
 [1] 15884.09645    72.51611   133.73301    86.20474   164.20015    65.00562
 [7]    53.70516    55.28738    64.53541    22.46906    75.23314    80.74425
[13]    44.50975    51.17680    66.45693    71.55733    55.84765    27.30004
[19]    55.11596    59.76306
> colSd(tmp5)
 [1] 126.032125   8.515639  11.564299   9.284651  12.814060   8.062606
 [7]   7.328381   7.435548   8.033394   4.740154   8.673704   8.985781
[13]   6.671563   7.153796   8.152112   8.459157   7.473128   5.224944
[19]   7.424012   7.730657
> colMax(tmp5)
 [1] 469.78064  85.77289  88.61891  86.73694  89.53153  83.72466  80.18685
 [8]  84.06439  87.35904  86.62836  82.41449  90.13691  80.26459  87.08279
[15]  83.76715  81.30341  80.41260  77.13092  83.55619  82.06843
> colMin(tmp5)
 [1] 64.47425 61.18512 54.85929 60.06052 55.10292 57.75162 58.14315 62.57399
 [9] 61.20628 70.38255 57.72866 61.66823 58.10124 66.30342 57.72704 56.93634
[17] 57.46084 60.98719 56.34743 61.02306
> 
> 
> ### 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.76510 71.56585 71.67629       NA 71.14527 73.57907 72.54774 72.72255
 [9] 71.89323 70.11803
> rowSums(tmp5)
 [1] 1855.302 1431.317 1433.526       NA 1422.905 1471.581 1450.955 1454.451
 [9] 1437.865 1402.361
> rowVars(tmp5)
 [1] 7941.21136   70.33679   67.43882   64.13854   57.85575   57.62481
 [7]   40.06712   85.83665  137.60185   57.11135
> rowSd(tmp5)
 [1] 89.113475  8.386703  8.212114  8.008654  7.606297  7.591101  6.329860
 [8]  9.264807 11.730381  7.557205
> rowMax(tmp5)
 [1] 469.78064  87.35904  82.99025        NA  86.23738  89.70033  85.15006
 [8]  89.53153  90.13691  86.62836
> rowMin(tmp5)
 [1] 54.85929 60.06052 55.56397       NA 55.10292 62.63048 57.72704 58.56214
 [9] 56.93634 57.46084
> 
> colMeans(tmp5)
 [1] 111.40360  72.51180  72.75938  71.41940  68.86884        NA  70.96685
 [8]  74.50129  75.54674  78.27394  69.53799  75.00985  71.09031  78.58942
[15]  67.83366  70.94214  71.45624  69.52305  72.57102  70.73574
> colSums(tmp5)
 [1] 1114.0360  725.1180  727.5938  714.1940  688.6884        NA  709.6685
 [8]  745.0129  755.4674  782.7394  695.3799  750.0985  710.9031  785.8942
[15]  678.3366  709.4214  714.5624  695.2305  725.7102  707.3574
> colVars(tmp5)
 [1] 15884.09645    72.51611   133.73301    86.20474   164.20015          NA
 [7]    53.70516    55.28738    64.53541    22.46906    75.23314    80.74425
[13]    44.50975    51.17680    66.45693    71.55733    55.84765    27.30004
[19]    55.11596    59.76306
> colSd(tmp5)
 [1] 126.032125   8.515639  11.564299   9.284651  12.814060         NA
 [7]   7.328381   7.435548   8.033394   4.740154   8.673704   8.985781
[13]   6.671563   7.153796   8.152112   8.459157   7.473128   5.224944
[19]   7.424012   7.730657
> colMax(tmp5)
 [1] 469.78064  85.77289  88.61891  86.73694  89.53153        NA  80.18685
 [8]  84.06439  87.35904  86.62836  82.41449  90.13691  80.26459  87.08279
[15]  83.76715  81.30341  80.41260  77.13092  83.55619  82.06843
> colMin(tmp5)
 [1] 64.47425 61.18512 54.85929 60.06052 55.10292       NA 58.14315 62.57399
 [9] 61.20628 70.38255 57.72866 61.66823 58.10124 66.30342 57.72704 56.93634
[17] 57.46084 60.98719 56.34743 61.02306
> 
> Max(tmp5,na.rm=TRUE)
[1] 469.7806
> Min(tmp5,na.rm=TRUE)
[1] 54.85929
> mean(tmp5,na.rm=TRUE)
[1] 74.21266
> Sum(tmp5,na.rm=TRUE)
[1] 14768.32
> Var(tmp5,na.rm=TRUE)
[1] 862.7925
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 92.76510 71.56585 71.67629 74.10825 71.14527 73.57907 72.54774 72.72255
 [9] 71.89323 70.11803
> rowSums(tmp5,na.rm=TRUE)
 [1] 1855.302 1431.317 1433.526 1408.057 1422.905 1471.581 1450.955 1454.451
 [9] 1437.865 1402.361
> rowVars(tmp5,na.rm=TRUE)
 [1] 7941.21136   70.33679   67.43882   64.13854   57.85575   57.62481
 [7]   40.06712   85.83665  137.60185   57.11135
> rowSd(tmp5,na.rm=TRUE)
 [1] 89.113475  8.386703  8.212114  8.008654  7.606297  7.591101  6.329860
 [8]  9.264807 11.730381  7.557205
> rowMax(tmp5,na.rm=TRUE)
 [1] 469.78064  87.35904  82.99025  87.08279  86.23738  89.70033  85.15006
 [8]  89.53153  90.13691  86.62836
> rowMin(tmp5,na.rm=TRUE)
 [1] 54.85929 60.06052 55.56397 56.34743 55.10292 62.63048 57.72704 58.56214
 [9] 56.93634 57.46084
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 111.40360  72.51180  72.75938  71.41940  68.86884  70.32297  70.96685
 [8]  74.50129  75.54674  78.27394  69.53799  75.00985  71.09031  78.58942
[15]  67.83366  70.94214  71.45624  69.52305  72.57102  70.73574
> colSums(tmp5,na.rm=TRUE)
 [1] 1114.0360  725.1180  727.5938  714.1940  688.6884  632.9068  709.6685
 [8]  745.0129  755.4674  782.7394  695.3799  750.0985  710.9031  785.8942
[15]  678.3366  709.4214  714.5624  695.2305  725.7102  707.3574
> colVars(tmp5,na.rm=TRUE)
 [1] 15884.09645    72.51611   133.73301    86.20474   164.20015    71.36201
 [7]    53.70516    55.28738    64.53541    22.46906    75.23314    80.74425
[13]    44.50975    51.17680    66.45693    71.55733    55.84765    27.30004
[19]    55.11596    59.76306
> colSd(tmp5,na.rm=TRUE)
 [1] 126.032125   8.515639  11.564299   9.284651  12.814060   8.447604
 [7]   7.328381   7.435548   8.033394   4.740154   8.673704   8.985781
[13]   6.671563   7.153796   8.152112   8.459157   7.473128   5.224944
[19]   7.424012   7.730657
> colMax(tmp5,na.rm=TRUE)
 [1] 469.78064  85.77289  88.61891  86.73694  89.53153  83.72466  80.18685
 [8]  84.06439  87.35904  86.62836  82.41449  90.13691  80.26459  87.08279
[15]  83.76715  81.30341  80.41260  77.13092  83.55619  82.06843
> colMin(tmp5,na.rm=TRUE)
 [1] 64.47425 61.18512 54.85929 60.06052 55.10292 57.75162 58.14315 62.57399
 [9] 61.20628 70.38255 57.72866 61.66823 58.10124 66.30342 57.72704 56.93634
[17] 57.46084 60.98719 56.34743 61.02306
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1] 92.76510 71.56585 71.67629      NaN 71.14527 73.57907 72.54774 72.72255
 [9] 71.89323 70.11803
> rowSums(tmp5,na.rm=TRUE)
 [1] 1855.302 1431.317 1433.526    0.000 1422.905 1471.581 1450.955 1454.451
 [9] 1437.865 1402.361
> rowVars(tmp5,na.rm=TRUE)
 [1] 7941.21136   70.33679   67.43882         NA   57.85575   57.62481
 [7]   40.06712   85.83665  137.60185   57.11135
> rowSd(tmp5,na.rm=TRUE)
 [1] 89.113475  8.386703  8.212114        NA  7.606297  7.591101  6.329860
 [8]  9.264807 11.730381  7.557205
> rowMax(tmp5,na.rm=TRUE)
 [1] 469.78064  87.35904  82.99025        NA  86.23738  89.70033  85.15006
 [8]  89.53153  90.13691  86.62836
> rowMin(tmp5,na.rm=TRUE)
 [1] 54.85929 60.06052 55.56397       NA 55.10292 62.63048 57.72704 58.56214
 [9] 56.93634 57.46084
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1] 115.69767  72.80985  71.98352  71.83922  69.89535       NaN  70.70568
 [8]  73.54520  75.78177  77.76895  69.05205  75.68058  70.30627  77.64572
[15]  66.06328  70.65471  71.44898  69.36984  74.37364  69.52837
> colSums(tmp5,na.rm=TRUE)
 [1] 1041.2790  655.2887  647.8516  646.5529  629.0582    0.0000  636.3511
 [8]  661.9068  682.0359  699.9206  621.4684  681.1252  632.7564  698.8115
[15]  594.5695  635.8924  643.0408  624.3286  669.3628  625.7553
> colVars(tmp5,na.rm=TRUE)
 [1] 17662.16912    80.58120   143.67755    94.99759   172.87064          NA
 [7]    59.65090    51.91459    71.98087    22.40882    81.98069    85.77606
[13]    43.15791    47.55483    39.50351    79.57257    62.82801    30.44846
[19]    25.44923    50.83375
> colSd(tmp5,na.rm=TRUE)
 [1] 132.899094   8.976703  11.986557   9.746671  13.148028         NA
 [7]   7.723399   7.205178   8.484154   4.733795   9.054319   9.261537
[13]   6.569468   6.896001   6.285182   8.920346   7.926412   5.518013
[19]   5.044723   7.129779
> colMax(tmp5,na.rm=TRUE)
 [1] 469.78064  85.77289  88.61891  86.73694  89.53153      -Inf  80.18685
 [8]  84.06439  87.35904  86.62836  82.41449  90.13691  80.26459  85.86898
[15]  80.48251  81.30341  80.41260  77.13092  83.55619  82.06843
> colMin(tmp5,na.rm=TRUE)
 [1] 64.47425 61.18512 54.85929 60.06052 55.10292      Inf 58.14315 62.57399
 [9] 61.20628 70.38255 57.72866 61.66823 58.10124 66.30342 57.72704 56.93634
[17] 57.46084 60.98719 66.68558 61.02306
> 
> 
> 
> 
> 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]  96.69549 206.35516 217.14906 193.16472 439.96283 160.70848 213.36194
 [8] 255.08124 232.90656 195.48988
> apply(copymatrix,1,var,na.rm=TRUE)
 [1]  96.69549 206.35516 217.14906 193.16472 439.96283 160.70848 213.36194
 [8] 255.08124 232.90656 195.48988
> 
> 
> 
> copymatrix <- matrix(rnorm(200,150,15),10,20)
> 
> tmp5[1:10,1:20] <- copymatrix
> which.row <- 1
> which.col  <- 3
> cat(which.row," ",which.col,"\n")
1   3 
> tmp5[which.row,which.col] <- NA
> copymatrix[which.row,which.col] <- NA
> 
> colVars(tmp5,na.rm=TRUE)-apply(copymatrix,2,var,na.rm=TRUE)
 [1] -2.842171e-14  1.705303e-13  2.273737e-13  1.136868e-13 -7.105427e-14
 [6]  5.684342e-14  0.000000e+00 -1.705303e-13  1.136868e-13 -2.842171e-14
[11] -1.421085e-14  4.263256e-14  5.684342e-14  7.105427e-14  2.842171e-14
[16] -8.526513e-14  5.684342e-14 -2.842171e-14  0.000000e+00  2.273737e-13
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> ## 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)
+ }
1   16 
1   2 
9   10 
6   19 
4   20 
7   18 
3   7 
9   5 
6   14 
7   11 
6   20 
4   5 
4   12 
3   8 
7   12 
7   9 
5   17 
1   20 
1   7 
3   8 
There were 50 or more warnings (use warnings() to see the first 50)
> 
> 
> ### now test 1 by n and n by 1 matrix
> 
> 
> err.tol <- 1e-12
> 
> rm(tmp5)
> 
> dataset1 <- rnorm(100)
> dataset2 <- rnorm(100)
> 
> tmp <- createBufferedMatrix(1,100)
> tmp[1,] <- dataset1
> 
> tmp2 <- createBufferedMatrix(100,1)
> tmp2[,1] <- dataset2
> 
> 
> 
> 
> 
> Max(tmp)
[1] 2.189567
> Min(tmp)
[1] -1.931805
> mean(tmp)
[1] 0.03765071
> Sum(tmp)
[1] 3.765071
> Var(tmp)
[1] 0.7920128
> 
> rowMeans(tmp)
[1] 0.03765071
> rowSums(tmp)
[1] 3.765071
> rowVars(tmp)
[1] 0.7920128
> rowSd(tmp)
[1] 0.889951
> rowMax(tmp)
[1] 2.189567
> rowMin(tmp)
[1] -1.931805
> 
> colMeans(tmp)
  [1]  0.69053284 -0.17119183  1.04287539 -1.01479212  0.72017633 -0.10075269
  [7]  0.88350510 -0.73345641 -0.45147653  0.71933615 -0.91345418 -0.54609105
 [13]  1.32991220 -0.27373616 -0.56036615 -0.36024882  0.49662021 -0.44378908
 [19] -1.41996160  0.35119557  0.88908029  0.47906957 -0.59928026  0.67683987
 [25]  1.31124587 -0.52533709  0.17969846  0.28392176 -0.01708678 -0.98884324
 [31] -0.06461722  0.40233306  0.08374876 -0.07350861  0.77204831  0.18099664
 [37] -1.05203250  1.09231270 -1.22549706 -1.09255254 -0.39344033 -0.04276942
 [43]  0.71152413  1.07333224 -1.50182987  0.77689355  0.67955015  0.57519293
 [49]  1.21501089 -0.90764330 -1.12541102  1.80614825  0.43195699  0.11763089
 [55]  0.75665352  0.17581601 -1.50906872 -1.23324051 -1.93180534  0.91524235
 [61] -0.86869777 -0.01464323 -1.24313649  1.87135923 -0.44262693  1.26196308
 [67]  0.27427574  0.30389662 -1.37945049  1.45035941 -1.13730919  2.18956661
 [73] -0.88899863 -0.16966225 -0.25044961  0.36246426  1.32217560 -0.22541273
 [79] -0.25030135 -1.02577443 -0.39737768  0.41706715  1.70319046  1.29834688
 [85] -0.30386741 -0.48203427  1.67414986  0.18470212 -0.06923301 -0.59373382
 [91] -1.06782146 -0.06724166  1.13350881 -0.52744308  0.79057387  0.40438948
 [97] -0.95160521 -0.21378581 -0.68546246 -0.16797011
> colSums(tmp)
  [1]  0.69053284 -0.17119183  1.04287539 -1.01479212  0.72017633 -0.10075269
  [7]  0.88350510 -0.73345641 -0.45147653  0.71933615 -0.91345418 -0.54609105
 [13]  1.32991220 -0.27373616 -0.56036615 -0.36024882  0.49662021 -0.44378908
 [19] -1.41996160  0.35119557  0.88908029  0.47906957 -0.59928026  0.67683987
 [25]  1.31124587 -0.52533709  0.17969846  0.28392176 -0.01708678 -0.98884324
 [31] -0.06461722  0.40233306  0.08374876 -0.07350861  0.77204831  0.18099664
 [37] -1.05203250  1.09231270 -1.22549706 -1.09255254 -0.39344033 -0.04276942
 [43]  0.71152413  1.07333224 -1.50182987  0.77689355  0.67955015  0.57519293
 [49]  1.21501089 -0.90764330 -1.12541102  1.80614825  0.43195699  0.11763089
 [55]  0.75665352  0.17581601 -1.50906872 -1.23324051 -1.93180534  0.91524235
 [61] -0.86869777 -0.01464323 -1.24313649  1.87135923 -0.44262693  1.26196308
 [67]  0.27427574  0.30389662 -1.37945049  1.45035941 -1.13730919  2.18956661
 [73] -0.88899863 -0.16966225 -0.25044961  0.36246426  1.32217560 -0.22541273
 [79] -0.25030135 -1.02577443 -0.39737768  0.41706715  1.70319046  1.29834688
 [85] -0.30386741 -0.48203427  1.67414986  0.18470212 -0.06923301 -0.59373382
 [91] -1.06782146 -0.06724166  1.13350881 -0.52744308  0.79057387  0.40438948
 [97] -0.95160521 -0.21378581 -0.68546246 -0.16797011
> 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.69053284 -0.17119183  1.04287539 -1.01479212  0.72017633 -0.10075269
  [7]  0.88350510 -0.73345641 -0.45147653  0.71933615 -0.91345418 -0.54609105
 [13]  1.32991220 -0.27373616 -0.56036615 -0.36024882  0.49662021 -0.44378908
 [19] -1.41996160  0.35119557  0.88908029  0.47906957 -0.59928026  0.67683987
 [25]  1.31124587 -0.52533709  0.17969846  0.28392176 -0.01708678 -0.98884324
 [31] -0.06461722  0.40233306  0.08374876 -0.07350861  0.77204831  0.18099664
 [37] -1.05203250  1.09231270 -1.22549706 -1.09255254 -0.39344033 -0.04276942
 [43]  0.71152413  1.07333224 -1.50182987  0.77689355  0.67955015  0.57519293
 [49]  1.21501089 -0.90764330 -1.12541102  1.80614825  0.43195699  0.11763089
 [55]  0.75665352  0.17581601 -1.50906872 -1.23324051 -1.93180534  0.91524235
 [61] -0.86869777 -0.01464323 -1.24313649  1.87135923 -0.44262693  1.26196308
 [67]  0.27427574  0.30389662 -1.37945049  1.45035941 -1.13730919  2.18956661
 [73] -0.88899863 -0.16966225 -0.25044961  0.36246426  1.32217560 -0.22541273
 [79] -0.25030135 -1.02577443 -0.39737768  0.41706715  1.70319046  1.29834688
 [85] -0.30386741 -0.48203427  1.67414986  0.18470212 -0.06923301 -0.59373382
 [91] -1.06782146 -0.06724166  1.13350881 -0.52744308  0.79057387  0.40438948
 [97] -0.95160521 -0.21378581 -0.68546246 -0.16797011
> colMin(tmp)
  [1]  0.69053284 -0.17119183  1.04287539 -1.01479212  0.72017633 -0.10075269
  [7]  0.88350510 -0.73345641 -0.45147653  0.71933615 -0.91345418 -0.54609105
 [13]  1.32991220 -0.27373616 -0.56036615 -0.36024882  0.49662021 -0.44378908
 [19] -1.41996160  0.35119557  0.88908029  0.47906957 -0.59928026  0.67683987
 [25]  1.31124587 -0.52533709  0.17969846  0.28392176 -0.01708678 -0.98884324
 [31] -0.06461722  0.40233306  0.08374876 -0.07350861  0.77204831  0.18099664
 [37] -1.05203250  1.09231270 -1.22549706 -1.09255254 -0.39344033 -0.04276942
 [43]  0.71152413  1.07333224 -1.50182987  0.77689355  0.67955015  0.57519293
 [49]  1.21501089 -0.90764330 -1.12541102  1.80614825  0.43195699  0.11763089
 [55]  0.75665352  0.17581601 -1.50906872 -1.23324051 -1.93180534  0.91524235
 [61] -0.86869777 -0.01464323 -1.24313649  1.87135923 -0.44262693  1.26196308
 [67]  0.27427574  0.30389662 -1.37945049  1.45035941 -1.13730919  2.18956661
 [73] -0.88899863 -0.16966225 -0.25044961  0.36246426  1.32217560 -0.22541273
 [79] -0.25030135 -1.02577443 -0.39737768  0.41706715  1.70319046  1.29834688
 [85] -0.30386741 -0.48203427  1.67414986  0.18470212 -0.06923301 -0.59373382
 [91] -1.06782146 -0.06724166  1.13350881 -0.52744308  0.79057387  0.40438948
 [97] -0.95160521 -0.21378581 -0.68546246 -0.16797011
> colMedians(tmp)
  [1]  0.69053284 -0.17119183  1.04287539 -1.01479212  0.72017633 -0.10075269
  [7]  0.88350510 -0.73345641 -0.45147653  0.71933615 -0.91345418 -0.54609105
 [13]  1.32991220 -0.27373616 -0.56036615 -0.36024882  0.49662021 -0.44378908
 [19] -1.41996160  0.35119557  0.88908029  0.47906957 -0.59928026  0.67683987
 [25]  1.31124587 -0.52533709  0.17969846  0.28392176 -0.01708678 -0.98884324
 [31] -0.06461722  0.40233306  0.08374876 -0.07350861  0.77204831  0.18099664
 [37] -1.05203250  1.09231270 -1.22549706 -1.09255254 -0.39344033 -0.04276942
 [43]  0.71152413  1.07333224 -1.50182987  0.77689355  0.67955015  0.57519293
 [49]  1.21501089 -0.90764330 -1.12541102  1.80614825  0.43195699  0.11763089
 [55]  0.75665352  0.17581601 -1.50906872 -1.23324051 -1.93180534  0.91524235
 [61] -0.86869777 -0.01464323 -1.24313649  1.87135923 -0.44262693  1.26196308
 [67]  0.27427574  0.30389662 -1.37945049  1.45035941 -1.13730919  2.18956661
 [73] -0.88899863 -0.16966225 -0.25044961  0.36246426  1.32217560 -0.22541273
 [79] -0.25030135 -1.02577443 -0.39737768  0.41706715  1.70319046  1.29834688
 [85] -0.30386741 -0.48203427  1.67414986  0.18470212 -0.06923301 -0.59373382
 [91] -1.06782146 -0.06724166  1.13350881 -0.52744308  0.79057387  0.40438948
 [97] -0.95160521 -0.21378581 -0.68546246 -0.16797011
> colRanges(tmp)
          [,1]       [,2]     [,3]      [,4]      [,5]       [,6]      [,7]
[1,] 0.6905328 -0.1711918 1.042875 -1.014792 0.7201763 -0.1007527 0.8835051
[2,] 0.6905328 -0.1711918 1.042875 -1.014792 0.7201763 -0.1007527 0.8835051
           [,8]       [,9]     [,10]      [,11]      [,12]    [,13]      [,14]
[1,] -0.7334564 -0.4514765 0.7193362 -0.9134542 -0.5460911 1.329912 -0.2737362
[2,] -0.7334564 -0.4514765 0.7193362 -0.9134542 -0.5460911 1.329912 -0.2737362
          [,15]      [,16]     [,17]      [,18]     [,19]     [,20]     [,21]
[1,] -0.5603662 -0.3602488 0.4966202 -0.4437891 -1.419962 0.3511956 0.8890803
[2,] -0.5603662 -0.3602488 0.4966202 -0.4437891 -1.419962 0.3511956 0.8890803
         [,22]      [,23]     [,24]    [,25]      [,26]     [,27]     [,28]
[1,] 0.4790696 -0.5992803 0.6768399 1.311246 -0.5253371 0.1796985 0.2839218
[2,] 0.4790696 -0.5992803 0.6768399 1.311246 -0.5253371 0.1796985 0.2839218
           [,29]      [,30]       [,31]     [,32]      [,33]       [,34]
[1,] -0.01708678 -0.9888432 -0.06461722 0.4023331 0.08374876 -0.07350861
[2,] -0.01708678 -0.9888432 -0.06461722 0.4023331 0.08374876 -0.07350861
         [,35]     [,36]     [,37]    [,38]     [,39]     [,40]      [,41]
[1,] 0.7720483 0.1809966 -1.052033 1.092313 -1.225497 -1.092553 -0.3934403
[2,] 0.7720483 0.1809966 -1.052033 1.092313 -1.225497 -1.092553 -0.3934403
           [,42]     [,43]    [,44]    [,45]     [,46]     [,47]     [,48]
[1,] -0.04276942 0.7115241 1.073332 -1.50183 0.7768935 0.6795502 0.5751929
[2,] -0.04276942 0.7115241 1.073332 -1.50183 0.7768935 0.6795502 0.5751929
        [,49]      [,50]     [,51]    [,52]    [,53]     [,54]     [,55]
[1,] 1.215011 -0.9076433 -1.125411 1.806148 0.431957 0.1176309 0.7566535
[2,] 1.215011 -0.9076433 -1.125411 1.806148 0.431957 0.1176309 0.7566535
        [,56]     [,57]     [,58]     [,59]     [,60]      [,61]       [,62]
[1,] 0.175816 -1.509069 -1.233241 -1.931805 0.9152424 -0.8686978 -0.01464323
[2,] 0.175816 -1.509069 -1.233241 -1.931805 0.9152424 -0.8686978 -0.01464323
         [,63]    [,64]      [,65]    [,66]     [,67]     [,68]    [,69]
[1,] -1.243136 1.871359 -0.4426269 1.261963 0.2742757 0.3038966 -1.37945
[2,] -1.243136 1.871359 -0.4426269 1.261963 0.2742757 0.3038966 -1.37945
        [,70]     [,71]    [,72]      [,73]      [,74]      [,75]     [,76]
[1,] 1.450359 -1.137309 2.189567 -0.8889986 -0.1696623 -0.2504496 0.3624643
[2,] 1.450359 -1.137309 2.189567 -0.8889986 -0.1696623 -0.2504496 0.3624643
        [,77]      [,78]      [,79]     [,80]      [,81]     [,82]   [,83]
[1,] 1.322176 -0.2254127 -0.2503013 -1.025774 -0.3973777 0.4170671 1.70319
[2,] 1.322176 -0.2254127 -0.2503013 -1.025774 -0.3973777 0.4170671 1.70319
        [,84]      [,85]      [,86]   [,87]     [,88]       [,89]      [,90]
[1,] 1.298347 -0.3038674 -0.4820343 1.67415 0.1847021 -0.06923301 -0.5937338
[2,] 1.298347 -0.3038674 -0.4820343 1.67415 0.1847021 -0.06923301 -0.5937338
         [,91]       [,92]    [,93]      [,94]     [,95]     [,96]      [,97]
[1,] -1.067821 -0.06724166 1.133509 -0.5274431 0.7905739 0.4043895 -0.9516052
[2,] -1.067821 -0.06724166 1.133509 -0.5274431 0.7905739 0.4043895 -0.9516052
          [,98]      [,99]     [,100]
[1,] -0.2137858 -0.6854625 -0.1679701
[2,] -0.2137858 -0.6854625 -0.1679701
> 
> 
> Max(tmp2)
[1] 3.472937
> Min(tmp2)
[1] -2.583782
> mean(tmp2)
[1] -0.07579829
> Sum(tmp2)
[1] -7.579829
> Var(tmp2)
[1] 1.416211
> 
> rowMeans(tmp2)
  [1]  0.685558566 -1.138095408 -0.377037078 -0.954970889 -1.531287263
  [6]  0.049853683 -0.969357680  3.009624285  0.060686033  1.110903254
 [11] -1.118961419  0.277657179  0.218081401  0.057038915 -2.051587284
 [16]  0.142806585  0.256767352  0.309308498  1.839329564  2.811094904
 [21] -0.480078376  1.167331429  1.645771615 -1.430358150 -1.793272624
 [26] -1.565301794 -1.695540707 -1.373292341 -1.144696096 -0.866864754
 [31] -0.455197685 -0.331123051  2.197622560 -2.583782008 -0.056076928
 [36]  1.104471564 -0.025095234 -0.386208025 -0.234917670 -0.292712560
 [41]  0.099027182 -0.471911130 -0.249521750 -0.865717412  0.215641177
 [46]  1.137220307 -0.640629190 -0.542419329 -0.736293949 -0.395978836
 [51]  0.155470211  0.153884331 -0.107558441  0.165664482  0.163263403
 [56] -1.431974373  0.240137292 -0.897470555  1.041186824 -0.381219506
 [61] -0.322273877  1.635552361 -0.136659665 -0.240147043  0.752073572
 [66] -2.549867845  0.238369523  0.099446707  3.089410193 -0.784223814
 [71]  0.675448349  1.031156939  0.422418795 -0.222942610 -2.024901968
 [76] -0.535773467 -1.444013637  3.472937424  1.824175642  2.004788532
 [81]  1.106066964  0.395499980 -1.071801621 -1.071412404  0.383164671
 [86] -0.288890290  1.036628931  0.644157518  0.643259775 -1.089595317
 [91]  0.320229337 -0.965674568  0.748565793  0.280791543 -0.317368662
 [96] -2.123422050 -0.006956855 -1.305603437 -1.983769870 -0.637565986
> rowSums(tmp2)
  [1]  0.685558566 -1.138095408 -0.377037078 -0.954970889 -1.531287263
  [6]  0.049853683 -0.969357680  3.009624285  0.060686033  1.110903254
 [11] -1.118961419  0.277657179  0.218081401  0.057038915 -2.051587284
 [16]  0.142806585  0.256767352  0.309308498  1.839329564  2.811094904
 [21] -0.480078376  1.167331429  1.645771615 -1.430358150 -1.793272624
 [26] -1.565301794 -1.695540707 -1.373292341 -1.144696096 -0.866864754
 [31] -0.455197685 -0.331123051  2.197622560 -2.583782008 -0.056076928
 [36]  1.104471564 -0.025095234 -0.386208025 -0.234917670 -0.292712560
 [41]  0.099027182 -0.471911130 -0.249521750 -0.865717412  0.215641177
 [46]  1.137220307 -0.640629190 -0.542419329 -0.736293949 -0.395978836
 [51]  0.155470211  0.153884331 -0.107558441  0.165664482  0.163263403
 [56] -1.431974373  0.240137292 -0.897470555  1.041186824 -0.381219506
 [61] -0.322273877  1.635552361 -0.136659665 -0.240147043  0.752073572
 [66] -2.549867845  0.238369523  0.099446707  3.089410193 -0.784223814
 [71]  0.675448349  1.031156939  0.422418795 -0.222942610 -2.024901968
 [76] -0.535773467 -1.444013637  3.472937424  1.824175642  2.004788532
 [81]  1.106066964  0.395499980 -1.071801621 -1.071412404  0.383164671
 [86] -0.288890290  1.036628931  0.644157518  0.643259775 -1.089595317
 [91]  0.320229337 -0.965674568  0.748565793  0.280791543 -0.317368662
 [96] -2.123422050 -0.006956855 -1.305603437 -1.983769870 -0.637565986
> 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.685558566 -1.138095408 -0.377037078 -0.954970889 -1.531287263
  [6]  0.049853683 -0.969357680  3.009624285  0.060686033  1.110903254
 [11] -1.118961419  0.277657179  0.218081401  0.057038915 -2.051587284
 [16]  0.142806585  0.256767352  0.309308498  1.839329564  2.811094904
 [21] -0.480078376  1.167331429  1.645771615 -1.430358150 -1.793272624
 [26] -1.565301794 -1.695540707 -1.373292341 -1.144696096 -0.866864754
 [31] -0.455197685 -0.331123051  2.197622560 -2.583782008 -0.056076928
 [36]  1.104471564 -0.025095234 -0.386208025 -0.234917670 -0.292712560
 [41]  0.099027182 -0.471911130 -0.249521750 -0.865717412  0.215641177
 [46]  1.137220307 -0.640629190 -0.542419329 -0.736293949 -0.395978836
 [51]  0.155470211  0.153884331 -0.107558441  0.165664482  0.163263403
 [56] -1.431974373  0.240137292 -0.897470555  1.041186824 -0.381219506
 [61] -0.322273877  1.635552361 -0.136659665 -0.240147043  0.752073572
 [66] -2.549867845  0.238369523  0.099446707  3.089410193 -0.784223814
 [71]  0.675448349  1.031156939  0.422418795 -0.222942610 -2.024901968
 [76] -0.535773467 -1.444013637  3.472937424  1.824175642  2.004788532
 [81]  1.106066964  0.395499980 -1.071801621 -1.071412404  0.383164671
 [86] -0.288890290  1.036628931  0.644157518  0.643259775 -1.089595317
 [91]  0.320229337 -0.965674568  0.748565793  0.280791543 -0.317368662
 [96] -2.123422050 -0.006956855 -1.305603437 -1.983769870 -0.637565986
> rowMin(tmp2)
  [1]  0.685558566 -1.138095408 -0.377037078 -0.954970889 -1.531287263
  [6]  0.049853683 -0.969357680  3.009624285  0.060686033  1.110903254
 [11] -1.118961419  0.277657179  0.218081401  0.057038915 -2.051587284
 [16]  0.142806585  0.256767352  0.309308498  1.839329564  2.811094904
 [21] -0.480078376  1.167331429  1.645771615 -1.430358150 -1.793272624
 [26] -1.565301794 -1.695540707 -1.373292341 -1.144696096 -0.866864754
 [31] -0.455197685 -0.331123051  2.197622560 -2.583782008 -0.056076928
 [36]  1.104471564 -0.025095234 -0.386208025 -0.234917670 -0.292712560
 [41]  0.099027182 -0.471911130 -0.249521750 -0.865717412  0.215641177
 [46]  1.137220307 -0.640629190 -0.542419329 -0.736293949 -0.395978836
 [51]  0.155470211  0.153884331 -0.107558441  0.165664482  0.163263403
 [56] -1.431974373  0.240137292 -0.897470555  1.041186824 -0.381219506
 [61] -0.322273877  1.635552361 -0.136659665 -0.240147043  0.752073572
 [66] -2.549867845  0.238369523  0.099446707  3.089410193 -0.784223814
 [71]  0.675448349  1.031156939  0.422418795 -0.222942610 -2.024901968
 [76] -0.535773467 -1.444013637  3.472937424  1.824175642  2.004788532
 [81]  1.106066964  0.395499980 -1.071801621 -1.071412404  0.383164671
 [86] -0.288890290  1.036628931  0.644157518  0.643259775 -1.089595317
 [91]  0.320229337 -0.965674568  0.748565793  0.280791543 -0.317368662
 [96] -2.123422050 -0.006956855 -1.305603437 -1.983769870 -0.637565986
> 
> colMeans(tmp2)
[1] -0.07579829
> colSums(tmp2)
[1] -7.579829
> colVars(tmp2)
[1] 1.416211
> colSd(tmp2)
[1] 1.190047
> colMax(tmp2)
[1] 3.472937
> colMin(tmp2)
[1] -2.583782
> colMedians(tmp2)
[1] -0.1221091
> colRanges(tmp2)
          [,1]
[1,] -2.583782
[2,]  3.472937
> 
> dataset1 <- matrix(dataset1,1,100)
> 
> agree.checks(tmp,dataset1)
> 
> dataset2 <- matrix(dataset2,100,1)
> agree.checks(tmp2,dataset2)
>   
> 
> tmp <- createBufferedMatrix(10,10)
> 
> tmp[1:10,1:10] <- rnorm(100)
> colApply(tmp,sum)
 [1] -4.3252947  2.6323608  2.5956883 -1.6594482  1.6904475 -0.3556309
 [7] -1.8547489  0.5595453 -7.8264181  2.7970655
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -1.7449016
[2,] -0.9044817
[3,] -0.5763603
[4,]  0.1171303
[5,]  1.0753210
> 
> rowApply(tmp,sum)
 [1] -2.3510025  1.7623340  0.6777831 -1.8021218 -1.8313029  2.5310928
 [7] -7.1130965  7.3843155 -4.1824893 -0.8219458
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    8    3    2    6    8    2    1    1    3     5
 [2,]    3    7    8    7    5    5    3    9   10     7
 [3,]    9    9   10    4    2    9    4    2    8     9
 [4,]    4   10    9    5    1    4    2    8    2     2
 [5,]    7    2    1    8    4   10    9   10    6     4
 [6,]   10    4    4    2   10    8    6    4    7     1
 [7,]    6    5    5    3    7    6    8    3    4     3
 [8,]    5    1    6   10    3    3   10    5    9     6
 [9,]    1    6    3    1    9    1    5    6    1     8
[10,]    2    8    7    9    6    7    7    7    5    10
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1]  2.7957455  2.4673682  2.6251956 -3.6085309  2.3083332 -2.8123994
 [7]  2.3606788  0.4183479  3.2173881  1.2912742 -3.1724171 -2.8339074
[13] -0.2855081  2.6989897  3.2207749  0.2708216 -0.6395654  1.1711371
[19]  1.8259490 -4.9564397
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -0.6931705
[2,] -0.4034768
[3,]  1.0386839
[4,]  1.3604191
[5,]  1.4932898
> 
> rowApply(tmp,sum)
[1] -1.6103128 -0.9258757  4.2272396  2.2100544  4.4621301
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]   18    7    3   18   17
[2,]   12   20    8   11    6
[3,]   11   15    2   12   20
[4,]    6   13    6    3    3
[5,]   17   19   16    5    7
> 
> 
> as.matrix(tmp)
           [,1]       [,2]       [,3]       [,4]       [,5]       [,6]
[1,]  1.3604191  0.4318703  0.4134061 -1.0978194  1.0083118 -2.0206669
[2,] -0.4034768  2.3727568  0.4630404  0.3264483  0.7682435 -1.6060147
[3,] -0.6931705 -0.1640937 -1.2388850 -0.2360940  1.0267362  0.2598382
[4,]  1.0386839  0.4968509  0.5113328 -1.3526722 -0.2006548  0.1253499
[5,]  1.4932898 -0.6700161  2.4763013 -1.2483936 -0.2943034  0.4290941
            [,7]         [,8]       [,9]       [,10]      [,11]      [,12]
[1,]  0.93322762  1.654808779 -0.6465928 -0.84403592 -1.5774455 -1.1296875
[2,]  0.41055717 -0.005573284  0.7359956  0.75405650 -0.7819549 -1.1884714
[3,]  1.77787902 -2.094994075  1.7685497 -0.08794761 -0.2212843  0.3131247
[4,] -0.68998430  0.188639125  0.5596896  0.40376447  0.5159501  0.6860215
[5,] -0.07100075  0.675467316  0.7997460  1.06543676 -1.1076825 -1.5148947
          [,13]      [,14]       [,15]      [,16]      [,17]        [,18]
[1,]  1.9087596 -1.3899785  0.21278513  0.9511833 -2.7202845  0.755311424
[2,]  0.1856503  0.6043807 -0.05504541 -2.1792019 -0.7452245 -0.220768982
[3,] -0.5862912  0.8216247  0.16819035  1.7888771  0.4770036  0.347953497
[4,] -1.6608438  0.6969668  1.39797549  0.5475059  1.0905966  0.002975825
[5,] -0.1327831  1.9659959  1.49686934 -0.8375428  1.2583434  0.285665363
           [,19]      [,20]
[1,]  0.99655521 -0.8104403
[2,] -0.63579042  0.2745173
[3,]  1.14902264 -0.3487997
[4,]  0.35876789 -2.5068612
[5,] -0.04260627 -1.5648558
> 
> 
> 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.22-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.22-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.22-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.22-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.5476443 1.518238 0.530815 -0.8871832 0.02243727 0.9049274 0.9706193
           col8      col9      col10     col11     col12    col13     col14
row1 -0.8109851 -2.225974 -0.3983951 0.6059107 0.9164927 1.205642 0.5163676
          col15    col16     col17    col18      col19     col20
row1 -0.5576148 1.193733 0.9555205 1.357898 -0.8289282 0.7321257
> tmp[,"col10"]
           col10
row1 -0.39839511
row2  1.83916682
row3 -0.06700367
row4 -0.04284080
row5  0.76057365
> tmp[c("row1","row5"),]
          col1      col2       col3       col4       col5      col6       col7
row1 0.5476443  1.518238  0.5308150 -0.8871832 0.02243727 0.9049274  0.9706193
row5 0.2449821 -0.590831 -0.2412826 -0.3763929 1.27727136 1.4189519 -1.3319241
           col8      col9      col10     col11     col12     col13     col14
row1 -0.8109851 -2.225974 -0.3983951 0.6059107 0.9164927  1.205642 0.5163676
row5 -1.0238030  1.340087  0.7605736 0.8162708 1.2247699 -0.823305 1.0677486
          col15    col16      col17    col18      col19     col20
row1 -0.5576148 1.193733  0.9555205 1.357898 -0.8289282 0.7321257
row5 -1.3297889 2.860662 -0.2584667 0.466749 -0.7703075 1.2575562
> tmp[,c("col6","col20")]
           col6     col20
row1 0.90492739 0.7321257
row2 0.66977915 0.2749593
row3 0.07438745 0.5758043
row4 0.72727281 0.1772235
row5 1.41895187 1.2575562
> tmp[c("row1","row5"),c("col6","col20")]
          col6     col20
row1 0.9049274 0.7321257
row5 1.4189519 1.2575562
> 
> 
> 
> 
> 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.14825 51.20177 50.52867 50.58805 49.3605 104.7558 51.1851 48.09625
         col9    col10    col11    col12    col13    col14    col15    col16
row1 48.38839 50.37603 50.48154 50.50222 48.54403 48.67613 49.68101 48.42374
        col17    col18    col19    col20
row1 50.86761 49.97587 49.83418 104.8013
> tmp[,"col10"]
        col10
row1 50.37603
row2 28.90090
row3 30.02105
row4 29.16968
row5 50.26565
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 50.14825 51.20177 50.52867 50.58805 49.36050 104.7558 51.18510 48.09625
row5 50.13256 49.31569 48.65309 49.48477 50.01361 106.5627 51.04073 51.31068
         col9    col10    col11    col12    col13    col14    col15    col16
row1 48.38839 50.37603 50.48154 50.50222 48.54403 48.67613 49.68101 48.42374
row5 49.16211 50.26565 52.16682 50.87148 50.22975 50.79787 51.33915 50.48943
        col17    col18    col19    col20
row1 50.86761 49.97587 49.83418 104.8013
row5 50.03477 52.04607 50.05983 104.6507
> tmp[,c("col6","col20")]
          col6     col20
row1 104.75581 104.80134
row2  74.73195  74.92693
row3  75.07879  73.50168
row4  73.88669  74.25161
row5 106.56265 104.65067
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 104.7558 104.8013
row5 106.5627 104.6507
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 104.7558 104.8013
row5 106.5627 104.6507
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
          col13
[1,]  1.4452910
[2,] -0.7849850
[3,] -1.5366858
[4,] -0.9460220
[5,] -0.9761248
> tmp[,c("col17","col7")]
           col17       col7
[1,] -1.62427880 -0.3947984
[2,]  0.09683601  0.6435237
[3,]  0.73308419  0.5549155
[4,] -0.33110930 -1.5344880
[5,]  0.05611783  0.2440893
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
           col6      col20
[1,]  0.6972355 -0.8132594
[2,]  1.7301232  0.1493617
[3,] -0.4765070  0.5705732
[4,] -0.4203382  0.6011255
[5,] -1.5620409 -0.5095216
> subBufferedMatrix(tmp,1,c("col6"))[,1]
          col1
[1,] 0.6972355
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
          col6
[1,] 0.6972355
[2,] 1.7301232
> 
> 
> 
> 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.562903 -3.0260047 -2.174628 0.1592416 -0.4218745 -0.1705655 -2.474987
row1 1.234496 -0.4359931  1.748970 0.6133131  0.6594640 -1.8660730 -1.063101
          [,8]       [,9]      [,10]      [,11]      [,12]     [,13]      [,14]
row3 0.2483908  2.1817178 -0.2754898 -1.3683711  3.1981208 0.1410344 -0.3528597
row1 0.6669102 -0.6307231  0.9381127 -0.2934984 -0.4322758 0.4165976 -0.1995179
          [,15]      [,16]      [,17]     [,18]      [,19]      [,20]
row3 -0.6896241 -0.6944956  0.6626686 0.2486224  0.1647150  0.1584905
row1  0.4035628  1.0297540 -1.3002949 1.0463823 -0.3276632 -0.5616310
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
           [,1]       [,2]       [,3]      [,4]   [,5]      [,6]      [,7]
row2 -0.1468342 -0.1050592 -0.3897745 0.3000088 1.1147 0.6266695 0.3599607
           [,8]       [,9]     [,10]
row2 0.04023461 -0.6616446 0.2098229
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
          [,1]      [,2]     [,3]      [,4]      [,5]      [,6]      [,7]
row5 0.9452105 -1.587278 1.884831 0.6825896 -1.519613 0.2864291 0.4394347
          [,8]       [,9]    [,10]      [,11]     [,12]     [,13]     [,14]
row5 -0.162828 -0.2324418 1.330578 -0.9737788 -0.246733 0.5879418 0.7540551
          [,15]    [,16]    [,17]     [,18]     [,19]     [,20]
row5 -0.8652259 1.054741 1.352414 -1.282339 -1.003027 -1.118322
> 
> 
> 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: 0x600000fdc300>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMcc9b738031f2"
 [2] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMcc9b654f421b"
 [3] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMcc9b367d2e93"
 [4] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMcc9b547cd0d7"
 [5] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMcc9b4e72fe96"
 [6] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMcc9b5fa85216"
 [7] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMcc9b23a5536a"
 [8] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMcc9b3b07666e"
 [9] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMcc9b62d5de08"
[10] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMcc9b46e411e9"
[11] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMcc9b2753fc5b"
[12] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMcc9b7adcce88"
[13] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMcc9b367b81bc"
[14] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMcc9b66827995"
[15] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMcc9b7ffc59c6"
> 
> 
> ### 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: 0x600000fd0360>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x600000fd0360>
Warning message:
In dir.create(new.directory) :
  '/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x600000fd0360>
> rowMedians(tmp)
  [1] -0.190212763 -0.146680187  0.161658158  0.137404560 -0.515290316
  [6]  0.030391362  0.367987679 -0.128563878 -0.270466746 -0.152890776
 [11] -0.261173126 -0.005853771  0.285488783  0.163198628  0.461849137
 [16] -0.060182480 -0.313794761 -0.023791564 -0.290807262 -0.007820578
 [21]  0.402290279  0.362969419 -0.315363285 -0.310147485  0.613791821
 [26] -0.007398571 -0.241842656 -0.210881598 -0.124461189 -0.241816349
 [31] -0.475468034  0.184466556  0.059835023 -0.086595476  0.425865624
 [36] -0.194382462 -0.580853136 -0.222171002 -0.179515980 -0.298736754
 [41] -0.396410328  0.031795092  0.442771462  0.036036652  0.205274382
 [46] -0.351824027  0.103959559 -0.295362249 -0.085820900  0.084680016
 [51]  0.120790515 -0.861694431  0.501032589  0.351972598 -0.322605820
 [56] -0.405263808 -0.101113846  0.168334794  0.359029403 -0.002074535
 [61] -0.117088602  0.005435027 -0.377091275  0.005408091  0.357840221
 [66] -0.047487733  0.147746585  0.170881794 -0.211599363 -0.262940038
 [71]  0.104987718  0.049870472 -0.203951019 -0.207202280  0.261740450
 [76] -0.357849301  0.216013790 -0.419015140 -0.171342044 -0.361502428
 [81] -0.029386193 -0.718654654 -0.301480351 -0.072363463 -0.339458948
 [86]  0.163587448 -0.092869846 -0.402423775  0.117541409 -0.364128027
 [91] -0.341428193  0.131746248 -0.026504499 -0.223202262  0.237317886
 [96]  0.287414393 -0.189011975 -0.023279135 -0.065095924 -0.124647573
[101]  0.128782127 -0.527799761  0.457376757 -0.111208454  0.358965289
[106] -0.178866504 -0.084992686 -0.114698884  0.330573340 -0.134265763
[111]  0.102821155  0.064109914  0.059872114  0.174211176 -0.157069997
[116] -0.405895916  0.234868603  0.600405550  0.192351215  0.202836935
[121] -0.242230155 -0.249794193  0.054663647  0.052766661  0.008960274
[126] -0.378174612  0.174699394  0.350942356  0.086148936 -0.074300331
[131]  0.543611402 -0.790428285  0.361687107  0.083773859 -0.417265143
[136]  0.162922144 -0.129747975  0.330098286  0.193190166 -0.171692731
[141]  0.280162241  0.307189277  0.262356708  0.337069046 -0.005561325
[146]  0.094637500  0.305422896 -0.137560632 -0.228727642  0.091973908
[151]  0.287869384 -0.247406708 -0.218640281 -0.046540299 -0.038933235
[156]  0.166943248 -0.266221452  0.285060268 -0.135963447  0.439372473
[161]  0.239613755  0.040636668  0.433154667  0.253542873 -0.277163005
[166]  0.188546388 -0.387691441  0.031951401  0.313422059 -0.646269922
[171]  0.133381522  0.120401843 -0.207145906  0.262912356 -0.227775778
[176]  0.043916945 -0.579405303  0.361066979 -0.042521578 -0.353924507
[181]  0.278194231 -0.038243540 -0.173780258 -0.277094952 -0.421215385
[186]  0.533859773  0.203006992 -0.149609028 -0.428114407 -0.118739204
[191] -0.360871223  0.494831410  0.090956127 -0.644109300 -0.184400563
[196] -0.045257503  0.177282531  0.145104284 -0.173043734 -0.062664774
[201] -0.224609496 -0.330057012 -0.299811247 -0.055949287 -0.661960532
[206] -0.088156231 -0.493665126 -0.126142923  0.037945210 -0.425945654
[211] -0.180102041 -0.140281553  0.194463086  0.214681210  0.292082294
[216]  0.187922891  0.153430586  0.160885976  0.090398121  0.078570586
[221]  0.033566378 -0.684662717  0.532654785 -0.411279021 -0.720816783
[226]  0.371616479 -0.501880781 -0.513738833  0.015580086  0.104847505
> 
> proc.time()
   user  system elapsed 
  0.647   3.219   4.140 

BufferedMatrix.Rcheck/tests/rawCalltesting.Rout


R version 4.5.1 Patched (2025-09-10 r88807) -- "Great Square Root"
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: 0x6000033f44e0>
> .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: 0x6000033f44e0>
> .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: 0x6000033f44e0>
> .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: 0x6000033f44e0>
> 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: 0x6000033e82a0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000033e82a0>
> .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: 0x6000033e82a0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000033e82a0>
> .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: 0x6000033e82a0>
> 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: 0x6000033e8480>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000033e8480>
> .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: 0x6000033e8480>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x6000033e8480>
> .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: 0x6000033e8480>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x6000033e8480>
> .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: 0x6000033e8480>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x6000033e8480>
> .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: 0x6000033e8480>
> 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: 0x6000033e8660>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x6000033e8660>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000033e8660>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000033e8660>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFilecfd71f0264c4" "BufferedMatrixFilecfd756258fc3"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFilecfd71f0264c4" "BufferedMatrixFilecfd756258fc3"
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000033e8900>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000033e8900>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x6000033e8900>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x6000033e8900>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x6000033e8900>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x6000033e8900>
> .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: 0x6000033e8ae0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000033e8ae0>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x6000033e8ae0>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x6000033e8ae0>
> 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: 0x6000033e8cc0>
> .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: 0x6000033e8cc0>
> rm(P)
> 
> proc.time()
   user  system elapsed 
  0.111   0.039   0.147 

BufferedMatrix.Rcheck/tests/Rcodetesting.Rout


R version 4.5.1 Patched (2025-09-10 r88807) -- "Great Square Root"
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.111   0.025   0.132 

Example timings