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

This page was generated on 2024-11-20 12:05 -0500 (Wed, 20 Nov 2024).

HostnameOSArch (*)R versionInstalled pkgs
teran2Linux (Ubuntu 24.04.1 LTS)x86_644.4.2 (2024-10-31) -- "Pile of Leaves" 4481
nebbiolo2Linux (Ubuntu 24.04.1 LTS)x86_644.4.2 (2024-10-31) -- "Pile of Leaves" 4479
palomino8Windows Server 2022 Datacenterx644.4.2 (2024-10-31 ucrt) -- "Pile of Leaves" 4359
lconwaymacOS 12.7.1 Montereyx86_644.4.1 (2024-06-14) -- "Race for Your Life" 4539
kunpeng2Linux (openEuler 22.03 LTS-SP1)aarch644.4.1 (2024-06-14) -- "Race for Your Life" 4493
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 251/2289HostnameOS / ArchINSTALLBUILDCHECKBUILD BIN
BufferedMatrix 1.70.0  (landing page)
Ben Bolstad
Snapshot Date: 2024-11-19 13:40 -0500 (Tue, 19 Nov 2024)
git_url: https://git.bioconductor.org/packages/BufferedMatrix
git_branch: RELEASE_3_20
git_last_commit: 32b6f6a
git_last_commit_date: 2024-10-29 09:27:20 -0500 (Tue, 29 Oct 2024)
teran2Linux (Ubuntu 24.04.1 LTS) / x86_64  OK    OK    OK  UNNEEDED, same version is already published
nebbiolo2Linux (Ubuntu 24.04.1 LTS) / x86_64  OK    OK    OK  
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
kunpeng2Linux (openEuler 22.03 LTS-SP1) / 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.70.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.70.0.tar.gz
StartedAt: 2024-11-19 20:09:47 -0500 (Tue, 19 Nov 2024)
EndedAt: 2024-11-19 20:14:05 -0500 (Tue, 19 Nov 2024)
EllapsedTime: 258.2 seconds
RetCode: 0
Status:   WARNINGS  
CheckDir: BufferedMatrix.Rcheck
Warnings: 1

Command output

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


* using log directory ‘/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck’
* using R version 4.4.1 (2024-06-14)
* using platform: x86_64-apple-darwin20
* R was compiled by
    Apple clang version 14.0.0 (clang-1400.0.29.202)
    GNU Fortran (GCC) 12.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.70.0’
* checking package namespace information ... OK
* checking package dependencies ...Warning: unable to access index for repository https://CRAN.R-project.org/src/contrib:
  cannot open URL 'https://CRAN.R-project.org/src/contrib/PACKAGES'
 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.20-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.20-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.4-x86_64/Resources/library’
* installing *source* package ‘BufferedMatrix’ ...
** 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 -Wl,-framework -Wl,CoreFoundation
installing to /Library/Frameworks/R.framework/Versions/4.4-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.4.1 (2024-06-14) -- "Race for Your Life"
Copyright (C) 2024 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.237   0.101   0.341 

BufferedMatrix.Rcheck/tests/objectTesting.Rout


R version 4.4.1 (2024-06-14) -- "Race for Your Life"
Copyright (C) 2024 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.20-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 474173 25.4    1035465 55.3         NA   638628 34.2
Vcells 877659  6.7    8388608 64.0      98304  2071890 15.9
> 
> 
> 
> 
> ##
> ## 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] "Tue Nov 19 20:13:47 2024"
> 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] "Tue Nov 19 20:13:47 2024"
> 
> 
> 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: 0x600000f4c420>
> 
> 
> 
> 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] "Tue Nov 19 20:13:50 2024"
> 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] "Tue Nov 19 20:13:51 2024"
> 
> ColMode(tmp2)
<pointer: 0x600000f4c420>
> 
> 
> 
> ### 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.7792039  1.14168526 -1.1194570  0.21983188
[2,] -1.2285104 -0.05091759 -0.5862434  0.04190634
[3,]  0.5419467  1.04362522 -0.3483615  1.02912893
[4,]  1.4984558 -1.07473960  0.3005486 -1.75732611
> ewApply(tmp5,abs)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
           [,1]       [,2]      [,3]       [,4]
[1,] 99.7792039 1.14168526 1.1194570 0.21983188
[2,]  1.2285104 0.05091759 0.5862434 0.04190634
[3,]  0.5419467 1.04362522 0.3483615 1.02912893
[4,]  1.4984558 1.07473960 0.3005486 1.75732611
> ewApply(tmp5,sqrt)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
          [,1]      [,2]      [,3]      [,4]
[1,] 9.9889541 1.0684967 1.0580440 0.4688623
[2,] 1.1083819 0.2256493 0.7656653 0.2047104
[3,] 0.7361703 1.0215798 0.5902216 1.0144599
[4,] 1.2241143 1.0366965 0.5482231 1.3256418
> 
> 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.20-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
          [,1]     [,2]     [,3]     [,4]
[1,] 224.66874 36.82665 36.69990 29.90846
[2,]  37.31233 27.30741 33.24290 27.08901
[3,]  32.90365 36.25942 31.25058 36.17373
[4,]  38.73960 36.44170 30.78278 40.01374
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x600000f6c000>
> exp(tmp5)
<pointer: 0x600000f6c000>
> log(tmp5,2)
<pointer: 0x600000f6c000>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 467.6186
> Min(tmp5)
[1] 52.96526
> mean(tmp5)
[1] 71.98576
> Sum(tmp5)
[1] 14397.15
> Var(tmp5)
[1] 860.4526
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 89.79145 67.70244 70.30842 71.48570 68.88631 67.92958 72.51219 67.44339
 [9] 71.68223 72.11585
> rowSums(tmp5)
 [1] 1795.829 1354.049 1406.168 1429.714 1377.726 1358.592 1450.244 1348.868
 [9] 1433.645 1442.317
> rowVars(tmp5)
 [1] 7980.92757   60.91307   60.37905   44.30870   68.14702   66.27727
 [7]   69.93138   62.86210   63.38972  129.15045
> rowSd(tmp5)
 [1] 89.336037  7.804683  7.770395  6.656478  8.255121  8.141085  8.362498
 [8]  7.928562  7.961766 11.364438
> rowMax(tmp5)
 [1] 467.61856  80.92813  87.85674  83.28337  88.96339  83.84130  87.05033
 [8]  88.17558  91.36558  95.57841
> rowMin(tmp5)
 [1] 57.23686 54.74594 54.75381 59.70472 57.13144 54.91362 55.43561 57.78701
 [9] 60.63583 52.96526
> 
> colMeans(tmp5)
 [1] 112.33364  69.39478  69.96158  65.83738  71.21228  68.18470  67.73204
 [8]  68.59335  70.03036  73.27054  68.52082  72.27003  67.62886  77.10689
[15]  71.42870  69.19311  76.44552  68.16270  66.02298  66.38487
> colSums(tmp5)
 [1] 1123.3364  693.9478  699.6158  658.3738  712.1228  681.8470  677.3204
 [8]  685.9335  700.3036  732.7054  685.2082  722.7003  676.2886  771.0689
[15]  714.2870  691.9311  764.4552  681.6270  660.2298  663.8487
> colVars(tmp5)
 [1] 15622.05354   114.60490    76.14879    76.09507   151.68930    45.44752
 [7]    60.28050    42.36138    28.65050    81.27975    62.76207   101.75606
[13]    49.21766    58.93917    40.60616    38.66439    89.36645    79.38832
[19]    34.06232    68.27626
> colSd(tmp5)
 [1] 124.988214  10.705368   8.726327   8.723249  12.316221   6.741478
 [7]   7.764052   6.508562   5.352616   9.015528   7.922252  10.087421
[13]   7.015530   7.677185   6.372297   6.218069   9.453383   8.910013
[19]   5.836293   8.262945
> colMax(tmp5)
 [1] 467.61856  83.54438  91.36558  83.28337  95.57841  78.61868  79.81938
 [8]  77.54776  79.56837  88.96339  76.54035  87.89420  77.03149  87.85674
