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

This page was generated on 2025-10-24 12:04 -0400 (Fri, 24 Oct 2025).

HostnameOSArch (*)R versionInstalled pkgs
nebbiolo2Linux (Ubuntu 24.04.3 LTS)x86_644.5.1 Patched (2025-08-23 r88802) -- "Great Square Root" 4898
lconwaymacOS 12.7.6 Montereyx86_644.5.1 Patched (2025-09-10 r88807) -- "Great Square Root" 4688
kjohnson3macOS 13.7.7 Venturaarm644.5.1 Patched (2025-09-10 r88807) -- "Great Square Root" 4634
taishanLinux (openEuler 24.03 LTS)aarch644.5.0 (2025-04-11) -- "How About a Twenty-Six" 4658
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/2359HostnameOS / ArchINSTALLBUILDCHECKBUILD BIN
BufferedMatrix 1.73.0  (landing page)
Ben Bolstad
Snapshot Date: 2025-10-23 14:17 -0400 (Thu, 23 Oct 2025)
git_url: https://git.bioconductor.org/packages/BufferedMatrix
git_branch: devel
git_last_commit: 0147962
git_last_commit_date: 2025-04-15 09:39:39 -0400 (Tue, 15 Apr 2025)
nebbiolo2Linux (Ubuntu 24.04.3 LTS) / x86_64  OK    OK    OK  UNNEEDED, same version is already published
lconwaymacOS 12.7.6 Monterey / x86_64  OK    OK    WARNINGS    OK  UNNEEDED, same version is already published
kjohnson3macOS 13.7.7 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 lconway

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.73.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.73.0.tar.gz
StartedAt: 2025-10-23 19:49:31 -0400 (Thu, 23 Oct 2025)
EndedAt: 2025-10-23 19:50:18 -0400 (Thu, 23 Oct 2025)
EllapsedTime: 47.3 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.73.0.tar.gz
###
##############################################################################
##############################################################################


* using log directory ‘/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck’
* using R version 4.5.1 Patched (2025-09-10 r88807)
* using platform: 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.73.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.73.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.1 Patched (2025-09-10 r88807) -- "Great Square Root"
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.336   0.144   0.480 

BufferedMatrix.Rcheck/tests/objectTesting.Rout


