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

This page was generated on 2024-06-11 14:42 -0400 (Tue, 11 Jun 2024).

HostnameOSArch (*)R versionInstalled pkgs
nebbiolo1Linux (Ubuntu 22.04.3 LTS)x86_644.4.0 (2024-04-24) -- "Puppy Cup" 4757
palomino3Windows Server 2022 Datacenterx644.4.0 (2024-04-24 ucrt) -- "Puppy Cup" 4491
lconwaymacOS 12.7.1 Montereyx86_644.4.0 (2024-04-24) -- "Puppy Cup" 4522
kjohnson3macOS 13.6.5 Venturaarm644.4.0 (2024-04-24) -- "Puppy Cup" 4468
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 249/2300HostnameOS / ArchINSTALLBUILDCHECKBUILD BIN
BufferedMatrix 1.68.0  (landing page)
Ben Bolstad
Snapshot Date: 2024-06-09 14:00 -0400 (Sun, 09 Jun 2024)
git_url: https://git.bioconductor.org/packages/BufferedMatrix
git_branch: RELEASE_3_19
git_last_commit: af6c73d
git_last_commit_date: 2024-04-30 10:16:21 -0400 (Tue, 30 Apr 2024)
nebbiolo1Linux (Ubuntu 22.04.3 LTS) / x86_64  OK    OK    OK  UNNEEDED, same version is already published
palomino3Windows Server 2022 Datacenter / x64  OK    OK    OK    OK  UNNEEDED, same version is already published
lconwaymacOS 12.7.1 Monterey / x86_64  OK    OK    WARNINGS    OK  UNNEEDED, same version is already published
kjohnson3macOS 13.6.5 Ventura / arm64  OK    OK    WARNINGS    OK  UNNEEDED, same version is already published


CHECK results for BufferedMatrix on lconway

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

raw results


Summary

Package: BufferedMatrix
Version: 1.68.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.68.0.tar.gz
StartedAt: 2024-06-09 19:10:55 -0400 (Sun, 09 Jun 2024)
EndedAt: 2024-06-09 19:11:42 -0400 (Sun, 09 Jun 2024)
EllapsedTime: 47.6 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.68.0.tar.gz
###
##############################################################################
##############################################################################


* using log directory ‘/Users/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck’
* using R version 4.4.0 (2024-04-24)
* 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.1
* using session charset: UTF-8
* using option ‘--no-vignettes’
* checking for file ‘BufferedMatrix/DESCRIPTION’ ... OK
* this is package ‘BufferedMatrix’ version ‘1.68.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.19-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.19-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.0 (2024-04-24) -- "Puppy Cup"
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.343   0.132   0.479 

BufferedMatrix.Rcheck/tests/objectTesting.Rout