[15]  83.73080  82.95519  88.17558  82.14758  78.55118  81.49500
> colMin(tmp5)
 [1] 63.86284 56.83680 63.04130 56.38223 55.43561 57.99357 56.07401 54.74594
 [9] 64.04664 59.83168 54.91362 58.24938 57.78701 64.13741 62.96363 60.00028
[17] 57.13144 52.96526 58.45718 54.75381
> 
> 
> ### 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] 89.79145 67.70244 70.30842 71.48570 68.88631 67.92958       NA 67.44339
 [9] 71.68223 72.11585
> rowSums(tmp5)
 [1] 1795.829 1354.049 1406.168 1429.714 1377.726 1358.592       NA 1348.868
 [9] 1433.645 1442.317
> rowVars(tmp5)
 [1] 7980.92757   60.91307   60.37905   44.30870   68.14702   66.27727
 [7]   66.45639   62.86210   63.38972  129.15045
> rowSd(tmp5)
 [1] 89.336037  7.804683  7.770395  6.656478  8.255121  8.141085  8.152079
 [8]  7.928562  7.961766 11.364438
> rowMax(tmp5)
 [1] 467.61856  80.92813  87.85674  83.28337  88.96339  83.84130        NA
 [8]  88.17558  91.36558  95.57841
> rowMin(tmp5)
 [1] 57.23686 54.74594 54.75381 59.70472 57.13144 54.91362       NA 57.78701
 [9] 60.63583 52.96526
> 
> colMeans(tmp5)
 [1] 112.33364  69.39478  69.96158  65.83738  71.21228  68.18470  67.73204
 [8]  68.59335  70.03036  73.27054  68.52082  72.27003  67.62886  77.10689
[15]        NA  69.19311  76.44552  68.16270  66.02298  66.38487
> colSums(tmp5)
 [1] 1123.3364  693.9478  699.6158  658.3738  712.1228  681.8470  677.3204
 [8]  685.9335  700.3036  732.7054  685.2082  722.7003  676.2886  771.0689
[15]        NA  691.9311  764.4552  681.6270  660.2298  663.8487
> colVars(tmp5)
 [1] 15622.05354   114.60490    76.14879    76.09507   151.68930    45.44752
 [7]    60.28050    42.36138    28.65050    81.27975    62.76207   101.75606
[13]    49.21766    58.93917          NA    38.66439    89.36645    79.38832
[19]    34.06232    68.27626
> colSd(tmp5)
 [1] 124.988214  10.705368   8.726327   8.723249  12.316221   6.741478
 [7]   7.764052   6.508562   5.352616   9.015528   7.922252  10.087421
[13]   7.015530   7.677185         NA   6.218069   9.453383   8.910013
[19]   5.836293   8.262945
> colMax(tmp5)
 [1] 467.61856  83.54438  91.36558  83.28337  95.57841  78.61868  79.81938
 [8]  77.54776  79.56837  88.96339  76.54035  87.89420  77.03149  87.85674
[15]        NA  82.95519  88.17558  82.14758  78.55118  81.49500
> colMin(tmp5)
 [1] 63.86284 56.83680 63.04130 56.38223 55.43561 57.99357 56.07401 54.74594
 [9] 64.04664 59.83168 54.91362 58.24938 57.78701 64.13741       NA 60.00028
[17] 57.13144 52.96526 58.45718 54.75381
> 
> Max(tmp5,na.rm=TRUE)
[1] 467.6186
> Min(tmp5,na.rm=TRUE)
[1] 52.96526
> mean(tmp5,na.rm=TRUE)
[1] 71.92674
> Sum(tmp5,na.rm=TRUE)
[1] 14313.42
> Var(tmp5,na.rm=TRUE)
[1] 864.0981
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 89.79145 67.70244 70.30842 71.48570 68.88631 67.92958 71.92174 67.44339
 [9] 71.68223 72.11585
> rowSums(tmp5,na.rm=TRUE)
 [1] 1795.829 1354.049 1406.168 1429.714 1377.726 1358.592 1366.513 1348.868
 [9] 1433.645 1442.317
> rowVars(tmp5,na.rm=TRUE)
 [1] 7980.92757   60.91307   60.37905   44.30870   68.14702   66.27727
 [7]   66.45639   62.86210   63.38972  129.15045
> rowSd(tmp5,na.rm=TRUE)
 [1] 89.336037  7.804683  7.770395  6.656478  8.255121  8.141085  8.152079
 [8]  7.928562  7.961766 11.364438
> rowMax(tmp5,na.rm=TRUE)
 [1] 467.61856  80.92813  87.85674  83.28337  88.96339  83.84130  87.05033
 [8]  88.17558  91.36558  95.57841
> rowMin(tmp5,na.rm=TRUE)
 [1] 57.23686 54.74594 54.75381 59.70472 57.13144 54.91362 55.43561 57.78701
 [9] 60.63583 52.96526
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 112.33364  69.39478  69.96158  65.83738  71.21228  68.18470  67.73204
 [8]  68.59335  70.03036  73.27054  68.52082  72.27003  67.62886  77.10689
[15]  70.06180  69.19311  76.44552  68.16270  66.02298  66.38487
> colSums(tmp5,na.rm=TRUE)
 [1] 1123.3364  693.9478  699.6158  658.3738  712.1228  681.8470  677.3204
 [8]  685.9335  700.3036  732.7054  685.2082  722.7003  676.2886  771.0689
[15]  630.5562  691.9311  764.4552  681.6270  660.2298  663.8487
> colVars(tmp5,na.rm=TRUE)
 [1] 15622.05354   114.60490    76.14879    76.09507   151.68930    45.44752
 [7]    60.28050    42.36138    28.65050    81.27975    62.76207   101.75606
[13]    49.21766    58.93917    24.66226    38.66439    89.36645    79.38832
[19]    34.06232    68.27626
> colSd(tmp5,na.rm=TRUE)
 [1] 124.988214  10.705368   8.726327   8.723249  12.316221   6.741478
 [7]   7.764052   6.508562   5.352616   9.015528   7.922252  10.087421
[13]   7.015530   7.677185   4.966111   6.218069   9.453383   8.910013
[19]   5.836293   8.262945
> colMax(tmp5,na.rm=TRUE)
 [1] 467.61856  83.54438  91.36558  83.28337  95.57841  78.61868  79.81938
 [8]  77.54776  79.56837  88.96339  76.54035  87.89420  77.03149  87.85674
[15]  77.92809  82.95519  88.17558  82.14758  78.55118  81.49500
> colMin(tmp5,na.rm=TRUE)
 [1] 63.86284 56.83680 63.04130 56.38223 55.43561 57.99357 56.07401 54.74594
 [9] 64.04664 59.83168 54.91362 58.24938 57.78701 64.13741 62.96363 60.00028
[17] 57.13144 52.96526 58.45718 54.75381
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1] 89.79145 67.70244 70.30842 71.48570 68.88631 67.92958      NaN 67.44339
 [9] 71.68223 72.11585
> rowSums(tmp5,na.rm=TRUE)
 [1] 1795.829 1354.049 1406.168 1429.714 1377.726 1358.592    0.000 1348.868
 [9] 1433.645 1442.317
> rowVars(tmp5,na.rm=TRUE)
 [1] 7980.92757   60.91307   60.37905   44.30870   68.14702   66.27727
 [7]         NA   62.86210   63.38972  129.15045
> rowSd(tmp5,na.rm=TRUE)
 [1] 89.336037  7.804683  7.770395  6.656478  8.255121  8.141085        NA
 [8]  7.928562  7.961766 11.364438
> rowMax(tmp5,na.rm=TRUE)
 [1] 467.61856  80.92813  87.85674  83.28337  88.96339  83.84130        NA
 [8]  88.17558  91.36558  95.57841
