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

This page was generated on 2024-09-27 12:29 -0400 (Fri, 27 Sep 2024).

HostnameOSArch (*)R versionInstalled pkgs
teran2Linux (Ubuntu 24.04.1 LTS)x86_644.4.1 (2024-06-14) -- "Race for Your Life" 4451
nebbiolo2Linux (Ubuntu 22.04.3 LTS)x86_644.4.1 (2024-06-14) -- "Race for Your Life" 4417
palomino8Windows Server 2022 Datacenterx644.4.1 (2024-06-14 ucrt) -- "Race for Your Life" 4456
lconwaymacOS 12.7.1 Montereyx86_644.4.1 (2024-06-14) -- "Race for Your Life" 4489
kjohnson3macOS 13.6.5 Venturaarm644.4.1 (2024-06-14) -- "Race for Your Life" 4436
kunpeng2Linux (openEuler 22.03 LTS-SP1)aarch644.4.1 (2024-06-14) -- "Race for Your Life" 4435
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/2262HostnameOS / ArchINSTALLBUILDCHECKBUILD BIN
BufferedMatrix 1.69.0  (landing page)
Ben Bolstad
Snapshot Date: 2024-09-26 13:40 -0400 (Thu, 26 Sep 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
nebbiolo2Linux (Ubuntu 22.04.3 LTS) / x86_64  OK    OK    OK  
palomino8Windows Server 2022 Datacenter / x64  OK    OK    OK    OK  UNNEEDED, same version is already published
lconwaymacOS 12.7.1 Monterey / x86_64  OK    OK    WARNINGS    OK  UNNEEDED, same version is already published
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 lconway

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

raw results


Summary

Package: BufferedMatrix
Version: 1.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-09-26 19:40:04 -0400 (Thu, 26 Sep 2024)
EndedAt: 2024-09-26 19:40:55 -0400 (Thu, 26 Sep 2024)
EllapsedTime: 51.7 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: x86_64-apple-darwin20
* R was compiled by
    Apple clang version 14.0.0 (clang-1400.0.29.202)
    GNU Fortran (GCC) 12.2.0
* running under: macOS Monterey 12.7.1
* using session charset: UTF-8
* using option ‘--no-vignettes’
* checking for file ‘BufferedMatrix/DESCRIPTION’ ... OK
* this is package ‘BufferedMatrix’ version ‘1.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 14.0.0 (clang-1400.0.29.202)’
* used SDK: ‘MacOSX11.3.sdk’
* checking installed package size ... OK
* checking package directory ... OK
* checking ‘build’ directory ... OK
* checking DESCRIPTION meta-information ... OK
* checking top-level files ... OK
* checking for left-over files ... OK
* checking index information ... OK
* checking package subdirectories ... OK
* checking code files for non-ASCII characters ... OK
* checking R files for syntax errors ... OK
* checking whether the package can be loaded ... OK
* checking whether the package can be loaded with stated dependencies ... OK
* checking whether the package can be unloaded cleanly ... OK
* checking whether the namespace can be loaded with stated dependencies ... OK
* checking whether the namespace can be unloaded cleanly ... OK
* checking dependencies in R code ... OK
* checking S3 generic/method consistency ... OK
* checking replacement functions ... OK
* checking foreign function calls ... OK
* checking R code for possible problems ... OK
* checking Rd files ... NOTE
checkRd: (-1) BufferedMatrix-class.Rd:209: Lost braces; missing escapes or markup?
   209 |     $x^{power}$ elementwise of the matrix
       |        ^
prepare_Rd: createBufferedMatrix.Rd:26: Dropping empty section \keyword
prepare_Rd: createBufferedMatrix.Rd:17-18: Dropping empty section \details
prepare_Rd: createBufferedMatrix.Rd:15-16: Dropping empty section \value
prepare_Rd: createBufferedMatrix.Rd:19-20: Dropping empty section \references
prepare_Rd: createBufferedMatrix.Rd:21-22: Dropping empty section \seealso
prepare_Rd: createBufferedMatrix.Rd:23-24: Dropping empty section \examples
* checking Rd metadata ... OK
* checking Rd cross-references ... OK
* checking for missing documentation entries ... OK
* checking for code/documentation mismatches ... OK
* checking Rd \usage sections ... OK
* checking Rd contents ... OK
* checking for unstated dependencies in examples ... OK
* checking line endings in C/C++/Fortran sources/headers ... OK
* checking compiled code ... NOTE
Note: information on .o files is not available
* checking sizes of PDF files under ‘inst/doc’ ... OK
* checking files in ‘vignettes’ ... OK
* checking examples ... NONE
* checking for unstated dependencies in ‘tests’ ... OK
* checking tests ...
  Running ‘Rcodetesting.R’
  Running ‘c_code_level_tests.R’
  Running ‘objectTesting.R’
  Running ‘rawCalltesting.R’
 OK
* checking for unstated dependencies in vignettes ... OK
* checking package vignettes ... OK
* checking running R code from vignettes ... SKIPPED
* checking re-building of vignette outputs ... SKIPPED
* checking PDF version of manual ... OK
* DONE

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


Installation output

BufferedMatrix.Rcheck/00install.out

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


* installing to library ‘/Library/Frameworks/R.framework/Versions/4.4-x86_64/Resources/library’
* installing *source* package ‘BufferedMatrix’ ...
** using staged installation
** libs
using C compiler: ‘Apple clang version 14.0.0 (clang-1400.0.29.202)’
using SDK: ‘MacOSX11.3.sdk’
clang -arch x86_64 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/opt/R/x86_64/include    -fPIC  -falign-functions=64 -Wall -g -O2  -c RBufferedMatrix.c -o RBufferedMatrix.o
clang -arch x86_64 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/opt/R/x86_64/include    -fPIC  -falign-functions=64 -Wall -g -O2  -c doubleBufferedMatrix.c -o doubleBufferedMatrix.o
doubleBufferedMatrix.c:1580:7: warning: logical not is only applied to the left hand side of this bitwise operator [-Wlogical-not-parentheses]
  if (!(Matrix->readonly) & setting){
      ^                   ~
doubleBufferedMatrix.c:1580:7: note: add parentheses after the '!' to evaluate the bitwise operator first
  if (!(Matrix->readonly) & setting){
      ^
       (                           )
doubleBufferedMatrix.c:1580:7: note: add parentheses around left hand side expression to silence this warning
  if (!(Matrix->readonly) & setting){
      ^
      (                  )
doubleBufferedMatrix.c:3327:12: warning: unused function 'sort_double' [-Wunused-function]
static int sort_double(const double *a1,const double *a2){
           ^
2 warnings generated.
clang -arch x86_64 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/opt/R/x86_64/include    -fPIC  -falign-functions=64 -Wall -g -O2  -c doubleBufferedMatrix_C_tests.c -o doubleBufferedMatrix_C_tests.o
clang -arch x86_64 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/opt/R/x86_64/include    -fPIC  -falign-functions=64 -Wall -g -O2  -c init_package.c -o init_package.o
clang -arch x86_64 -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -L/Library/Frameworks/R.framework/Resources/lib -L/opt/R/x86_64/lib -o BufferedMatrix.so RBufferedMatrix.o doubleBufferedMatrix.o doubleBufferedMatrix_C_tests.o init_package.o -F/Library/Frameworks/R.framework/.. -framework R -Wl,-framework -Wl,CoreFoundation
installing to /Library/Frameworks/R.framework/Versions/4.4-x86_64/Resources/library/00LOCK-BufferedMatrix/00new/BufferedMatrix/libs
** R
** inst
** byte-compile and prepare package for lazy loading
Creating a new generic function for ‘rowMeans’ in package ‘BufferedMatrix’
Creating a new generic function for ‘rowSums’ in package ‘BufferedMatrix’
Creating a new generic function for ‘colMeans’ in package ‘BufferedMatrix’
Creating a new generic function for ‘colSums’ in package ‘BufferedMatrix’
Creating a generic function for ‘ncol’ from package ‘base’ in package ‘BufferedMatrix’
Creating a generic function for ‘nrow’ from package ‘base’ in package ‘BufferedMatrix’
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
** checking absolute paths in shared objects and dynamic libraries
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (BufferedMatrix)

Tests output

BufferedMatrix.Rcheck/tests/c_code_level_tests.Rout


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

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

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

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

> library(BufferedMatrix);library.dynam("BufferedMatrix", "BufferedMatrix", .libPaths());.C("dbm_c_tester",integer(1))

Attaching package: 'BufferedMatrix'

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

    colMeans, colSums, rowMeans, rowSums

Checking dimensions
Rows: 5
Cols: 5
Buffer Rows: 1
Buffer Cols: 1

Assigning Values
0.000000 1.000000 2.000000 3.000000 4.000000 
1.000000 2.000000 3.000000 4.000000 5.000000 
2.000000 3.000000 4.000000 5.000000 6.000000 
3.000000 4.000000 5.000000 6.000000 7.000000 
4.000000 5.000000 6.000000 7.000000 8.000000 

Adding Additional Column
Checking dimensions
Rows: 5
Cols: 6
Buffer Rows: 1
Buffer Cols: 1
0.000000 1.000000 2.000000 3.000000 4.000000 0.000000 
1.000000 2.000000 3.000000 4.000000 5.000000 0.000000 
2.000000 3.000000 4.000000 5.000000 6.000000 0.000000 
3.000000 4.000000 5.000000 6.000000 7.000000 0.000000 
4.000000 5.000000 6.000000 7.000000 8.000000 0.000000 

Reassigning values
1.000000 6.000000 11.000000 16.000000 21.000000 26.000000 
2.000000 7.000000 12.000000 17.000000 22.000000 27.000000 
3.000000 8.000000 13.000000 18.000000 23.000000 28.000000 
4.000000 9.000000 14.000000 19.000000 24.000000 29.000000 
5.000000 10.000000 15.000000 20.000000 25.000000 30.000000 

Resizing Buffers
Checking dimensions
Rows: 5
Cols: 6
Buffer Rows: 3
Buffer Cols: 3
1.000000 6.000000 11.000000 16.000000 21.000000 26.000000 
2.000000 7.000000 12.000000 17.000000 22.000000 27.000000 
3.000000 8.000000 13.000000 18.000000 23.000000 28.000000 
4.000000 9.000000 14.000000 19.000000 24.000000 29.000000 
5.000000 10.000000 15.000000 20.000000 25.000000 30.000000 

Activating Row Buffer
In row mode: 1
1.000000 6.000000 11.000000 16.000000 21.000000 26.000000 
2.000000 7.000000 12.000000 17.000000 22.000000 27.000000 
3.000000 8.000000 13.000000 18.000000 23.000000 28.000000 
4.000000 9.000000 14.000000 19.000000 24.000000 29.000000 
5.000000 10.000000 15.000000 20.000000 25.000000 30.000000 

Squaring Last Column
1.000000 6.000000 11.000000 16.000000 21.000000 676.000000 
2.000000 7.000000 12.000000 17.000000 22.000000 729.000000 
3.000000 8.000000 13.000000 18.000000 23.000000 784.000000 
4.000000 9.000000 14.000000 19.000000 24.000000 841.000000 
5.000000 10.000000 15.000000 20.000000 25.000000 900.000000 

Square rooting Last Row, then turing off Row Buffer
In row mode: 0
Checking on value that should be not be in column buffer2.236068 
1.000000 6.000000 11.000000 16.000000 21.000000 676.000000 
2.000000 7.000000 12.000000 17.000000 22.000000 729.000000 
3.000000 8.000000 13.000000 18.000000 23.000000 784.000000 
4.000000 9.000000 14.000000 19.000000 24.000000 841.000000 
2.236068 3.162278 3.872983 4.472136 5.000000 30.000000 

Single Indexing. Assign each value its square
1.000000 36.000000 121.000000 256.000000 441.000000 676.000000 
4.000000 49.000000 144.000000 289.000000 484.000000 729.000000 
9.000000 64.000000 169.000000 324.000000 529.000000 784.000000 
16.000000 81.000000 196.000000 361.000000 576.000000 841.000000 
25.000000 100.000000 225.000000 400.000000 625.000000 900.000000 

Resizing Buffers Smaller
Checking dimensions
Rows: 5
Cols: 6
Buffer Rows: 1
Buffer Cols: 1
1.000000 36.000000 121.000000 256.000000 441.000000 676.000000 
4.000000 49.000000 144.000000 289.000000 484.000000 729.000000 
9.000000 64.000000 169.000000 324.000000 529.000000 784.000000 
16.000000 81.000000 196.000000 361.000000 576.000000 841.000000 
25.000000 100.000000 225.000000 400.000000 625.000000 900.000000 

Activating Row Mode.
Resizing Buffers
Checking dimensions
Rows: 5
Cols: 6
Buffer Rows: 1
Buffer Cols: 1
Activating ReadOnly Mode.
The results of assignment is: 0
Printing matrix reversed.
900.000000 625.000000 400.000000 225.000000 100.000000 25.000000 
841.000000 576.000000 361.000000 196.000000 81.000000 16.000000 
784.000000 529.000000 324.000000 169.000000 64.000000 9.000000 
729.000000 484.000000 289.000000 144.000000 49.000000 -30.000000 
676.000000 441.000000 256.000000 121.000000 -20.000000 -10.000000 

[[1]]
[1] 0

> 
> proc.time()
   user  system elapsed 
  0.341   0.145   0.475 

BufferedMatrix.Rcheck/tests/objectTesting.Rout


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

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

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

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

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

Attaching package: 'BufferedMatrix'

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

    colMeans, colSums, rowMeans, rowSums

> 
> 
> ### this is used to control how many repetitions in something below
> ### higher values result in more checks.
> nreps <-100 ##20000
> 
> 
> ## test creation and some simple assignments and subsetting operations
> 
> ## first on single elements
> tmp <- createBufferedMatrix(1000,10)
> 
> tmp[10,5]
[1] 0
> tmp[10,5] <- 10
> tmp[10,5]
[1] 10
> tmp[10,5] <- 12.445
> tmp[10,5]
[1] 12.445
> 
> 
> 
> ## now testing accessing multiple elements
> tmp2 <- createBufferedMatrix(10,20)
> 
> 
> tmp2[3,1] <- 51.34
> tmp2[9,2] <- 9.87654
> tmp2[,1:2]
       [,1]    [,2]
 [1,]  0.00 0.00000
 [2,]  0.00 0.00000
 [3,] 51.34 0.00000
 [4,]  0.00 0.00000
 [5,]  0.00 0.00000
 [6,]  0.00 0.00000
 [7,]  0.00 0.00000
 [8,]  0.00 0.00000
 [9,]  0.00 9.87654
[10,]  0.00 0.00000
> tmp2[,-(3:20)]
       [,1]    [,2]
 [1,]  0.00 0.00000
 [2,]  0.00 0.00000
 [3,] 51.34 0.00000
 [4,]  0.00 0.00000
 [5,]  0.00 0.00000
 [6,]  0.00 0.00000
 [7,]  0.00 0.00000
 [8,]  0.00 0.00000
 [9,]  0.00 9.87654
[10,]  0.00 0.00000
> tmp2[3,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
[1,] 51.34    0    0    0    0    0    0    0    0     0     0     0     0
     [,14] [,15] [,16] [,17] [,18] [,19] [,20]
[1,]     0     0     0     0     0     0     0
> tmp2[-3,]
      [,1]    [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [2,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [3,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [4,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [5,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [6,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [7,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [8,]    0 9.87654    0    0    0    0    0    0    0     0     0     0     0
 [9,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
      [,14] [,15] [,16] [,17] [,18] [,19] [,20]
 [1,]     0     0     0     0     0     0     0
 [2,]     0     0     0     0     0     0     0
 [3,]     0     0     0     0     0     0     0
 [4,]     0     0     0     0     0     0     0
 [5,]     0     0     0     0     0     0     0
 [6,]     0     0     0     0     0     0     0
 [7,]     0     0     0     0     0     0     0
 [8,]     0     0     0     0     0     0     0
 [9,]     0     0     0     0     0     0     0
> tmp2[2,1:3]
     [,1] [,2] [,3]
[1,]    0    0    0
> tmp2[3:9,1:3]
      [,1]    [,2] [,3]
[1,] 51.34 0.00000    0
[2,]  0.00 0.00000    0
[3,]  0.00 0.00000    0
[4,]  0.00 0.00000    0
[5,]  0.00 0.00000    0
[6,]  0.00 0.00000    0
[7,]  0.00 9.87654    0
> tmp2[-4,-4]
       [,1]    [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [2,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [3,] 51.34 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [4,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [5,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [6,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [7,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [8,]  0.00 9.87654    0    0    0    0    0    0    0     0     0     0     0
 [9,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
      [,14] [,15] [,16] [,17] [,18] [,19]
 [1,]     0     0     0     0     0     0
 [2,]     0     0     0     0     0     0
 [3,]     0     0     0     0     0     0
 [4,]     0     0     0     0     0     0
 [5,]     0     0     0     0     0     0
 [6,]     0     0     0     0     0     0
 [7,]     0     0     0     0     0     0
 [8,]     0     0     0     0     0     0
 [9,]     0     0     0     0     0     0
> 
> ## now testing accessing/assigning multiple elements
> tmp3 <- createBufferedMatrix(10,10)
> 
> for (i in 1:10){
+   for (j in 1:10){
+     tmp3[i,j] <- (j-1)*10 + i
+   }
+ }
> 
> tmp3[2:4,2:4]
     [,1] [,2] [,3]
[1,]   12   22   32
[2,]   13   23   33
[3,]   14   24   34
> tmp3[c(-10),c(2:4,2:4,10,1,2,1:10,10:1)]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]   11   21   31   11   21   31   91    1   11     1    11    21    31
 [2,]   12   22   32   12   22   32   92    2   12     2    12    22    32
 [3,]   13   23   33   13   23   33   93    3   13     3    13    23    33
 [4,]   14   24   34   14   24   34   94    4   14     4    14    24    34
 [5,]   15   25   35   15   25   35   95    5   15     5    15    25    35
 [6,]   16   26   36   16   26   36   96    6   16     6    16    26    36
 [7,]   17   27   37   17   27   37   97    7   17     7    17    27    37
 [8,]   18   28   38   18   28   38   98    8   18     8    18    28    38
 [9,]   19   29   39   19   29   39   99    9   19     9    19    29    39
      [,14] [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24] [,25]
 [1,]    41    51    61    71    81    91    91    81    71    61    51    41
 [2,]    42    52    62    72    82    92    92    82    72    62    52    42
 [3,]    43    53    63    73    83    93    93    83    73    63    53    43
 [4,]    44    54    64    74    84    94    94    84    74    64    54    44
 [5,]    45    55    65    75    85    95    95    85    75    65    55    45
 [6,]    46    56    66    76    86    96    96    86    76    66    56    46
 [7,]    47    57    67    77    87    97    97    87    77    67    57    47
 [8,]    48    58    68    78    88    98    98    88    78    68    58    48
 [9,]    49    59    69    79    89    99    99    89    79    69    59    49
      [,26] [,27] [,28] [,29]
 [1,]    31    21    11     1
 [2,]    32    22    12     2
 [3,]    33    23    13     3
 [4,]    34    24    14     4
 [5,]    35    25    15     5
 [6,]    36    26    16     6
 [7,]    37    27    17     7
 [8,]    38    28    18     8
 [9,]    39    29    19     9
> tmp3[-c(1:5),-c(6:10)]
     [,1] [,2] [,3] [,4] [,5]
[1,]    6   16   26   36   46
[2,]    7   17   27   37   47
[3,]    8   18   28   38   48
[4,]    9   19   29   39   49
[5,]   10   20   30   40   50
> 
> ## assignment of whole columns
> tmp3[,1] <- c(1:10*100.0)
> tmp3[,1:2] <- tmp3[,1:2]*100
> tmp3[,1:2] <- tmp3[,2:1]
> tmp3[,1:2]
      [,1]  [,2]
 [1,] 1100 1e+04
 [2,] 1200 2e+04
 [3,] 1300 3e+04
 [4,] 1400 4e+04
 [5,] 1500 5e+04
 [6,] 1600 6e+04
 [7,] 1700 7e+04
 [8,] 1800 8e+04
 [9,] 1900 9e+04
[10,] 2000 1e+05
> 
> 
> tmp3[,-1] <- tmp3[,1:9]
> tmp3[,1:10]
      [,1] [,2]  [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,] 1100 1100 1e+04   21   31   41   51   61   71    81
 [2,] 1200 1200 2e+04   22   32   42   52   62   72    82
 [3,] 1300 1300 3e+04   23   33   43   53   63   73    83
 [4,] 1400 1400 4e+04   24   34   44   54   64   74    84
 [5,] 1500 1500 5e+04   25   35   45   55   65   75    85
 [6,] 1600 1600 6e+04   26   36   46   56   66   76    86
 [7,] 1700 1700 7e+04   27   37   47   57   67   77    87
 [8,] 1800 1800 8e+04   28   38   48   58   68   78    88
 [9,] 1900 1900 9e+04   29   39   49   59   69   79    89
[10,] 2000 2000 1e+05   30   40   50   60   70   80    90
> 
> tmp3[,1:2] <- rep(1,10)
> tmp3[,1:2] <- rep(1,20)
> tmp3[,1:2] <- matrix(c(1:5),1,5)
> 
> tmp3[,-c(1:8)] <- matrix(c(1:5),1,5)
> 
> tmp3[1,] <- 1:10
> tmp3[1,]
     [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,]    1    2    3    4    5    6    7    8    9    10
> tmp3[-1,] <- c(1,2)
> tmp3[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    1    2    3    4    5    6    7    8    9    10
 [2,]    1    2    1    2    1    2    1    2    1     2
 [3,]    2    1    2    1    2    1    2    1    2     1
 [4,]    1    2    1    2    1    2    1    2    1     2
 [5,]    2    1    2    1    2    1    2    1    2     1
 [6,]    1    2    1    2    1    2    1    2    1     2
 [7,]    2    1    2    1    2    1    2    1    2     1
 [8,]    1    2    1    2    1    2    1    2    1     2
 [9,]    2    1    2    1    2    1    2    1    2     1
[10,]    1    2    1    2    1    2    1    2    1     2
> tmp3[-c(1:8),] <- matrix(c(1:5),1,5)
> tmp3[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    1    2    3    4    5    6    7    8    9    10
 [2,]    1    2    1    2    1    2    1    2    1     2
 [3,]    2    1    2    1    2    1    2    1    2     1
 [4,]    1    2    1    2    1    2    1    2    1     2
 [5,]    2    1    2    1    2    1    2    1    2     1
 [6,]    1    2    1    2    1    2    1    2    1     2
 [7,]    2    1    2    1    2    1    2    1    2     1
 [8,]    1    2    1    2    1    2    1    2    1     2
 [9,]    1    3    5    2    4    1    3    5    2     4
[10,]    2    4    1    3    5    2    4    1    3     5
> 
> 
> tmp3[1:2,1:2] <- 5555.04
> tmp3[-(1:2),1:2] <- 1234.56789
> 
> 
> 
> ## testing accessors for the directory and prefix
> directory(tmp3)
[1] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests"
> prefix(tmp3)
[1] "BM"
> 
> ## testing if we can remove these objects
> rm(tmp, tmp2, tmp3)
> gc()
         used (Mb) gc trigger (Mb) limit (Mb) max used (Mb)
Ncells 474173 25.4    1035461 55.3         NA   638637 34.2
Vcells 877659  6.7    8388608 64.0      98304  2071819 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] "Thu Sep 26 19:40:28 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] "Thu Sep 26 19:40: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: 0x6000007f0000>
> 
> 
> 
> 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] "Thu Sep 26 19:40:33 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] "Thu Sep 26 19:40:34 2024"
> 
> ColMode(tmp2)
<pointer: 0x6000007f0000>
> 
> 
> 
> ### Now testing assignments
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+ 
+   new.data <- rnorm(20)
+   tmp2[which.row,] <- new.data
+   test.matrix[which.row,] <- new.data
+   if (rep > 1){
+     if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+   
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   new.data <- rnorm(10)
+   tmp2[,which.col] <- new.data
+   test.matrix[,which.col]<- new.data
+ 
+   if (rep > 1){
+     if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.col <- which.col
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,5,replace=TRUE)
+   new.data <- matrix(rnorm(50),5,10)
+   tmp2[,which.col] <- new.data
+   test.matrix[,which.col]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.col <- which.col
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   new.data <- matrix(rnorm(50),5,10)
+   tmp2[which.row,] <- new.data
+   test.matrix[which.row,]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col  <- sample(1:20,5,replace=TRUE)
+   new.data <- matrix(rnorm(25),5,5)
+   tmp2[which.row,which.col] <- new.data
+   test.matrix[which.row,which.col]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[prev.row,prev.col] == test.matrix[prev.row,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+   prev.col <- which.col
+ }
> 
> 
> 
> 
> ###
> ###
> ### testing some more functions
> ###
> 
> 
> 
> ## duplication function
> tmp5 <- duplicate(tmp2)
> 
> # making sure really did copy everything.
> tmp5[1,1] <- tmp5[1,1] +100.00
> 
> if (tmp5[1,1] == tmp2[1,1]){
+   stop("Problem with duplication")
+ }
> 
> 
> 
> 
> ### testing elementwise applying of functions
> 
> tmp5[1:4,1:4]
           [,1]       [,2]        [,3]       [,4]
[1,] 99.5378581 -0.4834260 -0.08287975 -0.5998305
[2,] -0.5091915 -0.5465540 -0.44837037 -1.8700324
[3,] -0.9949266 -1.5922755  1.60467786  0.5042493
[4,] -0.6840672 -0.9590096 -0.48991743 -0.3301441
> ewApply(tmp5,abs)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
           [,1]      [,2]       [,3]      [,4]
[1,] 99.5378581 0.4834260 0.08287975 0.5998305
[2,]  0.5091915 0.5465540 0.44837037 1.8700324
[3,]  0.9949266 1.5922755 1.60467786 0.5042493
[4,]  0.6840672 0.9590096 0.48991743 0.3301441
> ewApply(tmp5,sqrt)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
          [,1]      [,2]      [,3]      [,4]
[1,] 9.9768661 0.6952885 0.2878884 0.7744873
[2,] 0.7135765 0.7392929 0.6696046 1.3674913
[3,] 0.9974601 1.2618540 1.2667588 0.7101052
[4,] 0.8270835 0.9792903 0.6999410 0.5745817
> 
> my.function <- function(x,power){
+   (x+5)^power
+ }
> 
> ewApply(tmp5,my.function,power=2)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
          [,1]     [,2]     [,3]     [,4]
[1,] 224.30652 32.43631 27.96176 33.34470
[2,]  32.64496 32.93948 32.14442 40.54495
[3,]  35.96953 39.21082 39.27227 32.60530
[4,]  33.95490 35.75191 32.48933 31.07596
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x6000007fc000>
> exp(tmp5)
<pointer: 0x6000007fc000>
> log(tmp5,2)
<pointer: 0x6000007fc000>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 466.8646
> Min(tmp5)
[1] 53.78504
> mean(tmp5)
[1] 73.0811
> Sum(tmp5)
[1] 14616.22
> Var(tmp5)
[1] 853.7371
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 90.19231 71.35748 69.51523 70.53889 73.56085 72.20310 71.82327 69.60215
 [9] 69.46923 72.54852
> rowSums(tmp5)
 [1] 1803.846 1427.150 1390.305 1410.778 1471.217 1444.062 1436.465 1392.043
 [9] 1389.385 1450.970
> rowVars(tmp5)
 [1] 7931.10077   80.69263   75.35079   60.59583   85.96413   69.43247
 [7]   84.55604   66.10898   51.37555   75.58652
> rowSd(tmp5)
 [1] 89.056728  8.982908  8.680483  7.784333  9.271685  8.332615  9.195436
 [8]  8.130743  7.167674  8.694051
> rowMax(tmp5)
 [1] 466.86463  85.77311  81.79598  85.20828  87.91761  89.98127  88.93776
 [8]  91.78424  82.60392  89.11387
> rowMin(tmp5)
 [1] 55.14735 55.65521 55.17323 57.80590 56.83895 57.30856 54.98537 53.78504
 [9] 56.78656 56.47895
> 
> colMeans(tmp5)
 [1] 111.69205  70.31049  69.39312  70.67819  73.24955  67.59874  66.14537
 [8]  71.65140  71.18283  69.07599  75.03035  65.83397  74.48654  67.28568
[15]  72.82097  76.22957  74.38235  69.56595  73.90092  71.10804
> colSums(tmp5)
 [1] 1116.9205  703.1049  693.9312  706.7819  732.4955  675.9874  661.4537
 [8]  716.5140  711.8283  690.7599  750.3035  658.3397  744.8654  672.8568
[15]  728.2097  762.2957  743.8235  695.6595  739.0092  711.0804
> colVars(tmp5)
 [1] 15616.87692    33.96970    69.64148    56.87295   122.01652    57.20294
 [7]    54.00581    70.07567    99.26133    49.80350    77.24936    61.95998
[13]   141.29060    39.10226    55.38818    24.34152    60.17773    94.88052
[19]    77.41210    84.19906
> colSd(tmp5)
 [1] 124.967503   5.828353   8.345147   7.541416  11.046109   7.563263
 [7]   7.348865   8.371121   9.962998   7.057160   8.789162   7.871466
[13]  11.886572   6.253180   7.442323   4.933712   7.757431   9.740663
[19]   8.798415   9.176005
> colMax(tmp5)
 [1] 466.86463  81.61218  85.08743  84.38899  89.98127  84.59848  79.18130
 [8]  83.47444  85.02567  79.52686  88.89693  79.39379  91.78424  75.48015
[15]  87.91761  85.61820  87.48807  85.77311  87.95884  88.93776
> colMin(tmp5)
 [1] 56.47895 63.37003 58.19875 57.30856 56.78656 58.01875 56.83895 60.16588
 [9] 56.91712 55.14735 62.13983 55.65521 56.66032 55.17323 64.44980 69.49361
[17] 59.53881 54.98537 59.19981 53.78504
> 
> 
> ### setting a random element to NA and then testing with na.rm=TRUE or na.rm=FALSE (The default)
> 
> 
> which.row <- sample(1:10,1,replace=TRUE)
> which.col  <- sample(1:20,1,replace=TRUE)
> 
> tmp5[which.row,which.col] <- NA
> 
> Max(tmp5)
[1] NA
> Min(tmp5)
[1] NA
> mean(tmp5)
[1] NA
> Sum(tmp5)
[1] NA
> Var(tmp5)
[1] NA
> 
> rowMeans(tmp5)
 [1] 90.19231 71.35748       NA 70.53889 73.56085 72.20310 71.82327 69.60215
 [9] 69.46923 72.54852
> rowSums(tmp5)
 [1] 1803.846 1427.150       NA 1410.778 1471.217 1444.062 1436.465 1392.043
 [9] 1389.385 1450.970
> rowVars(tmp5)
 [1] 7931.10077   80.69263   75.72684   60.59583   85.96413   69.43247
 [7]   84.55604   66.10898   51.37555   75.58652
> rowSd(tmp5)
 [1] 89.056728  8.982908  8.702117  7.784333  9.271685  8.332615  9.195436
 [8]  8.130743  7.167674  8.694051
> rowMax(tmp5)
 [1] 466.86463  85.77311        NA  85.20828  87.91761  89.98127  88.93776
 [8]  91.78424  82.60392  89.11387
> rowMin(tmp5)
 [1] 55.14735 55.65521       NA 57.80590 56.83895 57.30856 54.98537 53.78504
 [9] 56.78656 56.47895
> 
> colMeans(tmp5)
 [1] 111.69205  70.31049  69.39312  70.67819  73.24955  67.59874  66.14537
 [8]  71.65140        NA  69.07599  75.03035  65.83397  74.48654  67.28568
[15]  72.82097  76.22957  74.38235  69.56595  73.90092  71.10804
> colSums(tmp5)
 [1] 1116.9205  703.1049  693.9312  706.7819  732.4955  675.9874  661.4537
 [8]  716.5140        NA  690.7599  750.3035  658.3397  744.8654  672.8568
[15]  728.2097  762.2957  743.8235  695.6595  739.0092  711.0804
> colVars(tmp5)
 [1] 15616.87692    33.96970    69.64148    56.87295   122.01652    57.20294
 [7]    54.00581    70.07567          NA    49.80350    77.24936    61.95998
[13]   141.29060    39.10226    55.38818    24.34152    60.17773    94.88052
[19]    77.41210    84.19906
> colSd(tmp5)
 [1] 124.967503   5.828353   8.345147   7.541416  11.046109   7.563263
 [7]   7.348865   8.371121         NA   7.057160   8.789162   7.871466
[13]  11.886572   6.253180   7.442323   4.933712   7.757431   9.740663
[19]   8.798415   9.176005
> colMax(tmp5)
 [1] 466.86463  81.61218  85.08743  84.38899  89.98127  84.59848  79.18130
 [8]  83.47444        NA  79.52686  88.89693  79.39379  91.78424  75.48015
[15]  87.91761  85.61820  87.48807  85.77311  87.95884  88.93776
> colMin(tmp5)
 [1] 56.47895 63.37003 58.19875 57.30856 56.78656 58.01875 56.83895 60.16588
 [9]       NA 55.14735 62.13983 55.65521 56.66032 55.17323 64.44980 69.49361
[17] 59.53881 54.98537 59.19981 53.78504
> 
> Max(tmp5,na.rm=TRUE)
[1] 466.8646
> Min(tmp5,na.rm=TRUE)
[1] 53.78504
> mean(tmp5,na.rm=TRUE)
[1] 73.13958
> Sum(tmp5,na.rm=TRUE)
[1] 14554.78
> Var(tmp5,na.rm=TRUE)
[1] 857.3614
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 90.19231 71.35748 69.94006 70.53889 73.56085 72.20310 71.82327 69.60215
 [9] 69.46923 72.54852
> rowSums(tmp5,na.rm=TRUE)
 [1] 1803.846 1427.150 1328.861 1410.778 1471.217 1444.062 1436.465 1392.043
 [9] 1389.385 1450.970
> rowVars(tmp5,na.rm=TRUE)
 [1] 7931.10077   80.69263   75.72684   60.59583   85.96413   69.43247
 [7]   84.55604   66.10898   51.37555   75.58652
> rowSd(tmp5,na.rm=TRUE)
 [1] 89.056728  8.982908  8.702117  7.784333  9.271685  8.332615  9.195436
 [8]  8.130743  7.167674  8.694051
> rowMax(tmp5,na.rm=TRUE)
 [1] 466.86463  85.77311  81.79598  85.20828  87.91761  89.98127  88.93776
 [8]  91.78424  82.60392  89.11387
> rowMin(tmp5,na.rm=TRUE)
 [1] 55.14735 55.65521 55.17323 57.80590 56.83895 57.30856 54.98537 53.78504
 [9] 56.78656 56.47895
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 111.69205  70.31049  69.39312  70.67819  73.24955  67.59874  66.14537
 [8]  71.65140  72.26497  69.07599  75.03035  65.83397  74.48654  67.28568
[15]  72.82097  76.22957  74.38235  69.56595  73.90092  71.10804
> colSums(tmp5,na.rm=TRUE)
 [1] 1116.9205  703.1049  693.9312  706.7819  732.4955  675.9874  661.4537
 [8]  716.5140  650.3848  690.7599  750.3035  658.3397  744.8654  672.8568
[15]  728.2097  762.2957  743.8235  695.6595  739.0092  711.0804
> colVars(tmp5,na.rm=TRUE)
 [1] 15616.87692    33.96970    69.64148    56.87295   122.01652    57.20294
 [7]    54.00581    70.07567    98.49477    49.80350    77.24936    61.95998
[13]   141.29060    39.10226    55.38818    24.34152    60.17773    94.88052
[19]    77.41210    84.19906
> colSd(tmp5,na.rm=TRUE)
 [1] 124.967503   5.828353   8.345147   7.541416  11.046109   7.563263
 [7]   7.348865   8.371121   9.924453   7.057160   8.789162   7.871466
[13]  11.886572   6.253180   7.442323   4.933712   7.757431   9.740663
[19]   8.798415   9.176005
> colMax(tmp5,na.rm=TRUE)
 [1] 466.86463  81.61218  85.08743  84.38899  89.98127  84.59848  79.18130
 [8]  83.47444  85.02567  79.52686  88.89693  79.39379  91.78424  75.48015
[15]  87.91761  85.61820  87.48807  85.77311  87.95884  88.93776
> colMin(tmp5,na.rm=TRUE)
 [1] 56.47895 63.37003 58.19875 57.30856 56.78656 58.01875 56.83895 60.16588
 [9] 56.91712 55.14735 62.13983 55.65521 56.66032 55.17323 64.44980 69.49361
[17] 59.53881 54.98537 59.19981 53.78504
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1] 90.19231 71.35748      NaN 70.53889 73.56085 72.20310 71.82327 69.60215
 [9] 69.46923 72.54852
> rowSums(tmp5,na.rm=TRUE)
 [1] 1803.846 1427.150    0.000 1410.778 1471.217 1444.062 1436.465 1392.043
 [9] 1389.385 1450.970
> rowVars(tmp5,na.rm=TRUE)
 [1] 7931.10077   80.69263         NA   60.59583   85.96413   69.43247
 [7]   84.55604   66.10898   51.37555   75.58652
> rowSd(tmp5,na.rm=TRUE)
 [1] 89.056728  8.982908        NA  7.784333  9.271685  8.332615  9.195436
 [8]  8.130743  7.167674  8.694051
> rowMax(tmp5,na.rm=TRUE)
 [1] 466.86463  85.77311        NA  85.20828  87.91761  89.98127  88.93776
 [8]  91.78424  82.60392  89.11387
> rowMin(tmp5,na.rm=TRUE)
 [1] 55.14735 55.65521       NA 57.80590 56.83895 57.30856 54.98537 53.78504
 [9] 56.78656 56.47895
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1] 115.78385  69.05475  68.02123  70.99092  72.85529  68.52607  66.03579
 [8]  70.52423       NaN  69.62433  76.46263  64.32732  76.46723  68.63150
[15]  72.81048  76.97801  76.03163  68.82922  73.94145  71.38533
> colSums(tmp5,na.rm=TRUE)
 [1] 1042.0546  621.4927  612.1911  638.9182  655.6976  616.7346  594.3221
 [8]  634.7180    0.0000  626.6190  688.1637  578.9459  688.2050  617.6835
[15]  655.2943  692.8021  684.2847  619.4629  665.4731  642.4680
> colVars(tmp5,na.rm=TRUE)
 [1] 17380.62981    20.47591    57.17342    62.88185   135.51987    54.67905
 [7]    60.62143    64.54172          NA    52.64637    63.82700    44.16764
[13]   114.81666    23.61348    62.31046    21.08237    37.09846   100.63431
[19]    87.07013    93.85894
> colSd(tmp5,na.rm=TRUE)
 [1] 131.835617   4.525031   7.561310   7.929808  11.641300   7.394528
 [7]   7.785977   8.033786         NA   7.255782   7.989180   6.645874
[13]  10.715254   4.859370   7.893698   4.591554   6.090851  10.031665
[19]   9.331138   9.688082
> colMax(tmp5,na.rm=TRUE)
 [1] 466.86463  77.92625  85.08743  84.38899  89.98127  84.59848  79.18130
 [8]  83.47444      -Inf  79.52686  88.89693  78.64181  91.78424  75.48015
[15]  87.91761  85.61820  87.48807  85.77311  87.95884  88.93776
> colMin(tmp5,na.rm=TRUE)
 [1] 56.47895 63.37003 58.19875 57.30856 56.78656 58.01875 56.83895 60.16588
 [9]      Inf 55.14735 65.86654 55.65521 62.61778 61.11781 64.44980 70.53360
[17] 67.56169 54.98537 59.19981 53.78504
> 
> 
> 
> 
> 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] 225.4376 222.6500 176.7532 251.2566 192.7932 228.7402 192.0878 151.9309
 [9] 183.5364 146.5406
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 225.4376 222.6500 176.7532 251.2566 192.7932 228.7402 192.0878 151.9309
 [9] 183.5364 146.5406
> 
> 
> 
> copymatrix <- matrix(rnorm(200,150,15),10,20)
> 
> tmp5[1:10,1:20] <- copymatrix
> which.row <- 1
> which.col  <- 3
> cat(which.row," ",which.col,"\n")
1   3 
> tmp5[which.row,which.col] <- NA
> copymatrix[which.row,which.col] <- NA
> 
> colVars(tmp5,na.rm=TRUE)-apply(copymatrix,2,var,na.rm=TRUE)
 [1]  2.842171e-14 -5.684342e-14  8.526513e-14  1.136868e-13  5.684342e-14
 [6] -1.136868e-13  0.000000e+00 -1.421085e-14  8.526513e-14 -2.131628e-14
[11]  2.842171e-13 -5.684342e-14  1.421085e-14 -4.263256e-14  1.421085e-14
[16] -2.842171e-14  5.684342e-14 -8.526513e-14  1.136868e-13 -5.684342e-14
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> ## 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)
+ }
2   14 
8   10 
7   11 
5   14 
1   10 
1   6 
10   6 
10   3 
1   1 
9   6 
10   18 
2   18 
10   20 
2   12 
2   15 
3   11 
6   16 
8   12 
4   13 
10   17 
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.91701
> Min(tmp)
[1] -3.017828
> mean(tmp)
[1] -0.2101135
> Sum(tmp)
[1] -21.01135
> Var(tmp)
[1] 1.148539
> 
> rowMeans(tmp)
[1] -0.2101135
> rowSums(tmp)
[1] -21.01135
> rowVars(tmp)
[1] 1.148539
> rowSd(tmp)
[1] 1.071699
> rowMax(tmp)
[1] 2.91701
> rowMin(tmp)
[1] -3.017828
> 
> colMeans(tmp)
  [1] -0.33492443 -2.26798363  0.74352680 -0.06851868 -0.69186959  2.39809717
  [7] -0.86717277  1.06831911  0.20214791  0.27369118 -0.66562973 -1.31062424
 [13] -0.63665906 -0.33838435 -1.35933700 -1.52103182 -0.46360875  0.38814285
 [19] -0.06026133 -0.78424285 -0.19745262 -0.91757026  0.51814073  1.58063049
 [25]  0.64297970 -1.48745843 -0.19500593 -0.47307674 -0.09510571 -0.30597981
 [31] -0.19791410 -0.90163603  0.30534240  0.33308642 -1.25479414 -0.89378283
 [37] -0.18429110 -1.74063033 -0.62201961 -0.49275803 -1.59909075 -0.65903690
 [43]  2.91700981  0.44604647  1.01244460 -0.64357754 -1.80453328  0.57257652
 [49] -0.44706649 -0.41585229  1.94684642  0.31832792  0.56026982  0.66948293
 [55] -0.32211415 -2.21228347  1.15836977 -1.41529014 -0.62986575 -1.25940854
 [61] -0.62821637  0.16013238  1.33036232 -2.05641552 -0.74047029  0.25162172
 [67] -0.33438129 -0.33309533 -0.41345744  0.74641994 -0.77238565  0.36049486
 [73] -0.88586414  0.58127146 -0.14260994  2.37551280  0.04728832 -0.32270480
 [79] -3.01782778 -0.73370950 -0.35106079 -1.30287470 -2.20126675  0.97090202
 [85]  0.92152752  0.22150169  0.20075344 -0.48599109 -0.34520671 -2.47818476
 [91] -0.05831364  0.41066024  0.97352714  1.37168330 -0.70668843 -0.77070164
 [97] -0.60079072  0.35644906 -0.26413747  2.33725733
> colSums(tmp)
  [1] -0.33492443 -2.26798363  0.74352680 -0.06851868 -0.69186959  2.39809717
  [7] -0.86717277  1.06831911  0.20214791  0.27369118 -0.66562973 -1.31062424
 [13] -0.63665906 -0.33838435 -1.35933700 -1.52103182 -0.46360875  0.38814285
 [19] -0.06026133 -0.78424285 -0.19745262 -0.91757026  0.51814073  1.58063049
 [25]  0.64297970 -1.48745843 -0.19500593 -0.47307674 -0.09510571 -0.30597981
 [31] -0.19791410 -0.90163603  0.30534240  0.33308642 -1.25479414 -0.89378283
 [37] -0.18429110 -1.74063033 -0.62201961 -0.49275803 -1.59909075 -0.65903690
 [43]  2.91700981  0.44604647  1.01244460 -0.64357754 -1.80453328  0.57257652
 [49] -0.44706649 -0.41585229  1.94684642  0.31832792  0.56026982  0.66948293
 [55] -0.32211415 -2.21228347  1.15836977 -1.41529014 -0.62986575 -1.25940854
 [61] -0.62821637  0.16013238  1.33036232 -2.05641552 -0.74047029  0.25162172
 [67] -0.33438129 -0.33309533 -0.41345744  0.74641994 -0.77238565  0.36049486
 [73] -0.88586414  0.58127146 -0.14260994  2.37551280  0.04728832 -0.32270480
 [79] -3.01782778 -0.73370950 -0.35106079 -1.30287470 -2.20126675  0.97090202
 [85]  0.92152752  0.22150169  0.20075344 -0.48599109 -0.34520671 -2.47818476
 [91] -0.05831364  0.41066024  0.97352714  1.37168330 -0.70668843 -0.77070164
 [97] -0.60079072  0.35644906 -0.26413747  2.33725733
> colVars(tmp)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> colSd(tmp)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> colMax(tmp)
  [1] -0.33492443 -2.26798363  0.74352680 -0.06851868 -0.69186959  2.39809717
  [7] -0.86717277  1.06831911  0.20214791  0.27369118 -0.66562973 -1.31062424
 [13] -0.63665906 -0.33838435 -1.35933700 -1.52103182 -0.46360875  0.38814285
 [19] -0.06026133 -0.78424285 -0.19745262 -0.91757026  0.51814073  1.58063049
 [25]  0.64297970 -1.48745843 -0.19500593 -0.47307674 -0.09510571 -0.30597981
 [31] -0.19791410 -0.90163603  0.30534240  0.33308642 -1.25479414 -0.89378283
 [37] -0.18429110 -1.74063033 -0.62201961 -0.49275803 -1.59909075 -0.65903690
 [43]  2.91700981  0.44604647  1.01244460 -0.64357754 -1.80453328  0.57257652
 [49] -0.44706649 -0.41585229  1.94684642  0.31832792  0.56026982  0.66948293
 [55] -0.32211415 -2.21228347  1.15836977 -1.41529014 -0.62986575 -1.25940854
 [61] -0.62821637  0.16013238  1.33036232 -2.05641552 -0.74047029  0.25162172
 [67] -0.33438129 -0.33309533 -0.41345744  0.74641994 -0.77238565  0.36049486
 [73] -0.88586414  0.58127146 -0.14260994  2.37551280  0.04728832 -0.32270480
 [79] -3.01782778 -0.73370950 -0.35106079 -1.30287470 -2.20126675  0.97090202
 [85]  0.92152752  0.22150169  0.20075344 -0.48599109 -0.34520671 -2.47818476
 [91] -0.05831364  0.41066024  0.97352714  1.37168330 -0.70668843 -0.77070164
 [97] -0.60079072  0.35644906 -0.26413747  2.33725733
> colMin(tmp)
  [1] -0.33492443 -2.26798363  0.74352680 -0.06851868 -0.69186959  2.39809717
  [7] -0.86717277  1.06831911  0.20214791  0.27369118 -0.66562973 -1.31062424
 [13] -0.63665906 -0.33838435 -1.35933700 -1.52103182 -0.46360875  0.38814285
 [19] -0.06026133 -0.78424285 -0.19745262 -0.91757026  0.51814073  1.58063049
 [25]  0.64297970 -1.48745843 -0.19500593 -0.47307674 -0.09510571 -0.30597981
 [31] -0.19791410 -0.90163603  0.30534240  0.33308642 -1.25479414 -0.89378283
 [37] -0.18429110 -1.74063033 -0.62201961 -0.49275803 -1.59909075 -0.65903690
 [43]  2.91700981  0.44604647  1.01244460 -0.64357754 -1.80453328  0.57257652
 [49] -0.44706649 -0.41585229  1.94684642  0.31832792  0.56026982  0.66948293
 [55] -0.32211415 -2.21228347  1.15836977 -1.41529014 -0.62986575 -1.25940854
 [61] -0.62821637  0.16013238  1.33036232 -2.05641552 -0.74047029  0.25162172
 [67] -0.33438129 -0.33309533 -0.41345744  0.74641994 -0.77238565  0.36049486
 [73] -0.88586414  0.58127146 -0.14260994  2.37551280  0.04728832 -0.32270480
 [79] -3.01782778 -0.73370950 -0.35106079 -1.30287470 -2.20126675  0.97090202
 [85]  0.92152752  0.22150169  0.20075344 -0.48599109 -0.34520671 -2.47818476
 [91] -0.05831364  0.41066024  0.97352714  1.37168330 -0.70668843 -0.77070164
 [97] -0.60079072  0.35644906 -0.26413747  2.33725733
> colMedians(tmp)
  [1] -0.33492443 -2.26798363  0.74352680 -0.06851868 -0.69186959  2.39809717
  [7] -0.86717277  1.06831911  0.20214791  0.27369118 -0.66562973 -1.31062424
 [13] -0.63665906 -0.33838435 -1.35933700 -1.52103182 -0.46360875  0.38814285
 [19] -0.06026133 -0.78424285 -0.19745262 -0.91757026  0.51814073  1.58063049
 [25]  0.64297970 -1.48745843 -0.19500593 -0.47307674 -0.09510571 -0.30597981
 [31] -0.19791410 -0.90163603  0.30534240  0.33308642 -1.25479414 -0.89378283
 [37] -0.18429110 -1.74063033 -0.62201961 -0.49275803 -1.59909075 -0.65903690
 [43]  2.91700981  0.44604647  1.01244460 -0.64357754 -1.80453328  0.57257652
 [49] -0.44706649 -0.41585229  1.94684642  0.31832792  0.56026982  0.66948293
 [55] -0.32211415 -2.21228347  1.15836977 -1.41529014 -0.62986575 -1.25940854
 [61] -0.62821637  0.16013238  1.33036232 -2.05641552 -0.74047029  0.25162172
 [67] -0.33438129 -0.33309533 -0.41345744  0.74641994 -0.77238565  0.36049486
 [73] -0.88586414  0.58127146 -0.14260994  2.37551280  0.04728832 -0.32270480
 [79] -3.01782778 -0.73370950 -0.35106079 -1.30287470 -2.20126675  0.97090202
 [85]  0.92152752  0.22150169  0.20075344 -0.48599109 -0.34520671 -2.47818476
 [91] -0.05831364  0.41066024  0.97352714  1.37168330 -0.70668843 -0.77070164
 [97] -0.60079072  0.35644906 -0.26413747  2.33725733
> colRanges(tmp)
           [,1]      [,2]      [,3]        [,4]       [,5]     [,6]       [,7]
[1,] -0.3349244 -2.267984 0.7435268 -0.06851868 -0.6918696 2.398097 -0.8671728
[2,] -0.3349244 -2.267984 0.7435268 -0.06851868 -0.6918696 2.398097 -0.8671728
         [,8]      [,9]     [,10]      [,11]     [,12]      [,13]      [,14]
[1,] 1.068319 0.2021479 0.2736912 -0.6656297 -1.310624 -0.6366591 -0.3383843
[2,] 1.068319 0.2021479 0.2736912 -0.6656297 -1.310624 -0.6366591 -0.3383843
         [,15]     [,16]      [,17]     [,18]       [,19]      [,20]      [,21]
[1,] -1.359337 -1.521032 -0.4636087 0.3881429 -0.06026133 -0.7842428 -0.1974526
[2,] -1.359337 -1.521032 -0.4636087 0.3881429 -0.06026133 -0.7842428 -0.1974526
          [,22]     [,23]   [,24]     [,25]     [,26]      [,27]      [,28]
[1,] -0.9175703 0.5181407 1.58063 0.6429797 -1.487458 -0.1950059 -0.4730767
[2,] -0.9175703 0.5181407 1.58063 0.6429797 -1.487458 -0.1950059 -0.4730767
           [,29]      [,30]      [,31]     [,32]     [,33]     [,34]     [,35]
[1,] -0.09510571 -0.3059798 -0.1979141 -0.901636 0.3053424 0.3330864 -1.254794
[2,] -0.09510571 -0.3059798 -0.1979141 -0.901636 0.3053424 0.3330864 -1.254794
          [,36]      [,37]    [,38]      [,39]     [,40]     [,41]      [,42]
[1,] -0.8937828 -0.1842911 -1.74063 -0.6220196 -0.492758 -1.599091 -0.6590369
[2,] -0.8937828 -0.1842911 -1.74063 -0.6220196 -0.492758 -1.599091 -0.6590369
       [,43]     [,44]    [,45]      [,46]     [,47]     [,48]      [,49]
[1,] 2.91701 0.4460465 1.012445 -0.6435775 -1.804533 0.5725765 -0.4470665
[2,] 2.91701 0.4460465 1.012445 -0.6435775 -1.804533 0.5725765 -0.4470665
          [,50]    [,51]     [,52]     [,53]     [,54]      [,55]     [,56]
[1,] -0.4158523 1.946846 0.3183279 0.5602698 0.6694829 -0.3221142 -2.212283
[2,] -0.4158523 1.946846 0.3183279 0.5602698 0.6694829 -0.3221142 -2.212283
       [,57]    [,58]      [,59]     [,60]      [,61]     [,62]    [,63]
[1,] 1.15837 -1.41529 -0.6298658 -1.259409 -0.6282164 0.1601324 1.330362
[2,] 1.15837 -1.41529 -0.6298658 -1.259409 -0.6282164 0.1601324 1.330362
         [,64]      [,65]     [,66]      [,67]      [,68]      [,69]     [,70]
[1,] -2.056416 -0.7404703 0.2516217 -0.3343813 -0.3330953 -0.4134574 0.7464199
[2,] -2.056416 -0.7404703 0.2516217 -0.3343813 -0.3330953 -0.4134574 0.7464199
          [,71]     [,72]      [,73]     [,74]      [,75]    [,76]      [,77]
[1,] -0.7723857 0.3604949 -0.8858641 0.5812715 -0.1426099 2.375513 0.04728832
[2,] -0.7723857 0.3604949 -0.8858641 0.5812715 -0.1426099 2.375513 0.04728832
          [,78]     [,79]      [,80]      [,81]     [,82]     [,83]    [,84]
[1,] -0.3227048 -3.017828 -0.7337095 -0.3510608 -1.302875 -2.201267 0.970902
[2,] -0.3227048 -3.017828 -0.7337095 -0.3510608 -1.302875 -2.201267 0.970902
         [,85]     [,86]     [,87]      [,88]      [,89]     [,90]       [,91]
[1,] 0.9215275 0.2215017 0.2007534 -0.4859911 -0.3452067 -2.478185 -0.05831364
[2,] 0.9215275 0.2215017 0.2007534 -0.4859911 -0.3452067 -2.478185 -0.05831364
         [,92]     [,93]    [,94]      [,95]      [,96]      [,97]     [,98]
[1,] 0.4106602 0.9735271 1.371683 -0.7066884 -0.7707016 -0.6007907 0.3564491
[2,] 0.4106602 0.9735271 1.371683 -0.7066884 -0.7707016 -0.6007907 0.3564491
          [,99]   [,100]
[1,] -0.2641375 2.337257
[2,] -0.2641375 2.337257
> 
> 
> Max(tmp2)
[1] 1.962487
> Min(tmp2)
[1] -2.591203
> mean(tmp2)
[1] 0.04956944
> Sum(tmp2)
[1] 4.956944
> Var(tmp2)
[1] 0.7492873
> 
> rowMeans(tmp2)
  [1]  0.0667387783  1.0231702672 -0.2347755608 -0.7280429215 -0.6143239321
  [6]  0.0458935255  0.0005752241 -0.4192040791 -0.2893525833  0.1012268962
 [11]  0.2544963065  0.5132421258 -1.1292720247 -0.0469918571 -1.1768847931
 [16]  0.5528218172 -0.9895215705  0.3268946957 -0.9539885153  0.3247707611
 [21] -0.2559232910 -2.5912033225 -0.2891292571  0.2415654919 -0.4226455524
 [26]  0.7165128543 -0.7300803372 -1.5395663590 -0.3344695245  0.9822034093
 [31] -0.8378204079 -0.2344671639 -0.5974636592  0.3904601780 -0.0534857928
 [36] -0.3116480757 -0.5732913538  1.0878372145  0.8371859177  0.9876080019
 [41] -0.0689104874  0.7372943315 -0.4295457563 -0.7149718104 -0.3526900958
 [46]  1.5005850986  0.7021296332  1.9624867705  1.0393142178 -0.4463416251
 [51]  0.3161188425 -0.1988714948 -1.7674456662 -0.6460193996 -0.5236796327
 [56]  0.5496494794 -0.1343738437  1.6053290637  0.3035753114  0.4950816755
 [61]  0.6571294404  1.0868352066 -0.3181597567 -1.2784364860  0.2652702861
 [66]  0.1590280617 -0.5270256202  1.4492635602 -0.4336130528  0.6069514719
 [71]  0.2228361885  1.3274839815  0.0694698631 -0.5188416184  0.1534147245
 [76]  1.2137283701 -0.8411829753  1.2284946812 -1.4252865742 -1.3389764701
 [81]  0.2059149099 -1.1035940459  0.3514207258 -1.8271974026  1.2072928357
 [86]  0.6085480665 -1.1995867280  0.8609630701  1.8562031585  0.5938430458
 [91]  0.3960448280  0.3312744801  0.7069412550  1.2083840299 -0.5332644332
 [96] -0.6617364785  0.4485460400  0.9778468998  0.8235618551  0.9187883216
> rowSums(tmp2)
  [1]  0.0667387783  1.0231702672 -0.2347755608 -0.7280429215 -0.6143239321
  [6]  0.0458935255  0.0005752241 -0.4192040791 -0.2893525833  0.1012268962
 [11]  0.2544963065  0.5132421258 -1.1292720247 -0.0469918571 -1.1768847931
 [16]  0.5528218172 -0.9895215705  0.3268946957 -0.9539885153  0.3247707611
 [21] -0.2559232910 -2.5912033225 -0.2891292571  0.2415654919 -0.4226455524
 [26]  0.7165128543 -0.7300803372 -1.5395663590 -0.3344695245  0.9822034093
 [31] -0.8378204079 -0.2344671639 -0.5974636592  0.3904601780 -0.0534857928
 [36] -0.3116480757 -0.5732913538  1.0878372145  0.8371859177  0.9876080019
 [41] -0.0689104874  0.7372943315 -0.4295457563 -0.7149718104 -0.3526900958
 [46]  1.5005850986  0.7021296332  1.9624867705  1.0393142178 -0.4463416251
 [51]  0.3161188425 -0.1988714948 -1.7674456662 -0.6460193996 -0.5236796327
 [56]  0.5496494794 -0.1343738437  1.6053290637  0.3035753114  0.4950816755
 [61]  0.6571294404  1.0868352066 -0.3181597567 -1.2784364860  0.2652702861
 [66]  0.1590280617 -0.5270256202  1.4492635602 -0.4336130528  0.6069514719
 [71]  0.2228361885  1.3274839815  0.0694698631 -0.5188416184  0.1534147245
 [76]  1.2137283701 -0.8411829753  1.2284946812 -1.4252865742 -1.3389764701
 [81]  0.2059149099 -1.1035940459  0.3514207258 -1.8271974026  1.2072928357
 [86]  0.6085480665 -1.1995867280  0.8609630701  1.8562031585  0.5938430458
 [91]  0.3960448280  0.3312744801  0.7069412550  1.2083840299 -0.5332644332
 [96] -0.6617364785  0.4485460400  0.9778468998  0.8235618551  0.9187883216
> 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.0667387783  1.0231702672 -0.2347755608 -0.7280429215 -0.6143239321
  [6]  0.0458935255  0.0005752241 -0.4192040791 -0.2893525833  0.1012268962
 [11]  0.2544963065  0.5132421258 -1.1292720247 -0.0469918571 -1.1768847931
 [16]  0.5528218172 -0.9895215705  0.3268946957 -0.9539885153  0.3247707611
 [21] -0.2559232910 -2.5912033225 -0.2891292571  0.2415654919 -0.4226455524
 [26]  0.7165128543 -0.7300803372 -1.5395663590 -0.3344695245  0.9822034093
 [31] -0.8378204079 -0.2344671639 -0.5974636592  0.3904601780 -0.0534857928
 [36] -0.3116480757 -0.5732913538  1.0878372145  0.8371859177  0.9876080019
 [41] -0.0689104874  0.7372943315 -0.4295457563 -0.7149718104 -0.3526900958
 [46]  1.5005850986  0.7021296332  1.9624867705  1.0393142178 -0.4463416251
 [51]  0.3161188425 -0.1988714948 -1.7674456662 -0.6460193996 -0.5236796327
 [56]  0.5496494794 -0.1343738437  1.6053290637  0.3035753114  0.4950816755
 [61]  0.6571294404  1.0868352066 -0.3181597567 -1.2784364860  0.2652702861
 [66]  0.1590280617 -0.5270256202  1.4492635602 -0.4336130528  0.6069514719
 [71]  0.2228361885  1.3274839815  0.0694698631 -0.5188416184  0.1534147245
 [76]  1.2137283701 -0.8411829753  1.2284946812 -1.4252865742 -1.3389764701
 [81]  0.2059149099 -1.1035940459  0.3514207258 -1.8271974026  1.2072928357
 [86]  0.6085480665 -1.1995867280  0.8609630701  1.8562031585  0.5938430458
 [91]  0.3960448280  0.3312744801  0.7069412550  1.2083840299 -0.5332644332
 [96] -0.6617364785  0.4485460400  0.9778468998  0.8235618551  0.9187883216
> rowMin(tmp2)
  [1]  0.0667387783  1.0231702672 -0.2347755608 -0.7280429215 -0.6143239321
  [6]  0.0458935255  0.0005752241 -0.4192040791 -0.2893525833  0.1012268962
 [11]  0.2544963065  0.5132421258 -1.1292720247 -0.0469918571 -1.1768847931
 [16]  0.5528218172 -0.9895215705  0.3268946957 -0.9539885153  0.3247707611
 [21] -0.2559232910 -2.5912033225 -0.2891292571  0.2415654919 -0.4226455524
 [26]  0.7165128543 -0.7300803372 -1.5395663590 -0.3344695245  0.9822034093
 [31] -0.8378204079 -0.2344671639 -0.5974636592  0.3904601780 -0.0534857928
 [36] -0.3116480757 -0.5732913538  1.0878372145  0.8371859177  0.9876080019
 [41] -0.0689104874  0.7372943315 -0.4295457563 -0.7149718104 -0.3526900958
 [46]  1.5005850986  0.7021296332  1.9624867705  1.0393142178 -0.4463416251
 [51]  0.3161188425 -0.1988714948 -1.7674456662 -0.6460193996 -0.5236796327
 [56]  0.5496494794 -0.1343738437  1.6053290637  0.3035753114  0.4950816755
 [61]  0.6571294404  1.0868352066 -0.3181597567 -1.2784364860  0.2652702861
 [66]  0.1590280617 -0.5270256202  1.4492635602 -0.4336130528  0.6069514719
 [71]  0.2228361885  1.3274839815  0.0694698631 -0.5188416184  0.1534147245
 [76]  1.2137283701 -0.8411829753  1.2284946812 -1.4252865742 -1.3389764701
 [81]  0.2059149099 -1.1035940459  0.3514207258 -1.8271974026  1.2072928357
 [86]  0.6085480665 -1.1995867280  0.8609630701  1.8562031585  0.5938430458
 [91]  0.3960448280  0.3312744801  0.7069412550  1.2083840299 -0.5332644332
 [96] -0.6617364785  0.4485460400  0.9778468998  0.8235618551  0.9187883216
> 
> colMeans(tmp2)
[1] 0.04956944
> colSums(tmp2)
[1] 4.956944
> colVars(tmp2)
[1] 0.7492873
> colSd(tmp2)
[1] 0.8656138
> colMax(tmp2)
[1] 1.962487
> colMin(tmp2)
[1] -2.591203
> colMedians(tmp2)
[1] 0.08534838
> colRanges(tmp2)
          [,1]
[1,] -2.591203
[2,]  1.962487
> 
> 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.4778192  1.3347770  1.9280737 -1.1219898 -3.8841104  1.1682552
 [7] -4.7150350 -0.5417805  1.6487018  2.7789250
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -1.7315161
[2,] -0.6420465
[3,]  0.5356403
[4,]  0.6266200
[5,]  1.1267129
> 
> rowApply(tmp,sum)
 [1] -5.5529897  0.2309388  3.5656844 -2.3451783  3.7928068  0.2987848
 [7]  3.4746718  0.4618326 -1.9211026 -2.9318124
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]   10    6    9    8    1    8    8    2    3     8
 [2,]    4   10    4    6   10    1    7    5    9     4
 [3,]    8    9    1    3    6   10    5    4    5     9
 [4,]    7    2    5    5    9    6    6    3   10     1
 [5,]    2    3    6    2    3    9    4    1    8     7
 [6,]    9    7    7    9    5    5    2    8    2     6
 [7,]    3    1    2    1    2    7   10    6    1     2
 [8,]    6    4    3    4    4    4    3    7    6    10
 [9,]    5    5   10    7    7    3    1   10    7     5
[10,]    1    8    8   10    8    2    9    9    4     3
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1]  0.0957447  5.7198134  0.5772878 -2.2000408 -2.0689715  0.5184114
 [7]  2.2575496 -0.5081187 -0.2513392 -7.0418996 -1.2344711 -4.5266180
[13] -3.9194933 -1.3689659  2.5917971  1.1751900 -1.6970159  2.7222499
[19] -0.6422409  0.3021376
> colApply(tmp,quantile)[,1]
            [,1]
[1,] -1.41453287
[2,] -1.26685719
[3,] -0.02956261
[4,]  1.24306317
[5,]  1.56363420
> 
> rowApply(tmp,sum)
[1] -0.9366073  3.3834528 -0.2647417 -7.4970130 -4.1840841
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]    2    6   18    3   16
[2,]   15    7   20   19   19
[3,]   11   18   10   13   12
[4,]    1   10    8    9   11
[5,]    9   13    7   11    5
> 
> 
> as.matrix(tmp)
            [,1]       [,2]         [,3]       [,4]        [,5]       [,6]
[1,] -1.26685719 0.33672058  0.008053737 -1.4040047 -0.03496179 -0.4446374
[2,] -0.02956261 0.07279963  0.664787761  0.3095468  0.47016110  0.1554250
[3,]  1.56363420 2.17410194 -0.059924829 -0.3863765 -0.46504745  0.3346511
[4,] -1.41453287 1.72607974 -0.177244259 -0.5955242 -0.46790166 -0.8732410
[5,]  1.24306317 1.41011150  0.141615402 -0.1236822 -1.57122169  1.3462137
             [,7]        [,8]       [,9]      [,10]      [,11]      [,12]
[1,] -0.001836721  0.99550891 -0.4470603  0.1480893  0.9685551 -0.4219652
[2,]  0.583365288  0.65503463  1.0252507 -0.2608013  0.3239950 -0.6618807
[3,]  0.939196903  0.06901592 -0.9362868 -1.8912145 -0.6847586  0.4298612
[4,]  0.564454560 -0.50457274  2.2050324 -2.4759756 -1.3497982 -1.4726808
[5,]  0.172369526 -1.72310547 -2.0982752 -2.5619974 -0.4924645 -2.3999524
          [,13]       [,14]      [,15]       [,16]       [,17]      [,18]
[1,]  0.6624942  0.03824087 -1.1655183  0.22112979 -0.97916708  2.2967330
[2,] -0.8564162 -2.17032599  0.5055999  1.76632768 -0.44220519  0.5658985
[3,] -1.4601852 -1.74933913  1.6298498 -1.20684243  0.35460390  0.3769714
[4,] -1.2230270 -0.35211199  0.4452600  0.04012117  0.09727046  0.2558864
[5,] -1.0423590  2.86457036  1.1766056  0.35445381 -0.72751795 -0.7732393
          [,19]      [,20]
[1,] -0.8763388  0.4302147
[2,]  0.4653003  0.2411524
[3,]  1.0462748 -0.3429274
[4,] -0.6345243 -1.2899829
[5,] -0.6429529  1.2636809
> 
> 
> is.BufferedMatrix(tmp)
[1] TRUE
> 
> as.BufferedMatrix(as.matrix(tmp))
BufferedMatrix object
Matrix size:  5 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  800  bytes.
> 
> 
> 
> subBufferedMatrix(tmp,1:5,1:5)
BufferedMatrix object
Matrix size:  5 5 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  650  bytes.
Disk usage :  200  bytes.
> subBufferedMatrix(tmp,,5:8)
BufferedMatrix object
Matrix size:  5 4 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  563  bytes.
Disk usage :  160  bytes.
> subBufferedMatrix(tmp,1:3,)
BufferedMatrix object
Matrix size:  3 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  480  bytes.
> 
> 
> rm(tmp)
> 
> 
> ###
> ### Testing colnames and rownames
> ###
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> 
> 
> colnames(tmp)
NULL
> rownames(tmp)
NULL
> 
> 
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> colnames(tmp)
 [1] "col1"  "col2"  "col3"  "col4"  "col5"  "col6"  "col7"  "col8"  "col9" 
[10] "col10" "col11" "col12" "col13" "col14" "col15" "col16" "col17" "col18"
[19] "col19" "col20"
> rownames(tmp)
[1] "row1" "row2" "row3" "row4" "row5"
> 
> 
> tmp["row1",]
          col1      col2      col3      col4      col5      col6       col7
row1 0.1621016 0.3306119 0.5512377 0.2960563 -1.977167 -1.202307 -0.1957585
         col8       col9      col10      col11     col12      col13     col14
row1 0.626859 -0.8329381 -0.6933592 -0.5715441 0.1956192 -0.1252794 0.5311151
         col15     col16    col17    col18     col19     col20
row1 0.6226783 0.6816259 -2.15981 0.048878 0.4410572 0.6256823
> tmp[,"col10"]
          col10
row1 -0.6933592
row2 -1.1292715
row3 -0.2096690
row4 -1.7994893
row5 -0.9567939
> tmp[c("row1","row5"),]
          col1       col2       col3      col4       col5        col6
row1 0.1621016  0.3306119  0.5512377 0.2960563 -1.9771665 -1.20230734
row5 0.6060237 -0.5769396 -0.1564729 0.7062531 -0.4136274 -0.08125498
           col7          col8       col9      col10      col11      col12
row1 -0.1957585  6.268590e-01 -0.8329381 -0.6933592 -0.5715441  0.1956192
row5 -0.9114064 -9.749048e-05  1.9873322 -0.9567939 -1.3020393 -0.1743991
          col13     col14     col15     col16       col17     col18     col19
row1 -0.1252794 0.5311151 0.6226783 0.6816259 -2.15980986 0.0488780 0.4410572
row5 -0.5086480 0.7521502 0.7887661 1.6342014  0.04742439 0.5470777 0.6528048
         col20
row1 0.6256823
row5 0.4267333
> tmp[,c("col6","col20")]
            col6      col20
row1 -1.20230734  0.6256823
row2  0.99405411 -1.8505624
row3 -0.52129570 -0.6571152
row4 -0.56622648  0.8787095
row5 -0.08125498  0.4267333
> tmp[c("row1","row5"),c("col6","col20")]
            col6     col20
row1 -1.20230734 0.6256823
row5 -0.08125498 0.4267333
> 
> 
> 
> 
> tmp["row1",] <- rnorm(20,mean=10)
> tmp[,"col10"] <- rnorm(5,mean=30)
> tmp[c("row1","row5"),] <- rnorm(40,mean=50)
> tmp[,c("col6","col20")] <- rnorm(10,mean=75)
> tmp[c("row1","row5"),c("col6","col20")]  <- rnorm(4,mean=105)
> 
> tmp["row1",]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 49.26641 49.16302 49.85367 49.68419 51.69795 104.9593 49.64194 50.71577
         col9    col10    col11   col12    col13    col14    col15    col16
row1 49.74067 50.13791 50.91671 49.7246 49.29311 50.09311 49.17044 50.78448
        col17    col18    col19    col20
row1 49.69336 50.01743 50.36539 104.8854
> tmp[,"col10"]
        col10
row1 50.13791
row2 30.69858
row3 28.38255
row4 28.75689
row5 50.25842
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 49.26641 49.16302 49.85367 49.68419 51.69795 104.9593 49.64194 50.71577
row5 49.83773 50.70511 51.18879 48.63487 48.57984 105.6306 49.87839 50.10375
         col9    col10    col11    col12    col13    col14    col15    col16
row1 49.74067 50.13791 50.91671 49.72460 49.29311 50.09311 49.17044 50.78448
row5 49.18209 50.25842 47.66529 51.65129 49.42306 50.44287 51.37720 51.19190
        col17    col18    col19    col20
row1 49.69336 50.01743 50.36539 104.8854
row5 50.55626 49.66754 51.59894 103.9094
> tmp[,c("col6","col20")]
          col6     col20
row1 104.95932 104.88537
row2  75.75409  74.27078
row3  73.10068  76.48306
row4  73.94992  75.99239
row5 105.63062 103.90939
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 104.9593 104.8854
row5 105.6306 103.9094
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 104.9593 104.8854
row5 105.6306 103.9094
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
          col13
[1,] -0.4507909
[2,] -0.9206898
[3,] -1.4064207
[4,]  0.5306124
[5,]  2.2753005
> tmp[,c("col17","col7")]
          col17        col7
[1,]  0.6343859  1.97046074
[2,] -0.0559353 -0.02688873
[3,] -0.7557319 -0.45918263
[4,] -1.4611960  1.42263186
[5,] -1.6855456 -0.34203250
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
           col6      col20
[1,]  0.3775134  0.7508615
[2,]  2.0107080  0.2897085
[3,] -0.3091202 -1.9555354
[4,] -0.3755914 -0.5880738
[5,]  0.1842480 -0.4854530
> subBufferedMatrix(tmp,1,c("col6"))[,1]
          col1
[1,] 0.3775134
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
          col6
[1,] 0.3775134
[2,] 2.0107080
> 
> 
> 
> 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.9494772 0.3452625 -1.0969827 -1.3580448 -0.1131824 0.6421775 -1.296753
row1 0.9738940 1.5643846 -0.6602663  0.5798645  0.4346739 0.7697828 -1.968030
          [,8]      [,9]      [,10]      [,11]      [,12]      [,13]     [,14]
row3 0.2137313 0.6786962 -0.6258293 -0.4616071 -0.2561841 0.09287836 1.0424847
row1 0.2045291 0.3396177 -0.5193714 -0.9571531 -1.4032148 1.02524759 0.9872667
         [,15]       [,16]      [,17]     [,18]      [,19]      [,20]
row3  0.651039 -0.34772816 -0.4990211 1.2401677 0.07383794  0.1220210
row1 -0.264742  0.01218306  0.2173687 0.6140959 0.93597870 -0.8029318
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
           [,1]      [,2]       [,3]      [,4]      [,5]       [,6]      [,7]
row2 -0.7311068 -2.272028 -0.3572017 -1.203106 0.5996283 -0.3895415 0.2029466
          [,8]      [,9]      [,10]
row2 -1.603169 0.2853319 -0.9418681
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
         [,1]      [,2]      [,3]      [,4]      [,5]       [,6]       [,7]
row5 -1.36563 0.8433487 0.5843039 0.5369721 -0.797306 -0.1532472 -0.3865552
           [,8]     [,9]   [,10]     [,11]      [,12]    [,13]    [,14]
row5 -0.0787563 0.148299 1.71504 0.1042412 -0.2796621 1.294198 -1.08932
          [,15]    [,16]    [,17]      [,18]      [,19]     [,20]
row5 -0.6143619 0.479294 1.453219 -0.5733457 0.00756394 -1.789147
> 
> 
> 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: 0x6000007a0000>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM92507d423aeb"
 [2] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM925072a5a8c" 
 [3] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM92506d9ea100"
 [4] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM9250495c3f39"
 [5] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM9250473adccf"
 [6] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM92506976be91"
 [7] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM925072d957ae"
 [8] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM92501b0b9b6a"
 [9] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM925017085a05"
[10] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM9250254e0a13"
[11] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM925026777887"
[12] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM92506d89facb"
[13] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM92507db05d9b"
[14] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM925045d1ab94"
[15] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM92504857a55b"
> 
> 
> ### 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: 0x6000007ec120>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x6000007ec120>
Warning message:
In dir.create(new.directory) :
  '/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x6000007ec120>
> rowMedians(tmp)
  [1] -0.380338918  0.132098631  0.427904406  0.419965245 -0.119599232
  [6]  0.087034440  0.271197970 -0.229222031  0.546452560  0.004556524
 [11] -0.266466516 -0.107197067 -0.103065852  0.336529231 -0.322563695
 [16]  0.076729182 -0.237289676  0.025064387  0.177218837  1.035327071
 [21] -0.112376185  0.115173247  0.119302331  0.242093994 -0.452461397
 [26]  0.029950254  0.202809050 -0.160669767  0.264458151  0.265515272
 [31] -0.026613329 -0.628405757  0.275671671  0.312135953 -0.372373223
 [36]  0.160894251 -0.425497220  0.314287652  0.504509074  0.152193551
 [41]  0.606365868 -0.002173067 -0.532666630  0.544740110  0.577130006
 [46]  0.355518637  0.245046427  0.128246060 -0.223055154 -0.404223983
 [51] -0.018962933  0.428557644  0.140400038 -0.196012726  0.313749046
 [56]  0.375198515 -0.208270281 -0.797025025  0.191997467 -0.362484301
 [61] -0.133577194  0.018506923 -0.079968883  0.607047491  0.601882054
 [66]  0.303895760  0.692029517 -0.117372246 -0.295962419 -0.432561098
 [71] -0.019607621 -0.222342533 -0.521963538 -0.019588615  0.487563334
 [76] -0.524763941  0.166483698 -0.102565016  0.619225187 -0.229760152
 [81] -0.248004643  0.245032716 -0.105789261 -0.225842363 -0.327058725
 [86]  0.108783448 -0.027332116  0.216426670 -0.155511512  0.123870575
 [91] -0.141795258  0.150479229 -0.196207336 -0.864477089  0.365606759
 [96]  0.646997299  0.348929321  0.540921275  0.098878935 -0.049257153
[101] -0.188961637  0.186759437  0.520690968 -0.054168820  0.362266143
[106] -0.079250898  0.357044164  0.254985142 -0.233231047  0.380915150
[111] -0.270208882  0.012336737  0.047088994 -0.269326697  0.233675467
[116] -0.346656898 -0.265245555 -0.152650953  0.148843455  0.141127252
[121] -0.271066574  0.267339927 -0.249622017  0.418950201  0.120247958
[126]  0.670926132 -0.607704295 -0.145180695  0.227256697 -0.037759175
[131]  0.707694068  0.375839378 -0.368446938 -0.440182586  0.332517406
[136] -0.115699022 -0.396372917 -0.048585324  0.470899128 -0.154842054
[141]  0.153603712 -0.368090224  0.177041973  0.844413935  0.035058837
[146]  0.489371157 -0.059341248 -0.419925510  0.187489359 -0.319862355
[151]  0.100696021  0.303537719 -0.112135784 -0.193718310  0.373097025
[156] -0.125310657 -0.360221008 -0.134547292 -0.039950867  0.742398255
[161]  0.192465459  0.406904363 -0.215611791  0.324975572  0.155417897
[166]  0.012026466  0.501434169  0.183723452  0.428530957 -0.170427216
[171] -0.486270231 -0.102606198 -0.170659075  0.157408151  0.353346392
[176]  0.243663510  0.084149333  0.198364078  0.411808417 -0.128886394
[181]  0.244773634  0.102804112 -0.021115200  0.247992106 -0.550215964
[186]  0.629376387  0.051692481  0.407839304  0.580511661 -0.008434854
[191]  0.669482608 -0.403219155 -0.662215860  0.659084239  0.463939871
[196] -0.387782063  0.223443998  0.100453886 -0.245693488  0.037778172
[201] -0.034964017 -0.006974510 -0.057951376 -0.498546696  0.597137048
[206]  0.530183660 -0.118057800  0.133290511 -0.367411671  0.023769962
[211]  0.110708142  0.487984231 -0.243637269 -0.552174919  0.101843349
[216] -0.451078439 -0.054036266 -0.289844872 -0.232868056 -0.154737038
[221] -0.066057737  0.066150629 -0.063603394  0.277147828 -0.066719054
[226] -0.290792274 -0.017044488 -0.076241898 -0.064240469 -0.041996678
> 
> proc.time()
   user  system elapsed 
  2.676  14.691  18.014 

BufferedMatrix.Rcheck/tests/rawCalltesting.Rout


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

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

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

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

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

Attaching package: 'BufferedMatrix'

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

    colMeans, colSums, rowMeans, rowSums

> 
> prefix <- "dbmtest"
> directory <- getwd()
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_Test_C",P)
RBufferedMatrix
Checking dimensions
Rows: 5
Cols: 5
Buffer Rows: 1
Buffer Cols: 1

Assigning Values
0.000000 1.000000 2.000000 3.000000 4.000000 
1.000000 2.000000 3.000000 4.000000 5.000000 
2.000000 3.000000 4.000000 5.000000 6.000000 
3.000000 4.000000 5.000000 6.000000 7.000000 
4.000000 5.000000 6.000000 7.000000 8.000000 

<pointer: 0x6000018cc000>
> .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: 0x6000018cc000>
> .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: 0x6000018cc000>
> .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: 0x6000018cc000>
> 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: 0x6000018c4000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000018c4000>
> .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: 0x6000018c4000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000018c4000>
> .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: 0x6000018c4000>
> 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: 0x6000018c0000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000018c0000>
> .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: 0x6000018c0000>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x6000018c0000>
> .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: 0x6000018c0000>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x6000018c0000>
> .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: 0x6000018c0000>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x6000018c0000>
> .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: 0x6000018c0000>
> 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: 0x6000018dc000>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x6000018dc000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000018dc000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000018dc000>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile96a411cb276d" "BufferedMatrixFile96a430896e3b"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile96a411cb276d" "BufferedMatrixFile96a430896e3b"
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000018dc240>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000018dc240>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x6000018dc240>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x6000018dc240>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x6000018dc240>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x6000018dc240>
> .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: 0x6000018dc420>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000018dc420>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x6000018dc420>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x6000018dc420>
> 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: 0x6000018b0000>
> .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: 0x6000018b0000>
> rm(P)
> 
> proc.time()
   user  system elapsed 
  0.343   0.158   0.500 

BufferedMatrix.Rcheck/tests/Rcodetesting.Rout


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

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

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

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

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

Attaching package: 'BufferedMatrix'

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

    colMeans, colSums, rowMeans, rowSums

> 
> Temp <- createBufferedMatrix(100)
> dim(Temp)
[1] 100   0
> buffer.dim(Temp)
[1] 1 1
> 
> 
> proc.time()
   user  system elapsed 
  0.362   0.093   0.450 

Example timings