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

This page was generated on 2025-12-22 12:04 -0500 (Mon, 22 Dec 2025).

HostnameOSArch (*)R versionInstalled pkgs
nebbiolo2Linux (Ubuntu 24.04.3 LTS)x86_644.5.2 (2025-10-31) -- "[Not] Part in a Rumble" 4883
merida1macOS 12.7.6 Montereyx86_644.5.2 (2025-10-31) -- "[Not] Part in a Rumble" 4673
kjohnson1macOS 13.7.5 Venturaarm644.5.2 Patched (2025-11-04 r88984) -- "[Not] Part in a Rumble" 4607
taishanLinux (openEuler 24.03 LTS)aarch644.5.0 (2025-04-11) -- "How About a Twenty-Six" 4671
Click on any hostname to see more info about the system (e.g. compilers)      (*) as reported by 'uname -p', except on Windows and Mac OS X

Package 257/2361HostnameOS / ArchINSTALLBUILDCHECKBUILD BIN
BufferedMatrix 1.74.0  (landing page)
Ben Bolstad
Snapshot Date: 2025-12-18 13:45 -0500 (Thu, 18 Dec 2025)
git_url: https://git.bioconductor.org/packages/BufferedMatrix
git_branch: RELEASE_3_22
git_last_commit: d2ce144
git_last_commit_date: 2025-10-29 09:58:55 -0500 (Wed, 29 Oct 2025)
nebbiolo2Linux (Ubuntu 24.04.3 LTS) / x86_64  OK    OK    OK  UNNEEDED, same version is already published
merida1macOS 12.7.6 Monterey / x86_64  OK    OK    WARNINGS    OK  UNNEEDED, same version is already published
kjohnson1macOS 13.7.5 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 merida1

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.74.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.74.0.tar.gz
StartedAt: 2025-12-19 01:26:29 -0500 (Fri, 19 Dec 2025)
EndedAt: 2025-12-19 01:27:39 -0500 (Fri, 19 Dec 2025)
EllapsedTime: 70.1 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.74.0.tar.gz
###
##############################################################################
##############################################################################


* using log directory ‘/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck’
* using R version 4.5.2 (2025-10-31)
* 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.74.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.1.sdk’
* checking installed package size ... OK
* checking package directory ... OK
* checking ‘build’ directory ... OK
* checking DESCRIPTION meta-information ... OK
* checking top-level files ... OK
* checking for left-over files ... OK
* checking index information ... OK
* checking package subdirectories ... OK
* checking code files for non-ASCII characters ... OK
* checking R files for syntax errors ... OK
* checking whether the package can be loaded ... OK
* checking whether the package can be loaded with stated dependencies ... OK
* checking whether the package can be unloaded cleanly ... OK
* checking whether the namespace can be loaded with stated dependencies ... OK
* checking whether the namespace can be unloaded cleanly ... OK
* checking dependencies in R code ... OK
* checking S3 generic/method consistency ... OK
* checking replacement functions ... OK
* checking foreign function calls ... OK
* checking R code for possible problems ... OK
* checking Rd files ... NOTE
checkRd: (-1) BufferedMatrix-class.Rd:209: Lost braces; missing escapes or markup?
   209 |     $x^{power}$ elementwise of the matrix
       |        ^
prepare_Rd: createBufferedMatrix.Rd:26: Dropping empty section \keyword
prepare_Rd: createBufferedMatrix.Rd:17-18: Dropping empty section \details
prepare_Rd: createBufferedMatrix.Rd:15-16: Dropping empty section \value
prepare_Rd: createBufferedMatrix.Rd:19-20: Dropping empty section \references
prepare_Rd: createBufferedMatrix.Rd:21-22: Dropping empty section \seealso
prepare_Rd: createBufferedMatrix.Rd:23-24: Dropping empty section \examples
* checking Rd metadata ... OK
* checking Rd cross-references ... OK
* checking for missing documentation entries ... OK
* checking for code/documentation mismatches ... OK
* checking Rd \usage sections ... OK
* checking Rd contents ... OK
* checking for unstated dependencies in examples ... OK
* checking line endings in C/C++/Fortran sources/headers ... OK
* checking compiled code ... NOTE
Note: information on .o files is not available
* checking sizes of PDF files under ‘inst/doc’ ... OK
* checking files in ‘vignettes’ ... OK
* checking examples ... NONE
* checking for unstated dependencies in ‘tests’ ... OK
* checking tests ...
  Running ‘Rcodetesting.R’
  Running ‘c_code_level_tests.R’
  Running ‘objectTesting.R’
  Running ‘rawCalltesting.R’
 OK
* checking for unstated dependencies in vignettes ... OK
* checking package vignettes ... OK
* checking running R code from vignettes ... SKIPPED
* checking re-building of vignette outputs ... SKIPPED
* checking PDF version of manual ... OK
* DONE

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


Installation output

BufferedMatrix.Rcheck/00install.out

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


* installing to library ‘/Library/Frameworks/R.framework/Versions/4.5-x86_64/Resources/library’
* installing *source* package ‘BufferedMatrix’ ...
** this is package ‘BufferedMatrix’ version ‘1.74.0’
** using staged installation
** libs
using C compiler: ‘Apple clang version 14.0.0 (clang-1400.0.29.202)’
using SDK: ‘MacOSX11.3.1.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.2 (2025-10-31) -- "[Not] Part in a Rumble"
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.593   0.211   0.767 

BufferedMatrix.Rcheck/tests/objectTesting.Rout


