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

This page was generated on 2025-04-22 13:15 -0400 (Tue, 22 Apr 2025).

HostnameOSArch (*)R versionInstalled pkgs
nebbiolo1Linux (Ubuntu 24.04.1 LTS)x86_644.5.0 RC (2025-04-04 r88126) -- "How About a Twenty-Six" 4831
palomino7Windows Server 2022 Datacenterx644.5.0 RC (2025-04-04 r88126 ucrt) -- "How About a Twenty-Six" 4573
lconwaymacOS 12.7.1 Montereyx86_644.5.0 RC (2025-04-04 r88126) -- "How About a Twenty-Six" 4599
kjohnson3macOS 13.7.1 Venturaarm644.5.0 RC (2025-04-04 r88126) -- "How About a Twenty-Six" 4553
kunpeng2Linux (openEuler 24.03 LTS)aarch64R Under development (unstable) (2025-02-19 r87757) -- "Unsuffered Consequences" 4570
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 252/2341HostnameOS / ArchINSTALLBUILDCHECKBUILD BIN
BufferedMatrix 1.72.0  (landing page)
Ben Bolstad
Snapshot Date: 2025-04-21 13:40 -0400 (Mon, 21 Apr 2025)
git_url: https://git.bioconductor.org/packages/BufferedMatrix
git_branch: RELEASE_3_21
git_last_commit: aa9e634
git_last_commit_date: 2025-04-15 09:39:39 -0400 (Tue, 15 Apr 2025)
nebbiolo1Linux (Ubuntu 24.04.1 LTS) / x86_64  OK    OK    OK  YES
palomino7Windows Server 2022 Datacenter / x64  OK    OK    OK    OK  YES
lconwaymacOS 12.7.1 Monterey / x86_64  OK    OK    WARNINGS    OK  YES
kjohnson3macOS 13.7.1 Ventura / arm64  OK    OK    WARNINGS    OK  YES
kunpeng2Linux (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.72.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.72.0.tar.gz
StartedAt: 2025-04-21 19:29:55 -0400 (Mon, 21 Apr 2025)
EndedAt: 2025-04-21 19:30:48 -0400 (Mon, 21 Apr 2025)
EllapsedTime: 52.6 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.72.0.tar.gz
###
##############################################################################
##############################################################################


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

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

Tests output

BufferedMatrix.Rcheck/tests/c_code_level_tests.Rout


R version 4.5.0 RC (2025-04-04 r88126) -- "How About a Twenty-Six"
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.330   0.154   0.482 

BufferedMatrix.Rcheck/tests/objectTesting.Rout


R version 4.5.0 RC (2025-04-04 r88126) -- "How About a Twenty-Six"
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.21-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 480829 25.7    1056567 56.5         NA   634460 33.9
Vcells 891038  6.8    8388608 64.0      98304  2108474 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] "Mon Apr 21 19:30:19 2025"
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> date()
[1] "Mon Apr 21 19:30:19 2025"
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,which.col] == test.matrix[which.row,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> 
> 
> RowMode(tmp2)
<pointer: 0x600003b1c000>
> 
> 
> 
> 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] "Mon Apr 21 19:30:24 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] "Mon Apr 21 19:30:26 2025"
> 
> ColMode(tmp2)
<pointer: 0x600003b1c000>
> 
> 
> 
> ### Now testing assignments
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+ 
+   new.data <- rnorm(20)
+   tmp2[which.row,] <- new.data
+   test.matrix[which.row,] <- new.data
+   if (rep > 1){
+     if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+   
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   new.data <- rnorm(10)
+   tmp2[,which.col] <- new.data
+   test.matrix[,which.col]<- new.data
+ 
+   if (rep > 1){
+     if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.col <- which.col
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,5,replace=TRUE)
+   new.data <- matrix(rnorm(50),5,10)
+   tmp2[,which.col] <- new.data
+   test.matrix[,which.col]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.col <- which.col
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   new.data <- matrix(rnorm(50),5,10)
+   tmp2[which.row,] <- new.data
+   test.matrix[which.row,]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col  <- sample(1:20,5,replace=TRUE)
+   new.data <- matrix(rnorm(25),5,5)
+   tmp2[which.row,which.col] <- new.data
+   test.matrix[which.row,which.col]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[prev.row,prev.col] == test.matrix[prev.row,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+   prev.col <- which.col
+ }
> 
> 
> 
> 
> ###
> ###
> ### testing some more functions
> ###
> 
> 
> 
> ## duplication function
> tmp5 <- duplicate(tmp2)
> 
> # making sure really did copy everything.
> tmp5[1,1] <- tmp5[1,1] +100.00
> 
> if (tmp5[1,1] == tmp2[1,1]){
+   stop("Problem with duplication")
+ }
> 
> 
> 
> 
> ### testing elementwise applying of functions
> 
> tmp5[1:4,1:4]
             [,1]       [,2]        [,3]       [,4]
[1,] 100.08087719 -1.3835122 -0.04950337  1.4688777
[2,]  -0.01224922 -1.6478223  1.27929802 -1.5457689
[3,]   0.33296817 -0.7979778  0.61103914  1.2232708
[4,]  -1.44635544  1.4481235 -1.25102016 -0.6827258
> ewApply(tmp5,abs)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
             [,1]      [,2]       [,3]      [,4]
[1,] 100.08087719 1.3835122 0.04950337 1.4688777
[2,]   0.01224922 1.6478223 1.27929802 1.5457689
[3,]   0.33296817 0.7979778 0.61103914 1.2232708
[4,]   1.44635544 1.4481235 1.25102016 0.6827258
> ewApply(tmp5,sqrt)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
           [,1]      [,2]      [,3]      [,4]
[1,] 10.0040430 1.1762280 0.2224935 1.2119727
[2,]  0.1106762 1.2836753 1.1310606 1.2432896
[3,]  0.5770339 0.8932961 0.7816899 1.1060157
[4,]  1.2026452 1.2033800 1.1184901 0.8262722
> 
> 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.21-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
          [,1]     [,2]     [,3]     [,4]
[1,] 225.12131 38.14579 27.27444 38.58860
[2,]  26.11901 39.48458 37.58990 38.97866
[3,]  31.10331 34.73094 33.42794 37.28343
[4,]  38.47281 38.48192 37.43592 33.94545
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x600003b60000>
> exp(tmp5)
<pointer: 0x600003b60000>
> log(tmp5,2)
<pointer: 0x600003b60000>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 468.5605
> Min(tmp5)
[1] 52.67917
> mean(tmp5)
[1] 72.99484
> Sum(tmp5)
[1] 14598.97
> Var(tmp5)
[1] 872.8917
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 89.95961 69.66418 71.34999 73.99226 71.45676 69.90432 71.00471 68.53406
 [9] 70.50941 73.57316
> rowSums(tmp5)
 [1] 1799.192 1393.284 1427.000 1479.845 1429.135 1398.086 1420.094 1370.681
 [9] 1410.188 1471.463
> rowVars(tmp5)
 [1] 8042.19086   59.95277   82.36703   66.08858   73.31685   99.84962
 [7]   88.41446   79.04602   70.71474  117.41447
> rowSd(tmp5)
 [1] 89.678263  7.742918  9.075628  8.129488  8.562526  9.992478  9.402896
 [8]  8.890783  8.409206 10.835796
> rowMax(tmp5)
 [1] 468.56051  82.18197  88.50759  89.71621  84.58862  87.94220  88.43842
 [8]  85.17829  85.19492  89.78343
> rowMin(tmp5)
 [1] 54.70905 54.36330 55.18859 57.32865 52.67917 53.12837 58.59815 54.82914
 [9] 58.39016 54.90789
> 
> colMeans(tmp5)
 [1] 109.68850  74.89383  72.19480  78.13745  70.65523  74.60554  71.50646
 [8]  71.26525  65.66568  66.64391  71.51782  72.52536  69.39031  70.94044
[15]  66.62252  69.95099  72.83536  69.15454  71.41132  70.29160
> colSums(tmp5)
 [1] 1096.8850  748.9383  721.9480  781.3745  706.5523  746.0554  715.0646
 [8]  712.6525  656.6568  666.4391  715.1782  725.2536  693.9031  709.4044
[15]  666.2252  699.5099  728.3536  691.5454  714.1132  702.9160
> colVars(tmp5)
 [1] 15978.02471    71.44348    82.26244    52.53688   107.03898    95.33851
 [7]   104.58998    97.83930    94.86087    74.10241    85.57036    18.42149
[13]    37.67589    95.52324    70.18642   128.55741   113.26158    96.45299
[19]    91.52684    51.48302
> colSd(tmp5)
 [1] 126.404212   8.452424   9.069865   7.248233  10.345964   9.764144
 [7]  10.226924   9.891375   9.739654   8.608276   9.250425   4.292027
[13]   6.138069   9.773599   8.377733  11.338316  10.642442   9.821048
[19]   9.566966   7.175167
> colMax(tmp5)
 [1] 468.56051  87.47993  89.29262  87.94220  89.71621  89.78343  84.68181
 [8]  85.11784  85.01851  81.97348  82.81813  78.20405  79.73808  84.58862
[15]  80.95937  85.17829  88.50759  88.43842  85.88881  80.00369
> colMin(tmp5)
 [1] 54.36330 64.23588 56.76817 63.15245 55.18859 56.28584 56.43041 59.64114
 [9] 54.70905 52.67917 55.50774 64.62922 57.24196 54.82914 57.38161 53.12837
[17] 57.40461 56.38474 60.41958 57.18487
> 
> 
> ### 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] 89.95961 69.66418 71.34999       NA 71.45676 69.90432 71.00471 68.53406
 [9] 70.50941 73.57316
> rowSums(tmp5)
 [1] 1799.192 1393.284 1427.000       NA 1429.135 1398.086 1420.094 1370.681
 [9] 1410.188 1471.463
> rowVars(tmp5)
 [1] 8042.19086   59.95277   82.36703   68.55738   73.31685   99.84962
 [7]   88.41446   79.04602   70.71474  117.41447
> rowSd(tmp5)
 [1] 89.678263  7.742918  9.075628  8.279938  8.562526  9.992478  9.402896
 [8]  8.890783  8.409206 10.835796
> rowMax(tmp5)
 [1] 468.56051  82.18197  88.50759        NA  84.58862  87.94220  88.43842
 [8]  85.17829  85.19492  89.78343
> rowMin(tmp5)
 [1] 54.70905 54.36330 55.18859       NA 52.67917 53.12837 58.59815 54.82914
 [9] 58.39016 54.90789
> 
> colMeans(tmp5)
 [1] 109.68850  74.89383  72.19480  78.13745  70.65523  74.60554  71.50646
 [8]  71.26525  65.66568  66.64391  71.51782        NA  69.39031  70.94044
[15]  66.62252  69.95099  72.83536  69.15454  71.41132  70.29160
> colSums(tmp5)
 [1] 1096.8850  748.9383  721.9480  781.3745  706.5523  746.0554  715.0646
 [8]  712.6525  656.6568  666.4391  715.1782        NA  693.9031  709.4044
[15]  666.2252  699.5099  728.3536  691.5454  714.1132  702.9160
> colVars(tmp5)
 [1] 15978.02471    71.44348    82.26244    52.53688   107.03898    95.33851
 [7]   104.58998    97.83930    94.86087    74.10241    85.57036          NA
[13]    37.67589    95.52324    70.18642   128.55741   113.26158    96.45299
[19]    91.52684    51.48302
> colSd(tmp5)
 [1] 126.404212   8.452424   9.069865   7.248233  10.345964   9.764144
 [7]  10.226924   9.891375   9.739654   8.608276   9.250425         NA
[13]   6.138069   9.773599   8.377733  11.338316  10.642442   9.821048
[19]   9.566966   7.175167
> colMax(tmp5)
 [1] 468.56051  87.47993  89.29262  87.94220  89.71621  89.78343  84.68181
 [8]  85.11784  85.01851  81.97348  82.81813        NA  79.73808  84.58862
[15]  80.95937  85.17829  88.50759  88.43842  85.88881  80.00369
> colMin(tmp5)
 [1] 54.36330 64.23588 56.76817 63.15245 55.18859 56.28584 56.43041 59.64114
 [9] 54.70905 52.67917 55.50774       NA 57.24196 54.82914 57.38161 53.12837
[17] 57.40461 56.38474 60.41958 57.18487
> 
> Max(tmp5,na.rm=TRUE)
[1] 468.5605
> Min(tmp5,na.rm=TRUE)
[1] 52.67917
> mean(tmp5,na.rm=TRUE)
[1] 73.01262
> Sum(tmp5,na.rm=TRUE)
[1] 14529.51
> Var(tmp5,na.rm=TRUE)
[1] 877.2367
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 89.95961 69.66418 71.34999 74.23095 71.45676 69.90432 71.00471 68.53406
 [9] 70.50941 73.57316
> rowSums(tmp5,na.rm=TRUE)
 [1] 1799.192 1393.284 1427.000 1410.388 1429.135 1398.086 1420.094 1370.681
 [9] 1410.188 1471.463
> rowVars(tmp5,na.rm=TRUE)
 [1] 8042.19086   59.95277   82.36703   68.55738   73.31685   99.84962
 [7]   88.41446   79.04602   70.71474  117.41447
> rowSd(tmp5,na.rm=TRUE)
 [1] 89.678263  7.742918  9.075628  8.279938  8.562526  9.992478  9.402896
 [8]  8.890783  8.409206 10.835796
> rowMax(tmp5,na.rm=TRUE)
 [1] 468.56051  82.18197  88.50759  89.71621  84.58862  87.94220  88.43842
 [8]  85.17829  85.19492  89.78343
> rowMin(tmp5,na.rm=TRUE)
 [1] 54.70905 54.36330 55.18859 57.32865 52.67917 53.12837 58.59815 54.82914
 [9] 58.39016 54.90789
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 109.68850  74.89383  72.19480  78.13745  70.65523  74.60554  71.50646
 [8]  71.26525  65.66568  66.64391  71.51782  72.86628  69.39031  70.94044
[15]  66.62252  69.95099  72.83536  69.15454  71.41132  70.29160
> colSums(tmp5,na.rm=TRUE)
 [1] 1096.8850  748.9383  721.9480  781.3745  706.5523  746.0554  715.0646
 [8]  712.6525  656.6568  666.4391  715.1782  655.7965  693.9031  709.4044
[15]  666.2252  699.5099  728.3536  691.5454  714.1132  702.9160
> colVars(tmp5,na.rm=TRUE)
 [1] 15978.02471    71.44348    82.26244    52.53688   107.03898    95.33851
 [7]   104.58998    97.83930    94.86087    74.10241    85.57036    19.41664
[13]    37.67589    95.52324    70.18642   128.55741   113.26158    96.45299
[19]    91.52684    51.48302
> colSd(tmp5,na.rm=TRUE)
 [1] 126.404212   8.452424   9.069865   7.248233  10.345964   9.764144
 [7]  10.226924   9.891375   9.739654   8.608276   9.250425   4.406432
[13]   6.138069   9.773599   8.377733  11.338316  10.642442   9.821048
[19]   9.566966   7.175167
> colMax(tmp5,na.rm=TRUE)
 [1] 468.56051  87.47993  89.29262  87.94220  89.71621  89.78343  84.68181
 [8]  85.11784  85.01851  81.97348  82.81813  78.20405  79.73808  84.58862
[15]  80.95937  85.17829  88.50759  88.43842  85.88881  80.00369
> colMin(tmp5,na.rm=TRUE)
 [1] 54.36330 64.23588 56.76817 63.15245 55.18859 56.28584 56.43041 59.64114
 [9] 54.70905 52.67917 55.50774 64.62922 57.24196 54.82914 57.38161 53.12837
[17] 57.40461 56.38474 60.41958 57.18487
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1] 89.95961 69.66418 71.34999      NaN 71.45676 69.90432 71.00471 68.53406
 [9] 70.50941 73.57316
