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

This page was generated on 2025-10-24 12:06 -0400 (Fri, 24 Oct 2025).

HostnameOSArch (*)R versionInstalled pkgs
nebbiolo2Linux (Ubuntu 24.04.3 LTS)x86_644.5.1 Patched (2025-08-23 r88802) -- "Great Square Root" 4898
lconwaymacOS 12.7.6 Montereyx86_644.5.1 Patched (2025-09-10 r88807) -- "Great Square Root" 4688
kjohnson3macOS 13.7.7 Venturaarm644.5.1 Patched (2025-09-10 r88807) -- "Great Square Root" 4634
taishanLinux (openEuler 24.03 LTS)aarch644.5.0 (2025-04-11) -- "How About a Twenty-Six" 4658
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 257/2359HostnameOS / ArchINSTALLBUILDCHECKBUILD BIN
BufferedMatrix 1.73.0  (landing page)
Ben Bolstad
Snapshot Date: 2025-10-23 14:17 -0400 (Thu, 23 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.6 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-23 18:51:27 -0400 (Thu, 23 Oct 2025)
EndedAt: 2025-10-23 18:51:44 -0400 (Thu, 23 Oct 2025)
EllapsedTime: 16.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.105   0.031   0.131 

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    1056615 56.5         NA   634357 33.9
Vcells 891019  6.8    8388608 64.0     196608  2109489 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] "Thu Oct 23 18:51:37 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] "Thu Oct 23 18:51:37 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: 0x60000158c300>
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   which.col <- sample(1:20,1)
+   if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,5,replace=TRUE)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> date()
[1] "Thu Oct 23 18:51:38 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] "Thu Oct 23 18:51:38 2025"
> 
> ColMode(tmp2)
<pointer: 0x60000158c300>
> 
> 
> 
> ### Now testing assignments
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+ 
+   new.data <- rnorm(20)
+   tmp2[which.row,] <- new.data
+   test.matrix[which.row,] <- new.data
+   if (rep > 1){
+     if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+   
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   new.data <- rnorm(10)
+   tmp2[,which.col] <- new.data
+   test.matrix[,which.col]<- new.data
+ 
+   if (rep > 1){
+     if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.col <- which.col
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,5,replace=TRUE)
+   new.data <- matrix(rnorm(50),5,10)
+   tmp2[,which.col] <- new.data
+   test.matrix[,which.col]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.col <- which.col
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   new.data <- matrix(rnorm(50),5,10)
+   tmp2[which.row,] <- new.data
+   test.matrix[which.row,]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col  <- sample(1:20,5,replace=TRUE)
+   new.data <- matrix(rnorm(25),5,5)
+   tmp2[which.row,which.col] <- new.data
+   test.matrix[which.row,which.col]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[prev.row,prev.col] == test.matrix[prev.row,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+   prev.col <- which.col
+ }
> 
> 
> 
> 
> ###
> ###
> ### testing some more functions
> ###
> 
> 
> 
> ## duplication function
> tmp5 <- duplicate(tmp2)
> 
> # making sure really did copy everything.
> tmp5[1,1] <- tmp5[1,1] +100.00
> 
> if (tmp5[1,1] == tmp2[1,1]){
+   stop("Problem with duplication")
+ }
> 
> 
> 
> 
> ### testing elementwise applying of functions
> 
> tmp5[1:4,1:4]
            [,1]         [,2]       [,3]        [,4]
[1,] 100.4331675 -0.859936996  0.1533044 -0.35588134
[2,]   0.4426491  0.001012366 -0.8749394 -1.32428899
[3,]   0.1350844  0.503463435  0.8478170  0.03475678
[4,]  -2.0179713 -0.437744277  1.2458291  0.05436770
> 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 :  1.9  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
            [,1]        [,2]      [,3]       [,4]
[1,] 100.4331675 0.859936996 0.1533044 0.35588134
[2,]   0.4426491 0.001012366 0.8749394 1.32428899
[3,]   0.1350844 0.503463435 0.8478170 0.03475678
[4,]   2.0179713 0.437744277 1.2458291 0.05436770
> 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 :  1.9  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
           [,1]      [,2]      [,3]      [,4]
[1,] 10.0216350 0.9273279 0.3915411 0.5965579
[2,]  0.6653188 0.0318177 0.9353819 1.1507776
[3,]  0.3675383 0.7095516 0.9207698 0.1864317
[4,]  1.4205532 0.6616225 1.1161671 0.2331688
> 
> 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 :  1.9  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
          [,1]     [,2]     [,3]     [,4]
[1,] 225.64952 35.13322 29.06872 31.32146
[2,]  32.09584 25.31919 35.22876 37.83206
[3,]  28.81047 32.59898 35.05551 26.89907
[4,]  41.22350 32.05397 37.40750 27.38606
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x600001594000>
> exp(tmp5)
<pointer: 0x600001594000>
> log(tmp5,2)
<pointer: 0x600001594000>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 469.6599
> Min(tmp5)
[1] 52.69858
> mean(tmp5)
[1] 72.16949
> Sum(tmp5)
[1] 14433.9
> Var(tmp5)
[1] 875.7852
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 90.85264 69.37650 70.80842 70.37398 66.95128 69.59096 71.00474 68.28533
 [9] 74.98388 69.46715
> rowSums(tmp5)
 [1] 1817.053 1387.530 1416.168 1407.480 1339.026 1391.819 1420.095 1365.707
 [9] 1499.678 1389.343
> rowVars(tmp5)
 [1] 8062.74313   96.85756   78.11996   76.99130   64.30816   60.24944
 [7]   88.44269   46.06618   65.38607   83.55149
> rowSd(tmp5)
 [1] 89.792779  9.841624  8.838550  8.774469  8.019237  7.762052  9.404397
 [8]  6.787207  8.086165  9.140651
> rowMax(tmp5)
 [1] 469.65991  84.48228  86.34672  85.80132  85.46583  86.40150  87.42610
 [8]  79.79553  90.68409  83.72501
> rowMin(tmp5)
 [1] 56.67997 52.69858 55.98690 54.80295 55.22327 58.24800 55.29711 54.69704
 [9] 59.89791 53.85484
> 
> colMeans(tmp5)
 [1] 112.06088  71.88533  67.87693  64.71458  66.55168  69.74169  73.74815
 [8]  72.08220  75.89727  66.21800  70.43908  69.88815  67.20144  68.11174
[15]  68.02372  73.53212  72.44690  71.64281  72.91523  68.41186
> colSums(tmp5)
 [1] 1120.6088  718.8533  678.7693  647.1458  665.5168  697.4169  737.4815
 [8]  720.8220  758.9727  662.1800  704.3908  698.8815  672.0144  681.1174
[15]  680.2372  735.3212  724.4690  716.4281  729.1523  684.1186
> colVars(tmp5)
 [1] 15853.55222   115.37931    58.11595    62.82298    60.89169    81.00140
 [7]    82.38200    39.65357    49.45697    45.58299    85.75373    96.88855
[13]    54.91958   127.53070    95.49120    87.98596    73.49301    87.00089
[19]    98.00338    66.34880
> colSd(tmp5)
 [1] 125.910890  10.741476   7.623382   7.926095   7.803313   9.000078
 [7]   9.076453   6.297108   7.032565   6.751518   9.260331   9.843198
[13]   7.410775  11.292949   9.771960   9.380083   8.572806   9.327427
[19]   9.899666   8.145478
> colMax(tmp5)
 [1] 469.65991  86.09142  77.85881  78.74249  83.08472  88.20661  86.51160
 [8]  79.79553  86.34672  76.45585  84.48228  86.40150  77.56128  83.94014
[15]  80.05161  90.68409  83.72501  87.42610  85.19088  85.39259
> colMin(tmp5)
 [1] 59.96521 52.69858 57.05606 55.98690 58.87973 60.12073 61.88024 56.99954
 [9] 65.05507 58.24800 54.80295 53.85484 55.22327 54.69704 55.32171 56.65567
[17] 58.11060 61.19287 56.33710 60.09285
> 
> 
> ### setting a random element to NA and then testing with na.rm=TRUE or na.rm=FALSE (The default)
> 
> 
> which.row <- sample(1:10,1,replace=TRUE)
> which.col  <- sample(1:20,1,replace=TRUE)
> 
> tmp5[which.row,which.col] <- NA
> 
> Max(tmp5)
[1] NA
> Min(tmp5)
[1] NA
> mean(tmp5)
[1] NA
> Sum(tmp5)
[1] NA
> Var(tmp5)
[1] NA
> 
> rowMeans(tmp5)
 [1] 90.85264 69.37650 70.80842 70.37398 66.95128 69.59096       NA 68.28533
 [9] 74.98388 69.46715
> rowSums(tmp5)
 [1] 1817.053 1387.530 1416.168 1407.480 1339.026 1391.819       NA 1365.707
 [9] 1499.678 1389.343
> rowVars(tmp5)
 [1] 8062.74313   96.85756   78.11996   76.99130   64.30816   60.24944
 [7]   93.11499   46.06618   65.38607   83.55149
> rowSd(tmp5)
 [1] 89.792779  9.841624  8.838550  8.774469  8.019237  7.762052  9.649611
 [8]  6.787207  8.086165  9.140651
> rowMax(tmp5)
 [1] 469.65991  84.48228  86.34672  85.80132  85.46583  86.40150        NA
 [8]  79.79553  90.68409  83.72501
> rowMin(tmp5)
 [1] 56.67997 52.69858 55.98690 54.80295 55.22327 58.24800       NA 54.69704
 [9] 59.89791 53.85484
> 
> colMeans(tmp5)
 [1] 112.06088  71.88533  67.87693  64.71458  66.55168  69.74169  73.74815
 [8]  72.08220  75.89727  66.21800  70.43908  69.88815  67.20144  68.11174
[15]        NA  73.53212  72.44690  71.64281  72.91523  68.41186
> colSums(tmp5)
 [1] 1120.6088  718.8533  678.7693  647.1458  665.5168  697.4169  737.4815
 [8]  720.8220  758.9727  662.1800  704.3908  698.8815  672.0144  681.1174
[15]        NA  735.3212  724.4690  716.4281  729.1523  684.1186
> colVars(tmp5)
 [1] 15853.55222   115.37931    58.11595    62.82298    60.89169    81.00140
 [7]    82.38200    39.65357    49.45697    45.58299    85.75373    96.88855
[13]    54.91958   127.53070          NA    87.98596    73.49301    87.00089
[19]    98.00338    66.34880
> colSd(tmp5)
 [1] 125.910890  10.741476   7.623382   7.926095   7.803313   9.000078
 [7]   9.076453   6.297108   7.032565   6.751518   9.260331   9.843198
[13]   7.410775  11.292949         NA   9.380083   8.572806   9.327427
[19]   9.899666   8.145478
> colMax(tmp5)
 [1] 469.65991  86.09142  77.85881  78.74249  83.08472  88.20661  86.51160
 [8]  79.79553  86.34672  76.45585  84.48228  86.40150  77.56128  83.94014
[15]        NA  90.68409  83.72501  87.42610  85.19088  85.39259
> colMin(tmp5)
 [1] 59.96521 52.69858 57.05606 55.98690 58.87973 60.12073 61.88024 56.99954
 [9] 65.05507 58.24800 54.80295 53.85484 55.22327 54.69704       NA 56.65567
[17] 58.11060 61.19287 56.33710 60.09285
> 
> Max(tmp5,na.rm=TRUE)
[1] 469.6599
> Min(tmp5,na.rm=TRUE)
[1] 52.69858
> mean(tmp5,na.rm=TRUE)
[1] 72.18555
> Sum(tmp5,na.rm=TRUE)
[1] 14364.92
> Var(tmp5,na.rm=TRUE)
[1] 880.1565
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 90.85264 69.37650 70.80842 70.37398 66.95128 69.59096 71.11163 68.28533
 [9] 74.98388 69.46715
> rowSums(tmp5,na.rm=TRUE)
 [1] 1817.053 1387.530 1416.168 1407.480 1339.026 1391.819 1351.121 1365.707
 [9] 1499.678 1389.343
> rowVars(tmp5,na.rm=TRUE)
 [1] 8062.74313   96.85756   78.11996   76.99130   64.30816   60.24944
 [7]   93.11499   46.06618   65.38607   83.55149
> rowSd(tmp5,na.rm=TRUE)
 [1] 89.792779  9.841624  8.838550  8.774469  8.019237  7.762052  9.649611
 [8]  6.787207  8.086165  9.140651
> rowMax(tmp5,na.rm=TRUE)
 [1] 469.65991  84.48228  86.34672  85.80132  85.46583  86.40150  87.42610
 [8]  79.79553  90.68409  83.72501
> rowMin(tmp5,na.rm=TRUE)
 [1] 56.67997 52.69858 55.98690 54.80295 55.22327 58.24800 55.29711 54.69704
 [9] 59.89791 53.85484
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 112.06088  71.88533  67.87693  64.71458  66.55168  69.74169  73.74815
 [8]  72.08220  75.89727  66.21800  70.43908  69.88815  67.20144  68.11174
[15]  67.91815  73.53212  72.44690  71.64281  72.91523  68.41186
> colSums(tmp5,na.rm=TRUE)
 [1] 1120.6088  718.8533  678.7693  647.1458  665.5168  697.4169  737.4815
 [8]  720.8220  758.9727  662.1800  704.3908  698.8815  672.0144  681.1174
[15]  611.2633  735.3212  724.4690  716.4281  729.1523  684.1186
> colVars(tmp5,na.rm=TRUE)
 [1] 15853.55222   115.37931    58.11595    62.82298    60.89169    81.00140
 [7]    82.38200    39.65357    49.45697    45.58299    85.75373    96.88855
[13]    54.91958   127.53070   107.30220    87.98596    73.49301    87.00089
[19]    98.00338    66.34880
> colSd(tmp5,na.rm=TRUE)
 [1] 125.910890  10.741476   7.623382   7.926095   7.803313   9.000078
 [7]   9.076453   6.297108   7.032565   6.751518   9.260331   9.843198
[13]   7.410775  11.292949  10.358678   9.380083   8.572806   9.327427
[19]   9.899666   8.145478
> colMax(tmp5,na.rm=TRUE)
 [1] 469.65991  86.09142  77.85881  78.74249  83.08472  88.20661  86.51160
 [8]  79.79553  86.34672  76.45585  84.48228  86.40150  77.56128  83.94014
[15]  80.05161  90.68409  83.72501  87.42610  85.19088  85.39259
> colMin(tmp5,na.rm=TRUE)
 [1] 59.96521 52.69858 57.05606 55.98690 58.87973 60.12073 61.88024 56.99954
 [9] 65.05507 58.24800 54.80295 53.85484 55.22327 54.69704 55.32171 56.65567
[17] 58.11060 61.19287 56.33710 60.09285
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1] 90.85264 69.37650 70.80842 70.37398 66.95128 69.59096      NaN 68.28533
 [9] 74.98388 69.46715
