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

This page was generated on 2025-12-15 12:06 -0500 (Mon, 15 Dec 2025).

HostnameOSArch (*)R versionInstalled pkgs
nebbiolo2Linux (Ubuntu 24.04.3 LTS)x86_644.5.2 (2025-10-31) -- "[Not] Part in a Rumble" 4882
merida1macOS 12.7.6 Montereyx86_644.5.2 (2025-10-31) -- "[Not] Part in a Rumble" 4673
kjohnson1macOS 13.7.5 Venturaarm644.5.2 Patched (2025-11-04 r88984) -- "[Not] Part in a Rumble" 4607
taishanLinux (openEuler 24.03 LTS)aarch644.5.0 (2025-04-11) -- "How About a Twenty-Six" 4671
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-12-11 13:45 -0500 (Thu, 11 Dec 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
merida1macOS 12.7.6 Monterey / x86_64  OK    OK    WARNINGS    OK  UNNEEDED, same version is already published
kjohnson1macOS 13.7.5 Ventura / arm64  OK    OK    WARNINGS    OK  UNNEEDED, same version is already published
taishanLinux (openEuler 24.03 LTS) / aarch64  OK    OK    OK  


CHECK results for BufferedMatrix on merida1

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-12-12 01:38:37 -0500 (Fri, 12 Dec 2025)
EndedAt: 2025-12-12 01:39:48 -0500 (Fri, 12 Dec 2025)
EllapsedTime: 71.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.2 (2025-10-31)
* using platform: x86_64-apple-darwin20
* R was compiled by
    Apple clang version 14.0.0 (clang-1400.0.29.202)
    GNU Fortran (GCC) 14.2.0
* running under: macOS Monterey 12.7.6
* 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 14.0.0 (clang-1400.0.29.202)’
* 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-x86_64/Resources/library’
* installing *source* package ‘BufferedMatrix’ ...
** this is package ‘BufferedMatrix’ version ‘1.74.0’
** using staged installation
** libs
using C compiler: ‘Apple clang version 14.0.0 (clang-1400.0.29.202)’
using SDK: ‘MacOSX11.3.1.sdk’
clang -arch x86_64 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/opt/R/x86_64/include    -fPIC  -falign-functions=64 -Wall -g -O2  -c RBufferedMatrix.c -o RBufferedMatrix.o
clang -arch x86_64 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/opt/R/x86_64/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 x86_64 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/opt/R/x86_64/include    -fPIC  -falign-functions=64 -Wall -g -O2  -c doubleBufferedMatrix_C_tests.c -o doubleBufferedMatrix_C_tests.o
clang -arch x86_64 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/opt/R/x86_64/include    -fPIC  -falign-functions=64 -Wall -g -O2  -c init_package.c -o init_package.o
clang -arch x86_64 -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -L/Library/Frameworks/R.framework/Resources/lib -L/opt/R/x86_64/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-x86_64/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.2 (2025-10-31) -- "[Not] Part in a Rumble"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: x86_64-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.574   0.204   0.756 

BufferedMatrix.Rcheck/tests/objectTesting.Rout


R version 4.5.2 (2025-10-31) -- "[Not] Part in a Rumble"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: x86_64-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 480714 25.7    1056242 56.5         NA   634451 33.9
Vcells 890616  6.8    8388608 64.0      65536  2108808 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] "Fri Dec 12 01:39:10 2025"
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> date()
[1] "Fri Dec 12 01:39:10 2025"
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,which.col] == test.matrix[which.row,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> 
> 
> RowMode(tmp2)
<pointer: 0x600001150000>
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   which.col <- sample(1:20,1)
+   if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,5,replace=TRUE)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> date()
[1] "Fri Dec 12 01:39:16 2025"
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col <- sample(1:20,5,replace=TRUE)
+   if (!all(tmp2[which.row,which.col] == test.matrix[which.row,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> date()
[1] "Fri Dec 12 01:39:19 2025"
> 
> ColMode(tmp2)
<pointer: 0x600001150000>
> 
> 
> 
> ### Now testing assignments
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+ 
+   new.data <- rnorm(20)
+   tmp2[which.row,] <- new.data
+   test.matrix[which.row,] <- new.data
+   if (rep > 1){
+     if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+   
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   new.data <- rnorm(10)
+   tmp2[,which.col] <- new.data
+   test.matrix[,which.col]<- new.data
+ 
+   if (rep > 1){
+     if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.col <- which.col
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,5,replace=TRUE)
+   new.data <- matrix(rnorm(50),5,10)
+   tmp2[,which.col] <- new.data
+   test.matrix[,which.col]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.col <- which.col
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   new.data <- matrix(rnorm(50),5,10)
+   tmp2[which.row,] <- new.data
+   test.matrix[which.row,]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col  <- sample(1:20,5,replace=TRUE)
+   new.data <- matrix(rnorm(25),5,5)
+   tmp2[which.row,which.col] <- new.data
+   test.matrix[which.row,which.col]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[prev.row,prev.col] == test.matrix[prev.row,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+   prev.col <- which.col
+ }
> 
> 
> 
> 
> ###
> ###
> ### testing some more functions
> ###
> 
> 
> 
> ## duplication function
> tmp5 <- duplicate(tmp2)
> 
> # making sure really did copy everything.
> tmp5[1,1] <- tmp5[1,1] +100.00
> 
> if (tmp5[1,1] == tmp2[1,1]){
+   stop("Problem with duplication")
+ }
> 
> 
> 
> 
> ### testing elementwise applying of functions
> 
> tmp5[1:4,1:4]
            [,1]       [,2]        [,3]       [,4]
[1,] 99.54313459 -0.5384308 -0.62715076 -0.5718972
[2,] -1.10540426 -0.2869039 -0.17955279 -0.2723187
[3,] -0.36717491 -0.6365842  0.50102130 -0.5386739
[4,] -0.07230638  0.7945292  0.05541926 -0.7094786
> 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,] 99.54313459 0.5384308 0.62715076 0.5718972
[2,]  1.10540426 0.2869039 0.17955279 0.2723187
[3,]  0.36717491 0.6365842 0.50102130 0.5386739
[4,]  0.07230638 0.7945292 0.05541926 0.7094786
> 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,] 9.9771306 0.7337785 0.7919285 0.7562389
[2,] 1.0513821 0.5356342 0.4237367 0.5218417
[3,] 0.6059496 0.7978623 0.7078286 0.7339441
[4,] 0.2688985 0.8913637 0.2354130 0.8423055
> 
> 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,] 224.31444 32.87622 33.54644 33.13429
[2,]  36.61922 30.64325 29.41692 30.49074
[3,]  31.42667 33.61521 32.57931 32.87811
[4,]  27.76129 34.70817 27.40955 34.13253
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x60000117c300>
> exp(tmp5)
<pointer: 0x60000117c300>
> log(tmp5,2)
<pointer: 0x60000117c300>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 466.8811
> Min(tmp5)
[1] 53.70916
> mean(tmp5)
[1] 72.96512
> Sum(tmp5)
[1] 14593.02
> Var(tmp5)
[1] 859.8669
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 90.21131 70.57667 69.53158 68.08061 69.58621 70.45516 73.25521 72.26370
 [9] 70.25969 75.43108
> rowSums(tmp5)
 [1] 1804.226 1411.533 1390.632 1361.612 1391.724 1409.103 1465.104 1445.274
 [9] 1405.194 1508.622
> rowVars(tmp5)
 [1] 7906.91364   51.63604   58.15983   85.72467   84.37827   64.11930
 [7]   76.45245   84.62373   98.68768  105.30280
> rowSd(tmp5)
 [1] 88.920828  7.185822  7.626259  9.258762  9.185764  8.007453  8.743709
 [8]  9.199116  9.934168 10.261715
> rowMax(tmp5)
 [1] 466.88112  85.91310  86.79763  86.61995  85.53251  89.60265  92.83441
 [8]  84.47388  89.38214  90.35264
> rowMin(tmp5)
 [1] 57.55651 60.04450 54.56885 56.24526 53.81978 59.54636 63.24996 57.61913
 [9] 53.70916 58.96955
> 
> colMeans(tmp5)
 [1] 113.63404  72.97707  65.58329  71.43793  74.45170  72.93953  66.52942
 [8]  70.92396  69.11527  70.85276  71.13619  70.35144  76.30302  73.27855
[15]  68.36039  72.83278  67.88065  73.75929  65.95636  70.99882
> colSums(tmp5)
 [1] 1136.3404  729.7707  655.8329  714.3793  744.5170  729.3953  665.2942
 [8]  709.2396  691.1527  708.5276  711.3619  703.5144  763.0302  732.7855
[15]  683.6039  728.3278  678.8065  737.5929  659.5636  709.9882
> colVars(tmp5)
 [1] 15492.78771    64.65130    40.86982    16.41487   158.50991    38.23756
 [7]    35.38821    75.71539    83.34895    34.29062    74.55877    58.14761
[13]    88.71212    58.51938    96.35086    98.49458   103.97264   117.97730
[19]   105.91623    58.66750
> colSd(tmp5)
 [1] 124.470027   8.040603   6.392951   4.051526  12.590072   6.183652
 [7]   5.948799   8.701459   9.129564   5.855819   8.634742   7.625458
[13]   9.418711   7.649796   9.815847   9.924444  10.196698  10.861735
[19]  10.291561   7.659471
> colMax(tmp5)
 [1] 466.88112  87.93001  78.77212  76.43935  89.42076  84.85980  73.66074
 [8]  85.53251  90.35264  79.38450  81.53711  82.36814  87.91225  85.70105
[15]  89.38214  92.83441  80.59191  87.55536  89.60265  82.06178
> colMin(tmp5)
 [1] 57.78149 62.05014 57.04938 63.46247 54.76101 63.65812 54.09239 59.81191
 [9] 56.24526 63.24996 58.90901 60.11638 58.16902 63.69592 56.77448 60.29286
[17] 53.81978 58.96955 53.70916 60.78161
> 
> 
> ### setting a random element to NA and then testing with na.rm=TRUE or na.rm=FALSE (The default)
> 
> 
> which.row <- sample(1:10,1,replace=TRUE)
> which.col  <- sample(1:20,1,replace=TRUE)
> 
> tmp5[which.row,which.col] <- NA
> 
> Max(tmp5)
[1] NA
> Min(tmp5)
[1] NA
> mean(tmp5)
[1] NA
> Sum(tmp5)
[1] NA
> Var(tmp5)
[1] NA
> 
> rowMeans(tmp5)
 [1] 90.21131 70.57667 69.53158 68.08061 69.58621 70.45516       NA 72.26370
 [9] 70.25969 75.43108
> rowSums(tmp5)
 [1] 1804.226 1411.533 1390.632 1361.612 1391.724 1409.103       NA 1445.274
 [9] 1405.194 1508.622
> rowVars(tmp5)
 [1] 7906.91364   51.63604   58.15983   85.72467   84.37827   64.11930
 [7]   80.68666   84.62373   98.68768  105.30280
> rowSd(tmp5)
 [1] 88.920828  7.185822  7.626259  9.258762  9.185764  8.007453  8.982575
 [8]  9.199116  9.934168 10.261715
> rowMax(tmp5)
 [1] 466.88112  85.91310  86.79763  86.61995  85.53251  89.60265        NA
 [8]  84.47388  89.38214  90.35264
> rowMin(tmp5)
 [1] 57.55651 60.04450 54.56885 56.24526 53.81978 59.54636       NA 57.61913
 [9] 53.70916 58.96955
> 
> colMeans(tmp5)
 [1] 113.63404        NA  65.58329  71.43793  74.45170  72.93953  66.52942
 [8]  70.92396  69.11527  70.85276  71.13619  70.35144  76.30302  73.27855
[15]  68.36039  72.83278  67.88065  73.75929  65.95636  70.99882
> colSums(tmp5)
 [1] 1136.3404        NA  655.8329  714.3793  744.5170  729.3953  665.2942
 [8]  709.2396  691.1527  708.5276  711.3619  703.5144  763.0302  732.7855
[15]  683.6039  728.3278  678.8065  737.5929  659.5636  709.9882
> colVars(tmp5)
 [1] 15492.78771          NA    40.86982    16.41487   158.50991    38.23756
 [7]    35.38821    75.71539    83.34895    34.29062    74.55877    58.14761
[13]    88.71212    58.51938    96.35086    98.49458   103.97264   117.97730
[19]   105.91623    58.66750
> colSd(tmp5)
 [1] 124.470027         NA   6.392951   4.051526  12.590072   6.183652
 [7]   5.948799   8.701459   9.129564   5.855819   8.634742   7.625458
[13]   9.418711   7.649796   9.815847   9.924444  10.196698  10.861735
[19]  10.291561   7.659471
> colMax(tmp5)
 [1] 466.88112        NA  78.77212  76.43935  89.42076  84.85980  73.66074
 [8]  85.53251  90.35264  79.38450  81.53711  82.36814  87.91225  85.70105
[15]  89.38214  92.83441  80.59191  87.55536  89.60265  82.06178
> colMin(tmp5)
 [1] 57.78149       NA 57.04938 63.46247 54.76101 63.65812 54.09239 59.81191
 [9] 56.24526 63.24996 58.90901 60.11638 58.16902 63.69592 56.77448 60.29286
[17] 53.81978 58.96955 53.70916 60.78161
> 
> Max(tmp5,na.rm=TRUE)
[1] 466.8811
> Min(tmp5,na.rm=TRUE)
[1] 53.70916
> mean(tmp5,na.rm=TRUE)
[1] 72.96605
> Sum(tmp5,na.rm=TRUE)
[1] 14520.24
> Var(tmp5,na.rm=TRUE)
[1] 864.2094
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 90.21131 70.57667 69.53158 68.08061 69.58621 70.45516 73.28017 72.26370
 [9] 70.25969 75.43108
> rowSums(tmp5,na.rm=TRUE)
 [1] 1804.226 1411.533 1390.632 1361.612 1391.724 1409.103 1392.323 1445.274
 [9] 1405.194 1508.622
> rowVars(tmp5,na.rm=TRUE)
 [1] 7906.91364   51.63604   58.15983   85.72467   84.37827   64.11930
 [7]   80.68666   84.62373   98.68768  105.30280
> rowSd(tmp5,na.rm=TRUE)
 [1] 88.920828  7.185822  7.626259  9.258762  9.185764  8.007453  8.982575
 [8]  9.199116  9.934168 10.261715
> rowMax(tmp5,na.rm=TRUE)
 [1] 466.88112  85.91310  86.79763  86.61995  85.53251  89.60265  92.83441
 [8]  84.47388  89.38214  90.35264
> rowMin(tmp5,na.rm=TRUE)
 [1] 57.55651 60.04450 54.56885 56.24526 53.81978 59.54636 63.24996 57.61913
 [9] 53.70916 58.96955
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 113.63404  72.99886  65.58329  71.43793  74.45170  72.93953  66.52942
 [8]  70.92396  69.11527  70.85276  71.13619  70.35144  76.30302  73.27855
[15]  68.36039  72.83278  67.88065  73.75929  65.95636  70.99882
> colSums(tmp5,na.rm=TRUE)
 [1] 1136.3404  656.9897  655.8329  714.3793  744.5170  729.3953  665.2942
 [8]  709.2396  691.1527  708.5276  711.3619  703.5144  763.0302  732.7855
[15]  683.6039  728.3278  678.8065  737.5929  659.5636  709.9882
> colVars(tmp5,na.rm=TRUE)
 [1] 15492.78771    72.72737    40.86982    16.41487   158.50991    38.23756
 [7]    35.38821    75.71539    83.34895    34.29062    74.55877    58.14761
[13]    88.71212    58.51938    96.35086    98.49458   103.97264   117.97730
[19]   105.91623    58.66750
> colSd(tmp5,na.rm=TRUE)
 [1] 124.470027   8.528034   6.392951   4.051526  12.590072   6.183652
 [7]   5.948799   8.701459   9.129564   5.855819   8.634742   7.625458
[13]   9.418711   7.649796   9.815847   9.924444  10.196698  10.861735
[19]  10.291561   7.659471
> colMax(tmp5,na.rm=TRUE)
 [1] 466.88112  87.93001  78.77212  76.43935  89.42076  84.85980  73.66074
 [8]  85.53251  90.35264  79.38450  81.53711  82.36814  87.91225  85.70105
[15]  89.38214  92.83441  80.59191  87.55536  89.60265  82.06178
> colMin(tmp5,na.rm=TRUE)
 [1] 57.78149 62.05014 57.04938 63.46247 54.76101 63.65812 54.09239 59.81191
 [9] 56.24526 63.24996 58.90901 60.11638 58.16902 63.69592 56.77448 60.29286
[17] 53.81978 58.96955 53.70916 60.78161
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1] 90.21131 70.57667 69.53158 68.08061 69.58621 70.45516      NaN 72.26370
 [9] 70.25969 75.43108