> rowSums(tmp5,na.rm=TRUE)
 [1] 1799.192 1393.284 1427.000    0.000 1429.135 1398.086 1420.094 1370.681
 [9] 1410.188 1471.463
> rowVars(tmp5,na.rm=TRUE)
 [1] 8042.19086   59.95277   82.36703         NA   73.31685   99.84962
 [7]   88.41446   79.04602   70.71474  117.41447
> rowSd(tmp5,na.rm=TRUE)
 [1] 89.678263  7.742918  9.075628        NA  8.562526  9.992478  9.402896
 [8]  8.890783  8.409206 10.835796
> rowMax(tmp5,na.rm=TRUE)
 [1] 468.56051  82.18197  88.50759        NA  84.58862  87.94220  88.43842
 [8]  85.17829  85.19492  89.78343
> rowMin(tmp5,na.rm=TRUE)
 [1] 54.70905 54.36330 55.18859       NA 52.67917 53.12837 58.59815 54.82914
 [9] 58.39016 54.90789
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1] 112.97876  74.31591  71.55889  78.96906  68.53734  74.69756  71.12853
 [8]  71.43518  64.68064  66.69065  70.63719       NaN  69.01664  69.69331
[15]  66.72169  69.07933  74.54989  70.46852  70.44258  69.21248
> colSums(tmp5,na.rm=TRUE)
 [1] 1016.8089  668.8432  644.0300  710.7215  616.8361  672.2780  640.1568
 [8]  642.9166  582.1258  600.2158  635.7347    0.0000  621.1498  627.2398