R version 4.4.0 (2024-04-24) -- "Puppy Cup"
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.19-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 474174 25.4    1035464 55.3         NA   638637 34.2
Vcells 877658  6.7    8388608 64.0      98304  2071778 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] "Sun Jun  9 19:11:18 2024"
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> date()
[1] "Sun Jun  9 19:11:19 2024"
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,which.col] == test.matrix[which.row,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> 
> 
> RowMode(tmp2)
<pointer: 0x60000078c000>
> 
> 
> 
> 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] "Sun Jun  9 19:11:23 2024"
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col <- sample(1:20,5,replace=TRUE)
+   if (!all(tmp2[which.row,which.col] == test.matrix[which.row,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> date()
[1] "Sun Jun  9 19:11:24 2024"
> 
> ColMode(tmp2)
<pointer: 0x60000078c000>
> 
> 
> 
> ### 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,] 98.3478856 -0.7682341 -0.1660270 -0.8134644
[2,]  0.2903112 -1.6345638  0.4656637  0.8381190
[3,] -0.5988870 -1.7591914 -0.6677717  0.9324065
[4,] -2.2153285 -0.5529421 -0.3997165 -0.6346685
> ewApply(tmp5,abs)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.19-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,] 98.3478856 0.7682341 0.1660270 0.8134644
[2,]  0.2903112 1.6345638 0.4656637 0.8381190
[3,]  0.5988870 1.7591914 0.6677717 0.9324065
[4,]  2.2153285 0.5529421 0.3997165 0.6346685
> ewApply(tmp5,sqrt)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.19-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.9170502 0.8764897 0.4074641 0.9019226
[2,] 0.5388053 1.2785006 0.6823956 0.9154884
[3,] 0.7738779 1.3263451 0.8171730 0.9656120
[4,] 1.4883980 0.7436008 0.6322314 0.7966609
> 
> 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.19-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,] 222.51839 34.53313 29.24067 34.83269
[2,]  30.67836 39.41957 32.28962 34.99300
[3,]  33.33767 40.02264 33.83950 35.58853
[4,]  42.09931 32.98895 31.72203 33.60128
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x600000788000>
> exp(tmp5)
<pointer: 0x600000788000>
> log(tmp5,2)
<pointer: 0x600000788000>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 463.1429
> Min(tmp5)
[1] 54.26333
> mean(tmp5)
[1] 72.73544
> Sum(tmp5)
[1] 14547.09
> Var(tmp5)
[1] 843.7
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 92.05861 69.99514 68.06333 71.78676 69.94874 72.54794 73.63904 69.47345
 [9] 70.87504 68.96636
> rowSums(tmp5)
 [1] 1841.172 1399.903 1361.267 1435.735 1398.975 1450.959 1472.781 1389.469
 [9] 1417.501 1379.327
> rowVars(tmp5)
 [1] 7698.09794   82.51241   61.60521   71.79267   88.02969   78.05434
 [7]   84.86018   85.09170   56.06039   66.80859
> rowSd(tmp5)
 [1] 87.738805  9.083634  7.848899  8.473055  9.382414  8.834837  9.211958
 [8]  9.224516  7.487349  8.173652
> rowMax(tmp5)
 [1] 463.14287  83.87520  83.30189  89.04542  86.13879  83.16919  94.87865
 [8]  89.48070  86.86769  88.29878
> rowMin(tmp5)
 [1] 60.86062 54.26333 57.22369 59.84883 55.23655 56.25964 56.99211 58.53390
 [9] 60.32769 55.82601
> 
> colMeans(tmp5)
 [1] 113.85677  74.27374  69.71159  68.70404  65.58042  67.89923  76.97307
 [8]  73.05050  67.48320  68.11601  72.05316  74.99460  73.04413  72.97603
[15]  69.12249  68.72514  67.86924  69.07643  70.68468  70.51434
> colSums(tmp5)
 [1] 1138.5677  742.7374  697.1159  687.0404  655.8042  678.9923  769.7307
 [8]  730.5050  674.8320  681.1601  720.5316  749.9460  730.4413  729.7603
[15]  691.2249  687.2514  678.6924  690.7643  706.8468  705.1434
> colVars(tmp5)
 [1] 15114.66786   100.49645    81.01142    37.16487    71.71497    51.51909
 [7]    73.83212   112.45357    26.58364    79.33167    38.15005    97.96677
[13]    66.09044   103.11247    64.75210   118.12075    61.37206    71.15988
[19]    76.27303    52.30840
> colSd(tmp5)
 [1] 122.941725  10.024792   9.000634   6.096300   8.468469   7.177680
 [7]   8.592562  10.604413   5.155933   8.906833   6.176573   9.897817
[13]   8.129603  10.154431   8.046869  10.868337   7.834032   8.435632
[19]   8.733443   7.232455
> colMax(tmp5)
 [1] 463.14287  94.87865  86.86769  75.63373  82.32366  80.43357  89.17752
 [8]  89.48070  79.29750  85.05806  81.43647  88.29878  83.87520  89.04542
[15]  82.69844  84.20272  84.24761  83.16698  82.60904  86.13879
> colMin(tmp5)
 [1] 63.85300 58.98017 57.29835 56.99211 54.26333 57.57065 59.49377 55.82601
 [9] 62.19406 55.64515 61.86306 58.64904 57.22369 60.50085 58.51805 56.25964
[17] 60.38407 55.23655 57.24552 63.90652
> 
> 
> ### 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]       NA 69.99514 68.06333 71.78676 69.94874 72.54794 73.63904 69.47345
 [9] 70.87504 68.96636
> rowSums(tmp5)
 [1]       NA 1399.903 1361.267 1435.735 1398.975 1450.959 1472.781 1389.469
 [9] 1417.501 1379.327
> rowVars(tmp5)
 [1] 8098.86328   82.51241   61.60521   71.79267   88.02969   78.05434
 [7]   84.86018   85.09170   56.06039   66.80859
> rowSd(tmp5)
 [1] 89.993685  9.083634  7.848899  8.473055  9.382414  8.834837  9.211958
 [8]  9.224516  7.487349  8.173652
> rowMax(tmp5)
 [1]       NA 83.87520 83.30189 89.04542 86.13879 83.16919 94.87865 89.48070
 [9] 86.86769 88.29878
> rowMin(tmp5)
 [1]       NA 54.26333 57.22369 59.84883 55.23655 56.25964 56.99211 58.53390
 [9] 60.32769 55.82601
> 
> colMeans(tmp5)
 [1] 113.85677  74.27374  69.71159  68.70404  65.58042  67.89923  76.97307
 [8]  73.05050  67.48320        NA  72.05316  74.99460  73.04413  72.97603
[15]  69.12249  68.72514  67.86924  69.07643  70.68468  70.51434
> colSums(tmp5)
 [1] 1138.5677  742.7374  697.1159  687.0404  655.8042  678.9923  769.7307
 [8]  730.5050  674.8320        NA  720.5316  749.9460  730.4413  729.7603
[15]  691.2249  687.2514  678.6924  690.7643  706.8468  705.1434
> colVars(tmp5)
 [1] 15114.66786   100.49645    81.01142    37.16487    71.71497    51.51909
 [7]    73.83212   112.45357    26.58364          NA    38.15005    97.96677
[13]    66.09044   103.11247    64.75210   118.12075    61.37206    71.15988
[19]    76.27303    52.30840
> colSd(tmp5)
 [1] 122.941725  10.024792   9.000634   6.096300   8.468469   7.177680
 [7]   8.592562  10.604413   5.155933         NA   6.176573   9.897817
[13]   8.129603  10.154431   8.046869  10.868337   7.834032   8.435632
[19]   8.733443   7.232455
> colMax(tmp5)
 [1] 463.14287  94.87865  86.86769  75.63373  82.32366  80.43357  89.17752
 [8]  89.48070  79.29750        NA  81.43647  88.29878  83.87520  89.04542
[15]  82.69844  84.20272  84.24761  83.16698  82.60904  86.13879
> colMin(tmp5)
 [1] 63.85300 58.98017 57.29835 56.99211 54.26333 57.57065 59.49377 55.82601
 [9] 62.19406       NA 61.86306 58.64904 57.22369 60.50085 58.51805 56.25964
[17] 60.38407 55.23655 57.24552 63.90652
> 
> Max(tmp5,na.rm=TRUE)
[1] 463.1429
> Min(tmp5,na.rm=TRUE)
[1] 54.26333
> mean(tmp5,na.rm=TRUE)
[1] 72.74613
> Sum(tmp5,na.rm=TRUE)
[1] 14476.48
> Var(tmp5,na.rm=TRUE)
[1] 847.9381
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 93.18756 69.99514 68.06333 71.78676 69.94874 72.54794 73.63904 69.47345
 [9] 70.87504 68.96636
> rowSums(tmp5,na.rm=TRUE)
 [1] 1770.564 1399.903 1361.267 1435.735 1398.975 1450.959 1472.781 1389.469
 [9] 1417.501 1379.327
> rowVars(tmp5,na.rm=TRUE)
 [1] 8098.86328   82.51241   61.60521   71.79267   88.02969   78.05434
 [7]   84.86018   85.09170   56.06039   66.80859
> rowSd(tmp5,na.rm=TRUE)
 [1] 89.993685  9.083634  7.848899  8.473055  9.382414  8.834837  9.211958
 [8]  9.224516  7.487349  8.173652
> rowMax(tmp5,na.rm=TRUE)
 [1] 463.14287  83.87520  83.30189  89.04542  86.13879  83.16919  94.87865
 [8]  89.48070  86.86769  88.29878
> rowMin(tmp5,na.rm=TRUE)
 [1] 60.86062 54.26333 57.22369 59.84883 55.23655 56.25964 56.99211 58.53390
 [9] 60.32769 55.82601
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 113.85677  74.27374  69.71159  68.70404  65.58042  67.89923  76.97307
 [8]  73.05050  67.48320  67.83906  72.05316  74.99460  73.04413  72.97603
[15]  69.12249  68.72514  67.86924  69.07643  70.68468  70.51434
> colSums(tmp5,na.rm=TRUE)
 [1] 1138.5677  742.7374  697.1159  687.0404  655.8042  678.9923  769.7307
 [8]  730.5050  674.8320  610.5515  720.5316  749.9460  730.4413  729.7603
[15]  691.2249  687.2514  678.6924  690.7643  706.8468  705.1434
> colVars(tmp5,na.rm=TRUE)
 [1] 15114.66786   100.49645    81.01142    37.16487    71.71497    51.51909
 [7]    73.83212   112.45357    26.58364    88.38525    38.15005    97.96677
[13]    66.09044   103.11247    64.75210   118.12075    61.37206    71.15988
[19]    76.27303    52.30840
> colSd(tmp5,na.rm=TRUE)
 [1] 122.941725  10.024792   9.000634   6.096300   8.468469   7.177680
 [7]   8.592562  10.604413   5.155933   9.401343   6.176573   9.897817
[13]   8.129603  10.154431   8.046869  10.868337   7.834032   8.435632
[19]   8.733443   7.232455
> colMax(tmp5,na.rm=TRUE)
 [1] 463.14287  94.87865  86.86769  75.63373  82.32366  80.43357  89.17752
 [8]  89.48070  79.29750  85.05806  81.43647  88.29878  83.87520  89.04542
[15]  82.69844  84.20272  84.24761  83.16698  82.60904  86.13879
> colMin(tmp5,na.rm=TRUE)
 [1] 63.85300 58.98017 57.29835 56.99211 54.26333 57.57065 59.49377 55.82601
 [9] 62.19406 55.64515 61.86306 58.64904 57.22369 60.50085 58.51805 56.25964
[17] 60.38407 55.23655 57.24552 63.90652
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1]      NaN 69.99514 68.06333 71.78676 69.94874 72.54794 73.63904 69.47345
 [9] 70.87504 68.96636
> rowSums(tmp5,na.rm=TRUE)
 [1]    0.000 1399.903 1361.267 1435.735 1398.975 1450.959 1472.781 1389.469
 [9] 1417.501 1379.327
> rowVars(tmp5,na.rm=TRUE)
 [1]       NA 82.51241 61.60521 71.79267 88.02969 78.05434 84.86018 85.09170
 [9] 56.06039 66.80859
> rowSd(tmp5,na.rm=TRUE)
 [1]       NA 9.083634 7.848899 8.473055 9.382414 8.834837 9.211958 9.224516
 [9] 7.487349 8.173652
> rowMax(tmp5,na.rm=TRUE)
 [1]       NA 83.87520 83.30189 89.04542 86.13879 83.16919 94.87865 89.48070
 [9] 86.86769 88.29878
> rowMin(tmp5,na.rm=TRUE)
 [1]       NA 54.26333 57.22369 59.84883 55.23655 56.25964 56.99211 58.53390
 [9] 60.32769 55.82601
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1] 75.04720 74.54013 70.69503 68.28230 64.51287 66.50653 75.61703 71.85138
 [9] 68.03984      NaN 72.47249 76.38925 72.17185 73.57369 68.63373 67.27536