> rowMin(tmp5,na.rm=TRUE)
 [1] 57.23686 54.74594 54.75381 59.70472 57.13144 54.91362       NA 57.78701
 [9] 60.63583 52.96526
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1] 116.52166  67.89437  70.51536  66.35513  72.96525  68.13194  66.97778
 [8]  68.71430  68.97058  74.22100  67.81954  70.62778  67.11339  76.35015
[15]       NaN  68.65776  76.36088  67.82260  66.05966  66.40437
> colSums(tmp5,na.rm=TRUE)
 [1] 1048.6949  611.0493  634.6382  597.1962  656.6872  613.1874  602.8000
 [8]  618.4287  620.7352  667.9890  610.3758  635.6500  604.0205  687.1514
[15]    0.0000  617.9198  687.2479  610.4034  594.5370  597.6394
> colVars(tmp5,na.rm=TRUE)
 [1] 17377.49121   103.60398    82.21736    82.59119   136.08053    51.09714
 [7]    61.41525    47.49197    19.59658    81.27683    65.07459    84.13429
[13]    52.38067    59.86429          NA    40.27317   100.45665    88.01053
[19]    38.30497    76.80651
> colSd(tmp5,na.rm=TRUE)
 [1] 131.823713  10.178604   9.067379   9.087969  11.665356   7.148227
 [7]   7.836788   6.891442   4.426802   9.015366   8.066882   9.172475
[13]   7.237449   7.737201         NA   6.346115  10.022807   9.381393
[19]   6.189101   8.763932
> colMax(tmp5,na.rm=TRUE)
 [1] 467.61856  83.54438  91.36558  83.28337  95.57841  78.61868  79.81938
 [8]  77.54776  77.54778  88.96339  76.54035  87.89420  77.03149  87.85674
[15]      -Inf  82.95519  88.17558  82.14758  78.55118  81.49500
> colMin(tmp5,na.rm=TRUE)
 [1] 63.86284 56.83680 63.04130 56.38223 59.70472 57.99357 56.07401 54.74594
 [9] 64.04664 59.83168 54.91362 58.24938 57.78701 64.13741      Inf 60.00028
[17] 57.13144 52.96526 58.45718 54.75381
> 
> 
> 
> 
> 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] 254.6159 235.6298 281.4234 228.4352 175.5727 152.3328 209.5780 221.5983
 [9] 200.0753 186.3796
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 254.6159 235.6298 281.4234 228.4352 175.5727 152.3328 209.5780 221.5983
 [9] 200.0753 186.3796
> 
> 
> 
> copymatrix <- matrix(rnorm(200,150,15),10,20)
> 
> tmp5[1:10,1:20] <- copymatrix
> which.row <- 1
> which.col  <- 3
> cat(which.row," ",which.col,"\n")
1   3 
> tmp5[which.row,which.col] <- NA
> copymatrix[which.row,which.col] <- NA
> 
> colVars(tmp5,na.rm=TRUE)-apply(copymatrix,2,var,na.rm=TRUE)
 [1]  0.000000e+00 -5.684342e-14 -5.684342e-14 -8.526513e-14  9.947598e-14
 [6] -1.136868e-13  5.684342e-14  5.684342e-14 -4.263256e-14  1.136868e-13