[15]  600.4952  621.7140  670.9490  634.2167  633.9833  622.9123
> colVars(tmp5,na.rm=TRUE)
 [1] 17853.48701    76.61654    87.99599    51.32386    69.95760   107.16056
 [7]   116.05685   109.74436    95.80251    83.34064    87.54222          NA
[13]    40.81451    89.96620    78.84908   136.07947    94.34871    89.08579
[19]    92.41017    44.81773
> colSd(tmp5,na.rm=TRUE)
 [1] 133.616941   8.753088   9.380618   7.164067   8.364066  10.351838
 [7]  10.772968  10.475894   9.787876   9.129109   9.356400         NA
[13]   6.388623   9.485051   8.879701  11.665311   9.713326   9.438527
[19]   9.613021   6.694604
> colMax(tmp5,na.rm=TRUE)
 [1] 468.56051  87.47993  89.29262  87.94220  84.33356  89.78343  84.68181
 [8]  85.11784  85.01851  81.97348  82.81813      -Inf  79.73808  84.58862
[15]  80.95937  85.17829  88.50759  88.43842  85.88881  79.70022
> colMin(tmp5,na.rm=TRUE)
 [1] 54.36330 64.23588 56.76817 63.15245 55.18859 56.28584 56.43041 59.64114
 [9] 54.70905 52.67917 55.50774      Inf 57.24196 54.82914 57.38161 53.12837
[17] 62.96043 56.38474 60.41958 57.18487
> 
> 
> 
> 
> 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] 182.2734 262.9593 198.3232 213.3127 268.2402 184.5618 152.9799 158.4565
 [9] 215.8732 178.1371
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 182.2734 262.9593 198.3232 213.3127 268.2402 184.5618 152.9799 158.4565
 [9] 215.8732 178.1371
> 
> 
> 
> 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]  1.136868e-13  1.136868e-13  1.136868e-13 -2.842171e-14 -1.705303e-13
 [6]  1.136868e-13  2.842171e-14 -8.526513e-14  2.842171e-14  5.684342e-14