> rowSums(tmp5,na.rm=TRUE)
 [1] 1817.053 1387.530 1416.168 1407.480 1339.026 1391.819    0.000 1365.707
 [9] 1499.678 1389.343
> rowVars(tmp5,na.rm=TRUE)
 [1] 8062.74313   96.85756   78.11996   76.99130   64.30816   60.24944
 [7]         NA   46.06618   65.38607   83.55149
> rowSd(tmp5,na.rm=TRUE)
 [1] 89.792779  9.841624  8.838550  8.774469  8.019237  7.762052        NA
 [8]  6.787207  8.086165  9.140651
> rowMax(tmp5,na.rm=TRUE)
 [1] 469.65991  84.48228  86.34672  85.80132  85.46583  86.40150        NA
 [8]  79.79553  90.68409  83.72501
> rowMin(tmp5,na.rm=TRUE)
 [1] 56.67997 52.69858 55.98690 54.80295 55.22327 58.24800       NA 54.69704
 [9] 59.89791 53.85484
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1] 115.19145  70.30688  68.70746  63.82566  64.71467  69.39266  74.95316
 [8]  72.24538  75.50026  65.83185  71.10722  70.13892  66.92320  69.53559
[15]       NaN  73.11847  73.02731  69.88911  74.67427  68.97641
> colSums(tmp5,na.rm=TRUE)
 [1] 1036.7231  632.7619  618.3672  574.4309  582.4321  624.5339  674.5784
 [8]  650.2084  679.5023  592.4867  639.9650  631.2503  602.3088  625.8203
