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

This page was generated on 2024-05-04 11:38:56 -0400 (Sat, 04 May 2024).

HostnameOSArch (*)R versionInstalled pkgs
nebbiolo1Linux (Ubuntu 22.04.3 LTS)x86_644.4.0 beta (2024-04-15 r86425) -- "Puppy Cup" 4753
palomino3Windows Server 2022 Datacenterx644.4.0 beta (2024-04-15 r86425 ucrt) -- "Puppy Cup" 4486
lconwaymacOS 12.7.1 Montereyx86_644.4.0 beta (2024-04-14 r86421) -- "Puppy Cup" 4519
kunpeng2Linux (openEuler 22.03 LTS-SP1)aarch644.4.0 beta (2024-04-15 r86425) -- "Puppy Cup" 4479
Click on any hostname to see more info about the system (e.g. compilers)      (*) as reported by 'uname -p', except on Windows and Mac OS X

Package 249/2300HostnameOS / ArchINSTALLBUILDCHECKBUILD BIN
BufferedMatrix 1.68.0  (landing page)
Ben Bolstad
Snapshot Date: 2024-05-03 14:00:19 -0400 (Fri, 03 May 2024)
git_url: https://git.bioconductor.org/packages/BufferedMatrix
git_branch: RELEASE_3_19
git_last_commit: af6c73d
git_last_commit_date: 2024-04-30 10:16:21 -0400 (Tue, 30 Apr 2024)
nebbiolo1Linux (Ubuntu 22.04.3 LTS) / x86_64  OK    OK    OK  UNNEEDED, same version is already published
palomino3Windows Server 2022 Datacenter / x64  OK    OK    OK    OK  UNNEEDED, same version is already published
lconwaymacOS 12.7.1 Monterey / x86_64  OK    OK    WARNINGS    OK  UNNEEDED, same version is already published
kunpeng2Linux (openEuler 22.03 LTS-SP1) / aarch64  OK    OK    OK  
kjohnson3macOS 13.6.5 Ventura / arm64see weekly results here

CHECK results for BufferedMatrix on lconway


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

raw results


Summary

Package: BufferedMatrix
Version: 1.68.0
Command: /Library/Frameworks/R.framework/Resources/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/Library/Frameworks/R.framework/Resources/library --no-vignettes --timings BufferedMatrix_1.68.0.tar.gz
StartedAt: 2024-05-03 20:34:56 -0400 (Fri, 03 May 2024)
EndedAt: 2024-05-03 20:35:49 -0400 (Fri, 03 May 2024)
EllapsedTime: 52.4 seconds
RetCode: 0
Status:   WARNINGS  
CheckDir: BufferedMatrix.Rcheck
Warnings: 1

Command output

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


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

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


Installation output

BufferedMatrix.Rcheck/00install.out

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


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

Tests output

BufferedMatrix.Rcheck/tests/c_code_level_tests.Rout


R version 4.4.0 beta (2024-04-14 r86421) -- "Puppy Cup"
Copyright (C) 2024 The R Foundation for Statistical Computing
Platform: x86_64-apple-darwin20

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

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

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

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

Attaching package: 'BufferedMatrix'

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

    colMeans, colSums, rowMeans, rowSums

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

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

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

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

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

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

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

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

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

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

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

[[1]]
[1] 0

> 
> proc.time()
   user  system elapsed 
  0.338   0.144   0.472 

BufferedMatrix.Rcheck/tests/objectTesting.Rout


R version 4.4.0 beta (2024-04-14 r86421) -- "Puppy Cup"
Copyright (C) 2024 The R Foundation for Statistical Computing
Platform: x86_64-apple-darwin20

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

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

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

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

Attaching package: 'BufferedMatrix'

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

    colMeans, colSums, rowMeans, rowSums

> 
> 
> ### this is used to control how many repetitions in something below
> ### higher values result in more checks.
> nreps <-100 ##20000
> 
> 
> ## test creation and some simple assignments and subsetting operations
> 
> ## first on single elements
> tmp <- createBufferedMatrix(1000,10)
> 
> tmp[10,5]
[1] 0
> tmp[10,5] <- 10
> tmp[10,5]
[1] 10
> tmp[10,5] <- 12.445
> tmp[10,5]
[1] 12.445
> 
> 
> 
> ## now testing accessing multiple elements
> tmp2 <- createBufferedMatrix(10,20)
> 
> 
> tmp2[3,1] <- 51.34
> tmp2[9,2] <- 9.87654
> tmp2[,1:2]
       [,1]    [,2]
 [1,]  0.00 0.00000
 [2,]  0.00 0.00000
 [3,] 51.34 0.00000
 [4,]  0.00 0.00000
 [5,]  0.00 0.00000
 [6,]  0.00 0.00000
 [7,]  0.00 0.00000
 [8,]  0.00 0.00000
 [9,]  0.00 9.87654
[10,]  0.00 0.00000
> tmp2[,-(3:20)]
       [,1]    [,2]
 [1,]  0.00 0.00000
 [2,]  0.00 0.00000
 [3,] 51.34 0.00000
 [4,]  0.00 0.00000
 [5,]  0.00 0.00000
 [6,]  0.00 0.00000
 [7,]  0.00 0.00000
 [8,]  0.00 0.00000
 [9,]  0.00 9.87654
