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

This page was generated on 2025-08-04 12:08 -0400 (Mon, 04 Aug 2025).

HostnameOSArch (*)R versionInstalled pkgs
nebbiolo2Linux (Ubuntu 24.04.2 LTS)x86_644.5.1 (2025-06-13) -- "Great Square Root" 4796
palomino8Windows Server 2022 Datacenterx644.5.1 (2025-06-13 ucrt) -- "Great Square Root" 4536
lconwaymacOS 12.7.1 Montereyx86_644.5.1 (2025-06-13) -- "Great Square Root" 4578
kjohnson3macOS 13.7.1 Venturaarm644.5.1 Patched (2025-06-14 r88325) -- "Great Square Root" 4519
taishanLinux (openEuler 24.03 LTS)aarch644.5.0 (2025-04-11) -- "How About a Twenty-Six" 4517
Click on any hostname to see more info about the system (e.g. compilers)      (*) as reported by 'uname -p', except on Windows and Mac OS X

Package 251/2313HostnameOS / ArchINSTALLBUILDCHECKBUILD BIN
BufferedMatrix 1.73.0  (landing page)
Ben Bolstad
Snapshot Date: 2025-08-03 13:25 -0400 (Sun, 03 Aug 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.2 LTS) / x86_64  OK    OK    OK  UNNEEDED, same version is already published
palomino8Windows Server 2022 Datacenter / x64  OK    OK    OK    OK  UNNEEDED, same version is already published
lconwaymacOS 12.7.1 Monterey / x86_64  OK    OK    WARNINGS    OK  UNNEEDED, same version is already published
kjohnson3macOS 13.7.1 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 lconway

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

raw results


Summary

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

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

Tests output

BufferedMatrix.Rcheck/tests/c_code_level_tests.Rout


R version 4.5.1 (2025-06-13) -- "Great Square Root"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: x86_64-apple-darwin20

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

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

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

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

Attaching package: 'BufferedMatrix'

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

    colMeans, colSums, rowMeans, rowSums

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

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

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

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

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

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

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

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

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

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

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

[[1]]
[1] 0

> 
> proc.time()
   user  system elapsed 
  0.366   0.158   0.512 

BufferedMatrix.Rcheck/tests/objectTesting.Rout


R version 4.5.1 (2025-06-13) -- "Great Square Root"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: x86_64-apple-darwin20

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

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

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

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

Attaching package: 'BufferedMatrix'

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

    colMeans, colSums, rowMeans, rowSums

> 
> 
> ### this is used to control how many repetitions in something below
> ### higher values result in more checks.
> nreps <-100 ##20000
> 
> 
> ## test creation and some simple assignments and subsetting operations
> 
> ## first on single elements
> tmp <- createBufferedMatrix(1000,10)
> 
> tmp[10,5]
[1] 0
> tmp[10,5] <- 10
> tmp[10,5]
[1] 10
> tmp[10,5] <- 12.445
> tmp[10,5]
[1] 12.445
> 
> 
> 
> ## now testing accessing multiple elements
> tmp2 <- createBufferedMatrix(10,20)
> 
> 
> tmp2[3,1] <- 51.34
> tmp2[9,2] <- 9.87654
> tmp2[,1:2]
       [,1]    [,2]
 [1,]  0.00 0.00000
 [2,]  0.00 0.00000
 [3,] 51.34 0.00000
 [4,]  0.00 0.00000
 [5,]  0.00 0.00000
 [6,]  0.00 0.00000
 [7,]  0.00 0.00000
 [8,]  0.00 0.00000
 [9,]  0.00 9.87654
[10,]  0.00 0.00000
> tmp2[,-(3:20)]
       [,1]    [,2]
 [1,]  0.00 0.00000
 [2,]  0.00 0.00000
 [3,] 51.34 0.00000
 [4,]  0.00 0.00000
 [5,]  0.00 0.00000
 [6,]  0.00 0.00000
 [7,]  0.00 0.00000
 [8,]  0.00 0.00000
 [9,]  0.00 9.87654
