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

This page was generated on 2025-05-11 12:08 -0400 (Sun, 11 May 2025).

HostnameOSArch (*)R versionInstalled pkgs
nebbiolo2Linux (Ubuntu 24.04.1 LTS)x86_644.5.0 (2025-04-11) -- "How About a Twenty-Six" 4749
palomino8Windows Server 2022 Datacenterx644.5.0 (2025-04-11 ucrt) -- "How About a Twenty-Six" 4510
lconwaymacOS 12.7.1 Montereyx86_644.5.0 Patched (2025-04-21 r88169) -- "How About a Twenty-Six" 4548
kjohnson3macOS 13.7.1 Venturaarm644.5.0 Patched (2025-04-21 r88169) -- "How About a Twenty-Six" 4489
taishanLinux (openEuler 24.03 LTS)aarch644.5.0 (2025-04-11) -- "How About a Twenty-Six" 4449
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 250/2304HostnameOS / ArchINSTALLBUILDCHECKBUILD BIN
BufferedMatrix 1.73.0  (landing page)
Ben Bolstad
Snapshot Date: 2025-05-09 13:00 -0400 (Fri, 09 May 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.1 LTS) / x86_64  OK    OK    OK  UNNEEDED, same version is already published
palomino8Windows Server 2022 Datacenter / x64  OK    OK    OK    OK  UNNEEDED, same version is already published
lconwaymacOS 12.7.1 Monterey / x86_64  OK    OK    WARNINGS    OK  UNNEEDED, same version is already published
kjohnson3macOS 13.7.1 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-05-09 19:35:25 -0400 (Fri, 09 May 2025)
EndedAt: 2025-05-09 19:36:19 -0400 (Fri, 09 May 2025)
EllapsedTime: 53.9 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.0 Patched (2025-04-21 r88169)
* 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.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.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.0 Patched (2025-04-21 r88169) -- "How About a Twenty-Six"
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.345   0.148   0.483 

BufferedMatrix.Rcheck/tests/objectTesting.Rout