[15]    0.0000  658.0662  657.2458  629.0020  672.0684  620.7877
> colVars(tmp5,na.rm=TRUE)
 [1] 17724.99113   101.77217    57.62028    61.78626    30.53906    89.75605
 [7]    76.34411    44.31070    53.86589    49.60339    91.45077   108.29215
[13]    60.91360   120.66442          NA    97.05922    78.88972    63.27707
[19]    75.44387    71.05689
> colSd(tmp5,na.rm=TRUE)
 [1] 133.135236  10.088219   7.590802   7.860424   5.526216   9.473967
 [7]   8.737512   6.656628   7.339338   7.042968   9.562990  10.406351
[13]   7.804717  10.984736         NA   9.851864   8.881988   7.954688
[19]   8.685843   8.429525
> colMax(tmp5,na.rm=TRUE)
 [1] 469.65991  85.46583  77.85881  78.74249  74.54885  88.20661  86.51160
 [8]  79.79553  86.34672  76.45585  84.48228  86.40150  77.56128  83.94014
[15]      -Inf  90.68409  83.72501  84.23339  85.19088  85.39259
> colMin(tmp5,na.rm=TRUE)
 [1] 59.96521 52.69858 57.05606 55.98690 58.87973 60.12073 61.88024 56.99954
 [9] 65.05507 58.24800 54.80295 53.85484 55.22327 54.69704      Inf 56.65567
[17] 58.11060 61.19287 56.33710 60.09285
> 
> 
> 
> 
> 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] 249.27663 285.01806 283.12333 177.05303 285.08128 215.16525 251.13747
 [8] 236.68153 127.83303  78.49877
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 249.27663 285.01806 283.12333 177.05303 285.08128 215.16525 251.13747
 [8] 236.68153 127.83303  78.49877
> 
> 
> 
> 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]  8.526513e-14 -1.421085e-14 -1.136868e-13  2.842171e-14 -2.273737e-13
 [6] -8.526513e-14  8.526513e-14  5.684342e-14  0.000000e+00  5.684342e-14
[11]  5.684342e-14  5.684342e-14  2.842171e-14 -2.842171e-14 -1.421085e-13
[16]  2.842171e-14  0.000000e+00 -9.947598e-14  1.136868e-13  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)
+ }
9   17 
9   18 
7   1 
9   20 
4   3 
6   1 
10   6 
8   18 
10   17 
5   11 
8   12 
4   17 
1   18 
4   8 
9   7 
1   1 
8   19 
8   13 
2   4 
9   6 
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] 3.304967
> Min(tmp)
[1] -2.468855
> mean(tmp)
[1] -0.02506847
> Sum(tmp)
[1] -2.506847
> Var(tmp)
[1] 1.15116
> 
> rowMeans(tmp)
[1] -0.02506847
> rowSums(tmp)
[1] -2.506847
> rowVars(tmp)
[1] 1.15116
> rowSd(tmp)
[1] 1.072921
> rowMax(tmp)
[1] 3.304967
> rowMin(tmp)
[1] -2.468855
> 
> colMeans(tmp)
  [1] -0.744403649 -0.933580925 -0.589925460 -0.574467203 -1.075860977
  [6] -1.220145615  0.660435153 -0.744757181  0.137138128 -0.675909887
 [11]  0.097653271 -1.287979171 -0.765995891  0.516109559  1.484669237
 [16] -0.393475216  0.383462507  0.293164742  1.429658252  2.540223836
 [21] -0.313305290 -0.469828846  0.219302992  0.466801024  0.125513438
 [26] -0.839982743  0.214614851  0.007518155  0.806953023  0.587132039
 [31] -1.676481837  0.999901847  1.305956609  0.131430106 -0.251904819
 [36]  1.822088451  1.668619230  0.849101353  0.323234551 -1.077241876
 [41] -1.782696246 -0.001262014  2.634765073  0.825036666  0.291661970
 [46]  0.548204308 -0.139480178  0.320063466 -0.486473105  0.191993117
 [51]  0.691638341 -0.662108615  0.330387900 -0.142410346  0.005868548
 [56] -1.081719102 -1.245373266 -0.566688046  2.128663723 -1.314193365
 [61]  0.120110543  1.111750667  0.834292854  1.939172780 -1.591232792
 [66]  1.990882486  0.176456203 -0.286537559  0.208104236  0.534167829
 [71]  0.145346556 -0.335194447  1.115444404 -0.978768086 -2.042583018
 [76] -0.191708089 -1.333211777  0.146777437 -1.209961859 -0.847660747
 [81] -2.468855346  0.359387166  3.304967337 -0.670903195 -0.918640559
 [86] -0.392020248 -0.548465657 -0.100637510  1.218538248  0.688866969
 [91]  1.579129124 -0.108180577 -0.958228275 -1.376456532 -1.704818068
 [96] -0.742028196 -1.454774477 -0.490975555 -1.015602075 -0.194111548
> colSums(tmp)
  [1] -0.744403649 -0.933580925 -0.589925460 -0.574467203 -1.075860977
  [6] -1.220145615  0.660435153 -0.744757181  0.137138128 -0.675909887
 [11]  0.097653271 -1.287979171 -0.765995891  0.516109559  1.484669237
 [16] -0.393475216  0.383462507  0.293164742  1.429658252  2.540223836
 [21] -0.313305290 -0.469828846  0.219302992  0.466801024  0.125513438
 [26] -0.839982743  0.214614851  0.007518155  0.806953023  0.587132039
 [31] -1.676481837  0.999901847  1.305956609  0.131430106 -0.251904819
 [36]  1.822088451  1.668619230  0.849101353  0.323234551 -1.077241876
 [41] -1.782696246 -0.001262014  2.634765073  0.825036666  0.291661970
 [46]  0.548204308 -0.139480178  0.320063466 -0.486473105  0.191993117
 [51]  0.691638341 -0.662108615  0.330387900 -0.142410346  0.005868548
 [56] -1.081719102 -1.245373266 -0.566688046  2.128663723 -1.314193365
 [61]  0.120110543  1.111750667  0.834292854  1.939172780 -1.591232792
 [66]  1.990882486  0.176456203 -0.286537559  0.208104236  0.534167829
 [71]  0.145346556 -0.335194447  1.115444404 -0.978768086 -2.042583018
 [76] -0.191708089 -1.333211777  0.146777437 -1.209961859 -0.847660747
 [81] -2.468855346  0.359387166  3.304967337 -0.670903195 -0.918640559
 [86] -0.392020248 -0.548465657 -0.100637510  1.218538248  0.688866969
 [91]  1.579129124 -0.108180577 -0.958228275 -1.376456532 -1.704818068
 [96] -0.742028196 -1.454774477 -0.490975555 -1.015602075 -0.194111548
