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

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

HostnameOSArch (*)R versionInstalled pkgs
nebbiolo2Linux (Ubuntu 24.04.3 LTS)x86_644.5.1 Patched (2025-08-23 r88802) -- "Great Square Root" 4864
lconwaymacOS 12.7.1 Montereyx86_644.5.1 Patched (2025-09-10 r88807) -- "Great Square Root" 4652
kjohnson3macOS 13.7.7 Venturaarm644.5.1 Patched (2025-09-10 r88807) -- "Great Square Root" 4597
taishanLinux (openEuler 24.03 LTS)aarch644.5.0 (2025-04-11) -- "How About a Twenty-Six" 4586
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 255/2346HostnameOS / ArchINSTALLBUILDCHECKBUILD BIN
BufferedMatrix 1.73.0  (landing page)
Ben Bolstad
Snapshot Date: 2025-10-10 13:45 -0400 (Fri, 10 Oct 2025)
git_url: https://git.bioconductor.org/packages/BufferedMatrix
git_branch: devel
git_last_commit: 0147962
git_last_commit_date: 2025-04-15 09:39:39 -0400 (Tue, 15 Apr 2025)
nebbiolo2Linux (Ubuntu 24.04.3 LTS) / x86_64  OK    OK    OK  UNNEEDED, same version is already published
lconwaymacOS 12.7.1 Monterey / x86_64  OK    OK    WARNINGS    OK  UNNEEDED, same version is already published
kjohnson3macOS 13.7.7 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 kjohnson3

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

raw results


Summary

Package: BufferedMatrix
Version: 1.73.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.73.0.tar.gz
StartedAt: 2025-10-10 18:31:11 -0400 (Fri, 10 Oct 2025)
EndedAt: 2025-10-10 18:31:26 -0400 (Fri, 10 Oct 2025)
EllapsedTime: 15.2 seconds
RetCode: 0
Status:   WARNINGS  
CheckDir: BufferedMatrix.Rcheck
Warnings: 1

Command output

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


* using log directory ‘/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck’
* using R version 4.5.1 Patched (2025-09-10 r88807)
* using platform: aarch64-apple-darwin20
* R was compiled by
    Apple clang version 16.0.0 (clang-1600.0.26.6)
    GNU Fortran (GCC) 14.2.0
* running under: macOS Ventura 13.7.7
* using session charset: UTF-8
* using option ‘--no-vignettes’
* checking for file ‘BufferedMatrix/DESCRIPTION’ ... OK
* this is package ‘BufferedMatrix’ version ‘1.73.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.22-bioc/meat/BufferedMatrix.Rcheck/00install.out’ for details.
* used C compiler: ‘Apple clang version 15.0.0 (clang-1500.1.0.2.5)’
* used SDK: ‘MacOSX11.3.1.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.22-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.5-arm64/Resources/library’
* installing *source* package ‘BufferedMatrix’ ...
** this is package ‘BufferedMatrix’ version ‘1.73.0’
** using staged installation
** libs
using C compiler: ‘Apple clang version 15.0.0 (clang-1500.1.0.2.5)’
using SDK: ‘MacOSX11.3.1.sdk’
clang -arch arm64 -std=gnu2x -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 -std=gnu2x -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 -std=gnu2x -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 -std=gnu2x -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 -std=gnu2x -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
installing to /Library/Frameworks/R.framework/Versions/4.5-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.5.1 Patched (2025-09-10 r88807) -- "Great Square Root"
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.109   0.034   0.138 

BufferedMatrix.Rcheck/tests/objectTesting.Rout


R version 4.5.1 Patched (2025-09-10 r88807) -- "Great Square Root"
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.22-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 480828 25.7    1056624 56.5         NA   634340 33.9
Vcells 891019  6.8    8388608 64.0     196608  2109889 16.1
> 
> 
> 
> 
> ##
> ## checking reads
> ##
> 
> tmp2 <- createBufferedMatrix(10,20)
> 
> test.sample <- rnorm(10*20)
> 
> tmp2[1:10,1:20] <- test.sample
> 
> test.matrix <- matrix(test.sample,10,20)
> 
> ## testing reads
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   which.col <- sample(1:20,1)
+   if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> date()
[1] "Fri Oct 10 18:31:19 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 Oct 10 18:31:19 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: 0x600002cfc300>
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   which.col <- sample(1:20,1)
+   if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,5,replace=TRUE)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> date()
[1] "Fri Oct 10 18:31:20 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 Oct 10 18:31:21 2025"
> 
> ColMode(tmp2)
<pointer: 0x600002cfc300>
> 
> 
> 
> ### 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,] 101.1344930  0.5971114  1.35395672 -1.0297240
[2,]  -0.7378142  1.4939873  1.92199531 -0.1673301
[3,]  -0.9037645 -0.8828565  0.09366975  1.2298642
[4,]  -0.8132233 -0.1789470 -0.32541662  0.4003331
> ewApply(tmp5,abs)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.22-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,] 101.1344930 0.5971114 1.35395672 1.0297240
[2,]   0.7378142 1.4939873 1.92199531 0.1673301
[3,]   0.9037645 0.8828565 0.09366975 1.2298642
[4,]   0.8132233 0.1789470 0.32541662 0.4003331
> ewApply(tmp5,sqrt)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.22-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,] 10.0565647 0.7727298 1.1635965 1.0147532
[2,]  0.8589611 1.2222877 1.3863605 0.4090600
[3,]  0.9506653 0.9396044 0.3060551 1.1089924
[4,]  0.9017890 0.4230213 0.5704530 0.6327188
> 
> 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.22-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,] 226.70014 33.32441 37.98992 36.17726
[2,]  34.32743 38.71686 40.78560 29.25793
[3,]  35.41042 35.27890 28.15422 37.31979
[4,]  34.83111 29.40916 31.02995 31.72752
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x600002cf0000>
> exp(tmp5)
<pointer: 0x600002cf0000>
> log(tmp5,2)
<pointer: 0x600002cf0000>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 471.8466
> Min(tmp5)
[1] 53.248
> mean(tmp5)
[1] 72.38709
> Sum(tmp5)
[1] 14477.42
> Var(tmp5)
[1] 880.4165
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 91.40397 69.42225 73.63594 68.85082 65.49072 69.63469 75.09326 68.92200
 [9] 69.28861 72.12867
> rowSums(tmp5)
 [1] 1828.079 1388.445 1472.719 1377.016 1309.814 1392.694 1501.865 1378.440
 [9] 1385.772 1442.573
> rowVars(tmp5)
 [1] 8084.27606   55.52201   87.82387   66.08278   55.84592   76.05049
 [7]  104.60740   51.14474   70.22421   76.33227
> rowSd(tmp5)
 [1] 89.912602  7.451309  9.371439  8.129132  7.473013  8.720693 10.227776
 [8]  7.151555  8.379989  8.736834
> rowMax(tmp5)
 [1] 471.84664  84.88988  88.68716  82.96216  86.26825  87.43302 100.07357
 [8]  88.39324  89.34310  85.85974
> rowMin(tmp5)
 [1] 57.46699 57.62903 54.67253 53.77019 53.69582 53.24800 59.30582 60.16246
 [9] 54.28612 58.40234
> 
> colMeans(tmp5)
 [1] 111.12426  68.61135  69.72106  69.50426  71.17839  67.83884  66.17523
 [8]  74.54389  66.79037  68.64753  72.21117  71.49380  71.13674  69.81793
[15]  70.45810  76.82831  71.68560  72.90102  70.58847  66.48552
> colSums(tmp5)
 [1] 1111.2426  686.1135  697.2106  695.0426  711.7839  678.3884  661.7523
 [8]  745.4389  667.9037  686.4753  722.1117  714.9380  711.3674  698.1793
[15]  704.5810  768.2831  716.8560  729.0102  705.8847  664.8552
> colVars(tmp5)
 [1] 16078.86552    50.97790    67.31782   104.36542    36.96424    42.93882
 [7]    61.18597    78.57441    84.19586   109.26999    66.85267   170.70767