[11]  2.131628e-14 -2.842171e-14  2.842171e-14  1.136868e-13  8.526513e-14
[16] -8.526513e-14  5.684342e-14  0.000000e+00 -8.526513e-14 -1.136868e-13
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> ## making sure these things agree
> ##
> ## first when there is no NA
> 
> 
> 
> agree.checks <- function(buff.matrix,r.matrix,err.tol=1e-10){
+ 
+   if (Max(buff.matrix,na.rm=TRUE) != max(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Max")
+   }
+   
+ 
+   if (Min(buff.matrix,na.rm=TRUE) != min(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Min")
+   }
+ 
+ 
+   if (abs(Sum(buff.matrix,na.rm=TRUE)- sum(r.matrix,na.rm=TRUE)) > err.tol){
+ 
+     cat(Sum(buff.matrix,na.rm=TRUE),"\n")
+     cat(sum(r.matrix,na.rm=TRUE),"\n")
+     cat(Sum(buff.matrix,na.rm=TRUE) - sum(r.matrix,na.rm=TRUE),"\n")
+     
+     stop("No agreement in Sum")
+   }
+   
+   if (abs(mean(buff.matrix,na.rm=TRUE) - mean(r.matrix,na.rm=TRUE)) > err.tol){
+     stop("No agreement in mean")
+   }
+   
+   
+   if(abs(Var(buff.matrix,na.rm=TRUE) - var(as.vector(r.matrix),na.rm=TRUE)) > err.tol){
+     stop("No agreement in Var")
+   }
+   
+   
+ 
+   if(any(abs(rowMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,mean,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowMeans")
+   }
+   
+   
+   if(any(abs(colMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,mean,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colMeans")
+   }
+   
+   
+   if(any(abs(rowSums(buff.matrix,na.rm=TRUE)  -  apply(r.matrix,1,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in rowSums")
+   }
+   
+   
+   if(any(abs(colSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colSums")
+   }
+   
+   ### this is to get around the fact that R doesn't like to compute NA on an entire vector of NA when 
+   ### computing variance
+   my.Var <- function(x,na.rm=FALSE){
+    if (all(is.na(x))){
+      return(NA)
+    } else {
+      var(x,na.rm=na.rm)
+    }
+ 
+   }
+   
+   if(any(abs(rowVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+   
+   
+   if(any(abs(colVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+ 
+ 
+   if(any(abs(rowMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+ 
+   if(any(abs(colMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+   
+   
+   if(any(abs(rowMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+   
+ 
+   if(any(abs(colMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+ 
+   if(any(abs(colMedians(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,median,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMedian")
+   }
+ 
+   if(any(abs(colRanges(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,range,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colRanges")
+   }
+ 
+ 
+   
+ }
> 
> 
> 
> 
> 
> 
> 
> 
> 
> for (rep in 1:20){
+   copymatrix <- matrix(rnorm(200,150,15),10,20)
+   
+   tmp5[1:10,1:20] <- copymatrix
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ## now lets assign some NA values and check agreement
+ 
+   which.row <- sample(1:10,1,replace=TRUE)
+   which.col  <- sample(1:20,1,replace=TRUE)
+   
+   cat(which.row," ",which.col,"\n")
+   
+   tmp5[which.row,which.col] <- NA
+   copymatrix[which.row,which.col] <- NA
+   
+   agree.checks(tmp5,copymatrix)
+ 
+   ## make an entire row NA
+   tmp5[which.row,] <- NA
+   copymatrix[which.row,] <- NA
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ### also make an entire col NA
+   tmp5[,which.col] <- NA
+   copymatrix[,which.col] <- NA
+ 
+   agree.checks(tmp5,copymatrix)
+ 
+   ### now make 1 element non NA with NA in the rest of row and column
+ 
+   tmp5[which.row,which.col] <- rnorm(1,150,15)
+   copymatrix[which.row,which.col] <- tmp5[which.row,which.col]
+ 
+   agree.checks(tmp5,copymatrix)
+ }
10   12 
2   11 
2   9 
7   12 
7   2 
10   1 
5   11 
9   10 
7   5 
2   8 
6   14 
2   1 
10   11 
4   7 
9   3 
10   13 
1   11 
5   17 
8   9 
1   16 
There were 50 or more warnings (use warnings() to see the first 50)
> 
> 
> ### now test 1 by n and n by 1 matrix
> 
> 
> err.tol <- 1e-12
> 
> rm(tmp5)
> 
> dataset1 <- rnorm(100)
> dataset2 <- rnorm(100)
> 
> tmp <- createBufferedMatrix(1,100)
> tmp[1,] <- dataset1
> 
> tmp2 <- createBufferedMatrix(100,1)
> tmp2[,1] <- dataset2
> 
> 
> 
> 
> 
> Max(tmp)
[1] 3.302781
> Min(tmp)
[1] -2.909
> mean(tmp)
[1] 0.253572
> Sum(tmp)
[1] 25.3572
> Var(tmp)
[1] 1.182602
> 
> rowMeans(tmp)
[1] 0.253572
> rowSums(tmp)
[1] 25.3572
> rowVars(tmp)
[1] 1.182602
> rowSd(tmp)
[1] 1.087475
> rowMax(tmp)
[1] 3.302781
> rowMin(tmp)
[1] -2.909
> 
> colMeans(tmp)
  [1]  0.80078139  0.33393578  0.11043458  0.86362250 -0.40663538 -0.87098949
  [7] -1.01186927 -1.44560993  1.30554843  2.24792551 -0.28387364 -0.83407229
 [13] -0.89096500 -0.20706307  0.80580736  0.99263488 -0.63228897 -0.43741483
 [19] -1.04860357 -1.14927946  0.14020239  0.82463059 -0.20798292 -2.00514018
 [25]  0.45063404 -1.38673655 -0.12263955  0.47753576  1.91240094  0.65435667
 [31] -2.90899965  0.14031162 -0.93052853  0.30800434  2.08494765 -0.73494138
 [37]  1.86445802  0.57327706  1.13952557  0.43399190  0.83037752 -0.73891288
 [43] -0.47605573  0.52702287 -0.49200510 -0.64121126  0.77995234  1.62312866
 [49]  0.37478609  0.74535628  1.80877887  2.79054412 -0.46342054  0.02141008
 [55]  0.81342879  0.32817102 -0.39937259 -0.25714992  0.31637169  1.42878274
 [61]  2.46467234 -1.11239283  1.70308015  0.11131688  1.50998102  0.12654708
 [67]  0.03680273 -0.94208452  2.29967524  1.06555569 -0.13171822 -0.41801422
 [73]  3.30278119  1.22356589 -0.96224632  0.91555723 -0.13813381 -1.19414922
 [79] -1.31609693 -0.04685506  0.40956736  0.97177458  0.79550627  0.79526830
 [85]  0.90645218 -0.04287469  2.31004901  0.14304921 -0.70029550 -0.70591703
 [91] -1.04790962 -0.53280898  1.32659372  0.15079108 -0.69426929  1.09345292
 [97]  0.54687633  1.02516039  0.44975253 -0.21018003
> colSums(tmp)
  [1]  0.80078139  0.33393578  0.11043458  0.86362250 -0.40663538 -0.87098949
  [7] -1.01186927 -1.44560993  1.30554843  2.24792551 -0.28387364 -0.83407229
 [13] -0.89096500 -0.20706307  0.80580736  0.99263488 -0.63228897 -0.43741483
 [19] -1.04860357 -1.14927946  0.14020239  0.82463059 -0.20798292 -2.00514018
 [25]  0.45063404 -1.38673655 -0.12263955  0.47753576  1.91240094  0.65435667
 [31] -2.90899965  0.14031162 -0.93052853  0.30800434  2.08494765 -0.73494138
 [37]  1.86445802  0.57327706  1.13952557  0.43399190  0.83037752 -0.73891288
 [43] -0.47605573  0.52702287 -0.49200510 -0.64121126  0.77995234  1.62312866
 [49]  0.37478609  0.74535628  1.80877887  2.79054412 -0.46342054  0.02141008
 [55]  0.81342879  0.32817102 -0.39937259 -0.25714992  0.31637169  1.42878274
 [61]  2.46467234 -1.11239283  1.70308015  0.11131688  1.50998102  0.12654708
 [67]  0.03680273 -0.94208452  2.29967524  1.06555569 -0.13171822 -0.41801422
 [73]  3.30278119  1.22356589 -0.96224632  0.91555723 -0.13813381 -1.19414922
 [79] -1.31609693 -0.04685506  0.40956736  0.97177458  0.79550627  0.79526830
 [85]  0.90645218 -0.04287469  2.31004901  0.14304921 -0.70029550 -0.70591703
 [91] -1.04790962 -0.53280898  1.32659372  0.15079108 -0.69426929  1.09345292
 [97]  0.54687633  1.02516039  0.44975253 -0.21018003
> colVars(tmp)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> colSd(tmp)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> colMax(tmp)
  [1]  0.80078139  0.33393578  0.11043458  0.86362250 -0.40663538 -0.87098949
  [7] -1.01186927 -1.44560993  1.30554843  2.24792551 -0.28387364 -0.83407229
 [13] -0.89096500 -0.20706307  0.80580736  0.99263488 -0.63228897 -0.43741483
 [19] -1.04860357 -1.14927946  0.14020239  0.82463059 -0.20798292 -2.00514018
 [25]  0.45063404 -1.38673655 -0.12263955  0.47753576  1.91240094  0.65435667
 [31] -2.90899965  0.14031162 -0.93052853  0.30800434  2.08494765 -0.73494138
 [37]  1.86445802  0.57327706  1.13952557  0.43399190  0.83037752 -0.73891288
 [43] -0.47605573  0.52702287 -0.49200510 -0.64121126  0.77995234  1.62312866
 [49]  0.37478609  0.74535628  1.80877887  2.79054412 -0.46342054  0.02141008
 [55]  0.81342879  0.32817102 -0.39937259 -0.25714992  0.31637169  1.42878274
 [61]  2.46467234 -1.11239283  1.70308015  0.11131688  1.50998102  0.12654708
 [67]  0.03680273 -0.94208452  2.29967524  1.06555569 -0.13171822 -0.41801422
 [73]  3.30278119  1.22356589 -0.96224632  0.91555723 -0.13813381 -1.19414922
 [79] -1.31609693 -0.04685506  0.40956736  0.97177458  0.79550627  0.79526830
 [85]  0.90645218 -0.04287469  2.31004901  0.14304921 -0.70029550 -0.70591703
 [91] -1.04790962 -0.53280898  1.32659372  0.15079108 -0.69426929  1.09345292
 [97]  0.54687633  1.02516039  0.44975253 -0.21018003
> colMin(tmp)
  [1]  0.80078139  0.33393578  0.11043458  0.86362250 -0.40663538 -0.87098949
  [7] -1.01186927 -1.44560993  1.30554843  2.24792551 -0.28387364 -0.83407229
 [13] -0.89096500 -0.20706307  0.80580736  0.99263488 -0.63228897 -0.43741483
 [19] -1.04860357 -1.14927946  0.14020239  0.82463059 -0.20798292 -2.00514018
 [25]  0.45063404 -1.38673655 -0.12263955  0.47753576  1.91240094  0.65435667
 [31] -2.90899965  0.14031162 -0.93052853  0.30800434  2.08494765 -0.73494138
 [37]  1.86445802  0.57327706  1.13952557  0.43399190  0.83037752 -0.73891288
 [43] -0.47605573  0.52702287 -0.49200510 -0.64121126  0.77995234  1.62312866
 [49]  0.37478609  0.74535628  1.80877887  2.79054412 -0.46342054  0.02141008
 [55]  0.81342879  0.32817102 -0.39937259 -0.25714992  0.31637169  1.42878274
 [61]  2.46467234 -1.11239283  1.70308015  0.11131688  1.50998102  0.12654708
 [67]  0.03680273 -0.94208452  2.29967524  1.06555569 -0.13171822 -0.41801422
 [73]  3.30278119  1.22356589 -0.96224632  0.91555723 -0.13813381 -1.19414922
 [79] -1.31609693 -0.04685506  0.40956736  0.97177458  0.79550627  0.79526830
 [85]  0.90645218 -0.04287469  2.31004901  0.14304921 -0.70029550 -0.70591703
 [91] -1.04790962 -0.53280898  1.32659372  0.15079108 -0.69426929  1.09345292
 [97]  0.54687633  1.02516039  0.44975253 -0.21018003
> colMedians(tmp)
  [1]  0.80078139  0.33393578  0.11043458  0.86362250 -0.40663538 -0.87098949
  [7] -1.01186927 -1.44560993  1.30554843  2.24792551 -0.28387364 -0.83407229
 [13] -0.89096500 -0.20706307  0.80580736  0.99263488 -0.63228897 -0.43741483
 [19] -1.04860357 -1.14927946  0.14020239  0.82463059 -0.20798292 -2.00514018
 [25]  0.45063404 -1.38673655 -0.12263955  0.47753576  1.91240094  0.65435667
 [31] -2.90899965  0.14031162 -0.93052853  0.30800434  2.08494765 -0.73494138
 [37]  1.86445802  0.57327706  1.13952557  0.43399190  0.83037752 -0.73891288
 [43] -0.47605573  0.52702287 -0.49200510 -0.64121126  0.77995234  1.62312866
 [49]  0.37478609  0.74535628  1.80877887  2.79054412 -0.46342054  0.02141008
 [55]  0.81342879  0.32817102 -0.39937259 -0.25714992  0.31637169  1.42878274
 [61]  2.46467234 -1.11239283  1.70308015  0.11131688  1.50998102  0.12654708
 [67]  0.03680273 -0.94208452  2.29967524  1.06555569 -0.13171822 -0.41801422
 [73]  3.30278119  1.22356589 -0.96224632  0.91555723 -0.13813381 -1.19414922
 [79] -1.31609693 -0.04685506  0.40956736  0.97177458  0.79550627  0.79526830
 [85]  0.90645218 -0.04287469  2.31004901  0.14304921 -0.70029550 -0.70591703
 [91] -1.04790962 -0.53280898  1.32659372  0.15079108 -0.69426929  1.09345292
 [97]  0.54687633  1.02516039  0.44975253 -0.21018003
> colRanges(tmp)
          [,1]      [,2]      [,3]      [,4]       [,5]       [,6]      [,7]
[1,] 0.8007814 0.3339358 0.1104346 0.8636225 -0.4066354 -0.8709895 -1.011869
[2,] 0.8007814 0.3339358 0.1104346 0.8636225 -0.4066354 -0.8709895 -1.011869
         [,8]     [,9]    [,10]      [,11]      [,12]     [,13]      [,14]
[1,] -1.44561 1.305548 2.247926 -0.2838736 -0.8340723 -0.890965 -0.2070631
[2,] -1.44561 1.305548 2.247926 -0.2838736 -0.8340723 -0.890965 -0.2070631
         [,15]     [,16]     [,17]      [,18]     [,19]     [,20]     [,21]
[1,] 0.8058074 0.9926349 -0.632289 -0.4374148 -1.048604 -1.149279 0.1402024
[2,] 0.8058074 0.9926349 -0.632289 -0.4374148 -1.048604 -1.149279 0.1402024
         [,22]      [,23]    [,24]    [,25]     [,26]      [,27]     [,28]
[1,] 0.8246306 -0.2079829 -2.00514 0.450634 -1.386737 -0.1226395 0.4775358
[2,] 0.8246306 -0.2079829 -2.00514 0.450634 -1.386737 -0.1226395 0.4775358
        [,29]     [,30]  [,31]     [,32]      [,33]     [,34]    [,35]
[1,] 1.912401 0.6543567 -2.909 0.1403116 -0.9305285 0.3080043 2.084948
[2,] 1.912401 0.6543567 -2.909 0.1403116 -0.9305285 0.3080043 2.084948
          [,36]    [,37]     [,38]    [,39]     [,40]     [,41]      [,42]
[1,] -0.7349414 1.864458 0.5732771 1.139526 0.4339919 0.8303775 -0.7389129
[2,] -0.7349414 1.864458 0.5732771 1.139526 0.4339919 0.8303775 -0.7389129
          [,43]     [,44]      [,45]      [,46]     [,47]    [,48]     [,49]
[1,] -0.4760557 0.5270229 -0.4920051 -0.6412113 0.7799523 1.623129 0.3747861
[2,] -0.4760557 0.5270229 -0.4920051 -0.6412113 0.7799523 1.623129 0.3747861
         [,50]    [,51]    [,52]      [,53]      [,54]     [,55]    [,56]
[1,] 0.7453563 1.808779 2.790544 -0.4634205 0.02141008 0.8134288 0.328171
[2,] 0.7453563 1.808779 2.790544 -0.4634205 0.02141008 0.8134288 0.328171
          [,57]      [,58]     [,59]    [,60]    [,61]     [,62]   [,63]
[1,] -0.3993726 -0.2571499 0.3163717 1.428783 2.464672 -1.112393 1.70308
[2,] -0.3993726 -0.2571499 0.3163717 1.428783 2.464672 -1.112393 1.70308
         [,64]    [,65]     [,66]      [,67]      [,68]    [,69]    [,70]
[1,] 0.1113169 1.509981 0.1265471 0.03680273 -0.9420845 2.299675 1.065556
[2,] 0.1113169 1.509981 0.1265471 0.03680273 -0.9420845 2.299675 1.065556
          [,71]      [,72]    [,73]    [,74]      [,75]     [,76]      [,77]
[1,] -0.1317182 -0.4180142 3.302781 1.223566 -0.9622463 0.9155572 -0.1381338
[2,] -0.1317182 -0.4180142 3.302781 1.223566 -0.9622463 0.9155572 -0.1381338
         [,78]     [,79]       [,80]     [,81]     [,82]     [,83]     [,84]
[1,] -1.194149 -1.316097 -0.04685506 0.4095674 0.9717746 0.7955063 0.7952683
[2,] -1.194149 -1.316097 -0.04685506 0.4095674 0.9717746 0.7955063 0.7952683
         [,85]       [,86]    [,87]     [,88]      [,89]     [,90]    [,91]
[1,] 0.9064522 -0.04287469 2.310049 0.1430492 -0.7002955 -0.705917 -1.04791
[2,] 0.9064522 -0.04287469 2.310049 0.1430492 -0.7002955 -0.705917 -1.04791
         [,92]    [,93]     [,94]      [,95]    [,96]     [,97]   [,98]
[1,] -0.532809 1.326594 0.1507911 -0.6942693 1.093453 0.5468763 1.02516
[2,] -0.532809 1.326594 0.1507911 -0.6942693 1.093453 0.5468763 1.02516
         [,99]   [,100]
[1,] 0.4497525 -0.21018
[2,] 0.4497525 -0.21018
> 
> 
> Max(tmp2)
[1] 2.579912
> Min(tmp2)
[1] -2.380263
> mean(tmp2)
[1] -0.08906359
> Sum(tmp2)
[1] -8.906359
> Var(tmp2)
[1] 1.137425
> 
> rowMeans(tmp2)
  [1]  0.92105816  1.73816864  0.74817209 -0.25862893  0.16230721 -0.99897568
  [7]  0.02837893  0.89374281 -0.09678025  0.28566775  1.27448125  0.32117878
 [13] -0.33525678  0.65092467  0.40259237 -0.31245978 -0.36367195  1.23804831
 [19] -0.35679379 -1.31296514  0.02097813 -1.21484998  0.73251422 -1.29008439
 [25] -0.77940225 -1.67058147  0.38379171 -1.92932062 -1.36138477 -0.51027055
 [31]  2.57991210  0.72620548  0.60503412  2.04471446  0.41695760 -0.48209767
 [37]  0.25655636 -0.50543819 -0.65990410 -0.07866296 -0.33832904 -1.62254186
 [43]  0.33714178 -1.61633323 -0.19350228  0.60688450 -0.19859581 -1.30252270
 [49]  1.18325465  2.00258560 -0.11445069  1.61975130  0.22816700  0.64711760
 [55] -2.09772515 -1.64229132 -0.90950534  0.23367355 -2.38026292 -0.40340496
 [61]  0.42497255 -0.72007522 -2.34534271 -0.42665444 -0.82003291 -2.10784612
 [67] -0.22120357 -0.37120597 -0.37700934  1.65663742 -0.83435066 -0.27735939
 [73] -1.00879113 -0.93772751  1.59863126 -0.22488918  0.71850238  1.56985469
 [79] -0.06440576 -0.97368825 -0.68149808 -0.31692341  1.42497049  0.52862365
 [85] -2.06590494  0.62369937  0.58441358  0.98524372 -0.33922242 -1.56467848
 [91]  0.74526470 -0.67104911  0.51495653 -0.47039568  0.04610017  1.01975058
 [97]  2.15132066 -1.35774116 -0.77673295  0.50246096
> rowSums(tmp2)
  [1]  0.92105816  1.73816864  0.74817209 -0.25862893  0.16230721 -0.99897568
  [7]  0.02837893  0.89374281 -0.09678025  0.28566775  1.27448125  0.32117878
 [13] -0.33525678  0.65092467  0.40259237 -0.31245978 -0.36367195  1.23804831
 [19] -0.35679379 -1.31296514  0.02097813 -1.21484998  0.73251422 -1.29008439
 [25] -0.77940225 -1.67058147  0.38379171 -1.92932062 -1.36138477 -0.51027055
 [31]  2.57991210  0.72620548  0.60503412  2.04471446  0.41695760 -0.48209767
 [37]  0.25655636 -0.50543819 -0.65990410 -0.07866296 -0.33832904 -1.62254186
 [43]  0.33714178 -1.61633323 -0.19350228  0.60688450 -0.19859581 -1.30252270
 [49]  1.18325465  2.00258560 -0.11445069  1.61975130  0.22816700  0.64711760
 [55] -2.09772515 -1.64229132 -0.90950534  0.23367355 -2.38026292 -0.40340496
 [61]  0.42497255 -0.72007522 -2.34534271 -0.42665444 -0.82003291 -2.10784612
 [67] -0.22120357 -0.37120597 -0.37700934  1.65663742 -0.83435066 -0.27735939
 [73] -1.00879113 -0.93772751  1.59863126 -0.22488918  0.71850238  1.56985469
 [79] -0.06440576 -0.97368825 -0.68149808 -0.31692341  1.42497049  0.52862365
 [85] -2.06590494  0.62369937  0.58441358  0.98524372 -0.33922242 -1.56467848
 [91]  0.74526470 -0.67104911  0.51495653 -0.47039568  0.04610017  1.01975058
 [97]  2.15132066 -1.35774116 -0.77673295  0.50246096
> 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.92105816  1.73816864  0.74817209 -0.25862893  0.16230721 -0.99897568
  [7]  0.02837893  0.89374281 -0.09678025  0.28566775  1.27448125  0.32117878
 [13] -0.33525678  0.65092467  0.40259237 -0.31245978 -0.36367195  1.23804831
 [19] -0.35679379 -1.31296514  0.02097813 -1.21484998  0.73251422 -1.29008439
 [25] -0.77940225 -1.67058147  0.38379171 -1.92932062 -1.36138477 -0.51027055
 [31]  2.57991210  0.72620548  0.60503412  2.04471446  0.41695760 -0.48209767
 [37]  0.25655636 -0.50543819 -0.65990410 -0.07866296 -0.33832904 -1.62254186
 [43]  0.33714178 -1.61633323 -0.19350228  0.60688450 -0.19859581 -1.30252270
 [49]  1.18325465  2.00258560 -0.11445069  1.61975130  0.22816700  0.64711760
 [55] -2.09772515 -1.64229132 -0.90950534  0.23367355 -2.38026292 -0.40340496
 [61]  0.42497255 -0.72007522 -2.34534271 -0.42665444 -0.82003291 -2.10784612
 [67] -0.22120357 -0.37120597 -0.37700934  1.65663742 -0.83435066 -0.27735939
 [73] -1.00879113 -0.93772751  1.59863126 -0.22488918  0.71850238  1.56985469
 [79] -0.06440576 -0.97368825 -0.68149808 -0.31692341  1.42497049  0.52862365
 [85] -2.06590494  0.62369937  0.58441358  0.98524372 -0.33922242 -1.56467848
 [91]  0.74526470 -0.67104911  0.51495653 -0.47039568  0.04610017  1.01975058
 [97]  2.15132066 -1.35774116 -0.77673295  0.50246096
> rowMin(tmp2)
  [1]  0.92105816  1.73816864  0.74817209 -0.25862893  0.16230721 -0.99897568
  [7]  0.02837893  0.89374281 -0.09678025  0.28566775  1.27448125  0.32117878
 [13] -0.33525678  0.65092467  0.40259237 -0.31245978 -0.36367195  1.23804831
 [19] -0.35679379 -1.31296514  0.02097813 -1.21484998  0.73251422 -1.29008439
 [25] -0.77940225 -1.67058147  0.38379171 -1.92932062 -1.36138477 -0.51027055
 [31]  2.57991210  0.72620548  0.60503412  2.04471446  0.41695760 -0.48209767
 [37]  0.25655636 -0.50543819 -0.65990410 -0.07866296 -0.33832904 -1.62254186
 [43]  0.33714178 -1.61633323 -0.19350228  0.60688450 -0.19859581 -1.30252270
 [49]  1.18325465  2.00258560 -0.11445069  1.61975130  0.22816700  0.64711760
 [55] -2.09772515 -1.64229132 -0.90950534  0.23367355 -2.38026292 -0.40340496
 [61]  0.42497255 -0.72007522 -2.34534271 -0.42665444 -0.82003291 -2.10784612
 [67] -0.22120357 -0.37120597 -0.37700934  1.65663742 -0.83435066 -0.27735939
 [73] -1.00879113 -0.93772751  1.59863126 -0.22488918  0.71850238  1.56985469
 [79] -0.06440576 -0.97368825 -0.68149808 -0.31692341  1.42497049  0.52862365
 [85] -2.06590494  0.62369937  0.58441358  0.98524372 -0.33922242 -1.56467848
 [91]  0.74526470 -0.67104911  0.51495653 -0.47039568  0.04610017  1.01975058
 [97]  2.15132066 -1.35774116 -0.77673295  0.50246096
> 
> colMeans(tmp2)
[1] -0.08906359
> colSums(tmp2)
[1] -8.906359
> colVars(tmp2)
[1] 1.137425
> colSd(tmp2)
[1] 1.066501
> colMax(tmp2)
[1] 2.579912
> colMin(tmp2)
[1] -2.380263
> colMedians(tmp2)
[1] -0.196049
> colRanges(tmp2)
          [,1]
[1,] -2.380263
[2,]  2.579912
> 
> 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.09768844 -1.96299233 -2.73580764  0.76350064 -0.02005413  3.06150656
 [7] -1.54104790 -0.37718345 -2.24956491 -3.06900269
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -1.2570586
[2,] -0.3430128
[3,]  0.1234225
[4,]  0.7214211
[5,]  1.1180166
> 
> rowApply(tmp,sum)
 [1] -0.04689026 -3.54194206 -5.55792615  0.76745423  1.26365772  0.10959873
 [7]  4.62340696 -1.61131173 -3.30133187  0.26232700
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    5   10    7    9    9    2    4    7    8     4
 [2,]    8    5    5    4    1    3   10    6    2     6
 [3,]    3    9   10    2    4    9    3    2    3     3
 [4,]    1    6    8   10    6   10    5    4    4     5
 [5,]    2    1    2    7    2    8    9    8    7     9
 [6,]   10    3    6    8    5    6    6    5    5    10
 [7,]    6    4    4    3    8    5    8   10    1     2
 [8,]    7    7    9    6    3    7    2    1    9     8
 [9,]    4    8    3    1   10    4    7    9    6     1
[10,]    9    2    1    5    7    1    1    3   10     7
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1] -8.618968583  2.261863570  1.826703153 -4.228245274 -2.806540269
 [6] -0.004294967 -1.265340484  4.288026094  1.494640404 -0.282538098
[11] -1.206159860  0.993237506 -0.211980923 -3.343255753 -1.369980045
[16] -0.379034278  0.330178899 -0.153570937  1.956187615 -3.417382449
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -3.4597507
[2,] -1.9786458
[3,] -1.5723917
[4,] -1.4481202
[5,] -0.1600601
> 
> rowApply(tmp,sum)
[1] -11.2428663  -4.2706831  -1.2067904   2.1555516   0.4283335
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]   13    1    1    1    4
[2,]   15   19    2   19    9
[3,]   16   12   19   12   14
[4,]    2    2   12    4   13
[5,]    3   13   10    5    7
> 
> 
> as.matrix(tmp)
           [,1]        [,2]       [,3]        [,4]        [,5]        [,6]
[1,] -0.1600601  0.18150994 0.18884639 -1.81282181 -1.53619958 -0.04116085
[2,] -3.4597507  1.51695828 0.02544281 -1.89258744  0.13975053 -0.55490994
[3,] -1.4481202 -1.10154300 0.82629674  0.03544841 -0.09413039 -0.43165914
[4,] -1.9786458  1.59667334 0.35660067 -0.86121214 -0.73318392 -1.15234783
[5,] -1.5723917  0.06826502 0.42951654  0.30292770 -0.58277690  2.17578279
             [,7]       [,8]       [,9]      [,10]        [,11]       [,12]
[1,] -1.005742379  1.4834349 -1.0019813 -0.7341728  0.673107648  0.22159512
[2,] -0.748109686  1.5756996  0.7993829 -0.2569307 -1.716679288  0.01398416
[3,]  0.002121672  0.5852281 -0.9864905  0.1709738 -0.423572229  0.79596317
[4,]  0.438089941 -0.2100767  1.1567135 -0.2305317 -0.008541241 -1.31163407
[5,]  0.048299968  0.8537402  1.5270158  0.7681233  0.269525250  1.27332912
          [,13]      [,14]      [,15]      [,16]      [,17]      [,18]
[1,] -0.8679914 -0.9927462 -1.8525311 -1.0481483  0.4028180 -0.8450980
[2,] -0.2233981 -0.4169221 -0.9450565  0.4454880  1.1917810  0.7143822
[3,] -0.5397991 -0.4738642  0.4998950  0.6964199 -0.6913384  1.6724561
[4,]  2.3438173  0.1155194  0.6510433  0.2695298  1.2241924  0.4003446
[5,] -0.9246096 -1.5752426  0.2766693 -0.7423237 -1.7972740 -2.0956559
          [,19]      [,20]
[1,] -1.1516128 -1.3439116
[2,]  0.5959903 -1.0751985
[3,]  0.3396667 -0.6407428
[4,]  0.7111860 -0.6219852
[5,]  1.4609573  0.2644557
> 
> 
> 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.20-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.20-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  655  bytes.
Disk usage :  200  bytes.
> subBufferedMatrix(tmp,,5:8)
BufferedMatrix object
Matrix size:  5 4 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  566  bytes.
Disk usage :  160  bytes.
> subBufferedMatrix(tmp,1:3,)
BufferedMatrix object
Matrix size:  3 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.20-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.319847 -0.7105746 0.524082 -0.2391194 1.212499 -0.02067971 -0.9830438
        col8      col9     col10      col11       col12    col13     col14
row1 1.54064 0.3301902 0.7109543 -0.1841119 0.009539223 1.313253 -1.557477
          col15      col16     col17    col18      col19     col20
row1 -0.7336067 -0.6862799 0.6984343 0.514765 -0.1625395 0.2031284
> tmp[,"col10"]
          col10
row1  0.7109543
row2 -0.7303839
row3  1.0222081
row4 -0.5905951
row5 -1.9468460
> tmp[c("row1","row5"),]
          col1       col2      col3        col4       col5        col6
row1 2.3198472 -0.7105746  0.524082 -0.23911941  1.2124995 -0.02067971
row5 0.4179617 -0.5432485 -1.363501  0.07785939 -0.8180655 -0.06992854
           col7      col8       col9      col10      col11       col12    col13
row1 -0.9830438 1.5406402  0.3301902  0.7109543 -0.1841119 0.009539223 1.313253
row5  0.1015352 0.9718427 -0.1961820 -1.9468460  1.1212055 0.635073098 1.659890
          col14      col15       col16      col17    col18      col19
row1 -1.5574769 -0.7336067 -0.68627994  0.6984343 0.514765 -0.1625395
row5 -0.6727939 -0.5210333 -0.03319902 -0.5378556 2.083249  0.7761090
          col20
row1  0.2031284
row5 -0.5347638
> tmp[,c("col6","col20")]
            col6       col20
row1 -0.02067971  0.20312843
row2 -1.31703347 -0.06705903
row3  1.17800423  2.98637695
row4 -0.01166231 -0.21721967
row5 -0.06992854 -0.53476379
> tmp[c("row1","row5"),c("col6","col20")]
            col6      col20
row1 -0.02067971  0.2031284
row5 -0.06992854 -0.5347638
> 
> 
> 
> 
> tmp["row1",] <- rnorm(20,mean=10)
> tmp[,"col10"] <- rnorm(5,mean=30)
> tmp[c("row1","row5"),] <- rnorm(40,mean=50)
> tmp[,c("col6","col20")] <- rnorm(10,mean=75)
> tmp[c("row1","row5"),c("col6","col20")]  <- rnorm(4,mean=105)
> 
> tmp["row1",]
         col1    col2     col3     col4     col5     col6     col7     col8
row1 49.21367 51.1474 49.89536 49.23687 48.47645 105.1832 51.06187 50.25359
         col9    col10    col11    col12    col13   col14    col15    col16
row1 50.37062 49.88094 50.51206 48.61588 49.86175 48.1907 51.39703 50.37924
        col17    col18    col19    col20
row1 50.53694 49.49232 49.16116 104.2166
> tmp[,"col10"]
        col10
row1 49.88094
row2 30.10439
row3 30.73640
row4 29.83340
row5 49.34480
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 49.21367 51.14740 49.89536 49.23687 48.47645 105.1832 51.06187 50.25359
row5 49.55368 49.62175 49.53875 49.37184 49.86372 105.2326 51.46828 50.80679
         col9    col10    col11    col12    col13    col14    col15    col16
row1 50.37062 49.88094 50.51206 48.61588 49.86175 48.19070 51.39703 50.37924
row5 50.88364 49.34480 50.94393 49.87815 49.47509 49.21651 49.52011 50.26623
        col17    col18    col19    col20
row1 50.53694 49.49232 49.16116 104.2166
row5 48.38038 48.47578 48.78226 104.8300
> tmp[,c("col6","col20")]
          col6     col20
row1 105.18317 104.21663
row2  75.98440  73.33609
row3  73.21620  74.29035
row4  75.38098  73.99138
row5 105.23256 104.82999
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 105.1832 104.2166
row5 105.2326 104.8300
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 105.1832 104.2166
row5 105.2326 104.8300
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
             col13
[1,]  8.978956e-05
[2,]  2.071360e-01
[3,] -1.638283e+00
[4,] -1.173840e+00
[5,] -1.144660e+00
> tmp[,c("col17","col7")]
          col17        col7
[1,] -0.1435562 -0.75116260
[2,] -0.6524677  0.52608737
[3,]  0.7698981 -0.19706325
[4,]  1.0221235  0.05575147
[5,] -1.0374724  1.16362822
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
            col6       col20
[1,]  0.01600127  1.02493249
[2,] -2.36913756  0.80235309
[3,] -0.38659985 -0.24406392
[4,]  1.55658643  0.09237934
[5,]  0.39201409  0.70236882
> subBufferedMatrix(tmp,1,c("col6"))[,1]
           col1
[1,] 0.01600127
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
            col6
[1,]  0.01600127
[2,] -2.36913756
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> 
> 
> 
> subBufferedMatrix(tmp,c("row3","row1"),)[,1:20]
          [,1]       [,2]         [,3]       [,4]      [,5]     [,6]       [,7]
row3 1.3345083 -0.3651149 0.4667791279 -0.7066976 -1.025634 1.386966 -0.3362108
row1 0.8645458  0.5145948 0.0007570013 -0.3788829 -1.822567 1.085454  1.3781407
          [,8]       [,9]      [,10]      [,11]      [,12]       [,13]
row3 -2.023342 -0.3188303 -0.9376771 -1.5957932 -0.8228005  0.01473718
row1  1.036777 -0.5237400 -1.5099634 -0.4684215 -0.5797430 -1.38039170
          [,14]        [,15]      [,16]     [,17]      [,18]      [,19]
row3  0.7789332 -0.009696693 -2.9696754 0.1162577 0.08900642  0.1014288
row1 -0.9475757  0.189121837 -0.3854953 1.1207964 1.70778537 -0.5185167
          [,20]
row3  0.9478192
row1 -1.7006090
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
           [,1]      [,2]        [,3]     [,4]     [,5]     [,6]     [,7]
row2 -0.6444706 0.1144765 -0.07875338 1.861595 1.067454 1.417917 0.383535
          [,8]       [,9]      [,10]
row2 0.9995893 -0.4440974 -0.1411843
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
          [,1]        [,2]      [,3]       [,4]       [,5]       [,6]    [,7]
row5 -1.508318 -0.07465658 0.6619037 -0.5127234 -0.1120743 -0.3698282 1.21574
         [,8]      [,9]      [,10]     [,11]    [,12]     [,13]    [,14]
row5 1.074267 0.6668966 -0.3619737 -0.762824 1.373839 -1.061143 0.335226
         [,15]     [,16]      [,17]     [,18]      [,19]      [,20]
row5 -1.675924 0.2102988 -0.2937329 -0.221766 -0.4392388 -0.7242103
> 
> 
> 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: 0x600000f24000>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM159a363872638"
 [2] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM159a33dde5994"
 [3] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM159a350cb2347"
 [4] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM159a3487933c1"
 [5] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM159a3d34e913" 
 [6] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM159a3cb1e52b" 
 [7] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM159a3733c708f"
 [8] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM159a3501f764" 
 [9] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM159a34418c8cd"
[10] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM159a337272da8"
[11] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM159a36d268ce1"
[12] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM159a37deb3fc2"
[13] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM159a35fa71a23"
[14] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM159a353a520e4"
[15] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM159a37e1283a2"
> 
> 
> ### 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: 0x600000f3c0c0>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x600000f3c0c0>
Warning message:
In dir.create(new.directory) :
  '/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x600000f3c0c0>
> rowMedians(tmp)
  [1] -0.275285738 -0.073928720 -0.358634568 -0.315516525 -0.702307910
  [6]  0.355917658  0.012105882 -0.056108365  0.308362340 -0.374055084
 [11]  0.171348808 -0.090953980  0.230257175  0.066989161  0.247447911
 [16]  0.436028711 -0.314672494 -0.324457050 -0.280149394 -0.261965645
 [21] -0.281514892  0.112008585 -0.170445660  0.639041246  0.102484824
 [26]  0.066033149 -0.722519783 -0.088216580 -0.029739410  0.094845879
 [31] -0.105583555 -0.356038532 -0.066574679 -0.107338846  0.062035740
 [36]  0.233578864  0.148842550  0.490807070 -0.275917589 -0.249265233
 [41]  0.347586005 -0.206486533 -0.179387109  0.347260830 -0.060319800
 [46] -0.272195000  0.244876755 -0.007368969  0.010014574 -0.083555953
 [51]  0.253275219  0.049978840  0.734496163  0.191578837  0.019076582
 [56]  0.162362934  0.237195823  0.084215734  0.644384624 -0.220336531
 [61] -0.032929362 -0.547873918  0.174769248  0.203578234  0.299409999
 [66]  0.567552080  0.151613015  0.575170043  0.101251584  0.051800275
 [71] -0.308130283 -0.607106691  0.347129936 -0.277588311 -0.087428041
 [76]  0.696852682  0.461303729  0.120651157 -0.069026693  0.204318610
 [81] -0.659412273 -0.503000509 -0.195901791 -0.232193748  0.048309136
 [86] -0.074836042 -0.127942694 -0.169993806  0.436778388  0.129999257
 [91]  0.290281731 -0.589680881  0.430650935 -0.076394981  0.176107964
 [96]  0.036251994 -0.190365466  0.327244969  0.068519927 -0.210725003
[101] -0.326891897 -0.135654172  0.268597696 -0.148551382 -0.174540192
[106] -0.493127588  0.104497520 -0.378738972 -0.041355996 -0.236769768
[111]  0.019076232  0.235301731  0.248933002  0.294257035  0.428599969
[116] -0.438880152 -0.755811524  0.128535699  0.069700582  0.488130903
[121]  0.074682013  0.080744899 -0.222918554 -0.382560221  0.052379361
[126]  0.209478883 -0.407829964  0.615376607 -0.047956639  0.118143152
[131] -0.177661418 -0.694488393 -0.254490221 -0.412723201  0.018663116
[136] -0.579639150 -0.082889184 -0.132247651 -0.548460447 -0.117286124
[141] -0.015189610  0.045296122 -0.393960650  0.025545659 -0.016628176
[146]  0.210390664 -0.710415079 -0.349613247 -0.235391509  0.152192600
[151] -0.297470391 -0.278418301  0.168142384  0.444401895  0.175054419
[156] -0.490270791 -0.505525515  0.420097825 -0.521143818  0.437517395
[161]  0.539328083  0.290535408  0.318431400  0.424444559 -0.426072442
[166] -0.801570516 -0.845110680 -0.101117326  0.224041324  0.433991870
[171]  0.948459416  0.934235611  0.366268097  0.540837567 -0.035915509
[176] -0.028622683  0.142425259  0.503935718  0.177297538  0.119717349
[181]  0.196049542 -0.101781264 -0.258988677 -0.139985663 -0.419044848
[186]  0.163674283  0.257686126  0.229445160  0.126914961  0.053595503
[191] -0.210685858 -0.068666150  0.262840757  0.305019206 -0.781166368
[196] -0.380959746  0.952668377 -0.215812459 -0.088367253 -0.395976462
[201]  0.113835267  0.113574675  0.189885597 -0.307845195  0.050781722
[206]  0.039226306 -0.017809806  0.103915031  0.461823987  0.264745686
[211] -0.493138152  0.153125387 -0.239136993 -0.217389918  0.476303482
[216]  0.286544137  0.281489009 -0.032675875  0.159513590 -0.201892248
[221] -0.333299034  0.169671173  0.585625703 -0.309076508 -0.365896282
[226] -0.281427152 -0.161189024 -0.002030693 -0.028165992  0.438611606
> 
> proc.time()
   user  system elapsed 
  1.860  10.079  12.282 

BufferedMatrix.Rcheck/tests/rawCalltesting.Rout


R version 4.4.1 (2024-06-14) -- "Race for Your Life"
Copyright (C) 2024 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: 0x600003ed4000>
> .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: 0x600003ed4000>
> .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: 0x600003ed4000>
> .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: 0x600003ed4000>
> 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: 0x600003ee8000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600003ee8000>
> .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: 0x600003ee8000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600003ee8000>
> .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: 0x600003ee8000>
> 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: 0x600003eec000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600003eec000>
> .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: 0x600003eec000>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x600003eec000>
> .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: 0x600003eec000>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x600003eec000>
> .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: 0x600003eec000>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x600003eec000>
> .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: 0x600003eec000>
> 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: 0x600003eec180>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x600003eec180>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600003eec180>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600003eec180>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile15d0329b9b620" "BufferedMatrixFile15d035f640446"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile15d0329b9b620" "BufferedMatrixFile15d035f640446"
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x600003eec420>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600003eec420>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x600003eec420>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x600003eec420>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x600003eec420>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x600003eec420>
> .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: 0x600003eec600>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600003eec600>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x600003eec600>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x600003eec600>
> 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: 0x600003ee0000>
> .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: 0x600003ee0000>
> rm(P)
> 
> proc.time()
   user  system elapsed 
  0.229   0.096   0.325 

BufferedMatrix.Rcheck/tests/Rcodetesting.Rout


R version 4.4.1 (2024-06-14) -- "Race for Your Life"
Copyright (C) 2024 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.237   0.065   0.307 

Example timings