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

This page was generated on 2025-09-13 12:03 -0400 (Sat, 13 Sep 2025).

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


CHECK results for BufferedMatrix on lconway

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

raw results


Summary

Package: BufferedMatrix
Version: 1.73.0
Command: /Library/Frameworks/R.framework/Resources/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/Library/Frameworks/R.framework/Resources/library --no-vignettes --timings BufferedMatrix_1.73.0.tar.gz
StartedAt: 2025-09-12 19:37:11 -0400 (Fri, 12 Sep 2025)
EndedAt: 2025-09-12 19:38:03 -0400 (Fri, 12 Sep 2025)
EllapsedTime: 51.9 seconds
RetCode: 0
Status:   WARNINGS  
CheckDir: BufferedMatrix.Rcheck
Warnings: 1

Command output

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


* using log directory ‘/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck’
* using R version 4.5.1 Patched (2025-09-10 r88807)
* using platform: x86_64-apple-darwin20
* R was compiled by
    Apple clang version 14.0.0 (clang-1400.0.29.202)
    GNU Fortran (GCC) 14.2.0
* running under: macOS Monterey 12.7.6
* using session charset: UTF-8
* using option ‘--no-vignettes’
* checking for file ‘BufferedMatrix/DESCRIPTION’ ... OK
* this is package ‘BufferedMatrix’ version ‘1.73.0’
* checking package namespace information ... OK
* checking package dependencies ... OK
* checking if this is a source package ... OK
* checking if there is a namespace ... OK
* checking for hidden files and directories ... OK
* checking for portable file names ... OK
* checking for sufficient/correct file permissions ... OK
* checking whether package ‘BufferedMatrix’ can be installed ... WARNING
Found the following significant warnings:
  doubleBufferedMatrix.c:1580:7: warning: logical not is only applied to the left hand side of this bitwise operator [-Wlogical-not-parentheses]
See ‘/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/00install.out’ for details.
* used C compiler: ‘Apple clang version 14.0.0 (clang-1400.0.29.202)’
* used SDK: ‘MacOSX11.3.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.73.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.1 Patched (2025-09-10 r88807) -- "Great Square Root"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: x86_64-apple-darwin20

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

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

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

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

Attaching package: 'BufferedMatrix'

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

    colMeans, colSums, rowMeans, rowSums

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

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

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

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

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

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

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

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

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

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

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

[[1]]
[1] 0

> 
> proc.time()
   user  system elapsed 
  0.360   0.166   0.535 

BufferedMatrix.Rcheck/tests/objectTesting.Rout


R version 4.5.1 Patched (2025-09-10 r88807) -- "Great Square Root"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: 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 480848 25.7    1056620 56.5         NA   634462 33.9
Vcells 891079  6.8    8388608 64.0      98304  2108727 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 Sep 12 19:37:36 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 Sep 12 19:37:37 2025"
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,which.col] == test.matrix[which.row,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> 
> 
> RowMode(tmp2)
<pointer: 0x60000297c300>
> 
> 
> 
> 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 Sep 12 19:37:41 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 Sep 12 19:37:43 2025"
> 
> ColMode(tmp2)
<pointer: 0x60000297c300>
> 
> 
> 
> ### Now testing assignments
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+ 
+   new.data <- rnorm(20)
+   tmp2[which.row,] <- new.data
+   test.matrix[which.row,] <- new.data
+   if (rep > 1){
+     if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+   
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   new.data <- rnorm(10)
+   tmp2[,which.col] <- new.data
+   test.matrix[,which.col]<- new.data
+ 
+   if (rep > 1){
+     if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.col <- which.col
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,5,replace=TRUE)
+   new.data <- matrix(rnorm(50),5,10)
+   tmp2[,which.col] <- new.data
+   test.matrix[,which.col]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.col <- which.col
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   new.data <- matrix(rnorm(50),5,10)
+   tmp2[which.row,] <- new.data
+   test.matrix[which.row,]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col  <- sample(1:20,5,replace=TRUE)
+   new.data <- matrix(rnorm(25),5,5)
+   tmp2[which.row,which.col] <- new.data
+   test.matrix[which.row,which.col]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[prev.row,prev.col] == test.matrix[prev.row,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+   prev.col <- which.col
+ }
> 
> 
> 
> 
> ###
> ###
> ### testing some more functions
> ###
> 
> 
> 
> ## duplication function
> tmp5 <- duplicate(tmp2)
> 
> # making sure really did copy everything.
> tmp5[1,1] <- tmp5[1,1] +100.00
> 
> if (tmp5[1,1] == tmp2[1,1]){
+   stop("Problem with duplication")
+ }
> 
> 
> 
> 
> ### testing elementwise applying of functions
> 
> tmp5[1:4,1:4]
           [,1]       [,2]        [,3]       [,4]
[1,] 98.1538562  0.1996289  0.74646549 -1.6986113
[2,] -0.7195211  0.2814573  0.03294259  0.5887308
[3,] -1.1058934 -0.7961109 -0.97077217 -0.9185978
[4,]  2.2976631  0.4848726  0.51234884  0.6030855
> 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,] 98.1538562 0.1996289 0.74646549 1.6986113
[2,]  0.7195211 0.2814573 0.03294259 0.5887308
[3,]  1.1058934 0.7961109 0.97077217 0.9185978
[4,]  2.2976631 0.4848726 0.51234884 0.6030855
> 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,] 9.9072628 0.4467985 0.8639823 1.3033078
[2,] 0.8482459 0.5305255 0.1815009 0.7672880
[3,] 1.0516147 0.8922505 0.9852777 0.9584351
[4,] 1.5158044 0.6963279 0.7157855 0.7765858
> 
> 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,] 222.22648 29.66761 34.38629 39.73169
[2,]  34.20198 30.58671 26.84795 33.26161
[3,]  36.62204 34.71862 35.82355 35.50295
[4,]  42.45571 32.44815 32.67020 33.36894
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x6000029580c0>
> exp(tmp5)
<pointer: 0x6000029580c0>
> log(tmp5,2)
<pointer: 0x6000029580c0>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 462.5353
> Min(tmp5)
[1] 52.51861
> mean(tmp5)
[1] 73.26871
> Sum(tmp5)
[1] 14653.74
> Var(tmp5)
[1] 841.7098
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 92.66730 71.75655 70.99813 74.41812 71.61745 71.41784 73.40825 70.09937
 [9] 69.08559 67.21854
> rowSums(tmp5)
 [1] 1853.346 1435.131 1419.963 1488.362 1432.349 1428.357 1468.165 1401.987
 [9] 1381.712 1344.371
> rowVars(tmp5)
 [1] 7646.34070   76.50745  115.22320   52.84598   60.59342   53.21426
 [7]  112.68834   63.48041   70.97193   84.58128
> rowSd(tmp5)
 [1] 87.443357  8.746854 10.734207  7.269524  7.784178  7.294811 10.615477
 [8]  7.967459  8.424484  9.196808
> rowMax(tmp5)
 [1] 462.53531  81.80070  88.78541  89.65029  89.77953  83.70250  92.50212
 [8]  85.37930  81.79405  94.04364
> rowMin(tmp5)
 [1] 54.13826 52.51861 54.09880 64.41333 55.17950 57.63617 55.33800 58.67425
 [9] 54.33554 57.23838
> 
> colMeans(tmp5)
 [1] 113.93156  62.99117  72.18492  73.52286  73.08034  70.18798  73.31284
 [8]  74.97748  73.25387  68.39451  73.64017  70.64119  70.05092  68.12135
[15]  75.93433  73.95270  64.91727  67.76986  73.96821  70.54073
> colSums(tmp5)
 [1] 1139.3156  629.9117  721.8492  735.2286  730.8034  701.8798  733.1284
 [8]  749.7748  732.5387  683.9451  736.4017  706.4119  700.5092  681.2135
[15]  759.3433  739.5270  649.1727  677.6986  739.6821  705.4073
> colVars(tmp5)
 [1] 15041.76010    22.70392    67.19646    83.41481    54.74136    62.26589
 [7]    89.29805    84.69846    79.26265    91.21372    67.36151    25.16042
