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

This page was generated on 2025-01-09 12:07 -0500 (Thu, 09 Jan 2025).

HostnameOSArch (*)R versionInstalled pkgs
nebbiolo2Linux (Ubuntu 24.04.1 LTS)x86_644.4.2 (2024-10-31) -- "Pile of Leaves" 4744
palomino8Windows Server 2022 Datacenterx644.4.2 (2024-10-31 ucrt) -- "Pile of Leaves" 4487
merida1macOS 12.7.5 Montereyx86_644.4.2 (2024-10-31) -- "Pile of Leaves" 4515
kjohnson1macOS 13.6.6 Venturaarm644.4.2 (2024-10-31) -- "Pile of Leaves" 4467
taishanLinux (openEuler 24.03 LTS)aarch644.4.2 (2024-10-31) -- "Pile of Leaves" 4358
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: 2025-01-02 13:00 -0500 (Thu, 02 Jan 2025)
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)
nebbiolo2Linux (Ubuntu 24.04.1 LTS) / x86_64  OK    OK    OK  UNNEEDED, same version is already published
palomino8Windows Server 2022 Datacenter / x64  OK    OK    OK    OK  UNNEEDED, same version is already published
merida1macOS 12.7.5 Monterey / x86_64  OK    OK    WARNINGS    OK  UNNEEDED, same version is already published
kjohnson1macOS 13.6.6 Ventura / arm64  OK    OK    WARNINGS    OK  UNNEEDED, same version is already published
taishanLinux (openEuler 24.03 LTS) / aarch64  OK    OK    OK  


CHECK results for BufferedMatrix on merida1

To the developers/maintainers of the BufferedMatrix package:
- Allow up to 24 hours (and sometimes 48 hours) for your latest push to git@git.bioconductor.org:packages/BufferedMatrix.git to reflect on this report. See Troubleshooting Build Report for more information.
- Use the following Renviron settings to reproduce errors and warnings.
- If 'R CMD check' started to fail recently on the Linux builder(s) over a missing dependency, add the missing dependency to 'Suggests:' in your DESCRIPTION file. See Renviron.bioc for more information.

raw results


Summary

Package: BufferedMatrix
Version: 1.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: 2025-01-03 00:27:54 -0500 (Fri, 03 Jan 2025)
EndedAt: 2025-01-03 00:29:08 -0500 (Fri, 03 Jan 2025)
EllapsedTime: 74.0 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.2 (2024-10-31)
* using platform: x86_64-apple-darwin20
* R was compiled by
    Apple clang version 14.0.0 (clang-1400.0.29.202)
    GNU Fortran (GCC) 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 ... 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.2 (2024-10-31) -- "Pile of Leaves"
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.597   0.208   0.768 

BufferedMatrix.Rcheck/tests/objectTesting.Rout