> rowSums(tmp5,na.rm=TRUE)
 [1] 1804.226 1411.533 1390.632 1361.612 1391.724 1409.103    0.000 1445.274
 [9] 1405.194 1508.622
> rowVars(tmp5,na.rm=TRUE)
 [1] 7906.91364   51.63604   58.15983   85.72467   84.37827   64.11930
 [7]         NA   84.62373   98.68768  105.30280
> rowSd(tmp5,na.rm=TRUE)
 [1] 88.920828  7.185822  7.626259  9.258762  9.185764  8.007453        NA
 [8]  9.199116  9.934168 10.261715
> rowMax(tmp5,na.rm=TRUE)
 [1] 466.88112  85.91310  86.79763  86.61995  85.53251  89.60265        NA
 [8]  84.47388  89.38214  90.35264
> rowMin(tmp5,na.rm=TRUE)
 [1] 57.55651 60.04450 54.56885 56.24526 53.81978 59.54636       NA 57.61913
 [9] 53.70916 58.96955
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1] 116.88059       NaN  64.99507  71.06152  75.37240  71.61505  66.79045
 [8]  70.24001  68.87832  71.69752  70.85481  69.81056  77.44441  74.34329
[15]  68.71245  70.61038  68.30472  72.49013  65.78769  69.76961
> colSums(tmp5,na.rm=TRUE)
 [1] 1051.9253    0.0000  584.9556  639.5537  678.3516  644.5355  601.1140
 [8]  632.1601  619.9049  645.2776  637.6933  628.2950  696.9997  669.0896