[13]    97.46654    59.43926    32.77323   109.90314    68.70475   115.82223
[19]   135.71521    48.99360
> colSd(tmp5)
 [1] 122.644854   4.764863   8.197345   9.133171   7.398740   7.890874
 [7]   9.449764   9.203176   8.902957   9.550588   8.207406   5.016017
[13]   9.872514   7.709686   5.724791  10.483470   8.288833  10.762073
[19]  11.649687   6.999543
> colMax(tmp5)
 [1] 462.53531  72.26225  86.67684  92.50212  80.38495  82.68307  87.59162
 [8]  85.70189  89.65029  85.37930  88.78541  77.77566  86.45233  80.93200
[15]  84.28301  89.77953  78.62520  81.55694  94.04364  81.79405
> colMin(tmp5)
 [1] 65.33423 57.33309 55.88049 62.27512 55.17950 58.67425 57.23838 58.04208
 [9] 62.74432 54.09880 63.49698 62.26130 55.33800 57.63617 66.97679 59.96224
[17] 54.13826 52.51861 55.07286 60.45262
> 
> 
> ### 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 71.75655 70.99813 74.41812 71.61745 71.41784 73.40825 70.09937
 [9] 69.08559 67.21854
> rowSums(tmp5)
 [1]       NA 1435.131 1419.963 1488.362 1432.349 1428.357 1468.165 1401.987
 [9] 1381.712 1344.371
> rowVars(tmp5)
 [1] 8063.08376   76.50745  115.22320   52.84598   60.59342   53.21426
 [7]  112.68834   63.48041   70.97193   84.58128
> rowSd(tmp5)
 [1] 89.794676  8.746854 10.734207  7.269524  7.784178  7.294811 10.615477
 [8]  7.967459  8.424484  9.196808
> rowMax(tmp5)
 [1]       NA 81.80070 88.78541 89.65029 89.77953 83.70250 92.50212 85.37930
 [9] 81.79405 94.04364
> rowMin(tmp5)
 [1]       NA 52.51861 54.09880 64.41333 55.17950 57.63617 55.33800 58.67425
 [9] 54.33554 57.23838
> 
> colMeans(tmp5)
 [1] 113.93156  62.99117  72.18492  73.52286  73.08034  70.18798  73.31284
 [8]  74.97748  73.25387  68.39451  73.64017  70.64119  70.05092        NA
[15]  75.93433  73.95270  64.91727  67.76986  73.96821  70.54073
> colSums(tmp5)
 [1] 1139.3156  629.9117  721.8492  735.2286  730.8034  701.8798  733.1284
 [8]  749.7748  732.5387  683.9451  736.4017  706.4119  700.5092        NA
[15]  759.3433  739.5270  649.1727  677.6986  739.6821  705.4073
> colVars(tmp5)
 [1] 15041.76010    22.70392    67.19646    83.41481    54.74136    62.26589
 [7]    89.29805    84.69846    79.26265    91.21372    67.36151    25.16042
[13]    97.46654          NA    32.77323   109.90314    68.70475   115.82223
[19]   135.71521    48.99360
> colSd(tmp5)
 [1] 122.644854   4.764863   8.197345   9.133171   7.398740   7.890874
 [7]   9.449764   9.203176   8.902957   9.550588   8.207406   5.016017
[13]   9.872514         NA   5.724791  10.483470   8.288833  10.762073
[19]  11.649687   6.999543
> colMax(tmp5)
 [1] 462.53531  72.26225  86.67684  92.50212  80.38495  82.68307  87.59162
 [8]  85.70189  89.65029  85.37930  88.78541  77.77566  86.45233        NA
[15]  84.28301  89.77953  78.62520  81.55694  94.04364  81.79405
> colMin(tmp5)
 [1] 65.33423 57.33309 55.88049 62.27512 55.17950 58.67425 57.23838 58.04208
 [9] 62.74432 54.09880 63.49698 62.26130 55.33800       NA 66.97679 59.96224
[17] 54.13826 52.51861 55.07286 60.45262
> 
> Max(tmp5,na.rm=TRUE)
[1] 462.5353
> Min(tmp5,na.rm=TRUE)
[1] 52.51861
> mean(tmp5,na.rm=TRUE)
[1] 73.2302
> Sum(tmp5,na.rm=TRUE)
[1] 14572.81
> Var(tmp5,na.rm=TRUE)
[1] 845.6628
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 93.28495 71.75655 70.99813 74.41812 71.61745 71.41784 73.40825 70.09937
 [9] 69.08559 67.21854
> rowSums(tmp5,na.rm=TRUE)
 [1] 1772.414 1435.131 1419.963 1488.362 1432.349 1428.357 1468.165 1401.987
 [9] 1381.712 1344.371
> rowVars(tmp5,na.rm=TRUE)
 [1] 8063.08376   76.50745  115.22320   52.84598   60.59342   53.21426
 [7]  112.68834   63.48041   70.97193   84.58128
> rowSd(tmp5,na.rm=TRUE)
 [1] 89.794676  8.746854 10.734207  7.269524  7.784178  7.294811 10.615477
 [8]  7.967459  8.424484  9.196808
> rowMax(tmp5,na.rm=TRUE)
 [1] 462.53531  81.80070  88.78541  89.65029  89.77953  83.70250  92.50212
 [8]  85.37930  81.79405  94.04364
> rowMin(tmp5,na.rm=TRUE)
 [1] 54.13826 52.51861 54.09880 64.41333 55.17950 57.63617 55.33800 58.67425
 [9] 54.33554 57.23838
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 113.93156  62.99117  72.18492  73.52286  73.08034  70.18798  73.31284
 [8]  74.97748  73.25387  68.39451  73.64017  70.64119  70.05092  66.69794
[15]  75.93433  73.95270  64.91727  67.76986  73.96821  70.54073
> colSums(tmp5,na.rm=TRUE)
 [1] 1139.3156  629.9117  721.8492  735.2286  730.8034  701.8798  733.1284
 [8]  749.7748  732.5387  683.9451  736.4017  706.4119  700.5092  600.2815
[15]  759.3433  739.5270  649.1727  677.6986  739.6821  705.4073
> colVars(tmp5,na.rm=TRUE)
 [1] 15041.76010    22.70392    67.19646    83.41481    54.74136    62.26589
 [7]    89.29805    84.69846    79.26265    91.21372    67.36151    25.16042
[13]    97.46654    44.07573    32.77323   109.90314    68.70475   115.82223
[19]   135.71521    48.99360
> colSd(tmp5,na.rm=TRUE)
 [1] 122.644854   4.764863   8.197345   9.133171   7.398740   7.890874
 [7]   9.449764   9.203176   8.902957   9.550588   8.207406   5.016017
[13]   9.872514   6.638955   5.724791  10.483470   8.288833  10.762073
[19]  11.649687   6.999543
> colMax(tmp5,na.rm=TRUE)
 [1] 462.53531  72.26225  86.67684  92.50212  80.38495  82.68307  87.59162
 [8]  85.70189  89.65029  85.37930  88.78541  77.77566  86.45233  79.77974
[15]  84.28301  89.77953  78.62520  81.55694  94.04364  81.79405
> colMin(tmp5,na.rm=TRUE)
 [1] 65.33423 57.33309 55.88049 62.27512 55.17950 58.67425 57.23838 58.04208
 [9] 62.74432 54.09880 63.49698 62.26130 55.33800 57.63617 66.97679 59.96224
[17] 54.13826 52.51861 55.07286 60.45262
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1]      NaN 71.75655 70.99813 74.41812 71.61745 71.41784 73.40825 70.09937
 [9] 69.08559 67.21854
> rowSums(tmp5,na.rm=TRUE)
 [1]    0.000 1435.131 1419.963 1488.362 1432.349 1428.357 1468.165 1401.987
 [9] 1381.712 1344.371
> rowVars(tmp5,na.rm=TRUE)
 [1]        NA  76.50745 115.22320  52.84598  60.59342  53.21426 112.68834
 [8]  63.48041  70.97193  84.58128
> rowSd(tmp5,na.rm=TRUE)
 [1]        NA  8.746854 10.734207  7.269524  7.784178  7.294811 10.615477
 [8]  7.967459  8.424484  9.196808