R version 4.4.2 (2024-10-31) -- "Pile of Leaves"
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 474188 25.4    1035498 55.4         NA   638648 34.2
Vcells 877698  6.7    8388608 64.0      65536  2071806 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] "Fri Jan  3 00:28:28 2025"
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> date()
[1] "Fri Jan  3 00:28:29 2025"
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,which.col] == test.matrix[which.row,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> 
> 
> RowMode(tmp2)
<pointer: 0x6000035a4120>
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   which.col <- sample(1:20,1)
+   if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,5,replace=TRUE)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> date()
[1] "Fri Jan  3 00:28:35 2025"
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col <- sample(1:20,5,replace=TRUE)
+   if (!all(tmp2[which.row,which.col] == test.matrix[which.row,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> date()
[1] "Fri Jan  3 00:28:38 2025"
> 
> ColMode(tmp2)
<pointer: 0x6000035a4120>
> 
> 
> 
> ### 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.65880487  0.1237992  0.8327231  0.7942049
[2,] -0.42704824 -0.1121095 -1.3038416 -0.2314927
[3,] -0.03861886  0.9777902  1.3882805 -0.2139120
[4,] -2.23301102  0.2432721  0.1165189 -0.9224491
> 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 :  1.9  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
            [,1]      [,2]      [,3]      [,4]
[1,] 99.65880487 0.1237992 0.8327231 0.7942049
[2,]  0.42704824 0.1121095 1.3038416 0.2314927
[3,]  0.03861886 0.9777902 1.3882805 0.2139120
[4,]  2.23301102 0.2432721 0.1165189 0.9224491
> 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 :  1.9  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
          [,1]      [,2]      [,3]      [,4]
[1,] 9.9829257 0.3518511 0.9125366 0.8911817
[2,] 0.6534893 0.3348276 1.1418588 0.4811369
[3,] 0.1965168 0.9888327 1.1782532 0.4625062
[4,] 1.4943263 0.4932262 0.3413487 0.9604421
> 
> 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 :  1.9  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
          [,1]     [,2]     [,3]     [,4]
[1,] 224.48806 28.64231 34.95809 34.70602
[2,]  31.96194 28.46039 37.72243 30.04286
[3,]  27.00379 35.86612 38.17081 29.83897
[4,]  42.17627 30.17553 28.53001 35.52687
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x6000035ac360>
> exp(tmp5)
<pointer: 0x6000035ac360>
> log(tmp5,2)
<pointer: 0x6000035ac360>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 467.2425
> Min(tmp5)
[1] 53.5904
> mean(tmp5)
[1] 72.44727
> Sum(tmp5)
[1] 14489.45
> Var(tmp5)
[1] 864.6221
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 91.09098 69.61246 65.90953 72.17400 71.73949 73.37879 64.88032 72.51818
 [9] 73.28091 69.88807
> rowSums(tmp5)
 [1] 1821.820 1392.249 1318.191 1443.480 1434.790 1467.576 1297.606 1450.364
 [9] 1465.618 1397.761
> rowVars(tmp5)
 [1] 7907.64138   51.28537   57.66682   78.61714   67.65196   83.71524
 [7]   51.52469   65.55131   95.08998  108.27955
> rowSd(tmp5)
 [1] 88.924920  7.161381  7.593867  8.866631  8.225081  9.149603  7.178070
 [8]  8.096377  9.751409 10.405746
> rowMax(tmp5)
 [1] 467.24249  81.43611  79.44754  87.78439  86.54510  93.98638  78.57750
 [8]  85.46389  87.22465  95.75642
> rowMin(tmp5)
 [1] 55.65178 57.18805 53.59040 54.46574 57.11862 58.99569 54.60135 58.57995
 [9] 58.58825 55.12072
> 
> colMeans(tmp5)
 [1] 111.51236  65.03634  71.87942  68.21795  68.99111  67.57128  70.32939
 [8]  71.11852  71.48255  76.11607  73.46902  70.84168  68.54254  70.89692
[15]  66.13775  73.66353  70.08455  71.87819  69.50336  71.67295
> colSums(tmp5)
 [1] 1115.1236  650.3634  718.7942  682.1795  689.9111  675.7128  703.2939
 [8]  711.1852  714.8255  761.1607  734.6902  708.4168  685.4254  708.9692
[15]  661.3775  736.6353  700.8455  718.7819  695.0336  716.7295
> colVars(tmp5)
 [1] 15695.64955    51.62046    77.75749    48.42597    83.90585    49.65430
 [7]   153.96596    52.33096    90.26854    35.94796    40.10920    47.22152
[13]    81.28057   112.56628    80.51703   124.46864    87.59376   121.52375
[19]    90.76832    66.28100
> colSd(tmp5)
 [1] 125.282279   7.184738   8.818021   6.958877   9.160014   7.046581
 [7]  12.408302   7.234014   9.500976   5.995662   6.333183   6.871792
[13]   9.015574  10.609726   8.973128  11.156552   9.359154  11.023781
[19]   9.527241   8.141314
> colMax(tmp5)
 [1] 467.24249  75.59025  86.54510  81.91755  87.99840  79.51661  95.75642
 [8]  81.43611  85.04198  86.95918  81.32835  82.60708  83.52979  87.31384
[15]  80.21257  90.94910  82.55017  93.98638  85.88625  79.62664
> colMin(tmp5)
 [1] 56.20484 57.82404 59.38147 59.67811 55.65178 54.46574 53.59040 59.71594
 [9] 59.43708 69.89459 62.28462 60.59632 56.86136 57.69820 55.12072 57.18088
[17] 56.97239 54.60135 55.37893 57.18805
> 
> 
> ### 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] 91.09098 69.61246 65.90953 72.17400 71.73949 73.37879 64.88032 72.51818
 [9] 73.28091       NA
> rowSums(tmp5)
 [1] 1821.820 1392.249 1318.191 1443.480 1434.790 1467.576 1297.606 1450.364
 [9] 1465.618       NA
> rowVars(tmp5)
 [1] 7907.64138   51.28537   57.66682   78.61714   67.65196   83.71524
 [7]   51.52469   65.55131   95.08998  108.65823
> rowSd(tmp5)
 [1] 88.924920  7.161381  7.593867  8.866631  8.225081  9.149603  7.178070
 [8]  8.096377  9.751409 10.423926
> rowMax(tmp5)
 [1] 467.24249  81.43611  79.44754  87.78439  86.54510  93.98638  78.57750
 [8]  85.46389  87.22465        NA
> rowMin(tmp5)
 [1] 55.65178 57.18805 53.59040 54.46574 57.11862 58.99569 54.60135 58.57995
 [9] 58.58825       NA
> 
> colMeans(tmp5)
 [1] 111.51236  65.03634  71.87942  68.21795  68.99111  67.57128  70.32939
 [8]  71.11852  71.48255  76.11607  73.46902  70.84168  68.54254  70.89692
[15]  66.13775  73.66353  70.08455  71.87819  69.50336        NA
> colSums(tmp5)
 [1] 1115.1236  650.3634  718.7942  682.1795  689.9111  675.7128  703.2939
 [8]  711.1852  714.8255  761.1607  734.6902  708.4168  685.4254  708.9692
[15]  661.3775  736.6353  700.8455  718.7819  695.0336        NA
> colVars(tmp5)
 [1] 15695.64955    51.62046    77.75749    48.42597    83.90585    49.65430
 [7]   153.96596    52.33096    90.26854    35.94796    40.10920    47.22152
[13]    81.28057   112.56628    80.51703   124.46864    87.59376   121.52375
[19]    90.76832          NA
> colSd(tmp5)
 [1] 125.282279   7.184738   8.818021   6.958877   9.160014   7.046581
 [7]  12.408302   7.234014   9.500976   5.995662   6.333183   6.871792
[13]   9.015574  10.609726   8.973128  11.156552   9.359154  11.023781
[19]   9.527241         NA
> colMax(tmp5)
 [1] 467.24249  75.59025  86.54510  81.91755  87.99840  79.51661  95.75642
 [8]  81.43611  85.04198  86.95918  81.32835  82.60708  83.52979  87.31384
[15]  80.21257  90.94910  82.55017  93.98638  85.88625        NA
> colMin(tmp5)
 [1] 56.20484 57.82404 59.38147 59.67811 55.65178 54.46574 53.59040 59.71594
 [9] 59.43708 69.89459 62.28462 60.59632 56.86136 57.69820 55.12072 57.18088
[17] 56.97239 54.60135 55.37893       NA
> 
> Max(tmp5,na.rm=TRUE)
[1] 467.2425
> Min(tmp5,na.rm=TRUE)
[1] 53.5904
> mean(tmp5,na.rm=TRUE)
[1] 72.50947
> Sum(tmp5,na.rm=TRUE)
[1] 14429.38
> Var(tmp5,na.rm=TRUE)
[1] 868.2113
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 91.09098 69.61246 65.90953 72.17400 71.73949 73.37879 64.88032 72.51818
 [9] 73.28091 70.40480
> rowSums(tmp5,na.rm=TRUE)
 [1] 1821.820 1392.249 1318.191 1443.480 1434.790 1467.576 1297.606 1450.364
 [9] 1465.618 1337.691
> rowVars(tmp5,na.rm=TRUE)
 [1] 7907.64138   51.28537   57.66682   78.61714   67.65196   83.71524
 [7]   51.52469   65.55131   95.08998  108.65823
> rowSd(tmp5,na.rm=TRUE)
 [1] 88.924920  7.161381  7.593867  8.866631  8.225081  9.149603  7.178070
 [8]  8.096377  9.751409 10.423926
> rowMax(tmp5,na.rm=TRUE)
 [1] 467.24249  81.43611  79.44754  87.78439  86.54510  93.98638  78.57750
 [8]  85.46389  87.22465  95.75642
> rowMin(tmp5,na.rm=TRUE)
 [1] 55.65178 57.18805 53.59040 54.46574 57.11862 58.99569 54.60135 58.57995
 [9] 58.58825 55.12072
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 111.51236  65.03634  71.87942  68.21795  68.99111  67.57128  70.32939
 [8]  71.11852  71.48255  76.11607  73.46902  70.84168  68.54254  70.89692
[15]  66.13775  73.66353  70.08455  71.87819  69.50336  72.96215
> colSums(tmp5,na.rm=TRUE)
 [1] 1115.1236  650.3634  718.7942  682.1795  689.9111  675.7128  703.2939
 [8]  711.1852  714.8255  761.1607  734.6902  708.4168  685.4254  708.9692
[15]  661.3775  736.6353  700.8455  718.7819  695.0336  656.6593
> colVars(tmp5,na.rm=TRUE)
 [1] 15695.64955    51.62046    77.75749    48.42597    83.90585    49.65430
 [7]   153.96596    52.33096    90.26854    35.94796    40.10920    47.22152
[13]    81.28057   112.56628    80.51703   124.46864    87.59376   121.52375
[19]    90.76832    55.86844
> colSd(tmp5,na.rm=TRUE)
 [1] 125.282279   7.184738   8.818021   6.958877   9.160014   7.046581
 [7]  12.408302   7.234014   9.500976   5.995662   6.333183   6.871792
[13]   9.015574  10.609726   8.973128  11.156552   9.359154  11.023781
[19]   9.527241   7.474519
> colMax(tmp5,na.rm=TRUE)
 [1] 467.24249  75.59025  86.54510  81.91755  87.99840  79.51661  95.75642
 [8]  81.43611  85.04198  86.95918  81.32835  82.60708  83.52979  87.31384
[15]  80.21257  90.94910  82.55017  93.98638  85.88625  79.62664
> colMin(tmp5,na.rm=TRUE)
 [1] 56.20484 57.82404 59.38147 59.67811 55.65178 54.46574 53.59040 59.71594
 [9] 59.43708 69.89459 62.28462 60.59632 56.86136 57.69820 55.12072 57.18088
[17] 56.97239 54.60135 55.37893 57.18805
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1] 91.09098 69.61246 65.90953 72.17400 71.73949 73.37879 64.88032 72.51818
 [9] 73.28091      NaN
> rowSums(tmp5,na.rm=TRUE)
 [1] 1821.820 1392.249 1318.191 1443.480 1434.790 1467.576 1297.606 1450.364
 [9] 1465.618    0.000
> rowVars(tmp5,na.rm=TRUE)
 [1] 7907.64138   51.28537   57.66682   78.61714   67.65196   83.71524
 [7]   51.52469   65.55131   95.08998         NA
> rowSd(tmp5,na.rm=TRUE)
 [1] 88.924920  7.161381  7.593867  8.866631  8.225081  9.149603  7.178070
 [8]  8.096377  9.751409        NA
> rowMax(tmp5,na.rm=TRUE)
 [1] 467.24249  81.43611  79.44754  87.78439  86.54510  93.98638  78.57750
 [8]  85.46389  87.22465        NA
> rowMin(tmp5,na.rm=TRUE)
 [1] 55.65178 57.18805 53.59040 54.46574 57.11862 58.99569 54.60135 58.57995
 [9] 58.58825       NA
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1] 116.83138  64.00019  71.82219  68.24043  66.87919  67.92808  67.50416
 [8]  72.10864  70.97068  74.91127  74.31010  71.09702  69.84045  71.26219
[15]  67.36186  74.03289  69.82443  72.78093  69.96434       NaN
> colSums(tmp5,na.rm=TRUE)
 [1] 1051.4824  576.0017  646.3997  614.1638  601.9127  611.3528  607.5375
 [8]  648.9778  638.7362  674.2015  668.7909  639.8732  628.5641  641.3597
[15]  606.2568  666.2960  628.4198  655.0284  629.6791    0.0000
> colVars(tmp5,na.rm=TRUE)
 [1] 17339.32023    45.99494    87.44033    54.47353    44.21670    54.42887
 [7]    83.41534    47.84337    98.60450    24.11185    37.16431    52.39069
[13]    72.48925   125.13601    73.72404   138.49247    97.78174   127.54621
[19]    99.72366          NA
> colSd(tmp5,na.rm=TRUE)
 [1] 131.678853   6.781957   9.350953   7.380619   6.649564   7.377592
 [7]   9.133200   6.916890   9.929980   4.910382   6.096254   7.238141
[13]   8.514062  11.186421   8.586270  11.768282   9.888465  11.293636
[19]   9.986173         NA
> colMax(tmp5,na.rm=TRUE)
 [1] 467.24249  75.59025  86.54510  81.91755  73.56487  79.51661  82.11410
 [8]  81.43611  85.04198  85.46389  81.32835  82.60708  83.52979  87.31384
[15]  80.21257  90.94910  82.55017  93.98638  85.88625      -Inf
> colMin(tmp5,na.rm=TRUE)
 [1] 56.20484 57.82404 59.38147 59.67811 55.65178 54.46574 53.59040 59.71594
 [9] 59.43708 69.89459 62.28462 60.59632 59.78890 57.69820 58.99569 57.18088
[17] 56.97239 54.60135 55.37893      Inf
> 
> 
> 
> 
> 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] 152.0402 181.2737 202.3450 206.0393 185.6287 267.4543 183.3056 135.2627
 [9] 172.4033 323.7999
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 152.0402 181.2737 202.3450 206.0393 185.6287 267.4543 183.3056 135.2627
 [9] 172.4033 323.7999