[15]  618.4121  635.4934  614.7425  652.4111  592.0892  627.9265
> colVars(tmp5,na.rm=TRUE)
 [1] 17310.80996          NA    42.08600    16.87284   168.78714    23.28213
 [7]    39.04520    79.91721    93.13593    30.54881    82.98789    62.12486
[13]    85.14512    53.08058   107.00031    55.24178   114.94606   114.60331
[19]   118.83568    49.00247
> colSd(tmp5,na.rm=TRUE)
 [1] 131.570551         NA   6.487373   4.107657  12.991811   4.825156
 [7]   6.248616   8.939642   9.650696   5.527098   9.109769   7.881932
[13]   9.227411   7.285642  10.344095   7.432481  10.721290  10.705293
[19]  10.901178   7.000177
> colMax(tmp5,na.rm=TRUE)
 [1] 466.88112      -Inf  78.77212  76.43935  89.42076  80.06832  73.66074
 [8]  85.53251  90.35264  79.38450  81.53711  82.36814  87.91225  85.70105
[15]  89.38214  84.25110  80.59191  87.55536  89.60265  81.35614
> colMin(tmp5,na.rm=TRUE)
 [1] 57.78149      Inf 57.04938 63.46247 54.76101 63.65812 54.09239 59.81191
 [9] 56.24526 64.14666 58.90901 60.11638 58.16902 63.71760 56.77448 60.29286
[17] 53.81978 58.96955 53.70916 60.78161
> 
> 
> 
> 
> copymatrix <- matrix(rnorm(200,150,15),10,20)
> 
> tmp5[1:10,1:20] <- copymatrix
> which.row <- 3
> which.col  <- 1
> cat(which.row," ",which.col,"\n")
3   1 
> tmp5[which.row,which.col] <- NA
> copymatrix[which.row,which.col] <- NA
> 
> rowVars(tmp5,na.rm=TRUE)
 [1] 295.4286 221.6697 164.4959 261.0815 255.8511 135.8989 193.9538 336.6189
 [9] 128.8698 298.8430
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 295.4286 221.6697 164.4959 261.0815 255.8511 135.8989 193.9538 336.6189
 [9] 128.8698 298.8430
> 
> 
> 
> 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]  0.000000e+00 -2.842171e-14  5.684342e-14  1.136868e-13 -5.684342e-14
 [6] -5.684342e-14  0.000000e+00  2.842171e-14 -5.684342e-14  1.136868e-13
