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

This page was generated on 2025-03-24 12:09 -0400 (Mon, 24 Mar 2025).

HostnameOSArch (*)R versionInstalled pkgs
nebbiolo2Linux (Ubuntu 24.04.1 LTS)x86_644.4.3 (2025-02-28) -- "Trophy Case" 4763
palomino8Windows Server 2022 Datacenterx644.4.3 (2025-02-28 ucrt) -- "Trophy Case" 4494
merida1macOS 12.7.5 Montereyx86_644.4.3 (2025-02-28) -- "Trophy Case" 4521
kjohnson1macOS 13.6.6 Venturaarm644.4.3 (2025-02-28) -- "Trophy Case" 4448
taishanLinux (openEuler 24.03 LTS)aarch644.4.3 (2025-02-28) -- "Trophy Case" 4414
Click on any hostname to see more info about the system (e.g. compilers)      (*) as reported by 'uname -p', except on Windows and Mac OS X

Package 251/2289HostnameOS / ArchINSTALLBUILDCHECKBUILD BIN
BufferedMatrix 1.70.0  (landing page)
Ben Bolstad
Snapshot Date: 2025-03-20 13:00 -0400 (Thu, 20 Mar 2025)
git_url: https://git.bioconductor.org/packages/BufferedMatrix
git_branch: RELEASE_3_20
git_last_commit: 32b6f6a
git_last_commit_date: 2024-10-29 09:27:20 -0400 (Tue, 29 Oct 2024)
nebbiolo2Linux (Ubuntu 24.04.1 LTS) / x86_64  OK    OK    OK  UNNEEDED, same version is already published
palomino8Windows Server 2022 Datacenter / x64  OK    OK    OK    OK  UNNEEDED, same version is already published
merida1macOS 12.7.5 Monterey / x86_64  OK    OK    WARNINGS    OK  UNNEEDED, same version is already published
kjohnson1macOS 13.6.6 Ventura / arm64  OK    OK    WARNINGS    OK  UNNEEDED, same version is already published
taishanLinux (openEuler 24.03 LTS) / aarch64  OK    OK    OK  


CHECK results for BufferedMatrix on kjohnson1

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

raw results


Summary

Package: BufferedMatrix
Version: 1.70.0
Command: /Library/Frameworks/R.framework/Resources/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/Library/Frameworks/R.framework/Resources/library --no-vignettes --timings BufferedMatrix_1.70.0.tar.gz
StartedAt: 2025-03-21 12:53:23 -0400 (Fri, 21 Mar 2025)
EndedAt: 2025-03-21 12:54:02 -0400 (Fri, 21 Mar 2025)
EllapsedTime: 39.2 seconds
RetCode: 0
Status:   WARNINGS  
CheckDir: BufferedMatrix.Rcheck
Warnings: 1

Command output

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


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

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


Installation output

BufferedMatrix.Rcheck/00install.out

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


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

Tests output

BufferedMatrix.Rcheck/tests/c_code_level_tests.Rout


R version 4.4.3 (2025-02-28) -- "Trophy Case"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: aarch64-apple-darwin20

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

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

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

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

Attaching package: 'BufferedMatrix'

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

    colMeans, colSums, rowMeans, rowSums

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

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

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

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

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

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

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

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

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

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

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

[[1]]
[1] 0

> 
> proc.time()
   user  system elapsed 
  0.348   0.126   0.467 

BufferedMatrix.Rcheck/tests/objectTesting.Rout


R version 4.4.3 (2025-02-28) -- "Trophy Case"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: aarch64-apple-darwin20

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

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

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

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

Attaching package: 'BufferedMatrix'

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

    colMeans, colSums, rowMeans, rowSums

> 
> 
> ### this is used to control how many repetitions in something below
> ### higher values result in more checks.
> nreps <-100 ##20000
> 
> 
> ## test creation and some simple assignments and subsetting operations
> 
> ## first on single elements
> tmp <- createBufferedMatrix(1000,10)
> 
> tmp[10,5]
[1] 0
> tmp[10,5] <- 10
> tmp[10,5]
[1] 10
> tmp[10,5] <- 12.445
> tmp[10,5]
[1] 12.445
> 
> 
> 
> ## now testing accessing multiple elements
> tmp2 <- createBufferedMatrix(10,20)
> 
> 
> tmp2[3,1] <- 51.34
> tmp2[9,2] <- 9.87654
> tmp2[,1:2]
       [,1]    [,2]
 [1,]  0.00 0.00000
 [2,]  0.00 0.00000
 [3,] 51.34 0.00000
 [4,]  0.00 0.00000
 [5,]  0.00 0.00000
 [6,]  0.00 0.00000
 [7,]  0.00 0.00000
 [8,]  0.00 0.00000
 [9,]  0.00 9.87654
[10,]  0.00 0.00000
> tmp2[,-(3:20)]
       [,1]    [,2]
 [1,]  0.00 0.00000
 [2,]  0.00 0.00000
 [3,] 51.34 0.00000
 [4,]  0.00 0.00000
 [5,]  0.00 0.00000
 [6,]  0.00 0.00000
 [7,]  0.00 0.00000
 [8,]  0.00 0.00000
 [9,]  0.00 9.87654
