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

This page was generated on 2025-08-18 11:43 -0400 (Mon, 18 Aug 2025).

HostnameOSArch (*)R versionInstalled pkgs
nebbiolo1Linux (Ubuntu 24.04.3 LTS)x86_644.5.1 (2025-06-13) -- "Great Square Root" 4824
palomino7Windows Server 2022 Datacenterx644.5.1 (2025-06-13 ucrt) -- "Great Square Root" 4566
merida1macOS 12.7.5 Montereyx86_644.5.1 RC (2025-06-05 r88288) -- "Great Square Root" 4604
kjohnson1macOS 13.6.6 Venturaarm644.5.1 Patched (2025-06-14 r88325) -- "Great Square Root" 4545
kunpeng2Linux (openEuler 24.03 LTS)aarch64R Under development (unstable) (2025-02-19 r87757) -- "Unsuffered Consequences" 4579
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-08-14 13:40 -0400 (Thu, 14 Aug 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.3 LTS) / x86_64  OK    OK    OK  UNNEEDED, same version is already published
palomino7Windows Server 2022 Datacenter / x64  OK    OK    OK    OK  UNNEEDED, same version is already published
merida1macOS 12.7.5 Monterey / x86_64  OK    OK    WARNINGS    OK  UNNEEDED, same version is already published
kjohnson1macOS 13.6.6 Ventura / arm64  OK    OK    WARNINGS    OK  UNNEEDED, same version is already published
kunpeng2Linux (openEuler 24.03 LTS) / aarch64  OK    OK    OK  


CHECK results for BufferedMatrix on merida1

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

raw results


Summary

Package: BufferedMatrix
Version: 1.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-08-15 00:48:18 -0400 (Fri, 15 Aug 2025)
EndedAt: 2025-08-15 00:49:29 -0400 (Fri, 15 Aug 2025)
EllapsedTime: 71.4 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.1 RC (2025-06-05 r88288)
* 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.1 RC (2025-06-05 r88288) -- "Great Square Root"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: x86_64-apple-darwin20

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

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

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

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

Attaching package: 'BufferedMatrix'

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

    colMeans, colSums, rowMeans, rowSums

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

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

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

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

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

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

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

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

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

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

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

[[1]]
[1] 0

> 
> proc.time()
   user  system elapsed 
  0.578   0.205   0.743 

BufferedMatrix.Rcheck/tests/objectTesting.Rout


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

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

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

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

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

Attaching package: 'BufferedMatrix'

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

    colMeans, colSums, rowMeans, rowSums

> 
> 
> ### this is used to control how many repetitions in something below
> ### higher values result in more checks.
> nreps <-100 ##20000
> 
> 
> ## test creation and some simple assignments and subsetting operations
> 
> ## first on single elements
> tmp <- createBufferedMatrix(1000,10)
> 
> tmp[10,5]
[1] 0
> tmp[10,5] <- 10
> tmp[10,5]
[1] 10
> tmp[10,5] <- 12.445
> tmp[10,5]
[1] 12.445
> 
> 
> 
> ## now testing accessing multiple elements
> tmp2 <- createBufferedMatrix(10,20)
> 
> 
> tmp2[3,1] <- 51.34
> tmp2[9,2] <- 9.87654
> tmp2[,1:2]
       [,1]    [,2]
 [1,]  0.00 0.00000
 [2,]  0.00 0.00000
 [3,] 51.34 0.00000
 [4,]  0.00 0.00000
 [5,]  0.00 0.00000
 [6,]  0.00 0.00000
 [7,]  0.00 0.00000
 [8,]  0.00 0.00000
 [9,]  0.00 9.87654
[10,]  0.00 0.00000
> tmp2[,-(3:20)]
       [,1]    [,2]
 [1,]  0.00 0.00000
 [2,]  0.00 0.00000
 [3,] 51.34 0.00000
 [4,]  0.00 0.00000
 [5,]  0.00 0.00000
 [6,]  0.00 0.00000
 [7,]  0.00 0.00000
 [8,]  0.00 0.00000
 [9,]  0.00 9.87654