> 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.744403649 -0.933580925 -0.589925460 -0.574467203 -1.075860977
  [6] -1.220145615  0.660435153 -0.744757181  0.137138128 -0.675909887
 [11]  0.097653271 -1.287979171 -0.765995891  0.516109559  1.484669237
 [16] -0.393475216  0.383462507  0.293164742  1.429658252  2.540223836
 [21] -0.313305290 -0.469828846  0.219302992  0.466801024  0.125513438
 [26] -0.839982743  0.214614851  0.007518155  0.806953023  0.587132039
 [31] -1.676481837  0.999901847  1.305956609  0.131430106 -0.251904819
 [36]  1.822088451  1.668619230  0.849101353  0.323234551 -1.077241876
 [41] -1.782696246 -0.001262014  2.634765073  0.825036666  0.291661970
 [46]  0.548204308 -0.139480178  0.320063466 -0.486473105  0.191993117
 [51]  0.691638341 -0.662108615  0.330387900 -0.142410346  0.005868548
 [56] -1.081719102 -1.245373266 -0.566688046  2.128663723 -1.314193365
 [61]  0.120110543  1.111750667  0.834292854  1.939172780 -1.591232792
 [66]  1.990882486  0.176456203 -0.286537559  0.208104236  0.534167829
 [71]  0.145346556 -0.335194447  1.115444404 -0.978768086 -2.042583018
 [76] -0.191708089 -1.333211777  0.146777437 -1.209961859 -0.847660747
 [81] -2.468855346  0.359387166  3.304967337 -0.670903195 -0.918640559
 [86] -0.392020248 -0.548465657 -0.100637510  1.218538248  0.688866969
 [91]  1.579129124 -0.108180577 -0.958228275 -1.376456532 -1.704818068
 [96] -0.742028196 -1.454774477 -0.490975555 -1.015602075 -0.194111548
> colMin(tmp)
  [1] -0.744403649 -0.933580925 -0.589925460 -0.574467203 -1.075860977
  [6] -1.220145615  0.660435153 -0.744757181  0.137138128 -0.675909887
 [11]  0.097653271 -1.287979171 -0.765995891  0.516109559  1.484669237
 [16] -0.393475216  0.383462507  0.293164742  1.429658252  2.540223836
 [21] -0.313305290 -0.469828846  0.219302992  0.466801024  0.125513438
 [26] -0.839982743  0.214614851  0.007518155  0.806953023  0.587132039
 [31] -1.676481837  0.999901847  1.305956609  0.131430106 -0.251904819
 [36]  1.822088451  1.668619230  0.849101353  0.323234551 -1.077241876
 [41] -1.782696246 -0.001262014  2.634765073  0.825036666  0.291661970
 [46]  0.548204308 -0.139480178  0.320063466 -0.486473105  0.191993117
 [51]  0.691638341 -0.662108615  0.330387900 -0.142410346  0.005868548
 [56] -1.081719102 -1.245373266 -0.566688046  2.128663723 -1.314193365
 [61]  0.120110543  1.111750667  0.834292854  1.939172780 -1.591232792
 [66]  1.990882486  0.176456203 -0.286537559  0.208104236  0.534167829
 [71]  0.145346556 -0.335194447  1.115444404 -0.978768086 -2.042583018
 [76] -0.191708089 -1.333211777  0.146777437 -1.209961859 -0.847660747
 [81] -2.468855346  0.359387166  3.304967337 -0.670903195 -0.918640559
 [86] -0.392020248 -0.548465657 -0.100637510  1.218538248  0.688866969
 [91]  1.579129124 -0.108180577 -0.958228275 -1.376456532 -1.704818068
 [96] -0.742028196 -1.454774477 -0.490975555 -1.015602075 -0.194111548
> colMedians(tmp)
  [1] -0.744403649 -0.933580925 -0.589925460 -0.574467203 -1.075860977
  [6] -1.220145615  0.660435153 -0.744757181  0.137138128 -0.675909887
 [11]  0.097653271 -1.287979171 -0.765995891  0.516109559  1.484669237
 [16] -0.393475216  0.383462507  0.293164742  1.429658252  2.540223836
 [21] -0.313305290 -0.469828846  0.219302992  0.466801024  0.125513438
 [26] -0.839982743  0.214614851  0.007518155  0.806953023  0.587132039
 [31] -1.676481837  0.999901847  1.305956609  0.131430106 -0.251904819
 [36]  1.822088451  1.668619230  0.849101353  0.323234551 -1.077241876
 [41] -1.782696246 -0.001262014  2.634765073  0.825036666  0.291661970
 [46]  0.548204308 -0.139480178  0.320063466 -0.486473105  0.191993117
 [51]  0.691638341 -0.662108615  0.330387900 -0.142410346  0.005868548
 [56] -1.081719102 -1.245373266 -0.566688046  2.128663723 -1.314193365
 [61]  0.120110543  1.111750667  0.834292854  1.939172780 -1.591232792
 [66]  1.990882486  0.176456203 -0.286537559  0.208104236  0.534167829
 [71]  0.145346556 -0.335194447  1.115444404 -0.978768086 -2.042583018
 [76] -0.191708089 -1.333211777  0.146777437 -1.209961859 -0.847660747
 [81] -2.468855346  0.359387166  3.304967337 -0.670903195 -0.918640559
 [86] -0.392020248 -0.548465657 -0.100637510  1.218538248  0.688866969
 [91]  1.579129124 -0.108180577 -0.958228275 -1.376456532 -1.704818068
 [96] -0.742028196 -1.454774477 -0.490975555 -1.015602075 -0.194111548
> colRanges(tmp)
           [,1]       [,2]       [,3]       [,4]      [,5]      [,6]      [,7]
[1,] -0.7444036 -0.9335809 -0.5899255 -0.5744672 -1.075861 -1.220146 0.6604352
[2,] -0.7444036 -0.9335809 -0.5899255 -0.5744672 -1.075861 -1.220146 0.6604352
           [,8]      [,9]      [,10]      [,11]     [,12]      [,13]     [,14]
[1,] -0.7447572 0.1371381 -0.6759099 0.09765327 -1.287979 -0.7659959 0.5161096
[2,] -0.7447572 0.1371381 -0.6759099 0.09765327 -1.287979 -0.7659959 0.5161096
        [,15]      [,16]     [,17]     [,18]    [,19]    [,20]      [,21]
[1,] 1.484669 -0.3934752 0.3834625 0.2931647 1.429658 2.540224 -0.3133053
[2,] 1.484669 -0.3934752 0.3834625 0.2931647 1.429658 2.540224 -0.3133053
          [,22]    [,23]    [,24]     [,25]      [,26]     [,27]       [,28]
[1,] -0.4698288 0.219303 0.466801 0.1255134 -0.8399827 0.2146149 0.007518155
[2,] -0.4698288 0.219303 0.466801 0.1255134 -0.8399827 0.2146149 0.007518155
        [,29]    [,30]     [,31]     [,32]    [,33]     [,34]      [,35]