> 
> 
> 
> copymatrix <- matrix(rnorm(200,150,15),10,20)
> 
> tmp5[1:10,1:20] <- copymatrix
> which.row <- 1
> which.col  <- 3
> cat(which.row," ",which.col,"\n")
1   3 
> tmp5[which.row,which.col] <- NA
> copymatrix[which.row,which.col] <- NA
> 
> colVars(tmp5,na.rm=TRUE)-apply(copymatrix,2,var,na.rm=TRUE)
 [1]  2.842171e-14 -5.684342e-14 -2.131628e-14 -1.421085e-13  1.421085e-14
 [6] -8.526513e-14  1.136868e-13  5.684342e-14  2.842171e-14  0.000000e+00
[11]  5.684342e-14 -5.684342e-14  1.136868e-13 -5.684342e-14  5.684342e-14
[16]  5.684342e-14 -8.526513e-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)
+ }
8   5 
8   8 
7   11 
9   2 
4   10 
3   5 
6   9 
10   1 
5   15 
2   10 
8   2 
8   18 
5   6 
5   2 
10   5 
3   16 
3   6 
9   15 
8   14 
4   3 
There were 50 or more warnings (use warnings() to see the first 50)
> 
> 
> ### now test 1 by n and n by 1 matrix
> 
> 
> err.tol <- 1e-12
> 
> rm(tmp5)
> 
> dataset1 <- rnorm(100)
> dataset2 <- rnorm(100)
> 
> tmp <- createBufferedMatrix(1,100)
> tmp[1,] <- dataset1
> 
> tmp2 <- createBufferedMatrix(100,1)
> tmp2[,1] <- dataset2
> 
> 
> 
> 
> 
> Max(tmp)
[1] 2.508383
> Min(tmp)
[1] -2.179262
> mean(tmp)
[1] -0.113296
> Sum(tmp)
[1] -11.3296
> Var(tmp)
[1] 0.8356853
> 
> rowMeans(tmp)
[1] -0.113296
> rowSums(tmp)
[1] -11.3296
> rowVars(tmp)
[1] 0.8356853
> rowSd(tmp)
[1] 0.9141583
> rowMax(tmp)
[1] 2.508383
> rowMin(tmp)
[1] -2.179262
> 
> colMeans(tmp)
  [1] -1.29033336  0.16705644 -1.04961482  0.82685021 -0.18309020  0.71742062
  [7]  1.23579105  0.62308580 -0.13504030  0.96403751  0.49019687 -0.02361194
 [13] -1.90656144  1.25676457  1.30930926 -0.90311340  0.22112029  0.84353091
 [19]  0.09841310 -0.02376371 -1.52475643 -0.86185532  0.35771063 -1.02849428
 [25]  0.87849335 -0.15115196  1.58013437 -1.05878703  0.45005968 -0.91303654
 [31] -1.01118376 -1.86769126 -1.13323756 -0.37657687 -1.96208488  0.30684022
 [37]  0.16167253 -0.37218813 -0.66242266 -0.05382095  0.02729535  2.50838253
 [43]  0.98244867  0.09982127 -0.41136190 -0.63736414 -0.48266755 -0.32395480
 [49] -0.31762378  0.32661913  0.51837845 -0.12773528  0.22777156 -2.17926220
 [55] -0.61615194 -0.09802623  0.55036499 -1.19705270 -0.82373947 -0.21510699
 [61] -0.99281125  0.04785147 -0.77174929 -0.89154112 -0.39789961  0.21022074
 [67]  0.19962001 -0.08386917  0.16321727 -1.04028814  0.38672624 -0.86845971
 [73] -1.28582835 -1.17101764  0.15605237 -0.53496427  1.42816784 -0.89203872
 [79] -0.27757413 -1.18530928 -0.17255101  0.85380294  1.04826133  0.83289504
 [85] -0.11326354 -1.56570109 -0.57646442 -1.21508323  0.75117491 -0.07520650
 [91] -1.25460791  0.46133373 -0.26406417  1.53502403  0.57783846 -0.55811912
 [97]  2.22238132  0.50008329  1.43696447  0.24009453