R version 4.5.2 (2025-10-31) -- "[Not] Part in a Rumble"
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 480714 25.7    1056242 56.5         NA   634451 33.9
Vcells 890616  6.8    8388608 64.0      65536  2108808 16.1
> 
> 
> 
> 
> ##
> ## checking reads
> ##
> 
> tmp2 <- createBufferedMatrix(10,20)
> 
> test.sample <- rnorm(10*20)
> 
> tmp2[1:10,1:20] <- test.sample
> 
> test.matrix <- matrix(test.sample,10,20)
> 
> ## testing reads
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   which.col <- sample(1:20,1)
+   if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> date()
[1] "Fri Dec 19 01:27:02 2025"
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> date()
[1] "Fri Dec 19 01:27:03 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: 0x600002c48000>
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   which.col <- sample(1:20,1)
+   if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,5,replace=TRUE)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> date()
[1] "Fri Dec 19 01:27:08 2025"
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col <- sample(1:20,5,replace=TRUE)
+   if (!all(tmp2[which.row,which.col] == test.matrix[which.row,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> date()
[1] "Fri Dec 19 01:27:11 2025"
> 
> ColMode(tmp2)
<pointer: 0x600002c48000>
> 
> 
> 
> ### Now testing assignments
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+ 
+   new.data <- rnorm(20)
+   tmp2[which.row,] <- new.data
+   test.matrix[which.row,] <- new.data
+   if (rep > 1){
+     if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+   
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   new.data <- rnorm(10)
+   tmp2[,which.col] <- new.data
+   test.matrix[,which.col]<- new.data
+ 
+   if (rep > 1){
+     if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.col <- which.col
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,5,replace=TRUE)
+   new.data <- matrix(rnorm(50),5,10)
+   tmp2[,which.col] <- new.data
+   test.matrix[,which.col]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.col <- which.col
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   new.data <- matrix(rnorm(50),5,10)
+   tmp2[which.row,] <- new.data
+   test.matrix[which.row,]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col  <- sample(1:20,5,replace=TRUE)
+   new.data <- matrix(rnorm(25),5,5)
+   tmp2[which.row,which.col] <- new.data
+   test.matrix[which.row,which.col]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[prev.row,prev.col] == test.matrix[prev.row,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+   prev.col <- which.col
+ }
> 
> 
> 
> 
> ###
> ###
> ### testing some more functions
> ###
> 
> 
> 
> ## duplication function
> tmp5 <- duplicate(tmp2)
> 
> # making sure really did copy everything.
> tmp5[1,1] <- tmp5[1,1] +100.00
> 
> if (tmp5[1,1] == tmp2[1,1]){
+   stop("Problem with duplication")
+ }
> 
> 
> 
> 
> ### testing elementwise applying of functions
> 
> tmp5[1:4,1:4]
           [,1]      [,2]       [,3]       [,4]
[1,] 101.590759 0.1776210 -1.4197846  0.7759952
[2,]   1.176643 0.8792152 -0.6467170 -1.6637325
[3,]  -0.420315 0.6821161  0.8501637  0.7853634
[4,]   1.058595 0.5940618  0.9923699 -1.7412013
> 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,] 101.590759 0.1776210 1.4197846 0.7759952
[2,]   1.176643 0.8792152 0.6467170 1.6637325
[3,]   0.420315 0.6821161 0.8501637 0.7853634
[4,]   1.058595 0.5940618 0.9923699 1.7412013
> 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.0792242 0.4214511 1.1915471 0.8809059
[2,]  1.0847316 0.9376648 0.8041871 1.2898575
[3,]  0.6483171 0.8259032 0.9220432 0.8862073
[4,]  1.0288806 0.7707540 0.9961777 1.3195459
> 
> 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,] 227.38300 29.39213 38.33526 34.58505
[2,]  37.02396 35.25586 33.68859 39.56231
[3,]  31.90349 33.94115 35.07060 34.64744
[4,]  36.34740 33.30160 35.95415 39.93666
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x600002c74180>
> exp(tmp5)
<pointer: 0x600002c74180>
> log(tmp5,2)
<pointer: 0x600002c74180>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 473.2679
> Min(tmp5)
[1] 54.44047
> mean(tmp5)
[1] 72.88929
> Sum(tmp5)
[1] 14577.86
> Var(tmp5)
[1] 881.951
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 89.06715 72.60993 70.17208 70.58980 72.07417 70.04975 69.69514 69.00277
 [9] 71.53366 74.09840
> rowSums(tmp5)
 [1] 1781.343 1452.199 1403.442 1411.796 1441.483 1400.995 1393.903 1380.055
 [9] 1430.673 1481.968
> rowVars(tmp5)
 [1] 8237.39778   47.63857   42.90633   59.23716   79.50772   87.24943
 [7]  100.51349   95.85499   74.13585   84.61729
> rowSd(tmp5)
 [1] 90.760111  6.902070  6.550292  7.696568  8.916710  9.340740 10.025642
 [8]  9.790556  8.610218  9.198766
> rowMax(tmp5)
 [1] 473.26793  82.34376  84.69561  84.17596  87.79495  88.25667  88.01405
 [8]  85.53528  83.70075  86.86867
> rowMin(tmp5)
 [1] 56.70559 57.03499 56.44489 56.53225 57.64684 56.14685 56.26533 54.44047
 [9] 55.73955 54.86589
> 
> colMeans(tmp5)
 [1] 109.99397  70.71834  74.19727  74.85114  71.08001  71.03106  67.32137
 [8]  72.06653  70.96046  68.01634  65.75301  74.42530  69.06929  68.76707
[15]  72.11971  70.95116  72.51071  69.94958  71.52083  72.48257
> colSums(tmp5)
 [1] 1099.9397  707.1834  741.9727  748.5114  710.8001  710.3106  673.2137
 [8]  720.6653  709.6046  680.1634  657.5301  744.2530  690.6929  687.6707
[15]  721.1971  709.5116  725.1071  699.4958  715.2083  724.8257
> colVars(tmp5)
 [1] 16347.58353    51.64650    64.13592    52.38169    55.20325    90.13894
 [7]    64.70764    83.71843    88.75696    99.96523    49.56147    39.53737
[13]    94.84741    98.52733   120.92401    58.90834    68.22429    96.43552
[19]    55.52536    94.69454
> colSd(tmp5)
 [1] 127.857669   7.186550   8.008491   7.237520   7.429889   9.494153
 [7]   8.044106   9.149778   9.421091   9.998262   7.039991   6.287875
[13]   9.738963   9.926094  10.996545   7.675177   8.259800   9.820159
[19]   7.451534   9.731112
> colMax(tmp5)
 [1] 473.26793  81.11082  85.53528  83.12293  86.46414  87.79495  80.74252
 [8]  88.25667  83.32120  84.17596  76.36280  83.23334  83.56031  83.55920
[15]  87.65508  81.66966  84.25661  84.69561  85.32368  88.01405
> colMin(tmp5)
 [1] 58.81066 57.03639 62.17574 61.54284 64.14486 54.44047 56.14685 61.21131
 [9] 56.93640 56.70559 54.86589 63.91779 56.53225 55.58967 55.98568 60.76316
[17] 59.37351 56.26533 61.07098 57.57208
> 
> 
> ### 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]       NA 72.60993 70.17208 70.58980 72.07417 70.04975 69.69514 69.00277
 [9] 71.53366 74.09840
> rowSums(tmp5)
 [1]       NA 1452.199 1403.442 1411.796 1441.483 1400.995 1393.903 1380.055
 [9] 1430.673 1481.968
> rowVars(tmp5)
 [1] 8672.38835   47.63857   42.90633   59.23716   79.50772   87.24943
 [7]  100.51349   95.85499   74.13585   84.61729
> rowSd(tmp5)
 [1] 93.125659  6.902070  6.550292  7.696568  8.916710  9.340740 10.025642
 [8]  9.790556  8.610218  9.198766
> rowMax(tmp5)
 [1]       NA 82.34376 84.69561 84.17596 87.79495 88.25667 88.01405 85.53528
 [9] 83.70075 86.86867
> rowMin(tmp5)
 [1]       NA 57.03499 56.44489 56.53225 57.64684 56.14685 56.26533 54.44047
 [9] 55.73955 54.86589
> 
> colMeans(tmp5)
 [1] 109.99397  70.71834  74.19727  74.85114  71.08001  71.03106  67.32137
 [8]  72.06653  70.96046  68.01634  65.75301  74.42530        NA  68.76707
[15]  72.11971  70.95116  72.51071  69.94958  71.52083  72.48257
> colSums(tmp5)
 [1] 1099.9397  707.1834  741.9727  748.5114  710.8001  710.3106  673.2137
 [8]  720.6653  709.6046  680.1634  657.5301  744.2530        NA  687.6707
[15]  721.1971  709.5116  725.1071  699.4958  715.2083  724.8257
> colVars(tmp5)
 [1] 16347.58353    51.64650    64.13592    52.38169    55.20325    90.13894
 [7]    64.70764    83.71843    88.75696    99.96523    49.56147    39.53737
[13]          NA    98.52733   120.92401    58.90834    68.22429    96.43552
[19]    55.52536    94.69454
> colSd(tmp5)
 [1] 127.857669   7.186550   8.008491   7.237520   7.429889   9.494153
 [7]   8.044106   9.149778   9.421091   9.998262   7.039991   6.287875
[13]         NA   9.926094  10.996545   7.675177   8.259800   9.820159
[19]   7.451534   9.731112
> colMax(tmp5)
 [1] 473.26793  81.11082  85.53528  83.12293  86.46414  87.79495  80.74252
 [8]  88.25667  83.32120  84.17596  76.36280  83.23334        NA  83.55920
[15]  87.65508  81.66966  84.25661  84.69561  85.32368  88.01405
> colMin(tmp5)
 [1] 58.81066 57.03639 62.17574 61.54284 64.14486 54.44047 56.14685 61.21131
 [9] 56.93640 56.70559 54.86589 63.91779       NA 55.58967 55.98568 60.76316
[17] 59.37351 56.26533 61.07098 57.57208
> 
> Max(tmp5,na.rm=TRUE)
[1] 473.2679
> Min(tmp5,na.rm=TRUE)
[1] 54.44047
> mean(tmp5,na.rm=TRUE)
[1] 72.90687
> Sum(tmp5,na.rm=TRUE)
[1] 14508.47
> Var(tmp5,na.rm=TRUE)
[1] 886.3432
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 90.10279 72.60993 70.17208 70.58980 72.07417 70.04975 69.69514 69.00277
 [9] 71.53366 74.09840
> rowSums(tmp5,na.rm=TRUE)
 [1] 1711.953 1452.199 1403.442 1411.796 1441.483 1400.995 1393.903 1380.055
 [9] 1430.673 1481.968
> rowVars(tmp5,na.rm=TRUE)
 [1] 8672.38835   47.63857   42.90633   59.23716   79.50772   87.24943
 [7]  100.51349   95.85499   74.13585   84.61729
> rowSd(tmp5,na.rm=TRUE)
 [1] 93.125659  6.902070  6.550292  7.696568  8.916710  9.340740 10.025642
 [8]  9.790556  8.610218  9.198766
> rowMax(tmp5,na.rm=TRUE)
 [1] 473.26793  82.34376  84.69561  84.17596  87.79495  88.25667  88.01405
 [8]  85.53528  83.70075  86.86867
> rowMin(tmp5,na.rm=TRUE)
 [1] 56.70559 57.03499 56.44489 56.53225 57.64684 56.14685 56.26533 54.44047
 [9] 55.73955 54.86589
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 109.99397  70.71834  74.19727  74.85114  71.08001  71.03106  67.32137
 [8]  72.06653  70.96046  68.01634  65.75301  74.42530  69.03365  68.76707
[15]  72.11971  70.95116  72.51071  69.94958  71.52083  72.48257
> colSums(tmp5,na.rm=TRUE)
 [1] 1099.9397  707.1834  741.9727  748.5114  710.8001  710.3106  673.2137
 [8]  720.6653  709.6046  680.1634  657.5301  744.2530  621.3029  687.6707
[15]  721.1971  709.5116  725.1071  699.4958  715.2083  724.8257
> colVars(tmp5,na.rm=TRUE)
 [1] 16347.58353    51.64650    64.13592    52.38169    55.20325    90.13894
 [7]    64.70764    83.71843    88.75696    99.96523    49.56147    39.53737
[13]   106.68905    98.52733   120.92401    58.90834    68.22429    96.43552
[19]    55.52536    94.69454
> colSd(tmp5,na.rm=TRUE)
 [1] 127.857669   7.186550   8.008491   7.237520   7.429889   9.494153
 [7]   8.044106   9.149778   9.421091   9.998262   7.039991   6.287875
[13]  10.329039   9.926094  10.996545   7.675177   8.259800   9.820159
[19]   7.451534   9.731112
> colMax(tmp5,na.rm=TRUE)
 [1] 473.26793  81.11082  85.53528  83.12293  86.46414  87.79495  80.74252
 [8]  88.25667  83.32120  84.17596  76.36280  83.23334  83.56031  83.55920
[15]  87.65508  81.66966  84.25661  84.69561  85.32368  88.01405
> colMin(tmp5,na.rm=TRUE)
 [1] 58.81066 57.03639 62.17574 61.54284 64.14486 54.44047 56.14685 61.21131
 [9] 56.93640 56.70559 54.86589 63.91779 56.53225 55.58967 55.98568 60.76316
[17] 59.37351 56.26533 61.07098 57.57208
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1]      NaN 72.60993 70.17208 70.58980 72.07417 70.04975 69.69514 69.00277
 [9] 71.53366 74.09840
> rowSums(tmp5,na.rm=TRUE)
 [1]    0.000 1452.199 1403.442 1411.796 1441.483 1400.995 1393.903 1380.055
 [9] 1430.673 1481.968
> rowVars(tmp5,na.rm=TRUE)
 [1]        NA  47.63857  42.90633  59.23716  79.50772  87.24943 100.51349
 [8]  95.85499  74.13585  84.61729
> rowSd(tmp5,na.rm=TRUE)
 [1]        NA  6.902070  6.550292  7.696568  8.916710  9.340740 10.025642
 [8]  9.790556  8.610218  9.198766
> rowMax(tmp5,na.rm=TRUE)
 [1]       NA 82.34376 84.69561 84.17596 87.79495 88.25667 88.01405 85.53528
 [9] 83.70075 86.86867
> rowMin(tmp5,na.rm=TRUE)
 [1]       NA 57.03499 56.44489 56.53225 57.64684 56.14685 56.26533 54.44047
 [9] 55.73955 54.86589
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1] 69.63019 71.77861 73.57588 75.16969 71.12566 70.70399 67.70448 72.01295
 [9] 71.99833 69.27309 66.41198 75.59280      NaN 68.73663 73.25757 71.09597