[10,]  0.00 0.00000
> tmp2[3,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
[1,] 51.34    0    0    0    0    0    0    0    0     0     0     0     0
     [,14] [,15] [,16] [,17] [,18] [,19] [,20]
[1,]     0     0     0     0     0     0     0
> tmp2[-3,]
      [,1]    [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [2,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [3,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [4,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [5,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [6,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [7,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [8,]    0 9.87654    0    0    0    0    0    0    0     0     0     0     0
 [9,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
      [,14] [,15] [,16] [,17] [,18] [,19] [,20]
 [1,]     0     0     0     0     0     0     0
 [2,]     0     0     0     0     0     0     0
 [3,]     0     0     0     0     0     0     0
 [4,]     0     0     0     0     0     0     0
 [5,]     0     0     0     0     0     0     0
 [6,]     0     0     0     0     0     0     0
 [7,]     0     0     0     0     0     0     0
 [8,]     0     0     0     0     0     0     0
 [9,]     0     0     0     0     0     0     0
> tmp2[2,1:3]
     [,1] [,2] [,3]
[1,]    0    0    0
> tmp2[3:9,1:3]
      [,1]    [,2] [,3]
[1,] 51.34 0.00000    0
[2,]  0.00 0.00000    0
[3,]  0.00 0.00000    0
[4,]  0.00 0.00000    0
[5,]  0.00 0.00000    0
[6,]  0.00 0.00000    0
[7,]  0.00 9.87654    0
> tmp2[-4,-4]
       [,1]    [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [2,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [3,] 51.34 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [4,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [5,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [6,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [7,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [8,]  0.00 9.87654    0    0    0    0    0    0    0     0     0     0     0
 [9,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
      [,14] [,15] [,16] [,17] [,18] [,19]
 [1,]     0     0     0     0     0     0
 [2,]     0     0     0     0     0     0
 [3,]     0     0     0     0     0     0
 [4,]     0     0     0     0     0     0
 [5,]     0     0     0     0     0     0
 [6,]     0     0     0     0     0     0
 [7,]     0     0     0     0     0     0
 [8,]     0     0     0     0     0     0
 [9,]     0     0     0     0     0     0
> 
> ## now testing accessing/assigning multiple elements
> tmp3 <- createBufferedMatrix(10,10)
> 
> for (i in 1:10){
+   for (j in 1:10){
+     tmp3[i,j] <- (j-1)*10 + i
+   }
+ }
> 
> tmp3[2:4,2:4]
     [,1] [,2] [,3]
[1,]   12   22   32
[2,]   13   23   33
[3,]   14   24   34
> tmp3[c(-10),c(2:4,2:4,10,1,2,1:10,10:1)]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]   11   21   31   11   21   31   91    1   11     1    11    21    31
 [2,]   12   22   32   12   22   32   92    2   12     2    12    22    32
 [3,]   13   23   33   13   23   33   93    3   13     3    13    23    33
 [4,]   14   24   34   14   24   34   94    4   14     4    14    24    34
 [5,]   15   25   35   15   25   35   95    5   15     5    15    25    35
 [6,]   16   26   36   16   26   36   96    6   16     6    16    26    36
 [7,]   17   27   37   17   27   37   97    7   17     7    17    27    37
 [8,]   18   28   38   18   28   38   98    8   18     8    18    28    38
 [9,]   19   29   39   19   29   39   99    9   19     9    19    29    39
      [,14] [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24] [,25]
 [1,]    41    51    61    71    81    91    91    81    71    61    51    41
 [2,]    42    52    62    72    82    92    92    82    72    62    52    42
 [3,]    43    53    63    73    83    93    93    83    73    63    53    43
 [4,]    44    54    64    74    84    94    94    84    74    64    54    44
 [5,]    45    55    65    75    85    95    95    85    75    65    55    45
 [6,]    46    56    66    76    86    96    96    86    76    66    56    46
 [7,]    47    57    67    77    87    97    97    87    77    67    57    47
 [8,]    48    58    68    78    88    98    98    88    78    68    58    48
 [9,]    49    59    69    79    89    99    99    89    79    69    59    49
      [,26] [,27] [,28] [,29]
 [1,]    31    21    11     1
 [2,]    32    22    12     2
 [3,]    33    23    13     3
 [4,]    34    24    14     4
 [5,]    35    25    15     5
 [6,]    36    26    16     6
 [7,]    37    27    17     7
 [8,]    38    28    18     8
 [9,]    39    29    19     9
> tmp3[-c(1:5),-c(6:10)]
     [,1] [,2] [,3] [,4] [,5]
[1,]    6   16   26   36   46
[2,]    7   17   27   37   47
[3,]    8   18   28   38   48
[4,]    9   19   29   39   49
[5,]   10   20   30   40   50
> 
> ## assignment of whole columns
> tmp3[,1] <- c(1:10*100.0)
> tmp3[,1:2] <- tmp3[,1:2]*100
> tmp3[,1:2] <- tmp3[,2:1]
> tmp3[,1:2]
      [,1]  [,2]
 [1,] 1100 1e+04
 [2,] 1200 2e+04
 [3,] 1300 3e+04
 [4,] 1400 4e+04
 [5,] 1500 5e+04
 [6,] 1600 6e+04
 [7,] 1700 7e+04
 [8,] 1800 8e+04
 [9,] 1900 9e+04
[10,] 2000 1e+05
> 
> 
> tmp3[,-1] <- tmp3[,1:9]
> tmp3[,1:10]
      [,1] [,2]  [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,] 1100 1100 1e+04   21   31   41   51   61   71    81
 [2,] 1200 1200 2e+04   22   32   42   52   62   72    82
 [3,] 1300 1300 3e+04   23   33   43   53   63   73    83
 [4,] 1400 1400 4e+04   24   34   44   54   64   74    84
 [5,] 1500 1500 5e+04   25   35   45   55   65   75    85
 [6,] 1600 1600 6e+04   26   36   46   56   66   76    86
 [7,] 1700 1700 7e+04   27   37   47   57   67   77    87
 [8,] 1800 1800 8e+04   28   38   48   58   68   78    88
 [9,] 1900 1900 9e+04   29   39   49   59   69   79    89
[10,] 2000 2000 1e+05   30   40   50   60   70   80    90
> 
> tmp3[,1:2] <- rep(1,10)
> tmp3[,1:2] <- rep(1,20)
> tmp3[,1:2] <- matrix(c(1:5),1,5)
> 
> tmp3[,-c(1:8)] <- matrix(c(1:5),1,5)
> 
> tmp3[1,] <- 1:10
> tmp3[1,]
     [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,]    1    2    3    4    5    6    7    8    9    10
> tmp3[-1,] <- c(1,2)
> tmp3[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    1    2    3    4    5    6    7    8    9    10
 [2,]    1    2    1    2    1    2    1    2    1     2
 [3,]    2    1    2    1    2    1    2    1    2     1
 [4,]    1    2    1    2    1    2    1    2    1     2
 [5,]    2    1    2    1    2    1    2    1    2     1
 [6,]    1    2    1    2    1    2    1    2    1     2
 [7,]    2    1    2    1    2    1    2    1    2     1
 [8,]    1    2    1    2    1    2    1    2    1     2
 [9,]    2    1    2    1    2    1    2    1    2     1
[10,]    1    2    1    2    1    2    1    2    1     2
> tmp3[-c(1:8),] <- matrix(c(1:5),1,5)
> tmp3[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    1    2    3    4    5    6    7    8    9    10
 [2,]    1    2    1    2    1    2    1    2    1     2
 [3,]    2    1    2    1    2    1    2    1    2     1
 [4,]    1    2    1    2    1    2    1    2    1     2
 [5,]    2    1    2    1    2    1    2    1    2     1
 [6,]    1    2    1    2    1    2    1    2    1     2
 [7,]    2    1    2    1    2    1    2    1    2     1
 [8,]    1    2    1    2    1    2    1    2    1     2
 [9,]    1    3    5    2    4    1    3    5    2     4
[10,]    2    4    1    3    5    2    4    1    3     5
> 
> 
> tmp3[1:2,1:2] <- 5555.04
> tmp3[-(1:2),1:2] <- 1234.56789
> 
> 
> 
> ## testing accessors for the directory and prefix
> directory(tmp3)
[1] "/Users/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests"
> prefix(tmp3)
[1] "BM"
> 
> ## testing if we can remove these objects
> rm(tmp, tmp2, tmp3)
> gc()
         used (Mb) gc trigger (Mb) limit (Mb) max used (Mb)
Ncells 474173 25.4    1035458 55.3         NA   638642 34.2
Vcells 877661  6.7    8388608 64.0      98304  2071729 15.9
> 
> 
> 
> 
> ##
> ## checking reads
> ##
> 
> tmp2 <- createBufferedMatrix(10,20)
> 
> test.sample <- rnorm(10*20)
> 
> tmp2[1:10,1:20] <- test.sample
> 
> test.matrix <- matrix(test.sample,10,20)
> 
> ## testing reads
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   which.col <- sample(1:20,1)
+   if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> date()
[1] "Fri May  3 20:35:21 2024"
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> date()
[1] "Fri May  3 20:35:22 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: 0x6000001d02a0>
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   which.col <- sample(1:20,1)
+   if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,5,replace=TRUE)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> date()
[1] "Fri May  3 20:35:26 2024"
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col <- sample(1:20,5,replace=TRUE)
+   if (!all(tmp2[which.row,which.col] == test.matrix[which.row,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> date()
[1] "Fri May  3 20:35:28 2024"
> 
> ColMode(tmp2)
<pointer: 0x6000001d02a0>
> 
> 
> 
> ### 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,] 100.9590785  0.1867910  1.479031  0.59228576
[2,]   0.1871133 -1.2040866 -1.173718 -1.32900103
[3,]   0.5716709 -0.1482378  2.643692 -2.56537747
[4,]   0.2718265  0.9227729 -3.004420 -0.05585091
> ewApply(tmp5,abs)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
            [,1]      [,2]     [,3]       [,4]
[1,] 100.9590785 0.1867910 1.479031 0.59228576
[2,]   0.1871133 1.2040866 1.173718 1.32900103
[3,]   0.5716709 0.1482378 2.643692 2.56537747
[4,]   0.2718265 0.9227729 3.004420 0.05585091
> ewApply(tmp5,sqrt)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
           [,1]      [,2]     [,3]     [,4]
[1,] 10.0478395 0.4321932 1.216154 0.769601
[2,]  0.4325660 1.0973088 1.083383 1.152823
[3,]  0.7560892 0.3850167 1.625943 1.601680
[4,]  0.5213699 0.9606107 1.733326 0.236328
> 
> my.function <- function(x,power){
+   (x+5)^power
+ }
> 
> ewApply(tmp5,my.function,power=2)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
          [,1]     [,2]     [,3]     [,4]
[1,] 226.43747 29.50872 38.64057 33.28830
[2,]  29.51277 37.17717 37.00755 37.85723
[3,]  33.13256 28.99840 43.90313 43.58217
[4,]  30.48553 35.52888 45.33768 27.41913
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x6000001cc000>
> exp(tmp5)
<pointer: 0x6000001cc000>
> log(tmp5,2)
<pointer: 0x6000001cc000>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 471.2999
> Min(tmp5)
[1] 54.54207
> mean(tmp5)
[1] 72.04402
> Sum(tmp5)
[1] 14408.8
> Var(tmp5)
[1] 872.1017
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 91.24169 73.32032 71.26387 67.93538 67.34855 68.29962 67.55084 70.50533
 [9] 71.81459 71.16003
> rowSums(tmp5)
 [1] 1824.834 1466.406 1425.277 1358.708 1346.971 1365.992 1351.017 1410.107
 [9] 1436.292 1423.201
> rowVars(tmp5)
 [1] 8079.70748   87.65823   93.02684   88.61946   40.97285   60.76168
 [7]   34.62432   47.49086   67.30507   63.29055
> rowSd(tmp5)
 [1] 89.887193  9.362598  9.645042  9.413791  6.401004  7.794978  5.884243
 [8]  6.891361  8.203967  7.955536
> rowMax(tmp5)
 [1] 471.29993  90.05485  91.37860  94.36445  78.68353  83.20190  79.54097
 [8]  83.02938  83.46748  85.22067
> rowMin(tmp5)
 [1] 56.64761 57.06295 55.87758 57.06933 57.31033 55.43169 54.54207 56.90429
 [9] 57.71160 57.14470
> 
> colMeans(tmp5)
 [1] 106.27555  71.85428  77.90180  69.69742  68.98379  69.97023  70.00369
 [8]  65.46465  73.74200  70.49371  71.30400  64.64278  68.57281  70.30649
[15]  71.60040  70.80576  71.14548  71.06131  68.96506  68.08925
> colSums(tmp5)
 [1] 1062.7555  718.5428  779.0180  696.9742  689.8379  699.7023  700.0369
 [8]  654.6465  737.4200  704.9371  713.0400  646.4278  685.7281  703.0649
[15]  716.0040  708.0576  711.4548  710.6131  689.6506  680.8925
> colVars(tmp5)
 [1] 16477.78911    48.66136    86.12349   103.28093    83.76023    62.27263
 [7]    63.59198    26.38398   111.03022    70.23649    56.99354    73.18945
[13]    90.91053   107.98373    36.91807    32.78281    95.43997    43.06991
[19]    35.64283    46.99282
> colSd(tmp5)
 [1] 128.365841   6.975769   9.280274  10.162723   9.152062   7.891301
 [7]   7.974458   5.136534  10.537088   8.380722   7.549406   8.555083
[13]   9.534701  10.391522   6.076025   5.725628   9.769338   6.562767
[19]   5.970161   6.855131
> colMax(tmp5)
 [1] 471.29993  78.62506  94.36445  90.71058  85.40261  79.35218  83.06007
 [8]  74.45218  86.51071  85.22067  79.54097  84.79290  84.57687  83.46748
[15]  80.97950  79.31763  90.05485  79.72693  81.22031  77.99782
> colMin(tmp5)
 [1] 54.54207 60.35638 64.41060 57.06933 55.87758 57.34215 60.90572 59.20716
 [9] 57.27936 59.70496 58.45653 57.06295 55.43169 57.31033 58.94893 62.32359
[17] 56.64761 56.90429 62.18405 60.44856
> 
> 
> ### setting a random element to NA and then testing with na.rm=TRUE or na.rm=FALSE (The default)
> 
> 
> which.row <- sample(1:10,1,replace=TRUE)
> which.col  <- sample(1:20,1,replace=TRUE)
> 
> tmp5[which.row,which.col] <- NA
> 
> Max(tmp5)
[1] NA
> Min(tmp5)
[1] NA
> mean(tmp5)
[1] NA
> Sum(tmp5)
[1] NA
> Var(tmp5)
[1] NA
> 
> rowMeans(tmp5)
 [1] 91.24169 73.32032 71.26387       NA 67.34855 68.29962 67.55084 70.50533
 [9] 71.81459 71.16003
> rowSums(tmp5)
 [1] 1824.834 1466.406 1425.277       NA 1346.971 1365.992 1351.017 1410.107
 [9] 1436.292 1423.201
> rowVars(tmp5)
 [1] 8079.70748   87.65823   93.02684   52.69507   40.97285   60.76168
 [7]   34.62432   47.49086   67.30507   63.29055
> rowSd(tmp5)
 [1] 89.887193  9.362598  9.645042  7.259137  6.401004  7.794978  5.884243
 [8]  6.891361  8.203967  7.955536
> rowMax(tmp5)
 [1] 471.29993  90.05485  91.37860        NA  78.68353  83.20190  79.54097
 [8]  83.02938  83.46748  85.22067
> rowMin(tmp5)
 [1] 56.64761 57.06295 55.87758       NA 57.31033 55.43169 54.54207 56.90429
 [9] 57.71160 57.14470
> 
> colMeans(tmp5)
 [1] 106.27555  71.85428        NA  69.69742  68.98379  69.97023  70.00369
 [8]  65.46465  73.74200  70.49371  71.30400  64.64278  68.57281  70.30649
[15]  71.60040  70.80576  71.14548  71.06131  68.96506  68.08925
> colSums(tmp5)
 [1] 1062.7555  718.5428        NA  696.9742  689.8379  699.7023  700.0369
 [8]  654.6465  737.4200  704.9371  713.0400  646.4278  685.7281  703.0649
[15]  716.0040  708.0576  711.4548  710.6131  689.6506  680.8925
> colVars(tmp5)
 [1] 16477.78911    48.66136          NA   103.28093    83.76023    62.27263
 [7]    63.59198    26.38398   111.03022    70.23649    56.99354    73.18945
[13]    90.91053   107.98373    36.91807    32.78281    95.43997    43.06991
[19]    35.64283    46.99282
> colSd(tmp5)
 [1] 128.365841   6.975769         NA  10.162723   9.152062   7.891301
 [7]   7.974458   5.136534  10.537088   8.380722   7.549406   8.555083
[13]   9.534701  10.391522   6.076025   5.725628   9.769338   6.562767
[19]   5.970161   6.855131
> colMax(tmp5)
 [1] 471.29993  78.62506        NA  90.71058  85.40261  79.35218  83.06007
 [8]  74.45218  86.51071  85.22067  79.54097  84.79290  84.57687  83.46748
[15]  80.97950  79.31763  90.05485  79.72693  81.22031  77.99782
> colMin(tmp5)
 [1] 54.54207 60.35638       NA 57.06933 55.87758 57.34215 60.90572 59.20716
 [9] 57.27936 59.70496 58.45653 57.06295 55.43169 57.31033 58.94893 62.32359
[17] 56.64761 56.90429 62.18405 60.44856
> 
> Max(tmp5,na.rm=TRUE)
[1] 471.2999
> Min(tmp5,na.rm=TRUE)
[1] 54.54207
> mean(tmp5,na.rm=TRUE)
[1] 71.93186
> Sum(tmp5,na.rm=TRUE)
[1] 14314.44
> Var(tmp5,na.rm=TRUE)
[1] 873.9774
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 91.24169 73.32032 71.26387 66.54438 67.34855 68.29962 67.55084 70.50533
 [9] 71.81459 71.16003
> rowSums(tmp5,na.rm=TRUE)
 [1] 1824.834 1466.406 1425.277 1264.343 1346.971 1365.992 1351.017 1410.107
 [9] 1436.292 1423.201
> rowVars(tmp5,na.rm=TRUE)
 [1] 8079.70748   87.65823   93.02684   52.69507   40.97285   60.76168
 [7]   34.62432   47.49086   67.30507   63.29055
> rowSd(tmp5,na.rm=TRUE)
 [1] 89.887193  9.362598  9.645042  7.259137  6.401004  7.794978  5.884243
 [8]  6.891361  8.203967  7.955536
> rowMax(tmp5,na.rm=TRUE)
 [1] 471.29993  90.05485  91.37860  80.62881  78.68353  83.20190  79.54097
 [8]  83.02938  83.46748  85.22067
> rowMin(tmp5,na.rm=TRUE)
 [1] 56.64761 57.06295 55.87758 57.06933 57.31033 55.43169 54.54207 56.90429
 [9] 57.71160 57.14470
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 106.27555  71.85428  76.07262  69.69742  68.98379  69.97023  70.00369
 [8]  65.46465  73.74200  70.49371  71.30400  64.64278  68.57281  70.30649
[15]  71.60040  70.80576  71.14548  71.06131  68.96506  68.08925
> colSums(tmp5,na.rm=TRUE)
 [1] 1062.7555  718.5428  684.6536  696.9742  689.8379  699.7023  700.0369
 [8]  654.6465  737.4200  704.9371  713.0400  646.4278  685.7281  703.0649
[15]  716.0040  708.0576  711.4548  710.6131  689.6506  680.8925
> colVars(tmp5,na.rm=TRUE)
 [1] 16477.78911    48.66136    59.24744   103.28093    83.76023    62.27263
 [7]    63.59198    26.38398   111.03022    70.23649    56.99354    73.18945
[13]    90.91053   107.98373    36.91807    32.78281    95.43997    43.06991
[19]    35.64283    46.99282
> colSd(tmp5,na.rm=TRUE)
 [1] 128.365841   6.975769   7.697236  10.162723   9.152062   7.891301
 [7]   7.974458   5.136534  10.537088   8.380722   7.549406   8.555083
[13]   9.534701  10.391522   6.076025   5.725628   9.769338   6.562767
[19]   5.970161   6.855131
> colMax(tmp5,na.rm=TRUE)
 [1] 471.29993  78.62506  91.37860  90.71058  85.40261  79.35218  83.06007
 [8]  74.45218  86.51071  85.22067  79.54097  84.79290  84.57687  83.46748
[15]  80.97950  79.31763  90.05485  79.72693  81.22031  77.99782
> colMin(tmp5,na.rm=TRUE)
 [1] 54.54207 60.35638 64.41060 57.06933 55.87758 57.34215 60.90572 59.20716
 [9] 57.27936 59.70496 58.45653 57.06295 55.43169 57.31033 58.94893 62.32359
[17] 56.64761 56.90429 62.18405 60.44856
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1] 91.24169 73.32032 71.26387      NaN 67.34855 68.29962 67.55084 70.50533
 [9] 71.81459 71.16003
> rowSums(tmp5,na.rm=TRUE)
 [1] 1824.834 1466.406 1425.277    0.000 1346.971 1365.992 1351.017 1410.107
 [9] 1436.292 1423.201
> rowVars(tmp5,na.rm=TRUE)
 [1] 8079.70748   87.65823   93.02684         NA   40.97285   60.76168
 [7]   34.62432   47.49086   67.30507   63.29055
> rowSd(tmp5,na.rm=TRUE)
 [1] 89.887193  9.362598  9.645042        NA  6.401004  7.794978  5.884243
 [8]  6.891361  8.203967  7.955536
> rowMax(tmp5,na.rm=TRUE)
 [1] 471.29993  90.05485  91.37860        NA  78.68353  83.20190  79.54097
 [8]  83.02938  83.46748  85.22067
> rowMin(tmp5,na.rm=TRUE)
 [1] 56.64761 57.06295 55.87758       NA 57.31033 55.43169 54.54207 56.90429
 [9] 57.71160 57.14470
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1] 111.03376  71.62157       NaN  71.10054  68.73304  71.37335  70.83600
 [8]  64.46604  74.93137  71.69246  72.73149  65.13778  68.69879  71.27812
[15]  71.14986  70.50911  70.09178  71.28072  68.41820  68.85417
> colSums(tmp5,na.rm=TRUE)
 [1] 999.3038 644.5941   0.0000 639.9048 618.5973 642.3601 637.5240 580.1943
 [9] 674.3823 645.2321 654.5834 586.2400 618.2891 641.5031 640.3487 634.5820
[17] 630.8260 641.5265 615.7638 619.6876
> colVars(tmp5,na.rm=TRUE)
 [1] 18282.80605    54.13478          NA    94.04263    93.52288    47.90831
 [7]    63.74772    18.46314   108.99489    62.84981    41.19311    79.58159
[13]   102.09580   110.86099    39.24924    35.89070    94.87919    47.91206
[19]    36.73381    46.28440
> colSd(tmp5,na.rm=TRUE)
 [1] 135.213927   7.357634         NA   9.697558   9.670723   6.921583
 [7]   7.984217   4.296875  10.440062   7.927787   6.418186   8.920851
[13]  10.104247  10.529054   6.264922   5.990885   9.740595   6.921854
[19]   6.060843   6.803264
> colMax(tmp5,na.rm=TRUE)
 [1] 471.29993  78.62506      -Inf  90.71058  85.40261  79.35218  83.06007
 [8]  70.98935  86.51071  85.22067  79.54097  84.79290  84.57687  83.46748
[15]  80.97950  79.31763  90.05485  79.72693  81.22031  77.99782
> colMin(tmp5,na.rm=TRUE)
 [1] 54.54207 60.35638      Inf 58.26893 55.87758 61.95545 60.90572 59.20716
 [9] 57.27936 62.91750 65.13848 57.06295 55.43169 57.31033 58.94893 62.32359
[17] 56.64761 56.90429 62.18405 60.44856
> 
> 
> 
> 
> 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] 310.1014 250.9681 106.1345 211.9857 273.7624 232.6974 193.0684 127.1902
 [9] 157.9522 374.8329
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 310.1014 250.9681 106.1345 211.9857 273.7624 232.6974 193.0684 127.1902
 [9] 157.9522 374.8329
> 
> 
> 
> copymatrix <- matrix(rnorm(200,150,15),10,20)
> 
> tmp5[1:10,1:20] <- copymatrix
> which.row <- 1
> which.col  <- 3
> cat(which.row," ",which.col,"\n")
1   3 
> tmp5[which.row,which.col] <- NA
> copymatrix[which.row,which.col] <- NA
> 
> colVars(tmp5,na.rm=TRUE)-apply(copymatrix,2,var,na.rm=TRUE)
 [1]  1.421085e-14  0.000000e+00 -1.421085e-14 -1.136868e-13 -1.705303e-13
 [6] -5.684342e-14 -5.684342e-14  1.136868e-13  0.000000e+00  5.684342e-14
[11]  8.526513e-14  1.421085e-13  0.000000e+00  5.684342e-14 -2.842171e-14
[16] -1.136868e-13 -1.705303e-13 -2.273737e-13  1.136868e-13 -7.105427e-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)
+ }
7   20 
5   7 
1   15 
1   19 
10   4 
6   7 
2   11 
9   10 
3   13 
10   2 
8   10 
6   11 
2   18 
7   2 
7   10 
7   6 
6   12 
8   5 
7   15 
3   9 
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.732554
> Min(tmp)
[1] -1.989105
> mean(tmp)
[1] 0.1813369
> Sum(tmp)
[1] 18.13369
> Var(tmp)
[1] 0.7879686
> 
> rowMeans(tmp)
[1] 0.1813369
> rowSums(tmp)
[1] 18.13369
> rowVars(tmp)
[1] 0.7879686
> rowSd(tmp)
[1] 0.8876759
> rowMax(tmp)
[1] 2.732554
> rowMin(tmp)
[1] -1.989105
> 
> colMeans(tmp)
  [1] -0.02657093  1.55555674  0.12850381  1.30395093  0.47776796 -1.23987683
  [7]  1.60425437  0.02483447  1.56120441  0.31861704  1.50370183 -0.10878168
 [13]  0.31334518  1.33129752 -0.95455184  0.72324671  0.20611906 -0.85676674
 [19] -1.23238561 -0.29083268 -0.63256991  0.34704862 -0.35952506  0.58030099
 [25] -1.30213154 -0.63812953 -0.14796808  0.66268267  0.92317382 -1.98910521
 [31] -0.56964027  0.54167428 -0.72972320 -0.17148355  0.16783619 -0.77331165
 [37]  1.88295696  0.07608046  0.75718199  1.08671306  0.15458518 -0.93456110
 [43]  0.40671179  1.04184907  2.73255401 -0.68990260  1.13653684  0.70252710
 [49]  0.35495900  0.04715374  0.60813777  0.31772422 -0.68119422 -0.95803937
 [55]  1.28490298  1.56344205  1.30937989 -0.93542646  1.04289550 -0.06530823
 [61]  1.83487949 -1.84931567 -0.38167866 -0.78672547  0.21476423 -1.68149068
 [67]  0.36834889 -0.09916172  0.76842096 -0.67399057  0.13577703 -0.33160834
 [73]  0.14932210  0.06184652  0.58375125  0.91051574  0.85984328  0.99472325
 [79] -0.46775551  1.06385401  1.06019392  0.09018427 -0.10837531  0.37125477
 [85] -0.80332283 -0.07581864 -0.96334634 -0.38562462 -0.89472600  1.03357700
 [91] -0.10345076 -0.32411757 -0.21413860  1.53581823  0.02585157 -0.53845375
 [97]  0.97200227  0.36149873  0.51801716  0.40872605
> colSums(tmp)
  [1] -0.02657093  1.55555674  0.12850381  1.30395093  0.47776796 -1.23987683
  [7]  1.60425437  0.02483447  1.56120441  0.31861704  1.50370183 -0.10878168
 [13]  0.31334518  1.33129752 -0.95455184  0.72324671  0.20611906 -0.85676674
 [19] -1.23238561 -0.29083268 -0.63256991  0.34704862 -0.35952506  0.58030099
 [25] -1.30213154 -0.63812953 -0.14796808  0.66268267  0.92317382 -1.98910521
 [31] -0.56964027  0.54167428 -0.72972320 -0.17148355  0.16783619 -0.77331165
 [37]  1.88295696  0.07608046  0.75718199  1.08671306  0.15458518 -0.93456110
 [43]  0.40671179  1.04184907  2.73255401 -0.68990260  1.13653684  0.70252710
 [49]  0.35495900  0.04715374  0.60813777  0.31772422 -0.68119422 -0.95803937
 [55]  1.28490298  1.56344205  1.30937989 -0.93542646  1.04289550 -0.06530823
 [61]  1.83487949 -1.84931567 -0.38167866 -0.78672547  0.21476423 -1.68149068
 [67]  0.36834889 -0.09916172  0.76842096 -0.67399057  0.13577703 -0.33160834
 [73]  0.14932210  0.06184652  0.58375125  0.91051574  0.85984328  0.99472325
 [79] -0.46775551  1.06385401  1.06019392  0.09018427 -0.10837531  0.37125477
 [85] -0.80332283 -0.07581864 -0.96334634 -0.38562462 -0.89472600  1.03357700
 [91] -0.10345076 -0.32411757 -0.21413860  1.53581823  0.02585157 -0.53845375
 [97]  0.97200227  0.36149873  0.51801716  0.40872605
> 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.02657093  1.55555674  0.12850381  1.30395093  0.47776796 -1.23987683
  [7]  1.60425437  0.02483447  1.56120441  0.31861704  1.50370183 -0.10878168
 [13]  0.31334518  1.33129752 -0.95455184  0.72324671  0.20611906 -0.85676674
 [19] -1.23238561 -0.29083268 -0.63256991  0.34704862 -0.35952506  0.58030099
 [25] -1.30213154 -0.63812953 -0.14796808  0.66268267  0.92317382 -1.98910521
 [31] -0.56964027  0.54167428 -0.72972320 -0.17148355  0.16783619 -0.77331165
 [37]  1.88295696  0.07608046  0.75718199  1.08671306  0.15458518 -0.93456110
 [43]  0.40671179  1.04184907  2.73255401 -0.68990260  1.13653684  0.70252710
 [49]  0.35495900  0.04715374  0.60813777  0.31772422 -0.68119422 -0.95803937
 [55]  1.28490298  1.56344205  1.30937989 -0.93542646  1.04289550 -0.06530823
 [61]  1.83487949 -1.84931567 -0.38167866 -0.78672547  0.21476423 -1.68149068
 [67]  0.36834889 -0.09916172  0.76842096 -0.67399057  0.13577703 -0.33160834
 [73]  0.14932210  0.06184652  0.58375125  0.91051574  0.85984328  0.99472325
 [79] -0.46775551  1.06385401  1.06019392  0.09018427 -0.10837531  0.37125477
 [85] -0.80332283 -0.07581864 -0.96334634 -0.38562462 -0.89472600  1.03357700
 [91] -0.10345076 -0.32411757 -0.21413860  1.53581823  0.02585157 -0.53845375
 [97]  0.97200227  0.36149873  0.51801716  0.40872605
> colMin(tmp)
  [1] -0.02657093  1.55555674  0.12850381  1.30395093  0.47776796 -1.23987683
  [7]  1.60425437  0.02483447  1.56120441  0.31861704  1.50370183 -0.10878168
 [13]  0.31334518  1.33129752 -0.95455184  0.72324671  0.20611906 -0.85676674
 [19] -1.23238561 -0.29083268 -0.63256991  0.34704862 -0.35952506  0.58030099
 [25] -1.30213154 -0.63812953 -0.14796808  0.66268267  0.92317382 -1.98910521
 [31] -0.56964027  0.54167428 -0.72972320 -0.17148355  0.16783619 -0.77331165
 [37]  1.88295696  0.07608046  0.75718199  1.08671306  0.15458518 -0.93456110
 [43]  0.40671179  1.04184907  2.73255401 -0.68990260  1.13653684  0.70252710
 [49]  0.35495900  0.04715374  0.60813777  0.31772422 -0.68119422 -0.95803937
 [55]  1.28490298  1.56344205  1.30937989 -0.93542646  1.04289550 -0.06530823
 [61]  1.83487949 -1.84931567 -0.38167866 -0.78672547  0.21476423 -1.68149068
 [67]  0.36834889 -0.09916172  0.76842096 -0.67399057  0.13577703 -0.33160834
 [73]  0.14932210  0.06184652  0.58375125  0.91051574  0.85984328  0.99472325
 [79] -0.46775551  1.06385401  1.06019392  0.09018427 -0.10837531  0.37125477
 [85] -0.80332283 -0.07581864 -0.96334634 -0.38562462 -0.89472600  1.03357700
 [91] -0.10345076 -0.32411757 -0.21413860  1.53581823  0.02585157 -0.53845375
 [97]  0.97200227  0.36149873  0.51801716  0.40872605
> colMedians(tmp)
  [1] -0.02657093  1.55555674  0.12850381  1.30395093  0.47776796 -1.23987683
  [7]  1.60425437  0.02483447  1.56120441  0.31861704  1.50370183 -0.10878168
 [13]  0.31334518  1.33129752 -0.95455184  0.72324671  0.20611906 -0.85676674
 [19] -1.23238561 -0.29083268 -0.63256991  0.34704862 -0.35952506  0.58030099
 [25] -1.30213154 -0.63812953 -0.14796808  0.66268267  0.92317382 -1.98910521
 [31] -0.56964027  0.54167428 -0.72972320 -0.17148355  0.16783619 -0.77331165
 [37]  1.88295696  0.07608046  0.75718199  1.08671306  0.15458518 -0.93456110
 [43]  0.40671179  1.04184907  2.73255401 -0.68990260  1.13653684  0.70252710
 [49]  0.35495900  0.04715374  0.60813777  0.31772422 -0.68119422 -0.95803937
 [55]  1.28490298  1.56344205  1.30937989 -0.93542646  1.04289550 -0.06530823
 [61]  1.83487949 -1.84931567 -0.38167866 -0.78672547  0.21476423 -1.68149068
 [67]  0.36834889 -0.09916172  0.76842096 -0.67399057  0.13577703 -0.33160834
 [73]  0.14932210  0.06184652  0.58375125  0.91051574  0.85984328  0.99472325
 [79] -0.46775551  1.06385401  1.06019392  0.09018427 -0.10837531  0.37125477
 [85] -0.80332283 -0.07581864 -0.96334634 -0.38562462 -0.89472600  1.03357700
 [91] -0.10345076 -0.32411757 -0.21413860  1.53581823  0.02585157 -0.53845375
 [97]  0.97200227  0.36149873  0.51801716  0.40872605
> colRanges(tmp)
            [,1]     [,2]      [,3]     [,4]     [,5]      [,6]     [,7]
[1,] -0.02657093 1.555557 0.1285038 1.303951 0.477768 -1.239877 1.604254
[2,] -0.02657093 1.555557 0.1285038 1.303951 0.477768 -1.239877 1.604254
           [,8]     [,9]    [,10]    [,11]      [,12]     [,13]    [,14]
[1,] 0.02483447 1.561204 0.318617 1.503702 -0.1087817 0.3133452 1.331298
[2,] 0.02483447 1.561204 0.318617 1.503702 -0.1087817 0.3133452 1.331298
          [,15]     [,16]     [,17]      [,18]     [,19]      [,20]      [,21]
[1,] -0.9545518 0.7232467 0.2061191 -0.8567667 -1.232386 -0.2908327 -0.6325699
[2,] -0.9545518 0.7232467 0.2061191 -0.8567667 -1.232386 -0.2908327 -0.6325699
         [,22]      [,23]    [,24]     [,25]      [,26]      [,27]     [,28]
[1,] 0.3470486 -0.3595251 0.580301 -1.302132 -0.6381295 -0.1479681 0.6626827
[2,] 0.3470486 -0.3595251 0.580301 -1.302132 -0.6381295 -0.1479681 0.6626827
         [,29]     [,30]      [,31]     [,32]      [,33]      [,34]     [,35]
[1,] 0.9231738 -1.989105 -0.5696403 0.5416743 -0.7297232 -0.1714836 0.1678362
[2,] 0.9231738 -1.989105 -0.5696403 0.5416743 -0.7297232 -0.1714836 0.1678362
          [,36]    [,37]      [,38]    [,39]    [,40]     [,41]      [,42]
[1,] -0.7733117 1.882957 0.07608046 0.757182 1.086713 0.1545852 -0.9345611
[2,] -0.7733117 1.882957 0.07608046 0.757182 1.086713 0.1545852 -0.9345611
         [,43]    [,44]    [,45]      [,46]    [,47]     [,48]    [,49]
[1,] 0.4067118 1.041849 2.732554 -0.6899026 1.136537 0.7025271 0.354959
[2,] 0.4067118 1.041849 2.732554 -0.6899026 1.136537 0.7025271 0.354959
          [,50]     [,51]     [,52]      [,53]      [,54]    [,55]    [,56]
[1,] 0.04715374 0.6081378 0.3177242 -0.6811942 -0.9580394 1.284903 1.563442
[2,] 0.04715374 0.6081378 0.3177242 -0.6811942 -0.9580394 1.284903 1.563442
       [,57]      [,58]    [,59]       [,60]    [,61]     [,62]      [,63]
[1,] 1.30938 -0.9354265 1.042896 -0.06530823 1.834879 -1.849316 -0.3816787
[2,] 1.30938 -0.9354265 1.042896 -0.06530823 1.834879 -1.849316 -0.3816787
          [,64]     [,65]     [,66]     [,67]       [,68]    [,69]      [,70]
[1,] -0.7867255 0.2147642 -1.681491 0.3683489 -0.09916172 0.768421 -0.6739906
[2,] -0.7867255 0.2147642 -1.681491 0.3683489 -0.09916172 0.768421 -0.6739906
        [,71]      [,72]     [,73]      [,74]     [,75]     [,76]     [,77]
[1,] 0.135777 -0.3316083 0.1493221 0.06184652 0.5837512 0.9105157 0.8598433
[2,] 0.135777 -0.3316083 0.1493221 0.06184652 0.5837512 0.9105157 0.8598433
         [,78]      [,79]    [,80]    [,81]      [,82]      [,83]     [,84]
[1,] 0.9947233 -0.4677555 1.063854 1.060194 0.09018427 -0.1083753 0.3712548
[2,] 0.9947233 -0.4677555 1.063854 1.060194 0.09018427 -0.1083753 0.3712548
          [,85]       [,86]      [,87]      [,88]     [,89]    [,90]      [,91]
[1,] -0.8033228 -0.07581864 -0.9633463 -0.3856246 -0.894726 1.033577 -0.1034508
[2,] -0.8033228 -0.07581864 -0.9633463 -0.3856246 -0.894726 1.033577 -0.1034508
          [,92]      [,93]    [,94]      [,95]      [,96]     [,97]     [,98]
[1,] -0.3241176 -0.2141386 1.535818 0.02585157 -0.5384538 0.9720023 0.3614987
[2,] -0.3241176 -0.2141386 1.535818 0.02585157 -0.5384538 0.9720023 0.3614987
         [,99]    [,100]
[1,] 0.5180172 0.4087261
[2,] 0.5180172 0.4087261
> 
> 
> Max(tmp2)
[1] 2.723487
> Min(tmp2)
[1] -1.59213
> mean(tmp2)
[1] 0.09899404
> Sum(tmp2)
[1] 9.899404
> Var(tmp2)
[1] 0.7356191
> 
> rowMeans(tmp2)
  [1]  0.0794929569 -0.4088028325  0.9747055215 -0.1095893141 -1.3872221613
  [6] -0.7428908367 -0.1862495060  1.0969150132 -0.0388715134  0.6302137347
 [11] -0.7678417657  0.4581981210  1.4681452432 -0.1552142867  0.9506891473
 [16]  0.3038045843  0.3042760098  2.0710251257 -0.1821246816 -0.4359639089
 [21] -0.5605905724 -0.6574242057 -1.2163302374  1.1474291447  0.8938628779
 [26]  0.7158990920  0.6450898938  0.1256090796  1.5691707939  0.1815136243
 [31]  0.4058879350 -0.9341232975  0.7840191967  0.0001294059  0.8109299212
 [36]  0.5219802174  0.6911935603  0.0938196494  0.0069232786  0.1388331755
 [41] -1.5921303410 -0.2184268516  0.6779862224  0.1378590238  1.2672390187
 [46] -0.7280978890  0.0999763556  0.4010308492 -0.2618884823 -0.7784045003
 [51]  1.5037007458 -0.2807001848 -0.2420018088  0.8559180564 -0.4196011874
 [56] -0.0395039337  0.1122046723  2.7234872115 -0.2538506411 -0.3454625701
 [61]  0.9438606685  2.0190309710 -0.0282254627  1.6281879310 -0.1440050512
 [66]  1.3279708634  0.2401838796 -0.2281015028 -0.2072203612 -1.4403830419
 [71] -0.1931715258 -0.9671143752 -1.0560160864  0.1046998772  1.2372046479
 [76] -0.9474614517 -0.2531940896 -0.0404861520  0.4898051864 -0.5716729480
 [81]  0.0161397856 -1.0820416616 -0.6366704247  0.2094466179  0.2934562051
 [86] -0.2062450718 -0.0376583087  1.0154925564  1.1444409791 -1.3172536012
 [91] -0.3933724362  0.2401682180  0.0485576635 -0.8652310672 -1.2428143964
 [96] -1.0070868867 -1.1678713041  1.9582896223  0.0074938443 -0.8975789320
> rowSums(tmp2)
  [1]  0.0794929569 -0.4088028325  0.9747055215 -0.1095893141 -1.3872221613
  [6] -0.7428908367 -0.1862495060  1.0969150132 -0.0388715134  0.6302137347
 [11] -0.7678417657  0.4581981210  1.4681452432 -0.1552142867  0.9506891473
 [16]  0.3038045843  0.3042760098  2.0710251257 -0.1821246816 -0.4359639089
 [21] -0.5605905724 -0.6574242057 -1.2163302374  1.1474291447  0.8938628779
 [26]  0.7158990920  0.6450898938  0.1256090796  1.5691707939  0.1815136243
 [31]  0.4058879350 -0.9341232975  0.7840191967  0.0001294059  0.8109299212
 [36]  0.5219802174  0.6911935603  0.0938196494  0.0069232786  0.1388331755
 [41] -1.5921303410 -0.2184268516  0.6779862224  0.1378590238  1.2672390187
 [46] -0.7280978890  0.0999763556  0.4010308492 -0.2618884823 -0.7784045003
 [51]  1.5037007458 -0.2807001848 -0.2420018088  0.8559180564 -0.4196011874
 [56] -0.0395039337  0.1122046723  2.7234872115 -0.2538506411 -0.3454625701
 [61]  0.9438606685  2.0190309710 -0.0282254627  1.6281879310 -0.1440050512
 [66]  1.3279708634  0.2401838796 -0.2281015028 -0.2072203612 -1.4403830419
 [71] -0.1931715258 -0.9671143752 -1.0560160864  0.1046998772  1.2372046479
 [76] -0.9474614517 -0.2531940896 -0.0404861520  0.4898051864 -0.5716729480
 [81]  0.0161397856 -1.0820416616 -0.6366704247  0.2094466179  0.2934562051
 [86] -0.2062450718 -0.0376583087  1.0154925564  1.1444409791 -1.3172536012
 [91] -0.3933724362  0.2401682180  0.0485576635 -0.8652310672 -1.2428143964
 [96] -1.0070868867 -1.1678713041  1.9582896223  0.0074938443 -0.8975789320
> 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.0794929569 -0.4088028325  0.9747055215 -0.1095893141 -1.3872221613
  [6] -0.7428908367 -0.1862495060  1.0969150132 -0.0388715134  0.6302137347
 [11] -0.7678417657  0.4581981210  1.4681452432 -0.1552142867  0.9506891473
 [16]  0.3038045843  0.3042760098  2.0710251257 -0.1821246816 -0.4359639089
 [21] -0.5605905724 -0.6574242057 -1.2163302374  1.1474291447  0.8938628779
 [26]  0.7158990920  0.6450898938  0.1256090796  1.5691707939  0.1815136243
 [31]  0.4058879350 -0.9341232975  0.7840191967  0.0001294059  0.8109299212
 [36]  0.5219802174  0.6911935603  0.0938196494  0.0069232786  0.1388331755
 [41] -1.5921303410 -0.2184268516  0.6779862224  0.1378590238  1.2672390187
 [46] -0.7280978890  0.0999763556  0.4010308492 -0.2618884823 -0.7784045003
 [51]  1.5037007458 -0.2807001848 -0.2420018088  0.8559180564 -0.4196011874
 [56] -0.0395039337  0.1122046723  2.7234872115 -0.2538506411 -0.3454625701
 [61]  0.9438606685  2.0190309710 -0.0282254627  1.6281879310 -0.1440050512
 [66]  1.3279708634  0.2401838796 -0.2281015028 -0.2072203612 -1.4403830419
 [71] -0.1931715258 -0.9671143752 -1.0560160864  0.1046998772  1.2372046479
 [76] -0.9474614517 -0.2531940896 -0.0404861520  0.4898051864 -0.5716729480
 [81]  0.0161397856 -1.0820416616 -0.6366704247  0.2094466179  0.2934562051
 [86] -0.2062450718 -0.0376583087  1.0154925564  1.1444409791 -1.3172536012
 [91] -0.3933724362  0.2401682180  0.0485576635 -0.8652310672 -1.2428143964
 [96] -1.0070868867 -1.1678713041  1.9582896223  0.0074938443 -0.8975789320
> rowMin(tmp2)
  [1]  0.0794929569 -0.4088028325  0.9747055215 -0.1095893141 -1.3872221613
  [6] -0.7428908367 -0.1862495060  1.0969150132 -0.0388715134  0.6302137347
 [11] -0.7678417657  0.4581981210  1.4681452432 -0.1552142867  0.9506891473
 [16]  0.3038045843  0.3042760098  2.0710251257 -0.1821246816 -0.4359639089
 [21] -0.5605905724 -0.6574242057 -1.2163302374  1.1474291447  0.8938628779
 [26]  0.7158990920  0.6450898938  0.1256090796  1.5691707939  0.1815136243
 [31]  0.4058879350 -0.9341232975  0.7840191967  0.0001294059  0.8109299212
 [36]  0.5219802174  0.6911935603  0.0938196494  0.0069232786  0.1388331755
 [41] -1.5921303410 -0.2184268516  0.6779862224  0.1378590238  1.2672390187
 [46] -0.7280978890  0.0999763556  0.4010308492 -0.2618884823 -0.7784045003
 [51]  1.5037007458 -0.2807001848 -0.2420018088  0.8559180564 -0.4196011874
 [56] -0.0395039337  0.1122046723  2.7234872115 -0.2538506411 -0.3454625701
 [61]  0.9438606685  2.0190309710 -0.0282254627  1.6281879310 -0.1440050512
 [66]  1.3279708634  0.2401838796 -0.2281015028 -0.2072203612 -1.4403830419
 [71] -0.1931715258 -0.9671143752 -1.0560160864  0.1046998772  1.2372046479
 [76] -0.9474614517 -0.2531940896 -0.0404861520  0.4898051864 -0.5716729480
 [81]  0.0161397856 -1.0820416616 -0.6366704247  0.2094466179  0.2934562051
 [86] -0.2062450718 -0.0376583087  1.0154925564  1.1444409791 -1.3172536012
 [91] -0.3933724362  0.2401682180  0.0485576635 -0.8652310672 -1.2428143964
 [96] -1.0070868867 -1.1678713041  1.9582896223  0.0074938443 -0.8975789320
> 
> colMeans(tmp2)
[1] 0.09899404
> colSums(tmp2)
[1] 9.899404
> colVars(tmp2)
[1] 0.7356191
> colSd(tmp2)
[1] 0.8576824
> colMax(tmp2)
[1] 2.723487
> colMin(tmp2)
[1] -1.59213
> colMedians(tmp2)
[1] 0.007208561
> colRanges(tmp2)
          [,1]
[1,] -1.592130
[2,]  2.723487
> 
> dataset1 <- matrix(dataset1,1,100)
> 
> agree.checks(tmp,dataset1)
> 
> dataset2 <- matrix(dataset2,100,1)
> agree.checks(tmp2,dataset2)
>   
> 
> tmp <- createBufferedMatrix(10,10)
> 
> tmp[1:10,1:10] <- rnorm(100)
> colApply(tmp,sum)
 [1] -1.4561397 -0.2043599 -2.8670574  0.2756587 -0.1362538  4.4133901
 [7]  2.6918190  4.9545906 -1.0960473  1.6684701
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -1.8036923
[2,] -0.3852921
[3,]  0.1140224
[4,]  0.2601340
[5,]  0.4213439
> 
> rowApply(tmp,sum)
 [1] -2.1460360 -4.3808990  1.5369824  3.1116398  4.1422539  1.6012183
 [7] -0.5334267  5.5931724 -3.0730774  2.3922428
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    1    8    1    7    4    6    7    4    9     3
 [2,]    7    3    3   10    2    1    4    2    4    10
 [3,]    6    2    4    8    6    2    2    1    5     6
 [4,]    3   10    9    4    7    7    5    6    2     1
 [5,]    8    4    6    2    5    4    3    3    8     9
 [6,]    2    7    7    5    9    3    9    9   10     8
 [7,]    4    6    2    3    8    9   10    7    1     7
 [8,]    9    9    8    1   10    5    6   10    7     4
 [9,]    5    1   10    6    3    8    1    8    6     2
[10,]   10    5    5    9    1   10    8    5    3     5
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1]  5.46965099  0.01502295 -0.02932651  0.13920538  1.81131247  2.72954629
 [7]  1.94381269  5.12957347 -0.59572750 -4.45709993  0.11344907 -0.03377761
[13] -1.44970635  6.16226956 -3.08120961 -2.21000758 -0.46879720 -0.61768153
[19] -3.40606177  7.18084317
> colApply(tmp,quantile)[,1]
            [,1]
[1,] -0.01676233
[2,]  0.64155916
[3,]  1.21740359
[4,]  1.59443494
[5,]  2.03301564
> 
> rowApply(tmp,sum)
[1]  5.5357469  2.3553674  6.8040450 -1.0206345  0.6707657
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]   12   20   18   10   20
[2,]   17    5    3   16    6
[3,]   11   12   12    8    4
[4,]   19    7    1   13   15
[5,]    7   16   13   18    7
> 
> 
> as.matrix(tmp)
            [,1]       [,2]       [,3]         [,4]        [,5]       [,6]
[1,]  0.64155916  1.0980801  0.6380456  1.513576637 -0.06265223 -0.4063675
[2,]  1.59443494 -0.5535624  0.4407567  0.009929921  0.92480479  1.5880208
[3,]  1.21740359 -0.5937683  0.3548772 -2.579151024  0.39156600  1.1888648
[4,] -0.01676233  0.8185616 -0.4710450  0.304921920  1.14863062  0.6047050
[5,]  2.03301564 -0.7542881 -0.9919610  0.889927925 -0.59103671 -0.2456768
           [,7]       [,8]       [,9]       [,10]      [,11]      [,12]
[1,] -0.5680542  0.9971834  0.8507448 -0.40556392  1.4362089 -2.1460231
[2,]  1.4397133 -0.2927167  0.6765391 -2.52737303  0.3430879  0.7032591
[3,]  0.2381884  1.9313137 -1.3367113 -0.18311474 -0.3747148  2.8641297
[4,]  0.3729985  1.2850987 -0.9847330 -1.24453529 -1.6638660 -0.1117766
[5,]  0.4609667  1.2086944  0.1984330 -0.09651296  0.3727331 -1.3433667
          [,13]     [,14]       [,15]       [,16]      [,17]      [,18]
[1,]  0.4697256 0.8094144 -0.05113554  0.33037152 -1.0715742  0.6971499
[2,] -2.0459939 0.5720948 -0.56762754  0.32260208  0.2839021 -1.8379542
[3,] -0.1355467 0.9132640  0.25709521  0.07451302  0.1897684  0.2055893
[4,] -0.4877278 2.9025873  0.05845935 -1.63763337 -0.7926438  0.1132231
[5,]  0.7498365 0.9649089 -2.77800109 -1.29986083  0.9217502  0.2043103
          [,19]     [,20]
[1,] -1.7217391 2.4867966
[2,]  0.2861644 0.9952853
[3,]  1.1725022 1.0079762
[4,] -2.2684206 1.0493231
[5,] -0.8745687 1.6414620
> 
> 
> is.BufferedMatrix(tmp)
[1] TRUE
> 
> as.BufferedMatrix(as.matrix(tmp))
BufferedMatrix object
Matrix size:  5 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  800  bytes.
> 
> 
> 
> subBufferedMatrix(tmp,1:5,1:5)
BufferedMatrix object
Matrix size:  5 5 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  649  bytes.
Disk usage :  200  bytes.
> subBufferedMatrix(tmp,,5:8)
BufferedMatrix object
Matrix size:  5 4 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  562  bytes.
Disk usage :  160  bytes.
> subBufferedMatrix(tmp,1:3,)
BufferedMatrix object
Matrix size:  3 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  480  bytes.
> 
> 
> rm(tmp)
> 
> 
> ###
> ### Testing colnames and rownames
> ###
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> 
> 
> colnames(tmp)
NULL
> rownames(tmp)
NULL
> 
> 
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> colnames(tmp)
 [1] "col1"  "col2"  "col3"  "col4"  "col5"  "col6"  "col7"  "col8"  "col9" 
[10] "col10" "col11" "col12" "col13" "col14" "col15" "col16" "col17" "col18"
[19] "col19" "col20"
> rownames(tmp)
[1] "row1" "row2" "row3" "row4" "row5"
> 
> 
> tmp["row1",]
        col1     col2      col3      col4       col5      col6      col7
row1 0.91566 1.013621 0.5135399 -1.332424 -0.4071551 0.4395599 0.4867319
         col8     col9    col10     col11     col12    col13     col14    col15
row1 0.739054 1.074391 -1.79334 0.7835629 -1.196733 1.104377 0.2159109 0.199053
          col16     col17     col18     col19    col20
row1 -0.2463785 0.6276322 -1.011726 0.2147811 1.208543
> tmp[,"col10"]
           col10
row1 -1.79333953
row2  0.44942757
row3 -2.60412401
row4  0.38270370
row5 -0.04902704
> tmp[c("row1","row5"),]
        col1      col2       col3        col4       col5      col6      col7
row1 0.91566  1.013621  0.5135399 -1.33242433 -0.4071551 0.4395599 0.4867319
row5 1.04224 -1.660834 -0.1820872  0.02550398 -0.1503976 1.3314217 0.9964382
           col8     col9       col10      col11      col12      col13     col14
row1  0.7390540 1.074391 -1.79333953 0.78356289 -1.1967330  1.1043769 0.2159109
row5 -0.8525137 1.056364 -0.04902704 0.06152541  0.1148486 -0.4734162 0.9170472
         col15      col16      col17     col18      col19      col20
row1 0.1990530 -0.2463785  0.6276322 -1.011726 0.21478112  1.2085431
row5 0.6236217  0.3014254 -0.8029784  1.572599 0.02670133 -0.3409649
> tmp[,c("col6","col20")]
           col6      col20
row1  0.4395599  1.2085431
row2  0.8277872 -1.3011647
row3  0.1059612 -1.1388523
row4 -1.7362829  1.0895433
row5  1.3314217 -0.3409649
> tmp[c("row1","row5"),c("col6","col20")]
          col6      col20
row1 0.4395599  1.2085431
row5 1.3314217 -0.3409649
> 
> 
> 
> 
> tmp["row1",] <- rnorm(20,mean=10)
> tmp[,"col10"] <- rnorm(5,mean=30)
> tmp[c("row1","row5"),] <- rnorm(40,mean=50)
> tmp[,c("col6","col20")] <- rnorm(10,mean=75)
> tmp[c("row1","row5"),c("col6","col20")]  <- rnorm(4,mean=105)
> 
> tmp["row1",]
         col1    col2     col3     col4     col5     col6    col7     col8
row1 50.30283 50.5519 49.04392 49.48171 49.64808 106.1864 50.2553 49.25074
         col9    col10    col11    col12    col13    col14    col15    col16
row1 50.81809 51.18926 50.13836 50.62369 49.04589 51.09575 51.08122 48.50987
        col17    col18    col19    col20
row1 49.33146 50.77564 50.74741 104.9008
> tmp[,"col10"]
        col10
row1 51.18926
row2 32.23526
row3 28.45156
row4 29.02954
row5 50.10340
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 50.30283 50.55190 49.04392 49.48171 49.64808 106.1864 50.25530 49.25074
row5 50.79610 51.24888 51.93404 49.13215 48.17067 104.7817 49.92245 49.46823
         col9    col10    col11    col12    col13    col14    col15    col16
row1 50.81809 51.18926 50.13836 50.62369 49.04589 51.09575 51.08122 48.50987
row5 50.55542 50.10340 50.58627 49.70687 50.30865 49.65813 50.37193 49.07809
        col17    col18    col19    col20
row1 49.33146 50.77564 50.74741 104.9008
row5 49.16014 51.08631 52.63202 104.3723
> tmp[,c("col6","col20")]
          col6     col20
row1 106.18642 104.90085
row2  75.43566  75.26388
row3  75.44504  75.89741
row4  73.44241  76.91975
row5 104.78168 104.37228
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 106.1864 104.9008
row5 104.7817 104.3723
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 106.1864 104.9008
row5 104.7817 104.3723
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
          col13
[1,]  0.5341798
[2,] -1.1677172
[3,] -1.5009553
[4,] -0.5825968
[5,] -1.3954927
> tmp[,c("col17","col7")]
          col17        col7
[1,] -0.1284007 -0.06256351
[2,] -0.9829497  1.28489554
[3,] -0.6559544  1.28848044
[4,] -1.4902259 -1.02826082
[5,]  0.1091370  1.57684701
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
           col6      col20
[1,]  1.7285476 -0.2196226
[2,] -0.1618673  0.5986470
[3,]  0.4863856 -1.4820659
[4,] -0.8646549 -0.3920117
[5,] -0.6052125  1.7176704
> subBufferedMatrix(tmp,1,c("col6"))[,1]
         col1
[1,] 1.728548
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
           col6
[1,]  1.7285476
[2,] -0.1618673
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> 
> 
> 
> subBufferedMatrix(tmp,c("row3","row1"),)[,1:20]
           [,1]        [,2]      [,3]       [,4]       [,5]      [,6]
row3 -2.0514004  0.05376466  2.062462 -0.8229917 -0.2981480 1.0758773
row1  0.2433421 -1.61659460 -0.209417  0.8964720  0.0992871 0.9699916
           [,7]      [,8]       [,9]      [,10]      [,11]      [,12]
row3 -0.6769519 0.3573422  0.1085776 -0.5568579  0.3164510 -1.2252551
row1  0.9459126 0.3783012 -0.3914545  0.4979803 -0.1831103 -0.4669484
          [,13]      [,14]     [,15]      [,16]     [,17]     [,18]      [,19]
row3  0.3530496  0.0378194 0.8352967  0.8789777 1.0622514 -1.235228 0.55226610
row1 -1.1524904 -0.4957508 0.8945188 -1.4284720 0.2207051  0.908102 0.03993803
         [,20]
row3  1.229295
row1 -1.335531
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
          [,1]     [,2]      [,3]       [,4]       [,5]      [,6]     [,7]
row2 0.6015092 1.133285 0.7686293 -0.6226516 -0.4283825 0.5807063 1.743709
           [,8]      [,9]     [,10]
row2 -0.2857724 0.0825321 0.9460803
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
          [,1]       [,2]       [,3]       [,4]       [,5]       [,6]
row5 0.1119487 -0.3917991 0.05542568 0.01996883 -0.3771538 -0.2020396
           [,7]      [,8]     [,9]     [,10]     [,11]    [,12]      [,13]
row5 -0.6900567 0.6955126 1.076893 0.4277873 0.7116813 1.325107 0.03134145
         [,14]     [,15]     [,16]     [,17]     [,18]       [,19]      [,20]
row5 0.9395104 -1.291135 0.1476977 0.3917666 -2.355038 -0.05631661 -0.2686731
> 
> 
> 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: 0x600000154000>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "/Users/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests/BMbdc23b8a348d"
 [2] "/Users/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests/BMbdc26e803384"
 [3] "/Users/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests/BMbdc222b657c9"
 [4] "/Users/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests/BMbdc2713d5eec"
 [5] "/Users/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests/BMbdc274231208"
 [6] "/Users/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests/BMbdc22a7506c9"
 [7] "/Users/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests/BMbdc269108be5"
 [8] "/Users/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests/BMbdc23d509d46"
 [9] "/Users/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests/BMbdc277857e1c"
[10] "/Users/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests/BMbdc25d1a9d91"
[11] "/Users/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests/BMbdc27e5eca57"
[12] "/Users/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests/BMbdc21365692" 
[13] "/Users/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests/BMbdc2166d8bdd"
[14] "/Users/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests/BMbdc271f965ab"
[15] "/Users/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests/BMbdc22c81f802"
> 
> 
> ### 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: 0x60000017c000>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x60000017c000>
Warning message:
In dir.create(new.directory) :
  '/Users/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x60000017c000>
> rowMedians(tmp)
  [1] -0.1055908175 -0.4154212418  0.5931443707 -0.2466680119 -0.0387579391
  [6]  0.3879090660  0.0299291821 -0.3960864444  0.4311232609  0.0985969965
 [11] -0.2504400541  0.0429395155 -0.3145279649  0.2463741326  0.0180543696
 [16] -0.5970083314  0.4944163960 -0.3661340224 -0.0423870614  0.0177932399
 [21]  0.3602245771 -0.3246847668  0.0196422618 -0.2463661567 -0.1236427028
 [26]  0.3407784441  0.0947190485  0.3116990702 -0.5927287230 -0.0006112559
 [31] -0.2189931804  0.1148096692  0.6424845716 -0.6146129750 -0.1587858556
 [36] -0.1246848335 -0.0129641470 -0.3484873129 -0.0515924893 -0.2686319182
 [41] -0.1049042428  0.2976777873  0.1688795208 -0.4243927327 -0.0203904928
 [46] -0.2213973996 -0.2994589156 -0.1389479495  0.0969455456  0.4633770365
 [51]  0.1139895778  0.0834955714  0.1283541213 -0.1251598367 -0.2275869073
 [56]  0.0388492588  0.0436586359  0.2338647354 -0.3318766440 -0.2809179293
 [61]  0.2775175705 -0.3031208962  0.3270878809 -0.2010515762 -0.0429253509
 [66] -0.2591848203 -0.1553357866  0.1246158691 -0.1111908277  0.1215996848
 [71]  0.5471166479  0.2159895372  0.0260657218 -0.4221850866  0.3575873855
 [76] -0.1295289735 -0.3548376942 -0.5378648115 -0.1841538870  0.3214884611
 [81] -0.1618255061  0.0497267842 -0.0047742523  0.2899003874 -0.0241533698
 [86] -0.3514163200  0.1119130633  0.0042361108  0.3341392374  0.2199123439
 [91] -0.0176535313  0.4113090172 -0.6057085099 -0.5650255059  0.4087750888
 [96]  0.1580506078  0.2102242912 -0.0718500204 -0.0998198234 -0.6719037460
[101] -0.3052858274 -0.1864267608 -0.2384129284 -0.2309630681  0.1347753863
[106]  0.3829732781  0.0993322943  0.2205522135  0.1061923890 -0.4556228293
[111] -0.5097077386 -0.0125428461  0.0504428407 -0.0919977707 -0.2433769563
[116] -0.0508530355  0.3401995109  0.4598356585 -0.1076353450  0.0376926507
[121] -0.4627328713  0.5690097508 -0.2602629524 -0.2769205970 -0.4531680589
[126] -0.8340889404 -0.2160439723 -0.2598477544 -0.3873493562 -0.1066950240
[131]  0.1908035937  0.0439272514  0.0933020583 -0.1005556759  0.3824444381
[136]  0.0155873860  0.1593386880 -0.3875974274  0.1470698015  0.1026431059
[141] -0.0035904753  0.3473228083  0.1312900102  0.2001159851  0.2231100603
[146]  0.1700891755 -0.2256661898  0.4260655648  0.0157284753 -0.2324513921
[151] -0.0054950964  0.1509355333 -0.3754762428 -0.3515248297 -0.2829816417
[156]  0.1001613405 -0.2214998926  0.0063891811  0.0809534984  0.0956450210
[161]  0.2328839336  0.4681097529 -0.2252238946 -0.5177995343 -0.2847023362
[166] -0.3822727979  0.0861689988 -0.0140121758  0.3989839511  0.5486136796
[171]  0.1132198141  0.4836082026 -0.2103148461 -0.1675731912  0.5517872254
[176]  0.4616208530  0.2151713905 -0.0627269843  0.3937353104 -0.1529619381
[181]  0.1685643344  0.0156660566  0.2343890791  0.1618586032  0.0787521560
[186]  0.1709218372  0.6307586175  0.5642588057  0.2743988904 -0.3963082221
[191]  0.2743521650  0.3769282528  0.1634739302  0.2804845106 -0.7573354295
[196] -0.4637147567  0.1173409927 -0.1568298710 -0.2383746021  0.5625545338
[201] -0.1588095998  0.0582323428  0.2046563767  0.0673051687 -0.1034177190
[206] -0.1928302266 -0.1589639669 -0.3615527285  0.0578040721  0.3420877090
[211]  0.6231964169  0.0551733809 -0.4577202940  0.5699317663  0.0631349486
[216] -0.2682227797 -0.3426374781  0.4248462000 -0.1320238487 -0.1765232571
[221]  0.2806274995 -0.0554639930 -0.0072810722 -0.1822201954  0.0199052223
[226] -0.1918233272  0.4049253951 -1.1480835657 -0.6220699964  0.3024462826
> 
> proc.time()
   user  system elapsed 
  2.617  14.784  18.341 

BufferedMatrix.Rcheck/tests/rawCalltesting.Rout


R version 4.4.0 beta (2024-04-14 r86421) -- "Puppy Cup"
Copyright (C) 2024 The R Foundation for Statistical Computing
Platform: x86_64-apple-darwin20

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

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

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

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

Attaching package: 'BufferedMatrix'

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

    colMeans, colSums, rowMeans, rowSums

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

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

<pointer: 0x600001a98000>
> .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: 0x600001a98000>
> .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: 0x600001a98000>
> .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: 0x600001a98000>
> 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: 0x600001ad8180>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600001ad8180>
> .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: 0x600001ad8180>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600001ad8180>
> .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: 0x600001ad8180>
> 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: 0x600001ad40c0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600001ad40c0>
> .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: 0x600001ad40c0>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x600001ad40c0>
> .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: 0x600001ad40c0>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x600001ad40c0>
> .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: 0x600001ad40c0>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x600001ad40c0>
> .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: 0x600001ad40c0>
> 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: 0x600001a90000>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x600001a90000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600001a90000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600001a90000>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFilec3ec23e5cc1b" "BufferedMatrixFilec3ec43bb1306"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFilec3ec23e5cc1b" "BufferedMatrixFilec3ec43bb1306"
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x600001a90240>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600001a90240>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x600001a90240>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x600001a90240>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x600001a90240>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x600001a90240>
> .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: 0x600001a88240>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600001a88240>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x600001a88240>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x600001a88240>
> 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: 0x600001aac000>
> .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: 0x600001aac000>
> rm(P)
> 
> proc.time()
   user  system elapsed 
  0.352   0.159   0.502 

BufferedMatrix.Rcheck/tests/Rcodetesting.Rout


R version 4.4.0 beta (2024-04-14 r86421) -- "Puppy Cup"
Copyright (C) 2024 The R Foundation for Statistical Computing
Platform: x86_64-apple-darwin20

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

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

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

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

Attaching package: 'BufferedMatrix'

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

    colMeans, colSums, rowMeans, rowSums

> 
> Temp <- createBufferedMatrix(100)
> dim(Temp)
[1] 100   0
> buffer.dim(Temp)
[1] 1 1
> 
> 
> proc.time()
   user  system elapsed 
  0.347   0.095   0.433 

Example timings