> colSums(tmp)
  [1] -1.29033336  0.16705644 -1.04961482  0.82685021 -0.18309020  0.71742062
  [7]  1.23579105  0.62308580 -0.13504030  0.96403751  0.49019687 -0.02361194
 [13] -1.90656144  1.25676457  1.30930926 -0.90311340  0.22112029  0.84353091
 [19]  0.09841310 -0.02376371 -1.52475643 -0.86185532  0.35771063 -1.02849428
 [25]  0.87849335 -0.15115196  1.58013437 -1.05878703  0.45005968 -0.91303654
 [31] -1.01118376 -1.86769126 -1.13323756 -0.37657687 -1.96208488  0.30684022
 [37]  0.16167253 -0.37218813 -0.66242266 -0.05382095  0.02729535  2.50838253
 [43]  0.98244867  0.09982127 -0.41136190 -0.63736414 -0.48266755 -0.32395480
 [49] -0.31762378  0.32661913  0.51837845 -0.12773528  0.22777156 -2.17926220
 [55] -0.61615194 -0.09802623  0.55036499 -1.19705270 -0.82373947 -0.21510699
 [61] -0.99281125  0.04785147 -0.77174929 -0.89154112 -0.39789961  0.21022074
 [67]  0.19962001 -0.08386917  0.16321727 -1.04028814  0.38672624 -0.86845971
 [73] -1.28582835 -1.17101764  0.15605237 -0.53496427  1.42816784 -0.89203872
 [79] -0.27757413 -1.18530928 -0.17255101  0.85380294  1.04826133  0.83289504
 [85] -0.11326354 -1.56570109 -0.57646442 -1.21508323  0.75117491 -0.07520650
 [91] -1.25460791  0.46133373 -0.26406417  1.53502403  0.57783846 -0.55811912
 [97]  2.22238132  0.50008329  1.43696447  0.24009453
> 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] -1.29033336  0.16705644 -1.04961482  0.82685021 -0.18309020  0.71742062
  [7]  1.23579105  0.62308580 -0.13504030  0.96403751  0.49019687 -0.02361194
 [13] -1.90656144  1.25676457  1.30930926 -0.90311340  0.22112029  0.84353091
 [19]  0.09841310 -0.02376371 -1.52475643 -0.86185532  0.35771063 -1.02849428
 [25]  0.87849335 -0.15115196  1.58013437 -1.05878703  0.45005968 -0.91303654
 [31] -1.01118376 -1.86769126 -1.13323756 -0.37657687 -1.96208488  0.30684022
 [37]  0.16167253 -0.37218813 -0.66242266 -0.05382095  0.02729535  2.50838253
 [43]  0.98244867  0.09982127 -0.41136190 -0.63736414 -0.48266755 -0.32395480
 [49] -0.31762378  0.32661913  0.51837845 -0.12773528  0.22777156 -2.17926220
 [55] -0.61615194 -0.09802623  0.55036499 -1.19705270 -0.82373947 -0.21510699
 [61] -0.99281125  0.04785147 -0.77174929 -0.89154112 -0.39789961  0.21022074
 [67]  0.19962001 -0.08386917  0.16321727 -1.04028814  0.38672624 -0.86845971
 [73] -1.28582835 -1.17101764  0.15605237 -0.53496427  1.42816784 -0.89203872
 [79] -0.27757413 -1.18530928 -0.17255101  0.85380294  1.04826133  0.83289504
 [85] -0.11326354 -1.56570109 -0.57646442 -1.21508323  0.75117491 -0.07520650
 [91] -1.25460791  0.46133373 -0.26406417  1.53502403  0.57783846 -0.55811912
 [97]  2.22238132  0.50008329  1.43696447  0.24009453
> colMin(tmp)
  [1] -1.29033336  0.16705644 -1.04961482  0.82685021 -0.18309020  0.71742062
  [7]  1.23579105  0.62308580 -0.13504030  0.96403751  0.49019687 -0.02361194
 [13] -1.90656144  1.25676457  1.30930926 -0.90311340  0.22112029  0.84353091
 [19]  0.09841310 -0.02376371 -1.52475643 -0.86185532  0.35771063 -1.02849428
 [25]  0.87849335 -0.15115196  1.58013437 -1.05878703  0.45005968 -0.91303654
 [31] -1.01118376 -1.86769126 -1.13323756 -0.37657687 -1.96208488  0.30684022
 [37]  0.16167253 -0.37218813 -0.66242266 -0.05382095  0.02729535  2.50838253
 [43]  0.98244867  0.09982127 -0.41136190 -0.63736414 -0.48266755 -0.32395480
 [49] -0.31762378  0.32661913  0.51837845 -0.12773528  0.22777156 -2.17926220
 [55] -0.61615194 -0.09802623  0.55036499 -1.19705270 -0.82373947 -0.21510699
 [61] -0.99281125  0.04785147 -0.77174929 -0.89154112 -0.39789961  0.21022074
 [67]  0.19962001 -0.08386917  0.16321727 -1.04028814  0.38672624 -0.86845971
 [73] -1.28582835 -1.17101764  0.15605237 -0.53496427  1.42816784 -0.89203872
 [79] -0.27757413 -1.18530928 -0.17255101  0.85380294  1.04826133  0.83289504
 [85] -0.11326354 -1.56570109 -0.57646442 -1.21508323  0.75117491 -0.07520650
 [91] -1.25460791  0.46133373 -0.26406417  1.53502403  0.57783846 -0.55811912
 [97]  2.22238132  0.50008329  1.43696447  0.24009453
> colMedians(tmp)
  [1] -1.29033336  0.16705644 -1.04961482  0.82685021 -0.18309020  0.71742062
  [7]  1.23579105  0.62308580 -0.13504030  0.96403751  0.49019687 -0.02361194
 [13] -1.90656144  1.25676457  1.30930926 -0.90311340  0.22112029  0.84353091
 [19]  0.09841310 -0.02376371 -1.52475643 -0.86185532  0.35771063 -1.02849428
 [25]  0.87849335 -0.15115196  1.58013437 -1.05878703  0.45005968 -0.91303654
 [31] -1.01118376 -1.86769126 -1.13323756 -0.37657687 -1.96208488  0.30684022
 [37]  0.16167253 -0.37218813 -0.66242266 -0.05382095  0.02729535  2.50838253
 [43]  0.98244867  0.09982127 -0.41136190 -0.63736414 -0.48266755 -0.32395480
 [49] -0.31762378  0.32661913  0.51837845 -0.12773528  0.22777156 -2.17926220
 [55] -0.61615194 -0.09802623  0.55036499 -1.19705270 -0.82373947 -0.21510699
 [61] -0.99281125  0.04785147 -0.77174929 -0.89154112 -0.39789961  0.21022074
 [67]  0.19962001 -0.08386917  0.16321727 -1.04028814  0.38672624 -0.86845971
 [73] -1.28582835 -1.17101764  0.15605237 -0.53496427  1.42816784 -0.89203872
 [79] -0.27757413 -1.18530928 -0.17255101  0.85380294  1.04826133  0.83289504
 [85] -0.11326354 -1.56570109 -0.57646442 -1.21508323  0.75117491 -0.07520650
 [91] -1.25460791  0.46133373 -0.26406417  1.53502403  0.57783846 -0.55811912
 [97]  2.22238132  0.50008329  1.43696447  0.24009453
> colRanges(tmp)
          [,1]      [,2]      [,3]      [,4]       [,5]      [,6]     [,7]
[1,] -1.290333 0.1670564 -1.049615 0.8268502 -0.1830902 0.7174206 1.235791
[2,] -1.290333 0.1670564 -1.049615 0.8268502 -0.1830902 0.7174206 1.235791
          [,8]       [,9]     [,10]     [,11]       [,12]     [,13]    [,14]