[10,]  0.00 0.00000
> tmp2[3,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
[1,] 51.34    0    0    0    0    0    0    0    0     0     0     0     0
     [,14] [,15] [,16] [,17] [,18] [,19] [,20]
[1,]     0     0     0     0     0     0     0
> tmp2[-3,]
      [,1]    [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [2,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [3,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [4,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [5,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [6,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [7,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [8,]    0 9.87654    0    0    0    0    0    0    0     0     0     0     0
 [9,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
      [,14] [,15] [,16] [,17] [,18] [,19] [,20]
 [1,]     0     0     0     0     0     0     0
 [2,]     0     0     0     0     0     0     0
 [3,]     0     0     0     0     0     0     0
 [4,]     0     0     0     0     0     0     0
 [5,]     0     0     0     0     0     0     0
 [6,]     0     0     0     0     0     0     0
 [7,]     0     0     0     0     0     0     0
 [8,]     0     0     0     0     0     0     0
 [9,]     0     0     0     0     0     0     0
> tmp2[2,1:3]
     [,1] [,2] [,3]
[1,]    0    0    0
> tmp2[3:9,1:3]
      [,1]    [,2] [,3]
[1,] 51.34 0.00000    0
[2,]  0.00 0.00000    0
[3,]  0.00 0.00000    0
[4,]  0.00 0.00000    0
[5,]  0.00 0.00000    0
[6,]  0.00 0.00000    0
[7,]  0.00 9.87654    0
> tmp2[-4,-4]
       [,1]    [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [2,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [3,] 51.34 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [4,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [5,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [6,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [7,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [8,]  0.00 9.87654    0    0    0    0    0    0    0     0     0     0     0
 [9,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
      [,14] [,15] [,16] [,17] [,18] [,19]
 [1,]     0     0     0     0     0     0
 [2,]     0     0     0     0     0     0
 [3,]     0     0     0     0     0     0
 [4,]     0     0     0     0     0     0
 [5,]     0     0     0     0     0     0
 [6,]     0     0     0     0     0     0
 [7,]     0     0     0     0     0     0
 [8,]     0     0     0     0     0     0
 [9,]     0     0     0     0     0     0
> 
> ## now testing accessing/assigning multiple elements
> tmp3 <- createBufferedMatrix(10,10)
> 
> for (i in 1:10){
+   for (j in 1:10){
+     tmp3[i,j] <- (j-1)*10 + i
+   }
+ }
> 
> tmp3[2:4,2:4]
     [,1] [,2] [,3]
[1,]   12   22   32
[2,]   13   23   33
[3,]   14   24   34
> tmp3[c(-10),c(2:4,2:4,10,1,2,1:10,10:1)]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]   11   21   31   11   21   31   91    1   11     1    11    21    31
 [2,]   12   22   32   12   22   32   92    2   12     2    12    22    32
 [3,]   13   23   33   13   23   33   93    3   13     3    13    23    33
 [4,]   14   24   34   14   24   34   94    4   14     4    14    24    34
 [5,]   15   25   35   15   25   35   95    5   15     5    15    25    35
 [6,]   16   26   36   16   26   36   96    6   16     6    16    26    36
 [7,]   17   27   37   17   27   37   97    7   17     7    17    27    37
 [8,]   18   28   38   18   28   38   98    8   18     8    18    28    38
 [9,]   19   29   39   19   29   39   99    9   19     9    19    29    39
      [,14] [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24] [,25]
 [1,]    41    51    61    71    81    91    91    81    71    61    51    41
 [2,]    42    52    62    72    82    92    92    82    72    62    52    42
 [3,]    43    53    63    73    83    93    93    83    73    63    53    43
 [4,]    44    54    64    74    84    94    94    84    74    64    54    44
 [5,]    45    55    65    75    85    95    95    85    75    65    55    45
 [6,]    46    56    66    76    86    96    96    86    76    66    56    46
 [7,]    47    57    67    77    87    97    97    87    77    67    57    47
 [8,]    48    58    68    78    88    98    98    88    78    68    58    48
 [9,]    49    59    69    79    89    99    99    89    79    69    59    49
      [,26] [,27] [,28] [,29]
 [1,]    31    21    11     1
 [2,]    32    22    12     2
 [3,]    33    23    13     3
 [4,]    34    24    14     4
 [5,]    35    25    15     5
 [6,]    36    26    16     6
 [7,]    37    27    17     7
 [8,]    38    28    18     8
 [9,]    39    29    19     9
> tmp3[-c(1:5),-c(6:10)]
     [,1] [,2] [,3] [,4] [,5]
[1,]    6   16   26   36   46
[2,]    7   17   27   37   47
[3,]    8   18   28   38   48
[4,]    9   19   29   39   49
[5,]   10   20   30   40   50
> 
> ## assignment of whole columns
> tmp3[,1] <- c(1:10*100.0)
> tmp3[,1:2] <- tmp3[,1:2]*100
> tmp3[,1:2] <- tmp3[,2:1]
> tmp3[,1:2]
      [,1]  [,2]
 [1,] 1100 1e+04
 [2,] 1200 2e+04
 [3,] 1300 3e+04
 [4,] 1400 4e+04
 [5,] 1500 5e+04
 [6,] 1600 6e+04
 [7,] 1700 7e+04
 [8,] 1800 8e+04
 [9,] 1900 9e+04
[10,] 2000 1e+05
> 
> 
> tmp3[,-1] <- tmp3[,1:9]
> tmp3[,1:10]
      [,1] [,2]  [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,] 1100 1100 1e+04   21   31   41   51   61   71    81
 [2,] 1200 1200 2e+04   22   32   42   52   62   72    82
 [3,] 1300 1300 3e+04   23   33   43   53   63   73    83
 [4,] 1400 1400 4e+04   24   34   44   54   64   74    84
 [5,] 1500 1500 5e+04   25   35   45   55   65   75    85
 [6,] 1600 1600 6e+04   26   36   46   56   66   76    86
 [7,] 1700 1700 7e+04   27   37   47   57   67   77    87
 [8,] 1800 1800 8e+04   28   38   48   58   68   78    88
 [9,] 1900 1900 9e+04   29   39   49   59   69   79    89
[10,] 2000 2000 1e+05   30   40   50   60   70   80    90
> 
> tmp3[,1:2] <- rep(1,10)
> tmp3[,1:2] <- rep(1,20)
> tmp3[,1:2] <- matrix(c(1:5),1,5)
> 
> tmp3[,-c(1:8)] <- matrix(c(1:5),1,5)
> 
> tmp3[1,] <- 1:10
> tmp3[1,]
     [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,]    1    2    3    4    5    6    7    8    9    10
> tmp3[-1,] <- c(1,2)
> tmp3[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    1    2    3    4    5    6    7    8    9    10
 [2,]    1    2    1    2    1    2    1    2    1     2
 [3,]    2    1    2    1    2    1    2    1    2     1
 [4,]    1    2    1    2    1    2    1    2    1     2
 [5,]    2    1    2    1    2    1    2    1    2     1
 [6,]    1    2    1    2    1    2    1    2    1     2
 [7,]    2    1    2    1    2    1    2    1    2     1
 [8,]    1    2    1    2    1    2    1    2    1     2
 [9,]    2    1    2    1    2    1    2    1    2     1
[10,]    1    2    1    2    1    2    1    2    1     2
> tmp3[-c(1:8),] <- matrix(c(1:5),1,5)
> tmp3[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    1    2    3    4    5    6    7    8    9    10
 [2,]    1    2    1    2    1    2    1    2    1     2
 [3,]    2    1    2    1    2    1    2    1    2     1
 [4,]    1    2    1    2    1    2    1    2    1     2
 [5,]    2    1    2    1    2    1    2    1    2     1
 [6,]    1    2    1    2    1    2    1    2    1     2
 [7,]    2    1    2    1    2    1    2    1    2     1
 [8,]    1    2    1    2    1    2    1    2    1     2
 [9,]    1    3    5    2    4    1    3    5    2     4
[10,]    2    4    1    3    5    2    4    1    3     5
> 
> 
> tmp3[1:2,1:2] <- 5555.04
> tmp3[-(1:2),1:2] <- 1234.56789
> 
> 
> 
> ## testing accessors for the directory and prefix
> directory(tmp3)
[1] "/Users/biocbuild/bbs-3.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 480849 25.7    1056621 56.5         NA   634465 33.9
Vcells 891080  6.8    8388608 64.0      65536  2108740 16.1
> 
> 
> 
> 
> ##
> ## checking reads
> ##
> 
> tmp2 <- createBufferedMatrix(10,20)
> 
> test.sample <- rnorm(10*20)
> 
> tmp2[1:10,1:20] <- test.sample
> 
> test.matrix <- matrix(test.sample,10,20)
> 
> ## testing reads
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   which.col <- sample(1:20,1)
+   if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> date()
[1] "Fri Aug 15 00:48:51 2025"
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> date()
[1] "Fri Aug 15 00:48:52 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: 0x6000005a8000>
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   which.col <- sample(1:20,1)
+   if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,5,replace=TRUE)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> date()
[1] "Fri Aug 15 00:48:58 2025"
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col <- sample(1:20,5,replace=TRUE)
+   if (!all(tmp2[which.row,which.col] == test.matrix[which.row,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> date()
[1] "Fri Aug 15 00:49:00 2025"
> 
> ColMode(tmp2)
<pointer: 0x6000005a8000>
> 
> 
> 
> ### 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,] 99.91056591  0.08354002 0.04673515 -0.57094904
[2,]  0.61991279 -0.09430599 1.03852175 -1.48666231
[3,]  0.06239384 -0.85265627 0.04687252 -0.04695112
[4,]  0.35676809 -0.23891304 1.49005957  0.96523977
> 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 :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
            [,1]       [,2]       [,3]       [,4]
[1,] 99.91056591 0.08354002 0.04673515 0.57094904
[2,]  0.61991279 0.09430599 1.03852175 1.48666231
[3,]  0.06239384 0.85265627 0.04687252 0.04695112
[4,]  0.35676809 0.23891304 1.49005957 0.96523977
> 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 :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
          [,1]      [,2]      [,3]      [,4]
[1,] 9.9955273 0.2890329 0.2161831 0.7556117
[2,] 0.7873454 0.3070928 1.0190789 1.2192876
[3,] 0.2497876 0.9233939 0.2165006 0.2166821
[4,] 0.5973007 0.4887873 1.2206800 0.9824662
> 
> 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 :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
          [,1]     [,2]     [,3]     [,4]
[1,] 224.86584 27.97387 27.20857 33.12707
[2,]  33.49337 28.16523 36.22931 38.67954
[3,]  27.56027 35.08660 27.21188 27.21377
[4,]  31.32977 30.12679 38.69686 35.78990
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x6000005ac000>
> exp(tmp5)
<pointer: 0x6000005ac000>
> log(tmp5,2)
<pointer: 0x6000005ac000>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 468.0288
> Min(tmp5)
[1] 54.01324
> mean(tmp5)
[1] 72.75124
> Sum(tmp5)
[1] 14550.25
> Var(tmp5)
[1] 860.2838
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 90.65038 69.82888 67.80502 72.27968 69.70641 69.92498 71.41461 76.09703
 [9] 69.70806 70.09737
> rowSums(tmp5)
 [1] 1813.008 1396.578 1356.100 1445.594 1394.128 1398.500 1428.292 1521.941
 [9] 1394.161 1401.947
> rowVars(tmp5)
 [1] 7961.17793   74.91357   96.29722   69.38817   91.88637   68.28395
 [7]   49.53468   53.06788   50.70175   73.87820
> rowSd(tmp5)
 [1] 89.225433  8.655262  9.813115  8.329956  9.585738  8.263410  7.038088
 [8]  7.284771  7.120516  8.595243
> rowMax(tmp5)
 [1] 468.02878  90.20954  92.75858  85.68122  90.95693  84.33059  80.83983
 [8]  89.07916  87.63374  89.41443
> rowMin(tmp5)
 [1] 56.63107 54.77266 56.63796 57.37517 54.01324 54.03311 56.81916 63.78482
 [9] 58.72805 54.51954
> 
> colMeans(tmp5)
 [1] 109.84677  68.63723  70.09493  70.72115  75.25706  73.48263  71.81498
 [8]  70.36755  65.00940  71.83135  72.98654  68.12761  72.94252  69.24489
[15]  71.08276  71.00442  71.20807  73.50255  67.40983  70.45260
> colSums(tmp5)
 [1] 1098.4677  686.3723  700.9493  707.2115  752.5706  734.8263  718.1498
 [8]  703.6755  650.0940  718.3135  729.8654  681.2761  729.4252  692.4489
[15]  710.8276  710.0442  712.0807  735.0255  674.0983  704.5260
> colVars(tmp5)
 [1] 15911.81311    50.77939   100.22931    75.44501    72.56744    46.35857
 [7]    65.91359    64.39807    81.24514    30.39858    29.40847    73.98363
[13]    68.20601    43.75883    94.68272    42.79184   115.88232   154.87524
[19]    41.16281   130.49120
> colSd(tmp5)
 [1] 126.142035   7.125966  10.011459   8.685909   8.518653   6.808712
 [7]   8.118718   8.024841   9.013609   5.513490   5.422957   8.601374
[13]   8.258693   6.615046   9.730505   6.541547  10.764865  12.444888
[19]   6.415825  11.423274
> colMax(tmp5)
 [1] 468.02878  78.43893  81.04567  80.50639  90.20954  86.17764  84.33059
 [8]  83.99984  87.43739  82.59761  83.58609  86.10608  87.63374  81.88557
[15]  89.07916  82.57249  89.41443  92.75858  78.75676  90.95693
> colMin(tmp5)
 [1] 57.36309 58.22394 56.63107 56.64190 63.65650 63.78482 59.53297 54.01324
 [9] 54.51954 62.46247 63.40227 57.37517 59.30681 59.62471 56.24767 58.72805
[17] 54.77266 54.03311 59.25664 58.35428
> 
> 
> ### setting a random element to NA and then testing with na.rm=TRUE or na.rm=FALSE (The default)
> 
> 
> which.row <- sample(1:10,1,replace=TRUE)
> which.col  <- sample(1:20,1,replace=TRUE)
> 
> tmp5[which.row,which.col] <- NA
> 
> Max(tmp5)
[1] NA
> Min(tmp5)
[1] NA
> mean(tmp5)
[1] NA
> Sum(tmp5)
[1] NA
> Var(tmp5)
[1] NA
> 
> rowMeans(tmp5)
 [1] 90.65038 69.82888 67.80502 72.27968 69.70641       NA 71.41461 76.09703
 [9] 69.70806 70.09737
> rowSums(tmp5)
 [1] 1813.008 1396.578 1356.100 1445.594 1394.128       NA 1428.292 1521.941
 [9] 1394.161 1401.947
> rowVars(tmp5)
 [1] 7961.17793   74.91357   96.29722   69.38817   91.88637   71.80458
 [7]   49.53468   53.06788   50.70175   73.87820
> rowSd(tmp5)
 [1] 89.225433  8.655262  9.813115  8.329956  9.585738  8.473758  7.038088
 [8]  7.284771  7.120516  8.595243
> rowMax(tmp5)
 [1] 468.02878  90.20954  92.75858  85.68122  90.95693        NA  80.83983
 [8]  89.07916  87.63374  89.41443
> rowMin(tmp5)
 [1] 56.63107 54.77266 56.63796 57.37517 54.01324       NA 56.81916 63.78482
 [9] 58.72805 54.51954
> 
> colMeans(tmp5)
 [1] 109.84677  68.63723  70.09493        NA  75.25706  73.48263  71.81498
 [8]  70.36755  65.00940  71.83135  72.98654  68.12761  72.94252  69.24489
[15]  71.08276  71.00442  71.20807  73.50255  67.40983  70.45260
> colSums(tmp5)
 [1] 1098.4677  686.3723  700.9493        NA  752.5706  734.8263  718.1498
 [8]  703.6755  650.0940  718.3135  729.8654  681.2761  729.4252  692.4489
[15]  710.8276  710.0442  712.0807  735.0255  674.0983  704.5260
> colVars(tmp5)
 [1] 15911.81311    50.77939   100.22931          NA    72.56744    46.35857
 [7]    65.91359    64.39807    81.24514    30.39858    29.40847    73.98363
[13]    68.20601    43.75883    94.68272    42.79184   115.88232   154.87524
[19]    41.16281   130.49120
> colSd(tmp5)
 [1] 126.142035   7.125966  10.011459         NA   8.518653   6.808712
 [7]   8.118718   8.024841   9.013609   5.513490   5.422957   8.601374
[13]   8.258693   6.615046   9.730505   6.541547  10.764865  12.444888
[19]   6.415825  11.423274
> colMax(tmp5)
 [1] 468.02878  78.43893  81.04567        NA  90.20954  86.17764  84.33059
 [8]  83.99984  87.43739  82.59761  83.58609  86.10608  87.63374  81.88557
[15]  89.07916  82.57249  89.41443  92.75858  78.75676  90.95693
> colMin(tmp5)
 [1] 57.36309 58.22394 56.63107       NA 63.65650 63.78482 59.53297 54.01324
 [9] 54.51954 62.46247 63.40227 57.37517 59.30681 59.62471 56.24767 58.72805
[17] 54.77266 54.03311 59.25664 58.35428
> 
> Max(tmp5,na.rm=TRUE)
[1] 468.0288
> Min(tmp5,na.rm=TRUE)
[1] 54.01324
> mean(tmp5,na.rm=TRUE)
[1] 72.75459
> Sum(tmp5,na.rm=TRUE)
[1] 14478.16
> Var(tmp5,na.rm=TRUE)
[1] 864.6264
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 90.65038 69.82888 67.80502 72.27968 69.70641 69.81128 71.41461 76.09703
 [9] 69.70806 70.09737
> rowSums(tmp5,na.rm=TRUE)
 [1] 1813.008 1396.578 1356.100 1445.594 1394.128 1326.414 1428.292 1521.941
 [9] 1394.161 1401.947
> rowVars(tmp5,na.rm=TRUE)
 [1] 7961.17793   74.91357   96.29722   69.38817   91.88637   71.80458
 [7]   49.53468   53.06788   50.70175   73.87820
> rowSd(tmp5,na.rm=TRUE)
 [1] 89.225433  8.655262  9.813115  8.329956  9.585738  8.473758  7.038088
 [8]  7.284771  7.120516  8.595243
> rowMax(tmp5,na.rm=TRUE)
 [1] 468.02878  90.20954  92.75858  85.68122  90.95693  84.33059  80.83983
 [8]  89.07916  87.63374  89.41443
> rowMin(tmp5,na.rm=TRUE)
 [1] 56.63107 54.77266 56.63796 57.37517 54.01324 54.03311 56.81916 63.78482
 [9] 58.72805 54.51954
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 109.84677  68.63723  70.09493  70.56958  75.25706  73.48263  71.81498
 [8]  70.36755  65.00940  71.83135  72.98654  68.12761  72.94252  69.24489
[15]  71.08276  71.00442  71.20807  73.50255  67.40983  70.45260
> colSums(tmp5,na.rm=TRUE)
 [1] 1098.4677  686.3723  700.9493  635.1262  752.5706  734.8263  718.1498
 [8]  703.6755  650.0940  718.3135  729.8654  681.2761  729.4252  692.4489
[15]  710.8276  710.0442  712.0807  735.0255  674.0983  704.5260
> colVars(tmp5,na.rm=TRUE)
 [1] 15911.81311    50.77939   100.22931    84.61717    72.56744    46.35857
 [7]    65.91359    64.39807    81.24514    30.39858    29.40847    73.98363
[13]    68.20601    43.75883    94.68272    42.79184   115.88232   154.87524
[19]    41.16281   130.49120
> colSd(tmp5,na.rm=TRUE)
 [1] 126.142035   7.125966  10.011459   9.198759   8.518653   6.808712
 [7]   8.118718   8.024841   9.013609   5.513490   5.422957   8.601374
[13]   8.258693   6.615046   9.730505   6.541547  10.764865  12.444888
[19]   6.415825  11.423274
> colMax(tmp5,na.rm=TRUE)
 [1] 468.02878  78.43893  81.04567  80.50639  90.20954  86.17764  84.33059
 [8]  83.99984  87.43739  82.59761  83.58609  86.10608  87.63374  81.88557
[15]  89.07916  82.57249  89.41443  92.75858  78.75676  90.95693
> colMin(tmp5,na.rm=TRUE)
 [1] 57.36309 58.22394 56.63107 56.64190 63.65650 63.78482 59.53297 54.01324
 [9] 54.51954 62.46247 63.40227 57.37517 59.30681 59.62471 56.24767 58.72805
[17] 54.77266 54.03311 59.25664 58.35428
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1] 90.65038 69.82888 67.80502 72.27968 69.70641      NaN 71.41461 76.09703
 [9] 69.70806 70.09737
> rowSums(tmp5,na.rm=TRUE)
 [1] 1813.008 1396.578 1356.100 1445.594 1394.128    0.000 1428.292 1521.941
 [9] 1394.161 1401.947
> rowVars(tmp5,na.rm=TRUE)
 [1] 7961.17793   74.91357   96.29722   69.38817   91.88637         NA
 [7]   49.53468   53.06788   50.70175   73.87820
> rowSd(tmp5,na.rm=TRUE)
 [1] 89.225433  8.655262  9.813115  8.329956  9.585738        NA  7.038088
 [8]  7.284771  7.120516  8.595243
> rowMax(tmp5,na.rm=TRUE)
 [1] 468.02878  90.20954  92.75858  85.68122  90.95693        NA  80.83983
 [8]  89.07916  87.63374  89.41443
> rowMin(tmp5,na.rm=TRUE)
 [1] 56.63107 54.77266 56.63796 57.37517 54.01324       NA 56.81916 63.78482
 [9] 58.72805 54.51954
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1] 114.47268  68.60947  69.63071       NaN  74.93949  72.89477  70.42435
 [8]  70.87494  65.47083  72.26412  73.27571  67.42656  72.40787  70.08651
[15]  71.88849  70.60108  69.97760  75.66582  68.02797  71.79686
> colSums(tmp5,na.rm=TRUE)
 [1] 1030.2541  617.4853  626.6764    0.0000  674.4554  656.0529  633.8192
 [8]  637.8745  589.2375  650.3771  659.4814  606.8390  651.6708  630.7786
[15]  646.9964  635.4097  629.7984  680.9924  612.2517  646.1717
> colVars(tmp5,na.rm=TRUE)
 [1] 17660.04991    57.11814   110.33357          NA    80.50377    48.26555
 [7]    52.39714    69.55156    89.00538    32.09136    32.14386    77.70250
[13]    73.51600    41.25996    99.21454    46.31063   113.33431   121.58757
[19]    42.00957   126.47351
> colSd(tmp5,na.rm=TRUE)
 [1] 132.891120   7.557655  10.503979         NA   8.972389   6.947341
 [7]   7.238587   8.339758   9.434266   5.664924   5.669555   8.814902
[13]   8.574147   6.423392   9.960649   6.805191  10.645859  11.026675
[19]   6.481479  11.246044
> colMax(tmp5,na.rm=TRUE)
 [1] 468.02878  78.43893  81.04567      -Inf  90.20954  86.17764  79.09976
 [8]  83.99984  87.43739  82.59761  83.58609  86.10608  87.63374  81.88557
[15]  89.07916  82.57249  89.41443  92.75858  78.75676  90.95693
> colMin(tmp5,na.rm=TRUE)
 [1] 57.36309 58.22394 56.63107      Inf 63.65650 63.78482 59.53297 54.01324
 [9] 54.51954 62.46247 63.40227 57.37517 59.30681 59.62471 56.24767 58.72805
[17] 54.77266 57.19896 59.25664 59.79278
> 
> 
> 
> 
> 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] 211.9463 122.6763 293.6107 195.2445 246.0778 281.3099 218.9205 228.9337
 [9] 300.8307 131.7454
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 211.9463 122.6763 293.6107 195.2445 246.0778 281.3099 218.9205 228.9337
 [9] 300.8307 131.7454
> 
> 
> 
> 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.421085e-14  8.526513e-14 -2.842171e-14 -1.136868e-13  0.000000e+00
 [6] -2.842171e-14 -5.684342e-14  5.684342e-14  9.947598e-14 -2.842171e-14
[11] -5.684342e-14  2.842171e-14 -1.421085e-14  1.705303e-13  1.136868e-13
[16]  2.842171e-14  2.842171e-14 -4.263256e-14  1.705303e-13  2.557954e-13
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> ## 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)
+ }
3   3 
9   13 
8   4 
10   9 
8   20 
9   20 
9   8 
1   9 
4   16 
2   19 
3   8 
10   4 
9   9 
1   11 
5   1 
3   11 
7   17 
9   20 
4   18 
9   11 
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.019535
> Min(tmp)
[1] -2.258272
> mean(tmp)
[1] 0.05091093
> Sum(tmp)
[1] 5.091093
> Var(tmp)
[1] 0.8913527
> 
> rowMeans(tmp)
[1] 0.05091093
> rowSums(tmp)
[1] 5.091093
> rowVars(tmp)
[1] 0.8913527
> rowSd(tmp)
[1] 0.9441148
> rowMax(tmp)
[1] 2.019535
> rowMin(tmp)
[1] -2.258272
> 
> colMeans(tmp)
  [1]  1.167195094 -0.489591317  1.773789115 -0.111710801  0.047369751
  [6] -0.629259879  1.501700172 -0.300059422 -0.194146331 -1.726716121
 [11] -1.185654670 -1.589250341 -0.351445662  0.981463283 -0.155171508
 [16]  0.196459776 -1.468407643  0.354561087  1.443067648  1.516014928
 [21] -0.493926555 -0.717316538  0.011755829  1.024592045 -0.016994553
 [26] -2.258271996  1.116299120 -1.315821746  0.546963953 -0.270953241
 [31]  0.685033755 -1.533498487 -0.737419258  0.413457803  1.798790407
 [36] -0.202665899  0.452786791  0.065629709 -1.363740443  0.562725056
 [41] -0.415548015  0.469044152 -0.131460354  1.354211799 -0.786875461
 [46] -1.161648008  0.248923206  1.050065598 -0.007734580 -0.458312121
 [51]  0.530176711  0.002284411 -1.414028922  0.207051192 -0.240198881
 [56]  1.772677871 -1.623352659 -0.544607255  0.752856685  0.010273508
 [61] -0.123702859  1.007388625  2.019535118  1.516575516 -0.019635385
 [66] -0.673457831  0.212173513 -0.690169463  0.347299187  1.728466709
 [71]  0.738002804 -0.640708491 -0.693671928 -0.299346911  0.270015467
 [76]  0.493717648  0.497946258 -0.699591977 -0.081812984 -1.408709447
 [81] -0.670612429 -0.931829313  0.703514367 -0.029372961  1.607546712
 [86] -0.762773545  1.167112578 -1.111293894  0.022577177  0.118330069
 [91]  1.936523083  0.920860804 -0.873520032  0.036470875 -0.101054620
 [96] -1.020235008  0.839149867  0.933526433  0.721096085 -0.076668174
> colSums(tmp)
  [1]  1.167195094 -0.489591317  1.773789115 -0.111710801  0.047369751
  [6] -0.629259879  1.501700172 -0.300059422 -0.194146331 -1.726716121
 [11] -1.185654670 -1.589250341 -0.351445662  0.981463283 -0.155171508
 [16]  0.196459776 -1.468407643  0.354561087  1.443067648  1.516014928
 [21] -0.493926555 -0.717316538  0.011755829  1.024592045 -0.016994553
 [26] -2.258271996  1.116299120 -1.315821746  0.546963953 -0.270953241
 [31]  0.685033755 -1.533498487 -0.737419258  0.413457803  1.798790407
 [36] -0.202665899  0.452786791  0.065629709 -1.363740443  0.562725056
 [41] -0.415548015  0.469044152 -0.131460354  1.354211799 -0.786875461
 [46] -1.161648008  0.248923206  1.050065598 -0.007734580 -0.458312121
 [51]  0.530176711  0.002284411 -1.414028922  0.207051192 -0.240198881
 [56]  1.772677871 -1.623352659 -0.544607255  0.752856685  0.010273508
 [61] -0.123702859  1.007388625  2.019535118  1.516575516 -0.019635385
 [66] -0.673457831  0.212173513 -0.690169463  0.347299187  1.728466709
 [71]  0.738002804 -0.640708491 -0.693671928 -0.299346911  0.270015467
 [76]  0.493717648  0.497946258 -0.699591977 -0.081812984 -1.408709447
 [81] -0.670612429 -0.931829313  0.703514367 -0.029372961  1.607546712
 [86] -0.762773545  1.167112578 -1.111293894  0.022577177  0.118330069
 [91]  1.936523083  0.920860804 -0.873520032  0.036470875 -0.101054620
 [96] -1.020235008  0.839149867  0.933526433  0.721096085 -0.076668174
> colVars(tmp)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> colSd(tmp)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> colMax(tmp)
  [1]  1.167195094 -0.489591317  1.773789115 -0.111710801  0.047369751
  [6] -0.629259879  1.501700172 -0.300059422 -0.194146331 -1.726716121
 [11] -1.185654670 -1.589250341 -0.351445662  0.981463283 -0.155171508
 [16]  0.196459776 -1.468407643  0.354561087  1.443067648  1.516014928
 [21] -0.493926555 -0.717316538  0.011755829  1.024592045 -0.016994553
 [26] -2.258271996  1.116299120 -1.315821746  0.546963953 -0.270953241
 [31]  0.685033755 -1.533498487 -0.737419258  0.413457803  1.798790407
 [36] -0.202665899  0.452786791  0.065629709 -1.363740443  0.562725056
 [41] -0.415548015  0.469044152 -0.131460354  1.354211799 -0.786875461
 [46] -1.161648008  0.248923206  1.050065598 -0.007734580 -0.458312121
 [51]  0.530176711  0.002284411 -1.414028922  0.207051192 -0.240198881
 [56]  1.772677871 -1.623352659 -0.544607255  0.752856685  0.010273508
 [61] -0.123702859  1.007388625  2.019535118  1.516575516 -0.019635385
 [66] -0.673457831  0.212173513 -0.690169463  0.347299187  1.728466709
 [71]  0.738002804 -0.640708491 -0.693671928 -0.299346911  0.270015467
 [76]  0.493717648  0.497946258 -0.699591977 -0.081812984 -1.408709447
 [81] -0.670612429 -0.931829313  0.703514367 -0.029372961  1.607546712
 [86] -0.762773545  1.167112578 -1.111293894  0.022577177  0.118330069
 [91]  1.936523083  0.920860804 -0.873520032  0.036470875 -0.101054620
 [96] -1.020235008  0.839149867  0.933526433  0.721096085 -0.076668174
> colMin(tmp)
  [1]  1.167195094 -0.489591317  1.773789115 -0.111710801  0.047369751
  [6] -0.629259879  1.501700172 -0.300059422 -0.194146331 -1.726716121
 [11] -1.185654670 -1.589250341 -0.351445662  0.981463283 -0.155171508
 [16]  0.196459776 -1.468407643  0.354561087  1.443067648  1.516014928
 [21] -0.493926555 -0.717316538  0.011755829  1.024592045 -0.016994553
 [26] -2.258271996  1.116299120 -1.315821746  0.546963953 -0.270953241
 [31]  0.685033755 -1.533498487 -0.737419258  0.413457803  1.798790407
 [36] -0.202665899  0.452786791  0.065629709 -1.363740443  0.562725056
 [41] -0.415548015  0.469044152 -0.131460354  1.354211799 -0.786875461
 [46] -1.161648008  0.248923206  1.050065598 -0.007734580 -0.458312121
 [51]  0.530176711  0.002284411 -1.414028922  0.207051192 -0.240198881
 [56]  1.772677871 -1.623352659 -0.544607255  0.752856685  0.010273508
 [61] -0.123702859  1.007388625  2.019535118  1.516575516 -0.019635385
 [66] -0.673457831  0.212173513 -0.690169463  0.347299187  1.728466709
 [71]  0.738002804 -0.640708491 -0.693671928 -0.299346911  0.270015467
 [76]  0.493717648  0.497946258 -0.699591977 -0.081812984 -1.408709447
 [81] -0.670612429 -0.931829313  0.703514367 -0.029372961  1.607546712
 [86] -0.762773545  1.167112578 -1.111293894  0.022577177  0.118330069
 [91]  1.936523083  0.920860804 -0.873520032  0.036470875 -0.101054620
 [96] -1.020235008  0.839149867  0.933526433  0.721096085 -0.076668174
> colMedians(tmp)
  [1]  1.167195094 -0.489591317  1.773789115 -0.111710801  0.047369751
  [6] -0.629259879  1.501700172 -0.300059422 -0.194146331 -1.726716121
 [11] -1.185654670 -1.589250341 -0.351445662  0.981463283 -0.155171508
 [16]  0.196459776 -1.468407643  0.354561087  1.443067648  1.516014928
 [21] -0.493926555 -0.717316538  0.011755829  1.024592045 -0.016994553
 [26] -2.258271996  1.116299120 -1.315821746  0.546963953 -0.270953241
 [31]  0.685033755 -1.533498487 -0.737419258  0.413457803  1.798790407
 [36] -0.202665899  0.452786791  0.065629709 -1.363740443  0.562725056
 [41] -0.415548015  0.469044152 -0.131460354  1.354211799 -0.786875461
 [46] -1.161648008  0.248923206  1.050065598 -0.007734580 -0.458312121
 [51]  0.530176711  0.002284411 -1.414028922  0.207051192 -0.240198881
 [56]  1.772677871 -1.623352659 -0.544607255  0.752856685  0.010273508
 [61] -0.123702859  1.007388625  2.019535118  1.516575516 -0.019635385
 [66] -0.673457831  0.212173513 -0.690169463  0.347299187  1.728466709
 [71]  0.738002804 -0.640708491 -0.693671928 -0.299346911  0.270015467
 [76]  0.493717648  0.497946258 -0.699591977 -0.081812984 -1.408709447
 [81] -0.670612429 -0.931829313  0.703514367 -0.029372961  1.607546712
 [86] -0.762773545  1.167112578 -1.111293894  0.022577177  0.118330069
 [91]  1.936523083  0.920860804 -0.873520032  0.036470875 -0.101054620
 [96] -1.020235008  0.839149867  0.933526433  0.721096085 -0.076668174
> colRanges(tmp)
         [,1]       [,2]     [,3]       [,4]       [,5]       [,6]   [,7]
[1,] 1.167195 -0.4895913 1.773789 -0.1117108 0.04736975 -0.6292599 1.5017
[2,] 1.167195 -0.4895913 1.773789 -0.1117108 0.04736975 -0.6292599 1.5017
           [,8]       [,9]     [,10]     [,11]    [,12]      [,13]     [,14]
[1,] -0.3000594 -0.1941463 -1.726716 -1.185655 -1.58925 -0.3514457 0.9814633
[2,] -0.3000594 -0.1941463 -1.726716 -1.185655 -1.58925 -0.3514457 0.9814633
          [,15]     [,16]     [,17]     [,18]    [,19]    [,20]      [,21]
[1,] -0.1551715 0.1964598 -1.468408 0.3545611 1.443068 1.516015 -0.4939266
[2,] -0.1551715 0.1964598 -1.468408 0.3545611 1.443068 1.516015 -0.4939266
          [,22]      [,23]    [,24]       [,25]     [,26]    [,27]     [,28]
[1,] -0.7173165 0.01175583 1.024592 -0.01699455 -2.258272 1.116299 -1.315822
[2,] -0.7173165 0.01175583 1.024592 -0.01699455 -2.258272 1.116299 -1.315822
        [,29]      [,30]     [,31]     [,32]      [,33]     [,34]   [,35]
[1,] 0.546964 -0.2709532 0.6850338 -1.533498 -0.7374193 0.4134578 1.79879
[2,] 0.546964 -0.2709532 0.6850338 -1.533498 -0.7374193 0.4134578 1.79879
          [,36]     [,37]      [,38]    [,39]     [,40]     [,41]     [,42]
[1,] -0.2026659 0.4527868 0.06562971 -1.36374 0.5627251 -0.415548 0.4690442
[2,] -0.2026659 0.4527868 0.06562971 -1.36374 0.5627251 -0.415548 0.4690442
          [,43]    [,44]      [,45]     [,46]     [,47]    [,48]       [,49]
[1,] -0.1314604 1.354212 -0.7868755 -1.161648 0.2489232 1.050066 -0.00773458
[2,] -0.1314604 1.354212 -0.7868755 -1.161648 0.2489232 1.050066 -0.00773458
          [,50]     [,51]       [,52]     [,53]     [,54]      [,55]    [,56]
[1,] -0.4583121 0.5301767 0.002284411 -1.414029 0.2070512 -0.2401989 1.772678
[2,] -0.4583121 0.5301767 0.002284411 -1.414029 0.2070512 -0.2401989 1.772678
         [,57]      [,58]     [,59]      [,60]      [,61]    [,62]    [,63]
[1,] -1.623353 -0.5446073 0.7528567 0.01027351 -0.1237029 1.007389 2.019535
[2,] -1.623353 -0.5446073 0.7528567 0.01027351 -0.1237029 1.007389 2.019535
        [,64]       [,65]      [,66]     [,67]      [,68]     [,69]    [,70]
[1,] 1.516576 -0.01963539 -0.6734578 0.2121735 -0.6901695 0.3472992 1.728467
[2,] 1.516576 -0.01963539 -0.6734578 0.2121735 -0.6901695 0.3472992 1.728467
         [,71]      [,72]      [,73]      [,74]     [,75]     [,76]     [,77]
[1,] 0.7380028 -0.6407085 -0.6936719 -0.2993469 0.2700155 0.4937176 0.4979463
[2,] 0.7380028 -0.6407085 -0.6936719 -0.2993469 0.2700155 0.4937176 0.4979463
         [,78]       [,79]     [,80]      [,81]      [,82]     [,83]
[1,] -0.699592 -0.08181298 -1.408709 -0.6706124 -0.9318293 0.7035144
[2,] -0.699592 -0.08181298 -1.408709 -0.6706124 -0.9318293 0.7035144
           [,84]    [,85]      [,86]    [,87]     [,88]      [,89]     [,90]
[1,] -0.02937296 1.607547 -0.7627735 1.167113 -1.111294 0.02257718 0.1183301
[2,] -0.02937296 1.607547 -0.7627735 1.167113 -1.111294 0.02257718 0.1183301
        [,91]     [,92]    [,93]      [,94]      [,95]     [,96]     [,97]
[1,] 1.936523 0.9208608 -0.87352 0.03647087 -0.1010546 -1.020235 0.8391499
[2,] 1.936523 0.9208608 -0.87352 0.03647087 -0.1010546 -1.020235 0.8391499
         [,98]     [,99]      [,100]
[1,] 0.9335264 0.7210961 -0.07666817
[2,] 0.9335264 0.7210961 -0.07666817
> 
> 
> Max(tmp2)
[1] 2.2955
> Min(tmp2)
[1] -2.512741
> mean(tmp2)
[1] -0.1589744
> Sum(tmp2)
[1] -15.89744
> Var(tmp2)
[1] 0.9964817
> 
> rowMeans(tmp2)
  [1]  0.832245045 -1.416794553 -0.920558570  1.286583136  0.003131468
  [6]  0.058736002  0.623742486 -0.127107243  0.053547317 -0.030543975
 [11]  0.576245910  0.934963208 -0.348681821  1.435652225  0.893907726
 [16]  0.332755620 -1.365522126  0.425292921  1.015415594 -0.320570809
 [21]  2.295499859 -0.141307017  0.726089611  0.320285371 -0.614464960
 [26]  1.289677568 -0.113796468 -0.528753940 -1.157142029  0.050707855
 [31]  1.175769735  1.455886235 -1.119436116 -0.712866346 -1.259721360
 [36] -1.760849636 -0.263794311  0.800078514 -1.965484994 -0.909335127
 [41]  0.007053336 -2.512741331  1.707819677  1.072146267 -0.087908449
 [46] -0.130797510 -0.386179965  0.709637223 -0.328902931  0.754286790
 [51] -1.149090241 -0.864642982 -1.267965514 -0.269312724 -0.265992031
 [56] -0.051504899  0.928798533 -2.458320588  0.068080793  0.029021459
 [61]  0.211038483 -0.737496253 -0.994634753  0.145152703 -0.074322056
 [66]  1.652979083  0.495016471 -0.202864339 -0.837819081  0.400047174
 [71] -0.470107562 -1.156523751  1.036438595 -1.906337817  0.771798405
 [76]  1.365343469 -0.573331564 -1.408890702 -0.423782542  0.711609739
 [81]  1.660595421 -0.163090961 -0.908052883 -0.287214810 -0.553117940
 [86] -0.013224854 -0.677452453 -1.502082555 -0.767997122  0.036635191
 [91] -2.407599995  0.840998961 -0.560418173  0.568565724 -1.701155953
 [96] -1.234048134 -1.132283578 -1.240585908  0.400250398 -1.272441599
> rowSums(tmp2)
  [1]  0.832245045 -1.416794553 -0.920558570  1.286583136  0.003131468
  [6]  0.058736002  0.623742486 -0.127107243  0.053547317 -0.030543975
 [11]  0.576245910  0.934963208 -0.348681821  1.435652225  0.893907726
 [16]  0.332755620 -1.365522126  0.425292921  1.015415594 -0.320570809
 [21]  2.295499859 -0.141307017  0.726089611  0.320285371 -0.614464960
 [26]  1.289677568 -0.113796468 -0.528753940 -1.157142029  0.050707855
 [31]  1.175769735  1.455886235 -1.119436116 -0.712866346 -1.259721360
 [36] -1.760849636 -0.263794311  0.800078514 -1.965484994 -0.909335127
 [41]  0.007053336 -2.512741331  1.707819677  1.072146267 -0.087908449
 [46] -0.130797510 -0.386179965  0.709637223 -0.328902931  0.754286790
 [51] -1.149090241 -0.864642982 -1.267965514 -0.269312724 -0.265992031
 [56] -0.051504899  0.928798533 -2.458320588  0.068080793  0.029021459
 [61]  0.211038483 -0.737496253 -0.994634753  0.145152703 -0.074322056
 [66]  1.652979083  0.495016471 -0.202864339 -0.837819081  0.400047174
 [71] -0.470107562 -1.156523751  1.036438595 -1.906337817  0.771798405
 [76]  1.365343469 -0.573331564 -1.408890702 -0.423782542  0.711609739
 [81]  1.660595421 -0.163090961 -0.908052883 -0.287214810 -0.553117940
 [86] -0.013224854 -0.677452453 -1.502082555 -0.767997122  0.036635191
 [91] -2.407599995  0.840998961 -0.560418173  0.568565724 -1.701155953
 [96] -1.234048134 -1.132283578 -1.240585908  0.400250398 -1.272441599
> 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.832245045 -1.416794553 -0.920558570  1.286583136  0.003131468
  [6]  0.058736002  0.623742486 -0.127107243  0.053547317 -0.030543975
 [11]  0.576245910  0.934963208 -0.348681821  1.435652225  0.893907726
 [16]  0.332755620 -1.365522126  0.425292921  1.015415594 -0.320570809
 [21]  2.295499859 -0.141307017  0.726089611  0.320285371 -0.614464960
 [26]  1.289677568 -0.113796468 -0.528753940 -1.157142029  0.050707855
 [31]  1.175769735  1.455886235 -1.119436116 -0.712866346 -1.259721360
 [36] -1.760849636 -0.263794311  0.800078514 -1.965484994 -0.909335127
 [41]  0.007053336 -2.512741331  1.707819677  1.072146267 -0.087908449
 [46] -0.130797510 -0.386179965  0.709637223 -0.328902931  0.754286790
 [51] -1.149090241 -0.864642982 -1.267965514 -0.269312724 -0.265992031
 [56] -0.051504899  0.928798533 -2.458320588  0.068080793  0.029021459
 [61]  0.211038483 -0.737496253 -0.994634753  0.145152703 -0.074322056
 [66]  1.652979083  0.495016471 -0.202864339 -0.837819081  0.400047174
 [71] -0.470107562 -1.156523751  1.036438595 -1.906337817  0.771798405
 [76]  1.365343469 -0.573331564 -1.408890702 -0.423782542  0.711609739
 [81]  1.660595421 -0.163090961 -0.908052883 -0.287214810 -0.553117940
 [86] -0.013224854 -0.677452453 -1.502082555 -0.767997122  0.036635191
 [91] -2.407599995  0.840998961 -0.560418173  0.568565724 -1.701155953
 [96] -1.234048134 -1.132283578 -1.240585908  0.400250398 -1.272441599
> rowMin(tmp2)
  [1]  0.832245045 -1.416794553 -0.920558570  1.286583136  0.003131468
  [6]  0.058736002  0.623742486 -0.127107243  0.053547317 -0.030543975
 [11]  0.576245910  0.934963208 -0.348681821  1.435652225  0.893907726
 [16]  0.332755620 -1.365522126  0.425292921  1.015415594 -0.320570809
 [21]  2.295499859 -0.141307017  0.726089611  0.320285371 -0.614464960
 [26]  1.289677568 -0.113796468 -0.528753940 -1.157142029  0.050707855
 [31]  1.175769735  1.455886235 -1.119436116 -0.712866346 -1.259721360
 [36] -1.760849636 -0.263794311  0.800078514 -1.965484994 -0.909335127
 [41]  0.007053336 -2.512741331  1.707819677  1.072146267 -0.087908449
 [46] -0.130797510 -0.386179965  0.709637223 -0.328902931  0.754286790
 [51] -1.149090241 -0.864642982 -1.267965514 -0.269312724 -0.265992031
 [56] -0.051504899  0.928798533 -2.458320588  0.068080793  0.029021459
 [61]  0.211038483 -0.737496253 -0.994634753  0.145152703 -0.074322056
 [66]  1.652979083  0.495016471 -0.202864339 -0.837819081  0.400047174
 [71] -0.470107562 -1.156523751  1.036438595 -1.906337817  0.771798405
 [76]  1.365343469 -0.573331564 -1.408890702 -0.423782542  0.711609739
 [81]  1.660595421 -0.163090961 -0.908052883 -0.287214810 -0.553117940
 [86] -0.013224854 -0.677452453 -1.502082555 -0.767997122  0.036635191
 [91] -2.407599995  0.840998961 -0.560418173  0.568565724 -1.701155953
 [96] -1.234048134 -1.132283578 -1.240585908  0.400250398 -1.272441599
> 
> colMeans(tmp2)
[1] -0.1589744
> colSums(tmp2)
[1] -15.89744
> colVars(tmp2)
[1] 0.9964817
> colSd(tmp2)
[1] 0.9982393
> colMax(tmp2)
[1] 2.2955
> colMin(tmp2)
[1] -2.512741
> colMedians(tmp2)
[1] -0.1289524
> colRanges(tmp2)
          [,1]
[1,] -2.512741
[2,]  2.295500
> 
> 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] -7.4440833 -0.1278542 -0.6526737  1.3564921  2.0697416  1.1429518
 [7]  1.0040737 -0.3986870  1.6359957 -1.7720990
> colApply(tmp,quantile)[,1]
            [,1]
[1,] -2.73997556
[2,] -1.05358996
[3,] -0.53232007
[4,]  0.04164232
[5,]  0.72519716
> 
> rowApply(tmp,sum)
 [1] -2.84402696 -3.57858617  3.35629220 -0.09807847 -3.24242811 -0.96807748
 [7] -2.23719679 -1.54631574  5.14129645  2.83097887
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    1    1    3    5    4    8    8    3    2     1
 [2,]    8    6    1    1    5    4    6    9    9     5
 [3,]    5    9    8    8    2    9    3    5    5     2
 [4,]    2    4    4    4    7   10    4   10    6     7
 [5,]    6    2    2    7   10    5   10    4    3     4
 [6,]    7    7    6    3    9    6    1    7   10     8
 [7,]   10    5    7   10    1    1    7    6    7     6
 [8,]    4   10   10    2    8    2    2    1    8     9
 [9,]    3    8    9    6    3    3    9    8    4    10
[10,]    9    3    5    9    6    7    5    2    1     3
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1] -1.58325163  1.73586018 -1.46786993  0.30295734  0.64180517  0.69887102
 [7]  0.71959061  4.15337634  1.07265610 -0.01483327 -0.90602808  0.33061782
[13] -1.14672827  2.38821957 -1.92678906 -1.31858413  2.90220377 -2.80156175
[19] -0.25523344  3.71710194
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -1.9395131
[2,] -1.0045502
[3,] -0.2373123
[4,]  0.2761867
[5,]  1.3219372
> 
> rowApply(tmp,sum)
[1]  4.2183024  2.9034764  1.9631900  0.6276732 -2.4702618
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]    6   20   12    5    1
[2,]   20   14   20    1    9
[3,]    1   11    6   11   20
[4,]   17   10    5   10    6
[5,]    5   15    4   15   13
> 
> 
> as.matrix(tmp)
           [,1]       [,2]       [,3]        [,4]       [,5]       [,6]
[1,] -0.2373123  2.3552029 -2.1964317  1.36718287 -0.3603293  0.3845287
[2,]  1.3219372  0.4303921  0.1694490  0.05578727  0.4363016 -0.2997022
[3,]  0.2761867  1.6632377 -0.3487600 -0.52140889 -0.8160624  0.5642381
[4,] -1.0045502 -2.5281905 -0.1750194 -0.24043210  1.2041307 -0.5645483
[5,] -1.9395131 -0.1847821  1.0828921 -0.35817182  0.1777646  0.6143547
            [,7]       [,8]        [,9]      [,10]       [,11]       [,12]
[1,]  1.44203798 0.14505892  0.71111828  0.7931842  0.33931527  0.50653991
[2,]  0.40041793 1.05415419  0.18259965 -0.3348437  0.51297348 -0.82889151
[3,]  0.29302326 0.02809799  0.09486402  0.5224618 -0.09308386 -0.02691152
[4,] -1.44931999 1.98187640 -0.73039029 -1.4602441 -0.94230581  1.66532318
[5,]  0.03343144 0.94418883  0.81446442  0.4646085 -0.72292716 -0.98544225
          [,13]      [,14]      [,15]      [,16]      [,17]       [,18]
[1,] -0.4341931  2.2140363 -1.5582983  0.3265015  0.1759858 -0.07021562
[2,] -0.3767947 -0.2746677 -0.5545078 -0.6124122 -0.1321980 -0.13021136
[3,] -1.0573588  0.8803634  0.1952445 -1.8057929  1.2645025 -1.16849395
[4,]  0.8306518  1.2393412  0.1742353  2.2180050  0.8453638 -1.09620320
[5,] -0.1090334 -1.6708537 -0.1834627 -1.4448856  0.7485497 -0.33643763
          [,19]     [,20]
[1,] -1.9757641 0.2901541
[2,]  1.1786011 0.7050920
[3,]  1.5185098 0.5003325
[4,] -0.6573330 1.3172827
[5,] -0.3192473 0.9042406
> 
> 
> 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 :  653  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 :  566  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 -0.9451878 0.9359567 -0.6409427 1.494122 0.3346907 0.6228446 -0.2758024
          col8      col9     col10     col11      col12     col13     col14
row1 -1.481396 0.7910584 0.1679665 -1.624055 -0.2352432 0.4327874 -1.624065
         col15      col16     col17      col18     col19      col20
row1 0.3151664 -0.3745167 0.4008738 -0.9993165 0.8576888 -0.5565773
> tmp[,"col10"]
          col10
row1  0.1679665
row2 -1.2804681
row3  1.5133136
row4  1.5077612
row5  0.1724864
> tmp[c("row1","row5"),]
           col1       col2       col3       col4       col5       col6
row1 -0.9451878  0.9359567 -0.6409427  1.4941217  0.3346907  0.6228446
row5  0.9397699 -1.2164717 -0.5319153 -0.2445053 -0.5279576 -1.2217151
           col7       col8       col9     col10      col11      col12     col13
row1 -0.2758024 -1.4813963  0.7910584 0.1679665 -1.6240548 -0.2352432 0.4327874
row5 -2.1629734  0.3641297 -0.5869168 0.1724864 -0.6292983 -0.3614713 0.5147928
          col14     col15      col16     col17      col18      col19      col20
row1 -1.6240648 0.3151664 -0.3745167 0.4008738 -0.9993165  0.8576888 -0.5565773
row5  0.4827414 0.4566357 -1.5760701 1.2745840  0.2664151 -0.7555173 -0.8512582
> tmp[,c("col6","col20")]
           col6      col20
row1  0.6228446 -0.5565773
row2 -0.7739947  1.0924803
row3  0.3534069  1.2754835
row4 -0.9038005  0.4303581
row5 -1.2217151 -0.8512582
> tmp[c("row1","row5"),c("col6","col20")]
           col6      col20
row1  0.6228446 -0.5565773
row5 -1.2217151 -0.8512582
> 
> 
> 
> 
> 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.22396 50.30883 49.06811 50.94444 51.67038 104.3165 49.19831 50.98802
         col9    col10    col11    col12    col13    col14   col15    col16
row1 50.09219 47.94168 50.10637 50.60789 50.17843 50.97002 50.4656 49.92264
        col17   col18    col19    col20
row1 48.19156 50.0793 51.41304 103.5032
> tmp[,"col10"]
        col10
row1 47.94168
row2 30.37750
row3 31.05947
row4 28.02940
row5 49.60736
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 50.22396 50.30883 49.06811 50.94444 51.67038 104.3165 49.19831 50.98802
row5 51.17826 50.06708 48.12940 49.47889 49.71786 104.0751 49.78259 50.21377
         col9    col10    col11    col12    col13    col14    col15    col16
row1 50.09219 47.94168 50.10637 50.60789 50.17843 50.97002 50.46560 49.92264
row5 50.19705 49.60736 49.54838 50.78648 50.44969 48.42682 48.95861 50.35298
        col17    col18    col19    col20
row1 48.19156 50.07930 51.41304 103.5032
row5 49.91611 50.44707 49.92095 103.4340
> tmp[,c("col6","col20")]
          col6     col20
row1 104.31649 103.50316
row2  74.76737  73.56174
row3  74.75556  75.06801
row4  74.72392  75.52329
row5 104.07510 103.43398
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 104.3165 103.5032
row5 104.0751 103.4340
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 104.3165 103.5032
row5 104.0751 103.4340
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
          col13
[1,]  0.4766158
[2,] -0.7121026
[3,]  0.1902166
[4,] -0.9349984
[5,]  1.3923929
> tmp[,c("col17","col7")]
          col17        col7
[1,]  0.4916269  0.68996287
[2,]  1.0145788 -1.24018568
[3,] -1.3441414  0.05062612
[4,]  0.4248473  0.32021214
[5,] -0.2442195  0.62867763
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
             col6      col20
[1,]  0.009531877 0.04094595
[2,] -0.925826822 1.15939876
[3,]  0.566598786 0.10617923
[4,] -0.106251600 0.52628270
[5,] -0.191626117 0.40672291
> subBufferedMatrix(tmp,1,c("col6"))[,1]
            col1
[1,] 0.009531877
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
             col6
[1,]  0.009531877
[2,] -0.925826822
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> 
> 
> 
> subBufferedMatrix(tmp,c("row3","row1"),)[,1:20]
         [,1]        [,2]      [,3]       [,4]        [,5]       [,6]
row3 1.215973 -0.08967611 1.2592345  0.7579268  0.03165719  0.8521632
row1 1.100344  0.63318378 0.9909061 -1.3421514 -1.29185737 -0.5920386
           [,7]       [,8]       [,9]      [,10]      [,11]      [,12]
row3 -0.5201346 -0.9462125 -0.7375150 -0.5597967 -1.4919773 -1.2043627
row1 -1.5149251 -0.5069302 -0.2785106  0.7422045 -0.6873371 -0.4847532
          [,13]     [,14]     [,15]      [,16]     [,17]       [,18]      [,19]
row3 -0.6298617 -1.524554 0.1233266 -0.3727897  1.383182 -0.08329700  0.6657581
row1 -0.4081799 -0.685402 0.9217044  0.8314323 -1.291265 -0.02917959 -1.5568730
         [,20]
row3 1.0819584
row1 0.7165018
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
          [,1]        [,2]      [,3]     [,4]      [,5]        [,6]       [,7]
row2 -1.475721 -0.01091528 0.2432015 1.395345 -1.262217 -0.08303494 -0.3304775
           [,8]      [,9]    [,10]
row2 -0.8528358 -1.313147 1.158486
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
           [,1]      [,2]     [,3]       [,4]       [,5]       [,6]     [,7]
row5 -0.1825707 0.4404727 1.260805 -0.6088278 -0.7461195 -0.6858332 -1.59863
           [,8]     [,9]     [,10]    [,11]      [,12]  [,13]     [,14]
row5 0.04474224 0.162856 0.2992841 1.169296 -0.8607484 0.4955 0.6849824
         [,15]      [,16]     [,17]      [,18]      [,19]      [,20]
row5 0.8041193 -0.6830451 -1.093166 -0.9681581 -0.5501178 -0.9960199
> 
> 
> 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: 0x6000005880c0>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM167fe7245548c"
 [2] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM167fe25b1edf0"
 [3] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM167fe447c3ae5"
 [4] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM167fe37feb383"
 [5] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM167fe32bb7a2d"
 [6] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM167fe32523a60"
 [7] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM167fe34768e6f"
 [8] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM167fe53813451"
 [9] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM167fe4791dcab"
[10] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM167fe392e8342"
[11] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM167fe1cab7f62"
[12] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM167fe3f3809a2"
[13] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM167fe78008b1a"
[14] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM167fe6bac9582"
[15] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM167fef8bc108" 
> 
> 
> ### 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: 0x6000005801e0>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x6000005801e0>
Warning message:
In dir.create(new.directory) :
  '/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x6000005801e0>
> rowMedians(tmp)
  [1] -0.600644440 -0.200747284 -0.193976288 -0.150077114  0.295738519
  [6]  0.429565781  0.372424366  0.290467425  0.240317425  0.244867363
 [11] -0.312647186  0.390866419  0.533207980  0.286783773  0.076033424
 [16] -0.414640305  0.245697023  0.055673910  0.184433757  0.361107563
 [21]  0.053371507 -0.418527495 -0.020672475 -0.226216095 -0.342449882
 [26]  0.310315811 -0.417368598  0.307014278  0.078376003  0.263871000
 [31]  0.540392078 -0.037021336  0.316502354  0.276432772  0.205551884
 [36]  0.200926611 -0.409164387 -0.147210441 -0.039865366  0.195476379
 [41]  0.127714626 -0.382323188 -0.740989488  0.089474832  0.310159862
 [46] -0.258461796  0.154939978  0.060356160 -0.210959694  0.199153438
 [51] -0.336445395  0.249793071 -0.182123520  0.056526225 -0.491279699
 [56] -0.351713499 -0.333658174 -0.105128165  0.213270997 -0.240437916
 [61] -0.461079813  0.179830332 -0.419772378  0.231965565  0.059520199
 [66] -0.189782807 -0.455329769 -0.070068879  0.474881710  0.246587443
 [71] -0.310412389 -0.310717140  0.159250196  0.216978528 -0.475538874
 [76] -0.488902422  0.109347769 -0.182191098  0.222220072  0.390484904
 [81] -0.216728939 -0.525445030 -0.149789406 -0.176158290 -0.031951954
 [86]  0.238170872 -0.105104238 -0.183401987 -0.003947215 -0.362137174
 [91]  0.695056288 -0.038418012  0.366880991 -0.303700486  0.461258237
 [96] -0.283813771  0.344476194 -0.312461876 -0.129906240 -0.152080918
[101]  0.355031059  0.357251854  0.322883340 -0.066904803 -0.152283533
[106]  0.179805595 -0.664411602 -0.315483975 -0.098116060 -0.323694316
[111]  0.455322903 -0.029011227 -0.445752099  0.385253820  0.004795397
[116]  0.256559852  0.396954091  0.156998502  0.182191936  0.347600926
[121]  0.127996381  0.069897968  0.381651418  0.341138854 -0.051710647
[126] -0.405471345  0.503443190 -0.287823176  0.359617602  0.120027187
[131] -0.432591243  0.050500457  0.315397348 -0.347172126  0.223119414
[136] -0.023564927  0.149431130 -0.302882564 -0.041123221  0.238105575
[141] -0.469331695  0.472763861 -0.120493712 -0.376780624  0.282429419
[146]  0.582183783 -0.643817929  0.137943883  0.022078219 -0.257139294
[151] -0.243574899  0.166489366 -0.190737974  0.323742834 -0.062602234
[156] -0.312380572 -0.088143694 -0.048246900 -0.189652329  0.243397029
[161] -0.126703799 -0.122484616  0.454246717 -0.351527877 -0.022717815
[166]  0.681197571  0.208048692  0.148273145 -0.313059854  0.384902563
[171]  0.238201368  0.134869957 -0.017113781 -0.398431567  0.397419380
[176] -0.264603741 -0.052444684 -0.387333281  0.798713691 -0.655790582
[181]  0.237480062  0.061097557  0.250018120  0.035465243  0.630962748
[186]  0.389281175 -0.213451291 -0.056021372 -0.226891171  0.093470840
[191] -0.463067963  0.162269578 -0.704906964 -0.322037391  0.311789050
[196]  0.207232842  0.162326621 -0.055287605 -0.106083549  0.427059669
[201]  0.194604085 -0.164957309  0.055348223  0.072015913  0.012613351
[206] -0.254346244 -0.058978372  0.676428976 -0.231711815  0.181618981
[211] -0.110180321  0.255206925 -0.279592076  0.208217813  0.495962131
[216]  0.118793916 -0.233451889 -0.209919268 -0.215665893 -0.203117503
[221]  0.289464550  0.270766861 -0.258284061  0.460606769 -0.028421759
[226]  0.184414735 -0.443225234 -0.515006579  0.375197953  0.178099846
> 
> proc.time()
   user  system elapsed 
  5.093  18.802  26.264 

BufferedMatrix.Rcheck/tests/rawCalltesting.Rout


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

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

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

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

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

Attaching package: 'BufferedMatrix'

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

    colMeans, colSums, rowMeans, rowSums

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

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

<pointer: 0x600002978000>
> .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: 0x600002978000>
> .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: 0x600002978000>
> .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: 0x600002978000>
> 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: 0x600002950120>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600002950120>
> .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: 0x600002950120>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600002950120>
> .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: 0x600002950120>
> 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: 0x600002974360>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600002974360>
> .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: 0x600002974360>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x600002974360>
> .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: 0x600002974360>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x600002974360>
> .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: 0x600002974360>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x600002974360>
> .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: 0x600002974360>
> 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: 0x600002974540>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x600002974540>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600002974540>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600002974540>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile16af92d5bd206" "BufferedMatrixFile16af967399f2d"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile16af92d5bd206" "BufferedMatrixFile16af967399f2d"
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000029747e0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000029747e0>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x6000029747e0>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x6000029747e0>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x6000029747e0>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x6000029747e0>
> .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: 0x600002968000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600002968000>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x600002968000>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x600002968000>
> 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: 0x6000029501e0>
> .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: 0x6000029501e0>
> rm(P)
> 
> proc.time()
   user  system elapsed 
  0.597   0.217   0.783 

BufferedMatrix.Rcheck/tests/Rcodetesting.Rout


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

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

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

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

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

Attaching package: 'BufferedMatrix'

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

    colMeans, colSums, rowMeans, rowSums

> 
> Temp <- createBufferedMatrix(100)
> dim(Temp)
[1] 100   0
> buffer.dim(Temp)
[1] 1 1
> 
> 
> proc.time()
   user  system elapsed 
  0.588   0.134   0.703 

Example timings