R version 4.5.1 Patched (2025-09-10 r88807) -- "Great Square Root"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: 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 480848 25.7    1056621 56.5         NA   634460 33.9
Vcells 891079  6.8    8388608 64.0      98304  2108715 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] "Thu Oct 23 19:49:53 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] "Thu Oct 23 19:49:54 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: 0x6000012e4000>
> 
> 
> 
> 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] "Thu Oct 23 19:49:58 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] "Thu Oct 23 19:49:59 2025"
> 
> ColMode(tmp2)
<pointer: 0x6000012e4000>
> 
> 
> 
> ### Now testing assignments
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+ 
+   new.data <- rnorm(20)
+   tmp2[which.row,] <- new.data
+   test.matrix[which.row,] <- new.data
+   if (rep > 1){
+     if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+   
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   new.data <- rnorm(10)
+   tmp2[,which.col] <- new.data
+   test.matrix[,which.col]<- new.data
+ 
+   if (rep > 1){
+     if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.col <- which.col
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,5,replace=TRUE)
+   new.data <- matrix(rnorm(50),5,10)
+   tmp2[,which.col] <- new.data
+   test.matrix[,which.col]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.col <- which.col
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   new.data <- matrix(rnorm(50),5,10)
+   tmp2[which.row,] <- new.data
+   test.matrix[which.row,]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col  <- sample(1:20,5,replace=TRUE)
+   new.data <- matrix(rnorm(25),5,5)
+   tmp2[which.row,which.col] <- new.data
+   test.matrix[which.row,which.col]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[prev.row,prev.col] == test.matrix[prev.row,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+   prev.col <- which.col
+ }
> 
> 
> 
> 
> ###
> ###
> ### testing some more functions
> ###
> 
> 
> 
> ## duplication function
> tmp5 <- duplicate(tmp2)
> 
> # making sure really did copy everything.
> tmp5[1,1] <- tmp5[1,1] +100.00
> 
> if (tmp5[1,1] == tmp2[1,1]){
+   stop("Problem with duplication")
+ }
> 
> 
> 
> 
> ### testing elementwise applying of functions
> 
> tmp5[1:4,1:4]
            [,1]       [,2]       [,3]      [,4]
[1,] 100.5478371  0.8749826 -1.0312119 0.3473313
[2,]  -0.3984986 -1.9067837 -0.5906125 1.2603465
[3,]   0.7318010  0.4848122 -0.2239971 0.4402977
[4,]   0.2521542 -0.1030169  1.0957878 1.1560552
> 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 :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
            [,1]      [,2]      [,3]      [,4]
[1,] 100.5478371 0.8749826 1.0312119 0.3473313
[2,]   0.3984986 1.9067837 0.5906125 1.2603465
[3,]   0.7318010 0.4848122 0.2239971 0.4402977
[4,]   0.2521542 0.1030169 1.0957878 1.1560552
> 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 :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
           [,1]      [,2]      [,3]      [,4]
[1,] 10.0273544 0.9354050 1.0154861 0.5893482
[2,]  0.6312674 1.3808634 0.7685132 1.1226515
[3,]  0.8554537 0.6962846 0.4732833 0.6635493
[4,]  0.5021496 0.3209625 1.0467989 1.0752001
> 
> 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 :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
          [,1]     [,2]     [,3]     [,4]
[1,] 225.82138 35.22903 36.18607 31.24081
[2,]  31.71117 40.71542 33.27574 37.48686
[3,]  34.28634 32.44766 29.95683 32.07579
[4,]  30.27365 28.31264 36.56378 36.90806
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x6000012a4300>
> exp(tmp5)
<pointer: 0x6000012a4300>
> log(tmp5,2)
<pointer: 0x6000012a4300>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 470.0176
> Min(tmp5)
[1] 52.92827
> mean(tmp5)
[1] 72.4217
> Sum(tmp5)
[1] 14484.34
> Var(tmp5)
[1] 868.1586
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 90.13293 68.56623 70.61145 69.48934 70.86670 71.86856 70.85751 73.36600
 [9] 66.89839 71.55985
> rowSums(tmp5)
 [1] 1802.659 1371.325 1412.229 1389.787 1417.334 1437.371 1417.150 1467.320
 [9] 1337.968 1431.197
> rowVars(tmp5)
 [1] 8032.93183   71.29112   49.58454   40.27090   76.98472   85.76745
 [7]  117.43773   79.58219   71.36872   69.97913
> rowSd(tmp5)
 [1] 89.626625  8.443407  7.041629  6.345935  8.774094  9.261072 10.836869
 [8]  8.920885  8.448001  8.365353
> rowMax(tmp5)
 [1] 470.01762  84.74381  86.61637  78.17565  90.79420  90.27833  93.04420
 [8]  93.71815  81.11439  85.85242
> rowMin(tmp5)
 [1] 58.02265 55.70114 61.64666 55.85407 58.93316 55.31710 52.92827 56.80578
 [9] 53.39970 58.94209
> 
> colMeans(tmp5)
 [1] 113.04116  65.42517  72.68388  69.51648  68.52812  70.42726  69.14938
 [8]  68.95881  73.57449  72.46327  68.16866  75.11840  65.13245  75.49840
[15]  71.48283  68.29239  73.87900  67.90800  67.26876  71.91703
> colSums(tmp5)
 [1] 1130.4116  654.2517  726.8388  695.1648  685.2812  704.2726  691.4938
 [8]  689.5881  735.7449  724.6327  681.6866  751.1840  651.3245  754.9840
[15]  714.8283  682.9239  738.7900  679.0800  672.6876  719.1703
> colVars(tmp5)
 [1] 15793.04232    74.44942    55.68221    87.04236    60.87382   123.78067
 [7]    45.29807    57.56414    75.83262    38.98736    71.56041   105.11901
[13]    19.60769   120.47180    88.52026    83.64035    13.25864    66.87573
[19]    41.52373    55.30345
> colSd(tmp5)
 [1] 125.670372   8.628408   7.462051   9.329649   7.802168  11.125676
 [7]   6.730384   7.587103   8.708193   6.243986   8.459339  10.252756
[13]   4.428057  10.975965   9.408520   9.145510   3.641242   8.177758
[19]   6.443891   7.436629
> colMax(tmp5)
 [1] 470.01762  84.74381  84.36967  82.03198  82.28198  86.21479  78.11864
 [8]  80.78276  90.27833  83.53033  82.89412  93.04420  72.01204  93.71815
[15]  87.27089  85.95887  80.16644  79.62698  78.46123  86.61637
> colMin(tmp5)
 [1] 63.01064 54.74401 62.35122 55.31710 53.39970 53.30858 58.93316 56.80578
 [9] 60.26044 63.67518 52.92827 55.85407 58.65265 59.86612 55.70114 56.44902
[17] 68.24724 58.02265 55.44232 64.00571
> 
> 
> ### 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.13293 68.56623 70.61145 69.48934 70.86670 71.86856 70.85751 73.36600
 [9] 66.89839       NA
> rowSums(tmp5)
 [1] 1802.659 1371.325 1412.229 1389.787 1417.334 1437.371 1417.150 1467.320
 [9] 1337.968       NA
> rowVars(tmp5)
 [1] 8032.93183   71.29112   49.58454   40.27090   76.98472   85.76745
 [7]  117.43773   79.58219   71.36872   72.18032
> rowSd(tmp5)
 [1] 89.626625  8.443407  7.041629  6.345935  8.774094  9.261072 10.836869
 [8]  8.920885  8.448001  8.495900
> rowMax(tmp5)
 [1] 470.01762  84.74381  86.61637  78.17565  90.79420  90.27833  93.04420
 [8]  93.71815  81.11439        NA
> rowMin(tmp5)
 [1] 58.02265 55.70114 61.64666 55.85407 58.93316 55.31710 52.92827 56.80578
 [9] 53.39970       NA
> 
> colMeans(tmp5)
 [1] 113.04116  65.42517  72.68388  69.51648  68.52812  70.42726  69.14938
 [8]  68.95881  73.57449  72.46327  68.16866  75.11840  65.13245  75.49840
[15]  71.48283  68.29239  73.87900        NA  67.26876  71.91703
> colSums(tmp5)
 [1] 1130.4116  654.2517  726.8388  695.1648  685.2812  704.2726  691.4938
 [8]  689.5881  735.7449  724.6327  681.6866  751.1840  651.3245  754.9840
[15]  714.8283  682.9239  738.7900        NA  672.6876  719.1703
> colVars(tmp5)
 [1] 15793.04232    74.44942    55.68221    87.04236    60.87382   123.78067
 [7]    45.29807    57.56414    75.83262    38.98736    71.56041   105.11901
[13]    19.60769   120.47180    88.52026    83.64035    13.25864          NA
[19]    41.52373    55.30345
> colSd(tmp5)
 [1] 125.670372   8.628408   7.462051   9.329649   7.802168  11.125676
 [7]   6.730384   7.587103   8.708193   6.243986   8.459339  10.252756
[13]   4.428057  10.975965   9.408520   9.145510   3.641242         NA
[19]   6.443891   7.436629
> colMax(tmp5)
 [1] 470.01762  84.74381  84.36967  82.03198  82.28198  86.21479  78.11864
 [8]  80.78276  90.27833  83.53033  82.89412  93.04420  72.01204  93.71815
[15]  87.27089  85.95887  80.16644        NA  78.46123  86.61637
> colMin(tmp5)
 [1] 63.01064 54.74401 62.35122 55.31710 53.39970 53.30858 58.93316 56.80578
 [9] 60.26044 63.67518 52.92827 55.85407 58.65265 59.86612 55.70114 56.44902
[17] 68.24724       NA 55.44232 64.00571
> 
> Max(tmp5,na.rm=TRUE)
[1] 470.0176
> Min(tmp5,na.rm=TRUE)
[1] 52.92827
> mean(tmp5,na.rm=TRUE)
[1] 72.39904
> Sum(tmp5,na.rm=TRUE)
[1] 14407.41
> Var(tmp5,na.rm=TRUE)
[1] 872.4401
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 90.13293 68.56623 70.61145 69.48934 70.86670 71.86856 70.85751 73.36600
 [9] 66.89839 71.27720
> rowSums(tmp5,na.rm=TRUE)
 [1] 1802.659 1371.325 1412.229 1389.787 1417.334 1437.371 1417.150 1467.320
 [9] 1337.968 1354.267
> rowVars(tmp5,na.rm=TRUE)
 [1] 8032.93183   71.29112   49.58454   40.27090   76.98472   85.76745
 [7]  117.43773   79.58219   71.36872   72.18032
> rowSd(tmp5,na.rm=TRUE)
 [1] 89.626625  8.443407  7.041629  6.345935  8.774094  9.261072 10.836869
 [8]  8.920885  8.448001  8.495900
> rowMax(tmp5,na.rm=TRUE)
 [1] 470.01762  84.74381  86.61637  78.17565  90.79420  90.27833  93.04420
 [8]  93.71815  81.11439  85.85242
> rowMin(tmp5,na.rm=TRUE)
 [1] 58.02265 55.70114 61.64666 55.85407 58.93316 55.31710 52.92827 56.80578
 [9] 53.39970 58.94209
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 113.04116  65.42517  72.68388  69.51648  68.52812  70.42726  69.14938
 [8]  68.95881  73.57449  72.46327  68.16866  75.11840  65.13245  75.49840
[15]  71.48283  68.29239  73.87900  66.90554  67.26876  71.91703
> colSums(tmp5,na.rm=TRUE)
 [1] 1130.4116  654.2517  726.8388  695.1648  685.2812  704.2726  691.4938
 [8]  689.5881  735.7449  724.6327  681.6866  751.1840  651.3245  754.9840
[15]  714.8283  682.9239  738.7900  602.1499  672.6876  719.1703
> colVars(tmp5,na.rm=TRUE)
 [1] 15793.04232    74.44942    55.68221    87.04236    60.87382   123.78067
 [7]    45.29807    57.56414    75.83262    38.98736    71.56041   105.11901
[13]    19.60769   120.47180    88.52026    83.64035    13.25864    63.92981
[19]    41.52373    55.30345
> colSd(tmp5,na.rm=TRUE)
 [1] 125.670372   8.628408   7.462051   9.329649   7.802168  11.125676
 [7]   6.730384   7.587103   8.708193   6.243986   8.459339  10.252756
[13]   4.428057  10.975965   9.408520   9.145510   3.641242   7.995612
[19]   6.443891   7.436629
> colMax(tmp5,na.rm=TRUE)
 [1] 470.01762  84.74381  84.36967  82.03198  82.28198  86.21479  78.11864
 [8]  80.78276  90.27833  83.53033  82.89412  93.04420  72.01204  93.71815
[15]  87.27089  85.95887  80.16644  79.62698  78.46123  86.61637
> colMin(tmp5,na.rm=TRUE)
 [1] 63.01064 54.74401 62.35122 55.31710 53.39970 53.30858 58.93316 56.80578
 [9] 60.26044 63.67518 52.92827 55.85407 58.65265 59.86612 55.70114 56.44902
[17] 68.24724 58.02265 55.44232 64.00571
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1] 90.13293 68.56623 70.61145 69.48934 70.86670 71.86856 70.85751 73.36600
 [9] 66.89839      NaN
> rowSums(tmp5,na.rm=TRUE)
 [1] 1802.659 1371.325 1412.229 1389.787 1417.334 1437.371 1417.150 1467.320
 [9] 1337.968    0.000
> rowVars(tmp5,na.rm=TRUE)
 [1] 8032.93183   71.29112   49.58454   40.27090   76.98472   85.76745
 [7]  117.43773   79.58219   71.36872         NA