[1,] 0.6230858 -0.1350403 0.9640375 0.4901969 -0.02361194 -1.906561 1.256765
[2,] 0.6230858 -0.1350403 0.9640375 0.4901969 -0.02361194 -1.906561 1.256765
        [,15]      [,16]     [,17]     [,18]     [,19]       [,20]     [,21]
[1,] 1.309309 -0.9031134 0.2211203 0.8435309 0.0984131 -0.02376371 -1.524756
[2,] 1.309309 -0.9031134 0.2211203 0.8435309 0.0984131 -0.02376371 -1.524756
          [,22]     [,23]     [,24]     [,25]     [,26]    [,27]     [,28]
[1,] -0.8618553 0.3577106 -1.028494 0.8784933 -0.151152 1.580134 -1.058787
[2,] -0.8618553 0.3577106 -1.028494 0.8784933 -0.151152 1.580134 -1.058787
         [,29]      [,30]     [,31]     [,32]     [,33]      [,34]     [,35]
[1,] 0.4500597 -0.9130365 -1.011184 -1.867691 -1.133238 -0.3765769 -1.962085
[2,] 0.4500597 -0.9130365 -1.011184 -1.867691 -1.133238 -0.3765769 -1.962085
         [,36]     [,37]      [,38]      [,39]       [,40]      [,41]    [,42]
[1,] 0.3068402 0.1616725 -0.3721881 -0.6624227 -0.05382095 0.02729535 2.508383
[2,] 0.3068402 0.1616725 -0.3721881 -0.6624227 -0.05382095 0.02729535 2.508383
         [,43]      [,44]      [,45]      [,46]      [,47]      [,48]
[1,] 0.9824487 0.09982127 -0.4113619 -0.6373641 -0.4826675 -0.3239548
[2,] 0.9824487 0.09982127 -0.4113619 -0.6373641 -0.4826675 -0.3239548
          [,49]     [,50]     [,51]      [,52]     [,53]     [,54]      [,55]
[1,] -0.3176238 0.3266191 0.5183784 -0.1277353 0.2277716 -2.179262 -0.6161519
[2,] -0.3176238 0.3266191 0.5183784 -0.1277353 0.2277716 -2.179262 -0.6161519
           [,56]    [,57]     [,58]      [,59]     [,60]      [,61]      [,62]
[1,] -0.09802623 0.550365 -1.197053 -0.8237395 -0.215107 -0.9928112 0.04785147
[2,] -0.09802623 0.550365 -1.197053 -0.8237395 -0.215107 -0.9928112 0.04785147
          [,63]      [,64]      [,65]     [,66]   [,67]       [,68]     [,69]
[1,] -0.7717493 -0.8915411 -0.3978996 0.2102207 0.19962 -0.08386917 0.1632173
[2,] -0.7717493 -0.8915411 -0.3978996 0.2102207 0.19962 -0.08386917 0.1632173
         [,70]     [,71]      [,72]     [,73]     [,74]     [,75]      [,76]
[1,] -1.040288 0.3867262 -0.8684597 -1.285828 -1.171018 0.1560524 -0.5349643
[2,] -1.040288 0.3867262 -0.8684597 -1.285828 -1.171018 0.1560524 -0.5349643
        [,77]      [,78]      [,79]     [,80]     [,81]     [,82]    [,83]
[1,] 1.428168 -0.8920387 -0.2775741 -1.185309 -0.172551 0.8538029 1.048261
[2,] 1.428168 -0.8920387 -0.2775741 -1.185309 -0.172551 0.8538029 1.048261
        [,84]      [,85]     [,86]      [,87]     [,88]     [,89]      [,90]
[1,] 0.832895 -0.1132635 -1.565701 -0.5764644 -1.215083 0.7511749 -0.0752065
[2,] 0.832895 -0.1132635 -1.565701 -0.5764644 -1.215083 0.7511749 -0.0752065
         [,91]     [,92]      [,93]    [,94]     [,95]      [,96]    [,97]
[1,] -1.254608 0.4613337 -0.2640642 1.535024 0.5778385 -0.5581191 2.222381
[2,] -1.254608 0.4613337 -0.2640642 1.535024 0.5778385 -0.5581191 2.222381
         [,98]    [,99]    [,100]
[1,] 0.5000833 1.436964 0.2400945
[2,] 0.5000833 1.436964 0.2400945
> 
> 
> Max(tmp2)
[1] 2.681042
> Min(tmp2)
[1] -2.058986
> mean(tmp2)
[1] 0.1593421
> Sum(tmp2)
[1] 15.93421
> Var(tmp2)
[1] 0.9333542
> 
> rowMeans(tmp2)
  [1]  0.53045686 -0.92100419 -1.76330927  0.31605531  0.43167298  1.40703368
  [7] -0.32362428 -0.30815491  0.56396656  0.74278877  0.68505059 -0.12621105
 [13] -0.42123763 -0.58113129 -0.17496264 -0.30956217 -0.99897686  1.26329500
 [19]  0.63494358  0.07878003  0.67970839  2.18199746 -0.07792986  0.30200019
 [25]  0.51982237  1.48482680 -0.98285551 -0.09687770 -1.12937027  0.42000034
 [31] -2.05898595  0.48824145 -0.22571975  1.24892496 -0.99094753  1.45969451
 [37]  1.01399963 -0.54777176  0.41523379  0.29679035  0.23597768  1.27726408
 [43]  1.14833249  0.06719483  0.55399795  1.54277566  0.57714092 -1.76793538
 [49] -0.69413067 -0.30015835 -1.15960671 -0.32936989  0.18625354 -0.87001705
 [55] -0.02399286  0.85576122  1.68952215  0.87624927  1.85196796 -0.13888202
 [61] -1.30302151 -0.20653309  1.53659553  1.42024243  0.08454372 -0.91536703
 [67]  0.44640250  0.75627420 -0.09802807  1.07620568 -0.42870445  0.22482798
 [73] -0.88884420  0.33203220 -0.14021178 -1.31679810  1.84510496 -0.64043897
 [79] -0.61015060  0.98184366 -0.99884532 -0.23038405  0.35319281 -0.77268329
 [85] -1.27243590  0.30486831 -0.56486269  2.59229851  1.58447717  0.46566424
 [91]  0.72190768  0.15495205 -0.65113517 -1.55572895 -0.66408936  2.68104221
 [97]  0.38229116 -0.50853846  0.89863227  0.15261303
> rowSums(tmp2)
  [1]  0.53045686 -0.92100419 -1.76330927  0.31605531  0.43167298  1.40703368
  [7] -0.32362428 -0.30815491  0.56396656  0.74278877  0.68505059 -0.12621105
 [13] -0.42123763 -0.58113129 -0.17496264 -0.30956217 -0.99897686  1.26329500
 [19]  0.63494358  0.07878003  0.67970839  2.18199746 -0.07792986  0.30200019
 [25]  0.51982237  1.48482680 -0.98285551 -0.09687770 -1.12937027  0.42000034
 [31] -2.05898595  0.48824145 -0.22571975  1.24892496 -0.99094753  1.45969451
 [37]  1.01399963 -0.54777176  0.41523379  0.29679035  0.23597768  1.27726408
 [43]  1.14833249  0.06719483  0.55399795  1.54277566  0.57714092 -1.76793538
 [49] -0.69413067 -0.30015835 -1.15960671 -0.32936989  0.18625354 -0.87001705
 [55] -0.02399286  0.85576122  1.68952215  0.87624927  1.85196796 -0.13888202
 [61] -1.30302151 -0.20653309  1.53659553  1.42024243  0.08454372 -0.91536703
 [67]  0.44640250  0.75627420 -0.09802807  1.07620568 -0.42870445  0.22482798
 [73] -0.88884420  0.33203220 -0.14021178 -1.31679810  1.84510496 -0.64043897
 [79] -0.61015060  0.98184366 -0.99884532 -0.23038405  0.35319281 -0.77268329
 [85] -1.27243590  0.30486831 -0.56486269  2.59229851  1.58447717  0.46566424
 [91]  0.72190768  0.15495205 -0.65113517 -1.55572895 -0.66408936  2.68104221
 [97]  0.38229116 -0.50853846  0.89863227  0.15261303