[10,]  0.00 0.00000
> tmp2[3,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
[1,] 51.34    0    0    0    0    0    0    0    0     0     0     0     0
     [,14] [,15] [,16] [,17] [,18] [,19] [,20]
[1,]     0     0     0     0     0     0     0
> tmp2[-3,]
      [,1]    [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [2,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [3,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [4,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [5,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [6,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [7,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [8,]    0 9.87654    0    0    0    0    0    0    0     0     0     0     0
 [9,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
      [,14] [,15] [,16] [,17] [,18] [,19] [,20]
 [1,]     0     0     0     0     0     0     0
 [2,]     0     0     0     0     0     0     0
 [3,]     0     0     0     0     0     0     0
 [4,]     0     0     0     0     0     0     0
 [5,]     0     0     0     0     0     0     0
 [6,]     0     0     0     0     0     0     0
 [7,]     0     0     0     0     0     0     0
 [8,]     0     0     0     0     0     0     0
 [9,]     0     0     0     0     0     0     0
> tmp2[2,1:3]
     [,1] [,2] [,3]
[1,]    0    0    0
> tmp2[3:9,1:3]
      [,1]    [,2] [,3]
[1,] 51.34 0.00000    0
[2,]  0.00 0.00000    0
[3,]  0.00 0.00000    0
[4,]  0.00 0.00000    0
[5,]  0.00 0.00000    0
[6,]  0.00 0.00000    0
[7,]  0.00 9.87654    0
> tmp2[-4,-4]
       [,1]    [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [2,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [3,] 51.34 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [4,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [5,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [6,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [7,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [8,]  0.00 9.87654    0    0    0    0    0    0    0     0     0     0     0
 [9,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
      [,14] [,15] [,16] [,17] [,18] [,19]
 [1,]     0     0     0     0     0     0
 [2,]     0     0     0     0     0     0
 [3,]     0     0     0     0     0     0
 [4,]     0     0     0     0     0     0
 [5,]     0     0     0     0     0     0
 [6,]     0     0     0     0     0     0
 [7,]     0     0     0     0     0     0
 [8,]     0     0     0     0     0     0
 [9,]     0     0     0     0     0     0
> 
> ## now testing accessing/assigning multiple elements
> tmp3 <- createBufferedMatrix(10,10)
> 
> for (i in 1:10){
+   for (j in 1:10){
+     tmp3[i,j] <- (j-1)*10 + i
+   }
+ }
> 
> tmp3[2:4,2:4]
     [,1] [,2] [,3]
[1,]   12   22   32
[2,]   13   23   33
[3,]   14   24   34
> tmp3[c(-10),c(2:4,2:4,10,1,2,1:10,10:1)]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]   11   21   31   11   21   31   91    1   11     1    11    21    31
 [2,]   12   22   32   12   22   32   92    2   12     2    12    22    32
 [3,]   13   23   33   13   23   33   93    3   13     3    13    23    33
 [4,]   14   24   34   14   24   34   94    4   14     4    14    24    34
 [5,]   15   25   35   15   25   35   95    5   15     5    15    25    35
 [6,]   16   26   36   16   26   36   96    6   16     6    16    26    36
 [7,]   17   27   37   17   27   37   97    7   17     7    17    27    37
 [8,]   18   28   38   18   28   38   98    8   18     8    18    28    38
 [9,]   19   29   39   19   29   39   99    9   19     9    19    29    39
      [,14] [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24] [,25]
 [1,]    41    51    61    71    81    91    91    81    71    61    51    41
 [2,]    42    52    62    72    82    92    92    82    72    62    52    42
 [3,]    43    53    63    73    83    93    93    83    73    63    53    43
 [4,]    44    54    64    74    84    94    94    84    74    64    54    44
 [5,]    45    55    65    75    85    95    95    85    75    65    55    45
 [6,]    46    56    66    76    86    96    96    86    76    66    56    46
 [7,]    47    57    67    77    87    97    97    87    77    67    57    47
 [8,]    48    58    68    78    88    98    98    88    78    68    58    48
 [9,]    49    59    69    79    89    99    99    89    79    69    59    49
      [,26] [,27] [,28] [,29]
 [1,]    31    21    11     1
 [2,]    32    22    12     2
 [3,]    33    23    13     3
 [4,]    34    24    14     4
 [5,]    35    25    15     5
 [6,]    36    26    16     6
 [7,]    37    27    17     7
 [8,]    38    28    18     8
 [9,]    39    29    19     9
> tmp3[-c(1:5),-c(6:10)]
     [,1] [,2] [,3] [,4] [,5]
[1,]    6   16   26   36   46
[2,]    7   17   27   37   47
[3,]    8   18   28   38   48
[4,]    9   19   29   39   49
[5,]   10   20   30   40   50
> 
> ## assignment of whole columns
> tmp3[,1] <- c(1:10*100.0)
> tmp3[,1:2] <- tmp3[,1:2]*100
> tmp3[,1:2] <- tmp3[,2:1]
> tmp3[,1:2]
      [,1]  [,2]
 [1,] 1100 1e+04
 [2,] 1200 2e+04
 [3,] 1300 3e+04
 [4,] 1400 4e+04
 [5,] 1500 5e+04
 [6,] 1600 6e+04
 [7,] 1700 7e+04
 [8,] 1800 8e+04
 [9,] 1900 9e+04
[10,] 2000 1e+05
> 
> 
> tmp3[,-1] <- tmp3[,1:9]
> tmp3[,1:10]
      [,1] [,2]  [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,] 1100 1100 1e+04   21   31   41   51   61   71    81
 [2,] 1200 1200 2e+04   22   32   42   52   62   72    82
 [3,] 1300 1300 3e+04   23   33   43   53   63   73    83
 [4,] 1400 1400 4e+04   24   34   44   54   64   74    84
 [5,] 1500 1500 5e+04   25   35   45   55   65   75    85
 [6,] 1600 1600 6e+04   26   36   46   56   66   76    86
 [7,] 1700 1700 7e+04   27   37   47   57   67   77    87
 [8,] 1800 1800 8e+04   28   38   48   58   68   78    88
 [9,] 1900 1900 9e+04   29   39   49   59   69   79    89
[10,] 2000 2000 1e+05   30   40   50   60   70   80    90
> 
> tmp3[,1:2] <- rep(1,10)
> tmp3[,1:2] <- rep(1,20)
> tmp3[,1:2] <- matrix(c(1:5),1,5)
> 
> tmp3[,-c(1:8)] <- matrix(c(1:5),1,5)
> 
> tmp3[1,] <- 1:10
> tmp3[1,]
     [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,]    1    2    3    4    5    6    7    8    9    10
> tmp3[-1,] <- c(1,2)
> tmp3[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    1    2    3    4    5    6    7    8    9    10
 [2,]    1    2    1    2    1    2    1    2    1     2
 [3,]    2    1    2    1    2    1    2    1    2     1
 [4,]    1    2    1    2    1    2    1    2    1     2
 [5,]    2    1    2    1    2    1    2    1    2     1
 [6,]    1    2    1    2    1    2    1    2    1     2
 [7,]    2    1    2    1    2    1    2    1    2     1
 [8,]    1    2    1    2    1    2    1    2    1     2
 [9,]    2    1    2    1    2    1    2    1    2     1
[10,]    1    2    1    2    1    2    1    2    1     2
> tmp3[-c(1:8),] <- matrix(c(1:5),1,5)
> tmp3[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    1    2    3    4    5    6    7    8    9    10
 [2,]    1    2    1    2    1    2    1    2    1     2
 [3,]    2    1    2    1    2    1    2    1    2     1
 [4,]    1    2    1    2    1    2    1    2    1     2
 [5,]    2    1    2    1    2    1    2    1    2     1
 [6,]    1    2    1    2    1    2    1    2    1     2
 [7,]    2    1    2    1    2    1    2    1    2     1
 [8,]    1    2    1    2    1    2    1    2    1     2
 [9,]    1    3    5    2    4    1    3    5    2     4
[10,]    2    4    1    3    5    2    4    1    3     5
> 
> 
> tmp3[1:2,1:2] <- 5555.04
> tmp3[-(1:2),1:2] <- 1234.56789
> 
> 
> 
> ## testing accessors for the directory and prefix
> directory(tmp3)
[1] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests"
> prefix(tmp3)
[1] "BM"
> 
> ## testing if we can remove these objects
> rm(tmp, tmp2, tmp3)
> gc()
         used (Mb) gc trigger (Mb) limit (Mb) max used (Mb)
Ncells 473648 25.3    1033988 55.3         NA   638582 34.2
Vcells 877222  6.7    8388608 64.0      65536  2072452 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 Mar 21 12:53:41 2025"
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> date()
[1] "Fri Mar 21 12:53:41 2025"
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,which.col] == test.matrix[which.row,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> 
> 
> RowMode(tmp2)
<pointer: 0x600002ce4240>
> 
> 
> 
> 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 Mar 21 12:53:44 2025"
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col <- sample(1:20,5,replace=TRUE)
+   if (!all(tmp2[which.row,which.col] == test.matrix[which.row,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> date()
[1] "Fri Mar 21 12:53:45 2025"
> 
> ColMode(tmp2)
<pointer: 0x600002ce4240>
> 
> 
> 
> ### Now testing assignments
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+ 
+   new.data <- rnorm(20)
+   tmp2[which.row,] <- new.data
+   test.matrix[which.row,] <- new.data
+   if (rep > 1){
+     if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+   
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   new.data <- rnorm(10)
+   tmp2[,which.col] <- new.data
+   test.matrix[,which.col]<- new.data
+ 
+   if (rep > 1){
+     if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.col <- which.col
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,5,replace=TRUE)
+   new.data <- matrix(rnorm(50),5,10)
+   tmp2[,which.col] <- new.data
+   test.matrix[,which.col]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.col <- which.col
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   new.data <- matrix(rnorm(50),5,10)
+   tmp2[which.row,] <- new.data
+   test.matrix[which.row,]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col  <- sample(1:20,5,replace=TRUE)
+   new.data <- matrix(rnorm(25),5,5)
+   tmp2[which.row,which.col] <- new.data
+   test.matrix[which.row,which.col]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[prev.row,prev.col] == test.matrix[prev.row,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+   prev.col <- which.col
+ }
> 
> 
> 
> 
> ###
> ###
> ### testing some more functions
> ###
> 
> 
> 
> ## duplication function
> tmp5 <- duplicate(tmp2)
> 
> # making sure really did copy everything.
> tmp5[1,1] <- tmp5[1,1] +100.00
> 
> if (tmp5[1,1] == tmp2[1,1]){
+   stop("Problem with duplication")
+ }
> 
> 
> 
> 
> ### testing elementwise applying of functions
> 
> tmp5[1:4,1:4]
           [,1]        [,2]       [,3]       [,4]
[1,] 98.6629240 -0.42619149 -1.2857570  0.6815332
[2,]  0.5878419  0.05033564  0.7885674  0.2277566
[3,]  0.2451121 -0.23055502 -0.9026399 -1.2728059
[4,]  1.5356296 -1.54622848 -0.1694619 -0.9095924
> ewApply(tmp5,abs)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
           [,1]       [,2]      [,3]      [,4]
[1,] 98.6629240 0.42619149 1.2857570 0.6815332
[2,]  0.5878419 0.05033564 0.7885674 0.2277566
[3,]  0.2451121 0.23055502 0.9026399 1.2728059
[4,]  1.5356296 1.54622848 0.1694619 0.9095924
> ewApply(tmp5,sqrt)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
          [,1]      [,2]      [,3]      [,4]
[1,] 9.9329212 0.6528334 1.1339122 0.8255502
[2,] 0.7667085 0.2243561 0.8880132 0.4772385
[3,] 0.4950880 0.4801615 0.9500736 1.1281870
[4,] 1.2392052 1.2434744 0.4116575 0.9537256
> 
> my.function <- function(x,power){
+   (x+5)^power
+ }
> 
> ewApply(tmp5,my.function,power=2)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
          [,1]     [,2]     [,3]     [,4]
[1,] 222.99214 31.95453 37.62488 33.93704
[2,]  33.25493 27.29390 34.66870 30.00014
[3,]  30.19599 30.03217 35.40338 37.55468
[4,]  38.92768 38.98097 29.28604 35.44685
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x600002ce0120>
> exp(tmp5)
<pointer: 0x600002ce0120>
> log(tmp5,2)
<pointer: 0x600002ce0120>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 464.1289
> Min(tmp5)
[1] 53.78279
> mean(tmp5)
[1] 72.7335
> Sum(tmp5)
[1] 14546.7
> Var(tmp5)
[1] 835.7965
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 93.07571 68.48161 70.64029 71.04627 72.75326 71.02919 67.47779 68.31316
 [9] 70.89561 73.62209
> rowSums(tmp5)
 [1] 1861.514 1369.632 1412.806 1420.925 1455.065 1420.584 1349.556 1366.263
 [9] 1417.912 1472.442
> rowVars(tmp5)
 [1] 7680.91470   66.38904   74.54393   57.74183   74.94152   56.25850
 [7]   53.41285   66.23666   63.96426   40.15287
> rowSd(tmp5)
 [1] 87.640828  8.147947  8.633883  7.598805  8.656877  7.500567  7.308410
 [8]  8.138591  7.997766  6.336630
> rowMax(tmp5)
 [1] 464.12892  82.00712  86.31325  81.13379  93.71363  81.49219  80.55887
 [8]  86.77250  83.23068  83.28050
> rowMin(tmp5)
 [1] 61.75776 56.51458 55.56699 58.05150 59.77471 57.94663 53.78279 59.53703
 [9] 59.07853 56.64456
> 
> colMeans(tmp5)
 [1] 108.29362  69.78961  70.32589  72.26328  70.56512  66.85386  65.37735
 [8]  70.55173  66.88993  69.84522  67.47685  72.77685  71.85528  73.18538
[15]  73.48649  71.70108  71.62580  77.45123  72.47144  71.88392
> colSums(tmp5)
 [1] 1082.9362  697.8961  703.2589  722.6328  705.6512  668.5386  653.7735
 [8]  705.5173  668.8993  698.4522  674.7685  727.7685  718.5528  731.8538
[15]  734.8649  717.0108  716.2580  774.5123  724.7144  718.8392
> colVars(tmp5)
 [1] 15672.61795    66.71744    77.41195    35.76231    73.02115    31.48560
 [7]    73.75616   109.86008    27.96167    62.95392   125.87004    53.58892
[13]    70.24996    46.22866    21.64769    67.98897    93.88294    28.48678
[19]    65.25401    37.46779
> colSd(tmp5)
 [1] 125.190327   8.168075   8.798406   5.980160   8.545241   5.611203
 [7]   8.588140  10.481416   5.287880   7.934351  11.219182   7.320445
[13]   8.381525   6.799166   4.652708   8.245543   9.689321   5.337301
[19]   8.077996   6.121094
> colMax(tmp5)
 [1] 464.12892  81.13379  81.07803  80.14136  84.53920  74.13607  81.47365
 [8]  81.49219  73.35604  86.31325  93.71363  86.77250  82.00712  81.55310
[15]  80.55887  87.55029  83.88491  85.18030  86.58977  79.11435
> colMin(tmp5)
 [1] 59.07853 56.80867 59.53703 62.44137 59.68665 58.36036 55.56699 53.90472
 [9] 57.94663 61.56474 56.64456 61.37427 53.78279 61.26081 64.58349 61.29455
[17] 59.29477 69.57273 61.13795 61.22960
> 
> 
> ### 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] 93.07571 68.48161 70.64029 71.04627 72.75326       NA 67.47779 68.31316
 [9] 70.89561 73.62209
> rowSums(tmp5)
 [1] 1861.514 1369.632 1412.806 1420.925 1455.065       NA 1349.556 1366.263
 [9] 1417.912 1472.442
> rowVars(tmp5)
 [1] 7680.91470   66.38904   74.54393   57.74183   74.94152   57.66280
 [7]   53.41285   66.23666   63.96426   40.15287
> rowSd(tmp5)
 [1] 87.640828  8.147947  8.633883  7.598805  8.656877  7.593603  7.308410
 [8]  8.138591  7.997766  6.336630
> rowMax(tmp5)
 [1] 464.12892  82.00712  86.31325  81.13379  93.71363        NA  80.55887
 [8]  86.77250  83.23068  83.28050
> rowMin(tmp5)
 [1] 61.75776 56.51458 55.56699 58.05150 59.77471       NA 53.78279 59.53703
 [9] 59.07853 56.64456
> 
> colMeans(tmp5)
 [1] 108.29362  69.78961  70.32589  72.26328  70.56512  66.85386  65.37735
 [8]  70.55173  66.88993  69.84522  67.47685  72.77685  71.85528  73.18538
[15]  73.48649  71.70108  71.62580        NA  72.47144  71.88392
> colSums(tmp5)
 [1] 1082.9362  697.8961  703.2589  722.6328  705.6512  668.5386  653.7735
 [8]  705.5173  668.8993  698.4522  674.7685  727.7685  718.5528  731.8538
[15]  734.8649  717.0108  716.2580        NA  724.7144  718.8392
> colVars(tmp5)
 [1] 15672.61795    66.71744    77.41195    35.76231    73.02115    31.48560
 [7]    73.75616   109.86008    27.96167    62.95392   125.87004    53.58892
[13]    70.24996    46.22866    21.64769    67.98897    93.88294          NA
[19]    65.25401    37.46779
> colSd(tmp5)
 [1] 125.190327   8.168075   8.798406   5.980160   8.545241   5.611203
 [7]   8.588140  10.481416   5.287880   7.934351  11.219182   7.320445
[13]   8.381525   6.799166   4.652708   8.245543   9.689321         NA
[19]   8.077996   6.121094
> colMax(tmp5)
 [1] 464.12892  81.13379  81.07803  80.14136  84.53920  74.13607  81.47365
 [8]  81.49219  73.35604  86.31325  93.71363  86.77250  82.00712  81.55310
[15]  80.55887  87.55029  83.88491        NA  86.58977  79.11435
> colMin(tmp5)
 [1] 59.07853 56.80867 59.53703 62.44137 59.68665 58.36036 55.56699 53.90472
 [9] 57.94663 61.56474 56.64456 61.37427 53.78279 61.26081 64.58349 61.29455
[17] 59.29477       NA 61.13795 61.22960
> 
> Max(tmp5,na.rm=TRUE)
[1] 464.1289
> Min(tmp5,na.rm=TRUE)
[1] 53.78279
> mean(tmp5,na.rm=TRUE)
[1] 72.7148
> Sum(tmp5,na.rm=TRUE)
[1] 14470.24
> Var(tmp5,na.rm=TRUE)
[1] 839.9474
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 93.07571 68.48161 70.64029 71.04627 72.75326 70.74365 67.47779 68.31316
 [9] 70.89561 73.62209
> rowSums(tmp5,na.rm=TRUE)
 [1] 1861.514 1369.632 1412.806 1420.925 1455.065 1344.129 1349.556 1366.263
 [9] 1417.912 1472.442
> rowVars(tmp5,na.rm=TRUE)
 [1] 7680.91470   66.38904   74.54393   57.74183   74.94152   57.66280
 [7]   53.41285   66.23666   63.96426   40.15287
> rowSd(tmp5,na.rm=TRUE)
 [1] 87.640828  8.147947  8.633883  7.598805  8.656877  7.593603  7.308410
 [8]  8.138591  7.997766  6.336630
> rowMax(tmp5,na.rm=TRUE)
 [1] 464.12892  82.00712  86.31325  81.13379  93.71363  81.49219  80.55887
 [8]  86.77250  83.23068  83.28050
> rowMin(tmp5,na.rm=TRUE)
 [1] 61.75776 56.51458 55.56699 58.05150 59.77471 57.94663 53.78279 59.53703
 [9] 59.07853 56.64456
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 108.29362  69.78961  70.32589  72.26328  70.56512  66.85386  65.37735
 [8]  70.55173  66.88993  69.84522  67.47685  72.77685  71.85528  73.18538
[15]  73.48649  71.70108  71.62580  77.56199  72.47144  71.88392
> colSums(tmp5,na.rm=TRUE)
 [1] 1082.9362  697.8961  703.2589  722.6328  705.6512  668.5386  653.7735
 [8]  705.5173  668.8993  698.4522  674.7685  727.7685  718.5528  731.8538
[15]  734.8649  717.0108  716.2580  698.0579  724.7144  718.8392
> colVars(tmp5,na.rm=TRUE)
 [1] 15672.61795    66.71744    77.41195    35.76231    73.02115    31.48560
 [7]    73.75616   109.86008    27.96167    62.95392   125.87004    53.58892
[13]    70.24996    46.22866    21.64769    67.98897    93.88294    31.90960
[19]    65.25401    37.46779
> colSd(tmp5,na.rm=TRUE)
 [1] 125.190327   8.168075   8.798406   5.980160   8.545241   5.611203
 [7]   8.588140  10.481416   5.287880   7.934351  11.219182   7.320445
[13]   8.381525   6.799166   4.652708   8.245543   9.689321   5.648858
[19]   8.077996   6.121094
> colMax(tmp5,na.rm=TRUE)
 [1] 464.12892  81.13379  81.07803  80.14136  84.53920  74.13607  81.47365
 [8]  81.49219  73.35604  86.31325  93.71363  86.77250  82.00712  81.55310
[15]  80.55887  87.55029  83.88491  85.18030  86.58977  79.11435
> colMin(tmp5,na.rm=TRUE)
 [1] 59.07853 56.80867 59.53703 62.44137 59.68665 58.36036 55.56699 53.90472
 [9] 57.94663 61.56474 56.64456 61.37427 53.78279 61.26081 64.58349 61.29455
[17] 59.29477 69.57273 61.13795 61.22960
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1] 93.07571 68.48161 70.64029 71.04627 72.75326      NaN 67.47779 68.31316
 [9] 70.89561 73.62209
> rowSums(tmp5,na.rm=TRUE)
 [1] 1861.514 1369.632 1412.806 1420.925 1455.065    0.000 1349.556 1366.263
 [9] 1417.912 1472.442
> rowVars(tmp5,na.rm=TRUE)
 [1] 7680.91470   66.38904   74.54393   57.74183   74.94152         NA
 [7]   53.41285   66.23666   63.96426   40.15287
> rowSd(tmp5,na.rm=TRUE)
 [1] 87.640828  8.147947  8.633883  7.598805  8.656877        NA  7.308410
 [8]  8.138591  7.997766  6.336630
> rowMax(tmp5,na.rm=TRUE)
 [1] 464.12892  82.00712  86.31325  81.13379  93.71363        NA  80.55887
 [8]  86.77250  83.23068  83.28050
> rowMin(tmp5,na.rm=TRUE)
 [1] 61.75776 56.51458 55.56699 58.05150 59.77471       NA 53.78279 59.53703
 [9] 59.07853 56.64456
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1] 113.41771  69.72432  69.19388  72.77667  69.53910  67.79758  65.95320
 [8]  69.33613  67.88363  69.14545  67.00301  73.15301  71.27861  73.92222
[15]  73.38933  72.60452  71.44584       NaN  72.03612  71.29497
> colSums(tmp5,na.rm=TRUE)
 [1] 1020.7594  627.5189  622.7449  654.9900  625.8519  610.1782  593.5788
 [8]  624.0252  610.9527  622.3090  603.0271  658.3771  641.5074  665.2999
[15]  660.5040  653.4407  643.0126    0.0000  648.3251  641.6547
> colVars(tmp5,na.rm=TRUE)
 [1] 17336.31120    75.00916    72.67223    37.26739    70.30569    25.40192
 [7]    79.24521   106.96849    20.34819    65.31422   139.07792    58.69575
[13]    75.28995    45.89933    24.24747    67.30529   105.25396          NA
[19]    71.27889    38.24907
> colSd(tmp5,na.rm=TRUE)
 [1] 131.667426   8.660783   8.524801   6.104702   8.384849   5.040032
 [7]   8.901978  10.342557   4.510896   8.081722  11.793130   7.661315
[13]   8.676978   6.774904   4.924172   8.203980  10.259335         NA
[19]   8.442683   6.184583
> colMax(tmp5,na.rm=TRUE)
 [1] 464.12892  81.13379  81.07803  80.14136  84.53920  74.13607  81.47365
 [8]  81.11449  73.35604  86.31325  93.71363  86.77250  82.00712  81.55310
[15]  80.55887  87.55029  83.88491      -Inf  86.58977  79.11435
> colMin(tmp5,na.rm=TRUE)
 [1] 59.07853 56.80867 59.53703 62.44137 59.68665 59.63878 55.56699 53.90472
 [9] 61.99690 61.56474 56.64456 61.37427 53.78279 61.26081 64.58349 61.29455
[17] 59.29477      Inf 61.13795 61.22960
> 
> 
> 
> 
> 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] 203.3109 158.9737 158.9254 239.0359 265.6012 213.2484 132.2660 193.5713
 [9] 397.2343 165.4916
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 203.3109 158.9737 158.9254 239.0359 265.6012 213.2484 132.2660 193.5713
 [9] 397.2343 165.4916
> 
> 
> 
> copymatrix <- matrix(rnorm(200,150,15),10,20)
> 
> tmp5[1:10,1:20] <- copymatrix
> which.row <- 1
> which.col  <- 3
> cat(which.row," ",which.col,"\n")
1   3 
> tmp5[which.row,which.col] <- NA
> copymatrix[which.row,which.col] <- NA
> 
> colVars(tmp5,na.rm=TRUE)-apply(copymatrix,2,var,na.rm=TRUE)
 [1] -2.842171e-14  1.421085e-14 -2.842171e-13  0.000000e+00 -1.136868e-13
 [6]  1.421085e-14 -2.273737e-13  1.705303e-13  1.136868e-13 -5.684342e-14
[11] -1.136868e-13 -5.684342e-14 -1.136868e-13  5.684342e-14 -1.421085e-13
[16] -1.421085e-14  5.684342e-14  0.000000e+00 -2.273737e-13 -2.842171e-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)
+ }
6   16 
9   18 
9   7 
4   19 
8   8 
6   9 
7   17 
1   17 
4   15 
3   14 
1   3 
4   10 
5   10 
5   4 
1   11 
7   12 
7   11 
7   12 
9   18 
2   16 
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.31543
> Min(tmp)
[1] -2.018732
> mean(tmp)
[1] -0.06967489
> Sum(tmp)
[1] -6.967489
> Var(tmp)
[1] 0.7313472
> 
> rowMeans(tmp)
[1] -0.06967489
> rowSums(tmp)
[1] -6.967489
> rowVars(tmp)
[1] 0.7313472
> rowSd(tmp)
[1] 0.8551884
> rowMax(tmp)
[1] 2.31543
> rowMin(tmp)
[1] -2.018732
> 
> colMeans(tmp)
  [1]  0.543328929  0.504128778 -0.406395941 -1.143318719  1.546187069
  [6] -0.346703682  0.047229285 -1.026584155 -0.653105782  0.656849527
 [11] -2.018732187 -0.387532463 -0.999045279 -0.243355473  0.490829033
 [16]  0.003254311 -0.371390590  0.858348113  0.592018373  0.813429123
 [21] -0.872007051  0.621137046  1.244010105 -0.433760221  0.526677146
 [26]  0.309168730 -1.178939631  0.667011810 -0.155462258  1.010836126
 [31]  0.288589898  0.017094802 -0.357607852 -0.969413815 -1.626080778
 [36] -1.073306673 -0.527733218  1.126156873  0.062538912  1.295970531
 [41]  0.080190828 -0.598237127 -1.505284937  0.425330734  0.090934236
 [46] -1.324880080 -0.592818867 -0.128286339 -0.324691937 -1.977920608
 [51] -0.564171961 -1.058260979 -0.534348803  0.305696402 -0.222163210
 [56] -0.895885276  0.328605360 -0.318049287  0.839651519 -0.500304527
 [61] -0.389694489  0.645011792 -1.324697450  0.723868282  0.082896551
 [66] -0.337343976  1.437170502 -1.285260799  1.105541832 -0.889479462
 [71] -0.503984599  1.745403323 -0.367209395  1.140739746 -0.551042311
 [76] -0.198907532  0.288234049  0.105849520 -0.108452714  2.315430488
 [81] -0.104422159  0.936963560  0.212077009  0.511369671  0.362428798
 [86] -0.672128770  1.776679412 -0.796702123  0.962198864  0.099087116
 [91] -0.086598981  0.005836285 -1.326890597 -0.232038338  0.170192379
 [96] -0.494825326 -0.014443720  0.389827367 -1.958413526 -0.301183421
> colSums(tmp)
  [1]  0.543328929  0.504128778 -0.406395941 -1.143318719  1.546187069
  [6] -0.346703682  0.047229285 -1.026584155 -0.653105782  0.656849527
 [11] -2.018732187 -0.387532463 -0.999045279 -0.243355473  0.490829033
 [16]  0.003254311 -0.371390590  0.858348113  0.592018373  0.813429123
 [21] -0.872007051  0.621137046  1.244010105 -0.433760221  0.526677146
 [26]  0.309168730 -1.178939631  0.667011810 -0.155462258  1.010836126
 [31]  0.288589898  0.017094802 -0.357607852 -0.969413815 -1.626080778
 [36] -1.073306673 -0.527733218  1.126156873  0.062538912  1.295970531
 [41]  0.080190828 -0.598237127 -1.505284937  0.425330734  0.090934236
 [46] -1.324880080 -0.592818867 -0.128286339 -0.324691937 -1.977920608
 [51] -0.564171961 -1.058260979 -0.534348803  0.305696402 -0.222163210
 [56] -0.895885276  0.328605360 -0.318049287  0.839651519 -0.500304527
 [61] -0.389694489  0.645011792 -1.324697450  0.723868282  0.082896551
 [66] -0.337343976  1.437170502 -1.285260799  1.105541832 -0.889479462
 [71] -0.503984599  1.745403323 -0.367209395  1.140739746 -0.551042311
 [76] -0.198907532  0.288234049  0.105849520 -0.108452714  2.315430488
 [81] -0.104422159  0.936963560  0.212077009  0.511369671  0.362428798
 [86] -0.672128770  1.776679412 -0.796702123  0.962198864  0.099087116
 [91] -0.086598981  0.005836285 -1.326890597 -0.232038338  0.170192379
 [96] -0.494825326 -0.014443720  0.389827367 -1.958413526 -0.301183421
> 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.543328929  0.504128778 -0.406395941 -1.143318719  1.546187069
  [6] -0.346703682  0.047229285 -1.026584155 -0.653105782  0.656849527
 [11] -2.018732187 -0.387532463 -0.999045279 -0.243355473  0.490829033
 [16]  0.003254311 -0.371390590  0.858348113  0.592018373  0.813429123
 [21] -0.872007051  0.621137046  1.244010105 -0.433760221  0.526677146
 [26]  0.309168730 -1.178939631  0.667011810 -0.155462258  1.010836126
 [31]  0.288589898  0.017094802 -0.357607852 -0.969413815 -1.626080778
 [36] -1.073306673 -0.527733218  1.126156873  0.062538912  1.295970531
 [41]  0.080190828 -0.598237127 -1.505284937  0.425330734  0.090934236
 [46] -1.324880080 -0.592818867 -0.128286339 -0.324691937 -1.977920608
 [51] -0.564171961 -1.058260979 -0.534348803  0.305696402 -0.222163210
 [56] -0.895885276  0.328605360 -0.318049287  0.839651519 -0.500304527
 [61] -0.389694489  0.645011792 -1.324697450  0.723868282  0.082896551
 [66] -0.337343976  1.437170502 -1.285260799  1.105541832 -0.889479462
 [71] -0.503984599  1.745403323 -0.367209395  1.140739746 -0.551042311
 [76] -0.198907532  0.288234049  0.105849520 -0.108452714  2.315430488
 [81] -0.104422159  0.936963560  0.212077009  0.511369671  0.362428798
 [86] -0.672128770  1.776679412 -0.796702123  0.962198864  0.099087116
 [91] -0.086598981  0.005836285 -1.326890597 -0.232038338  0.170192379
 [96] -0.494825326 -0.014443720  0.389827367 -1.958413526 -0.301183421
> colMin(tmp)
  [1]  0.543328929  0.504128778 -0.406395941 -1.143318719  1.546187069
  [6] -0.346703682  0.047229285 -1.026584155 -0.653105782  0.656849527
 [11] -2.018732187 -0.387532463 -0.999045279 -0.243355473  0.490829033
 [16]  0.003254311 -0.371390590  0.858348113  0.592018373  0.813429123
 [21] -0.872007051  0.621137046  1.244010105 -0.433760221  0.526677146
 [26]  0.309168730 -1.178939631  0.667011810 -0.155462258  1.010836126
 [31]  0.288589898  0.017094802 -0.357607852 -0.969413815 -1.626080778
 [36] -1.073306673 -0.527733218  1.126156873  0.062538912  1.295970531
 [41]  0.080190828 -0.598237127 -1.505284937  0.425330734  0.090934236
 [46] -1.324880080 -0.592818867 -0.128286339 -0.324691937 -1.977920608
 [51] -0.564171961 -1.058260979 -0.534348803  0.305696402 -0.222163210
 [56] -0.895885276  0.328605360 -0.318049287  0.839651519 -0.500304527
 [61] -0.389694489  0.645011792 -1.324697450  0.723868282  0.082896551
 [66] -0.337343976  1.437170502 -1.285260799  1.105541832 -0.889479462
 [71] -0.503984599  1.745403323 -0.367209395  1.140739746 -0.551042311
 [76] -0.198907532  0.288234049  0.105849520 -0.108452714  2.315430488
 [81] -0.104422159  0.936963560  0.212077009  0.511369671  0.362428798
 [86] -0.672128770  1.776679412 -0.796702123  0.962198864  0.099087116
 [91] -0.086598981  0.005836285 -1.326890597 -0.232038338  0.170192379
 [96] -0.494825326 -0.014443720  0.389827367 -1.958413526 -0.301183421
> colMedians(tmp)
  [1]  0.543328929  0.504128778 -0.406395941 -1.143318719  1.546187069
  [6] -0.346703682  0.047229285 -1.026584155 -0.653105782  0.656849527
 [11] -2.018732187 -0.387532463 -0.999045279 -0.243355473  0.490829033
 [16]  0.003254311 -0.371390590  0.858348113  0.592018373  0.813429123
 [21] -0.872007051  0.621137046  1.244010105 -0.433760221  0.526677146
 [26]  0.309168730 -1.178939631  0.667011810 -0.155462258  1.010836126
 [31]  0.288589898  0.017094802 -0.357607852 -0.969413815 -1.626080778
 [36] -1.073306673 -0.527733218  1.126156873  0.062538912  1.295970531
 [41]  0.080190828 -0.598237127 -1.505284937  0.425330734  0.090934236
 [46] -1.324880080 -0.592818867 -0.128286339 -0.324691937 -1.977920608
 [51] -0.564171961 -1.058260979 -0.534348803  0.305696402 -0.222163210
 [56] -0.895885276  0.328605360 -0.318049287  0.839651519 -0.500304527
 [61] -0.389694489  0.645011792 -1.324697450  0.723868282  0.082896551
 [66] -0.337343976  1.437170502 -1.285260799  1.105541832 -0.889479462
 [71] -0.503984599  1.745403323 -0.367209395  1.140739746 -0.551042311
 [76] -0.198907532  0.288234049  0.105849520 -0.108452714  2.315430488
 [81] -0.104422159  0.936963560  0.212077009  0.511369671  0.362428798
 [86] -0.672128770  1.776679412 -0.796702123  0.962198864  0.099087116
 [91] -0.086598981  0.005836285 -1.326890597 -0.232038338  0.170192379
 [96] -0.494825326 -0.014443720  0.389827367 -1.958413526 -0.301183421
> colRanges(tmp)
          [,1]      [,2]       [,3]      [,4]     [,5]       [,6]       [,7]
[1,] 0.5433289 0.5041288 -0.4063959 -1.143319 1.546187 -0.3467037 0.04722929
[2,] 0.5433289 0.5041288 -0.4063959 -1.143319 1.546187 -0.3467037 0.04722929
          [,8]       [,9]     [,10]     [,11]      [,12]      [,13]      [,14]
[1,] -1.026584 -0.6531058 0.6568495 -2.018732 -0.3875325 -0.9990453 -0.2433555
[2,] -1.026584 -0.6531058 0.6568495 -2.018732 -0.3875325 -0.9990453 -0.2433555
        [,15]       [,16]      [,17]     [,18]     [,19]     [,20]      [,21]
[1,] 0.490829 0.003254311 -0.3713906 0.8583481 0.5920184 0.8134291 -0.8720071
[2,] 0.490829 0.003254311 -0.3713906 0.8583481 0.5920184 0.8134291 -0.8720071
        [,22]   [,23]      [,24]     [,25]     [,26]    [,27]     [,28]
[1,] 0.621137 1.24401 -0.4337602 0.5266771 0.3091687 -1.17894 0.6670118
[2,] 0.621137 1.24401 -0.4337602 0.5266771 0.3091687 -1.17894 0.6670118
          [,29]    [,30]     [,31]     [,32]      [,33]      [,34]     [,35]
[1,] -0.1554623 1.010836 0.2885899 0.0170948 -0.3576079 -0.9694138 -1.626081
[2,] -0.1554623 1.010836 0.2885899 0.0170948 -0.3576079 -0.9694138 -1.626081
         [,36]      [,37]    [,38]      [,39]    [,40]      [,41]      [,42]
[1,] -1.073307 -0.5277332 1.126157 0.06253891 1.295971 0.08019083 -0.5982371
[2,] -1.073307 -0.5277332 1.126157 0.06253891 1.295971 0.08019083 -0.5982371
         [,43]     [,44]      [,45]    [,46]      [,47]      [,48]      [,49]
[1,] -1.505285 0.4253307 0.09093424 -1.32488 -0.5928189 -0.1282863 -0.3246919
[2,] -1.505285 0.4253307 0.09093424 -1.32488 -0.5928189 -0.1282863 -0.3246919
         [,50]     [,51]     [,52]      [,53]     [,54]      [,55]      [,56]
[1,] -1.977921 -0.564172 -1.058261 -0.5343488 0.3056964 -0.2221632 -0.8958853
[2,] -1.977921 -0.564172 -1.058261 -0.5343488 0.3056964 -0.2221632 -0.8958853
         [,57]      [,58]     [,59]      [,60]      [,61]     [,62]     [,63]
[1,] 0.3286054 -0.3180493 0.8396515 -0.5003045 -0.3896945 0.6450118 -1.324697
[2,] 0.3286054 -0.3180493 0.8396515 -0.5003045 -0.3896945 0.6450118 -1.324697
         [,64]      [,65]     [,66]    [,67]     [,68]    [,69]      [,70]
[1,] 0.7238683 0.08289655 -0.337344 1.437171 -1.285261 1.105542 -0.8894795
[2,] 0.7238683 0.08289655 -0.337344 1.437171 -1.285261 1.105542 -0.8894795
          [,71]    [,72]      [,73]   [,74]      [,75]      [,76]    [,77]
[1,] -0.5039846 1.745403 -0.3672094 1.14074 -0.5510423 -0.1989075 0.288234
[2,] -0.5039846 1.745403 -0.3672094 1.14074 -0.5510423 -0.1989075 0.288234
         [,78]      [,79]   [,80]      [,81]     [,82]    [,83]     [,84]
[1,] 0.1058495 -0.1084527 2.31543 -0.1044222 0.9369636 0.212077 0.5113697
[2,] 0.1058495 -0.1084527 2.31543 -0.1044222 0.9369636 0.212077 0.5113697
         [,85]      [,86]    [,87]      [,88]     [,89]      [,90]       [,91]
[1,] 0.3624288 -0.6721288 1.776679 -0.7967021 0.9621989 0.09908712 -0.08659898
[2,] 0.3624288 -0.6721288 1.776679 -0.7967021 0.9621989 0.09908712 -0.08659898
           [,92]     [,93]      [,94]     [,95]      [,96]       [,97]
[1,] 0.005836285 -1.326891 -0.2320383 0.1701924 -0.4948253 -0.01444372
[2,] 0.005836285 -1.326891 -0.2320383 0.1701924 -0.4948253 -0.01444372
         [,98]     [,99]     [,100]
[1,] 0.3898274 -1.958414 -0.3011834
[2,] 0.3898274 -1.958414 -0.3011834
> 
> 
> Max(tmp2)
[1] 2.65216
> Min(tmp2)
[1] -2.767798
> mean(tmp2)
[1] -0.02234083
> Sum(tmp2)
[1] -2.234083
> Var(tmp2)
[1] 1.088072
> 
> rowMeans(tmp2)
  [1] -0.8068171932  1.4138749286 -2.1426302475 -0.0796449706 -0.3376026836
  [6]  0.4761939305 -0.0519683736  0.9382499114 -1.1715883197 -0.4406437828
 [11]  0.6367616339  0.2712001091 -0.0362190141 -0.9097744323  0.6470634832
 [16]  0.3686678433  0.1182203911  1.7070186862  1.7878158113  1.8957417074
 [21] -0.3292339535  0.1607735542  0.0982330204  0.8920559210  0.4281745510
 [26] -2.2691131243  0.1754309297 -1.6301384459 -0.2992324914  0.8343367706
 [31]  0.6299099574 -1.4301708627 -0.5028810368 -1.4455481156  1.1082779306
 [36] -1.3840040259 -0.2167906202  1.1521381716 -0.7111696635 -0.7484851638
 [41] -1.1793001701  2.6521604634 -0.7162926008  0.7697279771  0.1260669418
 [46] -0.2512912744 -0.8495267930  0.7733892966  0.5815111469 -1.3185015277
 [51] -1.4651629795  1.9728473748 -0.3090594291  0.7364788959 -0.0708075632
 [56] -0.2989555225  0.3435100026 -1.3461057799 -0.8200951545 -1.0265909890
 [61] -1.7148119440  0.1745551337 -0.0003969439  2.5472696388 -0.3005480620
 [66] -0.8971419199 -0.8857885050  1.5021132249  0.0023558235 -0.1140142476
 [71]  0.3227449491  0.4702453693  1.1634368021  0.4295358354 -0.3777855496
 [76]  1.4603435908 -0.3587521372  0.9333677243 -0.0152195302  1.1834372980
 [81] -1.0352052766  0.3353714078 -1.1505824845  1.1427442348  0.3469858717
 [86] -0.9205347165 -1.5832459372  0.3045651270  0.1004485902  0.0016831457
 [91]  1.9070315880 -0.6255778097 -0.3888098293 -2.7677976939 -0.1196842350
 [96] -0.2305735669  0.5721902503  1.1223393985 -1.0329397543 -0.8379230499
> rowSums(tmp2)
  [1] -0.8068171932  1.4138749286 -2.1426302475 -0.0796449706 -0.3376026836
  [6]  0.4761939305 -0.0519683736  0.9382499114 -1.1715883197 -0.4406437828
 [11]  0.6367616339  0.2712001091 -0.0362190141 -0.9097744323  0.6470634832
 [16]  0.3686678433  0.1182203911  1.7070186862  1.7878158113  1.8957417074
 [21] -0.3292339535  0.1607735542  0.0982330204  0.8920559210  0.4281745510
 [26] -2.2691131243  0.1754309297 -1.6301384459 -0.2992324914  0.8343367706
 [31]  0.6299099574 -1.4301708627 -0.5028810368 -1.4455481156  1.1082779306
 [36] -1.3840040259 -0.2167906202  1.1521381716 -0.7111696635 -0.7484851638
 [41] -1.1793001701  2.6521604634 -0.7162926008  0.7697279771  0.1260669418
 [46] -0.2512912744 -0.8495267930  0.7733892966  0.5815111469 -1.3185015277
 [51] -1.4651629795  1.9728473748 -0.3090594291  0.7364788959 -0.0708075632
 [56] -0.2989555225  0.3435100026 -1.3461057799 -0.8200951545 -1.0265909890
 [61] -1.7148119440  0.1745551337 -0.0003969439  2.5472696388 -0.3005480620
 [66] -0.8971419199 -0.8857885050  1.5021132249  0.0023558235 -0.1140142476
 [71]  0.3227449491  0.4702453693  1.1634368021  0.4295358354 -0.3777855496
 [76]  1.4603435908 -0.3587521372  0.9333677243 -0.0152195302  1.1834372980
 [81] -1.0352052766  0.3353714078 -1.1505824845  1.1427442348  0.3469858717
 [86] -0.9205347165 -1.5832459372  0.3045651270  0.1004485902  0.0016831457
 [91]  1.9070315880 -0.6255778097 -0.3888098293 -2.7677976939 -0.1196842350
 [96] -0.2305735669  0.5721902503  1.1223393985 -1.0329397543 -0.8379230499
> 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.8068171932  1.4138749286 -2.1426302475 -0.0796449706 -0.3376026836
  [6]  0.4761939305 -0.0519683736  0.9382499114 -1.1715883197 -0.4406437828
 [11]  0.6367616339  0.2712001091 -0.0362190141 -0.9097744323  0.6470634832
 [16]  0.3686678433  0.1182203911  1.7070186862  1.7878158113  1.8957417074
 [21] -0.3292339535  0.1607735542  0.0982330204  0.8920559210  0.4281745510
 [26] -2.2691131243  0.1754309297 -1.6301384459 -0.2992324914  0.8343367706
 [31]  0.6299099574 -1.4301708627 -0.5028810368 -1.4455481156  1.1082779306
 [36] -1.3840040259 -0.2167906202  1.1521381716 -0.7111696635 -0.7484851638
 [41] -1.1793001701  2.6521604634 -0.7162926008  0.7697279771  0.1260669418
 [46] -0.2512912744 -0.8495267930  0.7733892966  0.5815111469 -1.3185015277
 [51] -1.4651629795  1.9728473748 -0.3090594291  0.7364788959 -0.0708075632
 [56] -0.2989555225  0.3435100026 -1.3461057799 -0.8200951545 -1.0265909890
 [61] -1.7148119440  0.1745551337 -0.0003969439  2.5472696388 -0.3005480620
 [66] -0.8971419199 -0.8857885050  1.5021132249  0.0023558235 -0.1140142476
 [71]  0.3227449491  0.4702453693  1.1634368021  0.4295358354 -0.3777855496
 [76]  1.4603435908 -0.3587521372  0.9333677243 -0.0152195302  1.1834372980
 [81] -1.0352052766  0.3353714078 -1.1505824845  1.1427442348  0.3469858717
 [86] -0.9205347165 -1.5832459372  0.3045651270  0.1004485902  0.0016831457
 [91]  1.9070315880 -0.6255778097 -0.3888098293 -2.7677976939 -0.1196842350
 [96] -0.2305735669  0.5721902503  1.1223393985 -1.0329397543 -0.8379230499
> rowMin(tmp2)
  [1] -0.8068171932  1.4138749286 -2.1426302475 -0.0796449706 -0.3376026836
  [6]  0.4761939305 -0.0519683736  0.9382499114 -1.1715883197 -0.4406437828
 [11]  0.6367616339  0.2712001091 -0.0362190141 -0.9097744323  0.6470634832
 [16]  0.3686678433  0.1182203911  1.7070186862  1.7878158113  1.8957417074
 [21] -0.3292339535  0.1607735542  0.0982330204  0.8920559210  0.4281745510
 [26] -2.2691131243  0.1754309297 -1.6301384459 -0.2992324914  0.8343367706
 [31]  0.6299099574 -1.4301708627 -0.5028810368 -1.4455481156  1.1082779306
 [36] -1.3840040259 -0.2167906202  1.1521381716 -0.7111696635 -0.7484851638
 [41] -1.1793001701  2.6521604634 -0.7162926008  0.7697279771  0.1260669418
 [46] -0.2512912744 -0.8495267930  0.7733892966  0.5815111469 -1.3185015277
 [51] -1.4651629795  1.9728473748 -0.3090594291  0.7364788959 -0.0708075632
 [56] -0.2989555225  0.3435100026 -1.3461057799 -0.8200951545 -1.0265909890
 [61] -1.7148119440  0.1745551337 -0.0003969439  2.5472696388 -0.3005480620
 [66] -0.8971419199 -0.8857885050  1.5021132249  0.0023558235 -0.1140142476
 [71]  0.3227449491  0.4702453693  1.1634368021  0.4295358354 -0.3777855496
 [76]  1.4603435908 -0.3587521372  0.9333677243 -0.0152195302  1.1834372980
 [81] -1.0352052766  0.3353714078 -1.1505824845  1.1427442348  0.3469858717
 [86] -0.9205347165 -1.5832459372  0.3045651270  0.1004485902  0.0016831457
 [91]  1.9070315880 -0.6255778097 -0.3888098293 -2.7677976939 -0.1196842350
 [96] -0.2305735669  0.5721902503  1.1223393985 -1.0329397543 -0.8379230499
> 
> colMeans(tmp2)
[1] -0.02234083
> colSums(tmp2)
[1] -2.234083
> colVars(tmp2)
[1] 1.088072
> colSd(tmp2)
[1] 1.043107
> colMax(tmp2)
[1] 2.65216
> colMin(tmp2)
[1] -2.767798
> colMedians(tmp2)
[1] -0.02571927
> colRanges(tmp2)
          [,1]
[1,] -2.767798
[2,]  2.652160
> 
> 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]  2.68217598  5.67940351 -1.35731282  4.15841980 -5.25935387  1.89855413
 [7] -0.93441683  0.64690308 -0.04836779  1.62274084
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -0.8756112
[2,] -0.2005846
[3,]  0.2394876
[4,]  0.3308068
[5,]  1.6948374
> 
> rowApply(tmp,sum)
 [1]  1.98815901  4.68569972 -1.61119984  1.95248838 -1.05669625  0.86542005
 [7]  1.55513921  0.05402168  3.87889608 -3.22318202
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    2   10    8    8    7    4    4    6    6     8
 [2,]    5    7    9    9    2    5    6   10    9     7
 [3,]    7    5    4    4    9    2    9    8    1     2
 [4,]    6    6    5   10    5    7    3    9    5     4
 [5,]    1    3    7    1   10    1    5    1    3     9
 [6,]    4    8    3    6    3    3    1    7   10    10
 [7,]    9    9    6    2    4    6   10    5    4     1
 [8,]    3    1    2    7    8    9    8    3    7     6
 [9,]   10    2    1    5    6   10    2    2    2     3
[10,]    8    4   10    3    1    8    7    4    8     5
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1] -0.98880694  4.19415833  1.19658720 -0.89976243  0.15512970 -4.10630762
 [7] -2.89529536 -0.12829078  1.69838855  1.89347493  0.04226794 -3.57715542
[13] -2.63608430  1.79017437 -3.06640273 -0.14333037 -3.13709263 -1.10474591
[19]  0.06769732 -1.66124137
> colApply(tmp,quantile)[,1]
            [,1]
[1,] -1.24027000
[2,] -1.17252509
[3,] -0.09175181
[4,]  0.44286314
[5,]  1.07287682
> 
> rowApply(tmp,sum)
[1] -3.1815608 -2.0864581 -0.5718173 -4.0590746 -3.4077268
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]    4   18    3   12   16
[2,]   19   20   20   13    7
[3,]   18   19    8   10    4
[4,]    6   12   16    7    5
[5,]   11   14   15    8   10
> 
> 
> as.matrix(tmp)
            [,1]       [,2]       [,3]       [,4]       [,5]       [,6]
[1,] -1.24027000  1.5024476  1.3045302 -0.8053317 -0.2862131 -0.6643408
[2,]  1.07287682  1.3847513  1.1092756  0.2216030  0.6168580 -1.3360289
[3,] -1.17252509  1.6285847 -0.1464896  0.9522939  0.7477590 -1.2867053
[4,] -0.09175181  0.1944188 -0.3235178 -0.6656975 -0.5801493  0.4263756
[5,]  0.44286314 -0.5160440 -0.7472113 -0.6026302 -0.3431249 -1.2456083
           [,7]       [,8]       [,9]       [,10]      [,11]      [,12]
[1,] -1.4766957 -1.0044390  0.4339121  1.80651810 -0.1138106 -1.4091416
[2,] -0.5689023  0.8798776  0.6879970 -1.23573184  0.2282510 -1.6819557
[3,] -0.1458735 -0.1500020 -0.8988756 -0.02038735  1.0782398 -0.7626631
[4,]  1.3795964  0.3112004 -0.5072567 -0.14532454 -1.4349744  0.7852153
[5,] -2.0834202 -0.1649278  1.9826118  1.48840056  0.2845621 -0.5086103
           [,13]      [,14]      [,15]      [,16]      [,17]       [,18]
[1,] -0.52891431  1.2044139 -0.6408562  0.5733455 -1.4564267 -0.22613038
[2,] -1.52704891 -0.8441699  0.6404410 -0.3519254 -0.2266156  0.13533179
[3,]  1.04940527  0.1139585 -0.1380178  1.0627172 -1.6198135 -0.01947669
[4,] -1.57440577  1.7757827 -1.5908800 -2.0300126  0.7589265 -1.61143761
[5,] -0.05512058 -0.4598108 -1.3370898  0.6025448 -0.5931633  0.61696698
          [,19]      [,20]
[1,]  0.3656038 -0.5197618
[2,] -1.1612421 -0.1301006
[3,] -0.6976955 -0.1462507
[4,]  1.8729222 -1.0081045
[5,] -0.3118910  0.1429763
> 
> 
> is.BufferedMatrix(tmp)
[1] TRUE
> 
> as.BufferedMatrix(as.matrix(tmp))
BufferedMatrix object
Matrix size:  5 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  800  bytes.
> 
> 
> 
> subBufferedMatrix(tmp,1:5,1:5)
BufferedMatrix object
Matrix size:  5 5 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  652  bytes.
Disk usage :  200  bytes.
> subBufferedMatrix(tmp,,5:8)
BufferedMatrix object
Matrix size:  5 4 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  567  bytes.
Disk usage :  160  bytes.
> subBufferedMatrix(tmp,1:3,)
BufferedMatrix object
Matrix size:  3 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  480  bytes.
> 
> 
> rm(tmp)
> 
> 
> ###
> ### Testing colnames and rownames
> ###
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> 
> 
> colnames(tmp)
NULL
> rownames(tmp)
NULL
> 
> 
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> colnames(tmp)
 [1] "col1"  "col2"  "col3"  "col4"  "col5"  "col6"  "col7"  "col8"  "col9" 
[10] "col10" "col11" "col12" "col13" "col14" "col15" "col16" "col17" "col18"
[19] "col19" "col20"
> rownames(tmp)
[1] "row1" "row2" "row3" "row4" "row5"
> 
> 
> tmp["row1",]
          col1      col2      col3       col4       col5       col6      col7
row1 -1.460762 -1.476896 0.3802462 -0.3240463 -0.7958424 -0.8275098 -1.336995
           col8      col9     col10      col11      col12     col13     col14
row1 0.09057665 0.7753943 -1.476623 -0.4256985 -0.6476172 0.1076501 -2.421747
          col15      col16    col17     col18      col19     col20
row1 -0.3702797 -0.1168099 -1.58914 0.7583645 -0.4856991 -1.071794
> tmp[,"col10"]
          col10
row1 -1.4766226
row2 -1.8823483
row3 -0.9799513
row4 -1.1539284
row5 -0.5173525
> tmp[c("row1","row5"),]
           col1      col2      col3       col4       col5       col6
row1 -1.4607624 -1.476896 0.3802462 -0.3240463 -0.7958424 -0.8275098
row5 -0.2640685  1.570339 1.1395435 -1.3606166 -0.1676333  0.9785946
            col7        col8       col9      col10      col11      col12
row1 -1.33699538  0.09057665  0.7753943 -1.4766226 -0.4256985 -0.6476172
row5 -0.01972641 -0.68876504 -0.3174249 -0.5173525  0.2816542  1.2766349
          col13     col14      col15      col16      col17     col18
row1 0.10765014 -2.421747 -0.3702797 -0.1168099 -1.5891404 0.7583645
row5 0.09001935  1.261504  1.8035482 -0.4979352  0.6670286 0.4694830
           col19      col20
row1 -0.48569913 -1.0717945
row5 -0.09973123 -0.6908758
> tmp[,c("col6","col20")]
           col6        col20
row1 -0.8275098 -1.071794465
row2 -0.5851627  0.008203596
row3 -0.8106289  0.260266355
row4 -0.4629861 -0.426337814
row5  0.9785946 -0.690875792
> tmp[c("row1","row5"),c("col6","col20")]
           col6      col20
row1 -0.8275098 -1.0717945
row5  0.9785946 -0.6908758
> 
> 
> 
> 
> tmp["row1",] <- rnorm(20,mean=10)
> tmp[,"col10"] <- rnorm(5,mean=30)
> tmp[c("row1","row5"),] <- rnorm(40,mean=50)
> tmp[,c("col6","col20")] <- rnorm(10,mean=75)
> tmp[c("row1","row5"),c("col6","col20")]  <- rnorm(4,mean=105)
> 
> tmp["row1",]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 49.24111 50.35646 52.24938 50.00768 48.55999 105.1117 48.35147 52.07953
         col9    col10    col11    col12    col13    col14   col15   col16
row1 51.09613 49.28273 49.58853 51.57874 49.29553 49.77652 48.8424 50.3262
        col17    col18    col19    col20
row1 49.70742 51.10651 49.97009 103.9118
> tmp[,"col10"]
        col10
row1 49.28273
row2 32.36192
row3 29.87427
row4 31.18043
row5 51.20048
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 49.24111 50.35646 52.24938 50.00768 48.55999 105.1117 48.35147 52.07953
row5 48.66350 49.69895 50.39408 49.96032 48.93895 105.2389 50.16207 50.18755
         col9    col10    col11    col12    col13    col14   col15    col16
row1 51.09613 49.28273 49.58853 51.57874 49.29553 49.77652 48.8424 50.32620
row5 49.84200 51.20048 49.77907 50.93132 50.37259 50.30198 49.6628 49.83108
        col17    col18    col19    col20
row1 49.70742 51.10651 49.97009 103.9118
row5 49.14349 49.30873 51.06472 105.5637
> tmp[,c("col6","col20")]
          col6     col20
row1 105.11165 103.91178
row2  76.08463  74.96229
row3  74.72424  77.35133
row4  73.65900  75.20094
row5 105.23890 105.56372
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 105.1117 103.9118
row5 105.2389 105.5637
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 105.1117 103.9118
row5 105.2389 105.5637
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
          col13
[1,]  0.5974567
[2,]  1.5106718
[3,]  0.3242778
[4,] -0.2263820
[5,] -0.3687251
> tmp[,c("col17","col7")]
          col17       col7
[1,] -0.9120234  2.2176187
[2,] -0.2393902 -1.1561688
[3,]  2.2966226  0.4259957
[4,] -2.6631684 -1.2559121
[5,] -0.2265576 -0.2869878
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
            col6      col20
[1,] -1.89159373 -1.3482843
[2,]  0.08078198  0.5967187
[3,] -1.16797541  1.2345369
[4,] -0.63230256 -0.9070577
[5,]  0.88476171  0.1473865
> subBufferedMatrix(tmp,1,c("col6"))[,1]
          col1
[1,] -1.891594
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
            col6
[1,] -1.89159373
[2,]  0.08078198
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> 
> 
> 
> subBufferedMatrix(tmp,c("row3","row1"),)[,1:20]
          [,1]       [,2]         [,3]       [,4]       [,5]       [,6]
row3 0.4302948 -0.5408165  0.003570728 -1.3884619 -0.1533346 -1.4980060
row1 0.6581741  1.1183572 -0.623494172  0.1939989 -0.1808487  0.9308425
         [,7]     [,8]       [,9]     [,10]      [,11]     [,12]     [,13]
row3 2.047573 0.601294 -0.4880851 -1.513957 -0.5361378 -1.009753 0.2970130
row1 1.267467 1.327764 -0.1039080  1.248877 -1.1967814  1.134987 0.8530625
          [,14]      [,15]     [,16]      [,17]       [,18]     [,19]
row3 -0.1863695 -1.9119390 -1.135769  0.3542027  0.02584538  0.102689
row1  0.4222111  0.3152329  0.937909 -0.8237284 -0.43870967 -1.296002
          [,20]
row3  1.2278779
row1 -0.9060529
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
         [,1]       [,2]      [,3]      [,4]       [,5]       [,6]      [,7]
row2 1.977096 -0.3178444 0.3161761 0.5170396 -0.8363049 -0.4872678 0.7037783
         [,8]       [,9]    [,10]
row2 1.562712 -0.2206191 1.463346
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
          [,1]       [,2]       [,3]       [,4]      [,5]      [,6]      [,7]
row5 0.6111689 -0.9577087 -0.6658198 -0.1187838 0.3615993 0.9961363 -0.171976
           [,8]       [,9]     [,10]      [,11]     [,12]      [,13]   [,14]
row5 0.01265809 -0.2597145 0.5515991 -0.3824646 0.3202717 -0.1342487 2.83439
          [,15]      [,16]     [,17]     [,18]    [,19]      [,20]
row5 -0.5180598 -0.2990513 -1.299753 -0.684235 0.501418 -0.8765175
> 
> 
> 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: 0x600002cd40c0>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM1135b164ea1d" 
 [2] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM1135b84616a2" 
 [3] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM1135b3177e9ec"
 [4] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM1135b379e9e53"
 [5] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM1135beac77ac" 
 [6] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM1135b5ce4c4ba"
 [7] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM1135b2f2fbefb"
 [8] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM1135b67a368f0"
 [9] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM1135b193e99b8"
[10] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM1135b5cde0bfa"
[11] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM1135b75e479b7"
[12] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM1135b6af319d8"
[13] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM1135b7e25eac2"
[14] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM1135b6b57a741"
[15] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM1135b47a5d375"
> 
> 
> ### 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: 0x600002cf0960>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x600002cf0960>
Warning message:
In dir.create(new.directory) :
  '/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x600002cf0960>
> rowMedians(tmp)
  [1] -0.156637979  0.048770537 -0.235517917  0.312181001 -0.163708210
  [6] -0.214708029  0.312077777 -0.231777782 -0.042212540 -0.052829938
 [11] -0.528281043 -0.060938889  0.086965689 -0.309403808  0.074990843
 [16] -0.321669898  0.302246485 -0.336631208  0.141615376 -0.249800565
 [21] -0.326497169  0.484217715  0.026006689 -0.369762218  0.156305061
 [26] -0.299604970  0.043942441  0.277812865  0.210435402  0.020519036
 [31] -0.064492355 -0.497319409  0.393984410  0.003680932  1.036281909
 [36] -0.445201243  0.284564232 -0.149540879  0.009857300  0.201882960
 [41]  0.181268995 -0.061471494  0.641269080  0.350784531 -0.530221866
 [46]  0.074367647 -0.247923121 -0.143117101  0.069639989 -0.372628512
 [51] -0.136144100  0.357346000  0.561774601 -0.157161624 -0.095012571
 [56]  0.109893710  0.143668946 -0.122005998 -0.228932646 -0.573121519
 [61]  0.306870084 -0.506602707 -0.071233280  0.008752762 -0.388871458
 [66] -0.247291050  0.245509165 -0.233645337  0.232742848  0.689417663
 [71] -0.431431590 -0.264538686 -0.071873856 -0.573442431 -0.012563195
 [76] -0.082587894  0.003721488 -0.131335541 -0.540328848 -0.018989554
 [81]  0.159341704 -0.101353727 -0.083417161 -0.062566065 -0.026224747
 [86]  0.047782577 -0.440470173  0.774914501 -0.430047056 -0.204557834
 [91] -0.122869694  0.054133157 -0.578255196 -0.116768831  0.156209507
 [96]  0.019043630 -0.116868945  0.090186705  0.185590663  0.308712843
[101]  0.305875194  0.640372608  0.123942679  0.237561619 -0.395508772
[106]  0.555263578 -0.199874716 -0.588325000 -0.747731149  0.180259825
[111] -0.074076336 -0.373060457 -0.296890692 -0.340497214 -0.023561742
[116]  0.184354175  0.136655763  0.051698848 -0.244759732 -0.329173141
[121]  0.113473435  0.188753851  0.387032785 -0.099012618  0.255803962
[126]  0.318010978 -0.117741084 -0.469441395  0.023484179 -0.235912684
[131] -0.003443330  0.125377486  0.245044088 -0.057601705  0.084437107
[136]  0.211310312  0.295961431 -0.106099981 -0.157241031  0.125717715
[141] -0.335679140 -0.747814917  0.239896609  0.090107772  0.263428717
[146] -0.276619683  0.070434373  0.203163889  0.367036126  0.143724474
[151]  0.094349205 -0.019506404  0.804464954 -0.184341734 -0.505396722
[156] -0.369643102  0.219887681  0.032026076  0.062457121 -0.136059706
[161] -0.635884509  0.205191229  0.242794891  0.196883401  0.046090923
[166] -0.302662541  0.051557159 -0.280145258 -0.397415541 -0.555593645
[171]  0.060251344 -0.392158806  0.365956575 -0.608704639  0.197949417
[176]  0.088347101 -0.385620142  0.057909994  0.110253378  0.170911465
[181] -0.166247360 -0.134300859  0.224444860 -0.375324257  0.309136203
[186] -0.051355763 -0.095962338 -0.758119402 -0.030814210 -0.240239059
[191]  0.171865436  0.198636856  0.101459170  0.117166676 -0.247865735
[196] -0.189931102 -0.358729590  0.746482268 -0.452529870 -0.509561183
[201] -0.400473983 -0.259371053 -0.692732399 -0.049624733 -0.249773206
[206]  0.330742667  0.454644632 -0.123433588  0.031794503  0.035250084
[211]  0.324974783  0.379767322  0.643337613 -0.158801984  0.068152600
[216]  0.261309798  0.195297645 -0.099986452 -0.111986979 -0.105365334
[221]  0.041490934  0.159821526  0.237685000  0.146716435 -0.654025845
[226]  0.018339191 -0.214858728  0.008253555  0.155559356  0.036727769
> 
> proc.time()
   user  system elapsed 
  2.170   8.945  11.731 

BufferedMatrix.Rcheck/tests/rawCalltesting.Rout


R version 4.4.3 (2025-02-28) -- "Trophy Case"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: aarch64-apple-darwin20

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

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

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

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

Attaching package: 'BufferedMatrix'

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

    colMeans, colSums, rowMeans, rowSums

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

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

<pointer: 0x60000390c000>
> .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: 0x60000390c000>
> .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: 0x60000390c000>
> .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: 0x60000390c000>
> 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: 0x600003918840>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600003918840>
> .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: 0x600003918840>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600003918840>
> .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: 0x600003918840>
> 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: 0x600003918a20>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600003918a20>
> .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: 0x600003918a20>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x600003918a20>
> .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: 0x600003918a20>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x600003918a20>
> .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: 0x600003918a20>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x600003918a20>
> .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: 0x600003918a20>
> 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: 0x600003918c00>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x600003918c00>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600003918c00>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600003918c00>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile1137c1e7fab57" "BufferedMatrixFile1137c4fc9ec65"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile1137c1e7fab57" "BufferedMatrixFile1137c4fc9ec65"
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x600003918ea0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600003918ea0>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x600003918ea0>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x600003918ea0>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x600003918ea0>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x600003918ea0>
> .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: 0x600003919080>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600003919080>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x600003919080>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x600003919080>
> 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: 0x600003919260>
> .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: 0x600003919260>
> rm(P)
> 
> proc.time()
   user  system elapsed 
  0.319   0.115   0.422 

BufferedMatrix.Rcheck/tests/Rcodetesting.Rout


R version 4.4.3 (2025-02-28) -- "Trophy Case"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: aarch64-apple-darwin20

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

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

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

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

Attaching package: 'BufferedMatrix'

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

    colMeans, colSums, rowMeans, rowSums

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

Example timings