[1,] 0.806953 0.587132 -1.676482 0.9999018 1.305957 0.1314301 -0.2519048
[2,] 0.806953 0.587132 -1.676482 0.9999018 1.305957 0.1314301 -0.2519048
        [,36]    [,37]     [,38]     [,39]     [,40]     [,41]        [,42]
[1,] 1.822088 1.668619 0.8491014 0.3232346 -1.077242 -1.782696 -0.001262014
[2,] 1.822088 1.668619 0.8491014 0.3232346 -1.077242 -1.782696 -0.001262014
        [,43]     [,44]    [,45]     [,46]      [,47]     [,48]      [,49]
[1,] 2.634765 0.8250367 0.291662 0.5482043 -0.1394802 0.3200635 -0.4864731
[2,] 2.634765 0.8250367 0.291662 0.5482043 -0.1394802 0.3200635 -0.4864731
         [,50]     [,51]      [,52]     [,53]      [,54]       [,55]     [,56]
[1,] 0.1919931 0.6916383 -0.6621086 0.3303879 -0.1424103 0.005868548 -1.081719
[2,] 0.1919931 0.6916383 -0.6621086 0.3303879 -0.1424103 0.005868548 -1.081719
         [,57]     [,58]    [,59]     [,60]     [,61]    [,62]     [,63]
[1,] -1.245373 -0.566688 2.128664 -1.314193 0.1201105 1.111751 0.8342929
[2,] -1.245373 -0.566688 2.128664 -1.314193 0.1201105 1.111751 0.8342929
        [,64]     [,65]    [,66]     [,67]      [,68]     [,69]     [,70]
[1,] 1.939173 -1.591233 1.990882 0.1764562 -0.2865376 0.2081042 0.5341678
[2,] 1.939173 -1.591233 1.990882 0.1764562 -0.2865376 0.2081042 0.5341678
         [,71]      [,72]    [,73]      [,74]     [,75]      [,76]     [,77]
[1,] 0.1453466 -0.3351944 1.115444 -0.9787681 -2.042583 -0.1917081 -1.333212
[2,] 0.1453466 -0.3351944 1.115444 -0.9787681 -2.042583 -0.1917081 -1.333212
         [,78]     [,79]      [,80]     [,81]     [,82]    [,83]      [,84]
[1,] 0.1467774 -1.209962 -0.8476607 -2.468855 0.3593872 3.304967 -0.6709032
[2,] 0.1467774 -1.209962 -0.8476607 -2.468855 0.3593872 3.304967 -0.6709032
          [,85]      [,86]      [,87]      [,88]    [,89]    [,90]    [,91]
[1,] -0.9186406 -0.3920202 -0.5484657 -0.1006375 1.218538 0.688867 1.579129
[2,] -0.9186406 -0.3920202 -0.5484657 -0.1006375 1.218538 0.688867 1.579129
          [,92]      [,93]     [,94]     [,95]      [,96]     [,97]      [,98]
[1,] -0.1081806 -0.9582283 -1.376457 -1.704818 -0.7420282 -1.454774 -0.4909756
[2,] -0.1081806 -0.9582283 -1.376457 -1.704818 -0.7420282 -1.454774 -0.4909756
         [,99]     [,100]
[1,] -1.015602 -0.1941115
[2,] -1.015602 -0.1941115
> 
> 
> Max(tmp2)
[1] 2.798507
> Min(tmp2)
[1] -2.218508
> mean(tmp2)
[1] 0.03938881
> Sum(tmp2)
[1] 3.938881
> Var(tmp2)
[1] 0.994753
> 
> rowMeans(tmp2)
  [1]  0.6209332325  0.7548612105  0.5562812808  0.0003153504  0.6296626763
  [6]  0.7582591556  0.8594456555 -2.0633144454  0.7890284259  0.0265203906
 [11] -1.3046147542  0.4224300125  0.4852554658  1.4069001327 -1.6275750657
 [16] -1.4446985432  0.6524392231  0.9238757478 -0.3252234642 -0.1641386888
 [21]  1.1234036608 -0.9499103668 -1.0375602840 -1.5496914110  0.0379308274
 [26] -2.2070522024  1.0710809328  2.7985070138  0.0463172992 -0.6759750820
 [31] -0.6073070034  0.8765574062  0.1039107287 -0.9383188832  2.4606161981
 [36] -0.8929009863 -1.7346723604  0.1247902786 -1.4481641471 -0.5539807242
 [41] -1.2004830811  0.6402899011  0.3748618622  0.5682121085 -0.2393020325
 [46]  0.3264143375  1.0171060272 -1.1191793618 -0.2200812557 -0.0590271371
 [51] -0.8614164302 -0.1309621909  0.5769288107  0.5418523564 -1.2769023920
 [56]  1.2273775632 -1.0850554158  1.1554935771  0.1299248429 -1.8636689849
 [61]  0.6853004258  0.9986438529  0.6437851642  1.0569785626 -0.7325192391
 [66]  0.4756440593 -0.0515801147 -1.0563770759 -2.2185083089  1.1251731433
 [71]  1.2277355023 -0.3411994085  0.6682823412  1.0283290712  0.7872658002
 [76] -0.2473688428 -0.0937676482 -0.4079256652  0.5970826988 -0.7543596162
 [81] -0.3302988281  0.1997160773  0.6493511656 -0.0272049605 -0.0675958373
 [86] -1.3563089178  0.1138304687  0.2743457981 -0.6097006379  1.1049107718
 [91]  0.0842175418 -1.2824830755  1.8216591768  0.1617931442  1.1828825208
 [96]  1.0239217874  1.4590272392  0.3134990423  0.3560423188 -1.0299449978
> rowSums(tmp2)
  [1]  0.6209332325  0.7548612105  0.5562812808  0.0003153504  0.6296626763
  [6]  0.7582591556  0.8594456555 -2.0633144454  0.7890284259  0.0265203906
 [11] -1.3046147542  0.4224300125  0.4852554658  1.4069001327 -1.6275750657
 [16] -1.4446985432  0.6524392231  0.9238757478 -0.3252234642 -0.1641386888
 [21]  1.1234036608 -0.9499103668 -1.0375602840 -1.5496914110  0.0379308274
 [26] -2.2070522024  1.0710809328  2.7985070138  0.0463172992 -0.6759750820
 [31] -0.6073070034  0.8765574062  0.1039107287 -0.9383188832  2.4606161981
 [36] -0.8929009863 -1.7346723604  0.1247902786 -1.4481641471 -0.5539807242
 [41] -1.2004830811  0.6402899011  0.3748618622  0.5682121085 -0.2393020325
 [46]  0.3264143375  1.0171060272 -1.1191793618 -0.2200812557 -0.0590271371
 [51] -0.8614164302 -0.1309621909  0.5769288107  0.5418523564 -1.2769023920
 [56]  1.2273775632 -1.0850554158  1.1554935771  0.1299248429 -1.8636689849
 [61]  0.6853004258  0.9986438529  0.6437851642  1.0569785626 -0.7325192391
 [66]  0.4756440593 -0.0515801147 -1.0563770759 -2.2185083089  1.1251731433
 [71]  1.2277355023 -0.3411994085  0.6682823412  1.0283290712  0.7872658002
 [76] -0.2473688428 -0.0937676482 -0.4079256652  0.5970826988 -0.7543596162
 [81] -0.3302988281  0.1997160773  0.6493511656 -0.0272049605 -0.0675958373
 [86] -1.3563089178  0.1138304687  0.2743457981 -0.6097006379  1.1049107718
 [91]  0.0842175418 -1.2824830755  1.8216591768  0.1617931442  1.1828825208
 [96]  1.0239217874  1.4590272392  0.3134990423  0.3560423188 -1.0299449978