[17] 71.83832 69.30717 72.68192 70.90602
> colSums(tmp5,na.rm=TRUE)
 [1] 626.6717 646.0075 662.1829 676.5272 640.1310 636.3359 609.3403 648.1165
 [9] 647.9849 623.4578 597.7078 680.3352   0.0000 618.6296 659.3181 639.8637
[17] 646.5449 623.7646 654.1373 638.1542
> colVars(tmp5,na.rm=TRUE)
 [1]  62.14689  45.45528  67.80895  57.78787  62.08021 100.20278  71.14488
 [8]  94.15093  87.73338  94.69241  50.87147  29.14512        NA 110.83282
[15] 121.47381  66.03596  71.66617 103.84727  47.29945  78.56921
> colSd(tmp5,na.rm=TRUE)
 [1]  7.883330  6.742053  8.234619  7.601833  7.879100 10.010134  8.434743
 [8]  9.703140  9.366610  9.731002  7.132424  5.398622        NA 10.527717
[15] 11.021516  8.126251  8.465588 10.190548  6.877459  8.863928
> colMax(tmp5,na.rm=TRUE)
 [1] 78.62095 81.11082 85.53528 83.12293 86.46414 87.79495 80.74252 88.25667
 [9] 83.32120 84.17596 76.36280 83.23334     -Inf 83.55920 87.65508 81.66966
[17] 84.25661 84.69561 85.32368 88.01405
> colMin(tmp5,na.rm=TRUE)
 [1] 58.81066 57.03639 62.17574 61.54284 64.14486 54.44047 56.14685 61.21131
 [9] 56.93640 57.64684 54.86589 68.86559      Inf 55.58967 55.98568 60.76316
[17] 59.37351 56.26533 64.25836 57.57208
> 
> 
> 
> 
> 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] 162.5677 230.6545 179.8144 100.1876 247.0270 146.6647 214.0798 226.3409
 [9] 329.9593 155.0569
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 162.5677 230.6545 179.8144 100.1876 247.0270 146.6647 214.0798 226.3409
 [9] 329.9593 155.0569
> 
> 
> 
> copymatrix <- matrix(rnorm(200,150,15),10,20)
> 
> tmp5[1:10,1:20] <- copymatrix
> which.row <- 1
> which.col  <- 3
> cat(which.row," ",which.col,"\n")
1   3 
> tmp5[which.row,which.col] <- NA
> copymatrix[which.row,which.col] <- NA
> 
> colVars(tmp5,na.rm=TRUE)-apply(copymatrix,2,var,na.rm=TRUE)
 [1] -5.684342e-14 -1.705303e-13 -1.136868e-13  0.000000e+00  0.000000e+00
 [6] -2.842171e-14 -5.684342e-14  0.000000e+00 -5.684342e-14 -1.136868e-13