[13]    77.77921    91.09518    56.12563    33.81852    90.31087    60.78784
[19]   101.97901   100.43615
> colSd(tmp5)
 [1] 126.802467   7.139881   8.204744  10.215939   6.079823   6.552772
 [7]   7.822146   8.864221   9.175830  10.453229   8.176348  13.065514
[13]   8.819252   9.544380   7.491704   5.815370   9.503203   7.796656
[19]  10.098466  10.021784
> colMax(tmp5)
 [1] 471.84664  80.58408  84.88988  87.43302  79.59927  79.36854  82.96216
 [8]  85.61178  87.09319  92.15606  89.34310 100.07357  86.53520  85.85974
[15]  79.01206  86.26825  88.39324  85.67549  84.80677  88.19750
> colMin(tmp5)
 [1] 62.52148 61.21131 58.59932 58.09480 61.94813 59.97846 57.62903 61.41930
 [9] 55.95024 54.67253 58.83894 57.70079 57.43271 53.77019 58.76736 68.67909
[17] 53.69582 58.73141 54.28612 53.24800
> 
> 
> ### setting a random element to NA and then testing with na.rm=TRUE or na.rm=FALSE (The default)
> 
> 
> which.row <- sample(1:10,1,replace=TRUE)
> which.col  <- sample(1:20,1,replace=TRUE)
> 
> tmp5[which.row,which.col] <- NA
> 
> Max(tmp5)
[1] NA
> Min(tmp5)
[1] NA
> mean(tmp5)
[1] NA
> Sum(tmp5)
[1] NA
> Var(tmp5)
[1] NA
> 
> rowMeans(tmp5)
 [1] 91.40397 69.42225 73.63594 68.85082 65.49072 69.63469 75.09326 68.92200
 [9] 69.28861       NA
> rowSums(tmp5)
 [1] 1828.079 1388.445 1472.719 1377.016 1309.814 1392.694 1501.865 1378.440
 [9] 1385.772       NA
> rowVars(tmp5)
 [1] 8084.27606   55.52201   87.82387   66.08278   55.84592   76.05049
 [7]  104.60740   51.14474   70.22421   73.15700
> rowSd(tmp5)
 [1] 89.912602  7.451309  9.371439  8.129132  7.473013  8.720693 10.227776
 [8]  7.151555  8.379989  8.553186
> rowMax(tmp5)
 [1] 471.84664  84.88988  88.68716  82.96216  86.26825  87.43302 100.07357
 [8]  88.39324  89.34310        NA
> rowMin(tmp5)
 [1] 57.46699 57.62903 54.67253 53.77019 53.69582 53.24800 59.30582 60.16246
 [9] 54.28612       NA
> 
> colMeans(tmp5)
 [1] 111.12426  68.61135  69.72106  69.50426  71.17839  67.83884  66.17523
 [8]        NA  66.79037  68.64753  72.21117  71.49380  71.13674  69.81793
[15]  70.45810  76.82831  71.68560  72.90102  70.58847  66.48552
> colSums(tmp5)
 [1] 1111.2426  686.1135  697.2106  695.0426  711.7839  678.3884  661.7523
 [8]        NA  667.9037  686.4753  722.1117  714.9380  711.3674  698.1793
[15]  704.5810  768.2831  716.8560  729.0102  705.8847  664.8552
> colVars(tmp5)
 [1] 16078.86552    50.97790    67.31782   104.36542    36.96424    42.93882
 [7]    61.18597          NA    84.19586   109.26999    66.85267   170.70767
[13]    77.77921    91.09518    56.12563    33.81852    90.31087    60.78784
[19]   101.97901   100.43615
> colSd(tmp5)
 [1] 126.802467   7.139881   8.204744  10.215939   6.079823   6.552772
 [7]   7.822146         NA   9.175830  10.453229   8.176348  13.065514
[13]   8.819252   9.544380   7.491704   5.815370   9.503203   7.796656
[19]  10.098466  10.021784
> colMax(tmp5)
 [1] 471.84664  80.58408  84.88988  87.43302  79.59927  79.36854  82.96216
 [8]        NA  87.09319  92.15606  89.34310 100.07357  86.53520  85.85974
[15]  79.01206  86.26825  88.39324  85.67549  84.80677  88.19750
> colMin(tmp5)
 [1] 62.52148 61.21131 58.59932 58.09480 61.94813 59.97846 57.62903       NA
 [9] 55.95024 54.67253 58.83894 57.70079 57.43271 53.77019 58.76736 68.67909
[17] 53.69582 58.73141 54.28612 53.24800
> 
> Max(tmp5,na.rm=TRUE)
[1] 471.8466
> Min(tmp5,na.rm=TRUE)
[1] 53.248
> mean(tmp5,na.rm=TRUE)
[1] 72.3318
> Sum(tmp5,na.rm=TRUE)
[1] 14394.03
> Var(tmp5,na.rm=TRUE)
[1] 884.2486
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 91.40397 69.42225 73.63594 68.85082 65.49072 69.63469 75.09326 68.92200
 [9] 69.28861 71.53598
> rowSums(tmp5,na.rm=TRUE)
 [1] 1828.079 1388.445 1472.719 1377.016 1309.814 1392.694 1501.865 1378.440
 [9] 1385.772 1359.184
> rowVars(tmp5,na.rm=TRUE)
 [1] 8084.27606   55.52201   87.82387   66.08278   55.84592   76.05049
 [7]  104.60740   51.14474   70.22421   73.15700
> rowSd(tmp5,na.rm=TRUE)
 [1] 89.912602  7.451309  9.371439  8.129132  7.473013  8.720693 10.227776
 [8]  7.151555  8.379989  8.553186
> rowMax(tmp5,na.rm=TRUE)
 [1] 471.84664  84.88988  88.68716  82.96216  86.26825  87.43302 100.07357
 [8]  88.39324  89.34310  85.85974
> rowMin(tmp5,na.rm=TRUE)
 [1] 57.46699 57.62903 54.67253 53.77019 53.69582 53.24800 59.30582 60.16246
 [9] 54.28612 58.40234
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 111.12426  68.61135  69.72106  69.50426  71.17839  67.83884  66.17523
 [8]  73.56102  66.79037  68.64753  72.21117  71.49380  71.13674  69.81793
[15]  70.45810  76.82831  71.68560  72.90102  70.58847  66.48552
> colSums(tmp5,na.rm=TRUE)
 [1] 1111.2426  686.1135  697.2106  695.0426  711.7839  678.3884  661.7523
 [8]  662.0492  667.9037  686.4753  722.1117  714.9380  711.3674  698.1793
[15]  704.5810  768.2831  716.8560  729.0102  705.8847  664.8552
> colVars(tmp5,na.rm=TRUE)
 [1] 16078.86552    50.97790    67.31782   104.36542    36.96424    42.93882
 [7]    61.18597    77.52816    84.19586   109.26999    66.85267   170.70767
[13]    77.77921    91.09518    56.12563    33.81852    90.31087    60.78784
[19]   101.97901   100.43615
> colSd(tmp5,na.rm=TRUE)
 [1] 126.802467   7.139881   8.204744  10.215939   6.079823   6.552772
 [7]   7.822146   8.805007   9.175830  10.453229   8.176348  13.065514
[13]   8.819252   9.544380   7.491704   5.815370   9.503203   7.796656
[19]  10.098466  10.021784
> colMax(tmp5,na.rm=TRUE)
 [1] 471.84664  80.58408  84.88988  87.43302  79.59927  79.36854  82.96216
 [8]  85.61178  87.09319  92.15606  89.34310 100.07357  86.53520  85.85974
[15]  79.01206  86.26825  88.39324  85.67549  84.80677  88.19750
> colMin(tmp5,na.rm=TRUE)
 [1] 62.52148 61.21131 58.59932 58.09480 61.94813 59.97846 57.62903 61.41930
 [9] 55.95024 54.67253 58.83894 57.70079 57.43271 53.77019 58.76736 68.67909
[17] 53.69582 58.73141 54.28612 53.24800
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1] 91.40397 69.42225 73.63594 68.85082 65.49072 69.63469 75.09326 68.92200
 [9] 69.28861      NaN