> 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.6209332325  0.7548612105  0.5562812808  0.0003153504  0.6296626763
  [6]  0.7582591556  0.8594456555 -2.0633144454  0.7890284259  0.0265203906
 [11] -1.3046147542  0.4224300125  0.4852554658  1.4069001327 -1.6275750657
 [16] -1.4446985432  0.6524392231  0.9238757478 -0.3252234642 -0.1641386888
 [21]  1.1234036608 -0.9499103668 -1.0375602840 -1.5496914110  0.0379308274
 [26] -2.2070522024  1.0710809328  2.7985070138  0.0463172992 -0.6759750820
 [31] -0.6073070034  0.8765574062  0.1039107287 -0.9383188832  2.4606161981
 [36] -0.8929009863 -1.7346723604  0.1247902786 -1.4481641471 -0.5539807242
 [41] -1.2004830811  0.6402899011  0.3748618622  0.5682121085 -0.2393020325
 [46]  0.3264143375  1.0171060272 -1.1191793618 -0.2200812557 -0.0590271371
 [51] -0.8614164302 -0.1309621909  0.5769288107  0.5418523564 -1.2769023920
 [56]  1.2273775632 -1.0850554158  1.1554935771  0.1299248429 -1.8636689849
 [61]  0.6853004258  0.9986438529  0.6437851642  1.0569785626 -0.7325192391
 [66]  0.4756440593 -0.0515801147 -1.0563770759 -2.2185083089  1.1251731433
 [71]  1.2277355023 -0.3411994085  0.6682823412  1.0283290712  0.7872658002
 [76] -0.2473688428 -0.0937676482 -0.4079256652  0.5970826988 -0.7543596162
 [81] -0.3302988281  0.1997160773  0.6493511656 -0.0272049605 -0.0675958373
 [86] -1.3563089178  0.1138304687  0.2743457981 -0.6097006379  1.1049107718
 [91]  0.0842175418 -1.2824830755  1.8216591768  0.1617931442  1.1828825208
 [96]  1.0239217874  1.4590272392  0.3134990423  0.3560423188 -1.0299449978
> rowMin(tmp2)
  [1]  0.6209332325  0.7548612105  0.5562812808  0.0003153504  0.6296626763
  [6]  0.7582591556  0.8594456555 -2.0633144454  0.7890284259  0.0265203906
 [11] -1.3046147542  0.4224300125  0.4852554658  1.4069001327 -1.6275750657
 [16] -1.4446985432  0.6524392231  0.9238757478 -0.3252234642 -0.1641386888
 [21]  1.1234036608 -0.9499103668 -1.0375602840 -1.5496914110  0.0379308274
 [26] -2.2070522024  1.0710809328  2.7985070138  0.0463172992 -0.6759750820
 [31] -0.6073070034  0.8765574062  0.1039107287 -0.9383188832  2.4606161981
 [36] -0.8929009863 -1.7346723604  0.1247902786 -1.4481641471 -0.5539807242
 [41] -1.2004830811  0.6402899011  0.3748618622  0.5682121085 -0.2393020325
 [46]  0.3264143375  1.0171060272 -1.1191793618 -0.2200812557 -0.0590271371
 [51] -0.8614164302 -0.1309621909  0.5769288107  0.5418523564 -1.2769023920
 [56]  1.2273775632 -1.0850554158  1.1554935771  0.1299248429 -1.8636689849
 [61]  0.6853004258  0.9986438529  0.6437851642  1.0569785626 -0.7325192391
 [66]  0.4756440593 -0.0515801147 -1.0563770759 -2.2185083089  1.1251731433
 [71]  1.2277355023 -0.3411994085  0.6682823412  1.0283290712  0.7872658002
 [76] -0.2473688428 -0.0937676482 -0.4079256652  0.5970826988 -0.7543596162
 [81] -0.3302988281  0.1997160773  0.6493511656 -0.0272049605 -0.0675958373
 [86] -1.3563089178  0.1138304687  0.2743457981 -0.6097006379  1.1049107718
 [91]  0.0842175418 -1.2824830755  1.8216591768  0.1617931442  1.1828825208
 [96]  1.0239217874  1.4590272392  0.3134990423  0.3560423188 -1.0299449978
> 
> colMeans(tmp2)
[1] 0.03938881
> colSums(tmp2)
[1] 3.938881
> colVars(tmp2)
[1] 0.994753
> colSd(tmp2)
[1] 0.997373
> colMax(tmp2)
[1] 2.798507
> colMin(tmp2)
[1] -2.218508
> colMedians(tmp2)
[1] 0.1193104
> colRanges(tmp2)
          [,1]
[1,] -2.218508
[2,]  2.798507
> 
> dataset1 <- matrix(dataset1,1,100)
> 
> agree.checks(tmp,dataset1)
> 
> dataset2 <- matrix(dataset2,100,1)
> agree.checks(tmp2,dataset2)
>   
> 
> tmp <- createBufferedMatrix(10,10)
> 
> tmp[1:10,1:10] <- rnorm(100)
> colApply(tmp,sum)
 [1] -1.46300745 -0.06972237 -1.87674667 -0.57947182  0.55093973 -0.68424268
 [7] -1.30205753 -6.73960997 -0.38799358  2.79533620
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -1.3053225
[2,] -0.8870300
[3,] -0.1877091
[4,]  0.3880234
[5,]  1.0681003
> 
> rowApply(tmp,sum)
 [1] -1.0742661  0.2612803 -5.9688812 -4.7797766  0.6367644  3.2094963
 [7] -3.8075967  2.1348341  3.1845104 -3.5529410
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    8    2    5    7    4    1    9    1    9    10
 [2,]    9   10    7    6    3    7    4    4    1     4
 [3,]    4    7   10    8    5    2    3    3    7     5
 [4,]    6    1    9    1    7    8    5    2   10     7
 [5,]   10    3    8    4    9    9    6    7    5     1
 [6,]    5    9    2    9   10    6    2    6    6     2
 [7,]    3    6    3    2    6    4   10    5    3     8
 [8,]    1    4    1    5    1    3    7    9    2     6
 [9,]    2    8    4   10    2    5    1   10    4     3
[10,]    7    5    6    3    8   10    8    8    8     9
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1] -0.02044325 -4.35472919  1.49521536  1.65383083  5.58085193 -0.92776306
 [7] -0.35618161  2.36995420 -1.34499187 -4.51263696  0.10906184 -2.52147870
[13]  1.09886566 -0.56270543  3.54341794 -3.16769664  1.44720644 -1.64135313
[19]  0.82524067  0.39631282
> colApply(tmp,quantile)[,1]
            [,1]
[1,] -0.73955470
[2,] -0.42392304
[3,] -0.01299472
[4,]  0.35137995
[5,]  0.80464926
> 
> rowApply(tmp,sum)
[1]  8.4412819  0.1728515 -2.1757736 -4.4718851 -2.8564970
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]    7   17   11   14   10
[2,]    9    4    7    1    9
[3,]   19   12    5   12   18
[4,]   11   19   15    4   19
[5,]   18   18   19   15   16
> 
> 
> as.matrix(tmp)
            [,1]       [,2]       [,3]       [,4]      [,5]       [,6]
[1,] -0.01299472  0.2475990  1.5345885  0.7606590 1.3524150  1.7986575
[2,]  0.80464926 -0.9635359  0.2133299  1.1159787 0.9363161  0.3861806
[3,] -0.73955470 -0.8300432 -1.1063356  0.2499007 2.0567975 -1.2384705
[4,]  0.35137995 -2.2656371  0.1614663 -1.1741844 0.6360180 -1.3051737
[5,] -0.42392304 -0.5431119  0.6921663  0.7014767 0.5993054 -0.5689570
           [,7]       [,8]        [,9]      [,10]       [,11]      [,12]