> rowSd(tmp5,na.rm=TRUE)
 [1] 89.626625  8.443407  7.041629  6.345935  8.774094  9.261072 10.836869
 [8]  8.920885  8.448001        NA
> rowMax(tmp5,na.rm=TRUE)
 [1] 470.01762  84.74381  86.61637  78.17565  90.79420  90.27833  93.04420
 [8]  93.71815  81.11439        NA
> rowMin(tmp5,na.rm=TRUE)
 [1] 58.02265 55.70114 61.64666 55.85407 58.93316 55.31710 52.92827 56.80578
 [9] 53.39970       NA
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1] 116.06213  66.00172  72.12384  70.30465  68.85221  71.70339  69.20351
 [8]  68.68474  74.49052  72.06463  66.53250  74.38266  64.94132  76.82902
[15]  70.22237  68.46129  73.76193       NaN  66.02516  72.79606
> colSums(tmp5,na.rm=TRUE)
 [1] 1044.5592  594.0155  649.1145  632.7419  619.6699  645.3305  622.8316
 [8]  618.1627  670.4147  648.5817  598.7925  669.4439  584.4718  691.4612
[15]  632.0013  616.1516  663.8574    0.0000  594.2264  655.1646
> colVars(tmp5,na.rm=TRUE)
 [1] 17664.50211    80.01596    59.11399    90.93403    67.30147   120.93256
 [7]    50.92736    63.91461    75.87167    42.07302    50.38890   112.16902
[13]    21.64766   115.61228    81.71160    93.77447    14.76179          NA
[19]    29.31541    53.52348
> colSd(tmp5,na.rm=TRUE)
 [1] 132.907871   8.945164   7.688562   9.535933   8.203747  10.996934
 [7]   7.136341   7.994661   8.710435   6.486372   7.098514  10.590988
[13]   4.652704  10.752315   9.039447   9.683722   3.842108         NA
[19]   5.414370   7.315974
> colMax(tmp5,na.rm=TRUE)
 [1] 470.01762  84.74381  84.36967  82.03198  82.28198  86.21479  78.11864
 [8]  80.78276  90.27833  83.53033  74.63030  93.04420  72.01204  93.71815
[15]  87.27089  85.95887  80.16644      -Inf  73.26916  86.61637
> colMin(tmp5,na.rm=TRUE)
 [1] 63.01064 54.74401 62.35122 55.31710 53.39970 53.30858 58.93316 56.80578
 [9] 60.26044 63.67518 52.92827 55.85407 58.65265 59.86612 55.70114 56.44902
[17] 68.24724      Inf 55.44232 64.36205
> 
> 
> 
> 
> 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] 139.2069 148.4659 173.2918 101.1945 235.5962 215.4146 207.4809 203.1505
 [9] 180.4955 143.7828
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 139.2069 148.4659 173.2918 101.1945 235.5962 215.4146 207.4809 203.1505
 [9] 180.4955 143.7828
> 
> 
> 
> copymatrix <- matrix(rnorm(200,150,15),10,20)
> 
> tmp5[1:10,1:20] <- copymatrix
> which.row <- 1
> which.col  <- 3
> cat(which.row," ",which.col,"\n")
1   3 
> tmp5[which.row,which.col] <- NA
> copymatrix[which.row,which.col] <- NA
> 
> colVars(tmp5,na.rm=TRUE)-apply(copymatrix,2,var,na.rm=TRUE)
 [1] -5.684342e-14 -8.526513e-14 -1.421085e-13 -2.842171e-14 -1.136868e-13
 [6]  5.684342e-14  5.684342e-14 -2.842171e-13 -5.684342e-14 -8.526513e-14