[11]  1.705303e-13 -2.842171e-13  1.136868e-13  1.136868e-13 -3.410605e-13
[16] -1.705303e-13 -8.526513e-14  0.000000e+00  1.136868e-13  5.684342e-14
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> ## making sure these things agree
> ##
> ## first when there is no NA
> 
> 
> 
> agree.checks <- function(buff.matrix,r.matrix,err.tol=1e-10){
+ 
+   if (Max(buff.matrix,na.rm=TRUE) != max(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Max")
+   }
+   
+ 
+   if (Min(buff.matrix,na.rm=TRUE) != min(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Min")
+   }
+ 
+ 
+   if (abs(Sum(buff.matrix,na.rm=TRUE)- sum(r.matrix,na.rm=TRUE)) > err.tol){
+ 
+     cat(Sum(buff.matrix,na.rm=TRUE),"\n")
+     cat(sum(r.matrix,na.rm=TRUE),"\n")
+     cat(Sum(buff.matrix,na.rm=TRUE) - sum(r.matrix,na.rm=TRUE),"\n")
+     
+     stop("No agreement in Sum")
+   }
+   
+   if (abs(mean(buff.matrix,na.rm=TRUE) - mean(r.matrix,na.rm=TRUE)) > err.tol){
+     stop("No agreement in mean")
+   }
+   
+   
+   if(abs(Var(buff.matrix,na.rm=TRUE) - var(as.vector(r.matrix),na.rm=TRUE)) > err.tol){
+     stop("No agreement in Var")
+   }
+   
+   
+ 
+   if(any(abs(rowMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,mean,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowMeans")
+   }
+   
+   
+   if(any(abs(colMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,mean,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colMeans")
+   }
+   
+   
+   if(any(abs(rowSums(buff.matrix,na.rm=TRUE)  -  apply(r.matrix,1,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in rowSums")
+   }
+   
+   
+   if(any(abs(colSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colSums")
+   }
+   
+   ### this is to get around the fact that R doesn't like to compute NA on an entire vector of NA when 
+   ### computing variance
+   my.Var <- function(x,na.rm=FALSE){
+    if (all(is.na(x))){
+      return(NA)
+    } else {
+      var(x,na.rm=na.rm)
+    }
+ 
+   }
+   
+   if(any(abs(rowVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+   
+   
+   if(any(abs(colVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+ 
+ 
+   if(any(abs(rowMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+ 
+   if(any(abs(colMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+   
+   
+   if(any(abs(rowMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+   
+ 
+   if(any(abs(colMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+ 
+   if(any(abs(colMedians(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,median,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMedian")
+   }
+ 
+   if(any(abs(colRanges(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,range,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colRanges")
+   }
+ 
+ 
+   
+ }
> 
> 
> 
> 
> 
> 
> 
> 
> 
> for (rep in 1:20){
+   copymatrix <- matrix(rnorm(200,150,15),10,20)
+   
+   tmp5[1:10,1:20] <- copymatrix
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ## now lets assign some NA values and check agreement
+ 
+   which.row <- sample(1:10,1,replace=TRUE)
+   which.col  <- sample(1:20,1,replace=TRUE)
+   
+   cat(which.row," ",which.col,"\n")
+   
+   tmp5[which.row,which.col] <- NA
+   copymatrix[which.row,which.col] <- NA
+   
+   agree.checks(tmp5,copymatrix)
+ 
+   ## make an entire row NA
+   tmp5[which.row,] <- NA
+   copymatrix[which.row,] <- NA
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ### also make an entire col NA
+   tmp5[,which.col] <- NA
+   copymatrix[,which.col] <- NA
+ 
+   agree.checks(tmp5,copymatrix)
+ 
+   ### now make 1 element non NA with NA in the rest of row and column
+ 
+   tmp5[which.row,which.col] <- rnorm(1,150,15)
+   copymatrix[which.row,which.col] <- tmp5[which.row,which.col]
+ 
+   agree.checks(tmp5,copymatrix)
+ }
9   4 
6   15 
5   12 
1   10 
10   5 
2   18 
9   12 
5   7 
1   11 
9   12 
10   12 
4   12 
5   20 
1   19 
6   3 
4   7 
2   14 
10   11 
2   20 
8   7 
There were 50 or more warnings (use warnings() to see the first 50)
> 
> 
> ### now test 1 by n and n by 1 matrix
> 
> 
> err.tol <- 1e-12
> 
> rm(tmp5)
> 
> dataset1 <- rnorm(100)
> dataset2 <- rnorm(100)
> 
> tmp <- createBufferedMatrix(1,100)
> tmp[1,] <- dataset1
> 
> tmp2 <- createBufferedMatrix(100,1)
> tmp2[,1] <- dataset2
> 
> 
> 
> 
> 
> Max(tmp)
[1] 2.907621
> Min(tmp)
[1] -2.466331
> mean(tmp)
[1] 0.03391174
> Sum(tmp)
[1] 3.391174
> Var(tmp)
[1] 1.001403
> 
> rowMeans(tmp)
[1] 0.03391174
> rowSums(tmp)
[1] 3.391174
> rowVars(tmp)
[1] 1.001403
> rowSd(tmp)
[1] 1.000701
> rowMax(tmp)
[1] 2.907621
> rowMin(tmp)
[1] -2.466331
> 
> colMeans(tmp)
  [1]  0.1982970542  2.9076209052 -0.5762875604 -0.1872004330 -1.4889626817
  [6]  1.1899194753  0.7045495460 -1.2253938017  0.7680511080  1.3841146111
 [11]  0.8784925984 -0.7127252635  0.0408402422  0.3859297811  1.0064965041
 [16] -1.0292228805  1.5005863117 -0.6679732618 -1.2223588870  0.7861584770
 [21]  1.3746080707 -0.9024760848  0.0449556760 -1.2255534108  0.5896026212
 [26]  0.6200610469  0.4406273174 -0.7463790262  2.1526276574  0.8474577835
 [31] -0.0459066679  0.2623459344  0.4489379982 -0.3022357003 -0.1877076757
 [36] -1.1475460904 -0.0677931191 -1.2611008822 -0.8449530976  0.0004995457
 [41] -0.3494630774  0.9204166477  0.0437914557 -1.1667360870 -1.0236098818
 [46] -0.1305069418  0.8754922176 -0.9912851440 -1.2410039359  0.6517782253
 [51]  0.6111571617 -0.8614418692 -0.7788511556  0.6359205701  0.0921420173
 [56]  1.5266790035 -0.3158742628  1.9425565788  0.3885399742 -0.9633732591
 [61] -0.9988696185  0.9162807773 -1.3116302123  0.0085045604  0.9073070986
 [66] -0.4117469301 -0.2576114335  1.0409042361 -0.1285904206 -2.1752125673
 [71]  0.0371336806 -2.4663309354  0.4751861208 -0.8838510556 -0.0938132285
 [76]  0.5831425168 -2.2752648660 -0.0409961462  1.7606755038  1.0816705818
 [81] -0.4109341824  0.7436142498  0.1586141375 -0.4658242778  0.2855966588
 [86]  0.5802649176  0.3629491259  0.9535606162 -0.5510056390  1.6889781084
 [91]  1.0264138382 -0.5945910290  0.2085753110  1.7612881922  0.1709703595
 [96] -1.4645310883 -0.0382595045 -0.4569668033 -1.4693212968  0.5775623819
> colSums(tmp)
  [1]  0.1982970542  2.9076209052 -0.5762875604 -0.1872004330 -1.4889626817
  [6]  1.1899194753  0.7045495460 -1.2253938017  0.7680511080  1.3841146111
 [11]  0.8784925984 -0.7127252635  0.0408402422  0.3859297811  1.0064965041
 [16] -1.0292228805  1.5005863117 -0.6679732618 -1.2223588870  0.7861584770
 [21]  1.3746080707 -0.9024760848  0.0449556760 -1.2255534108  0.5896026212
 [26]  0.6200610469  0.4406273174 -0.7463790262  2.1526276574  0.8474577835
 [31] -0.0459066679  0.2623459344  0.4489379982 -0.3022357003 -0.1877076757
 [36] -1.1475460904 -0.0677931191 -1.2611008822 -0.8449530976  0.0004995457
 [41] -0.3494630774  0.9204166477  0.0437914557 -1.1667360870 -1.0236098818
 [46] -0.1305069418  0.8754922176 -0.9912851440 -1.2410039359  0.6517782253
 [51]  0.6111571617 -0.8614418692 -0.7788511556  0.6359205701  0.0921420173
 [56]  1.5266790035 -0.3158742628  1.9425565788  0.3885399742 -0.9633732591
 [61] -0.9988696185  0.9162807773 -1.3116302123  0.0085045604  0.9073070986
 [66] -0.4117469301 -0.2576114335  1.0409042361 -0.1285904206 -2.1752125673
 [71]  0.0371336806 -2.4663309354  0.4751861208 -0.8838510556 -0.0938132285
 [76]  0.5831425168 -2.2752648660 -0.0409961462  1.7606755038  1.0816705818
 [81] -0.4109341824  0.7436142498  0.1586141375 -0.4658242778  0.2855966588
 [86]  0.5802649176  0.3629491259  0.9535606162 -0.5510056390  1.6889781084
 [91]  1.0264138382 -0.5945910290  0.2085753110  1.7612881922  0.1709703595
 [96] -1.4645310883 -0.0382595045 -0.4569668033 -1.4693212968  0.5775623819
> 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.1982970542  2.9076209052 -0.5762875604 -0.1872004330 -1.4889626817
  [6]  1.1899194753  0.7045495460 -1.2253938017  0.7680511080  1.3841146111
 [11]  0.8784925984 -0.7127252635  0.0408402422  0.3859297811  1.0064965041
 [16] -1.0292228805  1.5005863117 -0.6679732618 -1.2223588870  0.7861584770
 [21]  1.3746080707 -0.9024760848  0.0449556760 -1.2255534108  0.5896026212
 [26]  0.6200610469  0.4406273174 -0.7463790262  2.1526276574  0.8474577835
 [31] -0.0459066679  0.2623459344  0.4489379982 -0.3022357003 -0.1877076757
 [36] -1.1475460904 -0.0677931191 -1.2611008822 -0.8449530976  0.0004995457
 [41] -0.3494630774  0.9204166477  0.0437914557 -1.1667360870 -1.0236098818
 [46] -0.1305069418  0.8754922176 -0.9912851440 -1.2410039359  0.6517782253
 [51]  0.6111571617 -0.8614418692 -0.7788511556  0.6359205701  0.0921420173
 [56]  1.5266790035 -0.3158742628  1.9425565788  0.3885399742 -0.9633732591
 [61] -0.9988696185  0.9162807773 -1.3116302123  0.0085045604  0.9073070986
 [66] -0.4117469301 -0.2576114335  1.0409042361 -0.1285904206 -2.1752125673
 [71]  0.0371336806 -2.4663309354  0.4751861208 -0.8838510556 -0.0938132285
 [76]  0.5831425168 -2.2752648660 -0.0409961462  1.7606755038  1.0816705818
 [81] -0.4109341824  0.7436142498  0.1586141375 -0.4658242778  0.2855966588
 [86]  0.5802649176  0.3629491259  0.9535606162 -0.5510056390  1.6889781084
 [91]  1.0264138382 -0.5945910290  0.2085753110  1.7612881922  0.1709703595
 [96] -1.4645310883 -0.0382595045 -0.4569668033 -1.4693212968  0.5775623819
> colMin(tmp)
  [1]  0.1982970542  2.9076209052 -0.5762875604 -0.1872004330 -1.4889626817
  [6]  1.1899194753  0.7045495460 -1.2253938017  0.7680511080  1.3841146111
 [11]  0.8784925984 -0.7127252635  0.0408402422  0.3859297811  1.0064965041
 [16] -1.0292228805  1.5005863117 -0.6679732618 -1.2223588870  0.7861584770
 [21]  1.3746080707 -0.9024760848  0.0449556760 -1.2255534108  0.5896026212
 [26]  0.6200610469  0.4406273174 -0.7463790262  2.1526276574  0.8474577835
 [31] -0.0459066679  0.2623459344  0.4489379982 -0.3022357003 -0.1877076757
 [36] -1.1475460904 -0.0677931191 -1.2611008822 -0.8449530976  0.0004995457
 [41] -0.3494630774  0.9204166477  0.0437914557 -1.1667360870 -1.0236098818
 [46] -0.1305069418  0.8754922176 -0.9912851440 -1.2410039359  0.6517782253
 [51]  0.6111571617 -0.8614418692 -0.7788511556  0.6359205701  0.0921420173
 [56]  1.5266790035 -0.3158742628  1.9425565788  0.3885399742 -0.9633732591
 [61] -0.9988696185  0.9162807773 -1.3116302123  0.0085045604  0.9073070986
 [66] -0.4117469301 -0.2576114335  1.0409042361 -0.1285904206 -2.1752125673
 [71]  0.0371336806 -2.4663309354  0.4751861208 -0.8838510556 -0.0938132285
 [76]  0.5831425168 -2.2752648660 -0.0409961462  1.7606755038  1.0816705818
 [81] -0.4109341824  0.7436142498  0.1586141375 -0.4658242778  0.2855966588
 [86]  0.5802649176  0.3629491259  0.9535606162 -0.5510056390  1.6889781084
 [91]  1.0264138382 -0.5945910290  0.2085753110  1.7612881922  0.1709703595
 [96] -1.4645310883 -0.0382595045 -0.4569668033 -1.4693212968  0.5775623819
> colMedians(tmp)
  [1]  0.1982970542  2.9076209052 -0.5762875604 -0.1872004330 -1.4889626817
  [6]  1.1899194753  0.7045495460 -1.2253938017  0.7680511080  1.3841146111
 [11]  0.8784925984 -0.7127252635  0.0408402422  0.3859297811  1.0064965041
 [16] -1.0292228805  1.5005863117 -0.6679732618 -1.2223588870  0.7861584770
 [21]  1.3746080707 -0.9024760848  0.0449556760 -1.2255534108  0.5896026212
 [26]  0.6200610469  0.4406273174 -0.7463790262  2.1526276574  0.8474577835
 [31] -0.0459066679  0.2623459344  0.4489379982 -0.3022357003 -0.1877076757
 [36] -1.1475460904 -0.0677931191 -1.2611008822 -0.8449530976  0.0004995457
 [41] -0.3494630774  0.9204166477  0.0437914557 -1.1667360870 -1.0236098818
 [46] -0.1305069418  0.8754922176 -0.9912851440 -1.2410039359  0.6517782253
 [51]  0.6111571617 -0.8614418692 -0.7788511556  0.6359205701  0.0921420173
 [56]  1.5266790035 -0.3158742628  1.9425565788  0.3885399742 -0.9633732591
 [61] -0.9988696185  0.9162807773 -1.3116302123  0.0085045604  0.9073070986
 [66] -0.4117469301 -0.2576114335  1.0409042361 -0.1285904206 -2.1752125673
 [71]  0.0371336806 -2.4663309354  0.4751861208 -0.8838510556 -0.0938132285
 [76]  0.5831425168 -2.2752648660 -0.0409961462  1.7606755038  1.0816705818
 [81] -0.4109341824  0.7436142498  0.1586141375 -0.4658242778  0.2855966588
 [86]  0.5802649176  0.3629491259  0.9535606162 -0.5510056390  1.6889781084
 [91]  1.0264138382 -0.5945910290  0.2085753110  1.7612881922  0.1709703595
 [96] -1.4645310883 -0.0382595045 -0.4569668033 -1.4693212968  0.5775623819
> colRanges(tmp)
          [,1]     [,2]       [,3]       [,4]      [,5]     [,6]      [,7]
[1,] 0.1982971 2.907621 -0.5762876 -0.1872004 -1.488963 1.189919 0.7045495
[2,] 0.1982971 2.907621 -0.5762876 -0.1872004 -1.488963 1.189919 0.7045495
          [,8]      [,9]    [,10]     [,11]      [,12]      [,13]     [,14]
[1,] -1.225394 0.7680511 1.384115 0.8784926 -0.7127253 0.04084024 0.3859298
[2,] -1.225394 0.7680511 1.384115 0.8784926 -0.7127253 0.04084024 0.3859298
        [,15]     [,16]    [,17]      [,18]     [,19]     [,20]    [,21]
[1,] 1.006497 -1.029223 1.500586 -0.6679733 -1.222359 0.7861585 1.374608
[2,] 1.006497 -1.029223 1.500586 -0.6679733 -1.222359 0.7861585 1.374608
          [,22]      [,23]     [,24]     [,25]    [,26]     [,27]     [,28]
[1,] -0.9024761 0.04495568 -1.225553 0.5896026 0.620061 0.4406273 -0.746379
[2,] -0.9024761 0.04495568 -1.225553 0.5896026 0.620061 0.4406273 -0.746379
        [,29]     [,30]       [,31]     [,32]    [,33]      [,34]      [,35]
[1,] 2.152628 0.8474578 -0.04590667 0.2623459 0.448938 -0.3022357 -0.1877077
[2,] 2.152628 0.8474578 -0.04590667 0.2623459 0.448938 -0.3022357 -0.1877077
         [,36]       [,37]     [,38]      [,39]        [,40]      [,41]
[1,] -1.147546 -0.06779312 -1.261101 -0.8449531 0.0004995457 -0.3494631
[2,] -1.147546 -0.06779312 -1.261101 -0.8449531 0.0004995457 -0.3494631
         [,42]      [,43]     [,44]    [,45]      [,46]     [,47]      [,48]
[1,] 0.9204166 0.04379146 -1.166736 -1.02361 -0.1305069 0.8754922 -0.9912851
[2,] 0.9204166 0.04379146 -1.166736 -1.02361 -0.1305069 0.8754922 -0.9912851
         [,49]     [,50]     [,51]      [,52]      [,53]     [,54]      [,55]
[1,] -1.241004 0.6517782 0.6111572 -0.8614419 -0.7788512 0.6359206 0.09214202
[2,] -1.241004 0.6517782 0.6111572 -0.8614419 -0.7788512 0.6359206 0.09214202
        [,56]      [,57]    [,58]   [,59]      [,60]      [,61]     [,62]
[1,] 1.526679 -0.3158743 1.942557 0.38854 -0.9633733 -0.9988696 0.9162808
[2,] 1.526679 -0.3158743 1.942557 0.38854 -0.9633733 -0.9988696 0.9162808
        [,63]      [,64]     [,65]      [,66]      [,67]    [,68]      [,69]
[1,] -1.31163 0.00850456 0.9073071 -0.4117469 -0.2576114 1.040904 -0.1285904
[2,] -1.31163 0.00850456 0.9073071 -0.4117469 -0.2576114 1.040904 -0.1285904
         [,70]      [,71]     [,72]     [,73]      [,74]       [,75]     [,76]
[1,] -2.175213 0.03713368 -2.466331 0.4751861 -0.8838511 -0.09381323 0.5831425
[2,] -2.175213 0.03713368 -2.466331 0.4751861 -0.8838511 -0.09381323 0.5831425
         [,77]       [,78]    [,79]    [,80]      [,81]     [,82]     [,83]
[1,] -2.275265 -0.04099615 1.760676 1.081671 -0.4109342 0.7436142 0.1586141
[2,] -2.275265 -0.04099615 1.760676 1.081671 -0.4109342 0.7436142 0.1586141
          [,84]     [,85]     [,86]     [,87]     [,88]      [,89]    [,90]
[1,] -0.4658243 0.2855967 0.5802649 0.3629491 0.9535606 -0.5510056 1.688978
[2,] -0.4658243 0.2855967 0.5802649 0.3629491 0.9535606 -0.5510056 1.688978
        [,91]     [,92]     [,93]    [,94]     [,95]     [,96]      [,97]
[1,] 1.026414 -0.594591 0.2085753 1.761288 0.1709704 -1.464531 -0.0382595
[2,] 1.026414 -0.594591 0.2085753 1.761288 0.1709704 -1.464531 -0.0382595
          [,98]     [,99]    [,100]
[1,] -0.4569668 -1.469321 0.5775624
[2,] -0.4569668 -1.469321 0.5775624
> 
> 
> Max(tmp2)
[1] 2.826684
> Min(tmp2)
[1] -2.121732
> mean(tmp2)
[1] 0.1408192
> Sum(tmp2)
[1] 14.08192
> Var(tmp2)
[1] 1.082989
> 
> rowMeans(tmp2)
  [1]  0.7976614449 -1.2575368953  0.2334617144 -0.5390310938 -0.3032363193
  [6] -0.1251638340  1.2920972872  0.4426417110 -0.3204030282  0.6208987936
 [11]  0.9528292793  1.2195944700 -0.7536693822  1.6741329212  0.0514828239
 [16] -1.3104392298 -1.1353261740 -0.7781482774 -0.4319665172  1.0002697768
 [21]  0.6504770483  1.5290070477 -0.9160970763 -0.9411092813  1.4185913621
 [26]  0.1570323145  0.9828201286  1.1619904388  0.5231244093 -0.4973783370
 [31] -0.0002813796 -1.8197856389 -1.6479691975 -0.3283955108 -0.7233960555
 [36] -2.0261919053  2.8266842406 -0.4234423550 -1.0413722342 -1.0313668971
 [41]  0.5813499456 -0.5672738901  1.1034697951 -0.2273929450  1.3043246048
 [46]  0.3448917809  0.8414990485  1.6232117136 -1.6322234262 -0.3334772950
 [51] -0.6702078756 -0.1298583196  0.1728347137  0.2391782739 -0.0948429116
 [56]  1.4629522319  1.3543415934  0.2654116345 -0.6439977221  2.3890608444
 [61]  0.4343796525  0.6336823705 -0.0942712632 -0.1329281034  2.0322354883
 [66] -0.5540766541  1.1144670597 -1.6880750574 -1.0406707663  0.5170928254
 [71] -0.1821217394  0.8460626106  0.6500223498  0.8978831906 -0.4550459878
 [76] -0.6888255265  0.6643134895 -1.2927318811  0.2077209663 -0.7589686896
 [81]  2.1100254701  0.5697765734 -0.4557291637  0.5030609848 -0.5365588207
 [86]  2.5302508073  0.1654886594 -1.2576489132  0.7056407279  0.4729848845
 [91] -2.1217322670 -1.0410798386  0.1338956520  1.2225372627  1.6905431172
 [96]  0.1739593419  0.6789511418  1.3417585203 -0.0666142353 -0.4140724400
> rowSums(tmp2)
  [1]  0.7976614449 -1.2575368953  0.2334617144 -0.5390310938 -0.3032363193
  [6] -0.1251638340  1.2920972872  0.4426417110 -0.3204030282  0.6208987936
 [11]  0.9528292793  1.2195944700 -0.7536693822  1.6741329212  0.0514828239
 [16] -1.3104392298 -1.1353261740 -0.7781482774 -0.4319665172  1.0002697768
 [21]  0.6504770483  1.5290070477 -0.9160970763 -0.9411092813  1.4185913621
 [26]  0.1570323145  0.9828201286  1.1619904388  0.5231244093 -0.4973783370
 [31] -0.0002813796 -1.8197856389 -1.6479691975 -0.3283955108 -0.7233960555
 [36] -2.0261919053  2.8266842406 -0.4234423550 -1.0413722342 -1.0313668971
 [41]  0.5813499456 -0.5672738901  1.1034697951 -0.2273929450  1.3043246048
 [46]  0.3448917809  0.8414990485  1.6232117136 -1.6322234262 -0.3334772950
 [51] -0.6702078756 -0.1298583196  0.1728347137  0.2391782739 -0.0948429116
 [56]  1.4629522319  1.3543415934  0.2654116345 -0.6439977221  2.3890608444
 [61]  0.4343796525  0.6336823705 -0.0942712632 -0.1329281034  2.0322354883
 [66] -0.5540766541  1.1144670597 -1.6880750574 -1.0406707663  0.5170928254
 [71] -0.1821217394  0.8460626106  0.6500223498  0.8978831906 -0.4550459878
 [76] -0.6888255265  0.6643134895 -1.2927318811  0.2077209663 -0.7589686896
 [81]  2.1100254701  0.5697765734 -0.4557291637  0.5030609848 -0.5365588207
 [86]  2.5302508073  0.1654886594 -1.2576489132  0.7056407279  0.4729848845
 [91] -2.1217322670 -1.0410798386  0.1338956520  1.2225372627  1.6905431172
 [96]  0.1739593419  0.6789511418  1.3417585203 -0.0666142353 -0.4140724400
> 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.7976614449 -1.2575368953  0.2334617144 -0.5390310938 -0.3032363193
  [6] -0.1251638340  1.2920972872  0.4426417110 -0.3204030282  0.6208987936
 [11]  0.9528292793  1.2195944700 -0.7536693822  1.6741329212  0.0514828239
 [16] -1.3104392298 -1.1353261740 -0.7781482774 -0.4319665172  1.0002697768
 [21]  0.6504770483  1.5290070477 -0.9160970763 -0.9411092813  1.4185913621
 [26]  0.1570323145  0.9828201286  1.1619904388  0.5231244093 -0.4973783370
 [31] -0.0002813796 -1.8197856389 -1.6479691975 -0.3283955108 -0.7233960555
 [36] -2.0261919053  2.8266842406 -0.4234423550 -1.0413722342 -1.0313668971
 [41]  0.5813499456 -0.5672738901  1.1034697951 -0.2273929450  1.3043246048
 [46]  0.3448917809  0.8414990485  1.6232117136 -1.6322234262 -0.3334772950
 [51] -0.6702078756 -0.1298583196  0.1728347137  0.2391782739 -0.0948429116
 [56]  1.4629522319  1.3543415934  0.2654116345 -0.6439977221  2.3890608444
 [61]  0.4343796525  0.6336823705 -0.0942712632 -0.1329281034  2.0322354883
 [66] -0.5540766541  1.1144670597 -1.6880750574 -1.0406707663  0.5170928254
 [71] -0.1821217394  0.8460626106  0.6500223498  0.8978831906 -0.4550459878
 [76] -0.6888255265  0.6643134895 -1.2927318811  0.2077209663 -0.7589686896
 [81]  2.1100254701  0.5697765734 -0.4557291637  0.5030609848 -0.5365588207
 [86]  2.5302508073  0.1654886594 -1.2576489132  0.7056407279  0.4729848845
 [91] -2.1217322670 -1.0410798386  0.1338956520  1.2225372627  1.6905431172
 [96]  0.1739593419  0.6789511418  1.3417585203 -0.0666142353 -0.4140724400
> rowMin(tmp2)
  [1]  0.7976614449 -1.2575368953  0.2334617144 -0.5390310938 -0.3032363193
  [6] -0.1251638340  1.2920972872  0.4426417110 -0.3204030282  0.6208987936
 [11]  0.9528292793  1.2195944700 -0.7536693822  1.6741329212  0.0514828239
 [16] -1.3104392298 -1.1353261740 -0.7781482774 -0.4319665172  1.0002697768
 [21]  0.6504770483  1.5290070477 -0.9160970763 -0.9411092813  1.4185913621
 [26]  0.1570323145  0.9828201286  1.1619904388  0.5231244093 -0.4973783370
 [31] -0.0002813796 -1.8197856389 -1.6479691975 -0.3283955108 -0.7233960555
 [36] -2.0261919053  2.8266842406 -0.4234423550 -1.0413722342 -1.0313668971
 [41]  0.5813499456 -0.5672738901  1.1034697951 -0.2273929450  1.3043246048
 [46]  0.3448917809  0.8414990485  1.6232117136 -1.6322234262 -0.3334772950
 [51] -0.6702078756 -0.1298583196  0.1728347137  0.2391782739 -0.0948429116
 [56]  1.4629522319  1.3543415934  0.2654116345 -0.6439977221  2.3890608444
 [61]  0.4343796525  0.6336823705 -0.0942712632 -0.1329281034  2.0322354883
 [66] -0.5540766541  1.1144670597 -1.6880750574 -1.0406707663  0.5170928254
 [71] -0.1821217394  0.8460626106  0.6500223498  0.8978831906 -0.4550459878
 [76] -0.6888255265  0.6643134895 -1.2927318811  0.2077209663 -0.7589686896
 [81]  2.1100254701  0.5697765734 -0.4557291637  0.5030609848 -0.5365588207
 [86]  2.5302508073  0.1654886594 -1.2576489132  0.7056407279  0.4729848845
 [91] -2.1217322670 -1.0410798386  0.1338956520  1.2225372627  1.6905431172
 [96]  0.1739593419  0.6789511418  1.3417585203 -0.0666142353 -0.4140724400
> 
> colMeans(tmp2)
[1] 0.1408192
> colSums(tmp2)
[1] 14.08192
> colVars(tmp2)
[1] 1.082989
> colSd(tmp2)
[1] 1.040668
> colMax(tmp2)
[1] 2.826684
> colMin(tmp2)
[1] -2.121732
> colMedians(tmp2)
[1] 0.1612605
> colRanges(tmp2)
          [,1]
[1,] -2.121732
[2,]  2.826684
> 
> dataset1 <- matrix(dataset1,1,100)
> 
> agree.checks(tmp,dataset1)
> 
> dataset2 <- matrix(dataset2,100,1)
> agree.checks(tmp2,dataset2)
>   
> 
> tmp <- createBufferedMatrix(10,10)
> 
> tmp[1:10,1:10] <- rnorm(100)
> colApply(tmp,sum)
 [1]  2.6189775 -1.6129432 -2.5261808  1.9868705  0.1073277 -4.4471777
 [7]  1.4716225  1.9499566 -6.6820872 -3.2451111
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -1.8831453
[2,] -0.6053791
[3,]  0.3571460
[4,]  0.9932893
[5,]  2.8764459
> 
> rowApply(tmp,sum)
 [1] -6.8172713066 -5.7794823911  2.7319570151  0.0005465904 -1.5332043681
 [6]  2.7427601980  1.9736601107 -3.6183152570  0.8819708591 -0.9613667007
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]   10   10    8    1   10    1    6    6    3     4
 [2,]    5    9    4    8    2    9    5    3    5     3
 [3,]    1    1   10    4    8    5   10    7    8     1
 [4,]    8    8    7    7    3    4    9    5    6    10
 [5,]    7    5    6    5    1    8    7    2    9     7
 [6,]    3    4    1    6    4   10    3    1    4     6
 [7,]    6    7    9   10    7    3    4    4    1     9
 [8,]    9    6    5    2    9    2    8    8   10     8
 [9,]    2    2    2    9    6    6    1    9    2     2
[10,]    4    3    3    3    5    7    2   10    7     5
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1] -0.3734690  3.1734021 -2.1991934  0.3117554  1.2328364  2.4773198
 [7] -4.2912460 -3.0995415 -0.6720699 -2.4802047  1.4463934 -2.6326067
[13] -1.3576742  1.8007569 -5.8204205  1.1207564  1.2890348  0.4528402
[19]  2.3400360 -1.6582699
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -0.9314761
[2,] -0.5555473
[3,]  0.1221668
[4,]  0.1462020
[5,]  0.8451856
> 
> rowApply(tmp,sum)
[1] -6.452224 -1.073647  2.146257 -5.597453  2.037503
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]    9   12   16    6   11
[2,]   14   17   19   19    2
[3,]   13    4   17    1   10
[4,]   17   13   12    5    7
[5,]    5   16   18   16    8
> 
> 
> as.matrix(tmp)
           [,1]       [,2]        [,3]       [,4]        [,5]       [,6]
[1,] -0.5555473  0.3144336  0.12978689  0.9647630 -1.35058098  0.6672719
[2,]  0.1221668  1.0080764 -0.87403530  0.1224877  0.82382910  0.7438214
[3,]  0.8451856  1.2913139  1.07774535  0.3688987  1.19076016 -1.3764650
[4,] -0.9314761  1.3249955 -2.59221550 -0.9980222  0.61704081  1.5119290
[5,]  0.1462020 -0.7654172  0.05952517 -0.1463718 -0.04821274  0.9307626
           [,7]       [,8]       [,9]       [,10]       [,11]      [,12]
[1,] -2.0446911 -2.2875872  1.0682035  0.01500324 -1.98851119 -0.5245264
[2,] -1.2061994 -1.7523062 -1.2160368  0.41478757 -0.19978672 -0.8715476
[3,] -1.4688058  0.6316178  0.2961970 -0.37795826  0.02616647 -0.1179678
[4,] -0.6622424 -0.2499998 -1.0026231 -2.15088432  0.93999175 -0.5290736
[5,]  1.0906928  0.5587339  0.1821895 -0.38115291  2.66853313 -0.5894913
           [,13]       [,14]     [,15]       [,16]      [,17]      [,18]
[1,]  1.16081138  1.36792035 -1.289147 -0.08594066 -0.6624616 -0.6261917
[2,] -0.41403500 -0.59104656  1.527124  1.44914142 -0.5364978 -0.4984308
[3,] -1.53621890  0.63576719 -1.439729 -0.12921950  0.6911368  0.1489294
[4,] -0.01865003  0.36729880 -2.001868 -0.27606758  1.1552298  0.2970545
[5,] -0.54958166  0.02081716 -2.616801  0.16284273  0.6416276  1.1314787
           [,19]      [,20]
[1,]  0.73361876 -1.4588511
[2,] -0.29724764  1.1720886
[3,]  1.52111779 -0.1322158
[4,]  0.09923797 -0.4971086
[5,]  0.28330917 -0.7421831
> 
> 
> 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.21-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.21-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  649  bytes.
Disk usage :  200  bytes.
> subBufferedMatrix(tmp,,5:8)
BufferedMatrix object
Matrix size:  5 4 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.21-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.21-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  480  bytes.
> 
> 
> rm(tmp)
> 
> 
> ###
> ### Testing colnames and rownames
> ###
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> 
> 
> colnames(tmp)
NULL
> rownames(tmp)
NULL
> 
> 
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> colnames(tmp)
 [1] "col1"  "col2"  "col3"  "col4"  "col5"  "col6"  "col7"  "col8"  "col9" 
[10] "col10" "col11" "col12" "col13" "col14" "col15" "col16" "col17" "col18"
[19] "col19" "col20"
> rownames(tmp)
[1] "row1" "row2" "row3" "row4" "row5"
> 
> 
> tmp["row1",]
         col1       col2       col3       col4      col5     col6       col7
row1 1.095096 -0.3250792 -0.3920108 -0.2835622 -1.029935 1.807829 -0.3380645
           col8       col9    col10     col11      col12      col13     col14
row1 -0.6495735 -0.3740537 1.009107 0.2398415 -0.8493229 -0.4866743 0.4970259
        col15    col16    col17     col18      col19     col20
row1 0.281381 1.285866 1.054663 -0.821194 -0.4473865 -1.770134
> tmp[,"col10"]
            col10
row1  1.009107376
row2  1.964976843
row3 -0.506955314
row4 -0.009168832
row5 -0.315518605
> tmp[c("row1","row5"),]
           col1       col2       col3       col4       col5     col6       col7
row1 1.09509620 -0.3250792 -0.3920108 -0.2835622 -1.0299353 1.807829 -0.3380645
row5 0.09691852 -0.2857753  0.4687197 -0.8032733 -0.5101975 1.063830 -0.1458525
           col8       col9      col10     col11      col12      col13
row1 -0.6495735 -0.3740537  1.0091074 0.2398415 -0.8493229 -0.4866743
row5  0.2556179 -0.4989090 -0.3155186 0.5478078 -0.5755873 -1.5044277
          col14    col15    col16     col17      col18      col19     col20
row1  0.4970259 0.281381 1.285866 1.0546631 -0.8211940 -0.4473865 -1.770134
row5 -0.1307291 1.002530 1.148027 0.6144071 -0.0611371  1.7657986  1.114025
> tmp[,c("col6","col20")]
           col6      col20
row1  1.8078288 -1.7701344
row2  1.3263038 -0.6993058
row3 -0.2853995 -0.4654967
row4 -1.2671616 -0.3265293
row5  1.0638301  1.1140249
> tmp[c("row1","row5"),c("col6","col20")]
         col6     col20
row1 1.807829 -1.770134
row5 1.063830  1.114025
> 
> 
> 
> 
> 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.11752 49.40301 49.54987 49.58291 50.20872 105.805 52.37102 51.51475
         col9   col10    col11    col12    col13    col14    col15    col16
row1 50.68869 48.6201 49.56159 48.09588 50.02667 49.20227 49.47693 50.01065
        col17    col18    col19    col20
row1 52.38774 49.66092 52.14357 103.9695
> tmp[,"col10"]
        col10
row1 48.62010
row2 28.20005
row3 29.38313
row4 31.10293
row5 50.45866
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 50.11752 49.40301 49.54987 49.58291 50.20872 105.8050 52.37102 51.51475
row5 49.81038 49.65729 49.18567 49.08518 50.37673 104.3426 49.80765 48.70704
         col9    col10    col11    col12    col13    col14    col15    col16
row1 50.68869 48.62010 49.56159 48.09588 50.02667 49.20227 49.47693 50.01065
row5 51.84850 50.45866 47.57112 50.26243 48.35040 48.86940 49.24358 50.68397
        col17    col18    col19    col20
row1 52.38774 49.66092 52.14357 103.9695
row5 49.78653 48.75440 50.62223 103.4955
> tmp[,c("col6","col20")]
          col6     col20
row1 105.80504 103.96953
row2  75.99990  75.10261
row3  76.95144  75.48269
row4  75.03374  75.19777
row5 104.34264 103.49553
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 105.8050 103.9695
row5 104.3426 103.4955
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 105.8050 103.9695
row5 104.3426 103.4955
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
          col13
[1,] -0.2693996
[2,] -0.6028831
[3,]  0.7855373
[4,] -0.8913048
[5,] -0.3109250
> tmp[,c("col17","col7")]
          col17       col7
[1,] -1.1443238  0.4439894
[2,] -0.8515888 -0.5804910
[3,] -1.2669018 -0.1713060
[4,] -2.0429971  1.1042095
[5,]  0.6009649 -0.6914333
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
           col6      col20
[1,] -0.9538482  0.1486920
[2,] -2.4050168  1.4120612
[3,] -0.4539150  0.3784100
[4,] -0.8264679 -0.6506217
[5,] -0.2104551 -0.5365796
> subBufferedMatrix(tmp,1,c("col6"))[,1]
           col1
[1,] -0.9538482
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
           col6
[1,] -0.9538482
[2,] -2.4050168
> 
> 
> 
> 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.9632514 -0.554666  0.3577836 -0.5790516 -0.3927148 -0.18939938 1.253609
row1 -0.4167480 -1.110486 -0.7071684 -1.2887514  0.9596130  0.07114093 1.419203
          [,8]        [,9]      [,10]     [,11]      [,12]     [,13]      [,14]
row3 -1.312251 -0.02810493 -0.3533841 0.3129505 -2.1332794 0.2963671 -0.6481955
row1 -1.911532 -1.00958103  0.9657890 0.8549715 -0.1586905 0.5834766  0.2618871
          [,15]      [,16]      [,17]       [,18]      [,19]     [,20]
row3 -0.7960722 -0.5199614 -0.8373746  0.04210276 -0.1096002 0.5473868
row1  1.4987635 -0.2466139 -1.5040563 -0.77166764  0.1440363 1.0121679
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
           [,1]      [,2]      [,3]     [,4]        [,5]     [,6]       [,7]
row2 -0.9204365 -2.301505 0.5313908 1.817532 -0.08340382 1.007363 -0.2568127
         [,8]      [,9]     [,10]
row2 0.609881 0.5210246 -0.153139
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
          [,1]     [,2]      [,3]     [,4]     [,5]     [,6]      [,7]     [,8]
row5 -1.585164 0.279515 0.4991652 1.290348 1.056539 0.339459 -1.714814 1.046798
         [,9]     [,10]     [,11]     [,12]      [,13]     [,14]      [,15]
row5 2.483531 0.5083054 0.3662843 -1.987352 -0.1036256 0.6053252 -0.5233082
         [,16]     [,17]    [,18]     [,19]      [,20]
row5 -1.012888 0.3553805 2.681153 -1.721402 -0.3076612
> 
> 
> 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: 0x600003b04420>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM625513d6a2ed"
 [2] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM625570627fc7"
 [3] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM625552b31b75"
 [4] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM62556ccfc8bd"
 [5] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM62553d84281a"
 [6] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM62552f64e283"
 [7] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM62558531ec4" 
 [8] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM6255908da21" 
 [9] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM62552428b129"
[10] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM62556b870d4a"
[11] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM62556f79ac6c"
[12] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM62551d271fa1"
[13] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM6255738d91fa"
[14] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM6255536aef5a"
[15] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM62551188287f"
> 
> 
> ### 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: 0x600003bb0060>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x600003bb0060>
Warning message:
In dir.create(new.directory) :
  '/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x600003bb0060>
> rowMedians(tmp)
  [1] -0.549494191  0.092290094  0.039427362 -0.243820708  0.012617790
  [6]  0.334345994  0.115995116  0.075044214  0.007911534  0.080908474
 [11]  0.095508228  0.333405122  0.515107842 -0.171394798  0.193489148
 [16]  0.503925612  0.551766844 -0.054936100 -0.481904922 -0.314714289
 [21]  0.471412127 -0.044177416  0.476673916  0.475767467 -0.310438406
 [26]  0.020678947 -0.261753127 -0.084521599  0.563964940 -0.065781537
 [31]  0.047116102 -0.141504076 -0.009588035  0.132849524 -0.193819926
 [36]  0.711655903  0.040120048 -0.137327931  0.046686185 -0.403374880
 [41]  0.277488197 -0.176486184 -0.176238814 -0.283574243  0.012828882
 [46]  0.730306015 -0.414582552  0.215501683  0.039098661  0.113085475
 [51] -0.305307217  0.445182601  0.132070553 -0.100387045 -0.565450857
 [56] -0.093323323  0.094565310  0.193407487 -0.095293353 -0.186560521
 [61]  0.325127827  0.322205097 -0.213835063  0.002519697  0.011999546
 [66] -0.084142204  0.355483541  0.557299925 -0.610774385  0.308894725
 [71]  0.083258994  0.022787612  0.122123439 -0.478465468 -0.035088237
 [76]  0.008920895  0.200726971 -0.052916706 -0.761687161  0.049400457
 [81] -0.227361809 -0.028334917 -0.490114730  0.187147355 -0.131567174
 [86] -0.148716251  0.061315075 -0.185129545 -0.356759318  0.581512005
 [91]  0.275387627 -0.241948829  0.191321287 -0.003225681 -0.010900498
 [96]  0.721082163  0.114153636  0.052862384 -0.022275300 -0.340546488
[101]  0.147737030  0.454143981  0.431374464 -0.013300475  0.181783130
[106] -0.040157240  0.031754285  0.629849225  0.533915300 -0.445927169
[111] -0.499820976 -0.049819836  0.195128627  0.307015217 -0.365405060
[116]  0.100642632  0.166812615 -0.227579770 -0.492517640 -0.095168172
[121]  0.177469274  0.552258239 -0.335119533 -0.195477521 -0.149661529
[126]  0.274586711 -0.319431961  0.177401855  0.167481736  0.149666618
[131]  0.247469645 -0.043520790 -0.563103323  0.291035952 -0.350550247
[136] -0.130902484 -0.323360238 -0.144082453 -0.140700081  0.271347066
[141] -0.362812794 -0.244877334 -0.094619194  0.109761547  0.541426583
[146]  0.318298883  0.718680814 -0.442064871 -0.690609428  0.093573454
[151] -0.326216581  0.239800169  0.548962562 -0.229405686  0.281186514
[156] -0.114763091  0.071735608 -0.104536455  0.125221060  0.686715129
[161]  0.181399161  0.207523277  0.058512940 -0.492627472  0.292813918
[166] -0.195272540 -0.554502494  0.141456410  0.280340828 -0.201197635
[171] -0.233889511  0.312740466 -0.166362695  0.149699109 -0.227100446
[176]  0.199089816 -0.129835669  0.331868400 -0.258038696  0.218166815
[181]  0.155542532 -0.113721437  0.031058077 -0.233646513  0.697991180
[186]  0.017168981  0.003313714 -0.140515709 -0.012868351 -0.559534118
[191]  0.513928591 -0.197212076 -0.349952203  0.060484720  0.467971023
[196] -0.334683497 -0.321965420  0.194542948 -0.140731173 -0.102370099
[201] -0.120151013 -0.686640715  0.310407720 -0.054611893  0.081067242
[206] -0.016709876  0.328165180 -0.319119911  0.766446082  0.315397710
[211]  0.069188038  0.638912474  0.585589536 -0.673102321 -0.400410597
[216] -0.240237452  0.390092976 -0.520991497  0.128577258 -0.093764988
[221] -0.637493079  0.765649420  0.336600357 -0.116301061  0.049133174
[226] -0.022117340 -0.048960536 -0.362591558 -0.027944585  0.299375312
> 
> proc.time()
   user  system elapsed 
  2.721  16.766  20.121 

BufferedMatrix.Rcheck/tests/rawCalltesting.Rout


R version 4.5.0 RC (2025-04-04 r88126) -- "How About a Twenty-Six"
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: 0x6000006a00c0>
> .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: 0x6000006a00c0>
> .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: 0x6000006a00c0>
> .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: 0x6000006a00c0>
> 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: 0x600000694000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600000694000>
> .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: 0x600000694000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600000694000>
> .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: 0x600000694000>
> 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: 0x6000006c8180>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000006c8180>
> .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: 0x6000006c8180>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x6000006c8180>
> .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: 0x6000006c8180>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x6000006c8180>
> .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: 0x6000006c8180>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x6000006c8180>
> .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: 0x6000006c8180>
> 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: 0x6000006e0060>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x6000006e0060>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000006e0060>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000006e0060>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile672d4ab363a6" "BufferedMatrixFile672d529557bd"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile672d4ab363a6" "BufferedMatrixFile672d529557bd"
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000006e4060>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000006e4060>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x6000006e4060>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x6000006e4060>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x6000006e4060>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x6000006e4060>
> .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: 0x600000680000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600000680000>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x600000680000>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x600000680000>
> 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: 0x6000006e41e0>
> .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: 0x6000006e41e0>
> rm(P)
> 
> proc.time()
   user  system elapsed 
  0.362   0.168   0.519 

BufferedMatrix.Rcheck/tests/Rcodetesting.Rout


R version 4.5.0 RC (2025-04-04 r88126) -- "How About a Twenty-Six"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: x86_64-apple-darwin20

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

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

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

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

Attaching package: 'BufferedMatrix'

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

    colMeans, colSums, rowMeans, rowSums

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

Example timings