> 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.53045686 -0.92100419 -1.76330927  0.31605531  0.43167298  1.40703368
  [7] -0.32362428 -0.30815491  0.56396656  0.74278877  0.68505059 -0.12621105
 [13] -0.42123763 -0.58113129 -0.17496264 -0.30956217 -0.99897686  1.26329500
 [19]  0.63494358  0.07878003  0.67970839  2.18199746 -0.07792986  0.30200019
 [25]  0.51982237  1.48482680 -0.98285551 -0.09687770 -1.12937027  0.42000034
 [31] -2.05898595  0.48824145 -0.22571975  1.24892496 -0.99094753  1.45969451
 [37]  1.01399963 -0.54777176  0.41523379  0.29679035  0.23597768  1.27726408
 [43]  1.14833249  0.06719483  0.55399795  1.54277566  0.57714092 -1.76793538
 [49] -0.69413067 -0.30015835 -1.15960671 -0.32936989  0.18625354 -0.87001705
 [55] -0.02399286  0.85576122  1.68952215  0.87624927  1.85196796 -0.13888202
 [61] -1.30302151 -0.20653309  1.53659553  1.42024243  0.08454372 -0.91536703
 [67]  0.44640250  0.75627420 -0.09802807  1.07620568 -0.42870445  0.22482798
 [73] -0.88884420  0.33203220 -0.14021178 -1.31679810  1.84510496 -0.64043897
 [79] -0.61015060  0.98184366 -0.99884532 -0.23038405  0.35319281 -0.77268329
 [85] -1.27243590  0.30486831 -0.56486269  2.59229851  1.58447717  0.46566424
 [91]  0.72190768  0.15495205 -0.65113517 -1.55572895 -0.66408936  2.68104221
 [97]  0.38229116 -0.50853846  0.89863227  0.15261303
> rowMin(tmp2)
  [1]  0.53045686 -0.92100419 -1.76330927  0.31605531  0.43167298  1.40703368
  [7] -0.32362428 -0.30815491  0.56396656  0.74278877  0.68505059 -0.12621105
 [13] -0.42123763 -0.58113129 -0.17496264 -0.30956217 -0.99897686  1.26329500
 [19]  0.63494358  0.07878003  0.67970839  2.18199746 -0.07792986  0.30200019
 [25]  0.51982237  1.48482680 -0.98285551 -0.09687770 -1.12937027  0.42000034
 [31] -2.05898595  0.48824145 -0.22571975  1.24892496 -0.99094753  1.45969451
 [37]  1.01399963 -0.54777176  0.41523379  0.29679035  0.23597768  1.27726408
 [43]  1.14833249  0.06719483  0.55399795  1.54277566  0.57714092 -1.76793538
 [49] -0.69413067 -0.30015835 -1.15960671 -0.32936989  0.18625354 -0.87001705
 [55] -0.02399286  0.85576122  1.68952215  0.87624927  1.85196796 -0.13888202
 [61] -1.30302151 -0.20653309  1.53659553  1.42024243  0.08454372 -0.91536703
 [67]  0.44640250  0.75627420 -0.09802807  1.07620568 -0.42870445  0.22482798
 [73] -0.88884420  0.33203220 -0.14021178 -1.31679810  1.84510496 -0.64043897
 [79] -0.61015060  0.98184366 -0.99884532 -0.23038405  0.35319281 -0.77268329
 [85] -1.27243590  0.30486831 -0.56486269  2.59229851  1.58447717  0.46566424
 [91]  0.72190768  0.15495205 -0.65113517 -1.55572895 -0.66408936  2.68104221
 [97]  0.38229116 -0.50853846  0.89863227  0.15261303
> 
> colMeans(tmp2)
[1] 0.1593421
> colSums(tmp2)
[1] 15.93421
> colVars(tmp2)
[1] 0.9333542
> colSd(tmp2)
[1] 0.9661026
> colMax(tmp2)
[1] 2.681042
> colMin(tmp2)
[1] -2.058986
> colMedians(tmp2)
[1] 0.1706028
> colRanges(tmp2)
          [,1]
[1,] -2.058986
[2,]  2.681042
> 
> 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] -5.9613848  2.9593599 -3.6699857 -1.7997395  7.0740498  1.5126014
 [7]  0.1757351 -4.3707157 -3.1973653 -3.1718648
> colApply(tmp,quantile)[,1]
            [,1]
[1,] -2.92094260
[2,] -0.88429936
[3,] -0.53927183
[4,]  0.09279288
[5,]  0.58262812
> 
> rowApply(tmp,sum)
 [1]  1.7963950 -0.9179059  0.2411419 -3.7571532 -1.6106434  1.1939587
 [7] -2.4752469 -2.9663042 -3.8798125  1.9262610
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    6    1    3    1    3    8    8    6    3     3
 [2,]    1    3   10   10    5    6    3    3   10     8
 [3,]    8    7    5    4    2    9    9    1    5     2
 [4,]    2    5    6    8    6    5    2    4    6     5
 [5,]   10   10    9    7    4   10   10    8    1    10
 [6,]    3    9    8    9    8    4    4    5    9     4
 [7,]    4    8    1    5    7    2    7   10    7     9
 [8,]    5    2    4    2   10    3    6    7    2     6
 [9,]    7    4    2    6    1    7    5    9    8     1
[10,]    9    6    7    3    9    1    1    2    4     7
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1] -1.8288176 -0.9281507 -1.8420287 -2.5831824  4.4659025  2.0104149
 [7] -2.3473475  0.8406739 -1.8361781 -0.1051880  1.0586356 -0.9030103
[13]  0.9772423 -3.0362910  2.5175159  2.2104540  2.5252226  0.5728295
[19]  1.1995010 -2.2412926
> colApply(tmp,quantile)[,1]
            [,1]
[1,] -0.97478058
[2,] -0.78570857
[3,] -0.59569074
[4,] -0.09732445
[5,]  0.62468672
> 
> rowApply(tmp,sum)
[1]  2.5195889 -2.5046417  0.8171155  3.4849155 -3.5900729
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]    2   15    9    3    4
[2,]   12    7    3   17    7
[3,]    6    8    5    8   11
[4,]    7   12   12   12    1
[5,]   18   20   14   13   13
> 
> 
> as.matrix(tmp)
            [,1]       [,2]       [,3]       [,4]      [,5]       [,6]
