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

This page was generated on 2024-10-05 11:43 -0400 (Sat, 05 Oct 2024).

HostnameOSArch (*)R versionInstalled pkgs
teran2Linux (Ubuntu 24.04.1 LTS)x86_644.4.1 (2024-06-14) -- "Race for Your Life" 4461
palomino8Windows Server 2022 Datacenterx644.4.1 (2024-06-14 ucrt) -- "Race for Your Life" 4466
lconwaymacOS 12.7.1 Montereyx86_644.4.1 (2024-06-14) -- "Race for Your Life" 4498
kjohnson3macOS 13.6.5 Venturaarm644.4.1 (2024-06-14) -- "Race for Your Life" 4446
kunpeng2Linux (openEuler 22.03 LTS-SP1)aarch644.4.1 (2024-06-14) -- "Race for Your Life" 4445
Click on any hostname to see more info about the system (e.g. compilers)      (*) as reported by 'uname -p', except on Windows and Mac OS X

Package 250/2266HostnameOS / ArchINSTALLBUILDCHECKBUILD BIN
BufferedMatrix 1.69.0  (landing page)
Ben Bolstad
Snapshot Date: 2024-10-04 13:40 -0400 (Fri, 04 Oct 2024)
git_url: https://git.bioconductor.org/packages/BufferedMatrix
git_branch: devel
git_last_commit: d422a05
git_last_commit_date: 2024-04-30 10:16:21 -0400 (Tue, 30 Apr 2024)
teran2Linux (Ubuntu 24.04.1 LTS) / x86_64  OK    OK    OK  UNNEEDED, same version is already published
palomino8Windows Server 2022 Datacenter / x64  OK    OK    OK    OK  UNNEEDED, same version is already published
lconwaymacOS 12.7.1 Monterey / x86_64  OK    OK    WARNINGS    OK  UNNEEDED, same version is already published
kjohnson3macOS 13.6.5 Ventura / arm64  OK    OK    WARNINGS    OK  UNNEEDED, same version is already published
kunpeng2Linux (openEuler 22.03 LTS-SP1) / aarch64  OK    OK    OK  


CHECK results for BufferedMatrix on kjohnson3

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.69.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.69.0.tar.gz
StartedAt: 2024-10-04 19:51:21 -0400 (Fri, 04 Oct 2024)
EndedAt: 2024-10-04 19:51:36 -0400 (Fri, 04 Oct 2024)
EllapsedTime: 15.2 seconds
RetCode: 0
Status:   WARNINGS  
CheckDir: BufferedMatrix.Rcheck
Warnings: 1

Command output

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


* using log directory ‘/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck’
* using R version 4.4.1 (2024-06-14)
* using platform: aarch64-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 Ventura 13.6.7
* using session charset: UTF-8
* using option ‘--no-vignettes’
* checking for file ‘BufferedMatrix/DESCRIPTION’ ... OK
* this is package ‘BufferedMatrix’ version ‘1.69.0’
* checking package namespace information ... OK
* checking package dependencies ... OK
* checking if this is a source package ... OK
* checking if there is a namespace ... OK
* checking for hidden files and directories ... OK
* checking for portable file names ... OK
* checking for sufficient/correct file permissions ... OK
* checking whether package ‘BufferedMatrix’ can be installed ... WARNING
Found the following significant warnings:
  doubleBufferedMatrix.c:1580:7: warning: logical not is only applied to the left hand side of this bitwise operator [-Wlogical-not-parentheses]
See ‘/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/00install.out’ for details.
* used C compiler: ‘Apple clang version 15.0.0 (clang-1500.1.0.2.5)’
* used SDK: ‘MacOSX11.3.sdk’
* checking installed package size ... OK
* checking package directory ... OK
* checking ‘build’ directory ... OK
* checking DESCRIPTION meta-information ... OK
* checking top-level files ... OK
* checking for left-over files ... OK
* checking index information ... OK
* checking package subdirectories ... OK
* checking code files for non-ASCII characters ... OK
* checking R files for syntax errors ... OK
* checking whether the package can be loaded ... OK
* checking whether the package can be loaded with stated dependencies ... OK
* checking whether the package can be unloaded cleanly ... OK
* checking whether the namespace can be loaded with stated dependencies ... OK
* checking whether the namespace can be unloaded cleanly ... OK
* checking dependencies in R code ... OK
* checking S3 generic/method consistency ... OK
* checking replacement functions ... OK
* checking foreign function calls ... OK
* checking R code for possible problems ... OK
* checking Rd files ... NOTE
checkRd: (-1) BufferedMatrix-class.Rd:209: Lost braces; missing escapes or markup?
   209 |     $x^{power}$ elementwise of the matrix
       |        ^
prepare_Rd: createBufferedMatrix.Rd:26: Dropping empty section \keyword
prepare_Rd: createBufferedMatrix.Rd:17-18: Dropping empty section \details
prepare_Rd: createBufferedMatrix.Rd:15-16: Dropping empty section \value
prepare_Rd: createBufferedMatrix.Rd:19-20: Dropping empty section \references
prepare_Rd: createBufferedMatrix.Rd:21-22: Dropping empty section \seealso
prepare_Rd: createBufferedMatrix.Rd:23-24: Dropping empty section \examples
* checking Rd metadata ... OK
* checking Rd cross-references ... OK
* checking for missing documentation entries ... OK
* checking for code/documentation mismatches ... OK
* checking Rd \usage sections ... OK
* checking Rd contents ... OK
* checking for unstated dependencies in examples ... OK
* checking line endings in C/C++/Fortran sources/headers ... OK
* checking compiled code ... NOTE
Note: information on .o files is not available
* checking sizes of PDF files under ‘inst/doc’ ... OK
* checking files in ‘vignettes’ ... OK
* checking examples ... NONE
* checking for unstated dependencies in ‘tests’ ... OK
* checking tests ...
  Running ‘Rcodetesting.R’
  Running ‘c_code_level_tests.R’
  Running ‘objectTesting.R’
  Running ‘rawCalltesting.R’
 OK
* checking for unstated dependencies in vignettes ... OK
* checking package vignettes ... OK
* checking running R code from vignettes ... SKIPPED
* checking re-building of vignette outputs ... SKIPPED
* checking PDF version of manual ... OK
* DONE

Status: 1 WARNING, 2 NOTEs
See
  ‘/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/00check.log’
for details.


Installation output

BufferedMatrix.Rcheck/00install.out

##############################################################################
##############################################################################
###
### Running command:
###
###   /Library/Frameworks/R.framework/Resources/bin/R CMD INSTALL BufferedMatrix
###
##############################################################################
##############################################################################


* installing to library ‘/Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library’
* installing *source* package ‘BufferedMatrix’ ...
** using staged installation
** libs
using C compiler: ‘Apple clang version 15.0.0 (clang-1500.1.0.2.5)’
using SDK: ‘MacOSX11.3.sdk’
clang -arch arm64 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/opt/R/arm64/include    -fPIC  -falign-functions=64 -Wall -g -O2  -c RBufferedMatrix.c -o RBufferedMatrix.o
clang -arch arm64 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/opt/R/arm64/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 arm64 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/opt/R/arm64/include    -fPIC  -falign-functions=64 -Wall -g -O2  -c doubleBufferedMatrix_C_tests.c -o doubleBufferedMatrix_C_tests.o
clang -arch arm64 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/opt/R/arm64/include    -fPIC  -falign-functions=64 -Wall -g -O2  -c init_package.c -o init_package.o
clang -arch arm64 -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -L/Library/Frameworks/R.framework/Resources/lib -L/opt/R/arm64/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-arm64/Resources/library/00LOCK-BufferedMatrix/00new/BufferedMatrix/libs
** R
** inst
** byte-compile and prepare package for lazy loading
Creating a new generic function for ‘rowMeans’ in package ‘BufferedMatrix’
Creating a new generic function for ‘rowSums’ in package ‘BufferedMatrix’
Creating a new generic function for ‘colMeans’ in package ‘BufferedMatrix’
Creating a new generic function for ‘colSums’ in package ‘BufferedMatrix’
Creating a generic function for ‘ncol’ from package ‘base’ in package ‘BufferedMatrix’
Creating a generic function for ‘nrow’ from package ‘base’ in package ‘BufferedMatrix’
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
** checking absolute paths in shared objects and dynamic libraries
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (BufferedMatrix)

Tests output

BufferedMatrix.Rcheck/tests/c_code_level_tests.Rout


R version 4.4.1 (2024-06-14) -- "Race for Your Life"
Copyright (C) 2024 The R Foundation for Statistical Computing
Platform: aarch64-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.110   0.036   0.141 

BufferedMatrix.Rcheck/tests/objectTesting.Rout


R version 4.4.1 (2024-06-14) -- "Race for Your Life"
Copyright (C) 2024 The R Foundation for Statistical Computing
Platform: aarch64-apple-darwin20

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(BufferedMatrix);library.dynam("BufferedMatrix","BufferedMatrix", .libPaths());

Attaching package: 'BufferedMatrix'

The following objects are masked from 'package:base':

    colMeans, colSums, rowMeans, rowSums

> 
> 
> ### this is used to control how many repetitions in something below
> ### higher values result in more checks.
> nreps <-100 ##20000
> 
> 
> ## test creation and some simple assignments and subsetting operations
> 
> ## first on single elements
> tmp <- createBufferedMatrix(1000,10)
> 
> tmp[10,5]
[1] 0
> tmp[10,5] <- 10
> tmp[10,5]
[1] 10
> tmp[10,5] <- 12.445
> tmp[10,5]
[1] 12.445
> 
> 
> 
> ## now testing accessing multiple elements
> tmp2 <- createBufferedMatrix(10,20)
> 
> 
> tmp2[3,1] <- 51.34
> tmp2[9,2] <- 9.87654
> tmp2[,1:2]
       [,1]    [,2]
 [1,]  0.00 0.00000
 [2,]  0.00 0.00000
 [3,] 51.34 0.00000
 [4,]  0.00 0.00000
 [5,]  0.00 0.00000
 [6,]  0.00 0.00000
 [7,]  0.00 0.00000
 [8,]  0.00 0.00000
 [9,]  0.00 9.87654