[17] 68.48688 69.41372 69.35975 71.06039
> colSums(tmp5,na.rm=TRUE)
 [1] 675.4248 670.8612 636.2553 614.5407 580.6158 598.5588 680.5532 646.6625
 [9] 612.3585   0.0000 652.2524 687.5032 649.5467 662.1632 617.7036 605.4782
[17] 616.3819 624.7235 624.2377 639.5435
> colVars(tmp5,na.rm=TRUE)
 [1]  59.44849 112.26014  80.25733  39.80952  67.85811  36.13820  62.37385
 [8] 110.33416  26.42092        NA  40.94068  88.33089  65.79193 111.98311
[15]  70.15862 109.23979  64.75197  78.77504  66.05849  55.49263
> colSd(tmp5,na.rm=TRUE)
 [1]  7.710285 10.595289  8.958645  6.309478  8.237603  6.011505  7.897712
 [8] 10.504007  5.140128        NA  6.398490  9.398452  8.111222 10.582207
[15]  8.376074 10.451784  8.046861  8.875530  8.127638  7.449337
> colMax(tmp5,na.rm=TRUE)
 [1] 87.62419 94.87865 86.86769 75.63373 82.32366 76.80798 86.86284 89.48070
 [9] 79.29750     -Inf 81.43647 88.29878 83.87520 89.04542 82.69844 84.20272
[17] 84.24761 83.16698 82.39076 86.13879
> colMin(tmp5,na.rm=TRUE)
 [1] 63.85300 58.98017 57.29835 56.99211 54.26333 57.57065 59.49377 55.82601
 [9] 62.19406      Inf 61.86306 58.64904 57.22369 60.50085 58.51805 56.25964
[17] 60.38407 55.23655 57.24552 63.90652
> 
> 
> 
> 
> 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] 216.1239 372.1812 214.1715 217.1701 208.1594 392.3281 110.5723 211.3967
 [9] 151.5563 201.7589
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 216.1239 372.1812 214.1715 217.1701 208.1594 392.3281 110.5723 211.3967
 [9] 151.5563 201.7589
> 
> 
> 
> 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 -2.842171e-14 -2.842171e-13  2.842171e-14  8.526513e-14
 [6] -8.526513e-14  1.136868e-13  0.000000e+00  2.842171e-14  5.684342e-14