[1,] -0.97478058  0.2753911 -0.2905105 -0.2239510 1.0895531 -0.4179624
[2,]  0.62468672 -0.6629903 -0.6540136 -0.3249737 1.9837572  1.2611190
[3,] -0.09732445 -0.9081430 -0.5475827  0.2132971 0.4478041  0.7651326
[4,] -0.59569074  0.9407912 -0.2383619  0.2016755 0.5308499 -0.2607096
[5,] -0.78570857 -0.5731997 -0.1115599 -2.4492301 0.4139382  0.6628353
           [,7]       [,8]       [,9]       [,10]      [,11]      [,12]
[1,]  0.3729822 -0.4219518  0.5160613  0.08754645  1.4293097  0.7387441
[2,] -1.1730583  0.9396774 -1.5278579 -0.47314312 -0.5929840 -1.1913203
[3,] -1.5611251 -0.7174359 -0.1726790 -1.48044191  0.8494919  0.5953359
[4,]  0.1259355  0.1437733 -1.4517197  0.82076049 -0.3760026 -0.2715373
[5,] -0.1120819  0.8966109  0.8000171  0.94009013 -0.2511794 -0.7742326
          [,13]      [,14]        [,15]      [,16]       [,17]      [,18]
[1,] -0.1572326  0.2650592  0.481673077  1.1117616  0.29026246  0.1005701
[2,] -0.7371520 -1.1168455  0.715023760  1.7421595 -0.06000006 -1.0037919
[3,] -0.2328605 -0.1353422  0.005015961  0.2774494  1.13810056  1.2313437
[4,]  1.5484923 -0.2133257  1.705263468 -1.4826238  0.68658683  0.8654440
[5,]  0.5559951 -1.8358368 -0.389460392  0.5617074  0.47027282 -0.6207365
           [,19]       [,20]
[1,] -0.70764498 -1.04529150
[2,] -0.33662703  0.08369242
[3,]  1.06966763  0.07741135
[4,]  1.20721152 -0.40189710
[5,] -0.03310616 -0.95520774
> 
> 
> 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 :  650  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 :  563  bytes.
Disk usage :  160  bytes.
> subBufferedMatrix(tmp,1:3,)
BufferedMatrix object
Matrix size:  3 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.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 0.2917382 -0.9702547 0.2772137 1.21386 0.6113572 -0.7970752 -0.3160906
           col8      col9      col10      col11     col12      col13      col14
row1 -0.6866954 -1.106955 -0.3161114 -0.4332187 0.2007629 -0.4217506 -0.1558964
         col15    col16     col17      col18     col19    col20
row1 0.0969108 -2.26649 -1.147549 -0.8573803 -1.371311 1.140457
> tmp[,"col10"]
           col10
row1 -0.31611139
row2 -1.06692414
row3 -0.05610702
row4 -1.96029662
row5 -0.92149642
> tmp[c("row1","row5"),]
          col1       col2      col3      col4       col5       col6       col7
row1 0.2917382 -0.9702547 0.2772137  1.213860  0.6113572 -0.7970752 -0.3160906
row5 0.1063426  0.5380840 1.0778216 -1.431676 -1.7627202 -1.0411697 -0.8103454
            col8       col9      col10      col11      col12      col13
row1 -0.68669539 -1.1069550 -0.3161114 -0.4332187  0.2007629 -0.4217506
row5 -0.06953965 -0.5636341 -0.9214964 -0.9444954 -0.8152302 -0.2538702
          col14     col15      col16     col17      col18      col19    col20
row1 -0.1558964 0.0969108 -2.2664903 -1.147549 -0.8573803 -1.3713113 1.140457
row5  1.8680759 0.2915687  0.0342581  0.753317 -1.0386753  0.8481415 1.317084
> tmp[,c("col6","col20")]
           col6      col20
row1 -0.7970752  1.1404568
row2 -2.0507656 -0.6888891
row3  0.7572163 -1.1201284
row4  0.1637288 -0.8957172
row5 -1.0411697  1.3170845
> tmp[c("row1","row5"),c("col6","col20")]
           col6    col20
row1 -0.7970752 1.140457
row5 -1.0411697 1.317084
> 
> 
> 
> 
> 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.51104 48.29801 48.42604 51.53571 49.79422 106.2426 50.5175 49.26698
         col9    col10    col11    col12    col13    col14    col15    col16
row1 48.25776 50.58809 49.60273 48.41547 47.74001 48.77008 50.25127 50.88115
       col17    col18    col19   col20
row1 50.5657 48.20744 49.60692 103.396
> tmp[,"col10"]
        col10
row1 50.58809
row2 29.58536
row3 29.67649
row4 29.01970
row5 50.48545
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 49.51104 48.29801 48.42604 51.53571 49.79422 106.2426 50.51750 49.26698
row5 51.30963 51.47062 49.78516 49.24394 49.42133 105.9735 50.64889 49.43191
         col9    col10    col11    col12    col13    col14    col15    col16
row1 48.25776 50.58809 49.60273 48.41547 47.74001 48.77008 50.25127 50.88115
row5 47.87963 50.48545 50.76148 49.03420 51.40074 49.75554 48.49595 50.87063
        col17    col18    col19   col20
row1 50.56570 48.20744 49.60692 103.396
row5 49.32905 47.89902 49.18843 103.718
> tmp[,c("col6","col20")]
          col6     col20
row1 106.24261 103.39604
row2  74.61200  73.87331
row3  73.75173  74.90832
row4  76.01087  74.18308
row5 105.97353 103.71800
> tmp[c("row1","row5"),c("col6","col20")]
         col6   col20
row1 106.2426 103.396
row5 105.9735 103.718
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6   col20
row1 106.2426 103.396
row5 105.9735 103.718
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
          col13
[1,] -0.1222713
[2,] -1.4117532
[3,] -1.7273937
[4,]  0.6749037
[5,] -0.6443665
> tmp[,c("col17","col7")]
           col17       col7
[1,]  0.23354825 -0.4416130
[2,] -0.06817768 -0.6486126
[3,] -1.86516096  0.1051438
[4,] -1.06357646 -0.3542864
[5,]  0.52903925  0.9538730
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
           col6      col20
[1,] -1.1170137 -0.2611810
[2,]  0.6510877 -0.1875264
[3,] -0.7090776  1.1321114
[4,]  1.0705038 -0.6145217
[5,]  0.9514786 -0.3444435
> subBufferedMatrix(tmp,1,c("col6"))[,1]
          col1
[1,] -1.117014
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
           col6
[1,] -1.1170137
[2,]  0.6510877
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> 
> 
> 
> subBufferedMatrix(tmp,c("row3","row1"),)[,1:20]
           [,1]       [,2]       [,3]       [,4]        [,5]     [,6]
row3 0.90011181  1.0450387 -0.7419093 -0.5989943 -1.54826329 2.285253
row1 0.04468493 -0.6097204 -0.0507977 -1.7232189  0.02516622 1.986690
            [,7]       [,8]       [,9]       [,10]      [,11]      [,12]
row3 -0.08617688 -0.5688614  0.8182693 -0.35864711 -0.4075083 -0.8269061
row1 -0.14545725 -4.0222637 -2.1953261 -0.01529411  0.0971657  1.5601206
          [,13]     [,14]     [,15]      [,16]     [,17]      [,18]      [,19]
row3 -0.8612224 0.2680828 0.2930872 -1.1671656 1.5143027  0.3578669 -0.3955543
row1  1.5141033 0.1387283 0.5678639  0.9329888 0.2590608 -0.3487306 -0.1122654
           [,20]
row3 -0.03011156
row1  0.41138912
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
          [,1]       [,2]       [,3]      [,4]      [,5]       [,6]       [,7]