[10,]  0.00 0.00000
> tmp2[,-(3:20)]
       [,1]    [,2]
 [1,]  0.00 0.00000
 [2,]  0.00 0.00000
 [3,] 51.34 0.00000
 [4,]  0.00 0.00000
 [5,]  0.00 0.00000
 [6,]  0.00 0.00000
 [7,]  0.00 0.00000
 [8,]  0.00 0.00000
 [9,]  0.00 9.87654
[10,]  0.00 0.00000
> tmp2[3,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
[1,] 51.34    0    0    0    0    0    0    0    0     0     0     0     0
     [,14] [,15] [,16] [,17] [,18] [,19] [,20]
[1,]     0     0     0     0     0     0     0
> tmp2[-3,]
      [,1]    [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [2,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [3,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [4,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [5,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [6,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [7,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [8,]    0 9.87654    0    0    0    0    0    0    0     0     0     0     0
 [9,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
      [,14] [,15] [,16] [,17] [,18] [,19] [,20]
 [1,]     0     0     0     0     0     0     0
 [2,]     0     0     0     0     0     0     0
 [3,]     0     0     0     0     0     0     0
 [4,]     0     0     0     0     0     0     0
 [5,]     0     0     0     0     0     0     0
 [6,]     0     0     0     0     0     0     0
 [7,]     0     0     0     0     0     0     0
 [8,]     0     0     0     0     0     0     0
 [9,]     0     0     0     0     0     0     0
> tmp2[2,1:3]
     [,1] [,2] [,3]
[1,]    0    0    0
> tmp2[3:9,1:3]
      [,1]    [,2] [,3]
[1,] 51.34 0.00000    0
[2,]  0.00 0.00000    0
[3,]  0.00 0.00000    0
[4,]  0.00 0.00000    0
[5,]  0.00 0.00000    0
[6,]  0.00 0.00000    0
[7,]  0.00 9.87654    0
> tmp2[-4,-4]
       [,1]    [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [2,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [3,] 51.34 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [4,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [5,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [6,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [7,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [8,]  0.00 9.87654    0    0    0    0    0    0    0     0     0     0     0
 [9,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
      [,14] [,15] [,16] [,17] [,18] [,19]
 [1,]     0     0     0     0     0     0
 [2,]     0     0     0     0     0     0
 [3,]     0     0     0     0     0     0
 [4,]     0     0     0     0     0     0
 [5,]     0     0     0     0     0     0
 [6,]     0     0     0     0     0     0
 [7,]     0     0     0     0     0     0
 [8,]     0     0     0     0     0     0
 [9,]     0     0     0     0     0     0
> 
> ## now testing accessing/assigning multiple elements
> tmp3 <- createBufferedMatrix(10,10)
> 
> for (i in 1:10){
+   for (j in 1:10){
+     tmp3[i,j] <- (j-1)*10 + i
+   }
+ }
> 
> tmp3[2:4,2:4]
     [,1] [,2] [,3]
[1,]   12   22   32
[2,]   13   23   33
[3,]   14   24   34
> tmp3[c(-10),c(2:4,2:4,10,1,2,1:10,10:1)]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]   11   21   31   11   21   31   91    1   11     1    11    21    31
 [2,]   12   22   32   12   22   32   92    2   12     2    12    22    32
 [3,]   13   23   33   13   23   33   93    3   13     3    13    23    33
 [4,]   14   24   34   14   24   34   94    4   14     4    14    24    34
 [5,]   15   25   35   15   25   35   95    5   15     5    15    25    35
 [6,]   16   26   36   16   26   36   96    6   16     6    16    26    36
 [7,]   17   27   37   17   27   37   97    7   17     7    17    27    37
 [8,]   18   28   38   18   28   38   98    8   18     8    18    28    38
 [9,]   19   29   39   19   29   39   99    9   19     9    19    29    39
      [,14] [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24] [,25]
 [1,]    41    51    61    71    81    91    91    81    71    61    51    41
 [2,]    42    52    62    72    82    92    92    82    72    62    52    42
 [3,]    43    53    63    73    83    93    93    83    73    63    53    43
 [4,]    44    54    64    74    84    94    94    84    74    64    54    44
 [5,]    45    55    65    75    85    95    95    85    75    65    55    45
 [6,]    46    56    66    76    86    96    96    86    76    66    56    46
 [7,]    47    57    67    77    87    97    97    87    77    67    57    47
 [8,]    48    58    68    78    88    98    98    88    78    68    58    48
 [9,]    49    59    69    79    89    99    99    89    79    69    59    49
      [,26] [,27] [,28] [,29]
 [1,]    31    21    11     1
 [2,]    32    22    12     2
 [3,]    33    23    13     3
 [4,]    34    24    14     4
 [5,]    35    25    15     5
 [6,]    36    26    16     6
 [7,]    37    27    17     7
 [8,]    38    28    18     8
 [9,]    39    29    19     9
> tmp3[-c(1:5),-c(6:10)]
     [,1] [,2] [,3] [,4] [,5]
[1,]    6   16   26   36   46
[2,]    7   17   27   37   47
[3,]    8   18   28   38   48
[4,]    9   19   29   39   49
[5,]   10   20   30   40   50
> 
> ## assignment of whole columns
> tmp3[,1] <- c(1:10*100.0)
> tmp3[,1:2] <- tmp3[,1:2]*100
> tmp3[,1:2] <- tmp3[,2:1]
> tmp3[,1:2]
      [,1]  [,2]
 [1,] 1100 1e+04
 [2,] 1200 2e+04
 [3,] 1300 3e+04
 [4,] 1400 4e+04
 [5,] 1500 5e+04
 [6,] 1600 6e+04
 [7,] 1700 7e+04
 [8,] 1800 8e+04
 [9,] 1900 9e+04
[10,] 2000 1e+05
> 
> 
> tmp3[,-1] <- tmp3[,1:9]
> tmp3[,1:10]
      [,1] [,2]  [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,] 1100 1100 1e+04   21   31   41   51   61   71    81
 [2,] 1200 1200 2e+04   22   32   42   52   62   72    82
 [3,] 1300 1300 3e+04   23   33   43   53   63   73    83
 [4,] 1400 1400 4e+04   24   34   44   54   64   74    84
 [5,] 1500 1500 5e+04   25   35   45   55   65   75    85
 [6,] 1600 1600 6e+04   26   36   46   56   66   76    86
 [7,] 1700 1700 7e+04   27   37   47   57   67   77    87
 [8,] 1800 1800 8e+04   28   38   48   58   68   78    88
 [9,] 1900 1900 9e+04   29   39   49   59   69   79    89
[10,] 2000 2000 1e+05   30   40   50   60   70   80    90
> 
> tmp3[,1:2] <- rep(1,10)
> tmp3[,1:2] <- rep(1,20)
> tmp3[,1:2] <- matrix(c(1:5),1,5)
> 
> tmp3[,-c(1:8)] <- matrix(c(1:5),1,5)
> 
> tmp3[1,] <- 1:10
> tmp3[1,]
     [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,]    1    2    3    4    5    6    7    8    9    10
> tmp3[-1,] <- c(1,2)
> tmp3[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    1    2    3    4    5    6    7    8    9    10
 [2,]    1    2    1    2    1    2    1    2    1     2
 [3,]    2    1    2    1    2    1    2    1    2     1
 [4,]    1    2    1    2    1    2    1    2    1     2
 [5,]    2    1    2    1    2    1    2    1    2     1
 [6,]    1    2    1    2    1    2    1    2    1     2
 [7,]    2    1    2    1    2    1    2    1    2     1
 [8,]    1    2    1    2    1    2    1    2    1     2
 [9,]    2    1    2    1    2    1    2    1    2     1
[10,]    1    2    1    2    1    2    1    2    1     2
> tmp3[-c(1:8),] <- matrix(c(1:5),1,5)
> tmp3[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    1    2    3    4    5    6    7    8    9    10
 [2,]    1    2    1    2    1    2    1    2    1     2
 [3,]    2    1    2    1    2    1    2    1    2     1
 [4,]    1    2    1    2    1    2    1    2    1     2
 [5,]    2    1    2    1    2    1    2    1    2     1
 [6,]    1    2    1    2    1    2    1    2    1     2
 [7,]    2    1    2    1    2    1    2    1    2     1
 [8,]    1    2    1    2    1    2    1    2    1     2
 [9,]    1    3    5    2    4    1    3    5    2     4
[10,]    2    4    1    3    5    2    4    1    3     5
> 
> 
> tmp3[1:2,1:2] <- 5555.04
> tmp3[-(1:2),1:2] <- 1234.56789
> 
> 
> 
> ## testing accessors for the directory and prefix
> directory(tmp3)
[1] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests"
> prefix(tmp3)
[1] "BM"
> 
> ## testing if we can remove these objects
> rm(tmp, tmp2, tmp3)
> gc()
         used (Mb) gc trigger (Mb) limit (Mb) max used (Mb)
Ncells 474153 25.4    1035438 55.3         NA   638568 34.2
Vcells 877599  6.7    8388608 64.0     196608  2072936 15.9
> 
> 
> 
> 
> ##
> ## checking reads
> ##
> 
> tmp2 <- createBufferedMatrix(10,20)
> 
> test.sample <- rnorm(10*20)
> 
> tmp2[1:10,1:20] <- test.sample
> 
> test.matrix <- matrix(test.sample,10,20)
> 
> ## testing reads
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   which.col <- sample(1:20,1)
+   if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> date()
[1] "Fri Oct  4 19:51:29 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] "Fri Oct  4 19:51:29 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: 0x600001e90000>
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   which.col <- sample(1:20,1)
+   if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,5,replace=TRUE)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> date()
[1] "Fri Oct  4 19:51:30 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] "Fri Oct  4 19:51:30 2024"
> 
> ColMode(tmp2)
<pointer: 0x600001e90000>
> 
> 
> 
> ### 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,] 97.8382209  2.9363332  0.7485263  1.5564489
[2,]  0.4712039 -0.3817991  1.3120741  1.6473778
[3,] -0.9802186 -0.7930606 -0.3696647 -0.4650463
[4,] -0.4702865  0.8742598 -1.4247944 -2.3202570
> ewApply(tmp5,abs)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
           [,1]      [,2]      [,3]      [,4]
[1,] 97.8382209 2.9363332 0.7485263 1.5564489
[2,]  0.4712039 0.3817991 1.3120741 1.6473778
[3,]  0.9802186 0.7930606 0.3696647 0.4650463
[4,]  0.4702865 0.8742598 1.4247944 2.3202570
> ewApply(tmp5,sqrt)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
          [,1]      [,2]      [,3]     [,4]
[1,] 9.8913205 1.7135732 0.8651741 1.247577
[2,] 0.6864429 0.6178989 1.1454580 1.283502
[3,] 0.9900599 0.8905395 0.6080006 0.681943
[4,] 0.6857744 0.9350186 1.1936475 1.523239
> 
> my.function <- function(x,power){
+   (x+5)^power
+ }
> 
> ewApply(tmp5,my.function,power=2)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
          [,1]     [,2]     [,3]     [,4]
[1,] 221.75143 45.07207 34.40027 39.03222
[2,]  32.33563 31.56079 37.76665 39.48240
[3,]  35.88082 34.69846 31.44967 32.28448
[4,]  32.32803 35.22445 38.36127 42.55265
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x600001e88120>
> exp(tmp5)
<pointer: 0x600001e88120>
> log(tmp5,2)
<pointer: 0x600001e88120>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 461.5465
> Min(tmp5)
[1] 53.75078
> mean(tmp5)
[1] 73.24101
> Sum(tmp5)
[1] 14648.2
> Var(tmp5)
[1] 823.5489
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 90.13763 71.00582 72.77474 73.96001 70.30232 70.71436 71.74817 70.75172
 [9] 72.13578 68.87958
> rowSums(tmp5)
 [1] 1802.753 1420.116 1455.495 1479.200 1406.046 1414.287 1434.963 1415.034
 [9] 1442.716 1377.592
> rowVars(tmp5)
 [1] 7726.22118   65.08116   79.90234   63.79940   57.86090   50.76018
 [7]   39.49820   58.76101   53.26624   77.89830
> rowSd(tmp5)
 [1] 87.898926  8.067290  8.938811  7.987453  7.606635  7.124618  6.284759
 [8]  7.665573  7.298372  8.826001
> rowMax(tmp5)
 [1] 461.54654  82.17744  92.62792  88.61363  83.46564  79.34507  84.42781
 [8]  87.28720  89.34340  87.05729
> rowMin(tmp5)
 [1] 53.75078 59.03661 59.65248 61.20192 57.50354 57.64595 61.88286 59.53277
 [9] 61.92551 57.34427
> 
> colMeans(tmp5)
 [1] 111.04577  72.11273  69.89705  70.30755  70.73167  72.05950  69.21518
 [8]  72.80673  69.36496  73.59983  68.74064  70.87453  73.39952  70.33617
[15]  71.16419  67.10043  74.35923  72.32063  72.78506  72.59891
> colSums(tmp5)
 [1] 1110.4577  721.1273  698.9705  703.0755  707.3167  720.5950  692.1518
 [8]  728.0673  693.6496  735.9983  687.4064  708.7453  733.9952  703.3617
[15]  711.6419  671.0043  743.5923  723.2063  727.8506  725.9891
> colVars(tmp5)
 [1] 15204.68433    95.22861    77.69221   107.58162    67.34686    51.12807
 [7]    55.82173    66.23569    76.57774    52.35487    24.90129    58.85456
[13]    44.44554    40.77341   121.25859    35.26710    57.44728    54.34222
[19]    78.58069    96.21875
> colSd(tmp5)
 [1] 123.307276   9.758515   8.814319  10.372156   8.206513   7.150389
 [7]   7.471394   8.138531   8.750871   7.235666   4.990119   7.671673
[13]   6.666748   6.385406  11.011748   5.938611   7.579399   7.371717
[19]   8.864575   9.809116
> colMax(tmp5)
 [1] 461.54654  93.81160  82.57906  88.56776  83.78569  80.91676  77.72102
 [8]  92.62792  86.75709  87.28720  74.34554  88.61363  83.46564  78.56151
[15]  86.59286  77.90007  85.93485  83.20955  87.05729  89.34340
> colMin(tmp5)
 [1] 64.13861 57.50354 58.09440 58.33363 61.63366 59.53277 56.47631 61.60472
 [9] 53.75078 63.38048 62.07409 61.88286 59.06306 57.34427 57.64595 59.65248
[17] 61.81598 63.06544 59.51217 61.96619
> 
> 
> ### 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 71.00582 72.77474 73.96001 70.30232 70.71436 71.74817 70.75172
 [9] 72.13578 68.87958
> rowSums(tmp5)
 [1]       NA 1420.116 1455.495 1479.200 1406.046 1414.287 1434.963 1415.034
 [9] 1442.716 1377.592
> rowVars(tmp5)
 [1] 8078.02863   65.08116   79.90234   63.79940   57.86090   50.76018
 [7]   39.49820   58.76101   53.26624   77.89830
> rowSd(tmp5)
 [1] 89.877854  8.067290  8.938811  7.987453  7.606635  7.124618  6.284759
 [8]  7.665573  7.298372  8.826001
> rowMax(tmp5)
 [1]       NA 82.17744 92.62792 88.61363 83.46564 79.34507 84.42781 87.28720
 [9] 89.34340 87.05729
> rowMin(tmp5)
 [1]       NA 59.03661 59.65248 61.20192 57.50354 57.64595 61.88286 59.53277
 [9] 61.92551 57.34427
> 
> colMeans(tmp5)
 [1] 111.04577  72.11273  69.89705  70.30755  70.73167  72.05950  69.21518
 [8]  72.80673        NA  73.59983  68.74064  70.87453  73.39952  70.33617
[15]  71.16419  67.10043  74.35923  72.32063  72.78506  72.59891
> colSums(tmp5)
 [1] 1110.4577  721.1273  698.9705  703.0755  707.3167  720.5950  692.1518
 [8]  728.0673        NA  735.9983  687.4064  708.7453  733.9952  703.3617
[15]  711.6419  671.0043  743.5923  723.2063  727.8506  725.9891
> colVars(tmp5)
 [1] 15204.68433    95.22861    77.69221   107.58162    67.34686    51.12807
 [7]    55.82173    66.23569          NA    52.35487    24.90129    58.85456
[13]    44.44554    40.77341   121.25859    35.26710    57.44728    54.34222
[19]    78.58069    96.21875
> colSd(tmp5)
 [1] 123.307276   9.758515   8.814319  10.372156   8.206513   7.150389
 [7]   7.471394   8.138531         NA   7.235666   4.990119   7.671673
[13]   6.666748   6.385406  11.011748   5.938611   7.579399   7.371717
[19]   8.864575   9.809116
> colMax(tmp5)
 [1] 461.54654  93.81160  82.57906  88.56776  83.78569  80.91676  77.72102
 [8]  92.62792        NA  87.28720  74.34554  88.61363  83.46564  78.56151
[15]  86.59286  77.90007  85.93485  83.20955  87.05729  89.34340
> colMin(tmp5)
 [1] 64.13861 57.50354 58.09440 58.33363 61.63366 59.53277 56.47631 61.60472
 [9]       NA 63.38048 62.07409 61.88286 59.06306 57.34427 57.64595 59.65248
[17] 61.81598 63.06544 59.51217 61.96619
> 
> Max(tmp5,na.rm=TRUE)
[1] 461.5465
> Min(tmp5,na.rm=TRUE)
[1] 56.47631
> mean(tmp5,na.rm=TRUE)
[1] 73.33895
> Sum(tmp5,na.rm=TRUE)
[1] 14594.45
> Var(tmp5,na.rm=TRUE)
[1] 825.78
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 92.05273 71.00582 72.77474 73.96001 70.30232 70.71436 71.74817 70.75172
 [9] 72.13578 68.87958
> rowSums(tmp5,na.rm=TRUE)
 [1] 1749.002 1420.116 1455.495 1479.200 1406.046 1414.287 1434.963 1415.034
 [9] 1442.716 1377.592
> rowVars(tmp5,na.rm=TRUE)
 [1] 8078.02863   65.08116   79.90234   63.79940   57.86090   50.76018
 [7]   39.49820   58.76101   53.26624   77.89830
> rowSd(tmp5,na.rm=TRUE)
 [1] 89.877854  8.067290  8.938811  7.987453  7.606635  7.124618  6.284759
 [8]  7.665573  7.298372  8.826001
> rowMax(tmp5,na.rm=TRUE)
 [1] 461.54654  82.17744  92.62792  88.61363  83.46564  79.34507  84.42781
 [8]  87.28720  89.34340  87.05729
> rowMin(tmp5,na.rm=TRUE)
 [1] 56.47631 59.03661 59.65248 61.20192 57.50354 57.64595 61.88286 59.53277
 [9] 61.92551 57.34427
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 111.04577  72.11273  69.89705  70.30755  70.73167  72.05950  69.21518
 [8]  72.80673  71.09987  73.59983  68.74064  70.87453  73.39952  70.33617
[15]  71.16419  67.10043  74.35923  72.32063  72.78506  72.59891
> colSums(tmp5,na.rm=TRUE)
 [1] 1110.4577  721.1273  698.9705  703.0755  707.3167  720.5950  692.1518
 [8]  728.0673  639.8988  735.9983  687.4064  708.7453  733.9952  703.3617
[15]  711.6419  671.0043  743.5923  723.2063  727.8506  725.9891
> colVars(tmp5,na.rm=TRUE)
 [1] 15204.68433    95.22861    77.69221   107.58162    67.34686    51.12807
 [7]    55.82173    66.23569    52.28851    52.35487    24.90129    58.85456
[13]    44.44554    40.77341   121.25859    35.26710    57.44728    54.34222
[19]    78.58069    96.21875
> colSd(tmp5,na.rm=TRUE)
 [1] 123.307276   9.758515   8.814319  10.372156   8.206513   7.150389
 [7]   7.471394   8.138531   7.231079   7.235666   4.990119   7.671673
[13]   6.666748   6.385406  11.011748   5.938611   7.579399   7.371717
[19]   8.864575   9.809116
> colMax(tmp5,na.rm=TRUE)
 [1] 461.54654  93.81160  82.57906  88.56776  83.78569  80.91676  77.72102
 [8]  92.62792  86.75709  87.28720  74.34554  88.61363  83.46564  78.56151
[15]  86.59286  77.90007  85.93485  83.20955  87.05729  89.34340
> colMin(tmp5,na.rm=TRUE)
 [1] 64.13861 57.50354 58.09440 58.33363 61.63366 59.53277 56.47631 61.60472
 [9] 60.56386 63.38048 62.07409 61.88286 59.06306 57.34427 57.64595 59.65248
[17] 61.81598 63.06544 59.51217 61.96619
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1]      NaN 71.00582 72.77474 73.96001 70.30232 70.71436 71.74817 70.75172
 [9] 72.13578 68.87958
> rowSums(tmp5,na.rm=TRUE)
 [1]    0.000 1420.116 1455.495 1479.200 1406.046 1414.287 1434.963 1415.034
 [9] 1442.716 1377.592
> rowVars(tmp5,na.rm=TRUE)
 [1]       NA 65.08116 79.90234 63.79940 57.86090 50.76018 39.49820 58.76101
 [9] 53.26624 77.89830
> rowSd(tmp5,na.rm=TRUE)
 [1]       NA 8.067290 8.938811 7.987453 7.606635 7.124618 6.284759 7.665573
 [9] 7.298372 8.826001
> rowMax(tmp5,na.rm=TRUE)
 [1]       NA 82.17744 92.62792 88.61363 83.46564 79.34507 84.42781 87.28720
 [9] 89.34340 87.05729
> rowMin(tmp5,na.rm=TRUE)
 [1]       NA 59.03661 59.65248 61.20192 57.50354 57.64595 61.88286 59.53277
 [9] 61.92551 57.34427
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1] 72.10124 69.70174 69.70787 69.09278 69.28122 71.91751 70.63061 72.66242
 [9]      NaN 74.14078 69.13514 70.46393 73.66051 71.16325 71.93566 67.55610
[17] 74.23314 73.13238 72.95983 72.69625
> colSums(tmp5,na.rm=TRUE)
 [1] 648.9111 627.3157 627.3708 621.8350 623.5310 647.2576 635.6755 653.9617
 [9]   0.0000 667.2671 622.2163 634.1754 662.9446 640.4693 647.4209 608.0049
[17] 668.0982 658.1914 656.6385 654.2663
> colVars(tmp5,na.rm=TRUE)
 [1]  42.66000  41.73760  87.00112 104.42815  52.09749  57.29225  40.26074
 [8]  74.28084        NA  55.60710  26.26308  64.31474  49.23495  38.17430
[15] 129.72046  37.33957  64.44933  53.72199  88.05964 108.13949
> colSd(tmp5,na.rm=TRUE)
 [1]  6.531462  6.460464  9.327439 10.219009  7.217859  7.569164  6.345135
 [8]  8.618633        NA  7.457017  5.124751  8.019647  7.016762  6.178535
[15] 11.389489  6.110611  8.028034  7.329528  9.384010 10.399014
> colMax(tmp5,na.rm=TRUE)
 [1] 83.37135 79.72575 82.57906 88.56776 80.73499 80.91676 77.72102 92.62792
 [9]     -Inf 87.28720 74.34554 88.61363 83.46564 78.56151 86.59286 77.90007
[17] 85.93485 83.20955 87.05729 89.34340
> colMin(tmp5,na.rm=TRUE)
 [1] 64.13861 57.50354 58.09440 58.33363 61.63366 59.53277 57.92890 61.60472
 [9]      Inf 63.38048 62.07409 61.88286 59.06306 57.34427 57.64595 59.65248
[17] 61.81598 63.06544 59.51217 61.96619
> 
> 
> 
> 
> 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] 428.0227 179.6295 365.1436 200.8263 138.9200 243.1818 344.2562 307.7718
 [9] 320.4988 182.3714
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 428.0227 179.6295 365.1436 200.8263 138.9200 243.1818 344.2562 307.7718
 [9] 320.4988 182.3714
> 
> 
> 
> 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]  1.136868e-13  0.000000e+00  1.136868e-13 -3.126388e-13 -5.684342e-14
 [6]  2.842171e-14 -5.684342e-14  8.526513e-14 -1.705303e-13  2.842171e-14
[11] -3.410605e-13 -5.684342e-14  2.842171e-13 -5.684342e-14  0.000000e+00
[16]  0.000000e+00  1.421085e-14  2.273737e-13 -2.842171e-14  1.136868e-13
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> ## making sure these things agree
> ##
> ## first when there is no NA
> 
> 
> 
> agree.checks <- function(buff.matrix,r.matrix,err.tol=1e-10){
+ 
+   if (Max(buff.matrix,na.rm=TRUE) != max(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Max")
+   }
+   
+ 
+   if (Min(buff.matrix,na.rm=TRUE) != min(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Min")
+   }
+ 
+ 
+   if (abs(Sum(buff.matrix,na.rm=TRUE)- sum(r.matrix,na.rm=TRUE)) > err.tol){
+ 
+     cat(Sum(buff.matrix,na.rm=TRUE),"\n")
+     cat(sum(r.matrix,na.rm=TRUE),"\n")
+     cat(Sum(buff.matrix,na.rm=TRUE) - sum(r.matrix,na.rm=TRUE),"\n")
+     
+     stop("No agreement in Sum")
+   }
+   
+   if (abs(mean(buff.matrix,na.rm=TRUE) - mean(r.matrix,na.rm=TRUE)) > err.tol){
+     stop("No agreement in mean")
+   }
+   
+   
+   if(abs(Var(buff.matrix,na.rm=TRUE) - var(as.vector(r.matrix),na.rm=TRUE)) > err.tol){
+     stop("No agreement in Var")
+   }
+   
+   
+ 
+   if(any(abs(rowMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,mean,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowMeans")
+   }
+   
+   
+   if(any(abs(colMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,mean,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colMeans")
+   }
+   
+   
+   if(any(abs(rowSums(buff.matrix,na.rm=TRUE)  -  apply(r.matrix,1,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in rowSums")
+   }
+   
+   
+   if(any(abs(colSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colSums")
+   }
+   
+   ### this is to get around the fact that R doesn't like to compute NA on an entire vector of NA when 
+   ### computing variance
+   my.Var <- function(x,na.rm=FALSE){
+    if (all(is.na(x))){
+      return(NA)
+    } else {
+      var(x,na.rm=na.rm)
+    }
+ 
+   }
+   
+   if(any(abs(rowVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+   
+   
+   if(any(abs(colVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+ 
+ 
+   if(any(abs(rowMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+ 
+   if(any(abs(colMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+   
+   
+   if(any(abs(rowMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+   
+ 
+   if(any(abs(colMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+ 
+   if(any(abs(colMedians(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,median,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMedian")
+   }
+ 
+   if(any(abs(colRanges(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,range,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colRanges")
+   }
+ 
+ 
+   
+ }
> 
> 
> 
> 
> 
> 
> 
> 
> 
> for (rep in 1:20){
+   copymatrix <- matrix(rnorm(200,150,15),10,20)
+   
+   tmp5[1:10,1:20] <- copymatrix
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ## now lets assign some NA values and check agreement
+ 
+   which.row <- sample(1:10,1,replace=TRUE)
+   which.col  <- sample(1:20,1,replace=TRUE)
+   
+   cat(which.row," ",which.col,"\n")
+   
+   tmp5[which.row,which.col] <- NA
+   copymatrix[which.row,which.col] <- NA
+   
+   agree.checks(tmp5,copymatrix)
+ 
+   ## make an entire row NA
+   tmp5[which.row,] <- NA
+   copymatrix[which.row,] <- NA
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ### also make an entire col NA
+   tmp5[,which.col] <- NA
+   copymatrix[,which.col] <- NA
+ 
+   agree.checks(tmp5,copymatrix)
+ 
+   ### now make 1 element non NA with NA in the rest of row and column
+ 
+   tmp5[which.row,which.col] <- rnorm(1,150,15)
+   copymatrix[which.row,which.col] <- tmp5[which.row,which.col]
+ 
+   agree.checks(tmp5,copymatrix)
+ }
10   14 
1   19 
4   6 
4   14 
7   13 
3   13 
6   9 
2   14 
9   5 
2   2 
7   18 
8   12 
4   19 
3   14 
1   11 
6   14 
8   3 
5   9 
1   14 
3   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] 2.000176
> Min(tmp)
[1] -2.803146
> mean(tmp)
[1] -0.077104
> Sum(tmp)
[1] -7.7104
> Var(tmp)
[1] 1.036662
> 
> rowMeans(tmp)
[1] -0.077104
> rowSums(tmp)
[1] -7.7104
> rowVars(tmp)
[1] 1.036662
> rowSd(tmp)
[1] 1.018166
> rowMax(tmp)
[1] 2.000176
> rowMin(tmp)
[1] -2.803146
> 
> colMeans(tmp)
  [1]  1.3786890177  1.8725307430 -0.3921778157 -2.1213438634 -0.1619436448
  [6] -0.4510178012 -0.6699385463  0.9256011401 -1.0467502059  0.7558970351
 [11] -0.3129864921  0.6250091197 -2.0428484589 -0.2237117738  0.1281904808
 [16] -0.0211852336 -0.8985870192  0.2319887938 -0.5360861648 -2.7895971221
 [21] -0.3197517193 -0.5383213657  0.1417335223 -1.5100739739  0.2137392514
 [26]  0.1487327908 -1.7194878915 -1.2516648920 -1.1568129843  0.7980311127
 [31]  1.5217487864 -0.4271125391  1.8633771046 -0.7979507432 -0.3897861020
 [36]  1.0537619641 -1.3607025468 -0.2141253095  0.5996440510  1.1629908668
 [41] -0.0913616052  0.0851022938  0.5325478653  0.7993778343 -1.3683926341
 [46] -0.3289240751  0.2209131949 -0.2011274863  0.6083642386  0.7334493281
 [51]  0.5019528131 -0.5448227852 -1.1378718103 -0.4099045359  0.7505552651
 [56]  1.4909670359  0.3379944859  0.6137771621  2.0001755508 -0.6100454435
 [61]  1.1452311387 -2.8031460791 -0.9060632975  0.6126065861 -0.9805280373
 [66] -0.4281189996 -0.0864262631 -0.1136822156  0.8959317801  0.1867256202
 [71]  0.4323298331  1.2818663206 -0.0427584429  0.5933321224  1.1187788056
 [76] -1.0645828524  1.2545219740 -2.2697188162 -0.2051499239  0.6245556037
 [81] -1.7200888356  0.5336036988 -0.1492399864  1.2675793515 -0.2783737338
 [86] -1.1244615870  0.0236820450 -1.9508420368 -0.0258493193 -0.9531214337
 [91]  1.1567700287 -0.8539690846 -0.5083097560  1.1318598517  0.5140493063
 [96]  0.0006534511 -1.1633965475  0.7739636140  0.8967290003 -0.5777715574
> colSums(tmp)
  [1]  1.3786890177  1.8725307430 -0.3921778157 -2.1213438634 -0.1619436448
  [6] -0.4510178012 -0.6699385463  0.9256011401 -1.0467502059  0.7558970351
 [11] -0.3129864921  0.6250091197 -2.0428484589 -0.2237117738  0.1281904808
 [16] -0.0211852336 -0.8985870192  0.2319887938 -0.5360861648 -2.7895971221
 [21] -0.3197517193 -0.5383213657  0.1417335223 -1.5100739739  0.2137392514
 [26]  0.1487327908 -1.7194878915 -1.2516648920 -1.1568129843  0.7980311127
 [31]  1.5217487864 -0.4271125391  1.8633771046 -0.7979507432 -0.3897861020
 [36]  1.0537619641 -1.3607025468 -0.2141253095  0.5996440510  1.1629908668
 [41] -0.0913616052  0.0851022938  0.5325478653  0.7993778343 -1.3683926341
 [46] -0.3289240751  0.2209131949 -0.2011274863  0.6083642386  0.7334493281
 [51]  0.5019528131 -0.5448227852 -1.1378718103 -0.4099045359  0.7505552651
 [56]  1.4909670359  0.3379944859  0.6137771621  2.0001755508 -0.6100454435
 [61]  1.1452311387 -2.8031460791 -0.9060632975  0.6126065861 -0.9805280373
 [66] -0.4281189996 -0.0864262631 -0.1136822156  0.8959317801  0.1867256202
 [71]  0.4323298331  1.2818663206 -0.0427584429  0.5933321224  1.1187788056
 [76] -1.0645828524  1.2545219740 -2.2697188162 -0.2051499239  0.6245556037
 [81] -1.7200888356  0.5336036988 -0.1492399864  1.2675793515 -0.2783737338
 [86] -1.1244615870  0.0236820450 -1.9508420368 -0.0258493193 -0.9531214337
 [91]  1.1567700287 -0.8539690846 -0.5083097560  1.1318598517  0.5140493063
 [96]  0.0006534511 -1.1633965475  0.7739636140  0.8967290003 -0.5777715574
> colVars(tmp)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> colSd(tmp)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> colMax(tmp)
  [1]  1.3786890177  1.8725307430 -0.3921778157 -2.1213438634 -0.1619436448
  [6] -0.4510178012 -0.6699385463  0.9256011401 -1.0467502059  0.7558970351
 [11] -0.3129864921  0.6250091197 -2.0428484589 -0.2237117738  0.1281904808
 [16] -0.0211852336 -0.8985870192  0.2319887938 -0.5360861648 -2.7895971221
 [21] -0.3197517193 -0.5383213657  0.1417335223 -1.5100739739  0.2137392514
 [26]  0.1487327908 -1.7194878915 -1.2516648920 -1.1568129843  0.7980311127
 [31]  1.5217487864 -0.4271125391  1.8633771046 -0.7979507432 -0.3897861020
 [36]  1.0537619641 -1.3607025468 -0.2141253095  0.5996440510  1.1629908668
 [41] -0.0913616052  0.0851022938  0.5325478653  0.7993778343 -1.3683926341
 [46] -0.3289240751  0.2209131949 -0.2011274863  0.6083642386  0.7334493281
 [51]  0.5019528131 -0.5448227852 -1.1378718103 -0.4099045359  0.7505552651
 [56]  1.4909670359  0.3379944859  0.6137771621  2.0001755508 -0.6100454435
 [61]  1.1452311387 -2.8031460791 -0.9060632975  0.6126065861 -0.9805280373
 [66] -0.4281189996 -0.0864262631 -0.1136822156  0.8959317801  0.1867256202
 [71]  0.4323298331  1.2818663206 -0.0427584429  0.5933321224  1.1187788056
 [76] -1.0645828524  1.2545219740 -2.2697188162 -0.2051499239  0.6245556037
 [81] -1.7200888356  0.5336036988 -0.1492399864  1.2675793515 -0.2783737338
 [86] -1.1244615870  0.0236820450 -1.9508420368 -0.0258493193 -0.9531214337
 [91]  1.1567700287 -0.8539690846 -0.5083097560  1.1318598517  0.5140493063
 [96]  0.0006534511 -1.1633965475  0.7739636140  0.8967290003 -0.5777715574
> colMin(tmp)
  [1]  1.3786890177  1.8725307430 -0.3921778157 -2.1213438634 -0.1619436448
  [6] -0.4510178012 -0.6699385463  0.9256011401 -1.0467502059  0.7558970351
 [11] -0.3129864921  0.6250091197 -2.0428484589 -0.2237117738  0.1281904808
 [16] -0.0211852336 -0.8985870192  0.2319887938 -0.5360861648 -2.7895971221
 [21] -0.3197517193 -0.5383213657  0.1417335223 -1.5100739739  0.2137392514
 [26]  0.1487327908 -1.7194878915 -1.2516648920 -1.1568129843  0.7980311127
 [31]  1.5217487864 -0.4271125391  1.8633771046 -0.7979507432 -0.3897861020
 [36]  1.0537619641 -1.3607025468 -0.2141253095  0.5996440510  1.1629908668
 [41] -0.0913616052  0.0851022938  0.5325478653  0.7993778343 -1.3683926341
 [46] -0.3289240751  0.2209131949 -0.2011274863  0.6083642386  0.7334493281
 [51]  0.5019528131 -0.5448227852 -1.1378718103 -0.4099045359  0.7505552651
 [56]  1.4909670359  0.3379944859  0.6137771621  2.0001755508 -0.6100454435
 [61]  1.1452311387 -2.8031460791 -0.9060632975  0.6126065861 -0.9805280373
 [66] -0.4281189996 -0.0864262631 -0.1136822156  0.8959317801  0.1867256202
 [71]  0.4323298331  1.2818663206 -0.0427584429  0.5933321224  1.1187788056
 [76] -1.0645828524  1.2545219740 -2.2697188162 -0.2051499239  0.6245556037
 [81] -1.7200888356  0.5336036988 -0.1492399864  1.2675793515 -0.2783737338
 [86] -1.1244615870  0.0236820450 -1.9508420368 -0.0258493193 -0.9531214337
 [91]  1.1567700287 -0.8539690846 -0.5083097560  1.1318598517  0.5140493063
 [96]  0.0006534511 -1.1633965475  0.7739636140  0.8967290003 -0.5777715574
> colMedians(tmp)
  [1]  1.3786890177  1.8725307430 -0.3921778157 -2.1213438634 -0.1619436448
  [6] -0.4510178012 -0.6699385463  0.9256011401 -1.0467502059  0.7558970351
 [11] -0.3129864921  0.6250091197 -2.0428484589 -0.2237117738  0.1281904808
 [16] -0.0211852336 -0.8985870192  0.2319887938 -0.5360861648 -2.7895971221
 [21] -0.3197517193 -0.5383213657  0.1417335223 -1.5100739739  0.2137392514
 [26]  0.1487327908 -1.7194878915 -1.2516648920 -1.1568129843  0.7980311127
 [31]  1.5217487864 -0.4271125391  1.8633771046 -0.7979507432 -0.3897861020
 [36]  1.0537619641 -1.3607025468 -0.2141253095  0.5996440510  1.1629908668
 [41] -0.0913616052  0.0851022938  0.5325478653  0.7993778343 -1.3683926341
 [46] -0.3289240751  0.2209131949 -0.2011274863  0.6083642386  0.7334493281
 [51]  0.5019528131 -0.5448227852 -1.1378718103 -0.4099045359  0.7505552651
 [56]  1.4909670359  0.3379944859  0.6137771621  2.0001755508 -0.6100454435
 [61]  1.1452311387 -2.8031460791 -0.9060632975  0.6126065861 -0.9805280373
 [66] -0.4281189996 -0.0864262631 -0.1136822156  0.8959317801  0.1867256202
 [71]  0.4323298331  1.2818663206 -0.0427584429  0.5933321224  1.1187788056
 [76] -1.0645828524  1.2545219740 -2.2697188162 -0.2051499239  0.6245556037
 [81] -1.7200888356  0.5336036988 -0.1492399864  1.2675793515 -0.2783737338
 [86] -1.1244615870  0.0236820450 -1.9508420368 -0.0258493193 -0.9531214337
 [91]  1.1567700287 -0.8539690846 -0.5083097560  1.1318598517  0.5140493063
 [96]  0.0006534511 -1.1633965475  0.7739636140  0.8967290003 -0.5777715574
> colRanges(tmp)
         [,1]     [,2]       [,3]      [,4]       [,5]       [,6]       [,7]
[1,] 1.378689 1.872531 -0.3921778 -2.121344 -0.1619436 -0.4510178 -0.6699385
[2,] 1.378689 1.872531 -0.3921778 -2.121344 -0.1619436 -0.4510178 -0.6699385
          [,8]     [,9]    [,10]      [,11]     [,12]     [,13]      [,14]
[1,] 0.9256011 -1.04675 0.755897 -0.3129865 0.6250091 -2.042848 -0.2237118
[2,] 0.9256011 -1.04675 0.755897 -0.3129865 0.6250091 -2.042848 -0.2237118
         [,15]       [,16]     [,17]     [,18]      [,19]     [,20]      [,21]
[1,] 0.1281905 -0.02118523 -0.898587 0.2319888 -0.5360862 -2.789597 -0.3197517
[2,] 0.1281905 -0.02118523 -0.898587 0.2319888 -0.5360862 -2.789597 -0.3197517
          [,22]     [,23]     [,24]     [,25]     [,26]     [,27]     [,28]
[1,] -0.5383214 0.1417335 -1.510074 0.2137393 0.1487328 -1.719488 -1.251665
[2,] -0.5383214 0.1417335 -1.510074 0.2137393 0.1487328 -1.719488 -1.251665
         [,29]     [,30]    [,31]      [,32]    [,33]      [,34]      [,35]
[1,] -1.156813 0.7980311 1.521749 -0.4271125 1.863377 -0.7979507 -0.3897861
[2,] -1.156813 0.7980311 1.521749 -0.4271125 1.863377 -0.7979507 -0.3897861
        [,36]     [,37]      [,38]     [,39]    [,40]       [,41]      [,42]
[1,] 1.053762 -1.360703 -0.2141253 0.5996441 1.162991 -0.09136161 0.08510229
[2,] 1.053762 -1.360703 -0.2141253 0.5996441 1.162991 -0.09136161 0.08510229
         [,43]     [,44]     [,45]      [,46]     [,47]      [,48]     [,49]
[1,] 0.5325479 0.7993778 -1.368393 -0.3289241 0.2209132 -0.2011275 0.6083642
[2,] 0.5325479 0.7993778 -1.368393 -0.3289241 0.2209132 -0.2011275 0.6083642
         [,50]     [,51]      [,52]     [,53]      [,54]     [,55]    [,56]
[1,] 0.7334493 0.5019528 -0.5448228 -1.137872 -0.4099045 0.7505553 1.490967
[2,] 0.7334493 0.5019528 -0.5448228 -1.137872 -0.4099045 0.7505553 1.490967
         [,57]     [,58]    [,59]      [,60]    [,61]     [,62]      [,63]
[1,] 0.3379945 0.6137772 2.000176 -0.6100454 1.145231 -2.803146 -0.9060633
[2,] 0.3379945 0.6137772 2.000176 -0.6100454 1.145231 -2.803146 -0.9060633
         [,64]     [,65]     [,66]       [,67]      [,68]     [,69]     [,70]
[1,] 0.6126066 -0.980528 -0.428119 -0.08642626 -0.1136822 0.8959318 0.1867256
[2,] 0.6126066 -0.980528 -0.428119 -0.08642626 -0.1136822 0.8959318 0.1867256
         [,71]    [,72]       [,73]     [,74]    [,75]     [,76]    [,77]
[1,] 0.4323298 1.281866 -0.04275844 0.5933321 1.118779 -1.064583 1.254522
[2,] 0.4323298 1.281866 -0.04275844 0.5933321 1.118779 -1.064583 1.254522
         [,78]      [,79]     [,80]     [,81]     [,82]    [,83]    [,84]
[1,] -2.269719 -0.2051499 0.6245556 -1.720089 0.5336037 -0.14924 1.267579
[2,] -2.269719 -0.2051499 0.6245556 -1.720089 0.5336037 -0.14924 1.267579
          [,85]     [,86]      [,87]     [,88]       [,89]      [,90]   [,91]
[1,] -0.2783737 -1.124462 0.02368204 -1.950842 -0.02584932 -0.9531214 1.15677
[2,] -0.2783737 -1.124462 0.02368204 -1.950842 -0.02584932 -0.9531214 1.15677
          [,92]      [,93]   [,94]     [,95]        [,96]     [,97]     [,98]
[1,] -0.8539691 -0.5083098 1.13186 0.5140493 0.0006534511 -1.163397 0.7739636
[2,] -0.8539691 -0.5083098 1.13186 0.5140493 0.0006534511 -1.163397 0.7739636
        [,99]     [,100]
[1,] 0.896729 -0.5777716
[2,] 0.896729 -0.5777716
> 
> 
> Max(tmp2)
[1] 1.68897
> Min(tmp2)
[1] -2.716259
> mean(tmp2)
[1] -0.04312793
> Sum(tmp2)
[1] -4.312793
> Var(tmp2)
[1] 0.9068638
> 
> rowMeans(tmp2)
  [1] -0.319735220  0.418654415 -0.496887477 -0.204520910  1.224667612
  [6]  0.068415704 -2.716258876  0.628221220  0.677208607  0.206703167
 [11]  0.318662070  0.671724696  0.092985788 -0.953404451  0.809072089
 [16]  0.266546686  1.006942815  0.825579554 -0.330360761 -0.024654932
 [21]  0.391346373 -0.773604813  1.688970164  0.387169364 -0.686914032
 [26] -0.329115851  1.355365115  1.361644156 -0.263909591  0.426341474
 [31]  0.080022386 -1.389755870  0.473423523  1.606961875  0.521674109
 [36] -1.233676997  0.016411361  1.620980176  1.033480111  0.317284744
 [41]  0.095368223  0.736329710 -0.950078435  0.459834148 -1.946803749
 [46] -0.266357599 -0.108111346  0.880620703  1.109089110 -0.339254406
 [51] -0.393490366 -0.170621620  0.646575170  1.478847637  0.501792543
 [56]  0.006241987 -1.743473405 -0.769122690 -0.846741391 -0.442645211
 [61]  0.162474072  0.925468664  0.931774011  1.119679366 -1.704223956
 [66]  0.316489562 -1.933390298 -0.798124422 -0.880676546 -2.166876364
 [71]  0.412720417  0.151818484 -0.533222137  0.536724929  0.549194179
 [76]  0.337076217  1.654474073  0.468788432 -0.291189296 -1.107053629
 [81]  0.633369359 -0.266401378 -1.649576367  0.402447897 -1.063486593
 [86] -0.069098349  0.136426821 -1.934010275  0.719206858  1.448393561
 [91] -0.050598870 -0.069202151 -1.111500307 -1.093896846 -1.651953925
 [96] -1.765581011 -0.841519007  0.131097530 -0.555716422 -0.524777795
> rowSums(tmp2)
  [1] -0.319735220  0.418654415 -0.496887477 -0.204520910  1.224667612
  [6]  0.068415704 -2.716258876  0.628221220  0.677208607  0.206703167
 [11]  0.318662070  0.671724696  0.092985788 -0.953404451  0.809072089
 [16]  0.266546686  1.006942815  0.825579554 -0.330360761 -0.024654932
 [21]  0.391346373 -0.773604813  1.688970164  0.387169364 -0.686914032
 [26] -0.329115851  1.355365115  1.361644156 -0.263909591  0.426341474
 [31]  0.080022386 -1.389755870  0.473423523  1.606961875  0.521674109
 [36] -1.233676997  0.016411361  1.620980176  1.033480111  0.317284744
 [41]  0.095368223  0.736329710 -0.950078435  0.459834148 -1.946803749
 [46] -0.266357599 -0.108111346  0.880620703  1.109089110 -0.339254406
 [51] -0.393490366 -0.170621620  0.646575170  1.478847637  0.501792543
 [56]  0.006241987 -1.743473405 -0.769122690 -0.846741391 -0.442645211
 [61]  0.162474072  0.925468664  0.931774011  1.119679366 -1.704223956
 [66]  0.316489562 -1.933390298 -0.798124422 -0.880676546 -2.166876364
 [71]  0.412720417  0.151818484 -0.533222137  0.536724929  0.549194179
 [76]  0.337076217  1.654474073  0.468788432 -0.291189296 -1.107053629
 [81]  0.633369359 -0.266401378 -1.649576367  0.402447897 -1.063486593
 [86] -0.069098349  0.136426821 -1.934010275  0.719206858  1.448393561
 [91] -0.050598870 -0.069202151 -1.111500307 -1.093896846 -1.651953925
 [96] -1.765581011 -0.841519007  0.131097530 -0.555716422 -0.524777795
> rowVars(tmp2)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowSd(tmp2)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowMax(tmp2)
  [1] -0.319735220  0.418654415 -0.496887477 -0.204520910  1.224667612
  [6]  0.068415704 -2.716258876  0.628221220  0.677208607  0.206703167
 [11]  0.318662070  0.671724696  0.092985788 -0.953404451  0.809072089
 [16]  0.266546686  1.006942815  0.825579554 -0.330360761 -0.024654932
 [21]  0.391346373 -0.773604813  1.688970164  0.387169364 -0.686914032
 [26] -0.329115851  1.355365115  1.361644156 -0.263909591  0.426341474
 [31]  0.080022386 -1.389755870  0.473423523  1.606961875  0.521674109
 [36] -1.233676997  0.016411361  1.620980176  1.033480111  0.317284744
 [41]  0.095368223  0.736329710 -0.950078435  0.459834148 -1.946803749
 [46] -0.266357599 -0.108111346  0.880620703  1.109089110 -0.339254406
 [51] -0.393490366 -0.170621620  0.646575170  1.478847637  0.501792543
 [56]  0.006241987 -1.743473405 -0.769122690 -0.846741391 -0.442645211
 [61]  0.162474072  0.925468664  0.931774011  1.119679366 -1.704223956
 [66]  0.316489562 -1.933390298 -0.798124422 -0.880676546 -2.166876364
 [71]  0.412720417  0.151818484 -0.533222137  0.536724929  0.549194179
 [76]  0.337076217  1.654474073  0.468788432 -0.291189296 -1.107053629
 [81]  0.633369359 -0.266401378 -1.649576367  0.402447897 -1.063486593
 [86] -0.069098349  0.136426821 -1.934010275  0.719206858  1.448393561
 [91] -0.050598870 -0.069202151 -1.111500307 -1.093896846 -1.651953925
 [96] -1.765581011 -0.841519007  0.131097530 -0.555716422 -0.524777795
> rowMin(tmp2)
  [1] -0.319735220  0.418654415 -0.496887477 -0.204520910  1.224667612
  [6]  0.068415704 -2.716258876  0.628221220  0.677208607  0.206703167
 [11]  0.318662070  0.671724696  0.092985788 -0.953404451  0.809072089
 [16]  0.266546686  1.006942815  0.825579554 -0.330360761 -0.024654932
 [21]  0.391346373 -0.773604813  1.688970164  0.387169364 -0.686914032
 [26] -0.329115851  1.355365115  1.361644156 -0.263909591  0.426341474
 [31]  0.080022386 -1.389755870  0.473423523  1.606961875  0.521674109
 [36] -1.233676997  0.016411361  1.620980176  1.033480111  0.317284744
 [41]  0.095368223  0.736329710 -0.950078435  0.459834148 -1.946803749
 [46] -0.266357599 -0.108111346  0.880620703  1.109089110 -0.339254406
 [51] -0.393490366 -0.170621620  0.646575170  1.478847637  0.501792543
 [56]  0.006241987 -1.743473405 -0.769122690 -0.846741391 -0.442645211
 [61]  0.162474072  0.925468664  0.931774011  1.119679366 -1.704223956
 [66]  0.316489562 -1.933390298 -0.798124422 -0.880676546 -2.166876364
 [71]  0.412720417  0.151818484 -0.533222137  0.536724929  0.549194179
 [76]  0.337076217  1.654474073  0.468788432 -0.291189296 -1.107053629
 [81]  0.633369359 -0.266401378 -1.649576367  0.402447897 -1.063486593
 [86] -0.069098349  0.136426821 -1.934010275  0.719206858  1.448393561
 [91] -0.050598870 -0.069202151 -1.111500307 -1.093896846 -1.651953925
 [96] -1.765581011 -0.841519007  0.131097530 -0.555716422 -0.524777795
> 
> colMeans(tmp2)
[1] -0.04312793
> colSums(tmp2)
[1] -4.312793
> colVars(tmp2)
[1] 0.9068638
> colSd(tmp2)
[1] 0.9522939
> colMax(tmp2)
[1] 1.68897
> colMin(tmp2)
[1] -2.716259
> colMedians(tmp2)
[1] 0.08650409
> colRanges(tmp2)
          [,1]
[1,] -2.716259
[2,]  1.688970
> 
> 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]  0.2776892  2.3515205 -3.9533318 -2.1788170  1.7006744 -2.1178716
 [7]  5.5329797  1.6801682  5.6361282  2.0171056
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -0.8438014
[2,] -0.4752567
[3,] -0.3359439
[4,]  0.5145242
[5,]  1.6047411
> 
> rowApply(tmp,sum)
 [1]  1.4026852 -3.9766624 -0.6671985 -2.2524281  2.3895009  0.3220451
 [7]  3.2668475  3.7716437  1.8904357  4.7993765
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    6    6    2    4    4    9    3   10    2     3
 [2,]    8    1    7   10    2    6    6    9    5     4
 [3,]    1    5    3    1    3    8    1    7    6     5
 [4,]    4   10    4    3    1    3    2    5   10     2
 [5,]    5    8    5    6    7    5   10    6    8     1
 [6,]    2    4    1    7    5    2    9    2    4     8
 [7,]    3    3   10    9    9   10    8    3    7     7
 [8,]    9    2    8    8    6    1    4    1    9    10
 [9,]   10    7    9    2   10    4    7    8    1     9
[10,]    7    9    6    5    8    7    5    4    3     6
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1] -1.9862433 -0.5623318  3.4370897  4.0189649 -0.7404882 -0.3189150
 [7]  0.5658071  1.1442698 -0.8400356  5.0701133 -1.3936573  1.1758592
[13]  0.8745843  3.7271823 -5.2372529  1.5214314  1.4355262  4.1760295
[19]  3.3207114  1.6396021
> colApply(tmp,quantile)[,1]
            [,1]
[1,] -2.05958301
[2,] -0.29790968
[3,]  0.05012199
[4,]  0.06144508
[5,]  0.25968229
> 
> rowApply(tmp,sum)
[1] 4.746284 1.772098 6.436651 6.259845 1.813369
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]    9    9    1    7   13
[2,]    3    8   13    3   16
[3,]   17    7   11   20    5
[4,]    4   20   15   19   12
[5,]    1    6   20    8    2
> 
> 
> as.matrix(tmp)
            [,1]        [,2]       [,3]        [,4]         [,5]        [,6]
[1,]  0.25968229 -1.22067814  1.3635558 -0.73408026 -1.686630299 -0.09901991
[2,]  0.05012199  0.03038724 -0.3089746  1.61679164 -0.435627155  0.88430001
[3,] -2.05958301  0.77152176  0.4357122  1.06812349  2.171857688  0.32100318
[4,] -0.29790968 -0.81047542  2.3824236  2.12897498 -0.008296918 -0.87222044
[5,]  0.06144508  0.66691272 -0.4356274 -0.06084492 -0.781791472 -0.55297785
            [,7]       [,8]       [,9]     [,10]       [,11]      [,12]
[1,]  0.47381261  1.5445591 -1.3575541 0.8267502 -0.56947500  1.8463754
[2,] -2.39703741  0.7593948 -0.9895651 0.8573973  0.82565906  0.5346293
[3,]  0.03693386 -0.8810955  0.2675906 1.2728120  0.07945049 -0.4760153
[4,]  1.08780721  0.2893369  1.5545713 1.4532979 -0.30221248 -0.5359060
[5,]  1.36429081 -0.5679256 -0.3150784 0.6598558 -1.42707939 -0.1932242
          [,13]     [,14]      [,15]      [,16]      [,17]     [,18]      [,19]
[1,] -0.4317021 1.4983195  0.3506135  0.7013173  1.0575391 0.8590248  0.5899095
[2,] -1.0358176 1.1100662 -2.0795338  0.3309180 -1.1991617 1.2513960  1.3634436
[3,]  1.4261114 0.7468806 -1.6294299 -0.1751782  1.2052456 0.8804362  1.1148529
[4,] -0.7342795 0.1445374 -1.7446014  0.9684939  0.5895084 0.1439126  0.6585415
[5,]  1.6502721 0.2273785 -0.1343013 -0.3041197 -0.2176053 1.0412598 -0.4060361
          [,20]
[1,] -0.5260356
[2,]  0.6033105
[3,] -0.1405793
[4,]  0.1643408
[5,]  1.5385656
> 
> 
> is.BufferedMatrix(tmp)
[1] TRUE
> 
> as.BufferedMatrix(as.matrix(tmp))
BufferedMatrix object
Matrix size:  5 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  800  bytes.
> 
> 
> 
> subBufferedMatrix(tmp,1:5,1:5)
BufferedMatrix object
Matrix size:  5 5 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  655  bytes.
Disk usage :  200  bytes.
> subBufferedMatrix(tmp,,5:8)
BufferedMatrix object
Matrix size:  5 4 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  565  bytes.
Disk usage :  160  bytes.
> subBufferedMatrix(tmp,1:3,)
BufferedMatrix object
Matrix size:  3 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  480  bytes.
> 
> 
> rm(tmp)
> 
> 
> ###
> ### Testing colnames and rownames
> ###
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> 
> 
> colnames(tmp)
NULL
> rownames(tmp)
NULL
> 
> 
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> colnames(tmp)
 [1] "col1"  "col2"  "col3"  "col4"  "col5"  "col6"  "col7"  "col8"  "col9" 
[10] "col10" "col11" "col12" "col13" "col14" "col15" "col16" "col17" "col18"
[19] "col19" "col20"
> rownames(tmp)
[1] "row1" "row2" "row3" "row4" "row5"
> 
> 
> tmp["row1",]
         col1      col2      col3       col4      col5       col6      col7
row1 1.508614 0.1030961 -1.825447 -0.8141932 -1.415414 -0.8298429 0.5244453
         col8     col9    col10      col11    col12     col13    col14
row1 1.222956 1.581396 1.231962 -0.5116294 1.045862 0.7279804 -1.56136
          col15     col16      col17     col18     col19     col20
row1 -0.6802379 -1.561992 0.04562171 0.5538328 0.1396905 0.6881067
> tmp[,"col10"]
          col10
row1  1.2319623
row2  0.4036945
row3 -0.8477034
row4  1.6756424
row5  0.7273867
> tmp[c("row1","row5"),]
          col1      col2      col3       col4       col5       col6      col7
row1  1.508614 0.1030961 -1.825447 -0.8141932 -1.4154139 -0.8298429 0.5244453
row5 -1.070638 2.2883839 -0.505168  0.4445116  0.1471005 -0.2828860 1.6801002
         col8       col9     col10      col11      col12      col13      col14
row1 1.222956  1.5813963 1.2319623 -0.5116294  1.0458623  0.7279804 -1.5613599
row5 1.274876 -0.3304029 0.7273867 -2.3444612 -0.8014333 -1.7468185 -0.9076491
          col15     col16      col17     col18      col19     col20
row1 -0.6802379 -1.561992 0.04562171 0.5538328  0.1396905 0.6881067
row5 -2.4409695  1.088378 0.12687050 1.7959023 -0.8692399 0.2057218
> tmp[,c("col6","col20")]
            col6      col20
row1 -0.82984287  0.6881067
row2  0.08463126 -0.3087404
row3  0.45064632  0.6995727
row4  0.43437638 -1.3517067
row5 -0.28288600  0.2057218
> tmp[c("row1","row5"),c("col6","col20")]
           col6     col20
row1 -0.8298429 0.6881067
row5 -0.2828860 0.2057218
> 
> 
> 
> 
> 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 52.41735 49.73423 49.31513 49.85867 50.29232 103.9246 49.78368 49.80203
         col9    col10    col11    col12    col13    col14    col15   col16
row1 51.66016 49.41134 50.35758 49.42957 50.25178 50.81186 48.85473 51.9175
        col17    col18    col19    col20
row1 51.40701 49.29607 49.92546 105.2377
> tmp[,"col10"]
        col10
row1 49.41134
row2 29.58942
row3 30.36471
row4 27.22378
row5 49.56894
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 52.41735 49.73423 49.31513 49.85867 50.29232 103.9246 49.78368 49.80203
row5 50.86983 48.18892 49.97584 50.79579 48.30807 102.0098 49.82475 52.16179
         col9    col10    col11    col12    col13    col14    col15    col16
row1 51.66016 49.41134 50.35758 49.42957 50.25178 50.81186 48.85473 51.91750
row5 50.91639 49.56894 49.82666 50.36584 49.92412 50.04708 49.62806 48.33733
        col17    col18    col19    col20
row1 51.40701 49.29607 49.92546 105.2377
row5 51.95326 50.09711 49.59898 105.8252
> tmp[,c("col6","col20")]
          col6     col20
row1 103.92455 105.23775
row2  74.32994  74.72397
row3  73.87529  74.13883
row4  76.54249  74.52527
row5 102.00977 105.82516
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 103.9246 105.2377
row5 102.0098 105.8252
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 103.9246 105.2377
row5 102.0098 105.8252
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
         col13
[1,] 0.7676317
[2,] 0.7070225
[3,] 0.2753674
[4,] 0.1302856
[5,] 1.0530048
> tmp[,c("col17","col7")]
          col17       col7
[1,] -2.2444939  1.3262847
[2,]  0.8272759 -1.3697151
[3,]  0.1246638  0.5208886
[4,] -0.5526798 -0.1331786
[5,] -0.1537687  1.3663920
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
           col6      col20
[1,]  0.4855981  0.2300065
[2,] -1.7547542  1.3412385
[3,] -0.4559814  0.4723153
[4,] -2.1935195  1.2817778
[5,]  0.3432001 -0.7089019
> subBufferedMatrix(tmp,1,c("col6"))[,1]
          col1
[1,] 0.4855981
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
           col6
[1,]  0.4855981
[2,] -1.7547542
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> 
> 
> 
> subBufferedMatrix(tmp,c("row3","row1"),)[,1:20]
           [,1]       [,2]       [,3]       [,4]      [,5]      [,6]      [,7]
row3  0.5423135 -0.9461761  1.8958207  1.2473325 0.2422181  1.699365 1.8039121
row1 -0.6311675  0.8992552 -0.4440485 -0.8320124 0.3898944 -1.681252 0.7221386
          [,8]       [,9]     [,10]      [,11]      [,12]      [,13]      [,14]
row3 -1.090892 -0.8410418 -1.155481  0.7256745 -1.6634507  0.3693888 -0.9287949
row1 -1.535923  1.2298581  2.667963 -1.6739743  0.4065139 -1.9398092  1.2798959
          [,15]     [,16]      [,17]      [,18]     [,19]     [,20]
row3  2.5218938 0.8630465 -0.6066056  0.6361333 1.0572751 0.9216200
row1 -0.3029602 0.0603353 -0.8968403 -0.9324005 0.2682666 0.1061076
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
         [,1]      [,2]       [,3]     [,4]      [,5]      [,6]      [,7]
row2 -2.30846 0.7493087 -0.4376324 1.157499 -1.388094 -1.046154 -2.153563
         [,8]      [,9]     [,10]
row2 1.675165 0.4468554 -1.459784
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
           [,1]      [,2]      [,3]      [,4]     [,5]        [,6]      [,7]
row5 -0.6886257 -1.106123 -1.181367 0.5433356 1.404144 -0.07018226 0.7342028
           [,8]      [,9]      [,10]     [,11]     [,12]    [,13]     [,14]
row5 -0.8754357 -2.038122 -0.4106552 -1.124286 0.5528438 1.127444 0.1618548
          [,15]     [,16]     [,17]     [,18]     [,19]      [,20]
row5 -0.3469708 -0.239986 -1.315981 0.7440951 0.2218815 0.05019753
> 
> 
> 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: 0x600001e98240>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM1675a3350329b"
 [2] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM1675a562a786e"
 [3] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM1675a7e48a9f3"
 [4] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM1675a548dd14a"
 [5] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM1675a2aa77ca4"
 [6] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM1675a59e808dc"
 [7] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM1675a109dd1a1"
 [8] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM1675a692da98c"
 [9] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM1675a34d65c46"
[10] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM1675a654412c3"
[11] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM1675a582bf425"
[12] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM1675a2da9d65c"
[13] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM1675a6938496f"
[14] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM1675a6e5d4c60"
[15] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM1675a2f416b3b"
> 
> 
> ### 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: 0x600001e9c360>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x600001e9c360>
Warning message:
In dir.create(new.directory) :
  '/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x600001e9c360>
> rowMedians(tmp)
  [1]  5.609813e-03  4.683146e-01 -3.534943e-01  7.347045e-02  5.738536e-01
  [6] -3.699313e-01  1.839480e-01 -1.431220e-01 -1.081819e-01 -5.949811e-01
 [11]  3.189802e-01 -1.974214e-01 -3.050131e-01  2.053821e-01  5.367521e-03
 [16] -2.931159e-01  1.872894e-01  2.386491e-01 -8.663741e-01 -2.439150e-01
 [21]  1.766192e-01  1.190719e-01 -2.751320e-01 -1.606341e-01  1.272599e-01
 [26] -7.003901e-01  1.313638e-01  4.780114e-01  2.091577e-01 -3.385928e-02
 [31] -2.744178e-02  1.686945e-01 -2.000826e-01  1.557657e-01 -1.788178e-02
 [36] -3.907677e-01  4.109249e-01 -1.226066e-01  2.354266e-01 -2.171253e-02
 [41]  3.709545e-02 -5.844089e-01  2.708350e-03 -1.832759e-01  1.383790e-01
 [46]  2.407698e-01  2.132010e-01  5.795934e-01 -4.323857e-01 -1.754009e-01
 [51] -9.931905e-02  8.009665e-01  5.025878e-01 -2.807147e-02  1.849991e-01
 [56] -2.163908e-01  4.057743e-01 -3.290788e-01  3.502764e-01  1.008198e-01
 [61] -7.159544e-01  4.150298e-01  2.106435e-01 -3.751358e-01 -4.780225e-02
 [66]  3.019222e-01 -2.106875e-01  4.774662e-01 -1.560974e-01  4.362659e-01
 [71]  5.619344e-01 -4.767743e-01 -1.110469e-01  1.322407e-01 -5.470401e-01
 [76]  1.547931e-01  4.546808e-02 -1.158782e-01 -3.805596e-03 -5.187389e-02
 [81]  2.469205e-01 -1.510033e-01  4.242293e-01  1.008951e-01 -6.205037e-01
 [86] -1.651009e-01  3.379535e-02 -2.201579e-01  1.609646e-01  4.589557e-01
 [91]  3.175785e-01 -1.399358e-01  2.051104e-01  1.470616e-01  1.028259e-02
 [96]  2.760727e-01  1.471593e-01 -1.302868e-01  5.811882e-02 -4.891921e-01
[101] -2.308092e-01  1.210032e-01 -4.257086e-01  5.526209e-01  1.555280e-04
[106] -1.554664e-01 -3.830619e-02  3.163847e-03 -7.964077e-02 -5.020799e-01
[111]  2.410308e-01 -1.803069e-01  5.009058e-01 -1.947808e-01  6.340195e-02
[116]  2.854923e-01 -5.122548e-01 -1.889110e-01 -2.436122e-01  2.731705e-01
[121]  4.761594e-01 -8.219631e-01  4.302769e-01  3.193384e-01 -1.805633e-01
[126] -4.194987e-01  7.058658e-03  1.976129e-01 -1.267063e-01  1.173301e-01
[131]  2.008661e-01  4.484038e-01 -3.249720e-02  4.287093e-01  5.307598e-01
[136]  1.477048e-03  4.475830e-02  6.451036e-01  1.605835e-01  3.261747e-01
[141]  4.659357e-01  3.805276e-02  1.211170e-02 -2.938640e-01  3.098403e-01
[146]  7.985598e-02  1.619994e-01 -4.609226e-01 -2.113510e-02 -3.633489e-01
[151] -2.017599e-01  7.779958e-02  4.988984e-01 -1.534901e-01  1.024386e-02
[156] -1.910156e-01  4.913351e-02  3.108258e-02  2.235128e-02  3.003329e-01
[161]  4.314318e-01 -1.557990e-01  9.127393e-02 -1.777262e-01 -2.628618e-01
[166] -1.037123e-01  3.737634e-01 -2.557882e-02  9.674434e-02  4.064030e-01
[171] -1.316567e-02 -1.188477e-01 -2.171752e-01  6.493546e-03 -9.483416e-02
[176] -3.632134e-01 -1.872171e-02 -2.240749e-01 -2.195324e-01  1.196487e-01
[181] -2.988321e-01  1.701951e-01 -3.380518e-01 -3.557539e-01  6.542758e-02
[186]  3.409734e-01 -3.766564e-01  2.220831e-01 -3.869482e-02  2.189042e-02
[191] -8.921066e-02 -2.645990e-01  1.033695e+00 -3.432739e-01  3.982259e-01
[196] -2.196775e-01 -5.999315e-01 -3.229775e-01  2.334169e-01 -1.717136e-01
[201]  2.275570e-03 -5.096761e-01  2.003986e-01  3.532284e-01 -3.871698e-01
[206] -1.018290e-01  2.323324e-01 -4.828175e-01 -4.863469e-01 -4.367393e-01
[211]  6.095269e-01  2.896509e-01 -1.884716e-01  1.068460e-01 -1.953327e-01
[216]  5.358139e-01 -5.030143e-02 -2.283322e-01 -6.629588e-01 -1.079681e-01
[221]  2.358782e-01  1.834405e-01  5.579471e-01  9.932126e-02 -2.961307e-01
[226] -2.557970e-01  6.816931e-05 -9.141906e-02  4.431814e-01 -5.973332e-01
> 
> proc.time()
   user  system elapsed 
  0.617   2.653   3.448 

BufferedMatrix.Rcheck/tests/rawCalltesting.Rout


R version 4.4.1 (2024-06-14) -- "Race for Your Life"
Copyright (C) 2024 The R Foundation for Statistical Computing
Platform: aarch64-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: 0x6000034000c0>
> .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: 0x6000034000c0>
> .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: 0x6000034000c0>
> .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: 0x6000034000c0>
> 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: 0x60000341c360>
> .Call("R_bm_AddColumn",P)
<pointer: 0x60000341c360>
> .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: 0x60000341c360>
> .Call("R_bm_AddColumn",P)
<pointer: 0x60000341c360>
> .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: 0x60000341c360>
> 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: 0x60000341c540>
> .Call("R_bm_AddColumn",P)
<pointer: 0x60000341c540>
> .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: 0x60000341c540>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x60000341c540>
> .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: 0x60000341c540>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x60000341c540>
> .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: 0x60000341c540>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x60000341c540>
> .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: 0x60000341c540>
> 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: 0x60000341c720>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x60000341c720>
> .Call("R_bm_AddColumn",P)
<pointer: 0x60000341c720>
> .Call("R_bm_AddColumn",P)
<pointer: 0x60000341c720>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile1678a5d45b512" "BufferedMatrixFile1678ab72e095" 
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile1678a5d45b512" "BufferedMatrixFile1678ab72e095" 
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x60000341c9c0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x60000341c9c0>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x60000341c9c0>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x60000341c9c0>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x60000341c9c0>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x60000341c9c0>
> .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: 0x60000341cba0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x60000341cba0>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x60000341cba0>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x60000341cba0>
> 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: 0x60000341cd80>
> .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: 0x60000341cd80>
> rm(P)
> 
> proc.time()
   user  system elapsed 
  0.112   0.038   0.147 

BufferedMatrix.Rcheck/tests/Rcodetesting.Rout


R version 4.4.1 (2024-06-14) -- "Race for Your Life"
Copyright (C) 2024 The R Foundation for Statistical Computing
Platform: aarch64-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.113   0.025   0.133 

Example timings