[1,]  0.8707947 -0.3641490  0.74148749 -1.0410127 -0.77637574  0.7733941
[2,] -1.2010974  0.4786123  0.08330172  0.0212072 -1.50687569  0.3761455
[3,] -0.8938973  1.2640960 -1.60029152 -0.7724240 -0.05958702 -1.1637711
[4,]  1.4120547  0.8478378  0.19579694 -1.0809005 -0.23138617 -1.9150760
[5,] -0.5440363  0.1435571 -0.76528651 -1.6395070  2.68328646 -0.5921712
          [,13]      [,14]      [,15]      [,16]      [,17]      [,18]
[1,]  1.0772784  0.9761103 -0.1443756  0.1879217  0.9121896 -1.1202762
[2,] -0.4751586 -0.2429539  1.9307178 -2.1873619  0.3223153  0.1851006
[3,]  3.1354916 -1.5803947  0.2392777 -0.7515708 -0.8289156  0.9164287
[4,] -0.5803697 -0.1660475  0.8449171  0.6395701  0.6879931 -0.6392400
[5,] -2.0583760  0.4505804  0.6728810 -1.0562557  0.3536241 -0.9833662
          [,19]      [,20]
[1,] -0.4389474  1.1063181
[2,] -0.3051735  0.2011535
[3,]  1.7709506 -0.2434603
[4,]  0.1462865 -1.0371903
[5,] -0.3478754  0.3694919
> 
> 
> 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 :  650  bytes.
Disk usage :  200  bytes.
> subBufferedMatrix(tmp,,5:8)
BufferedMatrix object
Matrix size:  5 4 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  563  bytes.
Disk usage :  160  bytes.
> subBufferedMatrix(tmp,1:3,)
BufferedMatrix object
Matrix size:  3 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.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 -0.9375551 -0.7011925 1.299107 0.9824429 -1.358925 -0.6256632 1.269317
          col8       col9      col10     col11      col12      col13     col14
row1 0.1060687 -0.7847783 -0.5965122 0.6021544 -0.6410398 -0.5984565 -1.961688
         col15      col16     col17     col18      col19     col20
row1 0.2107455 -0.5375731 -1.076385 -1.035078 -0.8790159 0.3733038
> tmp[,"col10"]
          col10
row1 -0.5965122
row2 -0.4041990
row3  1.4072350
row4  0.8975587
row5 -1.4842642
> tmp[c("row1","row5"),]
           col1       col2     col3      col4      col5       col6       col7
row1 -0.9375551 -0.7011925 1.299107 0.9824429 -1.358925 -0.6256632  1.2693174
row5 -0.6701237 -0.2745672 1.418742 0.1734737  1.753529 -1.8901872 -0.8636213
           col8       col9      col10     col11      col12      col13
row1  0.1060687 -0.7847783 -0.5965122 0.6021544 -0.6410398 -0.5984565
row5 -0.1429774 -0.3870984 -1.4842642 1.0656823  0.2754154  0.1811634
          col14     col15      col16       col17      col18      col19
row1 -1.9616883 0.2107455 -0.5375731 -1.07638468 -1.0350781 -0.8790159
row5 -0.1933116 3.5304535  0.5424008  0.05180929  0.4594313  0.2085224
         col20
row1 0.3733038
row5 0.4324431
> tmp[,c("col6","col20")]
            col6      col20
row1 -0.62566316  0.3733038
row2  0.01357893  0.6933608
row3 -0.66833286 -0.7305197
row4  0.61231831 -1.7661939
row5 -1.89018718  0.4324431
> tmp[c("row1","row5"),c("col6","col20")]
           col6     col20
row1 -0.6256632 0.3733038
row5 -1.8901872 0.4324431
> 
> 
> 
> 
> tmp["row1",] <- rnorm(20,mean=10)
> tmp[,"col10"] <- rnorm(5,mean=30)
> tmp[c("row1","row5"),] <- rnorm(40,mean=50)
> tmp[,c("col6","col20")] <- rnorm(10,mean=75)
> tmp[c("row1","row5"),c("col6","col20")]  <- rnorm(4,mean=105)
> 
> tmp["row1",]
         col1     col2    col3     col4     col5     col6     col7     col8
row1 52.33172 51.18279 47.7225 50.99736 48.83872 102.3192 50.20217 49.86061
         col9    col10    col11    col12    col13    col14    col15    col16
row1 49.29737 50.00185 51.47205 48.61423 50.42904 48.82769 50.52825 50.46616
        col17    col18    col19    col20
row1 49.59502 50.70304 49.96341 104.5746
> tmp[,"col10"]
        col10
row1 50.00185
row2 29.32320
row3 30.66276
row4 29.83470
row5 49.52299
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 52.33172 51.18279 47.72250 50.99736 48.83872 102.3192 50.20217 49.86061
row5 48.28955 50.44913 49.27332 48.71134 50.88893 103.7435 50.42123 49.23518
         col9    col10    col11    col12    col13    col14    col15    col16
row1 49.29737 50.00185 51.47205 48.61423 50.42904 48.82769 50.52825 50.46616
row5 50.76970 49.52299 49.11196 50.38290 47.80989 50.02057 50.34642 49.27536
        col17    col18    col19    col20
row1 49.59502 50.70304 49.96341 104.5746
row5 48.79363 49.14982 51.61783 105.9028
> tmp[,c("col6","col20")]
          col6     col20
row1 102.31915 104.57460
row2  74.11898  75.01524
row3  74.93248  73.93200
row4  75.58481  74.24653
row5 103.74353 105.90279
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 102.3192 104.5746
row5 103.7435 105.9028
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 102.3192 104.5746
row5 103.7435 105.9028
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
          col13
[1,] -0.8113413
[2,] -1.2697015
[3,] -0.3205567
[4,]  0.4766975
[5,] -0.2297755
> tmp[,c("col17","col7")]
           col17        col7
[1,]  2.42211948 -0.11209929
[2,] -0.69041782  0.46230686
[3,]  0.42270602 -0.83881351
[4,] -0.06673295 -0.34742649
[5,]  0.97947519  0.04267967
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
           col6      col20
[1,]  0.4722888 -0.1212389
[2,] -2.3453848 -1.7584508
[3,]  0.7737313 -0.2728787
[4,]  0.0129628 -1.9865434
[5,] -2.8163218 -1.0679423
> subBufferedMatrix(tmp,1,c("col6"))[,1]
          col1
[1,] 0.4722888
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
           col6
[1,]  0.4722888
[2,] -2.3453848
> 
> 
> 
> 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.07696788 -0.2898820 -0.5382093 -2.3730574 1.7074402 -1.0303963
row1 -1.87266866  0.1535011 -1.3709622  0.5997102 0.1538701 -0.2127407
           [,7]       [,8]      [,9]       [,10]     [,11]      [,12]
row3 -0.4457579 -0.7345359 -1.185686  0.03212547 0.1781394 -0.3921745
row1  0.6069529  0.5876940 -1.058391 -1.28519004 0.2977982 -0.6709796
          [,13]      [,14]     [,15]     [,16]      [,17]      [,18]     [,19]
row3  2.4068443  0.4631119 1.0119534 0.5136229 -0.5878404 -0.9657482 0.9006613
row1 -0.6626225 -0.6488831 0.1130332 0.3043329 -1.7596588  0.7710692 0.3596151
           [,20]
row3 -1.28133540
row1 -0.08895418
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
           [,1]      [,2]       [,3]        [,4]      [,5]     [,6]      [,7]