row2 0.1548351 -0.9141988 -0.6048387 -0.703718 0.7693834 -0.6077036 -0.6825093
           [,8]       [,9]    [,10]
row2 -0.1159035 -0.3901642 1.821255
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
            [,1]      [,2]      [,3]      [,4]     [,5]       [,6]      [,7]
row5 -0.07624199 -1.174168 0.5557679 -1.472846 1.219264 -0.7974996 0.5788898
           [,8]      [,9]      [,10]     [,11]       [,12]     [,13]      [,14]
row5 0.01532146 0.3061839 -0.2359366 0.4384869 -0.05288233 0.9619008 -0.7263432
        [,15]    [,16]      [,17]     [,18]    [,19]    [,20]
row5 1.155932 -1.31774 -0.6705876 0.7493853 1.732103 -1.53431
> 
> 
> 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: 0x6000035e4000>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BMf66b7aa737fc"
 [2] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BMf66b784cc04c"
 [3] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BMf66b76e4fb47"
 [4] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BMf66b332d2f4c"
 [5] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BMf66b5b7c40d3"
 [6] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BMf66b3a840b91"
 [7] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BMf66b33137a9a"
 [8] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BMf66b43d62ea8"
 [9] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BMf66b22913a63"
[10] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BMf66b6c904b4f"
[11] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BMf66b75406737"
[12] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BMf66b57388804"
[13] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BMf66b4069eb58"
[14] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BMf66b69d9ff71"
[15] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BMf66b67118a01"
> 
> 
> ### 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: 0x6000035f41e0>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x6000035f41e0>
Warning message:
In dir.create(new.directory) :
  '/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x6000035f41e0>
> rowMedians(tmp)
  [1] -0.745087262  0.062857320  0.383686292  0.134683705 -0.465305207
  [6] -0.015977886 -0.180101211  0.478427620 -0.240437033 -0.130036709
 [11] -0.155648408 -0.124016278 -0.221391720  0.456412817  0.302201108
 [16]  0.384404846 -0.048421014  0.438932648 -0.211329679 -0.283943589
 [21] -0.002128457  0.023372533  0.562148335 -0.008684426  0.079886016
 [26] -0.025389844 -0.025209976  0.315912413  0.382365424 -0.194446346
 [31]  0.242301218 -0.091625067  0.288982405 -0.067599729 -0.207953684
 [36]  0.387427700  0.649361478 -0.029822782 -0.307329899  0.444019885
 [41] -0.297316469 -0.407923348  0.071575676 -0.190550545 -0.041320059
 [46] -0.699485173  0.644604211  0.105122261 -0.035890953 -0.586264610
 [51] -0.032159451 -0.541190171  0.574840350  0.317963534 -0.074817807
 [56] -0.328346433 -0.448368847 -0.144971185 -0.281817522  0.475259362
 [61]  0.095864065  0.416059172 -0.162504845  0.231172122  0.088850493
 [66]  0.141802882  0.266652532  0.038421708  0.030993651  0.006475672
 [71] -0.250600701 -0.459157573  0.557654318 -0.393358269 -0.457247556
 [76] -0.627330472 -0.117552198  0.211025664  0.256999856  0.066798063
 [81]  0.051459608  0.428942629  0.194592165 -0.462469859  0.289074477
 [86] -0.074626677  0.348182605 -0.239846819  0.277385231 -0.066233986
 [91]  0.438916213 -0.103402428  0.118896736 -0.395915691  0.322251944
 [96]  0.404893910 -0.055200554 -0.186665811  0.209275499  0.344097110
[101]  0.259220671 -0.188995513 -0.248560411  0.433756938  0.414472912
[106] -0.335264671 -0.479557418 -0.017619316  0.032540566  0.176896043
[111]  0.081149060 -0.166763435 -0.014974937 -0.510674383  0.121715909
[116] -0.392466227 -0.466307223  0.163251451 -0.144200787  0.029351292
[121] -0.927973691 -0.130773341 -0.056994738 -0.339905662 -0.006727402
[126]  0.571834639  0.010650089  0.281470945  0.286321008 -0.204359987
[131]  0.432925869 -0.134980822  0.221372570  0.255885068 -0.147215462
[136]  0.525888636 -0.240831762  0.238905395 -0.140041207 -0.052387695
[141] -0.034298105  0.777292683 -0.052381848 -0.522643739 -0.108222725
[146]  0.327474911  0.163383556  0.624351738  0.598602176 -0.365163174
[151]  0.844372324 -0.184016442 -0.281939484 -0.231735611  0.121797774
[156] -0.337997845 -0.261363291  0.011112439 -0.024682909 -0.319719494
[161]  0.461066467  0.242098267  0.159272336  0.074330459 -0.085929704
[166] -0.096586060  0.098849537 -0.412434025  0.164476001  0.273943405
[171] -0.349024212  0.055999853 -0.360205258 -0.306809472  0.038207972
[176] -0.210983284  0.270226707  0.113514563 -0.296824729 -0.403747484
[181]  0.232343097 -0.022668609  0.295763112  0.174455551 -0.121637397
[186]  0.029195458 -0.004774680 -0.386371170 -0.202103623  0.450411525
[191] -0.131871942  0.183064710 -0.092866263  0.012537958 -0.219210875
[196] -0.307352630  0.280396169 -0.792190739  0.135670890 -0.292959725
[201]  0.734502493  0.392862695  0.118856276 -1.320864769 -0.110975079
[206] -0.024508378 -0.314918111  0.369966551 -0.067389755  0.054410573
[211]  0.719450910  0.494523488  0.098605518 -0.361691344  0.146225043
[216]  0.119748348  0.161413319 -0.083337911 -0.252856019 -0.371449654
[221] -1.027092472 -0.373667143  0.615042410  0.255753307 -0.354532812
[226]  0.053303669  0.354573945 -0.250944885 -0.178068451  0.208581718
> 
> proc.time()
   user  system elapsed 
  5.221  20.009  27.477 

BufferedMatrix.Rcheck/tests/rawCalltesting.Rout


R version 4.4.2 (2024-10-31) -- "Pile of Leaves"
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: 0x6000023b0120>
> .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: 0x6000023b0120>
> .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: 0x6000023b0120>
> .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: 0x6000023b0120>
> 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: 0x60000238c0c0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x60000238c0c0>
> .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: 0x60000238c0c0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x60000238c0c0>
> .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: 0x60000238c0c0>
> 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: 0x60000238c240>
> .Call("R_bm_AddColumn",P)
<pointer: 0x60000238c240>
> .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: 0x60000238c240>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x60000238c240>
> .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: 0x60000238c240>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x60000238c240>
> .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: 0x60000238c240>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x60000238c240>
> .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: 0x60000238c240>
> 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: 0x600002398180>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x600002398180>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600002398180>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600002398180>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFilefb522a5fb032" "BufferedMatrixFilefb5256447cd5"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFilefb522a5fb032" "BufferedMatrixFilefb5256447cd5"
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000023b80c0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000023b80c0>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x6000023b80c0>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x6000023b80c0>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x6000023b80c0>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x6000023b80c0>
> .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: 0x6000023dc000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000023dc000>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x6000023dc000>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x6000023dc000>
> 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: 0x6000023dc180>
> .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: 0x6000023dc180>
> rm(P)
> 
> proc.time()
   user  system elapsed 
  0.600   0.218   0.782 

BufferedMatrix.Rcheck/tests/Rcodetesting.Rout


R version 4.4.2 (2024-10-31) -- "Pile of Leaves"
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.590   0.141   0.695 

Example timings