> rowSums(tmp5,na.rm=TRUE)
 [1] 1828.079 1388.445 1472.719 1377.016 1309.814 1392.694 1501.865 1378.440
 [9] 1385.772    0.000
> rowVars(tmp5,na.rm=TRUE)
 [1] 8084.27606   55.52201   87.82387   66.08278   55.84592   76.05049
 [7]  104.60740   51.14474   70.22421         NA
> rowSd(tmp5,na.rm=TRUE)
 [1] 89.912602  7.451309  9.371439  8.129132  7.473013  8.720693 10.227776
 [8]  7.151555  8.379989        NA
> rowMax(tmp5,na.rm=TRUE)
 [1] 471.84664  84.88988  88.68716  82.96216  86.26825  87.43302 100.07357
 [8]  88.39324  89.34310        NA
> rowMin(tmp5,na.rm=TRUE)
 [1] 57.46699 57.62903 54.67253 53.77019 53.69582 53.24800 59.30582 60.16246
 [9] 54.28612       NA
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1] 115.37123  67.75648  69.64812  70.66629  70.28890  68.07576  66.86040
 [8]       NaN  67.72237  68.86190  71.81552  72.25798  70.64388  68.03551
[15]  69.54801  77.52845  72.61369  71.48163  69.36663  66.21233
> colSums(tmp5,na.rm=TRUE)
 [1] 1038.3411  609.8084  626.8331  635.9966  632.6001  612.6818  601.7436
 [8]    0.0000  609.5014  619.7571  646.3397  650.3219  635.7949  612.3196
[15]  625.9321  697.7560  653.5232  643.3347  624.2997  595.9110
> colVars(tmp5,na.rm=TRUE)
 [1] 17885.81044    49.12861    75.67269   102.22024    32.68386    47.67473
 [7]    63.55279          NA    84.94825   122.41174    73.44819   185.47637
[13]    84.76889    66.74047    53.82339    32.53116    91.90936    45.72145
[19]    97.93135   112.15106
> colSd(tmp5,na.rm=TRUE)
 [1] 133.737842   7.009180   8.699005  10.110402   5.716980   6.904689
 [7]   7.972000         NA   9.216738  11.063984   8.570192  13.618971
[13]   9.207002   8.169484   7.336443   5.703609   9.586937   6.761764
[19]   9.896027  10.590140
> colMax(tmp5,na.rm=TRUE)
 [1] 471.84664  80.58408  84.88988  87.43302  79.59927  79.36854  82.96216
 [8]      -Inf  87.09319  92.15606  89.34310 100.07357  86.53520  82.02010
[15]  79.01206  86.26825  88.39324  82.86690  84.80677  88.19750
> colMin(tmp5,na.rm=TRUE)
 [1] 62.52148 61.21131 58.59932 58.09480 61.94813 59.97846 57.62903      Inf
 [9] 55.95024 54.67253 58.83894 57.70079 57.43271 53.77019 58.76736 68.67909
[17] 53.69582 58.73141 54.28612 53.24800
> 
> 
> 
> 
> 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] 282.52031 272.17883 230.48255 157.23240 219.93147 323.92001 254.33751
 [8] 318.03452 198.58777  93.31591
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 282.52031 272.17883 230.48255 157.23240 219.93147 323.92001 254.33751
 [8] 318.03452 198.58777  93.31591
> 
> 
> 
> 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]  5.684342e-14 -1.421085e-14  1.136868e-13  3.410605e-13  1.136868e-13
 [6]  5.684342e-14 -8.526513e-14  1.136868e-13 -2.273737e-13  4.263256e-14