[10,]  0.00 0.00000
> tmp2[3,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
[1,] 51.34    0    0    0    0    0    0    0    0     0     0     0     0
     [,14] [,15] [,16] [,17] [,18] [,19] [,20]
[1,]     0     0     0     0     0     0     0
> tmp2[-3,]
      [,1]    [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [2,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [3,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [4,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [5,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [6,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [7,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [8,]    0 9.87654    0    0    0    0    0    0    0     0     0     0     0
 [9,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
      [,14] [,15] [,16] [,17] [,18] [,19] [,20]
 [1,]     0     0     0     0     0     0     0
 [2,]     0     0     0     0     0     0     0
 [3,]     0     0     0     0     0     0     0
 [4,]     0     0     0     0     0     0     0
 [5,]     0     0     0     0     0     0     0
 [6,]     0     0     0     0     0     0     0
 [7,]     0     0     0     0     0     0     0
 [8,]     0     0     0     0     0     0     0
 [9,]     0     0     0     0     0     0     0
> tmp2[2,1:3]
     [,1] [,2] [,3]
[1,]    0    0    0
> tmp2[3:9,1:3]
      [,1]    [,2] [,3]
[1,] 51.34 0.00000    0
[2,]  0.00 0.00000    0
[3,]  0.00 0.00000    0
[4,]  0.00 0.00000    0
[5,]  0.00 0.00000    0
[6,]  0.00 0.00000    0
[7,]  0.00 9.87654    0
> tmp2[-4,-4]
       [,1]    [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [2,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [3,] 51.34 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [4,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [5,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [6,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [7,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [8,]  0.00 9.87654    0    0    0    0    0    0    0     0     0     0     0
 [9,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
      [,14] [,15] [,16] [,17] [,18] [,19]
 [1,]     0     0     0     0     0     0
 [2,]     0     0     0     0     0     0
 [3,]     0     0     0     0     0     0
 [4,]     0     0     0     0     0     0
 [5,]     0     0     0     0     0     0
 [6,]     0     0     0     0     0     0
 [7,]     0     0     0     0     0     0
 [8,]     0     0     0     0     0     0
 [9,]     0     0     0     0     0     0
> 
> ## now testing accessing/assigning multiple elements
> tmp3 <- createBufferedMatrix(10,10)
> 
> for (i in 1:10){
+   for (j in 1:10){
+     tmp3[i,j] <- (j-1)*10 + i
+   }
+ }
> 
> tmp3[2:4,2:4]
     [,1] [,2] [,3]
[1,]   12   22   32
[2,]   13   23   33
[3,]   14   24   34
> tmp3[c(-10),c(2:4,2:4,10,1,2,1:10,10:1)]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]   11   21   31   11   21   31   91    1   11     1    11    21    31
 [2,]   12   22   32   12   22   32   92    2   12     2    12    22    32
 [3,]   13   23   33   13   23   33   93    3   13     3    13    23    33
 [4,]   14   24   34   14   24   34   94    4   14     4    14    24    34
 [5,]   15   25   35   15   25   35   95    5   15     5    15    25    35
 [6,]   16   26   36   16   26   36   96    6   16     6    16    26    36
 [7,]   17   27   37   17   27   37   97    7   17     7    17    27    37
 [8,]   18   28   38   18   28   38   98    8   18     8    18    28    38
 [9,]   19   29   39   19   29   39   99    9   19     9    19    29    39
      [,14] [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24] [,25]
 [1,]    41    51    61    71    81    91    91    81    71    61    51    41
 [2,]    42    52    62    72    82    92    92    82    72    62    52    42
 [3,]    43    53    63    73    83    93    93    83    73    63    53    43
 [4,]    44    54    64    74    84    94    94    84    74    64    54    44
 [5,]    45    55    65    75    85    95    95    85    75    65    55    45
 [6,]    46    56    66    76    86    96    96    86    76    66    56    46
 [7,]    47    57    67    77    87    97    97    87    77    67    57    47
 [8,]    48    58    68    78    88    98    98    88    78    68    58    48
 [9,]    49    59    69    79    89    99    99    89    79    69    59    49
      [,26] [,27] [,28] [,29]
 [1,]    31    21    11     1
 [2,]    32    22    12     2
 [3,]    33    23    13     3
 [4,]    34    24    14     4
 [5,]    35    25    15     5
 [6,]    36    26    16     6
 [7,]    37    27    17     7
 [8,]    38    28    18     8
 [9,]    39    29    19     9
> tmp3[-c(1:5),-c(6:10)]
     [,1] [,2] [,3] [,4] [,5]
[1,]    6   16   26   36   46
[2,]    7   17   27   37   47
[3,]    8   18   28   38   48
[4,]    9   19   29   39   49
[5,]   10   20   30   40   50
> 
> ## assignment of whole columns
> tmp3[,1] <- c(1:10*100.0)
> tmp3[,1:2] <- tmp3[,1:2]*100
> tmp3[,1:2] <- tmp3[,2:1]
> tmp3[,1:2]
      [,1]  [,2]
 [1,] 1100 1e+04
 [2,] 1200 2e+04
 [3,] 1300 3e+04
 [4,] 1400 4e+04
 [5,] 1500 5e+04
 [6,] 1600 6e+04
 [7,] 1700 7e+04
 [8,] 1800 8e+04
 [9,] 1900 9e+04
[10,] 2000 1e+05
> 
> 
> tmp3[,-1] <- tmp3[,1:9]
> tmp3[,1:10]
      [,1] [,2]  [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,] 1100 1100 1e+04   21   31   41   51   61   71    81
 [2,] 1200 1200 2e+04   22   32   42   52   62   72    82
 [3,] 1300 1300 3e+04   23   33   43   53   63   73    83
 [4,] 1400 1400 4e+04   24   34   44   54   64   74    84
 [5,] 1500 1500 5e+04   25   35   45   55   65   75    85
 [6,] 1600 1600 6e+04   26   36   46   56   66   76    86
 [7,] 1700 1700 7e+04   27   37   47   57   67   77    87
 [8,] 1800 1800 8e+04   28   38   48   58   68   78    88
 [9,] 1900 1900 9e+04   29   39   49   59   69   79    89
[10,] 2000 2000 1e+05   30   40   50   60   70   80    90
> 
> tmp3[,1:2] <- rep(1,10)
> tmp3[,1:2] <- rep(1,20)
> tmp3[,1:2] <- matrix(c(1:5),1,5)
> 
> tmp3[,-c(1:8)] <- matrix(c(1:5),1,5)
> 
> tmp3[1,] <- 1:10
> tmp3[1,]
     [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,]    1    2    3    4    5    6    7    8    9    10
> tmp3[-1,] <- c(1,2)
> tmp3[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    1    2    3    4    5    6    7    8    9    10
 [2,]    1    2    1    2    1    2    1    2    1     2
 [3,]    2    1    2    1    2    1    2    1    2     1
 [4,]    1    2    1    2    1    2    1    2    1     2
 [5,]    2    1    2    1    2    1    2    1    2     1
 [6,]    1    2    1    2    1    2    1    2    1     2
 [7,]    2    1    2    1    2    1    2    1    2     1
 [8,]    1    2    1    2    1    2    1    2    1     2
 [9,]    2    1    2    1    2    1    2    1    2     1
[10,]    1    2    1    2    1    2    1    2    1     2
> tmp3[-c(1:8),] <- matrix(c(1:5),1,5)
> tmp3[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    1    2    3    4    5    6    7    8    9    10
 [2,]    1    2    1    2    1    2    1    2    1     2
 [3,]    2    1    2    1    2    1    2    1    2     1
 [4,]    1    2    1    2    1    2    1    2    1     2
 [5,]    2    1    2    1    2    1    2    1    2     1
 [6,]    1    2    1    2    1    2    1    2    1     2
 [7,]    2    1    2    1    2    1    2    1    2     1
 [8,]    1    2    1    2    1    2    1    2    1     2
 [9,]    1    3    5    2    4    1    3    5    2     4
[10,]    2    4    1    3    5    2    4    1    3     5
> 
> 
> tmp3[1:2,1:2] <- 5555.04
> tmp3[-(1:2),1:2] <- 1234.56789
> 
> 
> 
> ## testing accessors for the directory and prefix
> directory(tmp3)
[1] "/Users/biocbuild/bbs-3.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 480847 25.7    1056617 56.5         NA   634462 33.9
Vcells 891074  6.8    8388608 64.0      98304  2108713 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] "Sun Aug  3 19:51:47 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] "Sun Aug  3 19:51:47 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: 0x600000c982a0>
> 
> 
> 
> 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] "Sun Aug  3 19:51:52 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] "Sun Aug  3 19:51:53 2025"
> 
> ColMode(tmp2)
<pointer: 0x600000c982a0>
> 
> 
> 
> ### 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.26037879 -0.07091319  1.25626121  0.2686200
[2,]  -1.10222258  0.55392953 -0.26914745  0.9966381
[3,]  -0.80371758 -0.25833148 -0.70415185 -1.4900130
[4,]  -0.02663043 -2.68496878  0.01535344  0.7338904
> 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.26037879 0.07091319 1.25626121 0.2686200
[2,]   1.10222258 0.55392953 0.26914745 0.9966381
[3,]   0.80371758 0.25833148 0.70415185 1.4900130
[4,]   0.02663043 2.68496878 0.01535344 0.7338904
> 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.0130105 0.2662953 1.1208306 0.5182857
[2,]  1.0498679 0.7442644 0.5187942 0.9983176
[3,]  0.8965030 0.5082632 0.8391376 1.2206609
[4,]  0.1631883 1.6385874 0.1239090 0.8566740
> 
> 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.39048 27.73387 37.46457 30.45148
[2,]  36.60090 32.99657 30.45709 35.97981
[3,]  34.76875 30.34096 34.09553 38.69662
[4,]  26.65851 44.07084 26.25444 34.30063
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x600000c98240>
> exp(tmp5)
<pointer: 0x600000c98240>
> log(tmp5,2)
<pointer: 0x600000c98240>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 469.1208
> Min(tmp5)
[1] 53.33445
> mean(tmp5)
[1] 72.42132
> Sum(tmp5)
[1] 14484.26
> Var(tmp5)
[1] 866.2339
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 87.96923 70.03173 67.20516 71.54101 69.25622 72.50312 72.51338 71.27858
 [9] 70.91016 71.00464
> rowSums(tmp5)
 [1] 1759.385 1400.635 1344.103 1430.820 1385.124 1450.062 1450.268 1425.572
 [9] 1418.203 1420.093
> rowVars(tmp5)
 [1] 8094.75931  117.78737   43.88654   97.78862   68.01139   59.83865
 [7]   32.91528   70.78906   68.22350  112.28162
> rowSd(tmp5)
 [1] 89.970880 10.852989  6.624692  9.888813  8.246902  7.735544  5.737184
 [8]  8.413624  8.259752 10.596302
> rowMax(tmp5)
 [1] 469.12076  89.91301  80.54195  91.72769  82.15639  84.16583  81.42079
 [8]  87.71081  87.69014  93.99727
> rowMin(tmp5)
 [1] 57.72441 55.35191 58.15404 54.64518 54.43604 56.32877 59.76004 56.62593
 [9] 58.48021 53.33445
> 
> colMeans(tmp5)
 [1] 110.92500  77.41008  67.85505  69.52944  70.11750  74.01312  69.48820
 [8]  71.12156  68.27701  69.66724  72.21954  69.30767  69.17949  73.53200
[15]  72.08083  70.21486  66.63659  71.31654  68.80887  66.72586
> colSums(tmp5)
 [1] 1109.2500  774.1008  678.5505  695.2944  701.1750  740.1312  694.8820
 [8]  711.2156  682.7701  696.6724  722.1954  693.0767  691.7949  735.3200
[15]  720.8083  702.1486  666.3659  713.1654  688.0887  667.2586
> colVars(tmp5)
 [1] 15910.81537   144.44882    62.63297    38.67690    43.50712    58.87552
 [7]    83.89613   101.52249    37.19946    67.79431    57.28974    53.14068
[13]    60.85766    92.79203    96.67824    62.28198    75.29176   106.37194
[19]    49.47764    76.32860
> colSd(tmp5)
 [1] 126.138081  12.018686   7.914100   6.219076   6.595992   7.673038
 [7]   9.159483  10.075837   6.099136   8.233730   7.568998   7.289765
[13]   7.801132   9.632862   9.832509   7.891893   8.677083  10.313677
[19]   7.034034   8.736624
> colMax(tmp5)
 [1] 469.12076  93.99727  77.97759  80.54195  85.34780  86.16623  88.30654
 [8]  82.15639  78.76188  84.43996  82.05995  80.37696  86.03500  89.91301
[15]  84.34460  82.73592  78.73878  87.71081  77.45737  82.55867
> colMin(tmp5)
 [1] 55.48620 57.72441 54.64518 61.37783 63.62880 61.12454 56.62593 55.35191
 [9] 59.37513 58.58985 59.76004 58.76285 58.55350 53.33445 58.48021 56.94999
[17] 54.43604 60.87409 55.86679 56.70685
> 
> 
> ### 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] 87.96923 70.03173 67.20516 71.54101 69.25622       NA 72.51338 71.27858
 [9] 70.91016 71.00464
> rowSums(tmp5)
 [1] 1759.385 1400.635 1344.103 1430.820 1385.124       NA 1450.268 1425.572
 [9] 1418.203 1420.093
> rowVars(tmp5)
 [1] 8094.75931  117.78737   43.88654   97.78862   68.01139   62.48316
 [7]   32.91528   70.78906   68.22350  112.28162
> rowSd(tmp5)
 [1] 89.970880 10.852989  6.624692  9.888813  8.246902  7.904629  5.737184
 [8]  8.413624  8.259752 10.596302
> rowMax(tmp5)
 [1] 469.12076  89.91301  80.54195  91.72769  82.15639        NA  81.42079
 [8]  87.71081  87.69014  93.99727
> rowMin(tmp5)
 [1] 57.72441 55.35191 58.15404 54.64518 54.43604       NA 59.76004 56.62593
 [9] 58.48021 53.33445
> 
> colMeans(tmp5)
 [1] 110.92500  77.41008  67.85505  69.52944  70.11750  74.01312  69.48820
 [8]  71.12156  68.27701  69.66724  72.21954  69.30767  69.17949  73.53200
[15]  72.08083        NA  66.63659  71.31654  68.80887  66.72586
> colSums(tmp5)
 [1] 1109.2500  774.1008  678.5505  695.2944  701.1750  740.1312  694.8820
 [8]  711.2156  682.7701  696.6724  722.1954  693.0767  691.7949  735.3200
[15]  720.8083        NA  666.3659  713.1654  688.0887  667.2586
> colVars(tmp5)
 [1] 15910.81537   144.44882    62.63297    38.67690    43.50712    58.87552
 [7]    83.89613   101.52249    37.19946    67.79431    57.28974    53.14068
[13]    60.85766    92.79203    96.67824          NA    75.29176   106.37194
[19]    49.47764    76.32860
> colSd(tmp5)
 [1] 126.138081  12.018686   7.914100   6.219076   6.595992   7.673038
 [7]   9.159483  10.075837   6.099136   8.233730   7.568998   7.289765
[13]   7.801132   9.632862   9.832509         NA   8.677083  10.313677
[19]   7.034034   8.736624
> colMax(tmp5)
 [1] 469.12076  93.99727  77.97759  80.54195  85.34780  86.16623  88.30654
 [8]  82.15639  78.76188  84.43996  82.05995  80.37696  86.03500  89.91301
[15]  84.34460        NA  78.73878  87.71081  77.45737  82.55867
> colMin(tmp5)
 [1] 55.48620 57.72441 54.64518 61.37783 63.62880 61.12454 56.62593 55.35191
 [9] 59.37513 58.58985 59.76004 58.76285 58.55350 53.33445 58.48021       NA
[17] 54.43604 60.87409 55.86679 56.70685
> 
> Max(tmp5,na.rm=TRUE)
[1] 469.1208
> Min(tmp5,na.rm=TRUE)
[1] 53.33445
> mean(tmp5,na.rm=TRUE)
[1] 72.40378
> Sum(tmp5,na.rm=TRUE)
[1] 14408.35
> Var(tmp5,na.rm=TRUE)
[1] 870.547
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 87.96923 70.03173 67.20516 71.54101 69.25622 72.32366 72.51338 71.27858
 [9] 70.91016 71.00464
> rowSums(tmp5,na.rm=TRUE)
 [1] 1759.385 1400.635 1344.103 1430.820 1385.124 1374.150 1450.268 1425.572
 [9] 1418.203 1420.093
> rowVars(tmp5,na.rm=TRUE)
 [1] 8094.75931  117.78737   43.88654   97.78862   68.01139   62.48316
 [7]   32.91528   70.78906   68.22350  112.28162
> rowSd(tmp5,na.rm=TRUE)
 [1] 89.970880 10.852989  6.624692  9.888813  8.246902  7.904629  5.737184
 [8]  8.413624  8.259752 10.596302
> rowMax(tmp5,na.rm=TRUE)
 [1] 469.12076  89.91301  80.54195  91.72769  82.15639  84.16583  81.42079
 [8]  87.71081  87.69014  93.99727
> rowMin(tmp5,na.rm=TRUE)
 [1] 57.72441 55.35191 58.15404 54.64518 54.43604 56.32877 59.76004 56.62593
 [9] 58.48021 53.33445
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 110.92500  77.41008  67.85505  69.52944  70.11750  74.01312  69.48820
 [8]  71.12156  68.27701  69.66724  72.21954  69.30767  69.17949  73.53200
[15]  72.08083  69.58176  66.63659  71.31654  68.80887  66.72586
> colSums(tmp5,na.rm=TRUE)
 [1] 1109.2500  774.1008  678.5505  695.2944  701.1750  740.1312  694.8820
 [8]  711.2156  682.7701  696.6724  722.1954  693.0767  691.7949  735.3200
[15]  720.8083  626.2358  666.3659  713.1654  688.0887  667.2586
> colVars(tmp5,na.rm=TRUE)
 [1] 15910.81537   144.44882    62.63297    38.67690    43.50712    58.87552
 [7]    83.89613   101.52249    37.19946    67.79431    57.28974    53.14068
[13]    60.85766    92.79203    96.67824    65.55806    75.29176   106.37194
[19]    49.47764    76.32860
> colSd(tmp5,na.rm=TRUE)
 [1] 126.138081  12.018686   7.914100   6.219076   6.595992   7.673038
 [7]   9.159483  10.075837   6.099136   8.233730   7.568998   7.289765
[13]   7.801132   9.632862   9.832509   8.096793   8.677083  10.313677
[19]   7.034034   8.736624
> colMax(tmp5,na.rm=TRUE)
 [1] 469.12076  93.99727  77.97759  80.54195  85.34780  86.16623  88.30654
 [8]  82.15639  78.76188  84.43996  82.05995  80.37696  86.03500  89.91301
[15]  84.34460  82.73592  78.73878  87.71081  77.45737  82.55867
> colMin(tmp5,na.rm=TRUE)
 [1] 55.48620 57.72441 54.64518 61.37783 63.62880 61.12454 56.62593 55.35191
 [9] 59.37513 58.58985 59.76004 58.76285 58.55350 53.33445 58.48021 56.94999
[17] 54.43604 60.87409 55.86679 56.70685
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1] 87.96923 70.03173 67.20516 71.54101 69.25622      NaN 72.51338 71.27858
 [9] 70.91016 71.00464
> rowSums(tmp5,na.rm=TRUE)
 [1] 1759.385 1400.635 1344.103 1430.820 1385.124    0.000 1450.268 1425.572
 [9] 1418.203 1420.093
> rowVars(tmp5,na.rm=TRUE)
 [1] 8094.75931  117.78737   43.88654   97.78862   68.01139         NA
 [7]   32.91528   70.78906   68.22350  112.28162
> rowSd(tmp5,na.rm=TRUE)
 [1] 89.970880 10.852989  6.624692  9.888813  8.246902        NA  5.737184
 [8]  8.413624  8.259752 10.596302
> rowMax(tmp5,na.rm=TRUE)
 [1] 469.12076  89.91301  80.54195  91.72769  82.15639        NA  81.42079
 [8]  87.71081  87.69014  93.99727
> rowMin(tmp5,na.rm=TRUE)
 [1] 57.72441 55.35191 58.15404 54.64518 54.43604       NA 59.76004 56.62593
 [9] 58.48021 53.33445
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1] 113.89824  77.31862  69.13575  70.24319  69.99107  73.32648  69.26537
 [8]  72.18051  68.15198  70.54191  71.31195  69.04000  69.23894  73.96220
[15]  70.79332       NaN  65.73263  70.25811  68.59361  65.67905
> colSums(tmp5,na.rm=TRUE)
 [1] 1025.0842  695.8676  622.2218  632.1887  629.9197  659.9383  623.3883
 [8]  649.6246  613.3678  634.8771  641.8075  621.3600  623.1504  665.6598
[15]  637.1399    0.0000  591.5936  632.3230  617.3425  591.1114
> colVars(tmp5,na.rm=TRUE)
 [1] 17800.21549   162.41082    52.00998    37.78042    48.76569    60.93086
 [7]    93.82455   101.59734    41.67352    67.66194    55.18409    58.97725
[13]    68.42511   102.30897    90.11425          NA    75.51026   107.06540
[19]    55.14108    73.54177
> colSd(tmp5,na.rm=TRUE)
 [1] 133.417448  12.744050   7.211794   6.146578   6.983244   7.805822
 [7]   9.686308  10.079551   6.455503   8.225688   7.428599   7.679665
[13]   8.271947  10.114789   9.492853         NA   8.689664  10.347241
[19]   7.425704   8.575650
> colMax(tmp5,na.rm=TRUE)
 [1] 469.12076  93.99727  77.97759  80.54195  85.34780  86.16623  88.30654
 [8]  82.15639  78.76188  84.43996  82.05995  80.37696  86.03500  89.91301
[15]  84.34460      -Inf  78.73878  87.71081  77.45737  82.55867
> colMin(tmp5,na.rm=TRUE)
 [1] 55.48620 57.72441 54.64518 61.37783 63.62880 61.12454 56.62593 55.35191
 [9] 59.37513 58.58985 59.76004 58.76285 58.55350 53.33445 58.48021      Inf
[17] 54.43604 60.87409 55.86679 56.70685
> 
> 
> 
> 
> 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] 190.5412 153.5934 215.8567 365.5884 224.1622 213.1549 252.9684 176.1101
 [9] 188.4890 444.8396
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 190.5412 153.5934 215.8567 365.5884 224.1622 213.1549 252.9684 176.1101
 [9] 188.4890 444.8396
> 
> 
> 
> 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]  0.000000e+00  1.136868e-13  2.842171e-14  5.684342e-14  4.263256e-14
 [6]  5.684342e-14  1.136868e-13 -2.842171e-14  1.705303e-13  2.842171e-14
[11] -8.526513e-14  2.842171e-14  8.526513e-14  2.842171e-14  1.705303e-13
[16] -1.421085e-13  8.526513e-14 -1.136868e-13 -2.842171e-14  5.684342e-14
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> ## making sure these things agree
> ##
> ## first when there is no NA
> 
> 
> 
> agree.checks <- function(buff.matrix,r.matrix,err.tol=1e-10){
+ 
+   if (Max(buff.matrix,na.rm=TRUE) != max(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Max")
+   }
+   
+ 
+   if (Min(buff.matrix,na.rm=TRUE) != min(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Min")
+   }
+ 
+ 
+   if (abs(Sum(buff.matrix,na.rm=TRUE)- sum(r.matrix,na.rm=TRUE)) > err.tol){
+ 
+     cat(Sum(buff.matrix,na.rm=TRUE),"\n")
+     cat(sum(r.matrix,na.rm=TRUE),"\n")
+     cat(Sum(buff.matrix,na.rm=TRUE) - sum(r.matrix,na.rm=TRUE),"\n")
+     
+     stop("No agreement in Sum")
+   }
+   
+   if (abs(mean(buff.matrix,na.rm=TRUE) - mean(r.matrix,na.rm=TRUE)) > err.tol){
+     stop("No agreement in mean")
+   }
+   
+   
+   if(abs(Var(buff.matrix,na.rm=TRUE) - var(as.vector(r.matrix),na.rm=TRUE)) > err.tol){
+     stop("No agreement in Var")
+   }
+   
+   
+ 
+   if(any(abs(rowMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,mean,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowMeans")
+   }
+   
+   
+   if(any(abs(colMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,mean,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colMeans")
+   }
+   
+   
+   if(any(abs(rowSums(buff.matrix,na.rm=TRUE)  -  apply(r.matrix,1,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in rowSums")
+   }
+   
+   
+   if(any(abs(colSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colSums")
+   }
+   
+   ### this is to get around the fact that R doesn't like to compute NA on an entire vector of NA when 
+   ### computing variance
+   my.Var <- function(x,na.rm=FALSE){
+    if (all(is.na(x))){
+      return(NA)
+    } else {
+      var(x,na.rm=na.rm)
+    }
+ 
+   }
+   
+   if(any(abs(rowVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+   
+   
+   if(any(abs(colVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+ 
+ 
+   if(any(abs(rowMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+ 
+   if(any(abs(colMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+   
+   
+   if(any(abs(rowMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+   
+ 
+   if(any(abs(colMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+ 
+   if(any(abs(colMedians(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,median,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMedian")
+   }
+ 
+   if(any(abs(colRanges(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,range,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colRanges")
+   }
+ 
+ 
+   
+ }
> 
> 
> 
> 
> 
> 
> 
> 
> 
> for (rep in 1:20){
+   copymatrix <- matrix(rnorm(200,150,15),10,20)
+   
+   tmp5[1:10,1:20] <- copymatrix
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ## now lets assign some NA values and check agreement
+ 
+   which.row <- sample(1:10,1,replace=TRUE)
+   which.col  <- sample(1:20,1,replace=TRUE)
+   
+   cat(which.row," ",which.col,"\n")
+   
+   tmp5[which.row,which.col] <- NA
+   copymatrix[which.row,which.col] <- NA
+   
+   agree.checks(tmp5,copymatrix)
+ 
+   ## make an entire row NA
+   tmp5[which.row,] <- NA
+   copymatrix[which.row,] <- NA
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ### also make an entire col NA
+   tmp5[,which.col] <- NA
+   copymatrix[,which.col] <- NA
+ 
+   agree.checks(tmp5,copymatrix)
+ 
+   ### now make 1 element non NA with NA in the rest of row and column
+ 
+   tmp5[which.row,which.col] <- rnorm(1,150,15)
+   copymatrix[which.row,which.col] <- tmp5[which.row,which.col]
+ 
+   agree.checks(tmp5,copymatrix)
+ }
10   2 
1   15 
8   10 
10   19 
7   16 
6   5 
9   18 
9   12 
3   12 
10   18 
9   20 
7   6 
4   10 
2   15 
4   14 
2   7 
6   11 
9   3 
9   8 
6   20 
There were 50 or more warnings (use warnings() to see the first 50)
> 
> 
> ### now test 1 by n and n by 1 matrix
> 
> 
> err.tol <- 1e-12
> 
> rm(tmp5)
> 
> dataset1 <- rnorm(100)
> dataset2 <- rnorm(100)
> 
> tmp <- createBufferedMatrix(1,100)
> tmp[1,] <- dataset1
> 
> tmp2 <- createBufferedMatrix(100,1)
> tmp2[,1] <- dataset2
> 
> 
> 
> 
> 
> Max(tmp)
[1] 2.965584
> Min(tmp)
[1] -2.035934
> mean(tmp)
[1] 0.04213959
> Sum(tmp)
[1] 4.213959
> Var(tmp)
[1] 0.8649841
> 
> rowMeans(tmp)
[1] 0.04213959
> rowSums(tmp)
[1] 4.213959
> rowVars(tmp)
[1] 0.8649841
> rowSd(tmp)
[1] 0.9300452
> rowMax(tmp)
[1] 2.965584
> rowMin(tmp)
[1] -2.035934
> 
> colMeans(tmp)
  [1]  0.19026728 -1.31628034  0.94732203 -0.95000418  0.89238156  1.69242012
  [7] -0.25578039 -0.95986229  0.59551897 -1.64554127 -0.42908201  0.09320275
 [13]  0.25099316 -1.01483770 -1.16373100  0.16357179 -0.07410876  0.25167323
 [19] -0.15255374  0.55720469  0.66903993 -0.46879873  0.77020140 -0.43105264
 [25] -0.82110234  0.28410602 -1.40837916  0.47907289 -1.67947129  1.10831726
 [31] -0.17041925 -0.37173508 -0.93379110 -1.05709547 -0.82127496  1.11758068
 [37] -1.58082325  0.42781056  0.93646276  0.29109818  0.55416587  0.44942779
 [43] -0.02575963  0.48724840  2.17751191 -0.12256123  0.10138563  2.96558435
 [49]  0.50352238 -0.76625990  0.47297847  0.23292864  1.03343896  1.16124647
 [55] -0.01379102  0.45931913 -1.26099871  0.19598607 -0.47825235 -0.76860908
 [61] -0.19441227 -0.07870726 -1.78398247  1.05630553  0.72637168 -0.80632322
 [67] -0.47622017 -0.02413821  1.57536238  1.40596958  0.74870798  0.53170422
 [73]  0.86155600  1.13936395  1.39931753 -0.13909844  0.75576613  0.98055399
 [79] -1.27212192 -0.49003050  0.23414809  0.20932077 -1.92711283 -0.15899458
 [85] -0.61177139  1.01851107 -0.83672144  1.29629328 -0.18761119 -0.03884008
 [91] -2.03593362  0.45422625 -0.73036639 -0.04154832  0.53319468 -1.06999309
 [97]  0.77367934 -1.00441982  0.23152724  0.81939394
> colSums(tmp)
  [1]  0.19026728 -1.31628034  0.94732203 -0.95000418  0.89238156  1.69242012
  [7] -0.25578039 -0.95986229  0.59551897 -1.64554127 -0.42908201  0.09320275
 [13]  0.25099316 -1.01483770 -1.16373100  0.16357179 -0.07410876  0.25167323
 [19] -0.15255374  0.55720469  0.66903993 -0.46879873  0.77020140 -0.43105264
 [25] -0.82110234  0.28410602 -1.40837916  0.47907289 -1.67947129  1.10831726
 [31] -0.17041925 -0.37173508 -0.93379110 -1.05709547 -0.82127496  1.11758068
 [37] -1.58082325  0.42781056  0.93646276  0.29109818  0.55416587  0.44942779
 [43] -0.02575963  0.48724840  2.17751191 -0.12256123  0.10138563  2.96558435
 [49]  0.50352238 -0.76625990  0.47297847  0.23292864  1.03343896  1.16124647
 [55] -0.01379102  0.45931913 -1.26099871  0.19598607 -0.47825235 -0.76860908
 [61] -0.19441227 -0.07870726 -1.78398247  1.05630553  0.72637168 -0.80632322
 [67] -0.47622017 -0.02413821  1.57536238  1.40596958  0.74870798  0.53170422
 [73]  0.86155600  1.13936395  1.39931753 -0.13909844  0.75576613  0.98055399
 [79] -1.27212192 -0.49003050  0.23414809  0.20932077 -1.92711283 -0.15899458
 [85] -0.61177139  1.01851107 -0.83672144  1.29629328 -0.18761119 -0.03884008
 [91] -2.03593362  0.45422625 -0.73036639 -0.04154832  0.53319468 -1.06999309
 [97]  0.77367934 -1.00441982  0.23152724  0.81939394
> 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.19026728 -1.31628034  0.94732203 -0.95000418  0.89238156  1.69242012
  [7] -0.25578039 -0.95986229  0.59551897 -1.64554127 -0.42908201  0.09320275
 [13]  0.25099316 -1.01483770 -1.16373100  0.16357179 -0.07410876  0.25167323
 [19] -0.15255374  0.55720469  0.66903993 -0.46879873  0.77020140 -0.43105264
 [25] -0.82110234  0.28410602 -1.40837916  0.47907289 -1.67947129  1.10831726
 [31] -0.17041925 -0.37173508 -0.93379110 -1.05709547 -0.82127496  1.11758068
 [37] -1.58082325  0.42781056  0.93646276  0.29109818  0.55416587  0.44942779
 [43] -0.02575963  0.48724840  2.17751191 -0.12256123  0.10138563  2.96558435
 [49]  0.50352238 -0.76625990  0.47297847  0.23292864  1.03343896  1.16124647
 [55] -0.01379102  0.45931913 -1.26099871  0.19598607 -0.47825235 -0.76860908
 [61] -0.19441227 -0.07870726 -1.78398247  1.05630553  0.72637168 -0.80632322
 [67] -0.47622017 -0.02413821  1.57536238  1.40596958  0.74870798  0.53170422
 [73]  0.86155600  1.13936395  1.39931753 -0.13909844  0.75576613  0.98055399
 [79] -1.27212192 -0.49003050  0.23414809  0.20932077 -1.92711283 -0.15899458
 [85] -0.61177139  1.01851107 -0.83672144  1.29629328 -0.18761119 -0.03884008
 [91] -2.03593362  0.45422625 -0.73036639 -0.04154832  0.53319468 -1.06999309
 [97]  0.77367934 -1.00441982  0.23152724  0.81939394
> colMin(tmp)
  [1]  0.19026728 -1.31628034  0.94732203 -0.95000418  0.89238156  1.69242012
  [7] -0.25578039 -0.95986229  0.59551897 -1.64554127 -0.42908201  0.09320275
 [13]  0.25099316 -1.01483770 -1.16373100  0.16357179 -0.07410876  0.25167323
 [19] -0.15255374  0.55720469  0.66903993 -0.46879873  0.77020140 -0.43105264
 [25] -0.82110234  0.28410602 -1.40837916  0.47907289 -1.67947129  1.10831726
 [31] -0.17041925 -0.37173508 -0.93379110 -1.05709547 -0.82127496  1.11758068
 [37] -1.58082325  0.42781056  0.93646276  0.29109818  0.55416587  0.44942779
 [43] -0.02575963  0.48724840  2.17751191 -0.12256123  0.10138563  2.96558435
 [49]  0.50352238 -0.76625990  0.47297847  0.23292864  1.03343896  1.16124647
 [55] -0.01379102  0.45931913 -1.26099871  0.19598607 -0.47825235 -0.76860908
 [61] -0.19441227 -0.07870726 -1.78398247  1.05630553  0.72637168 -0.80632322
 [67] -0.47622017 -0.02413821  1.57536238  1.40596958  0.74870798  0.53170422
 [73]  0.86155600  1.13936395  1.39931753 -0.13909844  0.75576613  0.98055399
 [79] -1.27212192 -0.49003050  0.23414809  0.20932077 -1.92711283 -0.15899458
 [85] -0.61177139  1.01851107 -0.83672144  1.29629328 -0.18761119 -0.03884008
 [91] -2.03593362  0.45422625 -0.73036639 -0.04154832  0.53319468 -1.06999309
 [97]  0.77367934 -1.00441982  0.23152724  0.81939394
> colMedians(tmp)
  [1]  0.19026728 -1.31628034  0.94732203 -0.95000418  0.89238156  1.69242012
  [7] -0.25578039 -0.95986229  0.59551897 -1.64554127 -0.42908201  0.09320275
 [13]  0.25099316 -1.01483770 -1.16373100  0.16357179 -0.07410876  0.25167323
 [19] -0.15255374  0.55720469  0.66903993 -0.46879873  0.77020140 -0.43105264
 [25] -0.82110234  0.28410602 -1.40837916  0.47907289 -1.67947129  1.10831726
 [31] -0.17041925 -0.37173508 -0.93379110 -1.05709547 -0.82127496  1.11758068
 [37] -1.58082325  0.42781056  0.93646276  0.29109818  0.55416587  0.44942779
 [43] -0.02575963  0.48724840  2.17751191 -0.12256123  0.10138563  2.96558435
 [49]  0.50352238 -0.76625990  0.47297847  0.23292864  1.03343896  1.16124647
 [55] -0.01379102  0.45931913 -1.26099871  0.19598607 -0.47825235 -0.76860908
 [61] -0.19441227 -0.07870726 -1.78398247  1.05630553  0.72637168 -0.80632322
 [67] -0.47622017 -0.02413821  1.57536238  1.40596958  0.74870798  0.53170422
 [73]  0.86155600  1.13936395  1.39931753 -0.13909844  0.75576613  0.98055399
 [79] -1.27212192 -0.49003050  0.23414809  0.20932077 -1.92711283 -0.15899458
 [85] -0.61177139  1.01851107 -0.83672144  1.29629328 -0.18761119 -0.03884008
 [91] -2.03593362  0.45422625 -0.73036639 -0.04154832  0.53319468 -1.06999309
 [97]  0.77367934 -1.00441982  0.23152724  0.81939394
> colRanges(tmp)
          [,1]     [,2]     [,3]       [,4]      [,5]    [,6]       [,7]
[1,] 0.1902673 -1.31628 0.947322 -0.9500042 0.8923816 1.69242 -0.2557804
[2,] 0.1902673 -1.31628 0.947322 -0.9500042 0.8923816 1.69242 -0.2557804
           [,8]     [,9]     [,10]     [,11]      [,12]     [,13]     [,14]
[1,] -0.9598623 0.595519 -1.645541 -0.429082 0.09320275 0.2509932 -1.014838
[2,] -0.9598623 0.595519 -1.645541 -0.429082 0.09320275 0.2509932 -1.014838
         [,15]     [,16]       [,17]     [,18]      [,19]     [,20]     [,21]
[1,] -1.163731 0.1635718 -0.07410876 0.2516732 -0.1525537 0.5572047 0.6690399
[2,] -1.163731 0.1635718 -0.07410876 0.2516732 -0.1525537 0.5572047 0.6690399
          [,22]     [,23]      [,24]      [,25]    [,26]     [,27]     [,28]
[1,] -0.4687987 0.7702014 -0.4310526 -0.8211023 0.284106 -1.408379 0.4790729
[2,] -0.4687987 0.7702014 -0.4310526 -0.8211023 0.284106 -1.408379 0.4790729
         [,29]    [,30]      [,31]      [,32]      [,33]     [,34]     [,35]
[1,] -1.679471 1.108317 -0.1704193 -0.3717351 -0.9337911 -1.057095 -0.821275
[2,] -1.679471 1.108317 -0.1704193 -0.3717351 -0.9337911 -1.057095 -0.821275
        [,36]     [,37]     [,38]     [,39]     [,40]     [,41]     [,42]
[1,] 1.117581 -1.580823 0.4278106 0.9364628 0.2910982 0.5541659 0.4494278
[2,] 1.117581 -1.580823 0.4278106 0.9364628 0.2910982 0.5541659 0.4494278
           [,43]     [,44]    [,45]      [,46]     [,47]    [,48]     [,49]
[1,] -0.02575963 0.4872484 2.177512 -0.1225612 0.1013856 2.965584 0.5035224
[2,] -0.02575963 0.4872484 2.177512 -0.1225612 0.1013856 2.965584 0.5035224
          [,50]     [,51]     [,52]    [,53]    [,54]       [,55]     [,56]
[1,] -0.7662599 0.4729785 0.2329286 1.033439 1.161246 -0.01379102 0.4593191
[2,] -0.7662599 0.4729785 0.2329286 1.033439 1.161246 -0.01379102 0.4593191
         [,57]     [,58]      [,59]      [,60]      [,61]       [,62]     [,63]
[1,] -1.260999 0.1959861 -0.4782524 -0.7686091 -0.1944123 -0.07870726 -1.783982
[2,] -1.260999 0.1959861 -0.4782524 -0.7686091 -0.1944123 -0.07870726 -1.783982
        [,64]     [,65]      [,66]      [,67]       [,68]    [,69]   [,70]
[1,] 1.056306 0.7263717 -0.8063232 -0.4762202 -0.02413821 1.575362 1.40597
[2,] 1.056306 0.7263717 -0.8063232 -0.4762202 -0.02413821 1.575362 1.40597
        [,71]     [,72]    [,73]    [,74]    [,75]      [,76]     [,77]
[1,] 0.748708 0.5317042 0.861556 1.139364 1.399318 -0.1390984 0.7557661
[2,] 0.748708 0.5317042 0.861556 1.139364 1.399318 -0.1390984 0.7557661
        [,78]     [,79]      [,80]     [,81]     [,82]     [,83]      [,84]
[1,] 0.980554 -1.272122 -0.4900305 0.2341481 0.2093208 -1.927113 -0.1589946
[2,] 0.980554 -1.272122 -0.4900305 0.2341481 0.2093208 -1.927113 -0.1589946
          [,85]    [,86]      [,87]    [,88]      [,89]       [,90]     [,91]
[1,] -0.6117714 1.018511 -0.8367214 1.296293 -0.1876112 -0.03884008 -2.035934
[2,] -0.6117714 1.018511 -0.8367214 1.296293 -0.1876112 -0.03884008 -2.035934
         [,92]      [,93]       [,94]     [,95]     [,96]     [,97]    [,98]
[1,] 0.4542263 -0.7303664 -0.04154832 0.5331947 -1.069993 0.7736793 -1.00442
[2,] 0.4542263 -0.7303664 -0.04154832 0.5331947 -1.069993 0.7736793 -1.00442
         [,99]    [,100]
[1,] 0.2315272 0.8193939
[2,] 0.2315272 0.8193939
> 
> 
> Max(tmp2)
[1] 2.963708
> Min(tmp2)
[1] -2.852615
> mean(tmp2)
[1] -0.03169857
> Sum(tmp2)
[1] -3.169857
> Var(tmp2)
[1] 0.9921086
> 
> rowMeans(tmp2)
  [1]  0.2847713436 -2.0153559214 -0.6639702688  0.4160145180 -0.6673649256
  [6] -0.4215829440  0.5441629759  0.7135353119  0.0932601441 -0.2564934683
 [11] -1.3858880119  0.0006043232 -0.1926510919 -0.6673640471 -0.3151040131
 [16]  0.0008188910  0.4569874746  1.9264335963 -0.8315494866 -2.8526150041
 [21] -0.1458327270  0.2393049233 -0.3495618895  2.9637075858  0.3208241032
 [26] -0.3135328657 -0.7702180534  0.4099679564 -1.2101072796  0.9817118781
 [31] -1.6435493306 -0.6646897216 -1.1548654558  0.5863248989 -0.4433414451
 [36] -0.1476017412  0.5584339558 -1.2035230615  0.4544609853 -0.3328938782
 [41]  0.5343976085 -0.7531816425  0.9513698386 -0.0883685945  1.1696546196
 [46]  0.2396514304 -1.2743325512  0.6139360047  1.0895515990  1.5332147376
 [51]  0.5866586718  0.4563285038 -0.9079036489  0.1220350160  0.3099436875
 [56]  0.2140528558  0.1359915042  1.9037380743  1.0876811182 -0.5610898293
 [61] -0.2501110293 -0.8886923553 -1.5300216915 -1.1916215581  0.5874025882
 [66]  0.3641960238 -1.2061510442  2.0062065244  0.8504354853  0.4039230867
 [71] -0.1504049569  0.8629438786  0.6467703686 -0.4607937343 -0.5442388188
 [76]  0.6522574462 -1.6800623644 -0.3722714679 -0.3862631296  1.3253536266
 [81]  1.1204912444  0.4781734872 -1.9419793546 -1.3884765159 -0.6595863021
 [86]  1.2271435360  0.5012005644 -0.6152798085 -0.6946921435 -0.9074420487
 [91]  0.4291004093  0.7004435792 -0.0550850030  1.5453314018  0.2456565328
 [96] -1.1602108567 -0.6901092964 -0.7464363026  2.1898970075 -1.4518515749
> rowSums(tmp2)
  [1]  0.2847713436 -2.0153559214 -0.6639702688  0.4160145180 -0.6673649256
  [6] -0.4215829440  0.5441629759  0.7135353119  0.0932601441 -0.2564934683
 [11] -1.3858880119  0.0006043232 -0.1926510919 -0.6673640471 -0.3151040131
 [16]  0.0008188910  0.4569874746  1.9264335963 -0.8315494866 -2.8526150041
 [21] -0.1458327270  0.2393049233 -0.3495618895  2.9637075858  0.3208241032
 [26] -0.3135328657 -0.7702180534  0.4099679564 -1.2101072796  0.9817118781
 [31] -1.6435493306 -0.6646897216 -1.1548654558  0.5863248989 -0.4433414451
 [36] -0.1476017412  0.5584339558 -1.2035230615  0.4544609853 -0.3328938782
 [41]  0.5343976085 -0.7531816425  0.9513698386 -0.0883685945  1.1696546196
 [46]  0.2396514304 -1.2743325512  0.6139360047  1.0895515990  1.5332147376
 [51]  0.5866586718  0.4563285038 -0.9079036489  0.1220350160  0.3099436875
 [56]  0.2140528558  0.1359915042  1.9037380743  1.0876811182 -0.5610898293
 [61] -0.2501110293 -0.8886923553 -1.5300216915 -1.1916215581  0.5874025882
 [66]  0.3641960238 -1.2061510442  2.0062065244  0.8504354853  0.4039230867
 [71] -0.1504049569  0.8629438786  0.6467703686 -0.4607937343 -0.5442388188
 [76]  0.6522574462 -1.6800623644 -0.3722714679 -0.3862631296  1.3253536266
 [81]  1.1204912444  0.4781734872 -1.9419793546 -1.3884765159 -0.6595863021
 [86]  1.2271435360  0.5012005644 -0.6152798085 -0.6946921435 -0.9074420487
 [91]  0.4291004093  0.7004435792 -0.0550850030  1.5453314018  0.2456565328
 [96] -1.1602108567 -0.6901092964 -0.7464363026  2.1898970075 -1.4518515749
> 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.2847713436 -2.0153559214 -0.6639702688  0.4160145180 -0.6673649256
  [6] -0.4215829440  0.5441629759  0.7135353119  0.0932601441 -0.2564934683
 [11] -1.3858880119  0.0006043232 -0.1926510919 -0.6673640471 -0.3151040131
 [16]  0.0008188910  0.4569874746  1.9264335963 -0.8315494866 -2.8526150041
 [21] -0.1458327270  0.2393049233 -0.3495618895  2.9637075858  0.3208241032
 [26] -0.3135328657 -0.7702180534  0.4099679564 -1.2101072796  0.9817118781
 [31] -1.6435493306 -0.6646897216 -1.1548654558  0.5863248989 -0.4433414451
 [36] -0.1476017412  0.5584339558 -1.2035230615  0.4544609853 -0.3328938782
 [41]  0.5343976085 -0.7531816425  0.9513698386 -0.0883685945  1.1696546196
 [46]  0.2396514304 -1.2743325512  0.6139360047  1.0895515990  1.5332147376
 [51]  0.5866586718  0.4563285038 -0.9079036489  0.1220350160  0.3099436875
 [56]  0.2140528558  0.1359915042  1.9037380743  1.0876811182 -0.5610898293
 [61] -0.2501110293 -0.8886923553 -1.5300216915 -1.1916215581  0.5874025882
 [66]  0.3641960238 -1.2061510442  2.0062065244  0.8504354853  0.4039230867
 [71] -0.1504049569  0.8629438786  0.6467703686 -0.4607937343 -0.5442388188
 [76]  0.6522574462 -1.6800623644 -0.3722714679 -0.3862631296  1.3253536266
 [81]  1.1204912444  0.4781734872 -1.9419793546 -1.3884765159 -0.6595863021
 [86]  1.2271435360  0.5012005644 -0.6152798085 -0.6946921435 -0.9074420487
 [91]  0.4291004093  0.7004435792 -0.0550850030  1.5453314018  0.2456565328
 [96] -1.1602108567 -0.6901092964 -0.7464363026  2.1898970075 -1.4518515749
> rowMin(tmp2)
  [1]  0.2847713436 -2.0153559214 -0.6639702688  0.4160145180 -0.6673649256
  [6] -0.4215829440  0.5441629759  0.7135353119  0.0932601441 -0.2564934683
 [11] -1.3858880119  0.0006043232 -0.1926510919 -0.6673640471 -0.3151040131
 [16]  0.0008188910  0.4569874746  1.9264335963 -0.8315494866 -2.8526150041
 [21] -0.1458327270  0.2393049233 -0.3495618895  2.9637075858  0.3208241032
 [26] -0.3135328657 -0.7702180534  0.4099679564 -1.2101072796  0.9817118781
 [31] -1.6435493306 -0.6646897216 -1.1548654558  0.5863248989 -0.4433414451
 [36] -0.1476017412  0.5584339558 -1.2035230615  0.4544609853 -0.3328938782
 [41]  0.5343976085 -0.7531816425  0.9513698386 -0.0883685945  1.1696546196
 [46]  0.2396514304 -1.2743325512  0.6139360047  1.0895515990  1.5332147376
 [51]  0.5866586718  0.4563285038 -0.9079036489  0.1220350160  0.3099436875
 [56]  0.2140528558  0.1359915042  1.9037380743  1.0876811182 -0.5610898293
 [61] -0.2501110293 -0.8886923553 -1.5300216915 -1.1916215581  0.5874025882
 [66]  0.3641960238 -1.2061510442  2.0062065244  0.8504354853  0.4039230867
 [71] -0.1504049569  0.8629438786  0.6467703686 -0.4607937343 -0.5442388188
 [76]  0.6522574462 -1.6800623644 -0.3722714679 -0.3862631296  1.3253536266
 [81]  1.1204912444  0.4781734872 -1.9419793546 -1.3884765159 -0.6595863021
 [86]  1.2271435360  0.5012005644 -0.6152798085 -0.6946921435 -0.9074420487
 [91]  0.4291004093  0.7004435792 -0.0550850030  1.5453314018  0.2456565328
 [96] -1.1602108567 -0.6901092964 -0.7464363026  2.1898970075 -1.4518515749
> 
> colMeans(tmp2)
[1] -0.03169857
> colSums(tmp2)
[1] -3.169857
> colVars(tmp2)
[1] 0.9921086
> colSd(tmp2)
[1] 0.9960465
> colMax(tmp2)
[1] 2.963708
> colMin(tmp2)
[1] -2.852615
> colMedians(tmp2)
[1] -0.02724034
> colRanges(tmp2)
          [,1]
[1,] -2.852615
[2,]  2.963708
> 
> 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.2417015  3.9354390 -4.6870950  1.4361402  3.8837899  0.5913530
 [7]  1.6833877 -0.9456157 -1.3629687  1.2816592
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -1.4125495
[2,] -0.5927228
[3,]  0.3085287
[4,]  0.6139451
[5,]  1.6626949
> 
> rowApply(tmp,sum)
 [1]  3.3050432 -6.6130120  0.2812700  1.9682682  0.6759396  2.7196461
 [7]  2.6162787  1.4044227 -3.0333201  3.7332547
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    2    3   10    8    7   10    5    1    4    10
 [2,]    7   10    7    5   10    8    4    2    7     9
 [3,]    6    1    8    1    2    4    7    3    3     4
 [4,]    9    8    4   10    9    2    2   10    2     2
 [5,]    8    9    9    3    1    7   10    7    8     8
 [6,]   10    4    6    7    6    5    6    8    5     1
 [7,]    3    2    5    4    4    3    9    5   10     6
 [8,]    4    7    1    6    5    6    1    9    1     3
 [9,]    1    5    2    9    8    1    3    6    6     7
[10,]    5    6    3    2    3    9    8    4    9     5
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1] -0.2474639  1.1853509  0.5511503 -2.3237893  1.6829675 -1.5349372
 [7]  1.6272306  0.4571533  4.3450374 -0.5204846  0.4939928  0.1124484
[13] -1.7957027 -3.1075298  1.9280732 -1.4575095 -1.1295585 -1.3132463
[19] -0.5018497 -1.2305550
> colApply(tmp,quantile)[,1]
            [,1]
[1,] -1.20842676
[2,] -0.82211414
[3,]  0.07031117
[4,]  0.55353582
[5,]  1.15923000
> 
> rowApply(tmp,sum)
[1]  0.9352596 -7.0497954 -4.5969728  1.2312737  6.7010127
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]   11    8   18   19    2
[2,]   10   13    6   13   17
[3,]   19    6    9   15    7
[4,]   15    1   11    1   12
[5,]    7    7   17   11   20
> 
> 
> as.matrix(tmp)
            [,1]          [,2]       [,3]        [,4]       [,5]        [,6]
[1,]  0.07031117 -0.0415754313  1.2905560  0.65347110 -0.2437095 -0.07008886
[2,] -0.82211414 -0.0004576132 -1.0256959 -2.06664843 -0.8999444  1.45558308
[3,]  0.55353582 -0.6862027521 -0.4028295 -0.00652652  0.4993436 -1.37045201
[4,]  1.15923000  0.4136142012  0.8117122 -1.46407613  0.2212824 -1.21841450
[5,] -1.20842676  1.4999724530 -0.1225924  0.55999065  2.1059954 -0.33156488
            [,7]       [,8]       [,9]      [,10]      [,11]      [,12]
[1,]  0.61398551  0.3726892  0.9581253 -1.8252948  2.1947516  0.3366280
[2,] -0.30886581  0.9687645  0.7840018  0.9456715 -0.4522316  0.1400842
[3,] -0.25969469 -1.2123373 -0.5878183 -0.6488534  0.2612661  2.0880637
[4,]  0.06493478 -0.6620275  1.8247516  0.4300223 -0.9255819 -1.1271029
[5,]  1.51687079  0.9900645  1.3659770  0.5779697 -0.5842114 -1.3252245
          [,13]        [,14]      [,15]       [,16]      [,17]      [,18]
[1,]  0.8241043 -0.862720146  1.2525481 -1.94227482 -0.7825260 -1.2106466
[2,] -0.5770649 -1.818085267 -1.0912332 -1.28721565 -1.9347450  0.5723034
[3,] -1.9427381  0.558493598  0.1177359  0.08911792  0.3981939 -1.2350758
[4,] -0.3409438 -0.001551152  1.0394284 -0.35864471  0.9940348  0.2848100
[5,]  0.2409398 -0.983666821  0.6095940  2.04150777  0.1954837  0.2753627
           [,19]      [,20]
[1,] -0.05664123 -0.5964333
[2,] -0.66843242  1.0365305
[3,]  0.12462622 -0.9348209
[4,]  1.14250522 -1.0567098
[5,] -1.04390744  0.3208785
> 
> 
> 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 :  648  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.2141046 1.358877 0.6090726 -1.564192 0.01793638 -1.733922 2.170536
         col8     col9    col10      col11        col12     col13     col14
row1 1.257608 1.250171 1.477706 -0.3775431 -0.002882192 0.4052029 -1.628536
          col15    col16      col17     col18    col19     col20
row1 0.04423271 0.659438 -0.3378096 0.6472425 0.273734 0.1005592
> tmp[,"col10"]
          col10
row1  1.4777058
row2 -0.9386238
row3  0.4562046
row4 -1.2113050
row5  1.1924366
> tmp[c("row1","row5"),]
           col1       col2       col3      col4        col5       col6
row1 -0.2141046  1.3588766  0.6090726 -1.564192  0.01793638 -1.7339217
row5 -1.8301047 -0.9209254 -1.7142836  0.910668 -1.00574793  0.1376793
           col7      col8      col9    col10      col11        col12      col13
row1  2.1705363 1.2576083  1.250171 1.477706 -0.3775431 -0.002882192  0.4052029
row5 -0.3420503 0.8980526 -2.515245 1.192437 -1.0061050 -0.727442157 -0.7201310
            col14      col15     col16      col17      col18     col19
row1 -1.628535840 0.04423271 0.6594380 -0.3378096  0.6472425  0.273734
row5 -0.007497708 0.48130494 0.2011714  0.2217638 -0.6221760 -1.819633
         col20
row1 0.1005592
row5 1.3710768
> tmp[,c("col6","col20")]
           col6      col20
row1 -1.7339217  0.1005592
row2  1.4603580  1.6813557
row3  0.5864655 -1.2760388
row4 -0.1838940  0.4418017
row5  0.1376793  1.3710768
> tmp[c("row1","row5"),c("col6","col20")]
           col6     col20
row1 -1.7339217 0.1005592
row5  0.1376793 1.3710768
> 
> 
> 
> 
> tmp["row1",] <- rnorm(20,mean=10)
> tmp[,"col10"] <- rnorm(5,mean=30)
> tmp[c("row1","row5"),] <- rnorm(40,mean=50)
> tmp[,c("col6","col20")] <- rnorm(10,mean=75)
> tmp[c("row1","row5"),c("col6","col20")]  <- rnorm(4,mean=105)
> 
> tmp["row1",]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 50.46091 48.92833 48.78885 51.67295 49.37277 103.9672 49.76403 51.89509
         col9    col10    col11    col12    col13    col14    col15    col16
row1 50.58739 49.06645 50.55225 48.79969 50.50477 49.26081 50.89398 48.73596
        col17    col18    col19   col20
row1 50.98846 50.12037 49.46982 104.614
> tmp[,"col10"]
        col10
row1 49.06645
row2 28.94357
row3 31.24635
row4 28.96373
row5 49.75535
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 50.46091 48.92833 48.78885 51.67295 49.37277 103.9672 49.76403 51.89509
row5 50.10422 49.30027 49.29442 49.62454 50.77756 106.5536 50.93346 49.70632
         col9    col10    col11    col12    col13    col14    col15    col16
row1 50.58739 49.06645 50.55225 48.79969 50.50477 49.26081 50.89398 48.73596
row5 49.05480 49.75535 48.85064 49.54961 49.36505 50.47104 50.77377 49.91501
        col17    col18    col19    col20
row1 50.98846 50.12037 49.46982 104.6140
row5 52.15965 50.18169 49.46050 104.8793
> tmp[,c("col6","col20")]
          col6     col20
row1 103.96723 104.61397
row2  74.16697  76.06003
row3  74.52524  75.62305
row4  74.96903  74.42125
row5 106.55364 104.87928
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 103.9672 104.6140
row5 106.5536 104.8793
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 103.9672 104.6140
row5 106.5536 104.8793
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
          col13
[1,]  0.1601378
[2,] -0.9896502
[3,]  0.7225228
[4,] -0.3140288
[5,] -1.1547431
> tmp[,c("col17","col7")]
           col17        col7
[1,] -0.47045913  0.01069146
[2,] -0.04871238  1.05182984
[3,] -0.69024905 -1.02765540
[4,]  1.18004062 -0.68806555
[5,]  1.13775366  1.19040169
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
             col6      col20
[1,]  2.417792814 -0.4278454
[2,] -1.726810171  0.2040757
[3,] -0.490443747  0.3899344
[4,]  0.007762294 -0.4565841
[5,] -0.528498185 -1.0106926
> subBufferedMatrix(tmp,1,c("col6"))[,1]
         col1
[1,] 2.417793
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
          col6
[1,]  2.417793
[2,] -1.726810
> 
> 
> 
> 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.1433117 0.7711254 -0.8448362 -1.3376279  0.2160665  0.2757061
row1 -0.8273320 0.1769838  0.3668659  0.6425662 -0.7185841 -1.6159259
           [,7]      [,8]       [,9]      [,10]     [,11]     [,12]      [,13]
row3 -0.5084816 1.1315457  1.4526608  0.5980678 2.1298682 1.0757623 -0.2281656
row1  1.8906228 0.2105259 -0.7649097 -2.6842425 0.8687093 0.9240994 -1.2956795
          [,14]    [,15]     [,16]     [,17]       [,18]      [,19]      [,20]
row3 -1.0451553 1.283235 0.4393488 -1.716780  0.07697257 -0.1395741 -0.1253114
row1 -0.9935268 1.656142 0.7645128 -1.190021 -1.04127543 -0.8911829  2.2070088
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
         [,1]      [,2]      [,3]      [,4]      [,5]      [,6]     [,7]
row2 1.027794 -1.495539 -1.117323 -1.368028 0.7493122 0.6080861 -1.29883
         [,8]      [,9]     [,10]
row2 2.186133 -1.762729 0.1623777
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
           [,1]       [,2]        [,3]       [,4]       [,5]      [,6]
row5 -0.3871825 -0.6846363 -0.06225975 -0.4666781 -0.3742603 -1.246386
          [,7]      [,8]      [,9]     [,10]     [,11]      [,12]     [,13]
row5 -0.869992 0.2335033 -1.287075 0.4231696 -1.147674 -0.7142115 0.9645586
         [,14]     [,15]      [,16]       [,17]      [,18]      [,19]    [,20]
row5 -1.943359 0.1283784 -0.3660376 -0.01534121 0.02731391 -0.4321699 1.008792
> 
> 
> 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: 0x600000cd8000>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM4e4042442129"
 [2] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM4e406dd2cbc" 
 [3] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM4e4022a3ee29"
 [4] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM4e403868d783"
 [5] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM4e406b1cf663"
 [6] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM4e403a741485"
 [7] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM4e401aef45be"
 [8] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM4e4052cbcac2"
 [9] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM4e40416cb105"
[10] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM4e4046d9e0d1"
[11] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM4e40a36ddae" 
[12] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM4e401813cfbf"
[13] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM4e403cac10f2"
[14] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM4e40448c9efc"
[15] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM4e406c19d58c"
> 
> 
> ### 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: 0x600000ce0180>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x600000ce0180>
Warning message:
In dir.create(new.directory) :
  '/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x600000ce0180>
> rowMedians(tmp)
  [1]  0.045484448  0.599281767 -0.202229631 -0.079003464  0.305615120
  [6]  0.179772396  0.011061743 -0.662038905  0.150951405  0.190711829
 [11]  0.179524151 -0.067314897  0.196757843  0.051107044 -0.280033980
 [16]  0.375649291 -0.261242104 -0.028483870  0.088431443  0.226795926
 [21] -0.082341655  0.365896979 -0.248400444  0.529609988  0.543721090
 [26] -0.120700787 -0.019925953  0.483913620  0.197870143  0.284111860
 [31]  0.081962671 -0.411970203  0.116765232 -0.396565283  0.090569307
 [36]  0.295096197 -0.349435436 -0.254186212  0.226246858  0.502977514
 [41] -0.492452792  0.474798916 -0.211253930  0.016618478 -0.001793626
 [46]  0.056783455  0.258359304 -0.044113475  0.470244938 -0.239095542
 [51] -0.589717448  0.300377354 -0.324748912  0.618962265  0.108340879
 [56] -0.292619121 -0.204795810  0.247187281  0.178768008 -0.223921500
 [61] -0.085880571  0.168068311  0.021633711  0.266829577  0.437528779
 [66]  0.391961586  0.270823690 -0.238208539 -0.034667361  0.413287227
 [71]  0.032890487  0.585759981 -0.512564699 -0.362342527 -0.146375965
 [76]  0.041291424 -0.389837434 -0.397485147  0.033926892  0.006689695
 [81]  0.303358163 -0.451977437 -0.112131931  0.386538562 -0.428651048
 [86] -0.415480289 -0.007758295 -0.652773593  0.120294141 -0.083308703
 [91]  0.086248122 -0.040087617 -0.245642886 -0.164586033  0.031331681
 [96] -0.115375919 -0.130205584 -0.118926978 -0.335723833 -0.049153886
[101] -0.661217724 -0.076052518  0.466830308 -0.256789790 -0.117666418
[106] -0.728675772 -0.302002813 -0.313608984  0.126120937  0.486334369
[111] -0.215489637 -0.366918543 -0.010886933 -0.596491728 -0.012112803
[116] -0.663338327  0.202107969  0.202976225 -0.101794997  0.372379047
[121]  0.323295601 -0.150091231 -0.360477342  0.287022182  0.604669068
[126]  0.366947620 -0.283739395  0.027426431  0.668792630  0.675389256
[131] -0.208914790 -0.183751677  0.246439056 -0.060030604 -0.097582127
[136]  0.321534010 -0.081892402 -0.692007123 -0.083816941 -0.260477413
[141]  0.015657078  0.597967755 -0.173536588 -0.051444405 -0.276390853
[146] -0.096666153 -0.231656110  0.014958775 -0.206519633  0.148996142
[151] -0.207882462  0.244886968 -0.425079167  0.697802580  0.639919192
[156]  0.134509306 -0.475952054 -0.018701763 -0.398501720  0.196158902
[161]  0.053285093 -0.328968669 -0.076855138 -0.383336511  0.436099250
[166] -0.106516030 -0.078006298 -0.313627293  0.143106346 -0.636229569
[171] -0.686933828 -0.155889411 -0.409841047 -0.104041890 -0.127838420
[176]  0.145584233  0.407474005 -0.096664291  0.040739901  0.154413018
[181]  0.380957461 -0.218333704  0.441534278  0.080553049  0.275224796
[186] -0.729789910 -0.470455984  0.033080792  0.010144902 -0.331488729
[191] -0.045006259  0.118102662  0.301626498  0.462078619  0.269278806
[196] -0.276014870 -0.036195973 -0.513030478 -0.175551363 -0.484268620
[201] -0.283238065 -0.545356143  0.376495731 -0.404067486 -0.069816207
[206] -0.123789400 -0.307109486  0.404272378 -0.162211726 -0.311960979
[211] -0.576786012  0.065553840 -0.039985013 -0.123402181 -0.092124667
[216] -0.212569194 -0.191459427 -0.308820825 -0.080873247 -0.122197949
[221] -0.227820523 -0.002640243  0.163807437 -0.065110243  0.427583995
[226] -0.449524236 -0.369011260 -0.452304062 -0.040041322  0.014556902
> 
> proc.time()
   user  system elapsed 
  2.777  16.204  19.811 

BufferedMatrix.Rcheck/tests/rawCalltesting.Rout


R version 4.5.1 (2025-06-13) -- "Great Square Root"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: x86_64-apple-darwin20

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

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

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

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

Attaching package: 'BufferedMatrix'

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

    colMeans, colSums, rowMeans, rowSums

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

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

<pointer: 0x60000300c000>
> .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: 0x60000300c000>
> .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: 0x60000300c000>
> .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: 0x60000300c000>
> 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: 0x600003078120>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600003078120>
> .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: 0x600003078120>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600003078120>
> .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: 0x600003078120>
> 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: 0x6000030446c0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000030446c0>
> .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: 0x6000030446c0>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x6000030446c0>
> .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: 0x6000030446c0>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x6000030446c0>
> .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: 0x6000030446c0>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x6000030446c0>
> .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: 0x6000030446c0>
> 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: 0x6000030448a0>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x6000030448a0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000030448a0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000030448a0>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile543c3e186971" "BufferedMatrixFile543c467d15a6"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile543c3e186971" "BufferedMatrixFile543c467d15a6"
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x600003044b40>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600003044b40>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x600003044b40>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x600003044b40>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x600003044b40>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x600003044b40>
> .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: 0x60000301c000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x60000301c000>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x60000301c000>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x60000301c000>
> 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: 0x600003018000>
> .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: 0x600003018000>
> rm(P)
> 
> proc.time()
   user  system elapsed 
  0.361   0.165   0.516 

BufferedMatrix.Rcheck/tests/Rcodetesting.Rout


R version 4.5.1 (2025-06-13) -- "Great Square Root"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: x86_64-apple-darwin20

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

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

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

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

Attaching package: 'BufferedMatrix'

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

    colMeans, colSums, rowMeans, rowSums

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

Example timings