[11]  2.842171e-14 -2.842171e-14 -1.421085e-14  2.842171e-14  1.705303e-13
[16] -2.842171e-14 -1.989520e-13  0.000000e+00 -2.842171e-14  1.421085e-14
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> ## making sure these things agree
> ##
> ## first when there is no NA
> 
> 
> 
> agree.checks <- function(buff.matrix,r.matrix,err.tol=1e-10){
+ 
+   if (Max(buff.matrix,na.rm=TRUE) != max(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Max")
+   }
+   
+ 
+   if (Min(buff.matrix,na.rm=TRUE) != min(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Min")
+   }
+ 
+ 
+   if (abs(Sum(buff.matrix,na.rm=TRUE)- sum(r.matrix,na.rm=TRUE)) > err.tol){
+ 
+     cat(Sum(buff.matrix,na.rm=TRUE),"\n")
+     cat(sum(r.matrix,na.rm=TRUE),"\n")
+     cat(Sum(buff.matrix,na.rm=TRUE) - sum(r.matrix,na.rm=TRUE),"\n")
+     
+     stop("No agreement in Sum")
+   }
+   
+   if (abs(mean(buff.matrix,na.rm=TRUE) - mean(r.matrix,na.rm=TRUE)) > err.tol){
+     stop("No agreement in mean")
+   }
+   
+   
+   if(abs(Var(buff.matrix,na.rm=TRUE) - var(as.vector(r.matrix),na.rm=TRUE)) > err.tol){
+     stop("No agreement in Var")
+   }
+   
+   
+ 
+   if(any(abs(rowMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,mean,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowMeans")
+   }
+   
+   
+   if(any(abs(colMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,mean,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colMeans")
+   }
+   
+   
+   if(any(abs(rowSums(buff.matrix,na.rm=TRUE)  -  apply(r.matrix,1,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in rowSums")
+   }
+   
+   
+   if(any(abs(colSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colSums")
+   }
+   
+   ### this is to get around the fact that R doesn't like to compute NA on an entire vector of NA when 
+   ### computing variance
+   my.Var <- function(x,na.rm=FALSE){
+    if (all(is.na(x))){
+      return(NA)
+    } else {
+      var(x,na.rm=na.rm)
+    }
+ 
+   }
+   
+   if(any(abs(rowVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+   
+   
+   if(any(abs(colVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+ 
+ 
+   if(any(abs(rowMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+ 
+   if(any(abs(colMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+   
+   
+   if(any(abs(rowMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+   
+ 
+   if(any(abs(colMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+ 
+   if(any(abs(colMedians(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,median,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMedian")
+   }
+ 
+   if(any(abs(colRanges(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,range,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colRanges")
+   }
+ 
+ 
+   
+ }
> 
> 
> 
> 
> 
> 
> 
> 
> 
> for (rep in 1:20){
+   copymatrix <- matrix(rnorm(200,150,15),10,20)
+   
+   tmp5[1:10,1:20] <- copymatrix
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ## now lets assign some NA values and check agreement
+ 
+   which.row <- sample(1:10,1,replace=TRUE)
+   which.col  <- sample(1:20,1,replace=TRUE)
+   
+   cat(which.row," ",which.col,"\n")
+   
+   tmp5[which.row,which.col] <- NA
+   copymatrix[which.row,which.col] <- NA
+   
+   agree.checks(tmp5,copymatrix)
+ 
+   ## make an entire row NA
+   tmp5[which.row,] <- NA
+   copymatrix[which.row,] <- NA
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ### also make an entire col NA
+   tmp5[,which.col] <- NA
+   copymatrix[,which.col] <- NA
+ 
+   agree.checks(tmp5,copymatrix)
+ 
+   ### now make 1 element non NA with NA in the rest of row and column
+ 
+   tmp5[which.row,which.col] <- rnorm(1,150,15)
+   copymatrix[which.row,which.col] <- tmp5[which.row,which.col]
+ 
+   agree.checks(tmp5,copymatrix)
+ }
7   3 
10   12 
9   3 
9   3 
3   19 
3   14 
5   4 
10   10 
4   2 
7   13 
3   14 
7   7 
10   7 
8   9 
3   15 
7   18 
7   6 
6   6 
6   15 
9   13 
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.321653
> Min(tmp)
[1] -2.150416
> mean(tmp)
[1] 0.1752653
> Sum(tmp)
[1] 17.52653
> Var(tmp)
[1] 1.052999
> 
> rowMeans(tmp)
[1] 0.1752653
> rowSums(tmp)
[1] 17.52653
> rowVars(tmp)
[1] 1.052999
> rowSd(tmp)
[1] 1.026157
> rowMax(tmp)
[1] 2.321653
> rowMin(tmp)
[1] -2.150416
> 
> colMeans(tmp)
  [1] -1.307401746  0.639094397 -0.129954407  0.396151303  1.888323182
  [6]  0.809547547  1.384445042  0.344603687 -0.323093353 -1.689767166
 [11] -0.986861383  1.477847893  2.321653155  0.590098456  1.443805341
 [16]  0.900047008  0.447868633 -0.940881160  0.707286293  1.458475168
 [21]  1.198716940 -0.951537689  1.637961847  0.994307356 -0.720041484
 [26] -0.230593534  0.626190802 -0.212508063  0.931091312  1.883031853
 [31]  1.035226245 -0.440562661 -0.226514043 -0.774078328  0.453090153
 [36] -0.294156817  0.589089925 -0.314917424  1.737383394  0.294622988
 [41]  2.232543365  0.706250235 -0.130366449  1.199986038 -0.448841234
 [46]  0.934951571 -0.964157231  1.163809491 -0.669545266 -1.284117241
 [51] -1.758166643  0.879333602 -0.124922467 -0.303097841  1.183595042
 [56] -1.553188738  0.136840734  0.323993580 -0.938751306 -1.530362212
 [61]  0.527228345  0.206678242  1.143261811 -0.159872963 -1.905252376
 [66]  0.755144442  0.312843551  1.474322743 -0.785853755 -0.975841692
 [71] -1.090078122 -0.760552145 -0.731825190 -0.053802015 -0.744464048
 [76] -0.330443288  0.606475603 -0.099420100 -0.577434238  1.741145087
 [81]  0.172867347  1.559406358  1.509104408 -2.150416137  0.906706590
 [86]  1.312238560  0.371857157 -0.757468927  1.350703854 -0.589266764
 [91] -1.872302132 -0.223464661 -1.467141655  0.257450918  0.060747593
 [96]  0.065253990  0.860034360  1.081087073  0.833420540 -0.009425388
> colSums(tmp)
  [1] -1.307401746  0.639094397 -0.129954407  0.396151303  1.888323182
  [6]  0.809547547  1.384445042  0.344603687 -0.323093353 -1.689767166
 [11] -0.986861383  1.477847893  2.321653155  0.590098456  1.443805341
 [16]  0.900047008  0.447868633 -0.940881160  0.707286293  1.458475168
 [21]  1.198716940 -0.951537689  1.637961847  0.994307356 -0.720041484
 [26] -0.230593534  0.626190802 -0.212508063  0.931091312  1.883031853
 [31]  1.035226245 -0.440562661 -0.226514043 -0.774078328  0.453090153
 [36] -0.294156817  0.589089925 -0.314917424  1.737383394  0.294622988
 [41]  2.232543365  0.706250235 -0.130366449  1.199986038 -0.448841234
 [46]  0.934951571 -0.964157231  1.163809491 -0.669545266 -1.284117241
 [51] -1.758166643  0.879333602 -0.124922467 -0.303097841  1.183595042
 [56] -1.553188738  0.136840734  0.323993580 -0.938751306 -1.530362212
 [61]  0.527228345  0.206678242  1.143261811 -0.159872963 -1.905252376
 [66]  0.755144442  0.312843551  1.474322743 -0.785853755 -0.975841692
 [71] -1.090078122 -0.760552145 -0.731825190 -0.053802015 -0.744464048
 [76] -0.330443288  0.606475603 -0.099420100 -0.577434238  1.741145087
 [81]  0.172867347  1.559406358  1.509104408 -2.150416137  0.906706590
 [86]  1.312238560  0.371857157 -0.757468927  1.350703854 -0.589266764
 [91] -1.872302132 -0.223464661 -1.467141655  0.257450918  0.060747593
 [96]  0.065253990  0.860034360  1.081087073  0.833420540 -0.009425388
> 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] -1.307401746  0.639094397 -0.129954407  0.396151303  1.888323182
  [6]  0.809547547  1.384445042  0.344603687 -0.323093353 -1.689767166
 [11] -0.986861383  1.477847893  2.321653155  0.590098456  1.443805341
 [16]  0.900047008  0.447868633 -0.940881160  0.707286293  1.458475168
 [21]  1.198716940 -0.951537689  1.637961847  0.994307356 -0.720041484
 [26] -0.230593534  0.626190802 -0.212508063  0.931091312  1.883031853
 [31]  1.035226245 -0.440562661 -0.226514043 -0.774078328  0.453090153
 [36] -0.294156817  0.589089925 -0.314917424  1.737383394  0.294622988
 [41]  2.232543365  0.706250235 -0.130366449  1.199986038 -0.448841234
 [46]  0.934951571 -0.964157231  1.163809491 -0.669545266 -1.284117241
 [51] -1.758166643  0.879333602 -0.124922467 -0.303097841  1.183595042
 [56] -1.553188738  0.136840734  0.323993580 -0.938751306 -1.530362212
 [61]  0.527228345  0.206678242  1.143261811 -0.159872963 -1.905252376
 [66]  0.755144442  0.312843551  1.474322743 -0.785853755 -0.975841692
 [71] -1.090078122 -0.760552145 -0.731825190 -0.053802015 -0.744464048
 [76] -0.330443288  0.606475603 -0.099420100 -0.577434238  1.741145087
 [81]  0.172867347  1.559406358  1.509104408 -2.150416137  0.906706590
 [86]  1.312238560  0.371857157 -0.757468927  1.350703854 -0.589266764
 [91] -1.872302132 -0.223464661 -1.467141655  0.257450918  0.060747593
 [96]  0.065253990  0.860034360  1.081087073  0.833420540 -0.009425388
> colMin(tmp)
  [1] -1.307401746  0.639094397 -0.129954407  0.396151303  1.888323182
  [6]  0.809547547  1.384445042  0.344603687 -0.323093353 -1.689767166
 [11] -0.986861383  1.477847893  2.321653155  0.590098456  1.443805341
 [16]  0.900047008  0.447868633 -0.940881160  0.707286293  1.458475168
 [21]  1.198716940 -0.951537689  1.637961847  0.994307356 -0.720041484
 [26] -0.230593534  0.626190802 -0.212508063  0.931091312  1.883031853
 [31]  1.035226245 -0.440562661 -0.226514043 -0.774078328  0.453090153
 [36] -0.294156817  0.589089925 -0.314917424  1.737383394  0.294622988
 [41]  2.232543365  0.706250235 -0.130366449  1.199986038 -0.448841234
 [46]  0.934951571 -0.964157231  1.163809491 -0.669545266 -1.284117241
 [51] -1.758166643  0.879333602 -0.124922467 -0.303097841  1.183595042
 [56] -1.553188738  0.136840734  0.323993580 -0.938751306 -1.530362212
 [61]  0.527228345  0.206678242  1.143261811 -0.159872963 -1.905252376
 [66]  0.755144442  0.312843551  1.474322743 -0.785853755 -0.975841692
 [71] -1.090078122 -0.760552145 -0.731825190 -0.053802015 -0.744464048
 [76] -0.330443288  0.606475603 -0.099420100 -0.577434238  1.741145087
 [81]  0.172867347  1.559406358  1.509104408 -2.150416137  0.906706590
 [86]  1.312238560  0.371857157 -0.757468927  1.350703854 -0.589266764
 [91] -1.872302132 -0.223464661 -1.467141655  0.257450918  0.060747593
 [96]  0.065253990  0.860034360  1.081087073  0.833420540 -0.009425388
> colMedians(tmp)
  [1] -1.307401746  0.639094397 -0.129954407  0.396151303  1.888323182
  [6]  0.809547547  1.384445042  0.344603687 -0.323093353 -1.689767166
 [11] -0.986861383  1.477847893  2.321653155  0.590098456  1.443805341
 [16]  0.900047008  0.447868633 -0.940881160  0.707286293  1.458475168
 [21]  1.198716940 -0.951537689  1.637961847  0.994307356 -0.720041484
 [26] -0.230593534  0.626190802 -0.212508063  0.931091312  1.883031853
 [31]  1.035226245 -0.440562661 -0.226514043 -0.774078328  0.453090153
 [36] -0.294156817  0.589089925 -0.314917424  1.737383394  0.294622988
 [41]  2.232543365  0.706250235 -0.130366449  1.199986038 -0.448841234
 [46]  0.934951571 -0.964157231  1.163809491 -0.669545266 -1.284117241
 [51] -1.758166643  0.879333602 -0.124922467 -0.303097841  1.183595042
 [56] -1.553188738  0.136840734  0.323993580 -0.938751306 -1.530362212
 [61]  0.527228345  0.206678242  1.143261811 -0.159872963 -1.905252376
 [66]  0.755144442  0.312843551  1.474322743 -0.785853755 -0.975841692
 [71] -1.090078122 -0.760552145 -0.731825190 -0.053802015 -0.744464048
 [76] -0.330443288  0.606475603 -0.099420100 -0.577434238  1.741145087
 [81]  0.172867347  1.559406358  1.509104408 -2.150416137  0.906706590
 [86]  1.312238560  0.371857157 -0.757468927  1.350703854 -0.589266764
 [91] -1.872302132 -0.223464661 -1.467141655  0.257450918  0.060747593
 [96]  0.065253990  0.860034360  1.081087073  0.833420540 -0.009425388
> colRanges(tmp)
          [,1]      [,2]       [,3]      [,4]     [,5]      [,6]     [,7]
[1,] -1.307402 0.6390944 -0.1299544 0.3961513 1.888323 0.8095475 1.384445
[2,] -1.307402 0.6390944 -0.1299544 0.3961513 1.888323 0.8095475 1.384445
          [,8]       [,9]     [,10]      [,11]    [,12]    [,13]     [,14]
[1,] 0.3446037 -0.3230934 -1.689767 -0.9868614 1.477848 2.321653 0.5900985
[2,] 0.3446037 -0.3230934 -1.689767 -0.9868614 1.477848 2.321653 0.5900985
        [,15]    [,16]     [,17]      [,18]     [,19]    [,20]    [,21]
[1,] 1.443805 0.900047 0.4478686 -0.9408812 0.7072863 1.458475 1.198717
[2,] 1.443805 0.900047 0.4478686 -0.9408812 0.7072863 1.458475 1.198717
          [,22]    [,23]     [,24]      [,25]      [,26]     [,27]      [,28]
[1,] -0.9515377 1.637962 0.9943074 -0.7200415 -0.2305935 0.6261908 -0.2125081
[2,] -0.9515377 1.637962 0.9943074 -0.7200415 -0.2305935 0.6261908 -0.2125081
         [,29]    [,30]    [,31]      [,32]     [,33]      [,34]     [,35]
[1,] 0.9310913 1.883032 1.035226 -0.4405627 -0.226514 -0.7740783 0.4530902
[2,] 0.9310913 1.883032 1.035226 -0.4405627 -0.226514 -0.7740783 0.4530902
          [,36]     [,37]      [,38]    [,39]    [,40]    [,41]     [,42]
[1,] -0.2941568 0.5890899 -0.3149174 1.737383 0.294623 2.232543 0.7062502
[2,] -0.2941568 0.5890899 -0.3149174 1.737383 0.294623 2.232543 0.7062502
          [,43]    [,44]      [,45]     [,46]      [,47]    [,48]      [,49]
[1,] -0.1303664 1.199986 -0.4488412 0.9349516 -0.9641572 1.163809 -0.6695453
[2,] -0.1303664 1.199986 -0.4488412 0.9349516 -0.9641572 1.163809 -0.6695453
         [,50]     [,51]     [,52]      [,53]      [,54]    [,55]     [,56]
[1,] -1.284117 -1.758167 0.8793336 -0.1249225 -0.3030978 1.183595 -1.553189
[2,] -1.284117 -1.758167 0.8793336 -0.1249225 -0.3030978 1.183595 -1.553189
         [,57]     [,58]      [,59]     [,60]     [,61]     [,62]    [,63]
[1,] 0.1368407 0.3239936 -0.9387513 -1.530362 0.5272283 0.2066782 1.143262
[2,] 0.1368407 0.3239936 -0.9387513 -1.530362 0.5272283 0.2066782 1.143262
         [,64]     [,65]     [,66]     [,67]    [,68]      [,69]      [,70]
[1,] -0.159873 -1.905252 0.7551444 0.3128436 1.474323 -0.7858538 -0.9758417
[2,] -0.159873 -1.905252 0.7551444 0.3128436 1.474323 -0.7858538 -0.9758417
         [,71]      [,72]      [,73]       [,74]     [,75]      [,76]     [,77]
[1,] -1.090078 -0.7605521 -0.7318252 -0.05380202 -0.744464 -0.3304433 0.6064756
[2,] -1.090078 -0.7605521 -0.7318252 -0.05380202 -0.744464 -0.3304433 0.6064756
          [,78]      [,79]    [,80]     [,81]    [,82]    [,83]     [,84]
[1,] -0.0994201 -0.5774342 1.741145 0.1728673 1.559406 1.509104 -2.150416
[2,] -0.0994201 -0.5774342 1.741145 0.1728673 1.559406 1.509104 -2.150416
         [,85]    [,86]     [,87]      [,88]    [,89]      [,90]     [,91]
[1,] 0.9067066 1.312239 0.3718572 -0.7574689 1.350704 -0.5892668 -1.872302
[2,] 0.9067066 1.312239 0.3718572 -0.7574689 1.350704 -0.5892668 -1.872302
          [,92]     [,93]     [,94]      [,95]      [,96]     [,97]    [,98]
[1,] -0.2234647 -1.467142 0.2574509 0.06074759 0.06525399 0.8600344 1.081087
[2,] -0.2234647 -1.467142 0.2574509 0.06074759 0.06525399 0.8600344 1.081087
         [,99]       [,100]
[1,] 0.8334205 -0.009425388
[2,] 0.8334205 -0.009425388
> 
> 
> Max(tmp2)
[1] 2.940129
> Min(tmp2)
[1] -2.748298
> mean(tmp2)
[1] 0.008486725
> Sum(tmp2)
[1] 0.8486725
> Var(tmp2)
[1] 1.037773
> 
> rowMeans(tmp2)
  [1] -0.82325259 -0.05280948  0.68113566  0.40000840  0.93812518  0.53163900
  [7] -1.57956822 -1.58563609  1.00882953  0.18616361  0.47700395 -0.38575143
 [13] -0.57572287  2.17225054  0.54276260 -0.47438488  0.71388905  1.01424651
 [19]  0.12280097 -1.08852162 -1.02140875  0.22710329 -1.46546320 -0.36752655
 [25] -0.65939203 -0.36752737 -0.53803029  0.07910611  2.94012877  2.10012464
 [31] -0.58798340 -0.52514142  0.24185067 -0.14219141  0.59302912 -0.89239710
 [37] -2.74829845 -0.61406290 -0.31039163 -0.87605897  0.11453458 -0.83471026
 [43]  1.06239040 -1.02576043 -0.12947320  0.01647720 -0.87027791  1.88123136
 [49] -0.53340178 -1.54651817 -0.49226783 -0.47100930 -0.80583174  0.80751749
 [55] -0.44491477 -0.10577168  0.98365834  2.20562209  1.69411156 -0.58369676
 [61]  1.85781476 -0.98536529 -1.16953404  0.04011308 -0.71482312 -0.06652342
 [67] -0.29539102  1.49326098  0.88097266  0.06880020  0.44955138  0.48787257
 [73] -0.08774030 -1.25171726 -2.38398007  0.37624602 -0.31741140 -0.96785766
 [79]  0.50795363  0.16709423 -0.53963706 -0.76164644  1.70719049 -0.52580816
 [85]  1.38779243 -1.48592149  1.17987076  0.05720003  0.29166611 -0.95853286
 [91]  1.51771760  1.22874560  0.95249282  0.79456063  0.55065185  0.74024708
 [97] -0.71498598  0.30561421 -0.46806682 -0.71040034
> rowSums(tmp2)
  [1] -0.82325259 -0.05280948  0.68113566  0.40000840  0.93812518  0.53163900
  [7] -1.57956822 -1.58563609  1.00882953  0.18616361  0.47700395 -0.38575143
 [13] -0.57572287  2.17225054  0.54276260 -0.47438488  0.71388905  1.01424651
 [19]  0.12280097 -1.08852162 -1.02140875  0.22710329 -1.46546320 -0.36752655
 [25] -0.65939203 -0.36752737 -0.53803029  0.07910611  2.94012877  2.10012464
 [31] -0.58798340 -0.52514142  0.24185067 -0.14219141  0.59302912 -0.89239710
 [37] -2.74829845 -0.61406290 -0.31039163 -0.87605897  0.11453458 -0.83471026
 [43]  1.06239040 -1.02576043 -0.12947320  0.01647720 -0.87027791  1.88123136
 [49] -0.53340178 -1.54651817 -0.49226783 -0.47100930 -0.80583174  0.80751749
 [55] -0.44491477 -0.10577168  0.98365834  2.20562209  1.69411156 -0.58369676
 [61]  1.85781476 -0.98536529 -1.16953404  0.04011308 -0.71482312 -0.06652342
 [67] -0.29539102  1.49326098  0.88097266  0.06880020  0.44955138  0.48787257
 [73] -0.08774030 -1.25171726 -2.38398007  0.37624602 -0.31741140 -0.96785766
 [79]  0.50795363  0.16709423 -0.53963706 -0.76164644  1.70719049 -0.52580816
 [85]  1.38779243 -1.48592149  1.17987076  0.05720003  0.29166611 -0.95853286
 [91]  1.51771760  1.22874560  0.95249282  0.79456063  0.55065185  0.74024708
 [97] -0.71498598  0.30561421 -0.46806682 -0.71040034
> 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.82325259 -0.05280948  0.68113566  0.40000840  0.93812518  0.53163900
  [7] -1.57956822 -1.58563609  1.00882953  0.18616361  0.47700395 -0.38575143
 [13] -0.57572287  2.17225054  0.54276260 -0.47438488  0.71388905  1.01424651
 [19]  0.12280097 -1.08852162 -1.02140875  0.22710329 -1.46546320 -0.36752655
 [25] -0.65939203 -0.36752737 -0.53803029  0.07910611  2.94012877  2.10012464
 [31] -0.58798340 -0.52514142  0.24185067 -0.14219141  0.59302912 -0.89239710
 [37] -2.74829845 -0.61406290 -0.31039163 -0.87605897  0.11453458 -0.83471026
 [43]  1.06239040 -1.02576043 -0.12947320  0.01647720 -0.87027791  1.88123136
 [49] -0.53340178 -1.54651817 -0.49226783 -0.47100930 -0.80583174  0.80751749
 [55] -0.44491477 -0.10577168  0.98365834  2.20562209  1.69411156 -0.58369676
 [61]  1.85781476 -0.98536529 -1.16953404  0.04011308 -0.71482312 -0.06652342
 [67] -0.29539102  1.49326098  0.88097266  0.06880020  0.44955138  0.48787257
 [73] -0.08774030 -1.25171726 -2.38398007  0.37624602 -0.31741140 -0.96785766
 [79]  0.50795363  0.16709423 -0.53963706 -0.76164644  1.70719049 -0.52580816
 [85]  1.38779243 -1.48592149  1.17987076  0.05720003  0.29166611 -0.95853286
 [91]  1.51771760  1.22874560  0.95249282  0.79456063  0.55065185  0.74024708
 [97] -0.71498598  0.30561421 -0.46806682 -0.71040034
> rowMin(tmp2)
  [1] -0.82325259 -0.05280948  0.68113566  0.40000840  0.93812518  0.53163900
  [7] -1.57956822 -1.58563609  1.00882953  0.18616361  0.47700395 -0.38575143
 [13] -0.57572287  2.17225054  0.54276260 -0.47438488  0.71388905  1.01424651
 [19]  0.12280097 -1.08852162 -1.02140875  0.22710329 -1.46546320 -0.36752655
 [25] -0.65939203 -0.36752737 -0.53803029  0.07910611  2.94012877  2.10012464
 [31] -0.58798340 -0.52514142  0.24185067 -0.14219141  0.59302912 -0.89239710
 [37] -2.74829845 -0.61406290 -0.31039163 -0.87605897  0.11453458 -0.83471026
 [43]  1.06239040 -1.02576043 -0.12947320  0.01647720 -0.87027791  1.88123136
 [49] -0.53340178 -1.54651817 -0.49226783 -0.47100930 -0.80583174  0.80751749
 [55] -0.44491477 -0.10577168  0.98365834  2.20562209  1.69411156 -0.58369676
 [61]  1.85781476 -0.98536529 -1.16953404  0.04011308 -0.71482312 -0.06652342
 [67] -0.29539102  1.49326098  0.88097266  0.06880020  0.44955138  0.48787257
 [73] -0.08774030 -1.25171726 -2.38398007  0.37624602 -0.31741140 -0.96785766
 [79]  0.50795363  0.16709423 -0.53963706 -0.76164644  1.70719049 -0.52580816
 [85]  1.38779243 -1.48592149  1.17987076  0.05720003  0.29166611 -0.95853286
 [91]  1.51771760  1.22874560  0.95249282  0.79456063  0.55065185  0.74024708
 [97] -0.71498598  0.30561421 -0.46806682 -0.71040034
> 
> colMeans(tmp2)
[1] 0.008486725
> colSums(tmp2)
[1] 0.8486725
> colVars(tmp2)
[1] 1.037773
> colSd(tmp2)
[1] 1.018712
> colMax(tmp2)
[1] 2.940129
> colMin(tmp2)
[1] -2.748298
> colMedians(tmp2)
[1] -0.07713186
> colRanges(tmp2)
          [,1]
[1,] -2.748298
[2,]  2.940129
> 
> dataset1 <- matrix(dataset1,1,100)
> 
> agree.checks(tmp,dataset1)
> 
> dataset2 <- matrix(dataset2,100,1)
> agree.checks(tmp2,dataset2)
>   
> 
> tmp <- createBufferedMatrix(10,10)
> 
> tmp[1:10,1:10] <- rnorm(100)
> colApply(tmp,sum)
 [1] -2.8062248  0.6955907 -3.6222790 -2.6812811 -5.3944043  0.8790602
 [7]  1.1758694  0.6586872  5.5471169 -2.4111673
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -1.1860842
[2,] -0.8138021
[3,] -0.3995262
[4,] -0.1528037
[5,]  1.1098492
> 
> rowApply(tmp,sum)
 [1] -3.2283747 -1.4009798  0.8857679  0.5635611 -2.9760426 -2.4216384
 [7]  0.5155262 -2.2663859  2.0552170  0.3143170
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    6    8    8    2    5    2    3    2    3     8
 [2,]    4    5    2    8    3    5    9    5    7    10
 [3,]    3    1    3    4    2    9    6    6    9     1
 [4,]    5    4    6   10    1    3    7    1    5     5
 [5,]    2    7    7    5    9    6    4    3    2     2
 [6,]    9    2   10    3    6    7   10    4    8     3
 [7,]    8    9    1    7    8    8    2    9    1     6
 [8,]    1    3    9    9    4    4    5    8   10     7
 [9,]    7   10    4    6   10   10    8   10    4     4
[10,]   10    6    5    1    7    1    1    7    6     9
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1]  0.2362617 -0.8917595  0.1307598  2.9759154 -0.1626289  4.4978551
 [7]  0.9029694 -3.9086305  0.7983713 -0.5470895  3.3114612  0.5172440
[13] -0.5522014 -1.2005871 -0.1379365  0.9391626 -1.9395217 -1.6509754
[19] -1.8523506 -2.3487373
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -1.1651798
[2,] -0.7469530
[3,] -0.2632947
[4,]  0.5785113
[5,]  1.8331781
> 
> rowApply(tmp,sum)
[1] -5.0860552 -0.1838570  4.4711107 -0.3036482  0.2200321
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]    9   16    2   20    3
[2,]    3    8   19    9    9
[3,]   10    6   15   14   12
[4,]    6   18   13   13   20
[5,]   11   12   16    3    7
> 
> 
> as.matrix(tmp)
           [,1]       [,2]        [,3]       [,4]        [,5]       [,6]
[1,] -0.2632947 -1.4084403 -0.22940756 -0.8659515 -0.09184622  1.3448016
[2,]  0.5785113 -0.1771366 -0.77335076  1.1090558  0.21514241  1.6691171
[3,] -1.1651798  1.2239790  1.09742781  0.6905393  1.11241972  0.2043989
[4,]  1.8331781 -0.2950845  0.10913073 -0.1191408 -1.07801786  1.6497142
[5,] -0.7469530 -0.2350771 -0.07304045  2.1614127 -0.32032694 -0.3701767
           [,7]       [,8]       [,9]      [,10]     [,11]      [,12]
[1,]  1.1383746 -0.8945281  0.8553803  0.3364314 0.3025755  0.3878771
[2,] -0.8163623  1.7252536 -1.7322489 -1.1357687 0.4918383  0.1582000
[3,] -0.6340470 -1.3382217  1.1806220  0.2067270 0.3728853  0.8600995
[4,] -0.1606046 -1.2899020 -0.1451716  0.3974770 0.9947310 -0.6241909
[5,]  1.3756087 -2.1112322  0.6397895 -0.3519561 1.1494312 -0.2647416
           [,13]      [,14]      [,15]      [,16]       [,17]      [,18]
[1,]  0.04697481 -0.7899697 -0.6806033  0.1762108 -0.05593214 -1.3583274
[2,] -0.62847842 -0.1348547  0.3188791 -0.9209705  0.36839808  0.7560049
[3,]  1.21137700  0.1634898 -0.4458980  1.4447084 -0.33357443 -0.0714479
[4,] -1.21503245 -0.3241132 -0.2937361  0.9506445 -0.52538756 -0.7689104
[5,]  0.03295765 -0.1151393  0.9634218 -0.7114306 -1.39302560 -0.2082945
          [,19]      [,20]
[1,] -1.5904662 -1.4459141
[2,]  0.1444299 -1.3995165
[3,] -0.4317162 -0.8774778
[4,] -0.4781473  1.0789156
[5,]  0.5035493  0.2952556
> 
> 
> 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 :  649  bytes.
Disk usage :  200  bytes.
> subBufferedMatrix(tmp,,5:8)
BufferedMatrix object
Matrix size:  5 4 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.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.1809836 1.508203 -0.3859397 0.001747259 0.2165849 0.2677018 -0.2804024
          col8       col9      col10       col11     col12      col13
row1 0.3516732 -0.1346907 -0.5807218 -0.01804171 0.3284782 0.04106396
          col14      col15     col16    col17     col18    col19      col20
row1 -0.9122994 -0.4589064 0.2491822 1.019305 0.2287959 1.113778 -0.2469175
> tmp[,"col10"]
          col10
row1 -0.5807218
row2  0.6022390
row3  0.7263949
row4 -1.4750266
row5 -2.4999892
> tmp[c("row1","row5"),]
           col1      col2       col3        col4       col5       col6
row1  0.1809836 1.5082033 -0.3859397 0.001747259  0.2165849  0.2677018
row5 -2.6399211 0.5685069  0.5722021 1.648651552 -0.4554555 -1.2491774
           col7      col8       col9      col10       col11     col12
row1 -0.2804024 0.3516732 -0.1346907 -0.5807218 -0.01804171 0.3284782
row5 -2.3503540 0.3041236  0.4946788 -2.4999892  1.57578452 0.2323034
           col13      col14      col15      col16      col17      col18
row1  0.04106396 -0.9122994 -0.4589064  0.2491822  1.0193054  0.2287959
row5 -1.49245475  1.2838175 -1.0116781 -1.0454893 -0.2324078 -0.1254575
         col19      col20
row1  1.113778 -0.2469175
row5 -1.105754 -0.6537375
> tmp[,c("col6","col20")]
            col6       col20
row1  0.26770182 -0.24691753
row2 -0.08018925  2.21385282
row3 -0.26811785  0.02657462
row4 -2.16671222 -1.92888185
row5 -1.24917738 -0.65373751
> tmp[c("row1","row5"),c("col6","col20")]
           col6      col20
row1  0.2677018 -0.2469175
row5 -1.2491774 -0.6537375
> 
> 
> 
> 
> 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.7087 52.07237 49.16556 51.6209 48.95692 106.2865 51.50596 51.14401
         col9    col10    col11   col12    col13    col14    col15    col16
row1 50.17554 49.69436 52.16556 49.6194 50.88635 49.72399 50.28416 50.98869
        col17    col18    col19    col20
row1 49.08206 50.36103 50.57656 106.1163
> tmp[,"col10"]
        col10
row1 49.69436
row2 30.55927
row3 29.28857
row4 29.79535
row5 50.02743
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 50.70870 52.07237 49.16556 51.62090 48.95692 106.2865 51.50596 51.14401
row5 49.87172 49.65859 49.01145 52.08763 50.10496 103.5648 50.88942 50.32583
         col9    col10    col11    col12    col13    col14    col15    col16
row1 50.17554 49.69436 52.16556 49.61940 50.88635 49.72399 50.28416 50.98869
row5 51.05638 50.02743 49.45664 49.53463 50.16387 51.07449 48.57419 50.83827
        col17    col18    col19    col20
row1 49.08206 50.36103 50.57656 106.1163
row5 49.92692 51.02571 48.08428 105.3581
> tmp[,c("col6","col20")]
          col6     col20
row1 106.28648 106.11632
row2  76.45623  74.57816
row3  74.83919  75.63636
row4  73.75438  76.78800
row5 103.56481 105.35806
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 106.2865 106.1163
row5 103.5648 105.3581
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 106.2865 106.1163
row5 103.5648 105.3581
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
          col13
[1,]  0.1486419
[2,]  0.5030298
[3,] -0.5509079
[4,]  0.2550898
[5,] -1.7720841
> tmp[,c("col17","col7")]
            col17       col7
[1,] -0.001563347 -0.2704945
[2,] -1.618101314  1.8622026
[3,]  1.650253236 -0.1352364
[4,]  0.948371106 -1.7527284
[5,] -0.081310904 -0.1877688
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
           col6       col20
[1,] -0.6714375 -0.58768959
[2,] -0.8702962  0.49891472
[3,]  0.8446705 -0.55107911
[4,] -0.7996443 -1.15768400
[5,]  0.9664140 -0.08196878
> subBufferedMatrix(tmp,1,c("col6"))[,1]
           col1
[1,] -0.6714375
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
           col6
[1,] -0.6714375
[2,] -0.8702962
> 
> 
> 
> 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.110802  1.075554673  0.9548856  1.55305862 -1.347458 2.8362885
row1 -1.409683 -0.008423584 -0.1386682 -0.03380101  0.434241 0.2907746
           [,7]       [,8]       [,9]       [,10]      [,11]      [,12]
row3  0.2894322 -0.3275868 -1.0138739  0.29160921  1.4649865 -0.7580782
row1 -0.0939031  0.4868109  0.5683475 -0.03957921 -0.2048913 -0.4452685
          [,13]      [,14]      [,15]     [,16]       [,17]     [,18]
row3 -0.4081195  0.8198473 -1.4123908 0.1485123 -1.05632935 0.6617782
row1  0.5279447 -0.9920526 -0.8551573 1.2843934  0.02179672 0.5966148
          [,19]     [,20]
row3  1.2414090 -0.787883
row1 -0.6630901  1.364361
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
          [,1]      [,2]       [,3]       [,4]       [,5]        [,6]      [,7]
row2 0.1905068 0.2679566 -0.9926289 0.08455777 -0.8874866 -0.01591143 0.5749754
         [,8]      [,9]    [,10]
row2 1.298274 0.6112496 1.038823
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
         [,1]     [,2]       [,3]       [,4]      [,5]       [,6]      [,7]
row5 1.072693 1.249004 -0.1084231 -0.4923188 0.3099922 -0.1434894 0.9797026
          [,8]      [,9]     [,10]      [,11]     [,12]      [,13]     [,14]
row5 0.4091051 -1.915734 -2.309113 -0.6736318 -1.824808 -0.7741755 0.3882614
          [,15]     [,16]     [,17]        [,18]      [,19]      [,20]
row5 0.01866385 0.5007359 -1.864449 -0.007270244 -0.1110179 -0.1467337
> 
> 
> 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: 0x600002c64420>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMf88ffefc5c7" 
 [2] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMf88f46a193fd"
 [3] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMf88f19faeb45"
 [4] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMf88f286c0c56"
 [5] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMf88f4d9df6d5"
 [6] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMf88f3db841c2"
 [7] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMf88fbe54736" 
 [8] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMf88f79a63053"
 [9] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMf88fdaed78a" 
[10] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMf88f51c8ac0a"
[11] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMf88f4d96ee78"
[12] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMf88f70023013"
[13] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMf88f1fa268d8"
[14] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMf88f5f914d21"
[15] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMf88f3c5ee28b"
> 
> 
> ### 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: 0x600002c601e0>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x600002c601e0>
Warning message:
In dir.create(new.directory) :
  '/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x600002c601e0>
> rowMedians(tmp)
  [1]  2.916781e-01 -1.018377e-01 -1.719900e-01  3.605938e-01  7.556035e-02
  [6] -8.170958e-02 -3.351520e-01 -3.157663e-02 -4.283413e-01 -8.589926e-01
 [11] -5.837248e-01 -3.567149e-01  2.375677e-02 -1.656579e-01  5.439978e-01
 [16] -1.581551e-01  6.901677e-02 -1.245244e-01 -3.020327e-01 -3.720081e-01
 [21]  3.069328e-01  1.060030e-01 -1.312601e-01 -9.884522e-02  2.803829e-01
 [26] -5.960166e-01  3.143682e-01  4.316278e-01 -2.471061e-01  4.074705e-02
 [31] -1.811084e-01 -3.051384e-01  3.082341e-01 -2.969264e-01 -7.559780e-02
 [36] -2.022049e-01  3.044463e-01 -3.476391e-02  2.488698e-01  7.704623e-02
 [41]  1.392988e-01 -7.021427e-01 -4.085668e-01  1.089480e-01  2.915057e-01
 [46]  2.684436e-01 -1.012124e-01 -9.293763e-02 -9.907092e-02  4.480658e-01
 [51]  9.504414e-02  2.825714e-01 -1.711201e-01  2.294049e-01  1.144828e-01
 [56] -1.604043e-01  4.911217e-02  1.952070e-01  2.629708e-02 -4.686761e-01
 [61]  4.206091e-01  7.103092e-01  5.074280e-01  2.207720e-02  3.102154e-01
 [66] -2.440560e-01  4.827763e-01  6.016793e-01  9.098558e-02  2.083804e-01
 [71] -4.436213e-01 -5.561971e-01 -2.173807e-01  5.236293e-02  4.959813e-01
 [76] -1.350341e-01 -4.431002e-01  3.186208e-01  7.950698e-02 -2.779991e-01
 [81] -5.545713e-01  2.716848e-03  5.854842e-01  1.980223e-01 -4.027005e-01
 [86]  5.434286e-01  3.566003e-01  2.224329e-01  5.271925e-01 -2.978202e-01
 [91]  3.301170e-01  2.948860e-01  4.321434e-01  3.449764e-01  1.592727e-01
 [96] -2.170362e-01  2.180330e-02  2.028472e-01  1.867210e-01  4.627234e-02
[101]  3.099978e-02  2.184630e-01 -1.424245e-01  2.098617e-01 -1.437160e-01
[106] -2.519862e-01 -2.231571e-02 -1.588463e-02 -2.242354e-01 -3.238361e-01
[111] -5.368595e-01  2.028532e-02  7.935409e-01  2.277182e-01 -6.826790e-01
[116]  1.135827e-01 -5.140315e-02 -1.490392e-01  6.951581e-02  4.087576e-01
[121] -3.395655e-01  3.176406e-01  1.724333e-01 -4.732891e-02  1.133203e-01
[126]  3.293520e-01 -1.488471e-01 -1.394642e-01  1.019600e-02  7.575044e-01
[131] -6.259771e-01 -4.875537e-02 -3.384628e-01 -6.049488e-01  3.412824e-02
[136] -2.681042e-01  6.959859e-01  5.216897e-01 -1.050127e-01 -2.243761e-01
[141]  4.929534e-01  1.162118e-01 -3.495430e-01  1.460568e-01 -5.638088e-01
[146]  5.896067e-02  1.444361e-02  8.690454e-02  1.465333e-01  2.750732e-01
[151]  2.584784e-01 -3.194140e-01  4.899141e-01 -3.645591e-01 -2.586513e-01
[156] -3.920065e-02 -6.661186e-02  4.184521e-05  4.169419e-01 -3.983793e-01
[161] -1.937328e-01 -2.907382e-01  4.199651e-01  6.556020e-02 -2.790444e-01
[166]  8.086278e-02  3.351560e-02  9.090697e-02 -4.943367e-01 -1.045209e-03
[171]  9.049623e-02 -4.033698e-01 -5.465546e-02 -5.088486e-03 -1.082137e-01
[176] -5.377743e-01  1.110860e-01 -4.711965e-02  1.567436e-01 -9.966541e-02
[181] -1.631226e-02 -1.719348e-01 -2.967057e-02  2.514733e-01  2.004668e-01
[186]  1.730599e-01 -1.376904e-01  2.061156e-01  1.715343e-01 -1.584427e-01
[191]  8.399728e-02  3.395378e-01 -7.119928e-02 -2.249483e-01 -9.722868e-02
[196]  3.516505e-02  3.818803e-01  5.500124e-01 -3.959198e-02  2.286070e-01
[201] -1.294327e-01  3.727469e-02 -2.429022e-01  2.007117e-01  4.736580e-01
[206]  8.624443e-02 -1.986067e-01 -1.094918e-01 -3.562154e-01  1.189068e-01
[211]  5.223640e-01  1.995141e-01 -1.956440e-01  6.291566e-03 -4.287032e-01
[216]  4.722457e-02 -2.728885e-01 -6.161043e-02  9.722378e-03  2.036836e-01
[221] -4.198544e-01 -1.227672e-01  2.061956e-01  1.590937e-01 -9.509083e-02
[226]  2.445141e-01 -7.372061e-01  1.573794e-01 -5.565167e-01 -4.829407e-02
> 
> proc.time()
   user  system elapsed 
  4.976  18.611  25.358 

BufferedMatrix.Rcheck/tests/rawCalltesting.Rout


R version 4.5.2 (2025-10-31) -- "[Not] Part in a Rumble"
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: 0x600002a60000>
> .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: 0x600002a60000>
> .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: 0x600002a60000>
> .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: 0x600002a60000>
> 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: 0x600002a18000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600002a18000>
> .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: 0x600002a18000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600002a18000>
> .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: 0x600002a18000>
> 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: 0x600002a18180>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600002a18180>
> .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: 0x600002a18180>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x600002a18180>
> .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: 0x600002a18180>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x600002a18180>
> .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: 0x600002a18180>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x600002a18180>
> .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: 0x600002a18180>
> 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: 0x600002a1c000>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x600002a1c000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600002a1c000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600002a1c000>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFilefe1f329782bf" "BufferedMatrixFilefe1f3b588d19"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFilefe1f329782bf" "BufferedMatrixFilefe1f3b588d19"
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x600002a10120>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600002a10120>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x600002a10120>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x600002a10120>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x600002a10120>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x600002a10120>
> .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: 0x600002a680c0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600002a680c0>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x600002a680c0>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x600002a680c0>
> 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: 0x600002a14000>
> .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: 0x600002a14000>
> rm(P)
> 
> proc.time()
   user  system elapsed 
  0.600   0.222   0.929 

BufferedMatrix.Rcheck/tests/Rcodetesting.Rout


R version 4.5.2 (2025-10-31) -- "[Not] Part in a Rumble"
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.574   0.136   0.674 

Example timings