[11] -1.421085e-14 -1.989520e-13 -2.842171e-14 -1.136868e-13  9.947598e-14
[16] -1.421085e-14  0.000000e+00  8.526513e-14 -4.263256e-14  0.000000e+00
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> ## making sure these things agree
> ##
> ## first when there is no NA
> 
> 
> 
> agree.checks <- function(buff.matrix,r.matrix,err.tol=1e-10){
+ 
+   if (Max(buff.matrix,na.rm=TRUE) != max(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Max")
+   }
+   
+ 
+   if (Min(buff.matrix,na.rm=TRUE) != min(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Min")
+   }
+ 
+ 
+   if (abs(Sum(buff.matrix,na.rm=TRUE)- sum(r.matrix,na.rm=TRUE)) > err.tol){
+ 
+     cat(Sum(buff.matrix,na.rm=TRUE),"\n")
+     cat(sum(r.matrix,na.rm=TRUE),"\n")
+     cat(Sum(buff.matrix,na.rm=TRUE) - sum(r.matrix,na.rm=TRUE),"\n")
+     
+     stop("No agreement in Sum")
+   }
+   
+   if (abs(mean(buff.matrix,na.rm=TRUE) - mean(r.matrix,na.rm=TRUE)) > err.tol){
+     stop("No agreement in mean")
+   }
+   
+   
+   if(abs(Var(buff.matrix,na.rm=TRUE) - var(as.vector(r.matrix),na.rm=TRUE)) > err.tol){
+     stop("No agreement in Var")
+   }
+   
+   
+ 
+   if(any(abs(rowMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,mean,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowMeans")
+   }
+   
+   
+   if(any(abs(colMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,mean,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colMeans")
+   }
+   
+   
+   if(any(abs(rowSums(buff.matrix,na.rm=TRUE)  -  apply(r.matrix,1,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in rowSums")
+   }
+   
+   
+   if(any(abs(colSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colSums")
+   }
+   
+   ### this is to get around the fact that R doesn't like to compute NA on an entire vector of NA when 
+   ### computing variance
+   my.Var <- function(x,na.rm=FALSE){
+    if (all(is.na(x))){
+      return(NA)
+    } else {
+      var(x,na.rm=na.rm)
+    }
+ 
+   }
+   
+   if(any(abs(rowVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+   
+   
+   if(any(abs(colVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+ 
+ 
+   if(any(abs(rowMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+ 
+   if(any(abs(colMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+   
+   
+   if(any(abs(rowMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+   
+ 
+   if(any(abs(colMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+ 
+   if(any(abs(colMedians(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,median,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMedian")
+   }
+ 
+   if(any(abs(colRanges(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,range,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colRanges")
+   }
+ 
+ 
+   
+ }
> 
> 
> 
> 
> 
> 
> 
> 
> 
> for (rep in 1:20){
+   copymatrix <- matrix(rnorm(200,150,15),10,20)
+   
+   tmp5[1:10,1:20] <- copymatrix
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ## now lets assign some NA values and check agreement
+ 
+   which.row <- sample(1:10,1,replace=TRUE)
+   which.col  <- sample(1:20,1,replace=TRUE)
+   
+   cat(which.row," ",which.col,"\n")
+   
+   tmp5[which.row,which.col] <- NA
+   copymatrix[which.row,which.col] <- NA
+   
+   agree.checks(tmp5,copymatrix)
+ 
+   ## make an entire row NA
+   tmp5[which.row,] <- NA
+   copymatrix[which.row,] <- NA
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ### also make an entire col NA
+   tmp5[,which.col] <- NA
+   copymatrix[,which.col] <- NA
+ 
+   agree.checks(tmp5,copymatrix)
+ 
+   ### now make 1 element non NA with NA in the rest of row and column
+ 
+   tmp5[which.row,which.col] <- rnorm(1,150,15)
+   copymatrix[which.row,which.col] <- tmp5[which.row,which.col]
+ 
+   agree.checks(tmp5,copymatrix)
+ }
1   16 
7   11 
3   8 
5   8 
9   6 
2   6 
3   9 
3   8 
9   12 
6   19 
10   10 
7   12 
4   20 
3   17 
6   13 
4   6 
10   20 
8   16 
7   13 
7   2 
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.520193
> Min(tmp)
[1] -2.340398
> mean(tmp)
[1] 0.2376022
> Sum(tmp)
[1] 23.76022
> Var(tmp)
[1] 1.048314
> 
> rowMeans(tmp)
[1] 0.2376022
> rowSums(tmp)
[1] 23.76022
> rowVars(tmp)
[1] 1.048314
> rowSd(tmp)
[1] 1.023872
> rowMax(tmp)
[1] 2.520193
> rowMin(tmp)
[1] -2.340398
> 
> colMeans(tmp)
  [1]  0.114534611  0.768335131  0.142161749 -1.685330624 -0.814083733
  [6] -1.073772947  0.520182693  1.902616091 -1.110830384  0.791292422
 [11] -0.866683599  0.915320664 -0.393765206  0.749031410  2.106709502
 [16] -0.774867497  1.330785178 -0.547723669 -2.155004837  0.899831659
 [21] -0.195151007  1.338870991 -1.222902182 -0.660275553  0.035585495
 [26]  0.744594136 -0.353641649 -1.097437039  1.506568730  0.531350161
 [31] -2.048899060  1.795454283 -0.312576507 -0.046647666 -0.527369541
 [36]  0.597891363  0.624754456  1.571749156  0.945943688  1.490948812
 [41]  0.166329792 -0.675274580 -0.004722173  0.556984937  1.235546241
 [46]  1.154783427  0.159510541  0.294594180  0.602659830  1.683318310
 [51]  1.403299661  0.232336722 -0.465377863 -0.969430629 -0.463031728
 [56]  0.825098276  0.912407484  0.825322298 -0.014311117  0.012552885
 [61]  2.383397331 -0.617267528 -2.340397673  1.094656541 -0.245613606
 [66]  0.125821513  0.503403188 -0.428632670  0.492349417  1.437623211
 [71] -2.182718507 -0.667420125 -0.235642699  0.646326399  0.096009697
 [76]  1.171919206  2.520192637 -0.926631811  0.989677235 -0.597851953
 [81]  0.853024583 -0.071231571  0.735002254  1.694102463  1.075596418
 [86]  0.944634366  1.123785097 -0.568325459 -1.450989622  0.116873899
 [91] -0.432817690 -1.110991435  0.977689645  1.728168981 -0.336203056
 [96]  0.178759131  0.207772910 -0.040728073  0.635620655  1.271125994
> colSums(tmp)
  [1]  0.114534611  0.768335131  0.142161749 -1.685330624 -0.814083733
  [6] -1.073772947  0.520182693  1.902616091 -1.110830384  0.791292422
 [11] -0.866683599  0.915320664 -0.393765206  0.749031410  2.106709502
 [16] -0.774867497  1.330785178 -0.547723669 -2.155004837  0.899831659
 [21] -0.195151007  1.338870991 -1.222902182 -0.660275553  0.035585495
 [26]  0.744594136 -0.353641649 -1.097437039  1.506568730  0.531350161
 [31] -2.048899060  1.795454283 -0.312576507 -0.046647666 -0.527369541
 [36]  0.597891363  0.624754456  1.571749156  0.945943688  1.490948812
 [41]  0.166329792 -0.675274580 -0.004722173  0.556984937  1.235546241
 [46]  1.154783427  0.159510541  0.294594180  0.602659830  1.683318310
 [51]  1.403299661  0.232336722 -0.465377863 -0.969430629 -0.463031728
 [56]  0.825098276  0.912407484  0.825322298 -0.014311117  0.012552885
 [61]  2.383397331 -0.617267528 -2.340397673  1.094656541 -0.245613606
 [66]  0.125821513  0.503403188 -0.428632670  0.492349417  1.437623211
 [71] -2.182718507 -0.667420125 -0.235642699  0.646326399  0.096009697
 [76]  1.171919206  2.520192637 -0.926631811  0.989677235 -0.597851953
 [81]  0.853024583 -0.071231571  0.735002254  1.694102463  1.075596418
 [86]  0.944634366  1.123785097 -0.568325459 -1.450989622  0.116873899
 [91] -0.432817690 -1.110991435  0.977689645  1.728168981 -0.336203056
 [96]  0.178759131  0.207772910 -0.040728073  0.635620655  1.271125994
> 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.114534611  0.768335131  0.142161749 -1.685330624 -0.814083733
  [6] -1.073772947  0.520182693  1.902616091 -1.110830384  0.791292422
 [11] -0.866683599  0.915320664 -0.393765206  0.749031410  2.106709502
 [16] -0.774867497  1.330785178 -0.547723669 -2.155004837  0.899831659
 [21] -0.195151007  1.338870991 -1.222902182 -0.660275553  0.035585495
 [26]  0.744594136 -0.353641649 -1.097437039  1.506568730  0.531350161
 [31] -2.048899060  1.795454283 -0.312576507 -0.046647666 -0.527369541
 [36]  0.597891363  0.624754456  1.571749156  0.945943688  1.490948812
 [41]  0.166329792 -0.675274580 -0.004722173  0.556984937  1.235546241
 [46]  1.154783427  0.159510541  0.294594180  0.602659830  1.683318310
 [51]  1.403299661  0.232336722 -0.465377863 -0.969430629 -0.463031728
 [56]  0.825098276  0.912407484  0.825322298 -0.014311117  0.012552885
 [61]  2.383397331 -0.617267528 -2.340397673  1.094656541 -0.245613606
 [66]  0.125821513  0.503403188 -0.428632670  0.492349417  1.437623211
 [71] -2.182718507 -0.667420125 -0.235642699  0.646326399  0.096009697
 [76]  1.171919206  2.520192637 -0.926631811  0.989677235 -0.597851953
 [81]  0.853024583 -0.071231571  0.735002254  1.694102463  1.075596418
 [86]  0.944634366  1.123785097 -0.568325459 -1.450989622  0.116873899
 [91] -0.432817690 -1.110991435  0.977689645  1.728168981 -0.336203056
 [96]  0.178759131  0.207772910 -0.040728073  0.635620655  1.271125994
> colMin(tmp)
  [1]  0.114534611  0.768335131  0.142161749 -1.685330624 -0.814083733
  [6] -1.073772947  0.520182693  1.902616091 -1.110830384  0.791292422
 [11] -0.866683599  0.915320664 -0.393765206  0.749031410  2.106709502
 [16] -0.774867497  1.330785178 -0.547723669 -2.155004837  0.899831659
 [21] -0.195151007  1.338870991 -1.222902182 -0.660275553  0.035585495
 [26]  0.744594136 -0.353641649 -1.097437039  1.506568730  0.531350161
 [31] -2.048899060  1.795454283 -0.312576507 -0.046647666 -0.527369541
 [36]  0.597891363  0.624754456  1.571749156  0.945943688  1.490948812
 [41]  0.166329792 -0.675274580 -0.004722173  0.556984937  1.235546241
 [46]  1.154783427  0.159510541  0.294594180  0.602659830  1.683318310
 [51]  1.403299661  0.232336722 -0.465377863 -0.969430629 -0.463031728
 [56]  0.825098276  0.912407484  0.825322298 -0.014311117  0.012552885
 [61]  2.383397331 -0.617267528 -2.340397673  1.094656541 -0.245613606
 [66]  0.125821513  0.503403188 -0.428632670  0.492349417  1.437623211
 [71] -2.182718507 -0.667420125 -0.235642699  0.646326399  0.096009697
 [76]  1.171919206  2.520192637 -0.926631811  0.989677235 -0.597851953
 [81]  0.853024583 -0.071231571  0.735002254  1.694102463  1.075596418
 [86]  0.944634366  1.123785097 -0.568325459 -1.450989622  0.116873899
 [91] -0.432817690 -1.110991435  0.977689645  1.728168981 -0.336203056
 [96]  0.178759131  0.207772910 -0.040728073  0.635620655  1.271125994
> colMedians(tmp)
  [1]  0.114534611  0.768335131  0.142161749 -1.685330624 -0.814083733
  [6] -1.073772947  0.520182693  1.902616091 -1.110830384  0.791292422
 [11] -0.866683599  0.915320664 -0.393765206  0.749031410  2.106709502
 [16] -0.774867497  1.330785178 -0.547723669 -2.155004837  0.899831659
 [21] -0.195151007  1.338870991 -1.222902182 -0.660275553  0.035585495
 [26]  0.744594136 -0.353641649 -1.097437039  1.506568730  0.531350161
 [31] -2.048899060  1.795454283 -0.312576507 -0.046647666 -0.527369541
 [36]  0.597891363  0.624754456  1.571749156  0.945943688  1.490948812
 [41]  0.166329792 -0.675274580 -0.004722173  0.556984937  1.235546241
 [46]  1.154783427  0.159510541  0.294594180  0.602659830  1.683318310
 [51]  1.403299661  0.232336722 -0.465377863 -0.969430629 -0.463031728
 [56]  0.825098276  0.912407484  0.825322298 -0.014311117  0.012552885
 [61]  2.383397331 -0.617267528 -2.340397673  1.094656541 -0.245613606
 [66]  0.125821513  0.503403188 -0.428632670  0.492349417  1.437623211
 [71] -2.182718507 -0.667420125 -0.235642699  0.646326399  0.096009697
 [76]  1.171919206  2.520192637 -0.926631811  0.989677235 -0.597851953
 [81]  0.853024583 -0.071231571  0.735002254  1.694102463  1.075596418
 [86]  0.944634366  1.123785097 -0.568325459 -1.450989622  0.116873899
 [91] -0.432817690 -1.110991435  0.977689645  1.728168981 -0.336203056
 [96]  0.178759131  0.207772910 -0.040728073  0.635620655  1.271125994
> colRanges(tmp)
          [,1]      [,2]      [,3]      [,4]       [,5]      [,6]      [,7]
[1,] 0.1145346 0.7683351 0.1421617 -1.685331 -0.8140837 -1.073773 0.5201827
[2,] 0.1145346 0.7683351 0.1421617 -1.685331 -0.8140837 -1.073773 0.5201827
         [,8]     [,9]     [,10]      [,11]     [,12]      [,13]     [,14]
[1,] 1.902616 -1.11083 0.7912924 -0.8666836 0.9153207 -0.3937652 0.7490314
[2,] 1.902616 -1.11083 0.7912924 -0.8666836 0.9153207 -0.3937652 0.7490314
       [,15]      [,16]    [,17]      [,18]     [,19]     [,20]     [,21]
[1,] 2.10671 -0.7748675 1.330785 -0.5477237 -2.155005 0.8998317 -0.195151
[2,] 2.10671 -0.7748675 1.330785 -0.5477237 -2.155005 0.8998317 -0.195151
        [,22]     [,23]      [,24]      [,25]     [,26]      [,27]     [,28]
[1,] 1.338871 -1.222902 -0.6602756 0.03558549 0.7445941 -0.3536416 -1.097437
[2,] 1.338871 -1.222902 -0.6602756 0.03558549 0.7445941 -0.3536416 -1.097437
        [,29]     [,30]     [,31]    [,32]      [,33]       [,34]      [,35]
[1,] 1.506569 0.5313502 -2.048899 1.795454 -0.3125765 -0.04664767 -0.5273695
[2,] 1.506569 0.5313502 -2.048899 1.795454 -0.3125765 -0.04664767 -0.5273695
         [,36]     [,37]    [,38]     [,39]    [,40]     [,41]      [,42]
[1,] 0.5978914 0.6247545 1.571749 0.9459437 1.490949 0.1663298 -0.6752746
[2,] 0.5978914 0.6247545 1.571749 0.9459437 1.490949 0.1663298 -0.6752746
            [,43]     [,44]    [,45]    [,46]     [,47]     [,48]     [,49]
[1,] -0.004722173 0.5569849 1.235546 1.154783 0.1595105 0.2945942 0.6026598
[2,] -0.004722173 0.5569849 1.235546 1.154783 0.1595105 0.2945942 0.6026598
        [,50]  [,51]     [,52]      [,53]      [,54]      [,55]     [,56]
[1,] 1.683318 1.4033 0.2323367 -0.4653779 -0.9694306 -0.4630317 0.8250983
[2,] 1.683318 1.4033 0.2323367 -0.4653779 -0.9694306 -0.4630317 0.8250983
         [,57]     [,58]       [,59]      [,60]    [,61]      [,62]     [,63]
[1,] 0.9124075 0.8253223 -0.01431112 0.01255288 2.383397 -0.6172675 -2.340398
[2,] 0.9124075 0.8253223 -0.01431112 0.01255288 2.383397 -0.6172675 -2.340398
        [,64]      [,65]     [,66]     [,67]      [,68]     [,69]    [,70]
[1,] 1.094657 -0.2456136 0.1258215 0.5034032 -0.4286327 0.4923494 1.437623
[2,] 1.094657 -0.2456136 0.1258215 0.5034032 -0.4286327 0.4923494 1.437623
         [,71]      [,72]      [,73]     [,74]     [,75]    [,76]    [,77]
[1,] -2.182719 -0.6674201 -0.2356427 0.6463264 0.0960097 1.171919 2.520193
[2,] -2.182719 -0.6674201 -0.2356427 0.6463264 0.0960097 1.171919 2.520193
          [,78]     [,79]     [,80]     [,81]       [,82]     [,83]    [,84]
[1,] -0.9266318 0.9896772 -0.597852 0.8530246 -0.07123157 0.7350023 1.694102
[2,] -0.9266318 0.9896772 -0.597852 0.8530246 -0.07123157 0.7350023 1.694102
        [,85]     [,86]    [,87]      [,88]    [,89]     [,90]      [,91]
[1,] 1.075596 0.9446344 1.123785 -0.5683255 -1.45099 0.1168739 -0.4328177
[2,] 1.075596 0.9446344 1.123785 -0.5683255 -1.45099 0.1168739 -0.4328177
         [,92]     [,93]    [,94]      [,95]     [,96]     [,97]       [,98]
[1,] -1.110991 0.9776896 1.728169 -0.3362031 0.1787591 0.2077729 -0.04072807
[2,] -1.110991 0.9776896 1.728169 -0.3362031 0.1787591 0.2077729 -0.04072807
         [,99]   [,100]
[1,] 0.6356207 1.271126
[2,] 0.6356207 1.271126
> 
> 
> Max(tmp2)
[1] 2.693734
> Min(tmp2)
[1] -2.718435
> mean(tmp2)
[1] 0.06331641
> Sum(tmp2)
[1] 6.331641
> Var(tmp2)
[1] 1.185648
> 
> rowMeans(tmp2)
  [1] -0.492468297  0.668242350  2.376120044  0.577765832 -0.910094190
  [6] -0.127862715 -0.358877251  0.298268152 -0.461604602 -1.305622230
 [11] -0.014850333  0.705981693 -0.768389670  0.710728895  0.493014456
 [16] -2.718434573 -0.493203850 -0.944352552 -0.827043238  1.424127918
 [21]  0.488482300  0.961920499 -0.005916629  0.977712185  0.947798423
 [26] -0.553417002 -1.103861681  1.126211961  1.495314002  1.215333038
 [31]  1.827762982  0.226520778 -1.924212118 -0.893918736  0.129676132
 [36] -0.105513843  0.594967207 -0.373440789 -0.775320314  1.063311190
 [41] -0.875860153 -1.794235153 -0.081316160  0.298332718 -0.508310599
 [46]  1.166650874  1.028778112 -0.561838117  1.182014179  0.318512004
 [51]  1.284973939  1.356948074 -1.613835403 -0.022479502  0.798237333
 [56] -0.312801770 -1.973802467  0.530721594  1.120625416  0.801044717
 [61] -1.032546002 -0.264008454  0.903626904 -0.507965885  2.054876347
 [66]  2.619557111  0.553266687  0.426604797  0.273080019 -2.219073496
 [71]  1.188780414 -1.618624114  0.256991574 -1.555829531 -0.644008609
 [76] -0.849480560  0.112550305 -0.091683065 -0.297097332  0.007324808
 [81]  0.398753372 -0.359845608 -1.708053133  2.563204615  0.351203901
 [86]  0.895449814  0.422090142 -0.438068038 -0.167394415  1.213315553
 [91] -1.311871207 -0.085959350 -0.145031365 -0.530199432 -1.091216429
 [96]  2.693734262  0.499669277 -0.834057171  0.934186814 -1.577827372
> rowSums(tmp2)
  [1] -0.492468297  0.668242350  2.376120044  0.577765832 -0.910094190
  [6] -0.127862715 -0.358877251  0.298268152 -0.461604602 -1.305622230
 [11] -0.014850333  0.705981693 -0.768389670  0.710728895  0.493014456
 [16] -2.718434573 -0.493203850 -0.944352552 -0.827043238  1.424127918
 [21]  0.488482300  0.961920499 -0.005916629  0.977712185  0.947798423
 [26] -0.553417002 -1.103861681  1.126211961  1.495314002  1.215333038
 [31]  1.827762982  0.226520778 -1.924212118 -0.893918736  0.129676132
 [36] -0.105513843  0.594967207 -0.373440789 -0.775320314  1.063311190
 [41] -0.875860153 -1.794235153 -0.081316160  0.298332718 -0.508310599
 [46]  1.166650874  1.028778112 -0.561838117  1.182014179  0.318512004
 [51]  1.284973939  1.356948074 -1.613835403 -0.022479502  0.798237333
 [56] -0.312801770 -1.973802467  0.530721594  1.120625416  0.801044717
 [61] -1.032546002 -0.264008454  0.903626904 -0.507965885  2.054876347
 [66]  2.619557111  0.553266687  0.426604797  0.273080019 -2.219073496
 [71]  1.188780414 -1.618624114  0.256991574 -1.555829531 -0.644008609
 [76] -0.849480560  0.112550305 -0.091683065 -0.297097332  0.007324808
 [81]  0.398753372 -0.359845608 -1.708053133  2.563204615  0.351203901
 [86]  0.895449814  0.422090142 -0.438068038 -0.167394415  1.213315553
 [91] -1.311871207 -0.085959350 -0.145031365 -0.530199432 -1.091216429
 [96]  2.693734262  0.499669277 -0.834057171  0.934186814 -1.577827372
> 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.492468297  0.668242350  2.376120044  0.577765832 -0.910094190
  [6] -0.127862715 -0.358877251  0.298268152 -0.461604602 -1.305622230
 [11] -0.014850333  0.705981693 -0.768389670  0.710728895  0.493014456
 [16] -2.718434573 -0.493203850 -0.944352552 -0.827043238  1.424127918
 [21]  0.488482300  0.961920499 -0.005916629  0.977712185  0.947798423
 [26] -0.553417002 -1.103861681  1.126211961  1.495314002  1.215333038
 [31]  1.827762982  0.226520778 -1.924212118 -0.893918736  0.129676132
 [36] -0.105513843  0.594967207 -0.373440789 -0.775320314  1.063311190
 [41] -0.875860153 -1.794235153 -0.081316160  0.298332718 -0.508310599
 [46]  1.166650874  1.028778112 -0.561838117  1.182014179  0.318512004
 [51]  1.284973939  1.356948074 -1.613835403 -0.022479502  0.798237333
 [56] -0.312801770 -1.973802467  0.530721594  1.120625416  0.801044717
 [61] -1.032546002 -0.264008454  0.903626904 -0.507965885  2.054876347
 [66]  2.619557111  0.553266687  0.426604797  0.273080019 -2.219073496
 [71]  1.188780414 -1.618624114  0.256991574 -1.555829531 -0.644008609
 [76] -0.849480560  0.112550305 -0.091683065 -0.297097332  0.007324808
 [81]  0.398753372 -0.359845608 -1.708053133  2.563204615  0.351203901
 [86]  0.895449814  0.422090142 -0.438068038 -0.167394415  1.213315553
 [91] -1.311871207 -0.085959350 -0.145031365 -0.530199432 -1.091216429
 [96]  2.693734262  0.499669277 -0.834057171  0.934186814 -1.577827372
> rowMin(tmp2)
  [1] -0.492468297  0.668242350  2.376120044  0.577765832 -0.910094190
  [6] -0.127862715 -0.358877251  0.298268152 -0.461604602 -1.305622230
 [11] -0.014850333  0.705981693 -0.768389670  0.710728895  0.493014456
 [16] -2.718434573 -0.493203850 -0.944352552 -0.827043238  1.424127918
 [21]  0.488482300  0.961920499 -0.005916629  0.977712185  0.947798423
 [26] -0.553417002 -1.103861681  1.126211961  1.495314002  1.215333038
 [31]  1.827762982  0.226520778 -1.924212118 -0.893918736  0.129676132
 [36] -0.105513843  0.594967207 -0.373440789 -0.775320314  1.063311190
 [41] -0.875860153 -1.794235153 -0.081316160  0.298332718 -0.508310599
 [46]  1.166650874  1.028778112 -0.561838117  1.182014179  0.318512004
 [51]  1.284973939  1.356948074 -1.613835403 -0.022479502  0.798237333
 [56] -0.312801770 -1.973802467  0.530721594  1.120625416  0.801044717
 [61] -1.032546002 -0.264008454  0.903626904 -0.507965885  2.054876347
 [66]  2.619557111  0.553266687  0.426604797  0.273080019 -2.219073496
 [71]  1.188780414 -1.618624114  0.256991574 -1.555829531 -0.644008609
 [76] -0.849480560  0.112550305 -0.091683065 -0.297097332  0.007324808
 [81]  0.398753372 -0.359845608 -1.708053133  2.563204615  0.351203901
 [86]  0.895449814  0.422090142 -0.438068038 -0.167394415  1.213315553
 [91] -1.311871207 -0.085959350 -0.145031365 -0.530199432 -1.091216429
 [96]  2.693734262  0.499669277 -0.834057171  0.934186814 -1.577827372
> 
> colMeans(tmp2)
[1] 0.06331641
> colSums(tmp2)
[1] 6.331641
> colVars(tmp2)
[1] 1.185648
> colSd(tmp2)
[1] 1.088874
> colMax(tmp2)
[1] 2.693734
> colMin(tmp2)
[1] -2.718435
> colMedians(tmp2)
[1] 0.0007040892
> colRanges(tmp2)
          [,1]
[1,] -2.718435
[2,]  2.693734
> 
> 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]  4.2611685  0.9000831  0.9404204 -1.3918639  0.2780806  2.5841477
 [7]  3.8109852 -5.8737308 -1.1874174 -1.4616377
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -0.8422230
[2,]  0.2140414
[3,]  0.5481248
[4,]  0.6554770
[5,]  1.1808213
> 
> rowApply(tmp,sum)
 [1]  4.8266644  1.0501542  2.5913363 -1.8417180 -4.2026093 -1.7515120
 [7]  0.9888708  0.3745492  1.7242480 -0.8997477
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    7    7    8    5    9    7    3    6    9     9
 [2,]   10    1    6    6    8   10    4    1    5     7
 [3,]    1   10    4   10    7    1    7    8    2     4
 [4,]    6    4    5    7    5    4    6   10    1     5
 [5,]    5    2    2    4    2    6    9    9    8     2
 [6,]    9    3   10    1   10    8    5    7    3     6
 [7,]    2    8    9    9    4    2    8    4   10    10
 [8,]    4    6    3    3    3    5    1    2    4     8
 [9,]    3    9    7    2    6    9    2    3    6     3
[10,]    8    5    1    8    1    3   10    5    7     1
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1]  0.5459795  0.6349372 -3.6579404 -0.8441014 -5.0193416 -0.9795203
 [7]  3.1728468  0.9525276  0.3056716  0.3854650 -0.7951322 -1.5512578
[13] -3.6890283 -1.6816764  4.1409483 -2.8295649  2.1815781 -3.5067736
[19]  0.2547858 -1.1493885
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -0.9503659
[2,] -0.2045128
[3,]  0.2091895
[4,]  0.7457448
[5,]  0.7459239
> 
> rowApply(tmp,sum)
[1] -1.835322 -2.132845 -4.360969  1.745081 -6.544930
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]    4   15   11   17   19
[2,]   17    8   19   13    4
[3,]    8    3    9    3    7
[4,]   14   11    7   14    3
[5,]    1   18   15    2    1
> 
> 
> as.matrix(tmp)
           [,1]       [,2]       [,3]        [,4]       [,5]       [,6]
[1,] -0.9503659  0.8948305 -0.2812252  0.46198334 -3.2115260  0.4864357
[2,]  0.2091895 -0.6241609 -1.1538560  0.06264147  1.1890989 -0.7093291
[3,] -0.2045128  1.2087340 -0.3479322 -0.43502651  0.2781605 -0.1474239
[4,]  0.7459239  0.3755465 -1.1276376  0.45176208 -1.4335424 -0.8362660
[5,]  0.7457448 -1.2200129 -0.7472893 -1.38546179 -1.8415326  0.2270631
           [,7]        [,8]       [,9]       [,10]      [,11]       [,12]
[1,]  0.1944063  1.62231676  0.3144230  1.34514299 -0.1750943 -0.46968665
[2,] -1.5223012 -0.48080472  0.1924942  0.07008223  0.7783557 -0.63385364
[3,]  1.9624529 -0.22166947 -1.8219173  0.07484603 -0.3646513 -0.07963241
[4,]  2.0158682  0.10058584  1.4555527  0.54485377 -0.8641669  0.31649311
[5,]  0.5224207 -0.06790076  0.1651191 -1.64946005 -0.1695754 -0.68457822
           [,13]       [,14]      [,15]       [,16]        [,17]      [,18]
[1,] -0.94540526  0.17860590  0.8624131 -1.16678381  0.001831014 -1.4586605
[2,] -1.32584729 -0.75167262  1.2145431  0.13768746  0.612516350 -0.7174474
[3,] -1.66678887  0.59641756  0.9896072 -0.93192407  1.011383984 -1.8161694
[4,]  0.06980983 -1.79270037 -0.1716948 -0.05384654  0.733305782  1.2135677
[5,]  0.17920330  0.08767314  1.2460797 -0.81469796 -0.177459049 -0.7280640
          [,19]      [,20]
[1,]  1.2833644 -0.8223276
[2,]  1.5944118 -0.2745931
[3,] -1.5794298 -0.8654933
[4,] -0.1977442  0.1994109
[5,] -0.8458163  0.6136146
> 
> 
> 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.22-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.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  655  bytes.
Disk usage :  200  bytes.
> subBufferedMatrix(tmp,,5:8)
BufferedMatrix object
Matrix size:  5 4 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.22-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.22-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.49642 -0.6278628 -1.207437 -0.02605397 0.7526464 -1.429819 0.0729492
          col8       col9    col10     col11      col12  col13     col14
row1 -1.459768 0.03571971 1.041663 0.7315044 -0.1902335 1.5075 -1.796161
         col15      col16      col17     col18      col19     col20
row1 -0.794977 -0.4121361 -0.4092943 0.3735239 0.02255935 0.1678212
> tmp[,"col10"]
          col10
row1  1.0416633
row2  1.5251871
row3  2.1657320
row4 -0.2610055
row5  0.9300610
> tmp[c("row1","row5"),]
          col1       col2        col3        col4       col5      col6
row1  1.496420 -0.6278628 -1.20743697 -0.02605397  0.7526464 -1.429819
row5 -2.816275  0.4592583 -0.06965204  0.66057885 -1.2298171  0.446489
           col7       col8        col9    col10       col11      col12
row1  0.0729492 -1.4597684  0.03571971 1.041663  0.73150442 -0.1902335
row5 -0.8302109  0.7254292 -0.96477113 0.930061 -0.09878689 -1.6751808
          col13      col14     col15       col16       col17     col18
row1  1.5075003 -1.7961609 -0.794977 -0.41213609 -0.40929434 0.3735239
row5 -0.3007963 -0.1315662  0.579779  0.06158639 -0.09307035 0.6787542
           col19      col20
row1  0.02255935  0.1678212
row5 -0.57096246 -0.7173856
> tmp[,c("col6","col20")]
           col6      col20
row1 -1.4298189  0.1678212
row2 -1.4064819 -0.2417847
row3 -0.2080847 -1.2973385
row4  2.0001210  0.2940056
row5  0.4464890 -0.7173856
> tmp[c("row1","row5"),c("col6","col20")]
          col6      col20
row1 -1.429819  0.1678212
row5  0.446489 -0.7173856
> 
> 
> 
> 
> 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.21315 50.02978 50.56985 48.99229 50.80627 105.4079 50.14402 50.53583
         col9    col10    col11    col12    col13    col14    col15   col16
row1 50.10384 51.15541 47.96356 49.30781 49.65687 51.41775 49.58154 49.6671
        col17    col18    col19    col20
row1 49.55662 51.06227 48.12124 105.9291
> tmp[,"col10"]
        col10
row1 51.15541
row2 29.64185
row3 29.12134
row4 30.50645
row5 49.47186
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 49.21315 50.02978 50.56985 48.99229 50.80627 105.4079 50.14402 50.53583
row5 50.57988 50.37491 48.91269 48.40758 49.05818 105.9970 51.09906 51.31303
         col9    col10    col11    col12    col13    col14    col15    col16
row1 50.10384 51.15541 47.96356 49.30781 49.65687 51.41775 49.58154 49.66710
row5 51.69323 49.47186 49.65225 49.18145 50.00342 49.97654 50.86839 52.00881
        col17    col18    col19    col20
row1 49.55662 51.06227 48.12124 105.9291
row5 50.10866 50.50873 49.74908 104.6006
> tmp[,c("col6","col20")]
          col6     col20
row1 105.40794 105.92910
row2  72.24226  76.79238
row3  76.15866  75.67902
row4  74.36788  76.06171
row5 105.99700 104.60060
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 105.4079 105.9291
row5 105.9970 104.6006
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 105.4079 105.9291
row5 105.9970 104.6006
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
          col13
[1,]  0.8517563
[2,] -0.1617516
[3,] -1.1139433
[4,] -0.8132366
[5,] -1.2731828
> tmp[,c("col17","col7")]
          col17       col7
[1,] -0.3534620 -0.6481357
[2,]  0.7163648  2.3154803
[3,]  1.8234039 -0.5530963
[4,] -0.6141751 -0.6646904
[5,] -1.1816891 -0.1492571
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
           col6       col20
[1,]  0.8927807 -1.74479342
[2,] -1.6846524  0.54821753
[3,]  0.5024614  0.69231108
[4,] -1.5614437  0.01864581
[5,]  0.9164098  0.15721058
> subBufferedMatrix(tmp,1,c("col6"))[,1]
          col1
[1,] 0.8927807
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
           col6
[1,]  0.8927807
[2,] -1.6846524
> 
> 
> 
> 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.3173606 -0.2229325  1.0133217 -0.05302029 0.8734208 0.3196395
row1 0.7830911  0.6111892 -0.4530588 -0.28304359 1.1925192 0.3619477
            [,7]      [,8]       [,9]      [,10]       [,11]     [,12]
row3 -0.04334423  1.851480 -0.4197083  1.0261668 -0.03417576 0.1800297
row1  1.61163851 -1.929345 -2.4535095 -0.2955091  0.57591497 0.5919238
         [,13]      [,14]      [,15]     [,16]     [,17]      [,18]    [,19]
row3 -1.608878 -0.3258429 -0.1213267 0.1912843 -2.924415 -0.3210069 1.310946
row1  1.355490 -2.1030787 -0.3996619 0.2174695  1.827045 -0.9386575 1.468075
         [,20]
row3 -0.742535
row1 -2.237862
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
         [,1]      [,2]      [,3]      [,4]     [,5]      [,6]      [,7]
row2 1.963609 0.2740768 0.5885796 -1.317353 1.604115 -1.285689 -2.040565
           [,8]      [,9]     [,10]
row2 -0.3787843 0.2682513 0.5642938
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
         [,1]       [,2]      [,3]      [,4]       [,5]        [,6]     [,7]
row5 -1.59916 -0.2664227 0.3045543 -1.634612 -0.4221616 0.002739641 1.925371
           [,8]       [,9]    [,10]     [,11]      [,12]      [,13]     [,14]
row5 -0.7203763 -0.7422528 1.797233 -1.560534 -0.1737344 -0.6245893 -1.164986
          [,15]   [,16]    [,17]     [,18]     [,19]     [,20]
row5 -0.3702932 1.85724 1.318663 0.8842911 0.8407437 -1.263541
> 
> 
> 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: 0x600002ce0000>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM173bd185d8633"
 [2] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM173bd24158ac4"
 [3] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM173bd2495c5e" 
 [4] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM173bd1e4f207e"
 [5] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM173bd5cde3fbd"
 [6] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM173bd32ac0ed" 
 [7] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM173bd6be0093a"
 [8] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM173bd417df62a"
 [9] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM173bd34ac60fd"
[10] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM173bd21139d0f"
[11] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM173bdeac54c0" 
[12] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM173bd53f010c6"
[13] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM173bd35dd6237"
[14] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM173bd595b2481"
[15] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM173bd6eb9befb"
> 
> 
> ### 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: 0x600002ce0b40>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x600002ce0b40>
Warning message:
In dir.create(new.directory) :
  '/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x600002ce0b40>
> rowMedians(tmp)
  [1] -5.607050e-01  3.957987e-02  1.625090e-01  1.667971e-01 -3.647595e-02
  [6] -1.405365e-01  3.281397e-01 -1.374469e-01 -4.005082e-01 -9.290919e-02
 [11] -5.513732e-01  5.921941e-01 -2.822174e-02  4.120682e-01  8.836362e-02
 [16] -8.394654e-02 -1.724807e-01  8.339579e-01  8.672701e-02  6.702214e-01
 [21]  4.442430e-01  3.535801e-01 -4.024363e-02 -1.532451e-01 -5.806619e-01
 [26]  1.924432e-01  5.108871e-01 -3.123500e-01  1.680777e-01  4.669974e-01
 [31] -7.578358e-01 -2.509910e-01 -3.812873e-02  8.526291e-02 -6.661624e-01
 [36]  1.066956e-01  3.581409e-01  7.098078e-01 -6.747584e-02  2.143359e-01
 [41] -2.498578e-02  7.237432e-01 -4.649979e-01  2.888842e-01  2.244044e-02
 [46] -2.793794e-01 -2.109156e-01  3.571549e-01  4.819147e-01  1.233394e-01
 [51] -3.065744e-01  4.203868e-01  4.766400e-01  2.185889e-01 -2.779855e-02
 [56] -3.504310e-02 -5.684507e-02  1.751556e-01 -2.447849e-01 -4.684017e-01
 [61]  3.388412e-01  2.151742e-01 -3.476588e-02  2.378080e-01  2.854248e-01
 [66]  7.420559e-01  6.743331e-01  5.749929e-02 -2.768570e-01  3.132278e-01
 [71] -5.252488e-01 -6.755135e-02 -1.542024e-01  4.974862e-02 -4.898287e-03
 [76] -5.280674e-02  1.473631e-01 -1.109017e-01  4.574409e-02 -2.664260e-01
 [81] -1.243631e-01  1.347219e-01 -2.055137e-01 -1.494845e-01 -8.470237e-02
 [86]  4.291336e-01 -5.389201e-01  4.633642e-01 -1.914321e-01  1.636110e-01
 [91]  2.174305e-02 -2.709405e-02  2.756864e-02  2.914451e-01 -8.505031e-01
 [96] -8.467177e-01  3.089131e-01 -2.988077e-01  3.282366e-01 -4.241899e-01
[101] -3.023412e-02  7.325112e-02 -1.984636e-01  2.296906e-01 -1.651937e-01
[106]  2.432836e-01  9.580509e-02  5.256772e-02 -1.567879e-01  3.530709e-02
[111]  1.628324e-01 -8.152048e-01  4.556097e-01 -2.023858e-01  4.970862e-02
[116] -5.173691e-02 -3.351715e-01 -1.599780e-01  2.246630e-01 -6.378779e-02
[121] -3.625948e-01  4.858027e-01 -7.742879e-02  3.622224e-01  1.374148e-01
[126] -2.175999e-01  1.576349e-01  4.409676e-01  1.274362e-01  1.238477e-01
[131] -4.235071e-02  3.086284e-02 -4.441120e-01 -3.888606e-01  1.071376e-01
[136]  4.503818e-01 -7.293663e-02 -1.932746e-02  1.012634e+00 -9.423153e-03
[141] -1.837961e-01  1.491954e-01  5.345761e-01 -2.618688e-01  1.833131e-01
[146]  2.798453e-01  9.354912e-02 -1.661156e-01  6.361953e-02 -1.722427e-01
[151]  1.782063e-01  4.740619e-01  9.274464e-01  1.742842e-01  1.039985e-01
[156] -8.702848e-02 -1.591410e-01  1.577902e-01  4.130675e-02 -2.356073e-01
[161]  6.321174e-02 -5.648698e-01 -9.811617e-02 -2.101391e-01  2.946261e-01
[166]  2.538414e-01 -1.781030e-01 -1.525385e-01  1.098274e-01  9.979870e-02
[171]  2.890267e-01 -2.136652e-01 -3.014337e-01  1.107364e-01  3.186437e-01
[176] -9.486049e-02  7.927186e-01  3.726337e-01 -3.853721e-01 -2.470119e-01
[181] -3.932080e-01 -2.215296e-02 -2.397867e-01  3.267539e-01 -5.302890e-01
[186]  9.420428e-03 -4.068743e-02 -3.494106e-01 -4.498229e-01  4.501810e-01
[191] -1.101949e-01 -3.735441e-01 -2.695736e-01  3.860180e-01  1.075145e-01
[196]  8.409511e-02 -6.156208e-02  4.356538e-01  2.935385e-01 -3.741169e-02
[201]  9.297998e-02 -4.655887e-01 -2.998124e-02  3.443586e-01  7.385224e-02
[206]  5.437037e-01  4.477400e-01  4.714744e-02  9.147015e-05  4.851552e-01
[211] -4.381613e-01  1.406357e-01  3.312745e-01  2.317552e-02 -8.517188e-01
[216] -2.925568e-01  5.337950e-01 -5.361299e-01 -2.176368e-02 -1.489110e-01
[221] -3.370485e-01 -6.658876e-01 -2.295457e-02 -4.591299e-01  1.879831e-01
[226] -2.293352e-01  3.996986e-01  5.758973e-01  1.401467e-01  3.740628e-01
> 
> proc.time()
   user  system elapsed 
  0.603   3.196   3.868 

BufferedMatrix.Rcheck/tests/rawCalltesting.Rout


R version 4.5.1 Patched (2025-09-10 r88807) -- "Great Square Root"
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: 0x6000001c0000>
> .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: 0x6000001c0000>
> .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: 0x6000001c0000>
> .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: 0x6000001c0000>
> 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: 0x6000001d81e0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000001d81e0>
> .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: 0x6000001d81e0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000001d81e0>
> .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: 0x6000001d81e0>
> 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: 0x6000001d83c0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000001d83c0>
> .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: 0x6000001d83c0>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x6000001d83c0>
> .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: 0x6000001d83c0>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x6000001d83c0>
> .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: 0x6000001d83c0>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x6000001d83c0>
> .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: 0x6000001d83c0>
> 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: 0x6000001d85a0>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x6000001d85a0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000001d85a0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000001d85a0>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile1755a560ce622" "BufferedMatrixFile1755a5931d2e5"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile1755a560ce622" "BufferedMatrixFile1755a5931d2e5"
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000001d8840>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000001d8840>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x6000001d8840>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x6000001d8840>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x6000001d8840>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x6000001d8840>
> .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: 0x6000001d8a20>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000001d8a20>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x6000001d8a20>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x6000001d8a20>
> 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: 0x6000001d8c00>
> .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: 0x6000001d8c00>
> rm(P)
> 
> proc.time()
   user  system elapsed 
  0.106   0.031   0.134 

BufferedMatrix.Rcheck/tests/Rcodetesting.Rout


R version 4.5.1 Patched (2025-09-10 r88807) -- "Great Square Root"
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.108   0.020   0.127 

Example timings