[11]  5.684342e-14 -2.842171e-14 -5.684342e-14  1.989520e-13  0.000000e+00
[16]  2.842171e-14 -5.684342e-14  1.136868e-13  8.526513e-14 -1.136868e-13
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> ## making sure these things agree
> ##
> ## first when there is no NA
> 
> 
> 
> agree.checks <- function(buff.matrix,r.matrix,err.tol=1e-10){
+ 
+   if (Max(buff.matrix,na.rm=TRUE) != max(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Max")
+   }
+   
+ 
+   if (Min(buff.matrix,na.rm=TRUE) != min(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Min")
+   }
+ 
+ 
+   if (abs(Sum(buff.matrix,na.rm=TRUE)- sum(r.matrix,na.rm=TRUE)) > err.tol){
+ 
+     cat(Sum(buff.matrix,na.rm=TRUE),"\n")
+     cat(sum(r.matrix,na.rm=TRUE),"\n")
+     cat(Sum(buff.matrix,na.rm=TRUE) - sum(r.matrix,na.rm=TRUE),"\n")
+     
+     stop("No agreement in Sum")
+   }
+   
+   if (abs(mean(buff.matrix,na.rm=TRUE) - mean(r.matrix,na.rm=TRUE)) > err.tol){
+     stop("No agreement in mean")
+   }
+   
+   
+   if(abs(Var(buff.matrix,na.rm=TRUE) - var(as.vector(r.matrix),na.rm=TRUE)) > err.tol){
+     stop("No agreement in Var")
+   }
+   
+   
+ 
+   if(any(abs(rowMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,mean,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowMeans")
+   }
+   
+   
+   if(any(abs(colMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,mean,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colMeans")
+   }
+   
+   
+   if(any(abs(rowSums(buff.matrix,na.rm=TRUE)  -  apply(r.matrix,1,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in rowSums")
+   }
+   
+   
+   if(any(abs(colSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colSums")
+   }
+   
+   ### this is to get around the fact that R doesn't like to compute NA on an entire vector of NA when 
+   ### computing variance
+   my.Var <- function(x,na.rm=FALSE){
+    if (all(is.na(x))){
+      return(NA)
+    } else {
+      var(x,na.rm=na.rm)
+    }
+ 
+   }
+   
+   if(any(abs(rowVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+   
+   
+   if(any(abs(colVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+ 
+ 
+   if(any(abs(rowMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+ 
+   if(any(abs(colMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+   
+   
+   if(any(abs(rowMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+   
+ 
+   if(any(abs(colMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+ 
+   if(any(abs(colMedians(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,median,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMedian")
+   }
+ 
+   if(any(abs(colRanges(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,range,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colRanges")
+   }
+ 
+ 
+   
+ }
> 
> 
> 
> 
> 
> 
> 
> 
> 
> for (rep in 1:20){
+   copymatrix <- matrix(rnorm(200,150,15),10,20)
+   
+   tmp5[1:10,1:20] <- copymatrix
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ## now lets assign some NA values and check agreement
+ 
+   which.row <- sample(1:10,1,replace=TRUE)
+   which.col  <- sample(1:20,1,replace=TRUE)
+   
+   cat(which.row," ",which.col,"\n")
+   
+   tmp5[which.row,which.col] <- NA
+   copymatrix[which.row,which.col] <- NA
+   
+   agree.checks(tmp5,copymatrix)
+ 
+   ## make an entire row NA
+   tmp5[which.row,] <- NA
+   copymatrix[which.row,] <- NA
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ### also make an entire col NA
+   tmp5[,which.col] <- NA
+   copymatrix[,which.col] <- NA
+ 
+   agree.checks(tmp5,copymatrix)
+ 
+   ### now make 1 element non NA with NA in the rest of row and column
+ 
+   tmp5[which.row,which.col] <- rnorm(1,150,15)
+   copymatrix[which.row,which.col] <- tmp5[which.row,which.col]
+ 
+   agree.checks(tmp5,copymatrix)
+ }
1   19 
1   18 
7   2 
10   11 
7   1 
9   3 
10   14 
6   10 
5   3 
4   8 
9   8 
6   17 
8   1 
3   1 
7   1 
1   19 
3   19 
2   14 
1   13 
9   18 
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.487515
> Min(tmp)
[1] -2.271122
> mean(tmp)
[1] 0.03777251
> Sum(tmp)
[1] 3.777251
> Var(tmp)
[1] 1.028335
> 
> rowMeans(tmp)
[1] 0.03777251
> rowSums(tmp)
[1] 3.777251
> rowVars(tmp)
[1] 1.028335
> rowSd(tmp)
[1] 1.014068
> rowMax(tmp)
[1] 2.487515
> rowMin(tmp)
[1] -2.271122
> 
> colMeans(tmp)
  [1] -0.90287047  0.35284731 -0.82889849  0.03707469  0.05604672  0.48211669
  [7] -0.76516164  1.73100613 -0.16114798 -0.58477294  0.26810598 -1.71216369
 [13]  1.23287735  1.14130553 -0.24117402  0.28859147 -0.03785223 -0.90369186
 [19]  0.21832148 -0.75076100  0.94746422  0.18502248 -0.32037664  0.50662569
 [25] -1.25515735  0.19569647  0.82678703  0.15108041 -0.29899856 -0.49168795
 [31]  0.32991024 -0.46246700 -1.00965820 -2.02719801  1.47171518 -2.27112177
 [37] -0.89610571 -1.21171022  0.74896375  1.98942996 -0.21640642 -1.00738217
 [43]  0.33266272  1.42753862  0.49429691  1.66314217  1.22807362 -1.42922118
 [49] -0.46807710  0.92389351  1.06993014 -0.42977632  1.76165424 -0.52453518
 [55] -0.20191172  0.94329945  0.40715244 -0.63445285  0.39947743 -0.61743652
 [61] -0.97452140  0.11124565 -0.31332638 -1.55957869  0.35109431  0.73560443
 [67]  1.21451085  0.43402317  0.79091102 -0.21963325  1.55318852  0.87012429
 [73] -0.80655097  1.01438056 -1.88092061  0.65763449  2.31720726 -0.86009145
 [79]  0.37886717 -1.45423318  0.09774476 -0.59980068  0.98791003 -0.65216713
 [85]  0.80243050 -0.38473462  1.59707253  0.40978728 -0.22501543 -1.95185170
 [91]  1.45057291 -0.66753745 -0.07637882  2.48751540  1.06581475 -1.58570652
 [97] -1.38744329 -0.11945497 -0.50826008 -0.47311667
> colSums(tmp)
  [1] -0.90287047  0.35284731 -0.82889849  0.03707469  0.05604672  0.48211669
  [7] -0.76516164  1.73100613 -0.16114798 -0.58477294  0.26810598 -1.71216369
 [13]  1.23287735  1.14130553 -0.24117402  0.28859147 -0.03785223 -0.90369186
 [19]  0.21832148 -0.75076100  0.94746422  0.18502248 -0.32037664  0.50662569
 [25] -1.25515735  0.19569647  0.82678703  0.15108041 -0.29899856 -0.49168795
 [31]  0.32991024 -0.46246700 -1.00965820 -2.02719801  1.47171518 -2.27112177
 [37] -0.89610571 -1.21171022  0.74896375  1.98942996 -0.21640642 -1.00738217
 [43]  0.33266272  1.42753862  0.49429691  1.66314217  1.22807362 -1.42922118
 [49] -0.46807710  0.92389351  1.06993014 -0.42977632  1.76165424 -0.52453518
 [55] -0.20191172  0.94329945  0.40715244 -0.63445285  0.39947743 -0.61743652
 [61] -0.97452140  0.11124565 -0.31332638 -1.55957869  0.35109431  0.73560443
 [67]  1.21451085  0.43402317  0.79091102 -0.21963325  1.55318852  0.87012429
 [73] -0.80655097  1.01438056 -1.88092061  0.65763449  2.31720726 -0.86009145
 [79]  0.37886717 -1.45423318  0.09774476 -0.59980068  0.98791003 -0.65216713
 [85]  0.80243050 -0.38473462  1.59707253  0.40978728 -0.22501543 -1.95185170
 [91]  1.45057291 -0.66753745 -0.07637882  2.48751540  1.06581475 -1.58570652
 [97] -1.38744329 -0.11945497 -0.50826008 -0.47311667
> 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.90287047  0.35284731 -0.82889849  0.03707469  0.05604672  0.48211669
  [7] -0.76516164  1.73100613 -0.16114798 -0.58477294  0.26810598 -1.71216369
 [13]  1.23287735  1.14130553 -0.24117402  0.28859147 -0.03785223 -0.90369186
 [19]  0.21832148 -0.75076100  0.94746422  0.18502248 -0.32037664  0.50662569
 [25] -1.25515735  0.19569647  0.82678703  0.15108041 -0.29899856 -0.49168795
 [31]  0.32991024 -0.46246700 -1.00965820 -2.02719801  1.47171518 -2.27112177
 [37] -0.89610571 -1.21171022  0.74896375  1.98942996 -0.21640642 -1.00738217
 [43]  0.33266272  1.42753862  0.49429691  1.66314217  1.22807362 -1.42922118
 [49] -0.46807710  0.92389351  1.06993014 -0.42977632  1.76165424 -0.52453518
 [55] -0.20191172  0.94329945  0.40715244 -0.63445285  0.39947743 -0.61743652
 [61] -0.97452140  0.11124565 -0.31332638 -1.55957869  0.35109431  0.73560443
 [67]  1.21451085  0.43402317  0.79091102 -0.21963325  1.55318852  0.87012429
 [73] -0.80655097  1.01438056 -1.88092061  0.65763449  2.31720726 -0.86009145
 [79]  0.37886717 -1.45423318  0.09774476 -0.59980068  0.98791003 -0.65216713
 [85]  0.80243050 -0.38473462  1.59707253  0.40978728 -0.22501543 -1.95185170
 [91]  1.45057291 -0.66753745 -0.07637882  2.48751540  1.06581475 -1.58570652
 [97] -1.38744329 -0.11945497 -0.50826008 -0.47311667
> colMin(tmp)
  [1] -0.90287047  0.35284731 -0.82889849  0.03707469  0.05604672  0.48211669
  [7] -0.76516164  1.73100613 -0.16114798 -0.58477294  0.26810598 -1.71216369
 [13]  1.23287735  1.14130553 -0.24117402  0.28859147 -0.03785223 -0.90369186
 [19]  0.21832148 -0.75076100  0.94746422  0.18502248 -0.32037664  0.50662569
 [25] -1.25515735  0.19569647  0.82678703  0.15108041 -0.29899856 -0.49168795
 [31]  0.32991024 -0.46246700 -1.00965820 -2.02719801  1.47171518 -2.27112177
 [37] -0.89610571 -1.21171022  0.74896375  1.98942996 -0.21640642 -1.00738217
 [43]  0.33266272  1.42753862  0.49429691  1.66314217  1.22807362 -1.42922118
 [49] -0.46807710  0.92389351  1.06993014 -0.42977632  1.76165424 -0.52453518
 [55] -0.20191172  0.94329945  0.40715244 -0.63445285  0.39947743 -0.61743652
 [61] -0.97452140  0.11124565 -0.31332638 -1.55957869  0.35109431  0.73560443
 [67]  1.21451085  0.43402317  0.79091102 -0.21963325  1.55318852  0.87012429
 [73] -0.80655097  1.01438056 -1.88092061  0.65763449  2.31720726 -0.86009145
 [79]  0.37886717 -1.45423318  0.09774476 -0.59980068  0.98791003 -0.65216713
 [85]  0.80243050 -0.38473462  1.59707253  0.40978728 -0.22501543 -1.95185170
 [91]  1.45057291 -0.66753745 -0.07637882  2.48751540  1.06581475 -1.58570652
 [97] -1.38744329 -0.11945497 -0.50826008 -0.47311667
> colMedians(tmp)
  [1] -0.90287047  0.35284731 -0.82889849  0.03707469  0.05604672  0.48211669
  [7] -0.76516164  1.73100613 -0.16114798 -0.58477294  0.26810598 -1.71216369
 [13]  1.23287735  1.14130553 -0.24117402  0.28859147 -0.03785223 -0.90369186
 [19]  0.21832148 -0.75076100  0.94746422  0.18502248 -0.32037664  0.50662569
 [25] -1.25515735  0.19569647  0.82678703  0.15108041 -0.29899856 -0.49168795
 [31]  0.32991024 -0.46246700 -1.00965820 -2.02719801  1.47171518 -2.27112177
 [37] -0.89610571 -1.21171022  0.74896375  1.98942996 -0.21640642 -1.00738217
 [43]  0.33266272  1.42753862  0.49429691  1.66314217  1.22807362 -1.42922118
 [49] -0.46807710  0.92389351  1.06993014 -0.42977632  1.76165424 -0.52453518
 [55] -0.20191172  0.94329945  0.40715244 -0.63445285  0.39947743 -0.61743652
 [61] -0.97452140  0.11124565 -0.31332638 -1.55957869  0.35109431  0.73560443
 [67]  1.21451085  0.43402317  0.79091102 -0.21963325  1.55318852  0.87012429
 [73] -0.80655097  1.01438056 -1.88092061  0.65763449  2.31720726 -0.86009145
 [79]  0.37886717 -1.45423318  0.09774476 -0.59980068  0.98791003 -0.65216713
 [85]  0.80243050 -0.38473462  1.59707253  0.40978728 -0.22501543 -1.95185170
 [91]  1.45057291 -0.66753745 -0.07637882  2.48751540  1.06581475 -1.58570652
 [97] -1.38744329 -0.11945497 -0.50826008 -0.47311667
> colRanges(tmp)
           [,1]      [,2]       [,3]       [,4]       [,5]      [,6]       [,7]
[1,] -0.9028705 0.3528473 -0.8288985 0.03707469 0.05604672 0.4821167 -0.7651616
[2,] -0.9028705 0.3528473 -0.8288985 0.03707469 0.05604672 0.4821167 -0.7651616
         [,8]      [,9]      [,10]    [,11]     [,12]    [,13]    [,14]
[1,] 1.731006 -0.161148 -0.5847729 0.268106 -1.712164 1.232877 1.141306
[2,] 1.731006 -0.161148 -0.5847729 0.268106 -1.712164 1.232877 1.141306
         [,15]     [,16]       [,17]      [,18]     [,19]     [,20]     [,21]
[1,] -0.241174 0.2885915 -0.03785223 -0.9036919 0.2183215 -0.750761 0.9474642
[2,] -0.241174 0.2885915 -0.03785223 -0.9036919 0.2183215 -0.750761 0.9474642
         [,22]      [,23]     [,24]     [,25]     [,26]    [,27]     [,28]
[1,] 0.1850225 -0.3203766 0.5066257 -1.255157 0.1956965 0.826787 0.1510804
[2,] 0.1850225 -0.3203766 0.5066257 -1.255157 0.1956965 0.826787 0.1510804
          [,29]     [,30]     [,31]     [,32]     [,33]     [,34]    [,35]
[1,] -0.2989986 -0.491688 0.3299102 -0.462467 -1.009658 -2.027198 1.471715
[2,] -0.2989986 -0.491688 0.3299102 -0.462467 -1.009658 -2.027198 1.471715
         [,36]      [,37]    [,38]     [,39]   [,40]      [,41]     [,42]
[1,] -2.271122 -0.8961057 -1.21171 0.7489638 1.98943 -0.2164064 -1.007382
[2,] -2.271122 -0.8961057 -1.21171 0.7489638 1.98943 -0.2164064 -1.007382
         [,43]    [,44]     [,45]    [,46]    [,47]     [,48]      [,49]
[1,] 0.3326627 1.427539 0.4942969 1.663142 1.228074 -1.429221 -0.4680771
[2,] 0.3326627 1.427539 0.4942969 1.663142 1.228074 -1.429221 -0.4680771
         [,50]   [,51]      [,52]    [,53]      [,54]      [,55]     [,56]
[1,] 0.9238935 1.06993 -0.4297763 1.761654 -0.5245352 -0.2019117 0.9432995
[2,] 0.9238935 1.06993 -0.4297763 1.761654 -0.5245352 -0.2019117 0.9432995
         [,57]      [,58]     [,59]      [,60]      [,61]     [,62]      [,63]
[1,] 0.4071524 -0.6344529 0.3994774 -0.6174365 -0.9745214 0.1112457 -0.3133264
[2,] 0.4071524 -0.6344529 0.3994774 -0.6174365 -0.9745214 0.1112457 -0.3133264
         [,64]     [,65]     [,66]    [,67]     [,68]    [,69]      [,70]
[1,] -1.559579 0.3510943 0.7356044 1.214511 0.4340232 0.790911 -0.2196333
[2,] -1.559579 0.3510943 0.7356044 1.214511 0.4340232 0.790911 -0.2196333
        [,71]     [,72]     [,73]    [,74]     [,75]     [,76]    [,77]
[1,] 1.553189 0.8701243 -0.806551 1.014381 -1.880921 0.6576345 2.317207
[2,] 1.553189 0.8701243 -0.806551 1.014381 -1.880921 0.6576345 2.317207
          [,78]     [,79]     [,80]      [,81]      [,82]   [,83]      [,84]
[1,] -0.8600915 0.3788672 -1.454233 0.09774476 -0.5998007 0.98791 -0.6521671
[2,] -0.8600915 0.3788672 -1.454233 0.09774476 -0.5998007 0.98791 -0.6521671
         [,85]      [,86]    [,87]     [,88]      [,89]     [,90]    [,91]
[1,] 0.8024305 -0.3847346 1.597073 0.4097873 -0.2250154 -1.951852 1.450573
[2,] 0.8024305 -0.3847346 1.597073 0.4097873 -0.2250154 -1.951852 1.450573
          [,92]       [,93]    [,94]    [,95]     [,96]     [,97]     [,98]
[1,] -0.6675374 -0.07637882 2.487515 1.065815 -1.585707 -1.387443 -0.119455
[2,] -0.6675374 -0.07637882 2.487515 1.065815 -1.585707 -1.387443 -0.119455
          [,99]     [,100]
[1,] -0.5082601 -0.4731167
[2,] -0.5082601 -0.4731167
> 
> 
> Max(tmp2)
[1] 3.185547
> Min(tmp2)
[1] -2.115573
> mean(tmp2)
[1] 0.1309773
> Sum(tmp2)
[1] 13.09773
> Var(tmp2)
[1] 1.049724
> 
> rowMeans(tmp2)
  [1]  0.248840638 -0.408873967 -0.596148641  1.045601659 -0.037613205
  [6] -1.889953364  0.182464264  1.050490644  3.185546591  0.348120460
 [11]  1.609630593  0.502036318  0.657196959 -1.562853505 -0.019234321
 [16] -1.392176586 -0.860043915 -1.128422001  1.241736852 -0.300668723
 [21] -0.143225614 -0.863354309  1.341055600 -0.373158226 -0.083084934
 [26]  1.267946697  0.131490180  1.156120288 -0.296191294 -0.272146638
 [31]  0.860287723 -0.192301528 -0.214767413  0.172572679 -1.058481446
 [36] -0.208935106  1.195089297 -0.901351197 -0.104518795 -0.720509509
 [41] -1.135694884  0.209003642  0.428793851  0.455247368 -1.228344237
 [46]  1.404521707 -1.537775528 -1.347822300  1.266715970  0.056067384
 [51]  0.135763226  1.030351209  1.625995125 -0.861080982  1.038564851
 [56] -1.134546380  1.144514638  1.195193505  1.072413774 -2.115573500
 [61] -0.673034371 -0.064428871  1.368383680  0.007006474  0.061846354
 [66] -0.121775811  0.352034927 -1.426095992  1.816324240  0.816251184
 [71]  1.547072411 -0.489445902 -0.862476140 -1.809649696 -0.100804634
 [76]  1.536297774  0.608904488  2.444944510  1.104436246 -1.779804936
 [81] -0.735950733  0.956962061  0.481262373 -0.546057804  1.781648041
 [86]  0.050011823  0.012331823  1.018713534 -0.516224011 -0.703314679
 [91]  1.165767758  0.558530197 -0.657382035  1.208871710 -0.065155270
 [96] -0.877859429  0.419913700  0.565142590 -0.433705162  0.807719074
> rowSums(tmp2)
  [1]  0.248840638 -0.408873967 -0.596148641  1.045601659 -0.037613205
  [6] -1.889953364  0.182464264  1.050490644  3.185546591  0.348120460
 [11]  1.609630593  0.502036318  0.657196959 -1.562853505 -0.019234321
 [16] -1.392176586 -0.860043915 -1.128422001  1.241736852 -0.300668723
 [21] -0.143225614 -0.863354309  1.341055600 -0.373158226 -0.083084934
 [26]  1.267946697  0.131490180  1.156120288 -0.296191294 -0.272146638
 [31]  0.860287723 -0.192301528 -0.214767413  0.172572679 -1.058481446
 [36] -0.208935106  1.195089297 -0.901351197 -0.104518795 -0.720509509
 [41] -1.135694884  0.209003642  0.428793851  0.455247368 -1.228344237
 [46]  1.404521707 -1.537775528 -1.347822300  1.266715970  0.056067384
 [51]  0.135763226  1.030351209  1.625995125 -0.861080982  1.038564851
 [56] -1.134546380  1.144514638  1.195193505  1.072413774 -2.115573500
 [61] -0.673034371 -0.064428871  1.368383680  0.007006474  0.061846354
 [66] -0.121775811  0.352034927 -1.426095992  1.816324240  0.816251184
 [71]  1.547072411 -0.489445902 -0.862476140 -1.809649696 -0.100804634
 [76]  1.536297774  0.608904488  2.444944510  1.104436246 -1.779804936
 [81] -0.735950733  0.956962061  0.481262373 -0.546057804  1.781648041
 [86]  0.050011823  0.012331823  1.018713534 -0.516224011 -0.703314679
 [91]  1.165767758  0.558530197 -0.657382035  1.208871710 -0.065155270
 [96] -0.877859429  0.419913700  0.565142590 -0.433705162  0.807719074
> 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.248840638 -0.408873967 -0.596148641  1.045601659 -0.037613205
  [6] -1.889953364  0.182464264  1.050490644  3.185546591  0.348120460
 [11]  1.609630593  0.502036318  0.657196959 -1.562853505 -0.019234321
 [16] -1.392176586 -0.860043915 -1.128422001  1.241736852 -0.300668723
 [21] -0.143225614 -0.863354309  1.341055600 -0.373158226 -0.083084934
 [26]  1.267946697  0.131490180  1.156120288 -0.296191294 -0.272146638
 [31]  0.860287723 -0.192301528 -0.214767413  0.172572679 -1.058481446
 [36] -0.208935106  1.195089297 -0.901351197 -0.104518795 -0.720509509
 [41] -1.135694884  0.209003642  0.428793851  0.455247368 -1.228344237
 [46]  1.404521707 -1.537775528 -1.347822300  1.266715970  0.056067384
 [51]  0.135763226  1.030351209  1.625995125 -0.861080982  1.038564851
 [56] -1.134546380  1.144514638  1.195193505  1.072413774 -2.115573500
 [61] -0.673034371 -0.064428871  1.368383680  0.007006474  0.061846354
 [66] -0.121775811  0.352034927 -1.426095992  1.816324240  0.816251184
 [71]  1.547072411 -0.489445902 -0.862476140 -1.809649696 -0.100804634
 [76]  1.536297774  0.608904488  2.444944510  1.104436246 -1.779804936
 [81] -0.735950733  0.956962061  0.481262373 -0.546057804  1.781648041
 [86]  0.050011823  0.012331823  1.018713534 -0.516224011 -0.703314679
 [91]  1.165767758  0.558530197 -0.657382035  1.208871710 -0.065155270
 [96] -0.877859429  0.419913700  0.565142590 -0.433705162  0.807719074
> rowMin(tmp2)
  [1]  0.248840638 -0.408873967 -0.596148641  1.045601659 -0.037613205
  [6] -1.889953364  0.182464264  1.050490644  3.185546591  0.348120460
 [11]  1.609630593  0.502036318  0.657196959 -1.562853505 -0.019234321
 [16] -1.392176586 -0.860043915 -1.128422001  1.241736852 -0.300668723
 [21] -0.143225614 -0.863354309  1.341055600 -0.373158226 -0.083084934
 [26]  1.267946697  0.131490180  1.156120288 -0.296191294 -0.272146638
 [31]  0.860287723 -0.192301528 -0.214767413  0.172572679 -1.058481446
 [36] -0.208935106  1.195089297 -0.901351197 -0.104518795 -0.720509509
 [41] -1.135694884  0.209003642  0.428793851  0.455247368 -1.228344237
 [46]  1.404521707 -1.537775528 -1.347822300  1.266715970  0.056067384
 [51]  0.135763226  1.030351209  1.625995125 -0.861080982  1.038564851
 [56] -1.134546380  1.144514638  1.195193505  1.072413774 -2.115573500
 [61] -0.673034371 -0.064428871  1.368383680  0.007006474  0.061846354
 [66] -0.121775811  0.352034927 -1.426095992  1.816324240  0.816251184
 [71]  1.547072411 -0.489445902 -0.862476140 -1.809649696 -0.100804634
 [76]  1.536297774  0.608904488  2.444944510  1.104436246 -1.779804936
 [81] -0.735950733  0.956962061  0.481262373 -0.546057804  1.781648041
 [86]  0.050011823  0.012331823  1.018713534 -0.516224011 -0.703314679
 [91]  1.165767758  0.558530197 -0.657382035  1.208871710 -0.065155270
 [96] -0.877859429  0.419913700  0.565142590 -0.433705162  0.807719074
> 
> colMeans(tmp2)
[1] 0.1309773
> colSums(tmp2)
[1] 13.09773
> colVars(tmp2)
[1] 1.049724
> colSd(tmp2)
[1] 1.02456
> colMax(tmp2)
[1] 3.185547
> colMin(tmp2)
[1] -2.115573
> colMedians(tmp2)
[1] 0.0530396
> colRanges(tmp2)
          [,1]
[1,] -2.115573
[2,]  3.185547
> 
> dataset1 <- matrix(dataset1,1,100)
> 
> agree.checks(tmp,dataset1)
> 
> dataset2 <- matrix(dataset2,100,1)
> agree.checks(tmp2,dataset2)
>   
> 
> tmp <- createBufferedMatrix(10,10)
> 
> tmp[1:10,1:10] <- rnorm(100)
> colApply(tmp,sum)
 [1]  1.47283506  0.09938974  3.31623992 -0.03625166  3.07126075 -4.06869117
 [7]  0.70843837  5.11153118  1.75496839 -0.33277842
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -1.1970611
[2,] -0.7022634
[3,] -0.1595201
[4,]  1.0565498
[5,]  1.8032590
> 
> rowApply(tmp,sum)
 [1]  1.2712229  2.4087024 -2.2947516  1.4872039  2.5507423  1.2961975
 [7]  1.7350563  0.3699517  2.2509972  0.0216196
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    3    3   10    2   10   10   10    2    1     5
 [2,]    1    9    5    4    4    8    2    7    5     8
 [3,]   10    8    3   10    6    5    3    9    6     1
 [4,]    2   10    8    3    2    6    6    4    8     2
 [5,]    9    7    9    6    7    7    4    5    3     6
 [6,]    4    4    1    5    5    3    1    1    9     4
 [7,]    7    2    4    8    3    2    5   10    2     7
 [8,]    8    1    7    7    8    4    9    6   10     9
 [9,]    5    5    2    9    9    1    8    8    4    10
[10,]    6    6    6    1    1    9    7    3    7     3
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1] -3.37444060  1.97038773  0.92698669 -2.48791231 -4.17435132  1.06031828
 [7]  0.24500333 -2.38182383 -1.64796251  1.53199994  0.05897746 -2.71142749
[13] -1.56443809  5.38423326 -3.51369412 -1.73246595 -1.53146887  2.66763601
[19] -0.30401594  1.57170680
> colApply(tmp,quantile)[,1]
              [,1]
[1,] -1.5149108636
[2,] -1.3882765615
[3,] -1.3650830516
[4,]  0.0008617179
[5,]  0.8929681624
> 
> rowApply(tmp,sum)
[1] -2.07993726 -9.56539097 -0.03410332  0.61960769  1.05307233
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]    4   14    1    3   17
[2,]   12    9   18   18    4
[3,]    5   16   10    7   20
[4,]   10    7    5    8    9
[5,]    7    3    2   11    6
> 
> 
> as.matrix(tmp)
              [,1]       [,2]        [,3]       [,4]       [,5]       [,6]
[1,] -1.3882765615  0.3781846 -1.12236299 -0.3464540 -1.0603577  1.5881741
[2,]  0.0008617179 -0.6430383  0.37358779 -1.1006706 -1.5621356 -0.1559635
[3,] -1.3650830516  1.1296600  0.01278887 -0.5172741 -1.2490361 -0.2366612
[4,] -1.5149108636  1.7557577 -0.54966341 -0.2700668  0.2736160  0.5104886
[5,]  0.8929681624 -0.6501763  2.21263642 -0.2534468 -0.5764381 -0.6457197
           [,7]        [,8]        [,9]      [,10]       [,11]      [,12]
[1,]  1.3372147 -2.48963494 -2.33523365 -0.1832274  0.71924229  0.7155598
[2,] -1.6311532  0.43138564 -0.51667472 -1.6397646  0.66577530 -0.9009823
[3,]  1.1844840  0.01386105  1.37793074  0.7796778  0.04869706 -1.0998107
[4,]  0.3657746 -0.67262434 -0.11087809  1.7526914 -2.60124619 -0.7697600
[5,] -1.0113168  0.33518876 -0.06310677  0.8226227  1.22650901 -0.6564342
          [,13]      [,14]       [,15]      [,16]      [,17]       [,18]
[1,] -1.4307394  2.8003422 -0.76856986 -1.0699352 -0.4078150  1.77042990
[2,] -0.4792029 -1.5494883 -1.38116785  0.9107850  0.3392184  0.58781377
[3,] -0.9840943  0.7985624  0.02385585 -0.1561299 -0.1219082 -0.06599457
[4,]  1.7857420  2.2622660 -1.00059432  0.7204038 -2.1510826  0.33379096
[5,] -0.4561435  1.0725509 -0.38721794 -2.1375897  0.8101186  0.04159596
           [,19]       [,20]
[1,]  0.61486668  0.59865510
[2,] -1.30079870 -0.01377806
[3,]  0.05529079  0.33708020
[4,]  0.37906618  0.12083702
[5,] -0.05244089  0.52891254
> 
> 
> 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 :  654  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 :  566  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.594943 0.941872 -1.065794 -0.2141304 0.3105614 0.1853977 0.9046362
         col8      col9    col10      col11      col12      col13     col14
row1 1.861294 0.6166093 0.346799 -0.7485064 -0.3688432 0.04997149 -1.759944
         col15      col16     col17     col18    col19     col20
row1 0.9969174 -0.9988823 0.2824665 -0.521472 -1.02472 -1.997528
> tmp[,"col10"]
          col10
row1  0.3467990
row2  0.2171045
row3  0.4163749
row4 -1.2393898
row5 -0.7695958
> tmp[c("row1","row5"),]
           col1     col2       col3       col4      col5       col6       col7
row1 1.59494255 0.941872 -1.0657935 -0.2141304 0.3105614  0.1853977  0.9046362
row5 0.07504866 2.232622  0.6575819 -0.9806116 1.5807834 -0.3399457 -0.9859912
          col8      col9      col10      col11      col12      col13     col14
row1 1.8612940 0.6166093  0.3467990 -0.7485064 -0.3688432 0.04997149 -1.759944
row5 0.4235093 0.8688538 -0.7695958  1.1802118 -0.9041583 0.27169971 -1.070238
           col15      col16      col17      col18    col19      col20
row1  0.99691742 -0.9988823  0.2824665 -0.5214720 -1.02472 -1.9975282
row5 -0.00018016  0.6865384 -0.3581402 -0.1684826  1.20371 -0.3263458
> tmp[,c("col6","col20")]
           col6      col20
row1  0.1853977 -1.9975282
row2 -0.2241510  1.0664005
row3  0.9212025 -0.8403772
row4 -0.4365743  2.0138969
row5 -0.3399457 -0.3263458
> tmp[c("row1","row5"),c("col6","col20")]
           col6      col20
row1  0.1853977 -1.9975282
row5 -0.3399457 -0.3263458
> 
> 
> 
> 
> tmp["row1",] <- rnorm(20,mean=10)
> tmp[,"col10"] <- rnorm(5,mean=30)
> tmp[c("row1","row5"),] <- rnorm(40,mean=50)
> tmp[,c("col6","col20")] <- rnorm(10,mean=75)
> tmp[c("row1","row5"),c("col6","col20")]  <- rnorm(4,mean=105)
> 
> tmp["row1",]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 48.78427 50.06355 50.03719 50.09459 49.37663 104.9808 49.79479 49.72661
         col9  col10    col11    col12    col13    col14    col15    col16
row1 50.03449 49.563 49.27125 50.24699 50.84155 50.37653 50.28265 48.48602
        col17   col18    col19    col20
row1 50.44987 49.5337 50.43454 104.2874
> tmp[,"col10"]
        col10
row1 49.56300
row2 30.28676
row3 29.61827
row4 29.82967
row5 50.09346
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 48.78427 50.06355 50.03719 50.09459 49.37663 104.9808 49.79479 49.72661
row5 48.81848 49.78104 50.89934 50.79583 50.32044 104.1732 51.50710 51.09256
         col9    col10    col11    col12    col13    col14    col15    col16
row1 50.03449 49.56300 49.27125 50.24699 50.84155 50.37653 50.28265 48.48602
row5 50.32358 50.09346 48.28800 51.21872 48.77067 51.63362 49.32695 50.18257
        col17    col18    col19    col20
row1 50.44987 49.53370 50.43454 104.2874
row5 49.17984 50.21674 49.18057 103.4411
> tmp[,c("col6","col20")]
          col6     col20
row1 104.98080 104.28742
row2  76.72428  75.25290
row3  74.92599  73.30623
row4  75.08003  72.93178
row5 104.17325 103.44112
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 104.9808 104.2874
row5 104.1732 103.4411
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 104.9808 104.2874
row5 104.1732 103.4411
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
          col13
[1,] -0.8327887
[2,] -1.1851628
[3,]  0.4218791
[4,]  0.0405425
[5,]  0.4002786
> tmp[,c("col17","col7")]
          col17       col7
[1,]  1.7328352  1.1683005
[2,] -0.9411953  1.2124209
[3,] -1.1061667 -0.7643607
[4,] -0.3488518  0.1389985
[5,]  0.6826849  0.7146457
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
           col6      col20
[1,] -0.3529212 -1.8042952
[2,]  1.4630871  0.4085798
[3,]  0.6417615  0.7194042
[4,] -0.4561440 -1.0948428
[5,] -0.5164132  0.9342489
> subBufferedMatrix(tmp,1,c("col6"))[,1]
           col1
[1,] -0.3529212
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
           col6
[1,] -0.3529212
[2,]  1.4630871
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> 
> 
> 
> subBufferedMatrix(tmp,c("row3","row1"),)[,1:20]
          [,1]        [,2]       [,3]      [,4]     [,5]      [,6]       [,7]
row3 0.5743954 -0.67225687  1.7492786 0.1726928 1.530392 0.6518495 -1.4054158
row1 0.1701057  0.06501907 -0.2067499 1.5305612 1.715019 0.7967479 -0.4492746
           [,8]       [,9]     [,10]      [,11]      [,12]      [,13]
row3 -0.3728570 -1.3790961 0.5475004 -1.1493399 -0.3044534  0.7475198
row1 -0.3831365 -0.9929765 0.1559940 -0.3793817  0.1766553 -0.2547157
          [,14]     [,15]      [,16]      [,17]     [,18]      [,19]      [,20]
row3 -0.8246722 0.7737047  0.2657382  1.5087105 0.1595589  1.1605875 -0.5379114
row1  1.5154463 0.2990620 -0.2608680 -0.8539336 0.2674354 -0.4428823  1.1870177
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
           [,1]      [,2]     [,3]      [,4]      [,5]       [,6]       [,7]
row2 -0.9402847 -1.498757 2.050579 0.3840688 -1.060156 -0.7741152 -0.5863667
          [,8]       [,9]     [,10]
row2 0.2525752 -0.4020415 -1.542485
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
          [,1]     [,2]       [,3]        [,4]       [,5]        [,6]    [,7]
row5 0.6549069 1.208672 -0.8715356 -0.03538667 0.03988461 -0.09627284 1.56193
           [,8]       [,9]     [,10]     [,11]     [,12]    [,13]    [,14]
row5 -0.1756999 -0.5268368 0.8246704 0.2068508 0.4738723 1.261676 1.388103
          [,15]      [,16]     [,17]     [,18]      [,19]     [,20]
row5 -0.7882521 -0.5046599 0.1835293 0.7516936 -0.3628447 -1.270817
> 
> 
> 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: 0x6000012ec060>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM1167949e2389f"
 [2] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM1167922f3749e"
 [3] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM116791d6d42ff"
 [4] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM1167970498270"
 [5] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM116796a12c0a7"
 [6] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM1167975264a58"
 [7] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM1167924db137e"
 [8] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM116792adcc819"
 [9] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM116794d4f74b" 
[10] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM1167939b75f67"
[11] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM1167935d880cb"
[12] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM1167918efab0b"
[13] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM116791ec66bf7"
[14] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM1167974da34e9"
[15] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM1167921c7e8ee"
> 
> 
> ### 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: 0x60000123c180>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x60000123c180>
Warning message:
In dir.create(new.directory) :
  '/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x60000123c180>
> rowMedians(tmp)
  [1]  0.024856709 -0.270597135  0.018262789 -0.012742835  0.201490943
  [6] -0.292302305 -0.006914134  0.128567813  0.066684723  0.038333924
 [11]  0.118108084 -0.200214199  0.770122217 -0.325717185  0.806921669
 [16] -0.154152076 -0.355902524  0.322894816 -0.076930878 -0.143009381
 [21]  0.033922383 -0.124141325 -0.458728492 -0.096618578 -0.399431249
 [26]  0.438006668  0.519757369 -0.040574967 -0.249545426 -0.219404314
 [31] -0.270711443 -0.046368162 -0.331654605  0.050860629  0.213185098
 [36] -0.455960277  0.051269373 -0.498442870 -0.363512263 -0.069572882
 [41] -0.006294277 -0.263189896  0.405208356  0.119564923 -0.086704554
 [46]  0.321898692 -0.011488369  0.242082044  0.392146998 -0.381986810
 [51]  0.608082826 -0.209752358 -0.155463050  0.330038049 -0.141108533
 [56] -0.036245467 -0.604819106  0.464832156 -0.624425393  0.016048388
 [61]  0.266661461 -0.408057432  0.406197082 -0.173551407 -0.387520593
 [66]  0.036761536  0.122689515 -0.193397452 -0.157488525  0.115360296
 [71]  0.090938727  0.240758768 -0.451843198  0.054307566  0.108861316
 [76]  0.040202589 -0.265420128 -0.137547314 -0.103978879 -0.186557016
 [81] -0.230185058 -0.328306072  0.168356588 -0.281494425 -0.177140499
 [86]  0.681710573 -0.484847829  0.018534831 -0.117995467  0.046965583
 [91] -0.331982893  0.022566339 -0.061460068  0.013712513  0.655984393
 [96]  0.401511167 -0.084824196  0.482477969 -0.475084122  0.120899592
[101] -0.218972244 -0.462427188  0.024967211 -0.241483722  0.235345581
[106] -0.152268772 -0.259524778 -0.233100051 -0.054566384 -0.065766594
[111] -0.012467217  0.465963167 -0.437057209 -0.170716502  0.332390982
[116]  0.027728440  0.454761862 -0.523598860 -0.142777931  0.025886221
[121]  0.358782907  0.350975043  0.535598301 -0.339116748 -0.344046974
[126]  0.828059796 -0.067278310  0.238343990 -0.760576244 -0.522847244
[131] -0.541333513  0.520945274  0.442032758 -0.090735728 -0.081139022
[136] -0.436707115  0.267773582  0.194154274 -0.122821061  0.044401168
[141]  0.266631574 -0.102514467 -0.178237795  0.280487743  0.261098208
[146]  0.089585455 -0.199023395  0.247411636 -0.236270148  0.454331655
[151] -0.125985595  0.351428016 -0.462187743  0.112850300 -0.149565870
[156] -0.046051213  0.546537881  0.319798097  0.048769561  0.285316596
[161] -0.097768515 -0.228189981 -0.462376393  0.171892115 -0.322832653
[166]  0.381486903 -0.411148247 -0.090284313  0.556520122 -0.472058207
[171] -0.285253626 -0.142753921 -0.211952992  0.158956154  0.252144123
[176] -0.635410174  0.438745403  0.411010227 -0.222607360  0.201479532
[181] -0.209450430  0.189200517 -0.628216747  0.230742843  0.025443056
[186] -0.086070890 -0.456137588 -0.601812322  0.131447135 -0.411556109
[191] -0.379060198 -0.278393919 -0.325755615 -0.280169130  0.087202453
[196]  0.113667849  0.089351682 -0.502295249 -0.317001969  0.291748276
[201] -0.066095261  0.415475841 -0.265558241 -0.159209795 -0.223602951
[206] -0.275489700 -0.555293843  0.088350348 -0.119833042 -0.116720028
[211] -0.022181277 -0.271323010 -0.191364097  0.147743337  0.366791311
[216]  0.371147488 -0.188958458 -0.087167775 -0.214564414  0.194844687
[221]  0.150126890  0.357661285 -0.466946706 -0.182030377 -0.319869159
[226] -0.651089611 -0.116429130  0.263908904 -0.014566202  0.288674020
> 
> proc.time()
   user  system elapsed 
  2.460  13.955  16.806 

BufferedMatrix.Rcheck/tests/rawCalltesting.Rout


R version 4.5.1 Patched (2025-09-10 r88807) -- "Great Square Root"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: 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: 0x6000038b00c0>
> .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: 0x6000038b00c0>
> .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: 0x6000038b00c0>
> .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: 0x6000038b00c0>
> 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: 0x6000038ac000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000038ac000>
> .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: 0x6000038ac000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000038ac000>
> .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: 0x6000038ac000>
> 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: 0x6000038ac180>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000038ac180>
> .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: 0x6000038ac180>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x6000038ac180>
> .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: 0x6000038ac180>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x6000038ac180>
> .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: 0x6000038ac180>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x6000038ac180>
> .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: 0x6000038ac180>
> 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: 0x6000038e4120>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x6000038e4120>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000038e4120>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000038e4120>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile119d3142cc4fe" "BufferedMatrixFile119d37390a0b" 
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile119d3142cc4fe" "BufferedMatrixFile119d37390a0b" 
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000038e4360>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000038e4360>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x6000038e4360>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x6000038e4360>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x6000038e4360>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x6000038e4360>
> .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: 0x6000038b0180>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000038b0180>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x6000038b0180>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x6000038b0180>
> 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: 0x6000038a8000>
> .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: 0x6000038a8000>
> rm(P)
> 
> proc.time()
   user  system elapsed 
  0.322   0.152   0.475 

BufferedMatrix.Rcheck/tests/Rcodetesting.Rout


R version 4.5.1 Patched (2025-09-10 r88807) -- "Great Square Root"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: 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.299   0.085   0.382 

Example timings