R version 4.5.0 Patched (2025-04-21 r88169) -- "How About a Twenty-Six"
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 480829 25.7    1056567 56.5         NA   634460 33.9
Vcells 891038  6.8    8388608 64.0      98304  2108473 16.1
> 
> 
> 
> 
> ##
> ## checking reads
> ##
> 
> tmp2 <- createBufferedMatrix(10,20)
> 
> test.sample <- rnorm(10*20)
> 
> tmp2[1:10,1:20] <- test.sample
> 
> test.matrix <- matrix(test.sample,10,20)
> 
> ## testing reads
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   which.col <- sample(1:20,1)
+   if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> date()
[1] "Fri May  9 19:35:49 2025"
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> date()
[1] "Fri May  9 19:35:49 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: 0x600000388000>
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   which.col <- sample(1:20,1)
+   if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,5,replace=TRUE)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> date()
[1] "Fri May  9 19:35:55 2025"
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col <- sample(1:20,5,replace=TRUE)
+   if (!all(tmp2[which.row,which.col] == test.matrix[which.row,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> date()
[1] "Fri May  9 19:35:56 2025"
> 
> ColMode(tmp2)
<pointer: 0x600000388000>
> 
> 
> 
> ### Now testing assignments
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+ 
+   new.data <- rnorm(20)
+   tmp2[which.row,] <- new.data
+   test.matrix[which.row,] <- new.data
+   if (rep > 1){
+     if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+   
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   new.data <- rnorm(10)
+   tmp2[,which.col] <- new.data
+   test.matrix[,which.col]<- new.data
+ 
+   if (rep > 1){
+     if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.col <- which.col
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,5,replace=TRUE)
+   new.data <- matrix(rnorm(50),5,10)
+   tmp2[,which.col] <- new.data
+   test.matrix[,which.col]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.col <- which.col
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   new.data <- matrix(rnorm(50),5,10)
+   tmp2[which.row,] <- new.data
+   test.matrix[which.row,]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col  <- sample(1:20,5,replace=TRUE)
+   new.data <- matrix(rnorm(25),5,5)
+   tmp2[which.row,which.col] <- new.data
+   test.matrix[which.row,which.col]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[prev.row,prev.col] == test.matrix[prev.row,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+   prev.col <- which.col
+ }
> 
> 
> 
> 
> ###
> ###
> ### testing some more functions
> ###
> 
> 
> 
> ## duplication function
> tmp5 <- duplicate(tmp2)
> 
> # making sure really did copy everything.
> tmp5[1,1] <- tmp5[1,1] +100.00
> 
> if (tmp5[1,1] == tmp2[1,1]){
+   stop("Problem with duplication")
+ }
> 
> 
> 
> 
> ### testing elementwise applying of functions
> 
> tmp5[1:4,1:4]
           [,1]      [,2]       [,3]       [,4]
[1,] 99.1847028 1.8179621 -0.3067778 -1.3966477
[2,]  0.6101502 1.5575332 -2.0934298 -0.4091534
[3,]  0.3143060 0.4192273 -0.7799008  0.5627296
[4,] -0.3133959 0.1362084  0.7134991 -1.5542486
> ewApply(tmp5,abs)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
           [,1]      [,2]      [,3]      [,4]
[1,] 99.1847028 1.8179621 0.3067778 1.3966477
[2,]  0.6101502 1.5575332 2.0934298 0.4091534
[3,]  0.3143060 0.4192273 0.7799008 0.5627296
[4,]  0.3133959 0.1362084 0.7134991 1.5542486
> ewApply(tmp5,sqrt)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
          [,1]      [,2]      [,3]     [,4]
[1,] 9.9591517 1.3483183 0.5538752 1.181798
[2,] 0.7811211 1.2480117 1.4468690 0.639651
[3,] 0.5606300 0.6474776 0.8831199 0.750153
[4,] 0.5598178 0.3690642 0.8446887 1.246695
> 
> my.function <- function(x,power){
+   (x+5)^power
+ }
> 
> ewApply(tmp5,my.function,power=2)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
          [,1]     [,2]     [,3]     [,4]
[1,] 223.77622 40.30114 30.84553 38.21463
[2,]  33.42136 39.03765 41.56212 31.80566
[3,]  30.92061 31.89400 34.61110 33.06426
[4,]  30.91157 28.82685 34.16039 39.02120
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x600000380000>
> exp(tmp5)
<pointer: 0x600000380000>
> log(tmp5,2)
<pointer: 0x600000380000>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 465.7609
> Min(tmp5)
[1] 52.98831
> mean(tmp5)
[1] 72.21238
> Sum(tmp5)
[1] 14442.48
> Var(tmp5)
[1] 853.3907
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 90.62526 69.59397 68.35810 68.78413 71.38078 71.19291 71.24356 68.75921
 [9] 69.58497 72.60093
> rowSums(tmp5)
 [1] 1812.505 1391.879 1367.162 1375.683 1427.616 1423.858 1424.871 1375.184
 [9] 1391.699 1452.019
> rowVars(tmp5)
 [1] 7903.97807   80.03057   82.23331   47.39912   77.00936   43.60067
 [7]   92.50323   67.90810   58.77848   69.81248
> rowSd(tmp5)
 [1] 88.904320  8.945981  9.068258  6.884702  8.775498  6.603080  9.617860
 [8]  8.240637  7.666713  8.355386
> rowMax(tmp5)
 [1] 465.76088  86.50611  84.47228  81.21751  86.35244  84.45650  88.62461
 [8]  80.61088  87.97754  87.91841
> rowMin(tmp5)
 [1] 57.66006 57.05839 54.83906 55.26416 56.43210 62.77270 52.98831 53.43391
 [9] 59.87372 56.43802
> 
> colMeans(tmp5)
 [1] 112.57020  69.21048  72.45570  71.06959  71.84081  69.76668  67.13756
 [8]  69.00759  67.37860  70.92563  73.18063  67.25626  71.17337  72.74826
[15]  71.17528  68.89077  65.48706  68.71591  71.42183  72.83541
> colSums(tmp5)
 [1] 1125.7020  692.1048  724.5570  710.6959  718.4081  697.6668  671.3756
 [8]  690.0759  673.7860  709.2563  731.8063  672.5626  711.7337  727.4826
[15]  711.7528  688.9077  654.8706  687.1591  714.2183  728.3541
> colVars(tmp5)
 [1] 15466.48516    83.76609    89.74419    82.28039    41.27036    66.34501
 [7]   104.98270    51.87233    98.09136    51.44430   139.24371    70.45936
[13]    76.27180   111.77774    58.95957    35.68959    65.56454    47.21484
[19]    46.94536    76.85249
> colSd(tmp5)
 [1] 124.364324   9.152382   9.473341   9.070854   6.424201   8.145245
 [7]  10.246107   7.202245   9.904108   7.172468  11.800157   8.394007
[13]   8.733373  10.572499   7.678513   5.974076   8.097193   6.871305
[19]   6.851669   8.766555
> colMax(tmp5)
 [1] 465.76088  83.88155  87.91841  83.85792  80.47722  84.49593  80.34488
 [8]  81.50561  86.35244  81.07470  94.26008  83.26016  87.97754  85.26996
[15]  84.47228  78.21414  78.11757  78.51800  84.12654  84.52386
> colMin(tmp5)
 [1] 64.33839 56.43210 61.10383 57.02772 64.17009 59.24793 52.98831 58.79255
 [9] 55.26416 59.16993 53.43391 54.83906 56.43802 57.10618 59.92205 60.67404
[17] 56.74500 57.71377 62.32973 62.74608
> 
> 
> ### 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.62526 69.59397 68.35810 68.78413 71.38078 71.19291       NA 68.75921
 [9] 69.58497 72.60093
> rowSums(tmp5)
 [1] 1812.505 1391.879 1367.162 1375.683 1427.616 1423.858       NA 1375.184
 [9] 1391.699 1452.019
> rowVars(tmp5)
 [1] 7903.97807   80.03057   82.23331   47.39912   77.00936   43.60067
 [7]   94.96059   67.90810   58.77848   69.81248
> rowSd(tmp5)
 [1] 88.904320  8.945981  9.068258  6.884702  8.775498  6.603080  9.744772
 [8]  8.240637  7.666713  8.355386
> rowMax(tmp5)
 [1] 465.76088  86.50611  84.47228  81.21751  86.35244  84.45650        NA
 [8]  80.61088  87.97754  87.91841
> rowMin(tmp5)
 [1] 57.66006 57.05839 54.83906 55.26416 56.43210 62.77270       NA 53.43391
 [9] 59.87372 56.43802
> 
> colMeans(tmp5)
 [1] 112.57020  69.21048  72.45570  71.06959        NA  69.76668  67.13756
 [8]  69.00759  67.37860  70.92563  73.18063  67.25626  71.17337  72.74826
[15]  71.17528  68.89077  65.48706  68.71591  71.42183  72.83541
> colSums(tmp5)
 [1] 1125.7020  692.1048  724.5570  710.6959        NA  697.6668  671.3756
 [8]  690.0759  673.7860  709.2563  731.8063  672.5626  711.7337  727.4826
[15]  711.7528  688.9077  654.8706  687.1591  714.2183  728.3541
> colVars(tmp5)
 [1] 15466.48516    83.76609    89.74419    82.28039          NA    66.34501
 [7]   104.98270    51.87233    98.09136    51.44430   139.24371    70.45936
[13]    76.27180   111.77774    58.95957    35.68959    65.56454    47.21484
[19]    46.94536    76.85249
> colSd(tmp5)
 [1] 124.364324   9.152382   9.473341   9.070854         NA   8.145245
 [7]  10.246107   7.202245   9.904108   7.172468  11.800157   8.394007
[13]   8.733373  10.572499   7.678513   5.974076   8.097193   6.871305
[19]   6.851669   8.766555
> colMax(tmp5)
 [1] 465.76088  83.88155  87.91841  83.85792        NA  84.49593  80.34488
 [8]  81.50561  86.35244  81.07470  94.26008  83.26016  87.97754  85.26996
[15]  84.47228  78.21414  78.11757  78.51800  84.12654  84.52386
> colMin(tmp5)
 [1] 64.33839 56.43210 61.10383 57.02772       NA 59.24793 52.98831 58.79255
 [9] 55.26416 59.16993 53.43391 54.83906 56.43802 57.10618 59.92205 60.67404
[17] 56.74500 57.71377 62.32973 62.74608
> 
> Max(tmp5,na.rm=TRUE)
[1] 465.7609
> Min(tmp5,na.rm=TRUE)
[1] 52.98831
> mean(tmp5,na.rm=TRUE)
[1] 72.25128
> Sum(tmp5,na.rm=TRUE)
[1] 14378
> Var(tmp5,na.rm=TRUE)
[1] 857.3966
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 90.62526 69.59397 68.35810 68.78413 71.38078 71.19291 71.59997 68.75921
 [9] 69.58497 72.60093
> rowSums(tmp5,na.rm=TRUE)
 [1] 1812.505 1391.879 1367.162 1375.683 1427.616 1423.858 1360.399 1375.184
 [9] 1391.699 1452.019
> rowVars(tmp5,na.rm=TRUE)
 [1] 7903.97807   80.03057   82.23331   47.39912   77.00936   43.60067
 [7]   94.96059   67.90810   58.77848   69.81248
> rowSd(tmp5,na.rm=TRUE)
 [1] 88.904320  8.945981  9.068258  6.884702  8.775498  6.603080  9.744772
 [8]  8.240637  7.666713  8.355386
> rowMax(tmp5,na.rm=TRUE)
 [1] 465.76088  86.50611  84.47228  81.21751  86.35244  84.45650  88.62461
 [8]  80.61088  87.97754  87.91841
> rowMin(tmp5,na.rm=TRUE)
 [1] 57.66006 57.05839 54.83906 55.26416 56.43210 62.77270 52.98831 53.43391
 [9] 59.87372 56.43802
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 112.57020  69.21048  72.45570  71.06959  72.65959  69.76668  67.13756
 [8]  69.00759  67.37860  70.92563  73.18063  67.25626  71.17337  72.74826
[15]  71.17528  68.89077  65.48706  68.71591  71.42183  72.83541
> colSums(tmp5,na.rm=TRUE)
 [1] 1125.7020  692.1048  724.5570  710.6959  653.9363  697.6668  671.3756
 [8]  690.0759  673.7860  709.2563  731.8063  672.5626  711.7337  727.4826
[15]  711.7528  688.9077  654.8706  687.1591  714.2183  728.3541
> colVars(tmp5,na.rm=TRUE)
 [1] 15466.48516    83.76609    89.74419    82.28039    38.88707    66.34501
 [7]   104.98270    51.87233    98.09136    51.44430   139.24371    70.45936
[13]    76.27180   111.77774    58.95957    35.68959    65.56454    47.21484
[19]    46.94536    76.85249
> colSd(tmp5,na.rm=TRUE)
 [1] 124.364324   9.152382   9.473341   9.070854   6.235950   8.145245
 [7]  10.246107   7.202245   9.904108   7.172468  11.800157   8.394007
[13]   8.733373  10.572499   7.678513   5.974076   8.097193   6.871305
[19]   6.851669   8.766555
> colMax(tmp5,na.rm=TRUE)
 [1] 465.76088  83.88155  87.91841  83.85792  80.47722  84.49593  80.34488
 [8]  81.50561  86.35244  81.07470  94.26008  83.26016  87.97754  85.26996
[15]  84.47228  78.21414  78.11757  78.51800  84.12654  84.52386
> colMin(tmp5,na.rm=TRUE)
 [1] 64.33839 56.43210 61.10383 57.02772 64.17009 59.24793 52.98831 58.79255
 [9] 55.26416 59.16993 53.43391 54.83906 56.43802 57.10618 59.92205 60.67404
[17] 56.74500 57.71377 62.32973 62.74608
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1] 90.62526 69.59397 68.35810 68.78413 71.38078 71.19291      NaN 68.75921
 [9] 69.58497 72.60093
> rowSums(tmp5,na.rm=TRUE)
 [1] 1812.505 1391.879 1367.162 1375.683 1427.616 1423.858    0.000 1375.184
 [9] 1391.699 1452.019
> rowVars(tmp5,na.rm=TRUE)
 [1] 7903.97807   80.03057   82.23331   47.39912   77.00936   43.60067
 [7]         NA   67.90810   58.77848   69.81248
> rowSd(tmp5,na.rm=TRUE)
 [1] 88.904320  8.945981  9.068258  6.884702  8.775498  6.603080        NA
 [8]  8.240637  7.666713  8.355386
> rowMax(tmp5,na.rm=TRUE)
 [1] 465.76088  86.50611  84.47228  81.21751  86.35244  84.45650        NA
 [8]  80.61088  87.97754  87.91841
> rowMin(tmp5,na.rm=TRUE)
 [1] 57.66006 57.05839 54.83906 55.26416 56.43210 62.77270       NA 53.43391
 [9] 59.87372 56.43802
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1] 115.23082  69.05156  71.49733  69.64866       NaN  70.50301  68.70970
 [8]  69.16152  67.16898  69.80465  71.54200  67.37523  71.44434  73.20015
[15]  70.31225  68.94679  66.35090  68.75300  71.16563  73.87444
> colSums(tmp5,na.rm=TRUE)
 [1] 1037.0774  621.4641  643.4760  626.8379    0.0000  634.5270  618.3873
 [8]  622.4537  604.5208  628.2418  643.8780  606.3771  642.9991  658.8013
[15]  632.8103  620.5211  597.1581  618.7770  640.4907  664.8700
> colVars(tmp5,na.rm=TRUE)
 [1] 17320.15811    93.95273    90.62943    69.85135          NA    68.53876
 [7]    90.29978    58.08980   109.85846    43.73806   126.44179    79.10755
[13]    84.97971   123.45269    57.95033    40.11548    65.36507    53.10122
[19]    52.07511    74.31360
> colSd(tmp5,na.rm=TRUE)
 [1] 131.606072   9.692922   9.519949   8.357712         NA   8.278814
 [7]   9.502620   7.621667  10.481339   6.613476  11.244634   8.894242
[13]   9.218444  11.110927   7.612511   6.333679   8.084867   7.287058
[19]   7.216308   8.620534
> colMax(tmp5,na.rm=TRUE)
 [1] 465.76088  83.88155  87.91841  81.21751      -Inf  84.49593  80.34488
 [8]  81.50561  86.35244  81.07470  94.26008  83.26016  87.97754  85.26996
[15]  84.47228  78.21414  78.11757  78.51800  84.12654  84.52386
> colMin(tmp5,na.rm=TRUE)
 [1] 64.33839 56.43210 61.10383 57.02772      Inf 59.24793 57.42810 58.79255
 [9] 55.26416 59.16993 53.43391 54.83906 56.43802 57.10618 59.92205 60.67404
[17] 56.74500 57.71377 62.32973 62.74608
> 
> 
> 
> 
> 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] 269.4156 202.7350 122.8836 442.4624 214.3697 183.6696 144.3623 186.5742
 [9] 187.8155 312.8606
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 269.4156 202.7350 122.8836 442.4624 214.3697 183.6696 144.3623 186.5742
 [9] 187.8155 312.8606
> 
> 
> 
> 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  2.842171e-14 -8.526513e-14  0.000000e+00  8.526513e-14
 [6] -1.705303e-13 -2.842171e-14 -5.684342e-14  1.136868e-13  5.684342e-14
[11] -1.136868e-13 -2.557954e-13  1.705303e-13 -3.410605e-13  4.263256e-14
[16]  1.136868e-13  1.350031e-13 -5.684342e-14 -5.684342e-14  0.000000e+00
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> ## making sure these things agree
> ##
> ## first when there is no NA
> 
> 
> 
> agree.checks <- function(buff.matrix,r.matrix,err.tol=1e-10){
+ 
+   if (Max(buff.matrix,na.rm=TRUE) != max(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Max")
+   }
+   
+ 
+   if (Min(buff.matrix,na.rm=TRUE) != min(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Min")
+   }
+ 
+ 
+   if (abs(Sum(buff.matrix,na.rm=TRUE)- sum(r.matrix,na.rm=TRUE)) > err.tol){
+ 
+     cat(Sum(buff.matrix,na.rm=TRUE),"\n")
+     cat(sum(r.matrix,na.rm=TRUE),"\n")
+     cat(Sum(buff.matrix,na.rm=TRUE) - sum(r.matrix,na.rm=TRUE),"\n")
+     
+     stop("No agreement in Sum")
+   }
+   
+   if (abs(mean(buff.matrix,na.rm=TRUE) - mean(r.matrix,na.rm=TRUE)) > err.tol){
+     stop("No agreement in mean")
+   }
+   
+   
+   if(abs(Var(buff.matrix,na.rm=TRUE) - var(as.vector(r.matrix),na.rm=TRUE)) > err.tol){
+     stop("No agreement in Var")
+   }
+   
+   
+ 
+   if(any(abs(rowMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,mean,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowMeans")
+   }
+   
+   
+   if(any(abs(colMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,mean,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colMeans")
+   }
+   
+   
+   if(any(abs(rowSums(buff.matrix,na.rm=TRUE)  -  apply(r.matrix,1,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in rowSums")
+   }
+   
+   
+   if(any(abs(colSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colSums")
+   }
+   
+   ### this is to get around the fact that R doesn't like to compute NA on an entire vector of NA when 
+   ### computing variance
+   my.Var <- function(x,na.rm=FALSE){
+    if (all(is.na(x))){
+      return(NA)
+    } else {
+      var(x,na.rm=na.rm)
+    }
+ 
+   }
+   
+   if(any(abs(rowVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+   
+   
+   if(any(abs(colVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+ 
+ 
+   if(any(abs(rowMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+ 
+   if(any(abs(colMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+   
+   
+   if(any(abs(rowMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+   
+ 
+   if(any(abs(colMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+ 
+   if(any(abs(colMedians(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,median,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMedian")
+   }
+ 
+   if(any(abs(colRanges(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,range,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colRanges")
+   }
+ 
+ 
+   
+ }
> 
> 
> 
> 
> 
> 
> 
> 
> 
> for (rep in 1:20){
+   copymatrix <- matrix(rnorm(200,150,15),10,20)
+   
+   tmp5[1:10,1:20] <- copymatrix
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ## now lets assign some NA values and check agreement
+ 
+   which.row <- sample(1:10,1,replace=TRUE)
+   which.col  <- sample(1:20,1,replace=TRUE)
+   
+   cat(which.row," ",which.col,"\n")
+   
+   tmp5[which.row,which.col] <- NA
+   copymatrix[which.row,which.col] <- NA
+   
+   agree.checks(tmp5,copymatrix)
+ 
+   ## make an entire row NA
+   tmp5[which.row,] <- NA
+   copymatrix[which.row,] <- NA
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ### also make an entire col NA
+   tmp5[,which.col] <- NA
+   copymatrix[,which.col] <- NA
+ 
+   agree.checks(tmp5,copymatrix)
+ 
+   ### now make 1 element non NA with NA in the rest of row and column
+ 
+   tmp5[which.row,which.col] <- rnorm(1,150,15)
+   copymatrix[which.row,which.col] <- tmp5[which.row,which.col]
+ 
+   agree.checks(tmp5,copymatrix)
+ }
8   4 
7   7 
7   8 
1   20 
6   1 
8   6 
6   8 
2   12 
2   8 
10   17 
2   18 
8   13 
5   1 
9   3 
7   16 
8   19 
3   6 
5   8 
2   7 
5   11 
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.467654
> Min(tmp)
[1] -2.492655
> mean(tmp)
[1] 0.1059891
> Sum(tmp)
[1] 10.59891
> Var(tmp)
[1] 1.066065
> 
> rowMeans(tmp)
[1] 0.1059891
> rowSums(tmp)
[1] 10.59891
> rowVars(tmp)
[1] 1.066065
> rowSd(tmp)
[1] 1.032504
> rowMax(tmp)
[1] 2.467654
> rowMin(tmp)
[1] -2.492655
> 
> colMeans(tmp)
  [1] -2.105347987  2.467654032 -1.525412379  1.834640832  0.504930750
  [6]  0.061220353  1.862757502 -0.670427957  1.417345786  0.184965766
 [11] -0.435436880  0.062630533 -0.334500250 -1.612549560 -1.948524128
 [16]  0.682696655  0.993069371 -0.223196535  0.870340845  1.353579794
 [21] -0.530113970  0.638016478  0.147776184 -0.358687730  1.280125458
 [26] -2.223397170  0.416588918  0.148041925  1.225619357 -0.722195578
 [31]  1.910289757 -0.764501834  1.708752129  0.678072303 -0.440431414
 [36]  0.407982100 -1.380281608  0.572156129  1.798503644  0.746052511
 [41] -1.253666507 -1.074146143 -0.706263079 -0.144413419  0.669393043
 [46] -0.351222404  0.505082458 -0.436889128 -0.014995133 -0.507152938
 [51]  0.832524227  0.718278379 -1.146400176 -0.246995613  0.340337715
 [56]  0.430342473 -0.245979531  1.106033786  1.267913358  0.361336987
 [61] -0.157683993 -1.598995956 -0.743607490  0.720447837  0.151670393
 [66]  0.690927487 -0.008530247  0.108998924 -0.296875566 -0.410775039
 [71]  1.219511527  0.410525716  0.851720883  1.468316924 -0.784484467
 [76]  1.012098723  0.720696827  1.991157235 -0.455448938  1.308299823
 [81]  0.781376014 -0.774969710  0.662277597 -1.596008459  0.341200916
 [86]  0.264019882 -1.532398633 -2.492655279  0.237230831  0.165270170
 [91] -0.881073642  0.575463186  0.663559505 -1.654096184  1.012190921
 [96] -1.381092417  0.675646862 -0.217890359  1.192886952 -0.441924998
> colSums(tmp)
  [1] -2.105347987  2.467654032 -1.525412379  1.834640832  0.504930750
  [6]  0.061220353  1.862757502 -0.670427957  1.417345786  0.184965766
 [11] -0.435436880  0.062630533 -0.334500250 -1.612549560 -1.948524128
 [16]  0.682696655  0.993069371 -0.223196535  0.870340845  1.353579794
 [21] -0.530113970  0.638016478  0.147776184 -0.358687730  1.280125458
 [26] -2.223397170  0.416588918  0.148041925  1.225619357 -0.722195578
 [31]  1.910289757 -0.764501834  1.708752129  0.678072303 -0.440431414
 [36]  0.407982100 -1.380281608  0.572156129  1.798503644  0.746052511
 [41] -1.253666507 -1.074146143 -0.706263079 -0.144413419  0.669393043
 [46] -0.351222404  0.505082458 -0.436889128 -0.014995133 -0.507152938
 [51]  0.832524227  0.718278379 -1.146400176 -0.246995613  0.340337715
 [56]  0.430342473 -0.245979531  1.106033786  1.267913358  0.361336987
 [61] -0.157683993 -1.598995956 -0.743607490  0.720447837  0.151670393
 [66]  0.690927487 -0.008530247  0.108998924 -0.296875566 -0.410775039
 [71]  1.219511527  0.410525716  0.851720883  1.468316924 -0.784484467
 [76]  1.012098723  0.720696827  1.991157235 -0.455448938  1.308299823
 [81]  0.781376014 -0.774969710  0.662277597 -1.596008459  0.341200916
 [86]  0.264019882 -1.532398633 -2.492655279  0.237230831  0.165270170
 [91] -0.881073642  0.575463186  0.663559505 -1.654096184  1.012190921
 [96] -1.381092417  0.675646862 -0.217890359  1.192886952 -0.441924998
> 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] -2.105347987  2.467654032 -1.525412379  1.834640832  0.504930750
  [6]  0.061220353  1.862757502 -0.670427957  1.417345786  0.184965766
 [11] -0.435436880  0.062630533 -0.334500250 -1.612549560 -1.948524128
 [16]  0.682696655  0.993069371 -0.223196535  0.870340845  1.353579794
 [21] -0.530113970  0.638016478  0.147776184 -0.358687730  1.280125458
 [26] -2.223397170  0.416588918  0.148041925  1.225619357 -0.722195578
 [31]  1.910289757 -0.764501834  1.708752129  0.678072303 -0.440431414
 [36]  0.407982100 -1.380281608  0.572156129  1.798503644  0.746052511
 [41] -1.253666507 -1.074146143 -0.706263079 -0.144413419  0.669393043
 [46] -0.351222404  0.505082458 -0.436889128 -0.014995133 -0.507152938
 [51]  0.832524227  0.718278379 -1.146400176 -0.246995613  0.340337715
 [56]  0.430342473 -0.245979531  1.106033786  1.267913358  0.361336987
 [61] -0.157683993 -1.598995956 -0.743607490  0.720447837  0.151670393
 [66]  0.690927487 -0.008530247  0.108998924 -0.296875566 -0.410775039
 [71]  1.219511527  0.410525716  0.851720883  1.468316924 -0.784484467
 [76]  1.012098723  0.720696827  1.991157235 -0.455448938  1.308299823
 [81]  0.781376014 -0.774969710  0.662277597 -1.596008459  0.341200916
 [86]  0.264019882 -1.532398633 -2.492655279  0.237230831  0.165270170
 [91] -0.881073642  0.575463186  0.663559505 -1.654096184  1.012190921
 [96] -1.381092417  0.675646862 -0.217890359  1.192886952 -0.441924998
> colMin(tmp)
  [1] -2.105347987  2.467654032 -1.525412379  1.834640832  0.504930750
  [6]  0.061220353  1.862757502 -0.670427957  1.417345786  0.184965766
 [11] -0.435436880  0.062630533 -0.334500250 -1.612549560 -1.948524128
 [16]  0.682696655  0.993069371 -0.223196535  0.870340845  1.353579794
 [21] -0.530113970  0.638016478  0.147776184 -0.358687730  1.280125458
 [26] -2.223397170  0.416588918  0.148041925  1.225619357 -0.722195578
 [31]  1.910289757 -0.764501834  1.708752129  0.678072303 -0.440431414
 [36]  0.407982100 -1.380281608  0.572156129  1.798503644  0.746052511
 [41] -1.253666507 -1.074146143 -0.706263079 -0.144413419  0.669393043
 [46] -0.351222404  0.505082458 -0.436889128 -0.014995133 -0.507152938
 [51]  0.832524227  0.718278379 -1.146400176 -0.246995613  0.340337715
 [56]  0.430342473 -0.245979531  1.106033786  1.267913358  0.361336987
 [61] -0.157683993 -1.598995956 -0.743607490  0.720447837  0.151670393
 [66]  0.690927487 -0.008530247  0.108998924 -0.296875566 -0.410775039
 [71]  1.219511527  0.410525716  0.851720883  1.468316924 -0.784484467
 [76]  1.012098723  0.720696827  1.991157235 -0.455448938  1.308299823
 [81]  0.781376014 -0.774969710  0.662277597 -1.596008459  0.341200916
 [86]  0.264019882 -1.532398633 -2.492655279  0.237230831  0.165270170
 [91] -0.881073642  0.575463186  0.663559505 -1.654096184  1.012190921
 [96] -1.381092417  0.675646862 -0.217890359  1.192886952 -0.441924998
> colMedians(tmp)
  [1] -2.105347987  2.467654032 -1.525412379  1.834640832  0.504930750
  [6]  0.061220353  1.862757502 -0.670427957  1.417345786  0.184965766
 [11] -0.435436880  0.062630533 -0.334500250 -1.612549560 -1.948524128
 [16]  0.682696655  0.993069371 -0.223196535  0.870340845  1.353579794
 [21] -0.530113970  0.638016478  0.147776184 -0.358687730  1.280125458
 [26] -2.223397170  0.416588918  0.148041925  1.225619357 -0.722195578
 [31]  1.910289757 -0.764501834  1.708752129  0.678072303 -0.440431414
 [36]  0.407982100 -1.380281608  0.572156129  1.798503644  0.746052511
 [41] -1.253666507 -1.074146143 -0.706263079 -0.144413419  0.669393043
 [46] -0.351222404  0.505082458 -0.436889128 -0.014995133 -0.507152938
 [51]  0.832524227  0.718278379 -1.146400176 -0.246995613  0.340337715
 [56]  0.430342473 -0.245979531  1.106033786  1.267913358  0.361336987
 [61] -0.157683993 -1.598995956 -0.743607490  0.720447837  0.151670393
 [66]  0.690927487 -0.008530247  0.108998924 -0.296875566 -0.410775039
 [71]  1.219511527  0.410525716  0.851720883  1.468316924 -0.784484467
 [76]  1.012098723  0.720696827  1.991157235 -0.455448938  1.308299823
 [81]  0.781376014 -0.774969710  0.662277597 -1.596008459  0.341200916
 [86]  0.264019882 -1.532398633 -2.492655279  0.237230831  0.165270170
 [91] -0.881073642  0.575463186  0.663559505 -1.654096184  1.012190921
 [96] -1.381092417  0.675646862 -0.217890359  1.192886952 -0.441924998
> colRanges(tmp)
          [,1]     [,2]      [,3]     [,4]      [,5]       [,6]     [,7]
[1,] -2.105348 2.467654 -1.525412 1.834641 0.5049307 0.06122035 1.862758
[2,] -2.105348 2.467654 -1.525412 1.834641 0.5049307 0.06122035 1.862758
          [,8]     [,9]     [,10]      [,11]      [,12]      [,13]    [,14]
[1,] -0.670428 1.417346 0.1849658 -0.4354369 0.06263053 -0.3345003 -1.61255
[2,] -0.670428 1.417346 0.1849658 -0.4354369 0.06263053 -0.3345003 -1.61255
         [,15]     [,16]     [,17]      [,18]     [,19]   [,20]     [,21]
[1,] -1.948524 0.6826967 0.9930694 -0.2231965 0.8703408 1.35358 -0.530114
[2,] -1.948524 0.6826967 0.9930694 -0.2231965 0.8703408 1.35358 -0.530114
         [,22]     [,23]      [,24]    [,25]     [,26]     [,27]     [,28]
[1,] 0.6380165 0.1477762 -0.3586877 1.280125 -2.223397 0.4165889 0.1480419
[2,] 0.6380165 0.1477762 -0.3586877 1.280125 -2.223397 0.4165889 0.1480419
        [,29]      [,30]   [,31]      [,32]    [,33]     [,34]      [,35]
[1,] 1.225619 -0.7221956 1.91029 -0.7645018 1.708752 0.6780723 -0.4404314
[2,] 1.225619 -0.7221956 1.91029 -0.7645018 1.708752 0.6780723 -0.4404314
         [,36]     [,37]     [,38]    [,39]     [,40]     [,41]     [,42]
[1,] 0.4079821 -1.380282 0.5721561 1.798504 0.7460525 -1.253667 -1.074146
[2,] 0.4079821 -1.380282 0.5721561 1.798504 0.7460525 -1.253667 -1.074146
          [,43]      [,44]    [,45]      [,46]     [,47]      [,48]       [,49]
[1,] -0.7062631 -0.1444134 0.669393 -0.3512224 0.5050825 -0.4368891 -0.01499513
[2,] -0.7062631 -0.1444134 0.669393 -0.3512224 0.5050825 -0.4368891 -0.01499513
          [,50]     [,51]     [,52]   [,53]      [,54]     [,55]     [,56]
[1,] -0.5071529 0.8325242 0.7182784 -1.1464 -0.2469956 0.3403377 0.4303425
[2,] -0.5071529 0.8325242 0.7182784 -1.1464 -0.2469956 0.3403377 0.4303425
          [,57]    [,58]    [,59]    [,60]     [,61]     [,62]      [,63]
[1,] -0.2459795 1.106034 1.267913 0.361337 -0.157684 -1.598996 -0.7436075
[2,] -0.2459795 1.106034 1.267913 0.361337 -0.157684 -1.598996 -0.7436075
         [,64]     [,65]     [,66]        [,67]     [,68]      [,69]     [,70]
[1,] 0.7204478 0.1516704 0.6909275 -0.008530247 0.1089989 -0.2968756 -0.410775
[2,] 0.7204478 0.1516704 0.6909275 -0.008530247 0.1089989 -0.2968756 -0.410775
        [,71]     [,72]     [,73]    [,74]      [,75]    [,76]     [,77]
[1,] 1.219512 0.4105257 0.8517209 1.468317 -0.7844845 1.012099 0.7206968
[2,] 1.219512 0.4105257 0.8517209 1.468317 -0.7844845 1.012099 0.7206968
        [,78]      [,79]  [,80]    [,81]      [,82]     [,83]     [,84]
[1,] 1.991157 -0.4554489 1.3083 0.781376 -0.7749697 0.6622776 -1.596008
[2,] 1.991157 -0.4554489 1.3083 0.781376 -0.7749697 0.6622776 -1.596008
         [,85]     [,86]     [,87]     [,88]     [,89]     [,90]      [,91]
[1,] 0.3412009 0.2640199 -1.532399 -2.492655 0.2372308 0.1652702 -0.8810736
[2,] 0.3412009 0.2640199 -1.532399 -2.492655 0.2372308 0.1652702 -0.8810736
         [,92]     [,93]     [,94]    [,95]     [,96]     [,97]      [,98]
[1,] 0.5754632 0.6635595 -1.654096 1.012191 -1.381092 0.6756469 -0.2178904
[2,] 0.5754632 0.6635595 -1.654096 1.012191 -1.381092 0.6756469 -0.2178904
        [,99]    [,100]
[1,] 1.192887 -0.441925
[2,] 1.192887 -0.441925
> 
> 
> Max(tmp2)
[1] 2.107378
> Min(tmp2)
[1] -2.899293
> mean(tmp2)
[1] 0.06318066
> Sum(tmp2)
[1] 6.318066
> Var(tmp2)
[1] 1.009293
> 
> rowMeans(tmp2)
  [1] -0.48345767 -0.06278484  0.68472276 -1.21484094  1.12233241  0.80203888
  [7]  2.04841533  1.75230196 -0.79074738  0.03411291 -0.91294389  0.84479905
 [13]  1.32343759  0.82061615  1.04029046  0.33743196 -0.98926784 -0.87726746
 [19]  0.88290865 -1.12182475  0.93357858  0.88283468  0.05479805 -0.87359464
 [25] -0.17114066 -1.59627313 -1.49767617  1.54507312 -0.02502106  0.88333947
 [31] -1.45706155 -1.55326264  0.78193128 -0.28270880  0.99725507  2.10737767
 [37] -0.23357593 -0.34640195 -0.17707108 -2.68765889  0.95807060  0.67388270
 [43] -1.42156217  0.63058109  0.68571719  1.11287508 -0.10252621 -1.80518283
 [49] -0.70662251  0.88534478 -1.02095549  0.13417710 -0.49624391 -0.32042917
 [55]  0.60584460  1.57277916  0.45540442 -2.89929303  0.29217819 -0.69941842
 [61] -0.15316917  0.38905821 -0.56340216  0.09380145 -0.11066376  1.46833255
 [67] -0.53765087 -0.44139999 -0.01817215 -0.13770603 -1.17216391 -0.35244722
 [73] -0.48313048  0.49337802 -0.13835915  0.26756762 -0.16893714 -0.39703924
 [79]  1.33022489 -0.45644863 -2.14649276  1.55301368  1.08951888  1.61975791
 [85] -0.09334299 -0.76369686  1.02800814  1.18437011  0.71688871  0.22930418
 [91] -0.68899861  0.65147679 -0.24020468  1.32342148 -0.03010288 -0.03485305
 [97] -1.07321012  0.62575398  1.09864368  0.29750190
> rowSums(tmp2)
  [1] -0.48345767 -0.06278484  0.68472276 -1.21484094  1.12233241  0.80203888
  [7]  2.04841533  1.75230196 -0.79074738  0.03411291 -0.91294389  0.84479905
 [13]  1.32343759  0.82061615  1.04029046  0.33743196 -0.98926784 -0.87726746
 [19]  0.88290865 -1.12182475  0.93357858  0.88283468  0.05479805 -0.87359464
 [25] -0.17114066 -1.59627313 -1.49767617  1.54507312 -0.02502106  0.88333947
 [31] -1.45706155 -1.55326264  0.78193128 -0.28270880  0.99725507  2.10737767
 [37] -0.23357593 -0.34640195 -0.17707108 -2.68765889  0.95807060  0.67388270
 [43] -1.42156217  0.63058109  0.68571719  1.11287508 -0.10252621 -1.80518283
 [49] -0.70662251  0.88534478 -1.02095549  0.13417710 -0.49624391 -0.32042917
 [55]  0.60584460  1.57277916  0.45540442 -2.89929303  0.29217819 -0.69941842
 [61] -0.15316917  0.38905821 -0.56340216  0.09380145 -0.11066376  1.46833255
 [67] -0.53765087 -0.44139999 -0.01817215 -0.13770603 -1.17216391 -0.35244722
 [73] -0.48313048  0.49337802 -0.13835915  0.26756762 -0.16893714 -0.39703924
 [79]  1.33022489 -0.45644863 -2.14649276  1.55301368  1.08951888  1.61975791
 [85] -0.09334299 -0.76369686  1.02800814  1.18437011  0.71688871  0.22930418
 [91] -0.68899861  0.65147679 -0.24020468  1.32342148 -0.03010288 -0.03485305
 [97] -1.07321012  0.62575398  1.09864368  0.29750190
> 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.48345767 -0.06278484  0.68472276 -1.21484094  1.12233241  0.80203888
  [7]  2.04841533  1.75230196 -0.79074738  0.03411291 -0.91294389  0.84479905
 [13]  1.32343759  0.82061615  1.04029046  0.33743196 -0.98926784 -0.87726746
 [19]  0.88290865 -1.12182475  0.93357858  0.88283468  0.05479805 -0.87359464
 [25] -0.17114066 -1.59627313 -1.49767617  1.54507312 -0.02502106  0.88333947
 [31] -1.45706155 -1.55326264  0.78193128 -0.28270880  0.99725507  2.10737767
 [37] -0.23357593 -0.34640195 -0.17707108 -2.68765889  0.95807060  0.67388270
 [43] -1.42156217  0.63058109  0.68571719  1.11287508 -0.10252621 -1.80518283
 [49] -0.70662251  0.88534478 -1.02095549  0.13417710 -0.49624391 -0.32042917
 [55]  0.60584460  1.57277916  0.45540442 -2.89929303  0.29217819 -0.69941842
 [61] -0.15316917  0.38905821 -0.56340216  0.09380145 -0.11066376  1.46833255
 [67] -0.53765087 -0.44139999 -0.01817215 -0.13770603 -1.17216391 -0.35244722
 [73] -0.48313048  0.49337802 -0.13835915  0.26756762 -0.16893714 -0.39703924
 [79]  1.33022489 -0.45644863 -2.14649276  1.55301368  1.08951888  1.61975791
 [85] -0.09334299 -0.76369686  1.02800814  1.18437011  0.71688871  0.22930418
 [91] -0.68899861  0.65147679 -0.24020468  1.32342148 -0.03010288 -0.03485305
 [97] -1.07321012  0.62575398  1.09864368  0.29750190
> rowMin(tmp2)
  [1] -0.48345767 -0.06278484  0.68472276 -1.21484094  1.12233241  0.80203888
  [7]  2.04841533  1.75230196 -0.79074738  0.03411291 -0.91294389  0.84479905
 [13]  1.32343759  0.82061615  1.04029046  0.33743196 -0.98926784 -0.87726746
 [19]  0.88290865 -1.12182475  0.93357858  0.88283468  0.05479805 -0.87359464
 [25] -0.17114066 -1.59627313 -1.49767617  1.54507312 -0.02502106  0.88333947
 [31] -1.45706155 -1.55326264  0.78193128 -0.28270880  0.99725507  2.10737767
 [37] -0.23357593 -0.34640195 -0.17707108 -2.68765889  0.95807060  0.67388270
 [43] -1.42156217  0.63058109  0.68571719  1.11287508 -0.10252621 -1.80518283
 [49] -0.70662251  0.88534478 -1.02095549  0.13417710 -0.49624391 -0.32042917
 [55]  0.60584460  1.57277916  0.45540442 -2.89929303  0.29217819 -0.69941842
 [61] -0.15316917  0.38905821 -0.56340216  0.09380145 -0.11066376  1.46833255
 [67] -0.53765087 -0.44139999 -0.01817215 -0.13770603 -1.17216391 -0.35244722
 [73] -0.48313048  0.49337802 -0.13835915  0.26756762 -0.16893714 -0.39703924
 [79]  1.33022489 -0.45644863 -2.14649276  1.55301368  1.08951888  1.61975791
 [85] -0.09334299 -0.76369686  1.02800814  1.18437011  0.71688871  0.22930418
 [91] -0.68899861  0.65147679 -0.24020468  1.32342148 -0.03010288 -0.03485305
 [97] -1.07321012  0.62575398  1.09864368  0.29750190
> 
> colMeans(tmp2)
[1] 0.06318066
> colSums(tmp2)
[1] 6.318066
> colVars(tmp2)
[1] 1.009293
> colSd(tmp2)
[1] 1.004636
> colMax(tmp2)
[1] 2.107378
> colMin(tmp2)
[1] -2.899293
> colMedians(tmp2)
[1] -0.0215966
> colRanges(tmp2)
          [,1]
[1,] -2.899293
[2,]  2.107378
> 
> 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.10131957  1.67888823 -0.02711363  4.53882669 -4.98173416  3.28774862
 [7]  3.91333141 -2.07189571 -2.91629463 -3.36852360
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -1.3734255
[2,] -0.6572419
[3,] -0.1176988
[4,]  0.4608879
[5,]  0.9346363
> 
> rowApply(tmp,sum)
 [1]  0.6656368  4.6644237  0.6430398 -2.4682819  2.9156327 -2.9227775
 [7] -3.2189706 -3.2826139  4.2637564 -2.3079317
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    9    7    5    2    3    8    9    4    6     2
 [2,]    6    4    2    4   10    7    4    8    3     8
 [3,]    1    3    9    5    8   10    3   10    2     1
 [4,]    7    6    1   10    9    3    5    9    9    10
 [5,]    5    9    3    1    4    1    6    3    1     7
 [6,]    8   10    8    6    2    5    1    7   10     9
 [7,]   10    2    6    8    6    9    8    6    8     5
 [8,]    2    1   10    9    5    4    2    1    7     6
 [9,]    3    5    7    7    7    6    7    2    4     3
[10,]    4    8    4    3    1    2   10    5    5     4
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1] -1.2874096  5.3314783  0.9697682 -0.4332665  3.2071149  2.9596486
 [7] -1.2202419  1.9572458  0.2011688  0.4428000 -2.0563960  0.3077874
[13] -1.1516821  1.5047610  0.2210919 -2.3836302  0.1393196  0.3522167
[19]  1.0320830  0.6439584
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -1.1794771
[2,] -0.9697557
[3,] -0.5032184
[4,]  0.4815224
[5,]  0.8835193
> 
> rowApply(tmp,sum)
[1]  1.6539659  6.0980477  0.3886696 -4.9551518  7.5522851
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]   18    3    2    8   12
[2,]   14   16   18   15   20
[3,]    4   19   10    9   16
[4,]    2   15   12   11    9
[5,]   15   18   17   14   10
> 
> 
> as.matrix(tmp)
           [,1]      [,2]        [,3]       [,4]      [,5]       [,6]
[1,]  0.8835193 0.5242881 -1.10424181 -1.2798914 0.5498428  1.9523831
[2,] -0.9697557 1.1143799  1.54265319  0.8107516 1.2326401 -0.4616839
[3,] -1.1794771 0.9898389 -0.03541552  0.1967418 0.7111181  0.2998662
[4,] -0.5032184 0.4331604 -0.46682104 -0.4125983 0.4244767  0.5416832
[5,]  0.4815224 2.2698111  1.03359340  0.2517298 0.2890372  0.6274000
           [,7]       [,8]        [,9]      [,10]      [,11]      [,12]
[1,]  0.2646482 -0.3917545  1.46272229  0.8306986 -0.7473414  0.4395303
[2,]  0.6230872  1.1512247 -1.09288439 -0.3453769 -1.4056673  0.1489540
[3,]  1.0606630  0.3538387  0.27679871 -0.6706259  0.3703865 -1.4899300
[4,] -1.6063351 -1.0148110 -0.41929730 -0.8374904 -1.0464044  1.5160257
[5,] -1.5623053  1.8587480 -0.02617049  1.4655946  0.7726306 -0.3067926
           [,13]      [,14]       [,15]      [,16]       [,17]       [,18]
[1,] -0.47427117 -0.2626634 -0.02123224 -1.3111632  0.88031325 -1.19071404
[2,] -0.87898023  2.5130196  0.26264050 -0.1234444  0.47744441  0.52823675
[3,] -0.06881968 -0.3491730 -0.05271661 -0.8215817  0.06909143  1.31385898
[4,]  0.21821419 -1.6418237  0.72519896  0.4888030 -1.60208813 -0.32078484
[5,]  0.05217482  1.2454016 -0.69279871 -0.6162439  0.31455865  0.02161988
          [,19]      [,20]
[1,]  0.4644070  0.1848862
[2,]  0.1895749  0.7812337
[3,] -0.2664125 -0.3193807
[4,]  1.3043832 -0.7354245
[5,] -0.6598695  0.7326437
> 
> 
> is.BufferedMatrix(tmp)
[1] TRUE
> 
> as.BufferedMatrix(as.matrix(tmp))
BufferedMatrix object
Matrix size:  5 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  800  bytes.
> 
> 
> 
> subBufferedMatrix(tmp,1:5,1:5)
BufferedMatrix object
Matrix size:  5 5 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  649  bytes.
Disk usage :  200  bytes.
> subBufferedMatrix(tmp,,5:8)
BufferedMatrix object
Matrix size:  5 4 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  562  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 2.099735 -0.6707902 0.5336391 -1.265505 0.173558 -0.183494 0.997732
           col8      col9     col10    col11      col12       col13   col14
row1 -0.7888802 -1.082417 -1.780818 1.370511 -0.9214593 -0.03553123 1.90139
          col15      col16     col17     col18    col19     col20
row1 -0.3778594 -0.6411381 0.4645572 0.7495829 1.291294 -1.250814
> tmp[,"col10"]
          col10
row1 -1.7808182
row2 -0.8994180
row3  0.1705633
row4 -1.4288930
row5 -0.3173810
> tmp[c("row1","row5"),]
         col1       col2      col3       col4     col5        col6       col7
row1 2.099735 -0.6707902 0.5336391 -1.2655046 0.173558 -0.18349403  0.9977320
row5 1.025569  0.5535757 1.0325915 -0.9881351 1.701736  0.08890607 -0.1532904
           col8       col9     col10      col11      col12       col13
row1 -0.7888802 -1.0824170 -1.780818  1.3705107 -0.9214593 -0.03553123
row5  0.4334217 -0.3218847 -0.317381 -0.1805251  1.1706447 -1.63702352
         col14      col15      col16     col17      col18     col19      col20
row1 1.9013895 -0.3778594 -0.6411381 0.4645572  0.7495829  1.291294 -1.2508136
row5 0.8842616  0.8228450 -1.9279070 1.2399365 -0.7002346 -1.107877 -0.7094287
> tmp[,c("col6","col20")]
            col6      col20
row1 -0.18349403 -1.2508136
row2 -0.57813042  0.4043822
row3  1.41107353  0.7174174
row4 -0.01993996  1.1378871
row5  0.08890607 -0.7094287
> tmp[c("row1","row5"),c("col6","col20")]
            col6      col20
row1 -0.18349403 -1.2508136
row5  0.08890607 -0.7094287
> 
> 
> 
> 
> 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 51.23999 49.43901 49.39447 51.28619 48.47717 107.5674 49.44156 51.57028
         col9    col10    col11    col12    col13    col14    col15    col16
row1 49.64167 48.51767 49.40694 49.58751 51.64818 49.59664 50.26811 49.26162
        col17    col18    col19    col20
row1 49.42835 50.03843 50.41507 104.6375
> tmp[,"col10"]
        col10
row1 48.51767
row2 28.37321
row3 30.46849
row4 28.53733
row5 50.31827
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 51.23999 49.43901 49.39447 51.28619 48.47717 107.5674 49.44156 51.57028
row5 48.86193 50.44353 50.51141 51.26254 49.87511 104.9019 48.15934 48.83499
         col9    col10    col11    col12    col13    col14    col15    col16
row1 49.64167 48.51767 49.40694 49.58751 51.64818 49.59664 50.26811 49.26162
row5 48.34676 50.31827 51.02562 50.40054 50.88471 50.14180 50.66733 50.29375
        col17    col18    col19    col20
row1 49.42835 50.03843 50.41507 104.6375
row5 50.43693 51.10393 49.55977 105.3099
> tmp[,c("col6","col20")]
          col6     col20
row1 107.56742 104.63754
row2  75.81961  76.89532
row3  75.50549  74.67868
row4  73.85722  75.94243
row5 104.90193 105.30988
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 107.5674 104.6375
row5 104.9019 105.3099
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 107.5674 104.6375
row5 104.9019 105.3099
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
           col13
[1,] -0.18107567
[2,]  0.68029742
[3,] -0.01153302
[4,] -0.45507287
[5,]  0.29343682
> tmp[,c("col17","col7")]
          col17       col7
[1,]  0.1493130 -0.2769663
[2,]  0.7185010  1.5922335
[3,] -0.8188150  0.2116972
[4,]  0.3689487 -0.3260979
[5,]  0.5258782  2.0949985
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
           col6       col20
[1,] -1.3786525 -0.03540641
[2,] -0.5243525 -2.29456707
[3,] -1.0506973  0.67802280
[4,]  0.9341069  0.33425812
[5,]  0.7422152  0.20045523
> subBufferedMatrix(tmp,1,c("col6"))[,1]
          col1
[1,] -1.378652
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
           col6
[1,] -1.3786525
[2,] -0.5243525
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> 
> 
> 
> subBufferedMatrix(tmp,c("row3","row1"),)[,1:20]
           [,1]      [,2]       [,3]       [,4]       [,5]       [,6]
row3 -0.5420308 0.9170127 -0.1976849  0.2038823 -0.1101119  1.0086457
row1  0.6945588 0.1083740 -0.7086121 -1.4036111  0.2186149 -0.0664945
            [,7]       [,8]      [,9]      [,10]     [,11]     [,12]     [,13]
row3  0.01069464  0.3314567 0.4277793 -0.2851968 1.1677538 0.7806972 0.1369998
row1 -1.70773571 -0.3675059 0.8292294 -0.6813981 0.2050741 0.7103933 0.2619398
         [,14]     [,15]     [,16]      [,17]      [,18]       [,19]      [,20]
row3 -0.895002 0.6170978 0.5084375 -0.4559523  0.1875214  0.07348665  1.0509144
row1  2.929948 1.2722841 0.5088256 -0.2744868 -0.2250962 -0.45641282 -0.8508468
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
          [,1]      [,2]      [,3]       [,4]     [,5]     [,6]      [,7]
row2 -1.136894 -2.443038 0.5711891 -0.1257149 1.138541 1.152898 -0.264991
          [,8]      [,9]      [,10]
row2 -2.244521 -2.205006 -0.8350811
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
           [,1]       [,2]      [,3]     [,4]     [,5]      [,6]     [,7]
row5 -0.4122994 -0.1558346 0.3619241 1.512762 1.093492 0.1024715 2.532422
          [,8]    [,9]   [,10]     [,11]     [,12]    [,13]      [,14]    [,15]
row5 -0.237971 1.23772 1.30083 -1.556619 0.5677463 0.237873 -0.4349232 1.830609
         [,16]    [,17]     [,18]      [,19]     [,20]
row5 0.5155044 1.297873 0.8103313 -0.2058251 -2.142741
> 
> 
> 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: 0x6000003ac060>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM8e914919f476"
 [2] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM8e9147009478"
 [3] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM8e91771376b2"
 [4] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM8e911ed5dd31"
 [5] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM8e916aaccbc7"
 [6] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM8e917676ac87"
 [7] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM8e9169390fd3"
 [8] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM8e91213e1b9d"
 [9] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM8e917486f177"
[10] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM8e914756f765"
[11] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM8e911e8c2c7a"
[12] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM8e914bc0d41" 
[13] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM8e91560a28d4"
[14] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM8e9134fea26d"
[15] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM8e913959bd49"
> 
> 
> ### 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: 0x6000003b4180>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x6000003b4180>
Warning message:
In dir.create(new.directory) :
  '/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x6000003b4180>
> rowMedians(tmp)
  [1]  0.064405402 -0.343905879 -0.191910150  0.345962263 -0.446509957
  [6] -0.348866611  0.314337430 -0.083121815 -0.006621298  0.232675248
 [11]  0.578708850  0.110779589 -0.117130199  0.111134174 -0.412342090
 [16]  0.291372257 -0.006315272 -0.490695931  0.131879509 -0.074855179
 [21]  0.159157672 -0.065081149 -0.306648406 -0.355537260 -0.304260379
 [26] -0.016257110  0.227252542  0.198934755 -0.054932570  0.467664983
 [31] -0.315098806 -0.649161782  0.174768292 -0.016937004  0.009305676
 [36]  0.149490414 -0.441812888  0.199055142 -0.225628989 -0.559878203
 [41]  0.449989310 -0.578294482 -0.370889289  0.335935203 -0.296167330
 [46]  0.060608863 -0.627612405 -0.192392794 -0.428741257 -0.090071567
 [51] -0.237183279  0.129453035 -0.090585756  0.020291660  0.190619480
 [56]  0.134314069  0.072142661 -0.139080822 -0.066340680  0.210756077
 [61] -0.196222358 -0.425620954 -0.261591990 -0.106161192  0.107630525
 [66]  0.422065109 -0.169848970  0.035621235  0.497203117  0.226209710
 [71] -0.005213979 -0.159139164 -0.593623188 -0.120372547  0.382859377
 [76]  0.350113894 -0.256988199  0.482118401 -0.047962852 -0.308333968
 [81] -0.046661844  0.267587952 -0.244884826  0.405160512 -0.261368585
 [86]  0.131231963 -0.208707910  0.551256380  0.343684882 -0.477003241
 [91] -0.468648822 -0.493579014 -0.187104108  0.084758084  0.256817978
 [96] -0.652841992  0.195450895  0.270958010 -0.199946790 -0.055426158
[101]  0.236884144 -0.131779013  0.061388060  0.673628101  0.065975425
[106]  0.213130508  0.368038642 -0.124239297  0.207614605  0.033111959
[111] -0.025853999 -0.518873690  0.331376363  0.236064054 -0.307956746
[116]  0.344691362 -0.131335409 -0.257405798 -0.031828487 -0.244526266
[121] -0.222104726 -0.154679631 -0.181181857  0.261007734 -0.181019260
[126]  0.404753681  0.419645130  0.381796699 -0.374928145  0.078929190
[131]  0.166471192  0.294559314  0.259916966  0.085285987 -0.671198813
[136]  0.631321858  0.088491652  0.492966194 -0.198473462  0.022234540
[141]  0.608094821 -0.434329552  0.842804161 -0.097911550 -0.203057554
[146] -0.163730163 -0.210650719  0.267520805 -0.103825583 -0.523971425
[151] -0.184938277  0.106691146  0.014746943  0.545457500 -0.521402831
[156] -0.339168727  0.242943353  0.356488949  0.544498054 -0.046681707
[161]  0.064993673 -0.271331425  0.398207091  0.459111153 -0.327969931
[166] -0.164961489 -0.064585404 -0.002072115  0.122297283  0.736102708
[171] -0.095543933  0.198917837 -0.343259262 -0.277372995 -0.060524665
[176]  0.081959227  0.232197249 -0.134030790  0.520780753 -0.430217933
[181] -0.283723809  0.031160554  0.305115305  0.264851156  0.257492658
[186]  0.033059910 -0.083007751  0.412048286  0.500427502  0.226852819
[191]  0.142662914 -0.003888310  0.019319584 -0.350843475  0.030920110
[196]  0.082891159  0.060661463 -0.141891388 -0.132153192  0.255401147
[201]  0.183662323 -0.390168397  0.076730551  0.115314791  0.294853069
[206]  0.584298279 -0.045604438  0.268800847 -0.152869256  0.387016769
[211]  0.570144720  0.069463287 -0.400394670 -0.765084379 -0.221523999
[216] -0.029792298  0.067396655  1.000066029 -0.324600797 -0.073595318
[221]  0.645938211  0.514454764 -0.532547107  0.462406804  0.089788576
[226] -0.185293189 -0.214407144 -0.217300736  0.020418112  0.043632046
> 
> proc.time()
   user  system elapsed 
  2.739  16.734  20.148 

BufferedMatrix.Rcheck/tests/rawCalltesting.Rout


R version 4.5.0 Patched (2025-04-21 r88169) -- "How About a Twenty-Six"
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: 0x600001428120>
> .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: 0x600001428120>
> .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: 0x600001428120>
> .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: 0x600001428120>
> 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: 0x600001450000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600001450000>
> .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: 0x600001450000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600001450000>
> .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: 0x600001450000>
> 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: 0x600001454000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600001454000>
> .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: 0x600001454000>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x600001454000>
> .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: 0x600001454000>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x600001454000>
> .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: 0x600001454000>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x600001454000>
> .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: 0x600001454000>
> 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: 0x600001468000>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x600001468000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600001468000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600001468000>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile929649cd9245" "BufferedMatrixFile9296573e15dd"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile929649cd9245" "BufferedMatrixFile9296573e15dd"
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x600001438240>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600001438240>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x600001438240>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x600001438240>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x600001438240>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x600001438240>
> .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: 0x60000146c000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x60000146c000>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x60000146c000>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x60000146c000>
> 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: 0x600001460000>
> .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: 0x600001460000>
> rm(P)
> 
> proc.time()
   user  system elapsed 
  0.362   0.167   0.533 

BufferedMatrix.Rcheck/tests/Rcodetesting.Rout


R version 4.5.0 Patched (2025-04-21 r88169) -- "How About a Twenty-Six"
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.352   0.098   0.438 

Example timings