> rowMax(tmp5,na.rm=TRUE)
 [1]       NA 81.80070 88.78541 89.65029 89.77953 83.70250 92.50212 85.37930
 [9] 81.79405 94.04364
> rowMin(tmp5,na.rm=TRUE)
 [1]       NA 52.51861 54.09880 64.41333 55.17950 57.63617 55.33800 58.67425
 [9] 54.33554 57.23838
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1] 75.19780 63.12917 72.25319 72.50358 72.85483 68.79963 73.19890 75.88341
 [9] 72.84891 69.24917 73.52551 69.94041 68.87913      NaN 75.00669 74.95282
[17] 66.11494 66.40074 74.14645 70.68306
> colSums(tmp5,na.rm=TRUE)
 [1] 676.7802 568.1625 650.2787 652.5322 655.6935 619.1967 658.7901 682.9507
 [9] 655.6402 623.2425 661.7296 629.4637 619.9122   0.0000 675.0603 674.5754
[17] 595.0345 597.6066 667.3180 636.1476
> colVars(tmp5,na.rm=TRUE)
 [1]  43.56640  25.32769  75.54359  82.15386  61.01192  48.36477 100.31424
 [8]  86.05283  87.32550  94.39788  75.63379  22.78067  94.20251        NA
[15]  27.18925 112.38822  61.15576 109.21193 152.32220  54.88989
> colSd(tmp5,na.rm=TRUE)
 [1]  6.600485  5.032662  8.691582  9.063877  7.811013  6.954479 10.015700
 [8]  9.276466  9.344812  9.715857  8.696769  4.772910  9.705798        NA
[15]  5.214331 10.601331  7.820215 10.450451 12.341888  7.408771
> colMax(tmp5,na.rm=TRUE)
 [1] 88.36599 72.26225 86.67684 92.50212 80.38495 77.16766 87.59162 85.70189
 [9] 89.65029 85.37930 88.78541 77.77566 86.45233     -Inf 81.80070 89.77953
[17] 78.62520 81.55694 94.04364 81.79405
> colMin(tmp5,na.rm=TRUE)
 [1] 65.33423 57.33309 55.88049 62.27512 55.17950 58.67425 57.23838 58.04208
 [9] 62.74432 54.09880 63.49698 62.26130 55.33800      Inf 66.97679 59.96224
[17] 54.33554 52.51861 55.07286 60.45262
> 
> 
> 
> 
> 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] 329.4293 115.1673 252.5531 292.5988 118.1818 163.8868 180.2051 159.9146
 [9] 282.8204 188.6872
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 329.4293 115.1673 252.5531 292.5988 118.1818 163.8868 180.2051 159.9146
 [9] 282.8204 188.6872
> 
> 
> 
> copymatrix <- matrix(rnorm(200,150,15),10,20)
> 
> tmp5[1:10,1:20] <- copymatrix
> which.row <- 1
> which.col  <- 3
> cat(which.row," ",which.col,"\n")
1   3 
> tmp5[which.row,which.col] <- NA
> copymatrix[which.row,which.col] <- NA
> 
> colVars(tmp5,na.rm=TRUE)-apply(copymatrix,2,var,na.rm=TRUE)
 [1]  0.000000e+00 -2.842171e-14  0.000000e+00 -5.684342e-14 -1.705303e-13
 [6]  1.421085e-14  0.000000e+00  0.000000e+00  5.684342e-14  1.421085e-13