row2 0.02077155 0.1229926 -0.6041409 -0.02968084 0.4343078 1.649221 0.2615817
          [,8]      [,9]      [,10]
row2 0.4405663 -0.170478 -0.8872174
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
         [,1]      [,2]     [,3]       [,4]      [,5]       [,6]       [,7]
row5 1.754531 0.7045694 1.027162 -0.3537078 0.9819139 -0.4642969 -0.8095554
           [,8]     [,9]      [,10]     [,11]     [,12]     [,13]     [,14]
row5 -0.4102869 1.363588 -0.4954356 -1.745848 -1.407162 -1.030831 0.4646254
        [,15]     [,16]     [,17]     [,18]      [,19]    [,20]
row5 1.795839 0.9681094 0.6258931 -1.791239 -0.2948416 1.415057
> 
> 
> 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: 0x600001590240>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMd90e1b310aa8"
 [2] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMd90e30b2a98a"
 [3] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMd90e2198bc00"
 [4] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMd90e325eb53b"
 [5] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMd90e67cc4e52"
 [6] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMd90e162a1ebb"
 [7] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMd90e2747925b"
 [8] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMd90e4bd9a882"
 [9] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMd90e3ec615b5"
[10] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMd90e3ebb3e45"
[11] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMd90e76f5442f"
[12] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMd90e604fa6ac"
[13] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMd90ed47979a" 
[14] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMd90e57320645"
[15] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMd90e1539c8bc"
> 
> 
> ### 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: 0x600001594d20>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x600001594d20>
Warning message:
In dir.create(new.directory) :
  '/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x600001594d20>
> rowMedians(tmp)
  [1]  0.1214985332 -0.3898491022 -0.0791517907  0.0803712807  0.2192091286
  [6] -0.3703383205  0.2329276257  0.1182810642 -0.0210576958  0.0536703723
 [11]  0.5551151830 -0.9059041081 -0.0347562135  0.3605198083 -0.2749088817
 [16] -0.0275229422  0.0426426819 -0.1303044460  0.2101357791  0.6432199582
 [21]  0.0385815110 -0.0587625530  0.0215862147 -0.1466595342  0.5476111583
 [26] -0.3599749636 -0.2339896325  0.6230805456 -0.0087331782  0.0103862503
 [31]  0.0746874720 -0.0046504449 -0.0066779742 -0.5249151117  0.0242265005
 [36]  0.0567593992  0.2003130710  0.4895061871  0.0821556390 -0.0710378956
 [41]  0.1063418695  0.2892796743 -0.3090926226 -0.3286060314  0.2730172933
 [46]  0.1721319409  0.0701839842  0.1281367954  0.1496601102 -0.3010291128
 [51]  0.0249109728 -0.7093439186 -0.2880029305 -0.2387172939 -0.2023804105
 [56] -0.1975524296  0.1375997789 -0.3831666617  0.1501214412  0.2578713747
 [61] -0.3690107691  0.4178713952 -0.2646832875  0.3176260667 -0.0487922790
 [66] -0.5165629375 -0.1642795384  0.2732506847  0.2982890011 -0.3433196236
 [71]  0.1555680361 -0.4738283044 -0.4521784235  0.2101794547 -0.1370999792
 [76] -0.5662045290  0.4230793653 -0.3634016664  0.4495421289  0.5353527883
 [81]  0.6114686446  0.2346875977 -0.5345285569 -0.4548012809 -0.5543935843
 [86]  0.1695858526  0.1314609220 -0.6811959712 -0.0819267143  0.5935068006
 [91] -0.4170996160  0.0021051337  0.5446165912  0.0333913775 -0.5355438752
 [96] -0.1403270311 -0.2068980245 -0.1440112839  0.1397524083  0.0023794832
[101] -0.2831574293 -0.0851386285  0.2367922009  0.4213013521 -0.2456205639
[106] -0.0069883688 -0.3831962748 -0.2183527916 -0.1093131480 -0.0494311101
[111] -0.5807676748  0.0418591514  0.4122969531 -0.3320713090 -0.2887518572
[116] -0.1253697091  0.4061607114 -0.1310763441  0.2954096139 -0.0076365178
[121]  0.0155253316 -0.0032165662 -0.1367897955  0.3977303772 -0.0319313358
[126]  0.2383642600  0.0752480437  0.0014231881 -0.2031510530  0.0295749084
[131]  0.1014695033  0.2166063418  0.2437301156  0.2641914312 -0.3114834856
[136]  0.5895966991 -0.0701507187  0.5133448324 -0.0655315620  0.7030186079
[141] -0.2929273725  0.0829309836 -0.3801244525  0.1443776291  0.3418806852
[146]  0.3219567778  0.1753914393 -0.1179366248  0.0083659769  0.2349325777
[151] -0.3359478340 -0.3578482234 -0.1141265963 -0.0008204689  0.1852170224
[156]  0.2126397879  0.4004681578  0.6008437249  0.1108134224 -0.1137231542
[161] -0.0879637739  0.2050923803  0.2605783955  0.0119542071 -0.1285739181
[166]  0.1023844363  0.3907362311 -0.5492125352 -0.2540771749  0.0150652766
[171] -0.1924269670 -0.0352007097  0.0068007800  0.1470763951  0.0652299457
[176] -0.0606965296  0.7432326648  0.2694792048  0.6510048030 -0.0478238977
[181] -0.7348843166 -0.3504530124  0.3195835129 -0.4966479456 -0.3355373310
[186] -0.4520331386 -0.0825863609  0.2228823498  0.6036597188 -0.6042101510
[191] -0.1134862036  0.0047065440  0.0288223904 -0.1902799354  0.3686823742
[196] -0.0884514572  0.5256442604  0.0677351802 -0.3683251604  0.0435298913
[201]  0.4102156618 -0.2491798535  0.1391632468 -0.4408254697 -0.0400020567
[206] -0.0293712151 -0.0338156223  0.1357080921 -0.5603741458  0.1890256459
[211] -0.1959188973  0.1395605977  0.2870733797  0.2770979089  0.2022041373
[216]  0.1036073552 -0.0203463626  0.2786579820  0.3019882797 -0.1250496896
[221] -0.3340049748 -0.5547102805 -0.1379561745  0.0263303264 -0.5999076434
[226] -0.5030990908  0.0831686124 -0.0498595568 -0.1113230867  0.1354865855
> 
> proc.time()
   user  system elapsed 
  0.625   2.881   3.753 

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: 0x600003620000>
> .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: 0x600003620000>
> .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: 0x600003620000>
> .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: 0x600003620000>
> 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: 0x600003620780>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600003620780>
> .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: 0x600003620780>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600003620780>
> .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: 0x600003620780>
> 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: 0x600003620960>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600003620960>
> .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: 0x600003620960>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x600003620960>
> .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: 0x600003620960>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x600003620960>
> .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: 0x600003620960>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x600003620960>
> .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: 0x600003620960>
> 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: 0x600003620b40>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x600003620b40>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600003620b40>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600003620b40>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFiledadd386df830" "BufferedMatrixFiledadd7fc08546"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFiledadd386df830" "BufferedMatrixFiledadd7fc08546"
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x600003620de0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600003620de0>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x600003620de0>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x600003620de0>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x600003620de0>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x600003620de0>
> .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: 0x600003620fc0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600003620fc0>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x600003620fc0>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x600003620fc0>
> 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: 0x6000036211a0>
> .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: 0x6000036211a0>
> rm(P)
> 
> proc.time()
   user  system elapsed 
  0.109   0.035   0.141 

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.107   0.021   0.124 

Example timings