[11] -5.684342e-14 -1.705303e-13  7.105427e-14  1.705303e-13  1.989520e-13
[16]  0.000000e+00 -1.136868e-13 -2.842171e-14  0.000000e+00 -8.526513e-14
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> ## making sure these things agree
> ##
> ## first when there is no NA
> 
> 
> 
> agree.checks <- function(buff.matrix,r.matrix,err.tol=1e-10){
+ 
+   if (Max(buff.matrix,na.rm=TRUE) != max(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Max")
+   }
+   
+ 
+   if (Min(buff.matrix,na.rm=TRUE) != min(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Min")
+   }
+ 
+ 
+   if (abs(Sum(buff.matrix,na.rm=TRUE)- sum(r.matrix,na.rm=TRUE)) > err.tol){
+ 
+     cat(Sum(buff.matrix,na.rm=TRUE),"\n")
+     cat(sum(r.matrix,na.rm=TRUE),"\n")
+     cat(Sum(buff.matrix,na.rm=TRUE) - sum(r.matrix,na.rm=TRUE),"\n")
+     
+     stop("No agreement in Sum")
+   }
+   
+   if (abs(mean(buff.matrix,na.rm=TRUE) - mean(r.matrix,na.rm=TRUE)) > err.tol){
+     stop("No agreement in mean")
+   }
+   
+   
+   if(abs(Var(buff.matrix,na.rm=TRUE) - var(as.vector(r.matrix),na.rm=TRUE)) > err.tol){
+     stop("No agreement in Var")
+   }
+   
+   
+ 
+   if(any(abs(rowMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,mean,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowMeans")
+   }
+   
+   
+   if(any(abs(colMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,mean,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colMeans")
+   }
+   
+   
+   if(any(abs(rowSums(buff.matrix,na.rm=TRUE)  -  apply(r.matrix,1,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in rowSums")
+   }
+   
+   
+   if(any(abs(colSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colSums")
+   }
+   
+   ### this is to get around the fact that R doesn't like to compute NA on an entire vector of NA when 
+   ### computing variance
+   my.Var <- function(x,na.rm=FALSE){
+    if (all(is.na(x))){
+      return(NA)
+    } else {
+      var(x,na.rm=na.rm)
+    }
+ 
+   }
+   
+   if(any(abs(rowVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+   
+   
+   if(any(abs(colVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+ 
+ 
+   if(any(abs(rowMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+ 
+   if(any(abs(colMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+   
+   
+   if(any(abs(rowMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+   
+ 
+   if(any(abs(colMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+ 
+   if(any(abs(colMedians(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,median,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMedian")
+   }
+ 
+   if(any(abs(colRanges(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,range,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colRanges")
+   }
+ 
+ 
+   
+ }
> 
> 
> 
> 
> 
> 
> 
> 
> 
> for (rep in 1:20){
+   copymatrix <- matrix(rnorm(200,150,15),10,20)
+   
+   tmp5[1:10,1:20] <- copymatrix
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ## now lets assign some NA values and check agreement
+ 
+   which.row <- sample(1:10,1,replace=TRUE)
+   which.col  <- sample(1:20,1,replace=TRUE)
+   
+   cat(which.row," ",which.col,"\n")
+   
+   tmp5[which.row,which.col] <- NA
+   copymatrix[which.row,which.col] <- NA
+   
+   agree.checks(tmp5,copymatrix)
+ 
+   ## make an entire row NA
+   tmp5[which.row,] <- NA
+   copymatrix[which.row,] <- NA
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ### also make an entire col NA
+   tmp5[,which.col] <- NA
+   copymatrix[,which.col] <- NA
+ 
+   agree.checks(tmp5,copymatrix)
+ 
+   ### now make 1 element non NA with NA in the rest of row and column
+ 
+   tmp5[which.row,which.col] <- rnorm(1,150,15)
+   copymatrix[which.row,which.col] <- tmp5[which.row,which.col]
+ 
+   agree.checks(tmp5,copymatrix)
+ }
9   7 
7   1 
7   11 
9   4 
1   14 
8   1 
4   7 
8   10 
8   16 
3   16 
5   14 
8   6 
3   19 
10   10 
4   9 
1   16 
2   2 
2   14 
2   3 
5   10 
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.170585
> Min(tmp)
[1] -3.096631
> mean(tmp)
[1] -0.06412957
> Sum(tmp)
[1] -6.412957
> Var(tmp)
[1] 0.9007241
> 
> rowMeans(tmp)
[1] -0.06412957
> rowSums(tmp)
[1] -6.412957
> rowVars(tmp)
[1] 0.9007241
> rowSd(tmp)
[1] 0.9490649
> rowMax(tmp)
[1] 2.170585
> rowMin(tmp)
[1] -3.096631
> 
> colMeans(tmp)
  [1]  0.851350084 -0.773175184 -0.108030754 -1.072125545 -0.217147106
  [6] -0.338227523  0.045526316  0.520868113 -0.621087197  1.216738073
 [11] -0.624136709 -1.931659782 -0.152033105  1.088060538 -0.557526838
 [16]  0.462599206 -0.864774103  0.569924701  0.815422371 -0.498574347
 [21] -1.088355934 -0.516278293 -0.934673558  0.255451783 -0.126561583
 [26]  0.417683319  0.564104508 -2.072834116  2.170584543 -0.605934436
 [31]  0.014671428  0.038540591  1.559083934  1.131377865 -1.268990963
 [36]  0.462967702  0.255759941  0.463443965  0.843213391  1.553618799
 [41]  0.003553243  0.806734275 -0.987036398 -0.914287019  0.297150227
 [46]  0.505752002  0.437672451 -1.002250194  0.658009992  0.589209624
 [51] -0.889733436 -0.881745812  0.174588034  0.902053324 -0.440620257
 [56]  1.181747959 -1.871978895 -0.091613005 -1.170595387  1.425490489
 [61] -0.272205554  0.956614589 -0.083143782  0.292294916 -0.101023623
 [66]  0.392667576  0.284997887  0.729099855 -2.303189621 -0.364678490
 [71] -0.183037294  0.649054046 -0.855007404  1.160906312 -0.217829574
 [76] -0.261283902 -1.293169963  0.345335375 -3.096631306 -0.208455880
 [81] -1.330079018  0.721088885  0.946449008  0.289274911 -0.231409209
 [86]  0.979114951 -0.122853417 -2.067661148  1.229704213  0.812897694
 [91] -0.515075319  0.357131130  0.064509801  1.323285241 -0.904727015
 [96] -1.599904937 -0.760889699 -0.512549510 -1.030377169  0.706834083
> colSums(tmp)
  [1]  0.851350084 -0.773175184 -0.108030754 -1.072125545 -0.217147106
  [6] -0.338227523  0.045526316  0.520868113 -0.621087197  1.216738073
 [11] -0.624136709 -1.931659782 -0.152033105  1.088060538 -0.557526838
 [16]  0.462599206 -0.864774103  0.569924701  0.815422371 -0.498574347
 [21] -1.088355934 -0.516278293 -0.934673558  0.255451783 -0.126561583
 [26]  0.417683319  0.564104508 -2.072834116  2.170584543 -0.605934436
 [31]  0.014671428  0.038540591  1.559083934  1.131377865 -1.268990963
 [36]  0.462967702  0.255759941  0.463443965  0.843213391  1.553618799
 [41]  0.003553243  0.806734275 -0.987036398 -0.914287019  0.297150227
 [46]  0.505752002  0.437672451 -1.002250194  0.658009992  0.589209624
 [51] -0.889733436 -0.881745812  0.174588034  0.902053324 -0.440620257
 [56]  1.181747959 -1.871978895 -0.091613005 -1.170595387  1.425490489
 [61] -0.272205554  0.956614589 -0.083143782  0.292294916 -0.101023623
 [66]  0.392667576  0.284997887  0.729099855 -2.303189621 -0.364678490
 [71] -0.183037294  0.649054046 -0.855007404  1.160906312 -0.217829574
 [76] -0.261283902 -1.293169963  0.345335375 -3.096631306 -0.208455880
 [81] -1.330079018  0.721088885  0.946449008  0.289274911 -0.231409209
 [86]  0.979114951 -0.122853417 -2.067661148  1.229704213  0.812897694
 [91] -0.515075319  0.357131130  0.064509801  1.323285241 -0.904727015
 [96] -1.599904937 -0.760889699 -0.512549510 -1.030377169  0.706834083
> 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.851350084 -0.773175184 -0.108030754 -1.072125545 -0.217147106
  [6] -0.338227523  0.045526316  0.520868113 -0.621087197  1.216738073
 [11] -0.624136709 -1.931659782 -0.152033105  1.088060538 -0.557526838
 [16]  0.462599206 -0.864774103  0.569924701  0.815422371 -0.498574347
 [21] -1.088355934 -0.516278293 -0.934673558  0.255451783 -0.126561583
 [26]  0.417683319  0.564104508 -2.072834116  2.170584543 -0.605934436
 [31]  0.014671428  0.038540591  1.559083934  1.131377865 -1.268990963
 [36]  0.462967702  0.255759941  0.463443965  0.843213391  1.553618799
 [41]  0.003553243  0.806734275 -0.987036398 -0.914287019  0.297150227
 [46]  0.505752002  0.437672451 -1.002250194  0.658009992  0.589209624
 [51] -0.889733436 -0.881745812  0.174588034  0.902053324 -0.440620257
 [56]  1.181747959 -1.871978895 -0.091613005 -1.170595387  1.425490489
 [61] -0.272205554  0.956614589 -0.083143782  0.292294916 -0.101023623
 [66]  0.392667576  0.284997887  0.729099855 -2.303189621 -0.364678490
 [71] -0.183037294  0.649054046 -0.855007404  1.160906312 -0.217829574
 [76] -0.261283902 -1.293169963  0.345335375 -3.096631306 -0.208455880
 [81] -1.330079018  0.721088885  0.946449008  0.289274911 -0.231409209
 [86]  0.979114951 -0.122853417 -2.067661148  1.229704213  0.812897694
 [91] -0.515075319  0.357131130  0.064509801  1.323285241 -0.904727015
 [96] -1.599904937 -0.760889699 -0.512549510 -1.030377169  0.706834083
> colMin(tmp)
  [1]  0.851350084 -0.773175184 -0.108030754 -1.072125545 -0.217147106
  [6] -0.338227523  0.045526316  0.520868113 -0.621087197  1.216738073
 [11] -0.624136709 -1.931659782 -0.152033105  1.088060538 -0.557526838
 [16]  0.462599206 -0.864774103  0.569924701  0.815422371 -0.498574347
 [21] -1.088355934 -0.516278293 -0.934673558  0.255451783 -0.126561583
 [26]  0.417683319  0.564104508 -2.072834116  2.170584543 -0.605934436
 [31]  0.014671428  0.038540591  1.559083934  1.131377865 -1.268990963
 [36]  0.462967702  0.255759941  0.463443965  0.843213391  1.553618799
 [41]  0.003553243  0.806734275 -0.987036398 -0.914287019  0.297150227
 [46]  0.505752002  0.437672451 -1.002250194  0.658009992  0.589209624
 [51] -0.889733436 -0.881745812  0.174588034  0.902053324 -0.440620257
 [56]  1.181747959 -1.871978895 -0.091613005 -1.170595387  1.425490489
 [61] -0.272205554  0.956614589 -0.083143782  0.292294916 -0.101023623
 [66]  0.392667576  0.284997887  0.729099855 -2.303189621 -0.364678490
 [71] -0.183037294  0.649054046 -0.855007404  1.160906312 -0.217829574
 [76] -0.261283902 -1.293169963  0.345335375 -3.096631306 -0.208455880
 [81] -1.330079018  0.721088885  0.946449008  0.289274911 -0.231409209
 [86]  0.979114951 -0.122853417 -2.067661148  1.229704213  0.812897694
 [91] -0.515075319  0.357131130  0.064509801  1.323285241 -0.904727015
 [96] -1.599904937 -0.760889699 -0.512549510 -1.030377169  0.706834083
> colMedians(tmp)
  [1]  0.851350084 -0.773175184 -0.108030754 -1.072125545 -0.217147106
  [6] -0.338227523  0.045526316  0.520868113 -0.621087197  1.216738073
 [11] -0.624136709 -1.931659782 -0.152033105  1.088060538 -0.557526838
 [16]  0.462599206 -0.864774103  0.569924701  0.815422371 -0.498574347
 [21] -1.088355934 -0.516278293 -0.934673558  0.255451783 -0.126561583
 [26]  0.417683319  0.564104508 -2.072834116  2.170584543 -0.605934436
 [31]  0.014671428  0.038540591  1.559083934  1.131377865 -1.268990963
 [36]  0.462967702  0.255759941  0.463443965  0.843213391  1.553618799
 [41]  0.003553243  0.806734275 -0.987036398 -0.914287019  0.297150227
 [46]  0.505752002  0.437672451 -1.002250194  0.658009992  0.589209624
 [51] -0.889733436 -0.881745812  0.174588034  0.902053324 -0.440620257
 [56]  1.181747959 -1.871978895 -0.091613005 -1.170595387  1.425490489
 [61] -0.272205554  0.956614589 -0.083143782  0.292294916 -0.101023623
 [66]  0.392667576  0.284997887  0.729099855 -2.303189621 -0.364678490
 [71] -0.183037294  0.649054046 -0.855007404  1.160906312 -0.217829574
 [76] -0.261283902 -1.293169963  0.345335375 -3.096631306 -0.208455880
 [81] -1.330079018  0.721088885  0.946449008  0.289274911 -0.231409209
 [86]  0.979114951 -0.122853417 -2.067661148  1.229704213  0.812897694
 [91] -0.515075319  0.357131130  0.064509801  1.323285241 -0.904727015
 [96] -1.599904937 -0.760889699 -0.512549510 -1.030377169  0.706834083
> colRanges(tmp)
          [,1]       [,2]       [,3]      [,4]       [,5]       [,6]       [,7]
[1,] 0.8513501 -0.7731752 -0.1080308 -1.072126 -0.2171471 -0.3382275 0.04552632
[2,] 0.8513501 -0.7731752 -0.1080308 -1.072126 -0.2171471 -0.3382275 0.04552632
          [,8]       [,9]    [,10]      [,11]    [,12]      [,13]    [,14]
[1,] 0.5208681 -0.6210872 1.216738 -0.6241367 -1.93166 -0.1520331 1.088061
[2,] 0.5208681 -0.6210872 1.216738 -0.6241367 -1.93166 -0.1520331 1.088061
          [,15]     [,16]      [,17]     [,18]     [,19]      [,20]     [,21]
[1,] -0.5575268 0.4625992 -0.8647741 0.5699247 0.8154224 -0.4985743 -1.088356
[2,] -0.5575268 0.4625992 -0.8647741 0.5699247 0.8154224 -0.4985743 -1.088356
          [,22]      [,23]     [,24]      [,25]     [,26]     [,27]     [,28]
[1,] -0.5162783 -0.9346736 0.2554518 -0.1265616 0.4176833 0.5641045 -2.072834
[2,] -0.5162783 -0.9346736 0.2554518 -0.1265616 0.4176833 0.5641045 -2.072834
        [,29]      [,30]      [,31]      [,32]    [,33]    [,34]     [,35]
[1,] 2.170585 -0.6059344 0.01467143 0.03854059 1.559084 1.131378 -1.268991
[2,] 2.170585 -0.6059344 0.01467143 0.03854059 1.559084 1.131378 -1.268991
         [,36]     [,37]    [,38]     [,39]    [,40]       [,41]     [,42]
[1,] 0.4629677 0.2557599 0.463444 0.8432134 1.553619 0.003553243 0.8067343
[2,] 0.4629677 0.2557599 0.463444 0.8432134 1.553619 0.003553243 0.8067343
          [,43]     [,44]     [,45]    [,46]     [,47]    [,48]   [,49]
[1,] -0.9870364 -0.914287 0.2971502 0.505752 0.4376725 -1.00225 0.65801
[2,] -0.9870364 -0.914287 0.2971502 0.505752 0.4376725 -1.00225 0.65801
         [,50]      [,51]      [,52]    [,53]     [,54]      [,55]    [,56]
[1,] 0.5892096 -0.8897334 -0.8817458 0.174588 0.9020533 -0.4406203 1.181748
[2,] 0.5892096 -0.8897334 -0.8817458 0.174588 0.9020533 -0.4406203 1.181748
         [,57]       [,58]     [,59]   [,60]      [,61]     [,62]       [,63]
[1,] -1.871979 -0.09161301 -1.170595 1.42549 -0.2722056 0.9566146 -0.08314378
[2,] -1.871979 -0.09161301 -1.170595 1.42549 -0.2722056 0.9566146 -0.08314378
         [,64]      [,65]     [,66]     [,67]     [,68]    [,69]      [,70]
[1,] 0.2922949 -0.1010236 0.3926676 0.2849979 0.7290999 -2.30319 -0.3646785
[2,] 0.2922949 -0.1010236 0.3926676 0.2849979 0.7290999 -2.30319 -0.3646785
          [,71]    [,72]      [,73]    [,74]      [,75]      [,76]    [,77]
[1,] -0.1830373 0.649054 -0.8550074 1.160906 -0.2178296 -0.2612839 -1.29317
[2,] -0.1830373 0.649054 -0.8550074 1.160906 -0.2178296 -0.2612839 -1.29317
         [,78]     [,79]      [,80]     [,81]     [,82]    [,83]     [,84]
[1,] 0.3453354 -3.096631 -0.2084559 -1.330079 0.7210889 0.946449 0.2892749
[2,] 0.3453354 -3.096631 -0.2084559 -1.330079 0.7210889 0.946449 0.2892749
          [,85]    [,86]      [,87]     [,88]    [,89]     [,90]      [,91]
[1,] -0.2314092 0.979115 -0.1228534 -2.067661 1.229704 0.8128977 -0.5150753
[2,] -0.2314092 0.979115 -0.1228534 -2.067661 1.229704 0.8128977 -0.5150753
         [,92]     [,93]    [,94]     [,95]     [,96]      [,97]      [,98]
[1,] 0.3571311 0.0645098 1.323285 -0.904727 -1.599905 -0.7608897 -0.5125495
[2,] 0.3571311 0.0645098 1.323285 -0.904727 -1.599905 -0.7608897 -0.5125495
         [,99]    [,100]
[1,] -1.030377 0.7068341
[2,] -1.030377 0.7068341
> 
> 
> Max(tmp2)
[1] 2.55467
> Min(tmp2)
[1] -2.581776
> mean(tmp2)
[1] 0.116176
> Sum(tmp2)
[1] 11.6176
> Var(tmp2)
[1] 1.251632
> 
> rowMeans(tmp2)
  [1]  0.748543383  1.956874591  0.458280287  2.554670363  0.319285429
  [6] -0.248208889  0.809548252  1.811003526  0.056573923 -0.072694524
 [11] -1.429683893 -1.039500141  1.657312441 -1.521379071 -0.776304618
 [16] -0.488322563 -0.999625237 -0.906260149  1.550044611  1.055710341
 [21] -1.003753920 -1.131384855  0.275795847 -1.023532198  0.217154036
 [26] -0.194927309  0.100429151  1.921788194 -0.925014929  0.205478999
 [31] -2.540996564  0.206746086 -0.822011401  1.748433650  0.944064270
 [36] -1.102957707  0.278160953  0.986426668  1.647813819  0.028851496
 [41]  0.240130811  0.689121286 -0.023279126 -2.315003857 -0.951630926
 [46]  0.382796380 -1.676406462  0.056938087  1.977967216  0.408103842
 [51]  1.085226319  0.015369938 -0.826759077 -0.113518230  1.730119277
 [56]  0.616691946  0.484458750  0.085640698 -0.150391680  1.019263336
 [61]  1.225428572  0.312636098 -1.156878738  0.370803602  0.784124001
 [66] -1.223855815 -0.216763454  2.211755470  0.727396230 -1.852511848
 [71]  1.031376932 -1.080476735  0.990073496 -1.464450586  0.586319600
 [76] -0.155819780  1.572770751 -0.496797528  0.100659687 -0.673488616
 [81]  0.001739746 -2.581776286 -0.753072831  2.140629775  0.304341160
 [86]  0.291149404 -0.130852692 -0.510454099 -1.839112371  1.627056491
 [91] -1.240197050  0.176984632  0.349141776  0.014825789  1.942442735
 [96] -0.454293899  1.031977959  0.038113896  1.735045394 -0.165660399
> rowSums(tmp2)
  [1]  0.748543383  1.956874591  0.458280287  2.554670363  0.319285429
  [6] -0.248208889  0.809548252  1.811003526  0.056573923 -0.072694524
 [11] -1.429683893 -1.039500141  1.657312441 -1.521379071 -0.776304618
 [16] -0.488322563 -0.999625237 -0.906260149  1.550044611  1.055710341
 [21] -1.003753920 -1.131384855  0.275795847 -1.023532198  0.217154036
 [26] -0.194927309  0.100429151  1.921788194 -0.925014929  0.205478999
 [31] -2.540996564  0.206746086 -0.822011401  1.748433650  0.944064270
 [36] -1.102957707  0.278160953  0.986426668  1.647813819  0.028851496
 [41]  0.240130811  0.689121286 -0.023279126 -2.315003857 -0.951630926
 [46]  0.382796380 -1.676406462  0.056938087  1.977967216  0.408103842
 [51]  1.085226319  0.015369938 -0.826759077 -0.113518230  1.730119277
 [56]  0.616691946  0.484458750  0.085640698 -0.150391680  1.019263336
 [61]  1.225428572  0.312636098 -1.156878738  0.370803602  0.784124001
 [66] -1.223855815 -0.216763454  2.211755470  0.727396230 -1.852511848
 [71]  1.031376932 -1.080476735  0.990073496 -1.464450586  0.586319600
 [76] -0.155819780  1.572770751 -0.496797528  0.100659687 -0.673488616
 [81]  0.001739746 -2.581776286 -0.753072831  2.140629775  0.304341160
 [86]  0.291149404 -0.130852692 -0.510454099 -1.839112371  1.627056491
 [91] -1.240197050  0.176984632  0.349141776  0.014825789  1.942442735
 [96] -0.454293899  1.031977959  0.038113896  1.735045394 -0.165660399
> 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.748543383  1.956874591  0.458280287  2.554670363  0.319285429
  [6] -0.248208889  0.809548252  1.811003526  0.056573923 -0.072694524
 [11] -1.429683893 -1.039500141  1.657312441 -1.521379071 -0.776304618
 [16] -0.488322563 -0.999625237 -0.906260149  1.550044611  1.055710341
 [21] -1.003753920 -1.131384855  0.275795847 -1.023532198  0.217154036
 [26] -0.194927309  0.100429151  1.921788194 -0.925014929  0.205478999
 [31] -2.540996564  0.206746086 -0.822011401  1.748433650  0.944064270
 [36] -1.102957707  0.278160953  0.986426668  1.647813819  0.028851496
 [41]  0.240130811  0.689121286 -0.023279126 -2.315003857 -0.951630926
 [46]  0.382796380 -1.676406462  0.056938087  1.977967216  0.408103842
 [51]  1.085226319  0.015369938 -0.826759077 -0.113518230  1.730119277
 [56]  0.616691946  0.484458750  0.085640698 -0.150391680  1.019263336
 [61]  1.225428572  0.312636098 -1.156878738  0.370803602  0.784124001
 [66] -1.223855815 -0.216763454  2.211755470  0.727396230 -1.852511848
 [71]  1.031376932 -1.080476735  0.990073496 -1.464450586  0.586319600
 [76] -0.155819780  1.572770751 -0.496797528  0.100659687 -0.673488616
 [81]  0.001739746 -2.581776286 -0.753072831  2.140629775  0.304341160
 [86]  0.291149404 -0.130852692 -0.510454099 -1.839112371  1.627056491
 [91] -1.240197050  0.176984632  0.349141776  0.014825789  1.942442735
 [96] -0.454293899  1.031977959  0.038113896  1.735045394 -0.165660399
> rowMin(tmp2)
  [1]  0.748543383  1.956874591  0.458280287  2.554670363  0.319285429
  [6] -0.248208889  0.809548252  1.811003526  0.056573923 -0.072694524
 [11] -1.429683893 -1.039500141  1.657312441 -1.521379071 -0.776304618
 [16] -0.488322563 -0.999625237 -0.906260149  1.550044611  1.055710341
 [21] -1.003753920 -1.131384855  0.275795847 -1.023532198  0.217154036
 [26] -0.194927309  0.100429151  1.921788194 -0.925014929  0.205478999
 [31] -2.540996564  0.206746086 -0.822011401  1.748433650  0.944064270
 [36] -1.102957707  0.278160953  0.986426668  1.647813819  0.028851496
 [41]  0.240130811  0.689121286 -0.023279126 -2.315003857 -0.951630926
 [46]  0.382796380 -1.676406462  0.056938087  1.977967216  0.408103842
 [51]  1.085226319  0.015369938 -0.826759077 -0.113518230  1.730119277
 [56]  0.616691946  0.484458750  0.085640698 -0.150391680  1.019263336
 [61]  1.225428572  0.312636098 -1.156878738  0.370803602  0.784124001
 [66] -1.223855815 -0.216763454  2.211755470  0.727396230 -1.852511848
 [71]  1.031376932 -1.080476735  0.990073496 -1.464450586  0.586319600
 [76] -0.155819780  1.572770751 -0.496797528  0.100659687 -0.673488616
 [81]  0.001739746 -2.581776286 -0.753072831  2.140629775  0.304341160
 [86]  0.291149404 -0.130852692 -0.510454099 -1.839112371  1.627056491
 [91] -1.240197050  0.176984632  0.349141776  0.014825789  1.942442735
 [96] -0.454293899  1.031977959  0.038113896  1.735045394 -0.165660399
> 
> colMeans(tmp2)
[1] 0.116176
> colSums(tmp2)
[1] 11.6176
> colVars(tmp2)
[1] 1.251632
> colSd(tmp2)
[1] 1.118764
> colMax(tmp2)
[1] 2.55467
> colMin(tmp2)
[1] -2.581776
> colMedians(tmp2)
[1] 0.1005444
> colRanges(tmp2)
          [,1]
[1,] -2.581776
[2,]  2.554670
> 
> dataset1 <- matrix(dataset1,1,100)
> 
> agree.checks(tmp,dataset1)
> 
> dataset2 <- matrix(dataset2,100,1)
> agree.checks(tmp2,dataset2)
>   
> 
> tmp <- createBufferedMatrix(10,10)
> 
> tmp[1:10,1:10] <- rnorm(100)
> colApply(tmp,sum)
 [1]  2.8818348 -5.2827926  3.0685958 -1.5738768  0.1326297 -6.6326846
 [7]  1.1168222  1.5992780  0.6878837  2.0135298
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -1.2059405
[2,] -0.3210839
[3,]  0.3503324
[4,]  0.7366877
[5,]  2.5747217
> 
> rowApply(tmp,sum)
 [1] -0.9788021  3.9078420 -2.8517129 -6.9638762  1.3118463  3.1162343
 [7]  1.4864466  2.9064281 -2.1051620 -1.8180240
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    2    7    7    4    5   10    6    7    8     3
 [2,]    4    1    6    3   10    1    3    4    1     6
 [3,]    6   10   10    1    3    7    2    3   10     9
 [4,]    3    9    5    8    6    8    4    2    2     4
 [5,]    1    5    9    6    8    2   10    9    7     1
 [6,]    7    8    1    7    1    4    7    1    3     2
 [7,]   10    4    3   10    2    5    5    6    6    10
 [8,]    9    6    4    5    7    3    9    8    4     7
 [9,]    5    3    2    2    4    6    8   10    9     8
[10,]    8    2    8    9    9    9    1    5    5     5
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1]  0.8697495  2.7757558 -0.4509012 -2.7114577  1.6221592 -2.2833883
 [7] -4.9667677  1.4045445  1.1419668  2.2595064 -1.1242554  0.3335542
[13] -0.7920481  1.8621312 -2.0716148  2.5033021  0.5765934  1.4627670
[19]  1.0477285 -0.5184155
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -0.2238269
[2,] -0.1944823
[3,]  0.1007916
[4,]  0.5387597
[5,]  0.6485074
> 
> rowApply(tmp,sum)
[1]  13.082252  -2.815993  -1.657476 -10.000881   4.333008
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]    9   17   13   13    5
[2,]   18   15   18   10   13
[3,]    2   18    9    9    8
[4,]   12    7   10   12    1
[5,]   11   10   16   19    9
> 
> 
> as.matrix(tmp)
           [,1]       [,2]       [,3]        [,4]       [,5]       [,6]
[1,]  0.5387597  1.5988024 -0.6114494  0.78712865  0.7761971 -1.3103086
[2,]  0.6485074  0.3471774  0.8110602 -0.59939443 -0.4027908 -1.0557158
[3,]  0.1007916  0.9479984 -0.1295902 -0.07793237  0.3345364 -0.9393069
[4,] -0.2238269 -0.5577443 -0.6663053 -0.27405061  0.7155696 -0.4456721
[5,] -0.1944823  0.4395218  0.1453836 -2.54720891  0.1986469  1.4676151
           [,7]        [,8]        [,9]      [,10]        [,11]       [,12]
[1,] -0.1593518 -0.11073771  1.58896153  0.4130851  1.725273345 -0.09293476
[2,] -0.3897256 -0.02354043  0.07411019 -0.7647582 -0.900638106  1.00794673
[3,] -1.2690498  0.33242444 -0.14147062  2.0919902 -0.739241487  0.01517137
[4,] -1.1121689  0.32059428 -1.93813514 -0.8905793 -1.211409189 -1.13768166
[5,] -2.0364716  0.88580396  1.55850080  1.4097685  0.001760069  0.54105249
          [,13]      [,14]       [,15]      [,16]      [,17]       [,18]
[1,]  0.2434438  1.3006919 -0.14072578  0.9686891  1.1447909  2.42379953
[2,] -0.4689214  0.3312099 -0.71523424 -0.5273886  0.5729557  0.95548758
[3,] -1.1181301 -1.0561600 -1.43610298 -0.6651534  0.1678257  0.06952882
[4,]  0.3325751 -0.2035628 -0.06162408  1.2540781 -1.6233312 -1.18222819
[5,]  0.2189845  1.4899522  0.28207226  1.4730768  0.3143523 -0.80382079
          [,19]       [,20]
[1,]  1.3621781  0.63595899
[2,] -0.8230977 -0.89324317
[3,]  0.6092109  1.24518444
[4,]  0.4275792 -1.52295795
[5,] -0.5281420  0.01664214
> 
> 
> 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 1.741582 -0.3650305 0.2937142 -0.9222754 0.4282224 -0.1387411 -2.113948
          col8      col9      col10      col11      col12     col13      col14
row1 0.7872463 0.3837894 0.09648359 -0.7863867 0.05263784 0.6425727 -0.3889275
          col15      col16       col17    col18      col19     col20
row1 -0.1152255 -0.0744338 -0.04521006 0.362904 -0.7554803 -1.622384
> tmp[,"col10"]
           col10
row1  0.09648359
row2  1.60556172
row3  0.85355464
row4 -0.78066675
row5 -0.08421466
> tmp[c("row1","row5"),]
          col1       col2      col3       col4      col5       col6      col7
row1 1.7415823 -0.3650305 0.2937142 -0.9222754 0.4282224 -0.1387411 -2.113948
row5 0.4539578 -1.5042757 1.8345445  0.4475817 1.6914117 -1.6527053 -1.943589
            col8       col9       col10      col11      col12     col13
row1 0.787246257  0.3837894  0.09648359 -0.7863867 0.05263784 0.6425727
row5 0.004795045 -0.5608710 -0.08421466 -1.1111867 0.08995046 0.0840010
          col14      col15      col16       col17    col18      col19
row1 -0.3889275 -0.1152255 -0.0744338 -0.04521006 0.362904 -0.7554803
row5  1.4151935  1.5680767 -1.1637891 -0.60619611 1.244247 -0.4675814
            col20
row1 -1.622383594
row5  0.003369259
> tmp[,c("col6","col20")]
           col6        col20
row1 -0.1387411 -1.622383594
row2  0.1187563  0.071452639
row3  0.2531555 -2.092161906
row4 -1.3207267 -0.061195113
row5 -1.6527053  0.003369259
> tmp[c("row1","row5"),c("col6","col20")]
           col6        col20
row1 -0.1387411 -1.622383594
row5 -1.6527053  0.003369259
> 
> 
> 
> 
> tmp["row1",] <- rnorm(20,mean=10)
> tmp[,"col10"] <- rnorm(5,mean=30)
> tmp[c("row1","row5"),] <- rnorm(40,mean=50)
> tmp[,c("col6","col20")] <- rnorm(10,mean=75)
> tmp[c("row1","row5"),c("col6","col20")]  <- rnorm(4,mean=105)
> 
> tmp["row1",]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 49.37678 49.72288 49.60653 49.45144 50.12955 104.4159 47.35473 50.92645
         col9    col10    col11    col12   col13   col14    col15    col16
row1 49.41861 49.39408 51.33086 48.45861 49.0632 49.0204 50.93813 51.58084
        col17   col18   col19    col20
row1 50.51252 48.8186 51.2092 105.7419
> tmp[,"col10"]
        col10
row1 49.39408
row2 29.85233
row3 29.05811
row4 29.57922
row5 51.84629
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 49.37678 49.72288 49.60653 49.45144 50.12955 104.4159 47.35473 50.92645
row5 51.24743 49.79229 51.32459 49.45018 52.31696 103.6999 50.65900 49.08652
         col9    col10    col11    col12    col13    col14    col15    col16
row1 49.41861 49.39408 51.33086 48.45861 49.06320 49.02040 50.93813 51.58084
row5 49.18791 51.84629 49.60040 49.84606 48.70852 48.30909 48.96758 51.71205
        col17    col18    col19    col20
row1 50.51252 48.81860 51.20920 105.7419
row5 50.17638 48.27496 50.89199 103.6896
> tmp[,c("col6","col20")]
          col6     col20
row1 104.41587 105.74187
row2  75.23117  75.26085
row3  74.11774  75.84329
row4  76.50479  76.26181
row5 103.69993 103.68962
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 104.4159 105.7419
row5 103.6999 103.6896
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 104.4159 105.7419
row5 103.6999 103.6896
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
          col13
[1,] -1.2739702
[2,]  0.0353954
[3,]  0.1833001
[4,] -0.4489272
[5,] -0.4147317
> tmp[,c("col17","col7")]
           col17       col7
[1,] -0.71465598 -0.8096337
[2,] -1.69403269 -0.7961269
[3,] -1.46111048  0.1913097
[4,]  0.02531627 -0.9483932
[5,] -0.11289006  1.0069195
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
            col6      col20
[1,] -0.03340197  1.2180818
[2,]  0.29135957 -1.2816087
[3,]  1.70198322  0.4639453
[4,] -0.47259622 -0.5863380
[5,] -0.32885705  0.6567471
> subBufferedMatrix(tmp,1,c("col6"))[,1]
            col1
[1,] -0.03340197
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
            col6
[1,] -0.03340197
[2,]  0.29135957
> 
> 
> 
> 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]
row3 -0.2478548 -1.4857209  1.2225386  0.7477159 -1.4543677 -0.7190219
row1 -0.4512600  0.5062024 -0.6608729 -0.4212654  0.2474094  1.5447165
          [,7]       [,8]       [,9]      [,10]     [,11]      [,12]     [,13]
row3 0.1141033 -0.3924588  0.4102850 -0.8264898 -1.183637 -1.3294058 0.6541678
row1 2.1657663 -0.4308205 -0.6608902 -1.5233860 -1.446227 -0.3248234 0.2893622
           [,14]       [,15]     [,16]      [,17]      [,18]      [,19]
row3 -0.28079444 -0.29164914 1.3181927  0.5214222 -0.5045107 -0.8092195
row1 -0.03900645 -0.05202015 0.8489799 -0.8730704  0.8630699 -0.5540261
          [,20]
row3 -0.3446110
row1  0.5924331
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
         [,1]       [,2]      [,3]       [,4]      [,5]      [,6]      [,7]
row2 1.069925 0.08116776 0.9658302 -0.7410633 0.3848497 0.5287363 0.1276358
           [,8]      [,9]     [,10]
row2 -0.7780668 0.4969345 0.1263987
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
          [,1]      [,2]      [,3]       [,4]    [,5]      [,6]        [,7]
row5 0.2065198 -1.336286 0.8012812 -0.2556087 1.25065 -1.813914 -0.01545781
           [,8]      [,9]    [,10]     [,11]     [,12]   [,13]    [,14]
row5 -0.9658621 0.3605764 0.495883 0.2577812 -1.497961 2.29292 0.293942
         [,15]      [,16]      [,17]     [,18]     [,19]      [,20]
row5 -1.296809 -0.5298203 -0.3976946 0.7728976 -1.020379 -0.5532748
> 
> 
> 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: 0x60000113c000>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMdbf85b2923d" 
 [2] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMdbf8e9ee5b7" 
 [3] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMdbf861fb58e0"
 [4] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMdbf83c880c61"
 [5] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMdbf87e4d353" 
 [6] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMdbf83fedf231"
 [7] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMdbf81eb78fc1"
 [8] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMdbf8253ed7a8"
 [9] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMdbf840c069b2"
[10] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMdbf8185b4654"
[11] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMdbf81066414a"
[12] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMdbf8294869af"
[13] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMdbf851127555"
[14] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMdbf812d54908"
[15] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMdbf870adb5e0"
> 
> 
> ### 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: 0x600001144120>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x600001144120>
Warning message:
In dir.create(new.directory) :
  '/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x600001144120>
> rowMedians(tmp)
  [1] -0.176749281  0.355636816 -0.041247883 -0.316213828  0.230649412
  [6] -0.409343818  0.124705099  0.159492399 -0.138415664 -0.011039276
 [11] -0.197793311  0.463337161 -0.376070085  0.244020881  0.368660053
 [16]  0.150384243  0.556778006 -0.482329755 -0.237979045 -0.426588467
 [21] -0.139375883 -0.061252620  0.290656788  0.356965017 -0.078229445
 [26]  0.089717076 -0.647723137 -0.085613874  0.012103706  0.110838281
 [31] -0.442102452  0.310715312 -0.520776615  0.100718426 -0.087332635
 [36]  0.228746020  0.396591750  0.364247370 -0.042234937  0.583116875
 [41] -0.115623390  0.120807751 -0.089858757 -0.467927269 -0.547277517
 [46]  0.292287450  0.124120707  0.016065157 -0.218417396 -0.123573585
 [51] -0.116659403  0.021195031 -0.283419287 -0.007630178 -0.030710055
 [56]  0.254987782  0.155589406  0.267196924 -0.218893984  0.826871191
 [61]  0.094544584 -0.362600083 -0.450821333 -0.445437325 -0.035129643
 [66]  0.016373381  0.144926709  0.086578080  0.342450031 -0.034337692
 [71] -0.132075442 -0.552397398 -0.065827944 -0.060913383  0.018531336
 [76] -0.500272637  0.151054149  0.015053358  0.530513619  0.152862788
 [81] -0.078989107 -0.278732876 -0.119820477  0.270730058 -0.188734621
 [86] -0.558394277 -0.156183084 -0.641123725 -0.273192958 -0.544376768
 [91] -0.296617140  0.042580717  0.336293940  0.193023110  0.177058777
 [96] -0.245877244 -0.039634378 -0.415876688  0.125875053  0.014989421
[101]  0.136069039  0.185345334 -0.352125141  0.033909881 -0.209221422
[106]  0.075769550  0.496129133 -0.337108179  0.097151822  0.066019072
[111]  0.549588145  0.542356327 -0.488168876 -0.007884771 -0.827886818
[116] -0.374766916  0.307552019  0.538949028  0.109715673  0.090092364
[121] -0.034335312  0.240402980 -0.355568639 -0.198846437  0.027611425
[126]  0.039039412 -0.171120217  0.433719004 -0.417617487 -0.071085611
[131]  0.329269510 -0.073271217  0.108011652  0.016911963  0.022569096
[136]  0.508769544 -0.057299475  0.355629209  0.397824156  0.059677091
[141] -0.050260528  0.020381429  0.419865773 -0.063862349  0.503326031
[146]  0.083659560 -0.042127166  0.490424388 -0.423572729 -0.033987343
[151] -0.024617271  0.290920366 -0.477216436 -0.160619985 -0.198693601
[156] -0.460075697  0.377242884 -0.005087829 -0.014617978  0.544556548
[161] -0.524387320  0.672364740 -0.207851655 -0.311060626  0.202761823
[166] -0.722793776 -0.180469859 -0.493022402 -0.165328056  0.508658951
[171] -0.379076208 -0.287674917 -0.412322507  0.351440573  0.363141159
[176]  0.297606834  0.122287861 -0.109468376  0.352781584  0.196291004
[181]  0.009763991  0.329829241  0.062679729  0.461626538  0.119718329
[186] -0.193811668 -0.308772283 -0.194606429  0.208015241  0.512675558
[191]  0.432527841  0.259737959 -0.012687072 -0.428584442 -0.706653818
[196]  0.129157232  0.149468030 -0.237872982 -0.433127179 -0.037205912
[201] -0.122800187 -0.094071119 -0.274787958 -0.228713144  0.272083938
[206]  0.340662842 -0.283777981  0.579497673  0.153757892 -0.043644182
[211] -0.307904767  0.334425761 -0.160552920 -0.469378886 -0.374320074
[216] -0.128487411  0.434520916  0.330269710  0.098881804 -0.206397850
[221] -0.499369415  0.332648588 -0.268950048 -0.055842049 -0.115590599
[226] -0.194107021 -0.500562019 -0.123322467 -0.085851325 -0.325653219
> 
> proc.time()
   user  system elapsed 
  5.044  18.716  26.711 

BufferedMatrix.Rcheck/tests/rawCalltesting.Rout


R version 4.5.2 (2025-10-31) -- "[Not] Part in a Rumble"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: x86_64-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: 0x600003188000>
> .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: 0x600003188000>
> .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: 0x600003188000>
> .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: 0x600003188000>
> 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: 0x600003188300>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600003188300>
> .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: 0x600003188300>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600003188300>
> .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: 0x600003188300>
> 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: 0x600003180000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600003180000>
> .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: 0x600003180000>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x600003180000>
> .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: 0x600003180000>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x600003180000>
> .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: 0x600003180000>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x600003180000>
> .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: 0x600003180000>
> 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: 0x6000031fc000>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x6000031fc000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000031fc000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000031fc000>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFilee0fe34e2da6a" "BufferedMatrixFilee0fe7b615c0e"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFilee0fe34e2da6a" "BufferedMatrixFilee0fe7b615c0e"
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000031fc240>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000031fc240>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x6000031fc240>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x6000031fc240>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x6000031fc240>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x6000031fc240>
> .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: 0x6000031fc420>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000031fc420>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x6000031fc420>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x6000031fc420>
> 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: 0x60000318c1e0>
> .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: 0x60000318c1e0>
> rm(P)
> 
> proc.time()
   user  system elapsed 
  0.587   0.212   0.987 

BufferedMatrix.Rcheck/tests/Rcodetesting.Rout


R version 4.5.2 (2025-10-31) -- "[Not] Part in a Rumble"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: x86_64-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.563   0.130   0.669 

Example timings