[11] -1.421085e-13 -2.842171e-14  0.000000e+00  2.273737e-13 -5.684342e-14
[16] -1.705303e-13  5.684342e-14 -8.526513e-14  0.000000e+00  2.842171e-14
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> ## making sure these things agree
> ##
> ## first when there is no NA
> 
> 
> 
> agree.checks <- function(buff.matrix,r.matrix,err.tol=1e-10){
+ 
+   if (Max(buff.matrix,na.rm=TRUE) != max(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Max")
+   }
+   
+ 
+   if (Min(buff.matrix,na.rm=TRUE) != min(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Min")
+   }
+ 
+ 
+   if (abs(Sum(buff.matrix,na.rm=TRUE)- sum(r.matrix,na.rm=TRUE)) > err.tol){
+ 
+     cat(Sum(buff.matrix,na.rm=TRUE),"\n")
+     cat(sum(r.matrix,na.rm=TRUE),"\n")
+     cat(Sum(buff.matrix,na.rm=TRUE) - sum(r.matrix,na.rm=TRUE),"\n")
+     
+     stop("No agreement in Sum")
+   }
+   
+   if (abs(mean(buff.matrix,na.rm=TRUE) - mean(r.matrix,na.rm=TRUE)) > err.tol){
+     stop("No agreement in mean")
+   }
+   
+   
+   if(abs(Var(buff.matrix,na.rm=TRUE) - var(as.vector(r.matrix),na.rm=TRUE)) > err.tol){
+     stop("No agreement in Var")
+   }
+   
+   
+ 
+   if(any(abs(rowMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,mean,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowMeans")
+   }
+   
+   
+   if(any(abs(colMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,mean,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colMeans")
+   }
+   
+   
+   if(any(abs(rowSums(buff.matrix,na.rm=TRUE)  -  apply(r.matrix,1,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in rowSums")
+   }
+   
+   
+   if(any(abs(colSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colSums")
+   }
+   
+   ### this is to get around the fact that R doesn't like to compute NA on an entire vector of NA when 
+   ### computing variance
+   my.Var <- function(x,na.rm=FALSE){
+    if (all(is.na(x))){
+      return(NA)
+    } else {
+      var(x,na.rm=na.rm)
+    }
+ 
+   }
+   
+   if(any(abs(rowVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+   
+   
+   if(any(abs(colVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+ 
+ 
+   if(any(abs(rowMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+ 
+   if(any(abs(colMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+   
+   
+   if(any(abs(rowMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+   
+ 
+   if(any(abs(colMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+ 
+   if(any(abs(colMedians(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,median,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMedian")
+   }
+ 
+   if(any(abs(colRanges(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,range,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colRanges")
+   }
+ 
+ 
+   
+ }
> 
> 
> 
> 
> 
> 
> 
> 
> 
> for (rep in 1:20){
+   copymatrix <- matrix(rnorm(200,150,15),10,20)
+   
+   tmp5[1:10,1:20] <- copymatrix
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ## now lets assign some NA values and check agreement
+ 
+   which.row <- sample(1:10,1,replace=TRUE)
+   which.col  <- sample(1:20,1,replace=TRUE)
+   
+   cat(which.row," ",which.col,"\n")
+   
+   tmp5[which.row,which.col] <- NA
+   copymatrix[which.row,which.col] <- NA
+   
+   agree.checks(tmp5,copymatrix)
+ 
+   ## make an entire row NA
+   tmp5[which.row,] <- NA
+   copymatrix[which.row,] <- NA
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ### also make an entire col NA
+   tmp5[,which.col] <- NA
+   copymatrix[,which.col] <- NA
+ 
+   agree.checks(tmp5,copymatrix)
+ 
+   ### now make 1 element non NA with NA in the rest of row and column
+ 
+   tmp5[which.row,which.col] <- rnorm(1,150,15)
+   copymatrix[which.row,which.col] <- tmp5[which.row,which.col]
+ 
+   agree.checks(tmp5,copymatrix)
+ }
2   14 
4   2 
7   11 
10   12 
4   19 
6   2 
8   4 
4   6 
3   3 
7   13 
3   17 
1   14 
9   15 
3   14 
8   2 
6   10 
8   13 
5   18 
3   9 
10   15 
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] 1.73907
> Min(tmp)
[1] -3.096465
> mean(tmp)
[1] -0.07739237
> Sum(tmp)
[1] -7.739237
> Var(tmp)
[1] 1.033592
> 
> rowMeans(tmp)
[1] -0.07739237
> rowSums(tmp)
[1] -7.739237
> rowVars(tmp)
[1] 1.033592
> rowSd(tmp)
[1] 1.016657
> rowMax(tmp)
[1] 1.73907
> rowMin(tmp)
[1] -3.096465
> 
> colMeans(tmp)
  [1]  0.6370744932  0.7022167649  0.1922732502 -0.2532261514  0.4504141928
  [6]  0.8761902423 -2.1276120145  0.2312625637  1.7390704300  0.5671206593
 [11] -1.5866709026  0.1360923036 -0.9314187422  0.5186300203 -1.8514317919
 [16] -1.6227340243  0.8101756420 -1.0275673442 -0.6502332394  1.5401367359
 [21]  1.7140391797 -1.8446801151  0.0949631686  0.6363471380  0.0004854572
 [26]  0.1873476880  1.4005530928 -0.1056630725  0.5805746871 -0.4657482123
 [31] -1.4654252367 -1.1176043775 -0.3662394030  0.5704848733 -0.5672855175
 [36] -0.4308834926 -0.4302982526  1.5117344694 -1.1674540040 -1.8914273497
 [41]  0.7154168881 -1.3384856299  1.5144464707  0.4549665225 -1.0923114538
 [46]  0.5062647617  0.6552471082  1.5598640137 -1.4433304582 -0.3202553083
 [51] -0.0925976761 -0.0710150357 -0.8438642449 -0.6038484890 -0.4885955286
 [56] -0.2920212585  0.9762645525  1.2013569055 -0.1139164238  0.7100269438
 [61]  0.7074493566  0.9881074944 -0.1662822332 -1.5625363449  1.1376523990
 [66]  0.4395028093  0.2422288444  0.7207223800  0.0860300502  1.6694946507
 [71]  1.3224533465 -1.3521351250 -0.6760428367 -0.5806286396  1.2855074630
 [76]  1.4504176591 -1.8948736294 -1.1369026489  0.3301320353  0.1125496579
 [81]  0.0320199110 -0.3767051949  1.6069011766 -0.5166274269  0.6950113126
 [86] -0.7006667499 -3.0964645907 -1.0160813713  0.5134476824 -0.2009591769
 [91]  0.0342769231 -1.0203522322 -0.8520785854 -0.6565040052 -1.0211677936
 [96] -0.2043066142  0.3400897369  0.5111016942 -1.0805421273 -0.6396725820
> colSums(tmp)
  [1]  0.6370744932  0.7022167649  0.1922732502 -0.2532261514  0.4504141928
  [6]  0.8761902423 -2.1276120145  0.2312625637  1.7390704300  0.5671206593
 [11] -1.5866709026  0.1360923036 -0.9314187422  0.5186300203 -1.8514317919
 [16] -1.6227340243  0.8101756420 -1.0275673442 -0.6502332394  1.5401367359
 [21]  1.7140391797 -1.8446801151  0.0949631686  0.6363471380  0.0004854572
 [26]  0.1873476880  1.4005530928 -0.1056630725  0.5805746871 -0.4657482123
 [31] -1.4654252367 -1.1176043775 -0.3662394030  0.5704848733 -0.5672855175
 [36] -0.4308834926 -0.4302982526  1.5117344694 -1.1674540040 -1.8914273497
 [41]  0.7154168881 -1.3384856299  1.5144464707  0.4549665225 -1.0923114538
 [46]  0.5062647617  0.6552471082  1.5598640137 -1.4433304582 -0.3202553083
 [51] -0.0925976761 -0.0710150357 -0.8438642449 -0.6038484890 -0.4885955286
 [56] -0.2920212585  0.9762645525  1.2013569055 -0.1139164238  0.7100269438
 [61]  0.7074493566  0.9881074944 -0.1662822332 -1.5625363449  1.1376523990
 [66]  0.4395028093  0.2422288444  0.7207223800  0.0860300502  1.6694946507
 [71]  1.3224533465 -1.3521351250 -0.6760428367 -0.5806286396  1.2855074630
 [76]  1.4504176591 -1.8948736294 -1.1369026489  0.3301320353  0.1125496579
 [81]  0.0320199110 -0.3767051949  1.6069011766 -0.5166274269  0.6950113126
 [86] -0.7006667499 -3.0964645907 -1.0160813713  0.5134476824 -0.2009591769
 [91]  0.0342769231 -1.0203522322 -0.8520785854 -0.6565040052 -1.0211677936
 [96] -0.2043066142  0.3400897369  0.5111016942 -1.0805421273 -0.6396725820
> colVars(tmp)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> colSd(tmp)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> colMax(tmp)
  [1]  0.6370744932  0.7022167649  0.1922732502 -0.2532261514  0.4504141928
  [6]  0.8761902423 -2.1276120145  0.2312625637  1.7390704300  0.5671206593
 [11] -1.5866709026  0.1360923036 -0.9314187422  0.5186300203 -1.8514317919
 [16] -1.6227340243  0.8101756420 -1.0275673442 -0.6502332394  1.5401367359
 [21]  1.7140391797 -1.8446801151  0.0949631686  0.6363471380  0.0004854572
 [26]  0.1873476880  1.4005530928 -0.1056630725  0.5805746871 -0.4657482123
 [31] -1.4654252367 -1.1176043775 -0.3662394030  0.5704848733 -0.5672855175
 [36] -0.4308834926 -0.4302982526  1.5117344694 -1.1674540040 -1.8914273497
 [41]  0.7154168881 -1.3384856299  1.5144464707  0.4549665225 -1.0923114538
 [46]  0.5062647617  0.6552471082  1.5598640137 -1.4433304582 -0.3202553083
 [51] -0.0925976761 -0.0710150357 -0.8438642449 -0.6038484890 -0.4885955286
 [56] -0.2920212585  0.9762645525  1.2013569055 -0.1139164238  0.7100269438
 [61]  0.7074493566  0.9881074944 -0.1662822332 -1.5625363449  1.1376523990
 [66]  0.4395028093  0.2422288444  0.7207223800  0.0860300502  1.6694946507
 [71]  1.3224533465 -1.3521351250 -0.6760428367 -0.5806286396  1.2855074630
 [76]  1.4504176591 -1.8948736294 -1.1369026489  0.3301320353  0.1125496579
 [81]  0.0320199110 -0.3767051949  1.6069011766 -0.5166274269  0.6950113126
 [86] -0.7006667499 -3.0964645907 -1.0160813713  0.5134476824 -0.2009591769
 [91]  0.0342769231 -1.0203522322 -0.8520785854 -0.6565040052 -1.0211677936
 [96] -0.2043066142  0.3400897369  0.5111016942 -1.0805421273 -0.6396725820
> colMin(tmp)
  [1]  0.6370744932  0.7022167649  0.1922732502 -0.2532261514  0.4504141928
  [6]  0.8761902423 -2.1276120145  0.2312625637  1.7390704300  0.5671206593
 [11] -1.5866709026  0.1360923036 -0.9314187422  0.5186300203 -1.8514317919
 [16] -1.6227340243  0.8101756420 -1.0275673442 -0.6502332394  1.5401367359
 [21]  1.7140391797 -1.8446801151  0.0949631686  0.6363471380  0.0004854572
 [26]  0.1873476880  1.4005530928 -0.1056630725  0.5805746871 -0.4657482123
 [31] -1.4654252367 -1.1176043775 -0.3662394030  0.5704848733 -0.5672855175
 [36] -0.4308834926 -0.4302982526  1.5117344694 -1.1674540040 -1.8914273497
 [41]  0.7154168881 -1.3384856299  1.5144464707  0.4549665225 -1.0923114538
 [46]  0.5062647617  0.6552471082  1.5598640137 -1.4433304582 -0.3202553083
 [51] -0.0925976761 -0.0710150357 -0.8438642449 -0.6038484890 -0.4885955286
 [56] -0.2920212585  0.9762645525  1.2013569055 -0.1139164238  0.7100269438
 [61]  0.7074493566  0.9881074944 -0.1662822332 -1.5625363449  1.1376523990
 [66]  0.4395028093  0.2422288444  0.7207223800  0.0860300502  1.6694946507
 [71]  1.3224533465 -1.3521351250 -0.6760428367 -0.5806286396  1.2855074630
 [76]  1.4504176591 -1.8948736294 -1.1369026489  0.3301320353  0.1125496579
 [81]  0.0320199110 -0.3767051949  1.6069011766 -0.5166274269  0.6950113126
 [86] -0.7006667499 -3.0964645907 -1.0160813713  0.5134476824 -0.2009591769
 [91]  0.0342769231 -1.0203522322 -0.8520785854 -0.6565040052 -1.0211677936
 [96] -0.2043066142  0.3400897369  0.5111016942 -1.0805421273 -0.6396725820
> colMedians(tmp)
  [1]  0.6370744932  0.7022167649  0.1922732502 -0.2532261514  0.4504141928
  [6]  0.8761902423 -2.1276120145  0.2312625637  1.7390704300  0.5671206593
 [11] -1.5866709026  0.1360923036 -0.9314187422  0.5186300203 -1.8514317919
 [16] -1.6227340243  0.8101756420 -1.0275673442 -0.6502332394  1.5401367359
 [21]  1.7140391797 -1.8446801151  0.0949631686  0.6363471380  0.0004854572
 [26]  0.1873476880  1.4005530928 -0.1056630725  0.5805746871 -0.4657482123
 [31] -1.4654252367 -1.1176043775 -0.3662394030  0.5704848733 -0.5672855175
 [36] -0.4308834926 -0.4302982526  1.5117344694 -1.1674540040 -1.8914273497
 [41]  0.7154168881 -1.3384856299  1.5144464707  0.4549665225 -1.0923114538
 [46]  0.5062647617  0.6552471082  1.5598640137 -1.4433304582 -0.3202553083
 [51] -0.0925976761 -0.0710150357 -0.8438642449 -0.6038484890 -0.4885955286
 [56] -0.2920212585  0.9762645525  1.2013569055 -0.1139164238  0.7100269438
 [61]  0.7074493566  0.9881074944 -0.1662822332 -1.5625363449  1.1376523990
 [66]  0.4395028093  0.2422288444  0.7207223800  0.0860300502  1.6694946507
 [71]  1.3224533465 -1.3521351250 -0.6760428367 -0.5806286396  1.2855074630
 [76]  1.4504176591 -1.8948736294 -1.1369026489  0.3301320353  0.1125496579
 [81]  0.0320199110 -0.3767051949  1.6069011766 -0.5166274269  0.6950113126
 [86] -0.7006667499 -3.0964645907 -1.0160813713  0.5134476824 -0.2009591769
 [91]  0.0342769231 -1.0203522322 -0.8520785854 -0.6565040052 -1.0211677936
 [96] -0.2043066142  0.3400897369  0.5111016942 -1.0805421273 -0.6396725820
> colRanges(tmp)
          [,1]      [,2]      [,3]       [,4]      [,5]      [,6]      [,7]
[1,] 0.6370745 0.7022168 0.1922733 -0.2532262 0.4504142 0.8761902 -2.127612
[2,] 0.6370745 0.7022168 0.1922733 -0.2532262 0.4504142 0.8761902 -2.127612
          [,8]    [,9]     [,10]     [,11]     [,12]      [,13]   [,14]
[1,] 0.2312626 1.73907 0.5671207 -1.586671 0.1360923 -0.9314187 0.51863
[2,] 0.2312626 1.73907 0.5671207 -1.586671 0.1360923 -0.9314187 0.51863
         [,15]     [,16]     [,17]     [,18]      [,19]    [,20]    [,21]
[1,] -1.851432 -1.622734 0.8101756 -1.027567 -0.6502332 1.540137 1.714039
[2,] -1.851432 -1.622734 0.8101756 -1.027567 -0.6502332 1.540137 1.714039
        [,22]      [,23]     [,24]        [,25]     [,26]    [,27]      [,28]
[1,] -1.84468 0.09496317 0.6363471 0.0004854572 0.1873477 1.400553 -0.1056631
[2,] -1.84468 0.09496317 0.6363471 0.0004854572 0.1873477 1.400553 -0.1056631
         [,29]      [,30]     [,31]     [,32]      [,33]     [,34]      [,35]
[1,] 0.5805747 -0.4657482 -1.465425 -1.117604 -0.3662394 0.5704849 -0.5672855
[2,] 0.5805747 -0.4657482 -1.465425 -1.117604 -0.3662394 0.5704849 -0.5672855
          [,36]      [,37]    [,38]     [,39]     [,40]     [,41]     [,42]
[1,] -0.4308835 -0.4302983 1.511734 -1.167454 -1.891427 0.7154169 -1.338486
[2,] -0.4308835 -0.4302983 1.511734 -1.167454 -1.891427 0.7154169 -1.338486
        [,43]     [,44]     [,45]     [,46]     [,47]    [,48]    [,49]
[1,] 1.514446 0.4549665 -1.092311 0.5062648 0.6552471 1.559864 -1.44333
[2,] 1.514446 0.4549665 -1.092311 0.5062648 0.6552471 1.559864 -1.44333
          [,50]       [,51]       [,52]      [,53]      [,54]      [,55]
[1,] -0.3202553 -0.09259768 -0.07101504 -0.8438642 -0.6038485 -0.4885955
[2,] -0.3202553 -0.09259768 -0.07101504 -0.8438642 -0.6038485 -0.4885955
          [,56]     [,57]    [,58]      [,59]     [,60]     [,61]     [,62]
[1,] -0.2920213 0.9762646 1.201357 -0.1139164 0.7100269 0.7074494 0.9881075
[2,] -0.2920213 0.9762646 1.201357 -0.1139164 0.7100269 0.7074494 0.9881075
          [,63]     [,64]    [,65]     [,66]     [,67]     [,68]      [,69]
[1,] -0.1662822 -1.562536 1.137652 0.4395028 0.2422288 0.7207224 0.08603005
[2,] -0.1662822 -1.562536 1.137652 0.4395028 0.2422288 0.7207224 0.08603005
        [,70]    [,71]     [,72]      [,73]      [,74]    [,75]    [,76]
[1,] 1.669495 1.322453 -1.352135 -0.6760428 -0.5806286 1.285507 1.450418
[2,] 1.669495 1.322453 -1.352135 -0.6760428 -0.5806286 1.285507 1.450418
         [,77]     [,78]    [,79]     [,80]      [,81]      [,82]    [,83]
[1,] -1.894874 -1.136903 0.330132 0.1125497 0.03201991 -0.3767052 1.606901
[2,] -1.894874 -1.136903 0.330132 0.1125497 0.03201991 -0.3767052 1.606901
          [,84]     [,85]      [,86]     [,87]     [,88]     [,89]      [,90]
[1,] -0.5166274 0.6950113 -0.7006667 -3.096465 -1.016081 0.5134477 -0.2009592
[2,] -0.5166274 0.6950113 -0.7006667 -3.096465 -1.016081 0.5134477 -0.2009592
          [,91]     [,92]      [,93]     [,94]     [,95]      [,96]     [,97]
[1,] 0.03427692 -1.020352 -0.8520786 -0.656504 -1.021168 -0.2043066 0.3400897
[2,] 0.03427692 -1.020352 -0.8520786 -0.656504 -1.021168 -0.2043066 0.3400897
         [,98]     [,99]     [,100]
[1,] 0.5111017 -1.080542 -0.6396726
[2,] 0.5111017 -1.080542 -0.6396726
> 
> 
> Max(tmp2)
[1] 2.523721
> Min(tmp2)
[1] -2.252496
> mean(tmp2)
[1] -0.01835288
> Sum(tmp2)
[1] -1.835288
> Var(tmp2)
[1] 0.800897
> 
> rowMeans(tmp2)
  [1] -0.922242565  0.477892735 -0.122958774  0.804030563  0.549295030
  [6] -1.451669317 -0.044872281 -1.133049318  0.141899441 -0.325220288
 [11] -1.284498458 -0.404918545 -0.595349057 -0.117429868 -1.058524371
 [16] -0.755383138 -0.450224056  0.394260347  0.963159064 -0.046228746
 [21] -0.613753938  0.647722862 -0.721393572  0.114273307  0.466538169
 [26]  0.047982047  0.180192488  0.397758315 -0.768570938  0.127408238
 [31]  1.207827439  0.699675219  1.056309164  1.127495873 -1.012658827
 [36]  0.775725260 -0.851827771  1.161312679  0.671474133  0.010490722
 [41] -0.693576402  0.789570910 -1.888575417  0.338646981 -1.697081333
 [46] -0.272579932  0.010445848 -0.462322606 -0.184349617 -0.252465829
 [51]  0.637650332  0.101723436  0.619842197 -0.002713692  0.788658024
 [56] -0.376954879  0.673161232 -1.523948327  0.055336833 -0.783668013
 [61]  0.264786361  1.020294210  0.944415201  0.742371341  0.842371369
 [66] -0.674713690  1.063001849 -1.051461111  0.758855713 -1.526171754
 [71]  0.627311114 -1.410742984  0.849322143 -0.053439131  0.511756999
 [76] -0.447072137  0.399925272  0.705491769  0.822133478 -1.732364376
 [81]  2.523721050  1.378684493  0.137325928 -0.962248068 -1.044960217
 [86] -0.449139222 -0.599801450  0.226995254 -0.303051400  0.703400918
 [91] -0.028533335  0.191655737 -0.130334299  2.127110721 -0.992671176
 [96]  1.123797633 -1.020843845  1.150516252 -2.252496225 -1.489237589
> rowSums(tmp2)
  [1] -0.922242565  0.477892735 -0.122958774  0.804030563  0.549295030
  [6] -1.451669317 -0.044872281 -1.133049318  0.141899441 -0.325220288
 [11] -1.284498458 -0.404918545 -0.595349057 -0.117429868 -1.058524371
 [16] -0.755383138 -0.450224056  0.394260347  0.963159064 -0.046228746
 [21] -0.613753938  0.647722862 -0.721393572  0.114273307  0.466538169
 [26]  0.047982047  0.180192488  0.397758315 -0.768570938  0.127408238
 [31]  1.207827439  0.699675219  1.056309164  1.127495873 -1.012658827
 [36]  0.775725260 -0.851827771  1.161312679  0.671474133  0.010490722
 [41] -0.693576402  0.789570910 -1.888575417  0.338646981 -1.697081333
 [46] -0.272579932  0.010445848 -0.462322606 -0.184349617 -0.252465829
 [51]  0.637650332  0.101723436  0.619842197 -0.002713692  0.788658024
 [56] -0.376954879  0.673161232 -1.523948327  0.055336833 -0.783668013
 [61]  0.264786361  1.020294210  0.944415201  0.742371341  0.842371369
 [66] -0.674713690  1.063001849 -1.051461111  0.758855713 -1.526171754
 [71]  0.627311114 -1.410742984  0.849322143 -0.053439131  0.511756999
 [76] -0.447072137  0.399925272  0.705491769  0.822133478 -1.732364376
 [81]  2.523721050  1.378684493  0.137325928 -0.962248068 -1.044960217
 [86] -0.449139222 -0.599801450  0.226995254 -0.303051400  0.703400918
 [91] -0.028533335  0.191655737 -0.130334299  2.127110721 -0.992671176
 [96]  1.123797633 -1.020843845  1.150516252 -2.252496225 -1.489237589
> 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.922242565  0.477892735 -0.122958774  0.804030563  0.549295030
  [6] -1.451669317 -0.044872281 -1.133049318  0.141899441 -0.325220288
 [11] -1.284498458 -0.404918545 -0.595349057 -0.117429868 -1.058524371
 [16] -0.755383138 -0.450224056  0.394260347  0.963159064 -0.046228746
 [21] -0.613753938  0.647722862 -0.721393572  0.114273307  0.466538169
 [26]  0.047982047  0.180192488  0.397758315 -0.768570938  0.127408238
 [31]  1.207827439  0.699675219  1.056309164  1.127495873 -1.012658827
 [36]  0.775725260 -0.851827771  1.161312679  0.671474133  0.010490722
 [41] -0.693576402  0.789570910 -1.888575417  0.338646981 -1.697081333
 [46] -0.272579932  0.010445848 -0.462322606 -0.184349617 -0.252465829
 [51]  0.637650332  0.101723436  0.619842197 -0.002713692  0.788658024
 [56] -0.376954879  0.673161232 -1.523948327  0.055336833 -0.783668013
 [61]  0.264786361  1.020294210  0.944415201  0.742371341  0.842371369
 [66] -0.674713690  1.063001849 -1.051461111  0.758855713 -1.526171754
 [71]  0.627311114 -1.410742984  0.849322143 -0.053439131  0.511756999
 [76] -0.447072137  0.399925272  0.705491769  0.822133478 -1.732364376
 [81]  2.523721050  1.378684493  0.137325928 -0.962248068 -1.044960217
 [86] -0.449139222 -0.599801450  0.226995254 -0.303051400  0.703400918
 [91] -0.028533335  0.191655737 -0.130334299  2.127110721 -0.992671176
 [96]  1.123797633 -1.020843845  1.150516252 -2.252496225 -1.489237589
> rowMin(tmp2)
  [1] -0.922242565  0.477892735 -0.122958774  0.804030563  0.549295030
  [6] -1.451669317 -0.044872281 -1.133049318  0.141899441 -0.325220288
 [11] -1.284498458 -0.404918545 -0.595349057 -0.117429868 -1.058524371
 [16] -0.755383138 -0.450224056  0.394260347  0.963159064 -0.046228746
 [21] -0.613753938  0.647722862 -0.721393572  0.114273307  0.466538169
 [26]  0.047982047  0.180192488  0.397758315 -0.768570938  0.127408238
 [31]  1.207827439  0.699675219  1.056309164  1.127495873 -1.012658827
 [36]  0.775725260 -0.851827771  1.161312679  0.671474133  0.010490722
 [41] -0.693576402  0.789570910 -1.888575417  0.338646981 -1.697081333
 [46] -0.272579932  0.010445848 -0.462322606 -0.184349617 -0.252465829
 [51]  0.637650332  0.101723436  0.619842197 -0.002713692  0.788658024
 [56] -0.376954879  0.673161232 -1.523948327  0.055336833 -0.783668013
 [61]  0.264786361  1.020294210  0.944415201  0.742371341  0.842371369
 [66] -0.674713690  1.063001849 -1.051461111  0.758855713 -1.526171754
 [71]  0.627311114 -1.410742984  0.849322143 -0.053439131  0.511756999
 [76] -0.447072137  0.399925272  0.705491769  0.822133478 -1.732364376
 [81]  2.523721050  1.378684493  0.137325928 -0.962248068 -1.044960217
 [86] -0.449139222 -0.599801450  0.226995254 -0.303051400  0.703400918
 [91] -0.028533335  0.191655737 -0.130334299  2.127110721 -0.992671176
 [96]  1.123797633 -1.020843845  1.150516252 -2.252496225 -1.489237589
> 
> colMeans(tmp2)
[1] -0.01835288
> colSums(tmp2)
[1] -1.835288
> colVars(tmp2)
[1] 0.800897
> colSd(tmp2)
[1] 0.8949285
> colMax(tmp2)
[1] 2.523721
> colMin(tmp2)
[1] -2.252496
> colMedians(tmp2)
[1] 0.02923638
> colRanges(tmp2)
          [,1]
[1,] -2.252496
[2,]  2.523721
> 
> dataset1 <- matrix(dataset1,1,100)
> 
> agree.checks(tmp,dataset1)
> 
> dataset2 <- matrix(dataset2,100,1)
> agree.checks(tmp2,dataset2)
>   
> 
> tmp <- createBufferedMatrix(10,10)
> 
> tmp[1:10,1:10] <- rnorm(100)
> colApply(tmp,sum)
 [1]  4.1089358  0.7099790  2.6062419  2.2852577  6.0481620 -0.4923464
 [7] -3.9075763 -6.8036898 -2.0686632  1.0285627
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -0.5948379
[2,] -0.3421200
[3,]  0.5375660
[4,]  1.0124970
[5,]  1.4508804
> 
> rowApply(tmp,sum)
 [1]  0.04768128  5.25025534  1.27570702  4.23143729 -3.13635590 -0.19413366
 [7]  5.74459910 -2.72466419  0.57306575 -7.55272868
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]   10    7   10    7    6    4    4    6    4    10
 [2,]    3    4    5    5    7    5    7    7    9     8
 [3,]    6   10    4    9    3    9    5    9    1     2
 [4,]    9    2    1   10    8    7    9    3    6     5
 [5,]    7    9    6    8    9   10    6    2   10     3
 [6,]    2    5    7    3   10    2    8    5    3     4
 [7,]    1    8    3    6    5    6    1    8    5     1
 [8,]    5    1    9    1    1    3    2    4    2     7
 [9,]    4    6    2    2    4    8    3   10    8     6
[10,]    8    3    8    4    2    1   10    1    7     9
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1]  1.8918963  0.4047595  0.2253164 -1.6667014 -2.1723046 -0.8156633
 [7]  0.5690926 -0.5681132 -1.9151401  2.6065838  5.2772969 -0.2330478
[13] -3.6105592  0.3783796 -3.3376260  1.9343566  0.9213503  1.3729024
[19]  2.9965817 -1.4460411
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -0.1996587
[2,] -0.1802212
[3,]  0.1686879
[4,]  0.6399563
[5,]  1.4631320
> 
> rowApply(tmp,sum)
[1] -0.7927127  0.9956181 -1.7676287 -1.6164018  5.9944445
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]   14   20   10   11    6
[2,]   17    9   12    2   13
[3,]   20    1    2    5   19
[4,]    3    4    6   20   11
[5,]   10    2    7   13    4
> 
> 
> as.matrix(tmp)
           [,1]        [,2]       [,3]      [,4]       [,5]       [,6]
[1,]  0.6399563  0.91775244  2.1142123 -1.153319 -0.1691756 -0.7790711
[2,]  1.4631320  0.03032180 -1.6271164 -1.205830 -1.3315513  0.5562728
[3,] -0.1996587 -0.05890763 -1.1335254 -0.717805 -0.4736544  0.9653808
[4,]  0.1686879 -1.26377755 -0.8146853  1.255651  0.2072880 -0.5879587
[5,] -0.1802212  0.77937048  1.6864312  0.154601 -0.4052113 -0.9702870
           [,7]       [,8]        [,9]       [,10]     [,11]       [,12]
[1,]  0.6959099  0.9569735 -1.36855706 -0.03118688 1.4405281  0.40864368
[2,] -0.1184646 -1.2789280 -0.48633423  0.98039677 0.7773734  0.13360974
[3,] -0.4325163 -0.2509951 -0.02638924  1.16561611 0.4432057 -0.97956217
[4,]  0.7908873 -0.3530040 -1.13307219 -0.29841399 1.0640250  0.19148718
[5,] -0.3667237  0.3578404  1.09921261  0.79017179 1.5521648  0.01277377
           [,13]      [,14]        [,15]      [,16]       [,17]      [,18]
[1,] -0.66003523  0.7709278 -0.682538060 -1.9040595 -0.02548133 -0.5451932
[2,] -0.04534484  0.5207222 -0.007581705  0.3198930  1.04649287  0.6730845
[3,] -1.07506891 -0.1604879 -1.364680434  0.9956777  0.08867924 -0.7297492
[4,] -0.85285897 -0.6327216  0.390184205  1.2234531 -0.29953586  0.9035475
[5,] -0.97725123 -0.1200609 -1.673010001  1.2993924  0.11119534  1.0712128
          [,19]       [,20]
[1,] -0.7791018 -0.63989824
[2,]  0.1015067  0.49396350
[3,]  1.4767658  0.70004634
[4,]  0.3503774 -1.92596237
[5,]  1.8470336 -0.07419029
> 
> 
> is.BufferedMatrix(tmp)
[1] TRUE
> 
> as.BufferedMatrix(as.matrix(tmp))
BufferedMatrix object
Matrix size:  5 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  800  bytes.
> 
> 
> 
> subBufferedMatrix(tmp,1:5,1:5)
BufferedMatrix object
Matrix size:  5 5 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  650  bytes.
Disk usage :  200  bytes.
> subBufferedMatrix(tmp,,5:8)
BufferedMatrix object
Matrix size:  5 4 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  562  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.4125219 0.8535424 1.177726 0.9931577 0.5990013 -0.836175 -0.4374634
         col8      col9    col10     col11     col12       col13   col14
row1 1.659619 0.2155756 2.060149 -1.827222 -1.940404 -0.02836746 -1.5964
         col15     col16    col17    col18     col19     col20
row1 -1.192766 -2.633823 1.128106 2.261933 -1.619693 0.1331727
> tmp[,"col10"]
           col10
row1  2.06014889
row2 -1.50998887
row3  0.01446502
row4  0.31460267
row5  0.59905652
> tmp[c("row1","row5"),]
            col1       col2       col3      col4       col5        col6
row1  0.41252192 0.85354238  1.1777255 0.9931577  0.5990013 -0.83617505
row5 -0.06908063 0.05761607 -0.4132967 1.2217229 -1.0745903  0.02678068
           col7       col8      col9     col10      col11      col12
row1 -0.4374634  1.6596186 0.2155756 2.0601489 -1.8272218 -1.9404043
row5 -0.4691633 -0.5480973 0.1960047 0.5990565 -0.8640523 -0.7366231
           col13     col14     col15      col16    col17     col18      col19
row1 -0.02836746 -1.596400 -1.192766 -2.6338230 1.128106 2.2619331 -1.6196930
row5  1.59729695  1.235372 -2.052063  0.1428183 1.595220 0.7066395 -0.2887265
         col20
row1 0.1331727
row5 1.1953357
> tmp[,c("col6","col20")]
            col6      col20
row1 -0.83617505  0.1331727
row2  1.41224759  0.2396087
row3  0.83050891  1.4457046
row4 -0.43801059 -0.9262264
row5  0.02678068  1.1953357
> tmp[c("row1","row5"),c("col6","col20")]
            col6     col20
row1 -0.83617505 0.1331727
row5  0.02678068 1.1953357
> 
> 
> 
> 
> 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.56126 48.69764 52.17859 50.69674 48.77512 105.7443 51.24183 47.52662
         col9    col10    col11    col12    col13    col14    col15    col16
row1 49.06312 48.81179 50.61265 50.09132 49.54071 49.67994 51.42748 49.55809
        col17    col18   col19    col20
row1 52.24395 49.68422 50.0468 105.4575
> tmp[,"col10"]
        col10
row1 48.81179
row2 29.40899
row3 30.41880
row4 28.61329
row5 49.73588
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 50.56126 48.69764 52.17859 50.69674 48.77512 105.7443 51.24183 47.52662
row5 48.53591 48.35876 48.39438 49.99490 49.35867 103.9064 51.55495 50.25531
         col9    col10    col11    col12    col13    col14    col15    col16
row1 49.06312 48.81179 50.61265 50.09132 49.54071 49.67994 51.42748 49.55809
row5 48.90269 49.73588 49.42705 48.44574 50.90089 49.88316 49.31911 49.75934
        col17    col18    col19    col20
row1 52.24395 49.68422 50.04680 105.4575
row5 51.31757 49.68663 49.67036 105.9701
> tmp[,c("col6","col20")]
          col6     col20
row1 105.74432 105.45753
row2  75.17059  74.31288
row3  74.02760  75.95193
row4  76.15946  74.30682
row5 103.90643 105.97008
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 105.7443 105.4575
row5 103.9064 105.9701
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 105.7443 105.4575
row5 103.9064 105.9701
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
           col13
[1,]  1.17805203
[2,] -0.39826873
[3,] -0.06488922
[4,] -0.13708791
[5,] -1.24748815
> tmp[,c("col17","col7")]
           col17        col7
[1,]  0.07033187 -0.80852485
[2,] -2.87704710  0.03452222
[3,] -0.51001691  0.89154396
[4,] -0.05706162  0.35357306
[5,] -0.19796717  0.89557501
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
           col6      col20
[1,] -1.3552809  0.9724436
[2,]  0.8324080 -1.2185535
[3,] -0.1750508 -0.3342730
[4,] -0.9041351 -0.5939975
[5,] -1.1669894  1.2812987
> subBufferedMatrix(tmp,1,c("col6"))[,1]
          col1
[1,] -1.355281
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
          col6
[1,] -1.355281
[2,]  0.832408
> 
> 
> 
> 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]      [,7]
row3 0.2657830 -0.4632905 -0.7855787 2.6520449 -0.3246793 0.678518 -1.466078
row1 0.2380839 -1.0229094 -1.8022568 0.6079245 -0.5386779 2.431605 -2.193044
          [,8]        [,9]      [,10]     [,11]      [,12]     [,13]    [,14]
row3 1.6541480 -0.09450007  2.0527951 0.0904049  0.1347819  2.042621 0.487491
row1 0.6997922  1.90111787 -0.7000626 0.1885151 -1.0297285 -1.625053 1.347451
         [,15]     [,16]      [,17]      [,18]     [,19]      [,20]
row3 -1.303702  1.130865 -0.5725974 -0.7073184 -0.916851 -0.8909765
row1  0.114349 -2.286444  1.5873859 -1.0143273  1.270027  0.8130521
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
          [,1]     [,2]      [,3]      [,4]     [,5]     [,6]      [,7]
row2 -0.377645 1.569455 -1.163481 0.1108802 1.129449 1.704079 0.6805541
          [,8]       [,9]      [,10]
row2 -1.081525 -0.4100726 0.01193561
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
          [,1]       [,2]       [,3]       [,4]      [,5]     [,6]      [,7]
row5 -1.313712 -0.4053955 -0.8788236 -0.3307418 0.6744239 2.510222 -1.535047
          [,8]     [,9]     [,10]     [,11]    [,12]      [,13]     [,14]
row5 0.9882616 1.369846 -1.312852 0.2171355 -1.01191 -0.1478899 0.3739029
        [,15]      [,16]      [,17]     [,18]    [,19]      [,20]
row5 0.241876 0.02133246 -0.1341102 0.8405637 0.694792 -0.4261881
> 
> 
> 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: 0x6000029440c0>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM55b3406d2a06"
 [2] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM55b33ee210f5"
 [3] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM55b36bc76513"
 [4] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM55b36fbcf9ac"
 [5] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM55b35fabc483"
 [6] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM55b35f2a587" 
 [7] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM55b37d51451d"
 [8] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM55b36290b331"
 [9] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM55b39e48885" 
[10] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM55b37abed8d5"
[11] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM55b378dc6e8" 
[12] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM55b36cfdad37"
[13] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM55b32772dc8" 
[14] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM55b35e5ea6bb"
[15] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM55b318146f64"
> 
> 
> ### 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: 0x600002914060>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x600002914060>
Warning message:
In dir.create(new.directory) :
  '/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x600002914060>
> rowMedians(tmp)
  [1] -0.590943772 -0.647211285 -0.168607184  0.173342269  0.452283796
  [6]  0.287700267  0.410712948 -0.066537237 -0.117037846  0.258813612
 [11] -0.368222239  0.126231373  0.425492660  0.285620595 -0.260488962
 [16] -0.017816395  0.276886496  0.093214456  0.013765306  0.092841334
 [21] -0.168674964 -0.099043747 -0.554137837  0.352786374 -0.324021632
 [26] -0.641741038  0.278934683 -0.364153993 -0.101220966 -0.064600752
 [31] -0.152025001 -0.103189445 -0.061732063 -0.395532924  0.218754449
 [36]  0.084531699 -0.013147342  0.074739953 -0.497930982  0.360208704
 [41]  0.267480124 -0.291126268  0.508093441 -0.140347545 -0.226032867
 [46]  0.125064860 -0.095201071  0.072571169 -0.497350171 -0.318965770
 [51] -0.300090838  0.012867812  0.192876315  0.116201455  0.239613274
 [56]  0.261646957  0.517150657  0.968307121 -0.335667515 -0.108384679
 [61]  0.179904266  0.344062353 -0.307660971  0.258465654 -0.456092977
 [66] -0.636483877 -0.403826116  0.022334712 -0.322745856 -0.484801579
 [71]  0.075809492 -0.621507822 -0.142928023  0.002156222 -0.198846622
 [76]  0.028890601 -0.084735652 -0.071118914 -0.427482359  0.332318024
 [81]  0.355895790  0.179197754  0.301056624  0.552889625  0.239854493
 [86] -0.373753964  0.072515331  0.062391083  0.039463619  0.071215763
 [91] -0.623203412 -0.082910388 -0.929536114  0.523512542  0.004362495
 [96] -0.086447327 -0.155294775  0.603484764  0.617060462 -0.268427106
[101] -0.106058593 -0.257158662 -0.077492428  0.617456382 -0.234306658
[106] -0.081483942  0.253487374 -0.118193042  0.494284070 -0.019518392
[111]  0.186369280  0.179589482 -0.486997777 -0.320431649 -0.363178363
[116] -0.152661788  0.261726718  0.399804634 -0.611098334  0.274332467
[121]  0.147404216 -0.455590821 -0.119938065 -0.109274397 -0.237685168
[126] -0.165957686 -0.001319616 -0.054639231 -0.155749420  0.309260235
[131]  0.223661261 -0.020318555  0.435959500  0.408010614  0.279402696
[136] -0.762436484  0.088139454  0.066560285 -0.267822374 -0.200404768
[141] -0.238947840  0.030015469 -0.034388838  0.034649402  0.172172377
[146] -0.181729187 -0.128990112  0.077274871  0.438056811  0.182907596
[151] -0.382397367 -0.191148871  0.030872234  0.362284364  0.022722293
[156] -0.459202030 -0.023935863 -0.298448177  0.250417415 -0.075847020
[161]  0.392236166  0.369095052  0.161922895 -0.263426870  0.053030709
[166]  0.035338584 -0.155119983 -0.326179744  0.099237999  0.266940768
[171]  0.013832222  0.337360434  0.162728199  0.104335288 -0.108504793
[176] -0.195535460 -0.366735870 -0.133529521  0.510575545  0.366726526
[181]  0.411493136  0.125776758  0.008988136  0.143288813 -0.245387542
[186]  0.171908754 -0.536665146  0.159135794  0.554650419  0.183309434
[191] -0.283342346 -0.461060942  0.796606634 -0.056652464 -0.175635316
[196] -0.353866131  0.302975313 -0.264022100  0.116269327  0.140834981
[201] -0.067057179 -0.178402728 -0.102368924 -0.013618405  0.229672778
[206]  0.145995824 -0.173074461  0.374507267 -0.697410720  0.066025967
[211] -0.123344734  0.093578208  0.629173786  0.123153304  0.717077136
[216]  0.117550635 -0.304190499 -0.391272308 -0.110006816  0.044007474
[221]  0.219327981  0.064875862 -0.276732257 -0.583663334  0.561385220
[226] -0.211287324 -0.581294172 -0.017638827  0.031514283  0.476196980
> 
> proc.time()
   user  system elapsed 
  2.594  15.057  18.135 

BufferedMatrix.Rcheck/tests/rawCalltesting.Rout


R version 4.5.1 Patched (2025-09-10 r88807) -- "Great Square Root"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: 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: 0x6000033a8000>
> .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: 0x6000033a8000>
> .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: 0x6000033a8000>
> .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: 0x6000033a8000>
> 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: 0x6000033d8000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000033d8000>
> .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: 0x6000033d8000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000033d8000>
> .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: 0x6000033d8000>
> 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: 0x6000033c4000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000033c4000>
> .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: 0x6000033c4000>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x6000033c4000>
> .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: 0x6000033c4000>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x6000033c4000>
> .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: 0x6000033c4000>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x6000033c4000>
> .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: 0x6000033c4000>
> 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: 0x6000033c0000>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x6000033c0000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000033c0000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000033c0000>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile5c1627c6bcb8" "BufferedMatrixFile5c16688fe86e"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile5c1627c6bcb8" "BufferedMatrixFile5c16688fe86e"
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000033cc120>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000033cc120>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x6000033cc120>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x6000033cc120>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x6000033cc120>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x6000033cc120>
> .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: 0x6000033cc300>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000033cc300>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x6000033cc300>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x6000033cc300>
> 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: 0x6000033b83c0>
> .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: 0x6000033b83c0>
> rm(P)
> 
> proc.time()
   user  system elapsed 
  0.347   0.145   0.513 

BufferedMatrix.Rcheck/tests/Rcodetesting.Rout


R version 4.5.1 Patched (2025-09-10 r88807) -- "Great Square Root"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: 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.369   0.101   0.466 

Example timings