[11]  2.842171e-14 -1.136868e-13 -5.684342e-14 -8.526513e-14 -2.842171e-13
[16]  5.684342e-14 -1.421085e-13  2.842171e-14 -2.842171e-14  0.000000e+00
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> ## making sure these things agree
> ##
> ## first when there is no NA
> 
> 
> 
> agree.checks <- function(buff.matrix,r.matrix,err.tol=1e-10){
+ 
+   if (Max(buff.matrix,na.rm=TRUE) != max(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Max")
+   }
+   
+ 
+   if (Min(buff.matrix,na.rm=TRUE) != min(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Min")
+   }
+ 
+ 
+   if (abs(Sum(buff.matrix,na.rm=TRUE)- sum(r.matrix,na.rm=TRUE)) > err.tol){
+ 
+     cat(Sum(buff.matrix,na.rm=TRUE),"\n")
+     cat(sum(r.matrix,na.rm=TRUE),"\n")
+     cat(Sum(buff.matrix,na.rm=TRUE) - sum(r.matrix,na.rm=TRUE),"\n")
+     
+     stop("No agreement in Sum")
+   }
+   
+   if (abs(mean(buff.matrix,na.rm=TRUE) - mean(r.matrix,na.rm=TRUE)) > err.tol){
+     stop("No agreement in mean")
+   }
+   
+   
+   if(abs(Var(buff.matrix,na.rm=TRUE) - var(as.vector(r.matrix),na.rm=TRUE)) > err.tol){
+     stop("No agreement in Var")
+   }
+   
+   
+ 
+   if(any(abs(rowMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,mean,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowMeans")
+   }
+   
+   
+   if(any(abs(colMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,mean,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colMeans")
+   }
+   
+   
+   if(any(abs(rowSums(buff.matrix,na.rm=TRUE)  -  apply(r.matrix,1,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in rowSums")
+   }
+   
+   
+   if(any(abs(colSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colSums")
+   }
+   
+   ### this is to get around the fact that R doesn't like to compute NA on an entire vector of NA when 
+   ### computing variance
+   my.Var <- function(x,na.rm=FALSE){
+    if (all(is.na(x))){
+      return(NA)
+    } else {
+      var(x,na.rm=na.rm)
+    }
+ 
+   }
+   
+   if(any(abs(rowVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+   
+   
+   if(any(abs(colVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+ 
+ 
+   if(any(abs(rowMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+ 
+   if(any(abs(colMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+   
+   
+   if(any(abs(rowMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+   
+ 
+   if(any(abs(colMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+ 
+   if(any(abs(colMedians(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,median,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMedian")
+   }
+ 
+   if(any(abs(colRanges(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,range,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colRanges")
+   }
+ 
+ 
+   
+ }
> 
> 
> 
> 
> 
> 
> 
> 
> 
> for (rep in 1:20){
+   copymatrix <- matrix(rnorm(200,150,15),10,20)
+   
+   tmp5[1:10,1:20] <- copymatrix
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ## now lets assign some NA values and check agreement
+ 
+   which.row <- sample(1:10,1,replace=TRUE)
+   which.col  <- sample(1:20,1,replace=TRUE)
+   
+   cat(which.row," ",which.col,"\n")
+   
+   tmp5[which.row,which.col] <- NA
+   copymatrix[which.row,which.col] <- NA
+   
+   agree.checks(tmp5,copymatrix)
+ 
+   ## make an entire row NA
+   tmp5[which.row,] <- NA
+   copymatrix[which.row,] <- NA
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ### also make an entire col NA
+   tmp5[,which.col] <- NA
+   copymatrix[,which.col] <- NA
+ 
+   agree.checks(tmp5,copymatrix)
+ 
+   ### now make 1 element non NA with NA in the rest of row and column
+ 
+   tmp5[which.row,which.col] <- rnorm(1,150,15)
+   copymatrix[which.row,which.col] <- tmp5[which.row,which.col]
+ 
+   agree.checks(tmp5,copymatrix)
+ }
10   3 
3   17 
10   5 
4   11 
6   10 
8   12 
10   11 
4   18 
10   7 
9   20 
4   16 
8   13 
8   12 
7   14 
2   19 
8   11 
4   19 
1   13 
2   15 
6   4 
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] 1.95317
> Min(tmp)
[1] -2.777506
> mean(tmp)
[1] 0.1350977
> Sum(tmp)
[1] 13.50977
> Var(tmp)
[1] 0.9051181
> 
> rowMeans(tmp)
[1] 0.1350977
> rowSums(tmp)
[1] 13.50977
> rowVars(tmp)
[1] 0.9051181
> rowSd(tmp)
[1] 0.9513769
> rowMax(tmp)
[1] 1.95317
> rowMin(tmp)
[1] -2.777506
> 
> colMeans(tmp)
  [1]  0.51896428  0.39035851  1.02428843  0.98295693  1.21981599 -0.01949250
  [7] -1.53717543  0.15634453  0.06358518 -1.77164451 -0.74460918  0.96709833
 [13]  0.74358407 -1.03095117  1.35674389  0.90408797  0.53716604  0.91305957
 [19]  0.06594654  0.28189414  0.16634447  0.07255518  0.33264454  1.95317047
 [25]  0.09731804  1.23917423  1.06247678 -1.69420682  1.43083346 -0.46043551
 [31] -0.43641675  1.50752919 -1.69169295 -1.57609966 -1.05786098  0.07342189
 [37] -0.69233750 -2.77750636  0.83154201  1.89891807 -0.38605253  1.50159368
 [43] -0.66034141  1.57124232  0.24420551 -0.78107246 -0.23783076 -0.33970261
 [49] -0.65321697 -0.02483335  1.10632602 -1.06468706 -0.75990867 -0.47653489
 [55]  0.29146034 -0.29979533 -1.00137709  1.90322098  0.41795019  0.98608278
 [61] -0.74076631 -1.06209358 -0.36705699 -0.75112370 -0.14863840 -0.16094742
 [67]  0.45826868  1.08204745 -0.19447266  0.95398803  1.04295096  0.86333871
 [73]  1.46495009  0.76771275  0.71871992  1.17756404  1.07303022  1.02167239
 [79]  0.50293457  0.24920757 -0.94918807  0.65356237 -0.02427790  0.46865232
 [85]  0.21016021  1.28201882 -0.02722187 -0.63574315 -1.00287129 -0.19702155
 [91]  0.61457873 -0.51299762  0.31541983 -1.23426222  0.15004873 -0.05615311
 [97] -0.90315157  1.02672102 -1.45576127  1.19784885
> colSums(tmp)
  [1]  0.51896428  0.39035851  1.02428843  0.98295693  1.21981599 -0.01949250
  [7] -1.53717543  0.15634453  0.06358518 -1.77164451 -0.74460918  0.96709833
 [13]  0.74358407 -1.03095117  1.35674389  0.90408797  0.53716604  0.91305957
 [19]  0.06594654  0.28189414  0.16634447  0.07255518  0.33264454  1.95317047
 [25]  0.09731804  1.23917423  1.06247678 -1.69420682  1.43083346 -0.46043551
 [31] -0.43641675  1.50752919 -1.69169295 -1.57609966 -1.05786098  0.07342189
 [37] -0.69233750 -2.77750636  0.83154201  1.89891807 -0.38605253  1.50159368
 [43] -0.66034141  1.57124232  0.24420551 -0.78107246 -0.23783076 -0.33970261
 [49] -0.65321697 -0.02483335  1.10632602 -1.06468706 -0.75990867 -0.47653489
 [55]  0.29146034 -0.29979533 -1.00137709  1.90322098  0.41795019  0.98608278
 [61] -0.74076631 -1.06209358 -0.36705699 -0.75112370 -0.14863840 -0.16094742
 [67]  0.45826868  1.08204745 -0.19447266  0.95398803  1.04295096  0.86333871
 [73]  1.46495009  0.76771275  0.71871992  1.17756404  1.07303022  1.02167239
 [79]  0.50293457  0.24920757 -0.94918807  0.65356237 -0.02427790  0.46865232
 [85]  0.21016021  1.28201882 -0.02722187 -0.63574315 -1.00287129 -0.19702155
 [91]  0.61457873 -0.51299762  0.31541983 -1.23426222  0.15004873 -0.05615311
 [97] -0.90315157  1.02672102 -1.45576127  1.19784885
> colVars(tmp)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> colSd(tmp)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> colMax(tmp)
  [1]  0.51896428  0.39035851  1.02428843  0.98295693  1.21981599 -0.01949250
  [7] -1.53717543  0.15634453  0.06358518 -1.77164451 -0.74460918  0.96709833
 [13]  0.74358407 -1.03095117  1.35674389  0.90408797  0.53716604  0.91305957
 [19]  0.06594654  0.28189414  0.16634447  0.07255518  0.33264454  1.95317047
 [25]  0.09731804  1.23917423  1.06247678 -1.69420682  1.43083346 -0.46043551
 [31] -0.43641675  1.50752919 -1.69169295 -1.57609966 -1.05786098  0.07342189
 [37] -0.69233750 -2.77750636  0.83154201  1.89891807 -0.38605253  1.50159368
 [43] -0.66034141  1.57124232  0.24420551 -0.78107246 -0.23783076 -0.33970261
 [49] -0.65321697 -0.02483335  1.10632602 -1.06468706 -0.75990867 -0.47653489
 [55]  0.29146034 -0.29979533 -1.00137709  1.90322098  0.41795019  0.98608278
 [61] -0.74076631 -1.06209358 -0.36705699 -0.75112370 -0.14863840 -0.16094742
 [67]  0.45826868  1.08204745 -0.19447266  0.95398803  1.04295096  0.86333871
 [73]  1.46495009  0.76771275  0.71871992  1.17756404  1.07303022  1.02167239
 [79]  0.50293457  0.24920757 -0.94918807  0.65356237 -0.02427790  0.46865232
 [85]  0.21016021  1.28201882 -0.02722187 -0.63574315 -1.00287129 -0.19702155
 [91]  0.61457873 -0.51299762  0.31541983 -1.23426222  0.15004873 -0.05615311
 [97] -0.90315157  1.02672102 -1.45576127  1.19784885
> colMin(tmp)
  [1]  0.51896428  0.39035851  1.02428843  0.98295693  1.21981599 -0.01949250
  [7] -1.53717543  0.15634453  0.06358518 -1.77164451 -0.74460918  0.96709833
 [13]  0.74358407 -1.03095117  1.35674389  0.90408797  0.53716604  0.91305957
 [19]  0.06594654  0.28189414  0.16634447  0.07255518  0.33264454  1.95317047
 [25]  0.09731804  1.23917423  1.06247678 -1.69420682  1.43083346 -0.46043551
 [31] -0.43641675  1.50752919 -1.69169295 -1.57609966 -1.05786098  0.07342189
 [37] -0.69233750 -2.77750636  0.83154201  1.89891807 -0.38605253  1.50159368
 [43] -0.66034141  1.57124232  0.24420551 -0.78107246 -0.23783076 -0.33970261
 [49] -0.65321697 -0.02483335  1.10632602 -1.06468706 -0.75990867 -0.47653489
 [55]  0.29146034 -0.29979533 -1.00137709  1.90322098  0.41795019  0.98608278
 [61] -0.74076631 -1.06209358 -0.36705699 -0.75112370 -0.14863840 -0.16094742
 [67]  0.45826868  1.08204745 -0.19447266  0.95398803  1.04295096  0.86333871
 [73]  1.46495009  0.76771275  0.71871992  1.17756404  1.07303022  1.02167239
 [79]  0.50293457  0.24920757 -0.94918807  0.65356237 -0.02427790  0.46865232
 [85]  0.21016021  1.28201882 -0.02722187 -0.63574315 -1.00287129 -0.19702155
 [91]  0.61457873 -0.51299762  0.31541983 -1.23426222  0.15004873 -0.05615311
 [97] -0.90315157  1.02672102 -1.45576127  1.19784885
> colMedians(tmp)
  [1]  0.51896428  0.39035851  1.02428843  0.98295693  1.21981599 -0.01949250
  [7] -1.53717543  0.15634453  0.06358518 -1.77164451 -0.74460918  0.96709833
 [13]  0.74358407 -1.03095117  1.35674389  0.90408797  0.53716604  0.91305957
 [19]  0.06594654  0.28189414  0.16634447  0.07255518  0.33264454  1.95317047
 [25]  0.09731804  1.23917423  1.06247678 -1.69420682  1.43083346 -0.46043551
 [31] -0.43641675  1.50752919 -1.69169295 -1.57609966 -1.05786098  0.07342189
 [37] -0.69233750 -2.77750636  0.83154201  1.89891807 -0.38605253  1.50159368
 [43] -0.66034141  1.57124232  0.24420551 -0.78107246 -0.23783076 -0.33970261
 [49] -0.65321697 -0.02483335  1.10632602 -1.06468706 -0.75990867 -0.47653489
 [55]  0.29146034 -0.29979533 -1.00137709  1.90322098  0.41795019  0.98608278
 [61] -0.74076631 -1.06209358 -0.36705699 -0.75112370 -0.14863840 -0.16094742
 [67]  0.45826868  1.08204745 -0.19447266  0.95398803  1.04295096  0.86333871
 [73]  1.46495009  0.76771275  0.71871992  1.17756404  1.07303022  1.02167239
 [79]  0.50293457  0.24920757 -0.94918807  0.65356237 -0.02427790  0.46865232
 [85]  0.21016021  1.28201882 -0.02722187 -0.63574315 -1.00287129 -0.19702155
 [91]  0.61457873 -0.51299762  0.31541983 -1.23426222  0.15004873 -0.05615311
 [97] -0.90315157  1.02672102 -1.45576127  1.19784885
> colRanges(tmp)
          [,1]      [,2]     [,3]      [,4]     [,5]       [,6]      [,7]
[1,] 0.5189643 0.3903585 1.024288 0.9829569 1.219816 -0.0194925 -1.537175
[2,] 0.5189643 0.3903585 1.024288 0.9829569 1.219816 -0.0194925 -1.537175
          [,8]       [,9]     [,10]      [,11]     [,12]     [,13]     [,14]
[1,] 0.1563445 0.06358518 -1.771645 -0.7446092 0.9670983 0.7435841 -1.030951
[2,] 0.1563445 0.06358518 -1.771645 -0.7446092 0.9670983 0.7435841 -1.030951
        [,15]    [,16]    [,17]     [,18]      [,19]     [,20]     [,21]
[1,] 1.356744 0.904088 0.537166 0.9130596 0.06594654 0.2818941 0.1663445
[2,] 1.356744 0.904088 0.537166 0.9130596 0.06594654 0.2818941 0.1663445
          [,22]     [,23]   [,24]      [,25]    [,26]    [,27]     [,28]
[1,] 0.07255518 0.3326445 1.95317 0.09731804 1.239174 1.062477 -1.694207
[2,] 0.07255518 0.3326445 1.95317 0.09731804 1.239174 1.062477 -1.694207
        [,29]      [,30]      [,31]    [,32]     [,33]   [,34]     [,35]
[1,] 1.430833 -0.4604355 -0.4364167 1.507529 -1.691693 -1.5761 -1.057861
[2,] 1.430833 -0.4604355 -0.4364167 1.507529 -1.691693 -1.5761 -1.057861
          [,36]      [,37]     [,38]    [,39]    [,40]      [,41]    [,42]
[1,] 0.07342189 -0.6923375 -2.777506 0.831542 1.898918 -0.3860525 1.501594
[2,] 0.07342189 -0.6923375 -2.777506 0.831542 1.898918 -0.3860525 1.501594
          [,43]    [,44]     [,45]      [,46]      [,47]      [,48]     [,49]
[1,] -0.6603414 1.571242 0.2442055 -0.7810725 -0.2378308 -0.3397026 -0.653217
[2,] -0.6603414 1.571242 0.2442055 -0.7810725 -0.2378308 -0.3397026 -0.653217
           [,50]    [,51]     [,52]      [,53]      [,54]     [,55]      [,56]
[1,] -0.02483335 1.106326 -1.064687 -0.7599087 -0.4765349 0.2914603 -0.2997953
[2,] -0.02483335 1.106326 -1.064687 -0.7599087 -0.4765349 0.2914603 -0.2997953
         [,57]    [,58]     [,59]     [,60]      [,61]     [,62]     [,63]
[1,] -1.001377 1.903221 0.4179502 0.9860828 -0.7407663 -1.062094 -0.367057
[2,] -1.001377 1.903221 0.4179502 0.9860828 -0.7407663 -1.062094 -0.367057
          [,64]      [,65]      [,66]     [,67]    [,68]      [,69]    [,70]
[1,] -0.7511237 -0.1486384 -0.1609474 0.4582687 1.082047 -0.1944727 0.953988
[2,] -0.7511237 -0.1486384 -0.1609474 0.4582687 1.082047 -0.1944727 0.953988
        [,71]     [,72]   [,73]     [,74]     [,75]    [,76]   [,77]    [,78]
[1,] 1.042951 0.8633387 1.46495 0.7677127 0.7187199 1.177564 1.07303 1.021672
[2,] 1.042951 0.8633387 1.46495 0.7677127 0.7187199 1.177564 1.07303 1.021672
         [,79]     [,80]      [,81]     [,82]      [,83]     [,84]     [,85]
[1,] 0.5029346 0.2492076 -0.9491881 0.6535624 -0.0242779 0.4686523 0.2101602
[2,] 0.5029346 0.2492076 -0.9491881 0.6535624 -0.0242779 0.4686523 0.2101602
        [,86]       [,87]      [,88]     [,89]      [,90]     [,91]      [,92]
[1,] 1.282019 -0.02722187 -0.6357431 -1.002871 -0.1970216 0.6145787 -0.5129976
[2,] 1.282019 -0.02722187 -0.6357431 -1.002871 -0.1970216 0.6145787 -0.5129976
         [,93]     [,94]     [,95]       [,96]      [,97]    [,98]     [,99]
[1,] 0.3154198 -1.234262 0.1500487 -0.05615311 -0.9031516 1.026721 -1.455761
[2,] 0.3154198 -1.234262 0.1500487 -0.05615311 -0.9031516 1.026721 -1.455761
       [,100]
[1,] 1.197849
[2,] 1.197849
> 
> 
> Max(tmp2)
[1] 2.045537
> Min(tmp2)
[1] -2.587331
> mean(tmp2)
[1] -0.002098384
> Sum(tmp2)
[1] -0.2098384
> Var(tmp2)
[1] 0.9080044
> 
> rowMeans(tmp2)
  [1] -1.198498692 -0.128133395 -1.212193648 -0.382166512  0.129951283
  [6] -0.119888289 -0.459957492 -0.079818560  1.547119632 -0.279927516
 [11] -0.246090556  0.701518659  0.351323465  0.686111893  1.368337339
 [16]  0.828721532 -0.375800461  0.309448903 -0.977278457  1.545451608
 [21] -0.745618726  0.828317336  1.246715504 -0.555568628  1.550327234
 [26]  0.507794774 -0.151846210 -0.949495718 -0.646837288 -0.243955181
 [31]  0.808211111 -1.010753502 -0.076647490 -0.474547972 -0.608937895
 [36] -0.799393524 -0.315605183 -0.167065782 -0.269578475 -0.494158938
 [41]  1.314292194 -1.913035379 -0.155057632 -2.014716595 -2.587331444
 [46] -1.393558914  0.284224979 -0.417955357 -1.071245042  2.005339262
 [51] -1.077226872  0.106850865 -0.393672154 -1.599932214  1.035851668
 [56] -0.080045632  0.650709870 -0.532851090 -0.841329136 -0.483727858
 [61]  0.316486588 -1.242665030  0.046957932  1.791634677 -1.161908966
 [66]  1.638966746 -0.180634602  0.314193474  0.733360337  1.403441831
 [71]  1.933637105 -0.176624148  0.171891783  0.400484046  0.919193359
 [76] -0.302095273 -1.296431710 -0.828014422 -0.506821959  0.082661044
 [81] -0.135460459  2.009161592 -0.006724618 -0.811168573 -0.573617907
 [86]  0.353396275 -0.836576307  1.498101374  1.629282963 -0.395394529
 [91] -0.455723055  0.579239822 -0.149389946  0.208822709 -0.130749776
 [96] -0.322332556  2.045536692 -0.308526076  0.205842274  1.053559165
> rowSums(tmp2)
  [1] -1.198498692 -0.128133395 -1.212193648 -0.382166512  0.129951283
  [6] -0.119888289 -0.459957492 -0.079818560  1.547119632 -0.279927516
 [11] -0.246090556  0.701518659  0.351323465  0.686111893  1.368337339
 [16]  0.828721532 -0.375800461  0.309448903 -0.977278457  1.545451608
 [21] -0.745618726  0.828317336  1.246715504 -0.555568628  1.550327234
 [26]  0.507794774 -0.151846210 -0.949495718 -0.646837288 -0.243955181
 [31]  0.808211111 -1.010753502 -0.076647490 -0.474547972 -0.608937895
 [36] -0.799393524 -0.315605183 -0.167065782 -0.269578475 -0.494158938
 [41]  1.314292194 -1.913035379 -0.155057632 -2.014716595 -2.587331444
 [46] -1.393558914  0.284224979 -0.417955357 -1.071245042  2.005339262
 [51] -1.077226872  0.106850865 -0.393672154 -1.599932214  1.035851668
 [56] -0.080045632  0.650709870 -0.532851090 -0.841329136 -0.483727858
 [61]  0.316486588 -1.242665030  0.046957932  1.791634677 -1.161908966
 [66]  1.638966746 -0.180634602  0.314193474  0.733360337  1.403441831
 [71]  1.933637105 -0.176624148  0.171891783  0.400484046  0.919193359
 [76] -0.302095273 -1.296431710 -0.828014422 -0.506821959  0.082661044
 [81] -0.135460459  2.009161592 -0.006724618 -0.811168573 -0.573617907
 [86]  0.353396275 -0.836576307  1.498101374  1.629282963 -0.395394529
 [91] -0.455723055  0.579239822 -0.149389946  0.208822709 -0.130749776
 [96] -0.322332556  2.045536692 -0.308526076  0.205842274  1.053559165
> 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] -1.198498692 -0.128133395 -1.212193648 -0.382166512  0.129951283
  [6] -0.119888289 -0.459957492 -0.079818560  1.547119632 -0.279927516
 [11] -0.246090556  0.701518659  0.351323465  0.686111893  1.368337339
 [16]  0.828721532 -0.375800461  0.309448903 -0.977278457  1.545451608
 [21] -0.745618726  0.828317336  1.246715504 -0.555568628  1.550327234
 [26]  0.507794774 -0.151846210 -0.949495718 -0.646837288 -0.243955181
 [31]  0.808211111 -1.010753502 -0.076647490 -0.474547972 -0.608937895
 [36] -0.799393524 -0.315605183 -0.167065782 -0.269578475 -0.494158938
 [41]  1.314292194 -1.913035379 -0.155057632 -2.014716595 -2.587331444
 [46] -1.393558914  0.284224979 -0.417955357 -1.071245042  2.005339262
 [51] -1.077226872  0.106850865 -0.393672154 -1.599932214  1.035851668
 [56] -0.080045632  0.650709870 -0.532851090 -0.841329136 -0.483727858
 [61]  0.316486588 -1.242665030  0.046957932  1.791634677 -1.161908966
 [66]  1.638966746 -0.180634602  0.314193474  0.733360337  1.403441831
 [71]  1.933637105 -0.176624148  0.171891783  0.400484046  0.919193359
 [76] -0.302095273 -1.296431710 -0.828014422 -0.506821959  0.082661044
 [81] -0.135460459  2.009161592 -0.006724618 -0.811168573 -0.573617907
 [86]  0.353396275 -0.836576307  1.498101374  1.629282963 -0.395394529
 [91] -0.455723055  0.579239822 -0.149389946  0.208822709 -0.130749776
 [96] -0.322332556  2.045536692 -0.308526076  0.205842274  1.053559165
> rowMin(tmp2)
  [1] -1.198498692 -0.128133395 -1.212193648 -0.382166512  0.129951283
  [6] -0.119888289 -0.459957492 -0.079818560  1.547119632 -0.279927516
 [11] -0.246090556  0.701518659  0.351323465  0.686111893  1.368337339
 [16]  0.828721532 -0.375800461  0.309448903 -0.977278457  1.545451608
 [21] -0.745618726  0.828317336  1.246715504 -0.555568628  1.550327234
 [26]  0.507794774 -0.151846210 -0.949495718 -0.646837288 -0.243955181
 [31]  0.808211111 -1.010753502 -0.076647490 -0.474547972 -0.608937895
 [36] -0.799393524 -0.315605183 -0.167065782 -0.269578475 -0.494158938
 [41]  1.314292194 -1.913035379 -0.155057632 -2.014716595 -2.587331444
 [46] -1.393558914  0.284224979 -0.417955357 -1.071245042  2.005339262
 [51] -1.077226872  0.106850865 -0.393672154 -1.599932214  1.035851668
 [56] -0.080045632  0.650709870 -0.532851090 -0.841329136 -0.483727858
 [61]  0.316486588 -1.242665030  0.046957932  1.791634677 -1.161908966
 [66]  1.638966746 -0.180634602  0.314193474  0.733360337  1.403441831
 [71]  1.933637105 -0.176624148  0.171891783  0.400484046  0.919193359
 [76] -0.302095273 -1.296431710 -0.828014422 -0.506821959  0.082661044
 [81] -0.135460459  2.009161592 -0.006724618 -0.811168573 -0.573617907
 [86]  0.353396275 -0.836576307  1.498101374  1.629282963 -0.395394529
 [91] -0.455723055  0.579239822 -0.149389946  0.208822709 -0.130749776
 [96] -0.322332556  2.045536692 -0.308526076  0.205842274  1.053559165
> 
> colMeans(tmp2)
[1] -0.002098384
> colSums(tmp2)
[1] -0.2098384
> colVars(tmp2)
[1] 0.9080044
> colSd(tmp2)
[1] 0.9528927
> colMax(tmp2)
[1] 2.045537
> colMin(tmp2)
[1] -2.587331
> colMedians(tmp2)
[1] -0.1506181
> colRanges(tmp2)
          [,1]
[1,] -2.587331
[2,]  2.045537
> 
> dataset1 <- matrix(dataset1,1,100)
> 
> agree.checks(tmp,dataset1)
> 
> dataset2 <- matrix(dataset2,100,1)
> agree.checks(tmp2,dataset2)
>   
> 
> tmp <- createBufferedMatrix(10,10)
> 
> tmp[1:10,1:10] <- rnorm(100)
> colApply(tmp,sum)
 [1] -1.4216929 -6.7048730 -2.8546863 -1.6920565  0.5196224 -4.0349690
 [7] -1.0183047 -2.2167364  4.5448657 -1.1762396
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -1.6514227
[2,] -0.7120891
[3,] -0.0650135
[4,]  0.4785591
[5,]  1.3631186
> 
> rowApply(tmp,sum)
 [1]  3.1433385  0.5091482  1.7641945 -3.1488840  0.9282629 -2.6127611
 [7] -7.3498681 -1.8353138 -3.0284010 -4.4247864
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    8    5    5    4    3    1   10   10    3     3
 [2,]    3    8    3    3    1    3    5    3    8     4
 [3,]    6    3    9    6    5    7    3    8    2     1
 [4,]    4    6    2    9    8    2    7    1    5    10
 [5,]    9   10    6    1   10    9    9    7    1     7
 [6,]    2    4    4    2    6    5    1    4   10     5
 [7,]    5    7    1    5    4   10    2    9    7     8
 [8,]    1    2    8    7    9    4    6    2    9     2
 [9,]   10    9   10   10    7    8    4    5    6     6
[10,]    7    1    7    8    2    6    8    6    4     9
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1]  0.67524342  1.76680073  0.68142410  1.70867088  0.52517887 -2.63243696
 [7] -0.17419240  0.09333224 -2.41521211 -1.88046543  1.23252934  1.79644507
[13]  1.63196774 -1.01757329 -2.05410311  1.17721654 -5.87761367  0.43378710
[19] -1.62221901 -2.38691982
> colApply(tmp,quantile)[,1]
            [,1]
[1,] -0.58286488
[2,] -0.19792021
[3,] -0.02758779
[4,]  0.06137490
[5,]  1.42224139
> 
> rowApply(tmp,sum)
[1]  -0.3374608  -0.9247585 -10.4717927   1.9297848   1.4660874
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]    8   20   13    9   12
[2,]    9   10   14   20   17
[3,]   17   11   11   13    3
[4,]   20   13    6   12   11
[5,]   19   18    8    1    4
> 
> 
> as.matrix(tmp)
            [,1]        [,2]        [,3]        [,4]       [,5]       [,6]
[1,] -0.58286488 -0.23375366  1.19184209  2.19083198  2.1509503  0.1877347
[2,]  1.42224139  0.03436946  0.08136072  0.37907895  1.1341696 -1.2815357
[3,] -0.19792021 -0.09529449 -0.53935899 -0.95107717 -0.7273047 -2.3789627
[4,] -0.02758779  1.49060399  0.28891017  0.16030903 -1.7255882  0.9609049
[5,]  0.06137490  0.57087544 -0.34132989 -0.07047192 -0.3070481 -0.1205781
           [,7]       [,8]        [,9]      [,10]       [,11]      [,12]
[1,] -1.4021361  0.4892929  0.09149770  1.8016116 -1.19847828  0.2856735
[2,]  1.1165439  0.4963795 -0.99809663 -1.1995739  0.15314194 -0.2967518
[3,]  1.1848166 -0.8262131 -1.29438368 -2.2901612 -0.02420784  0.9913182
[4,] -1.3222699 -0.2908342 -0.09306222 -0.4142598  0.10041202  0.9552825
[5,]  0.2488531  0.2247071 -0.12116729  0.2219179  2.20166150 -0.1390774
          [,13]      [,14]      [,15]       [,16]      [,17]       [,18]
[1,]  0.6668973 -1.2745923 -1.6217635  0.91327451 -2.6334547 -1.10925391
[2,]  0.4600301 -1.6165739  1.1327110 -0.30765710 -0.6751202  1.27527901
[3,] -0.2021660  0.4517993  0.3280774 -0.59607324 -1.3383660  0.51275953
[4,] -0.2958800  0.9550105 -1.1200544  1.26003316  0.6089142 -0.05542325
[5,]  1.0030863  0.4667831 -0.7730737 -0.09236079 -1.8395870 -0.18957428
          [,19]      [,20]
[1,]  0.3510366 -0.6018067
[2,] -1.2003252 -1.0344294
[3,] -0.6904828 -1.7885917
[4,]  0.1186729  0.3756911
[5,] -0.2011205  0.6622170
> 
> 
> 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.19-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.19-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.19-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  560  bytes.
Disk usage :  160  bytes.
> subBufferedMatrix(tmp,1:3,)
BufferedMatrix object
Matrix size:  3 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.19-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.4898211 -0.9334199 0.7668728 -0.7647493 -0.6077149 -0.3858124 -1.022161
         col8     col9     col10      col11     col12      col13     col14
row1 1.206621 1.901784 0.2827919 -0.9666164 0.3023208 -0.3407686 0.9903775
          col15      col16     col17      col18      col19     col20
row1 -0.1562928 -0.5031999 -1.422378 0.08527366 -0.0393021 0.1898256
> tmp[,"col10"]
           col10
row1  0.28279191
row2  0.68495612
row3  0.05840786
row4 -0.80348342
row5 -1.69007395
> tmp[c("row1","row5"),]
           col1       col2       col3       col4       col5       col6
row1 -0.4898211 -0.9334199  0.7668728 -0.7647493 -0.6077149 -0.3858124
row5 -0.1199860  0.6635241 -1.1564120 -1.2561090 -0.1518657 -0.6178475
          col7      col8      col9      col10      col11     col12      col13
row1 -1.022161  1.206621  1.901784  0.2827919 -0.9666164 0.3023208 -0.3407686
row5 -1.924346 -1.270206 -2.188250 -1.6900739 -1.0590844 0.4446938 -0.5879917
          col14      col15      col16      col17      col18      col19
row1  0.9903775 -0.1562928 -0.5031999 -1.4223775 0.08527366 -0.0393021
row5 -1.4142550 -0.3482787  0.9880981  0.3291674 0.25500007 -1.1052671
          col20
row1  0.1898256
row5 -2.0282016
> tmp[,c("col6","col20")]
           col6      col20
row1 -0.3858124  0.1898256
row2  1.6293936  0.7696292
row3  0.7345343  0.8626758
row4  0.6457178  1.1142574
row5 -0.6178475 -2.0282016
> tmp[c("row1","row5"),c("col6","col20")]
           col6      col20
row1 -0.3858124  0.1898256
row5 -0.6178475 -2.0282016
> 
> 
> 
> 
> 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 50.19706 49.25834 48.60942 51.8077 48.76303 105.7818 48.87521 51.17152
         col9    col10   col11    col12    col13   col14    col15    col16
row1 50.17224 49.56682 50.7267 50.92534 49.80026 49.9324 50.11197 48.78007
        col17   col18    col19    col20
row1 49.42998 53.1429 50.12038 105.0346
> tmp[,"col10"]
        col10
row1 49.56682
row2 30.96276
row3 30.61961
row4 29.29922
row5 52.02018
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 50.19706 49.25834 48.60942 51.80770 48.76303 105.7818 48.87521 51.17152
row5 49.09352 50.36723 49.65264 50.26219 50.50764 103.9434 49.60144 49.39715
         col9    col10    col11    col12    col13    col14    col15    col16
row1 50.17224 49.56682 50.72670 50.92534 49.80026 49.93240 50.11197 48.78007
row5 50.82149 52.02018 49.38654 50.44457 49.74534 50.40614 48.23768 50.03084
        col17    col18    col19    col20
row1 49.42998 53.14290 50.12038 105.0346
row5 48.39887 51.41905 49.17438 105.1751
> tmp[,c("col6","col20")]
          col6     col20
row1 105.78183 105.03463
row2  76.91982  75.43510
row3  75.81751  73.22273
row4  75.33845  73.41968
row5 103.94343 105.17509
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 105.7818 105.0346
row5 103.9434 105.1751
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 105.7818 105.0346
row5 103.9434 105.1751
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
          col13
[1,] -0.6324869
[2,]  0.2915381
[3,] -0.6295189
[4,]  0.1031953
[5,] -1.3182676
> tmp[,c("col17","col7")]
          col17       col7
[1,] -0.5248789  0.8560957
[2,]  1.3143129 -1.8310592
[3,] -0.6356923 -0.4928847
[4,] -0.4920192 -0.0418367
[5,]  0.5900039 -1.6140537
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
           col6       col20
[1,]  0.2862556 -0.63150649
[2,] -1.5719790  1.03650540
[3,]  1.3182668 -1.96276700
[4,]  0.2756864  0.04320893
[5,]  1.4708747 -0.27087492
> subBufferedMatrix(tmp,1,c("col6"))[,1]
          col1
[1,] 0.2862556
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
           col6
[1,]  0.2862556
[2,] -1.5719790
> 
> 
> 
> 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  1.5023607 -0.9975333 -0.8194817  0.16256963 -0.259844 -0.8749656
row1 -0.1887539  0.1189371  0.9599051 -0.07952056 -1.657001  0.6230001
           [,7]      [,8]       [,9]      [,10]    [,11]      [,12]      [,13]
row3  0.2462092 0.3482236  0.9331237  0.3439456 1.644769 -0.7470784 -0.8846016
row1 -0.7296085 2.2959129 -0.8377199 -2.4868972 1.033478  1.0613103  1.0960723
          [,14]     [,15]     [,16]      [,17]     [,18]      [,19]      [,20]
row3  0.4213018 0.3725719 0.9412265 -0.4805140 0.5161631 -1.7154804  0.7621447
row1 -0.8061479 1.7787776 1.1725693  0.8662498 0.6656628 -0.8811302 -0.5399899
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
           [,1]     [,2]      [,3]      [,4]      [,5]      [,6]     [,7]
row2 -0.7993033 1.588299 0.2766986 0.1540345 0.6210038 0.8018639 1.246123
           [,8]       [,9]      [,10]
row2 -0.5564572 -0.1108364 -0.2895429
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
           [,1]       [,2]       [,3]      [,4]      [,5]      [,6]      [,7]
row5 -0.4727777 -0.8149673 0.04859722 -0.684344 0.5846122 -1.148441 -2.193083
           [,8]      [,9]    [,10]      [,11]       [,12]      [,13]    [,14]
row5 -0.7125778 0.3781063 1.316808 -0.1797972 -0.09183357 0.07130808 1.493469
         [,15]     [,16]      [,17]    [,18]     [,19]    [,20]
row5 -1.794429 -1.251427 -0.8756898 1.204281 0.2321822 1.518951
> 
> 
> 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: 0x600000790120>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "/Users/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests/BMdb752c1f991" 
 [2] "/Users/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests/BMdb75ce7a001" 
 [3] "/Users/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests/BMdb753ab9a845"
 [4] "/Users/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests/BMdb7572d66821"
 [5] "/Users/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests/BMdb755a4e896d"
 [6] "/Users/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests/BMdb755a20816c"
 [7] "/Users/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests/BMdb75c1107ae" 
 [8] "/Users/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests/BMdb75320f36b2"
 [9] "/Users/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests/BMdb754cff9cb" 
[10] "/Users/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests/BMdb75721880e4"
[11] "/Users/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests/BMdb7526b63341"
[12] "/Users/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests/BMdb753df0442" 
[13] "/Users/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests/BMdb7526908b0a"
[14] "/Users/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests/BMdb755b98514d"
[15] "/Users/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests/BMdb756d01c535"
> 
> 
> ### 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: 0x6000007fc180>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x6000007fc180>
Warning message:
In dir.create(new.directory) :
  '/Users/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x6000007fc180>
> rowMedians(tmp)
  [1]  0.0094883467 -0.3010110932  0.4152842232 -0.0314187955  0.4346338358
  [6] -0.1907183844 -0.2796023408  0.0362574110 -0.1727095884 -0.6101736393
 [11]  0.1041349064 -0.0865118613  0.4488923478  0.2326786647 -0.3345328461
 [16] -0.4168608252 -0.3895963977  0.1057590658 -0.0148053399  0.0777372909
 [21] -0.0484217882  0.5577741438  0.1247999934  0.2203815531  0.2779064568
 [26] -0.2557188513 -0.2456423305 -0.3580185939 -0.4745155268  0.5192425824
 [31]  0.5959517527 -0.5036593686  0.2511094801  0.1130826726  0.3496372693
 [36] -0.2260703660  0.5413339838  0.1692530655 -0.4612550796  0.3900383629
 [41] -0.0215600815 -0.7779160574  0.3606704633 -0.2080320042 -0.4917128198
 [46]  0.3746649985  0.3946739033  0.1805742354 -0.4466524306  0.3203148176
 [51] -0.2841762880 -0.1011546055 -0.0025353634  0.6337679284 -0.0652529025
 [56]  0.1627268229 -0.1432110627 -0.0224609699 -0.0237578396 -0.1140326779
 [61] -0.5649825007 -0.0378154619 -0.3072829080  0.0038935976 -0.0100556775
 [66]  0.2345401286  0.4247952248  0.1810606947 -0.5924524445  0.0455286123
 [71]  0.2843896641 -0.2173914984 -0.0740090728  0.3718698051  0.0874905387
 [76]  0.0860815503 -0.0574328061  0.4968754741  0.1840056686 -0.0848513112
 [81] -0.0237030048 -0.0017716449 -0.0846487694 -0.2213604893  0.0430989566
 [86] -0.1636911452 -0.3013022737 -0.1015649108  0.1537812953  0.3706773893
 [91]  0.1453152086  0.1253674038  0.3414264596 -0.4249534234 -0.0680389181
 [96] -0.2735464633  0.2385589016  0.1727090617  0.4276214939 -0.1697390630
[101] -0.1360204521  0.2378399168 -0.4097669407 -0.2242658575  0.2070457489
[106] -0.2357905964  0.0227190564  0.1498776535  0.1791381327 -0.2174855539
[111]  0.2190690920  0.0617066303  0.0800844100 -0.4091674465 -0.1263274658
[116]  0.1191414954 -0.5971653289 -0.3394114087 -0.2649981375 -0.6211977385
[121]  0.3292574963  0.3027991290 -0.5348832851 -0.2185697826 -0.1145034856
[126]  0.2852225062  0.4232803034 -0.2410159447  0.1905970175  0.0785189573
[131] -0.5549669995 -0.0174871267 -0.0386787541  0.3230658539  0.1886827365
[136]  0.0786315951  0.1693724649  0.0827397654  0.1617373398 -0.2955011504
[141]  0.1869140101  0.1897725852  0.6083976193 -0.5636591049  0.4614624028
[146]  0.2579601290 -0.1771749279  0.0025784818  0.1461638067 -0.7215722174
[151]  0.3358481756  0.2868644670  0.2760195166 -0.1017204910 -0.1173551290
[156]  0.2017737688  0.1613099731  0.0605429837 -0.2178224851 -0.2160102486
[161] -1.0064428358 -0.6258087909 -0.3570398340 -0.6362010304  0.4049661938
[166] -0.3002976277 -0.7048030583 -0.1155103738  0.1282158102  0.1178913247
[171] -0.6009782952  0.2143570075 -0.3113015148 -0.5927049341  0.1178004332
[176]  0.4351494268  0.2203228141  0.5210608580  0.1623697213  0.0431406043
[181]  0.2405176718  0.0235735418  0.0900549361 -0.0900031225  0.1474849504
[186] -0.2973710711  0.5225087064 -0.6718525005  0.4970436029 -0.0638125485
[191] -0.3728815883 -0.3386295455 -0.2139191741 -0.0910867957  0.2570209984
[196] -0.0536108883  0.0447190536 -0.2155668228  0.4206048361 -0.1032530977
[201] -0.6388584313  0.2782679531  0.0644546391 -0.1718204571  0.2071171421
[206]  0.7943925950 -0.1064918380 -0.5565589442 -0.1000139701  0.3714941115
[211] -0.0008317804 -0.3060559991 -0.3258232141  0.3217833451 -0.3870506775
[216]  0.3612597675  0.0516789411 -0.1583246823  0.3811475446  0.0516637757
[221] -0.1052611196 -0.4739206720  0.3047369155  0.1684757633  0.0249040408
[226]  0.1265822814  0.0393354225 -0.1092384163 -0.0648828025 -0.4874866175
> 
> proc.time()
   user  system elapsed 
  2.449  12.755  15.740 

BufferedMatrix.Rcheck/tests/rawCalltesting.Rout


R version 4.4.0 (2024-04-24) -- "Puppy Cup"
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: 0x600002c24240>
> .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: 0x600002c24240>
> .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: 0x600002c24240>
> .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: 0x600002c24240>
> 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: 0x600002c10000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600002c10000>
> .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: 0x600002c10000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600002c10000>
> .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: 0x600002c10000>
> 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: 0x600002c10180>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600002c10180>
> .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: 0x600002c10180>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x600002c10180>
> .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: 0x600002c10180>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x600002c10180>
> .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: 0x600002c10180>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x600002c10180>
> .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: 0x600002c10180>
> 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: 0x600002c1c000>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x600002c1c000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600002c1c000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600002c1c000>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFilee0a13709df21" "BufferedMatrixFilee0a1dfe5eec" 
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFilee0a13709df21" "BufferedMatrixFilee0a1dfe5eec" 
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x600002c18060>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600002c18060>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x600002c18060>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x600002c18060>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x600002c18060>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x600002c18060>
> .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: 0x600002c18120>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600002c18120>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x600002c18120>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x600002c18120>
> 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: 0x600002c34120>
> .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: 0x600002c34120>
> rm(P)
> 
> proc.time()
   user  system elapsed 
  0.327   0.133   0.451 

BufferedMatrix.Rcheck/tests/Rcodetesting.Rout


R version 4.4.0 (2024-04-24) -- "Puppy Cup"
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.312   0.086   0.383 

Example timings