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

This page was generated on 2025-10-16 11:40 -0400 (Thu, 16 Oct 2025).

HostnameOSArch (*)R versionInstalled pkgs
nebbiolo1Linux (Ubuntu 24.04.3 LTS)x86_644.5.1 (2025-06-13) -- "Great Square Root" 4833
merida1macOS 12.7.6 Montereyx86_644.5.1 RC (2025-06-05 r88288) -- "Great Square Root" 4614
kjohnson1macOS 13.7.5 Venturaarm644.5.1 Patched (2025-06-14 r88325) -- "Great Square Root" 4555
kunpeng2Linux (openEuler 24.03 LTS)aarch64R Under development (unstable) (2025-02-19 r87757) -- "Unsuffered Consequences" 4586
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-10-13 13:40 -0400 (Mon, 13 Oct 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
merida1macOS 12.7.6 Monterey / x86_64  OK    OK    WARNINGS    OK  UNNEEDED, same version is already published
kjohnson1macOS 13.7.5 Ventura / arm64  OK    OK    WARNINGS    OK  UNNEEDED, same version is already published
kunpeng2Linux (openEuler 24.03 LTS) / aarch64  OK    OK    OK  


CHECK results for BufferedMatrix on kjohnson1

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-10-14 14:49:57 -0400 (Tue, 14 Oct 2025)
EndedAt: 2025-10-14 14:50:39 -0400 (Tue, 14 Oct 2025)
EllapsedTime: 42.3 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 Patched (2025-06-14 r88325)
* using platform: aarch64-apple-darwin20
* R was compiled by
    Apple clang version 16.0.0 (clang-1600.0.26.6)
    GNU Fortran (GCC) 14.2.0
* running under: macOS Ventura 13.7.5
* 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 15.0.0 (clang-1500.0.40.1)’
* 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-arm64/Resources/library’
* installing *source* package ‘BufferedMatrix’ ...
** this is package ‘BufferedMatrix’ version ‘1.72.0’
** using staged installation
** libs
using C compiler: ‘Apple clang version 15.0.0 (clang-1500.0.40.1)’
using SDK: ‘MacOSX11.3.sdk’
clang -arch arm64 -std=gnu2x -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/opt/R/arm64/include    -fPIC  -falign-functions=64 -Wall -g -O2  -c RBufferedMatrix.c -o RBufferedMatrix.o
clang -arch arm64 -std=gnu2x -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/opt/R/arm64/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 arm64 -std=gnu2x -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/opt/R/arm64/include    -fPIC  -falign-functions=64 -Wall -g -O2  -c doubleBufferedMatrix_C_tests.c -o doubleBufferedMatrix_C_tests.o
clang -arch arm64 -std=gnu2x -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/opt/R/arm64/include    -fPIC  -falign-functions=64 -Wall -g -O2  -c init_package.c -o init_package.o
clang -arch arm64 -std=gnu2x -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -L/Library/Frameworks/R.framework/Resources/lib -L/opt/R/arm64/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-arm64/Resources/library/00LOCK-BufferedMatrix/00new/BufferedMatrix/libs
** R
** inst
** byte-compile and prepare package for lazy loading
Creating a new generic function for ‘rowMeans’ in package ‘BufferedMatrix’
Creating a new generic function for ‘rowSums’ in package ‘BufferedMatrix’
Creating a new generic function for ‘colMeans’ in package ‘BufferedMatrix’
Creating a new generic function for ‘colSums’ in package ‘BufferedMatrix’
Creating a generic function for ‘ncol’ from package ‘base’ in package ‘BufferedMatrix’
Creating a generic function for ‘nrow’ from package ‘base’ in package ‘BufferedMatrix’
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
** checking absolute paths in shared objects and dynamic libraries
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (BufferedMatrix)

Tests output

BufferedMatrix.Rcheck/tests/c_code_level_tests.Rout


R version 4.5.1 Patched (2025-06-14 r88325) -- "Great Square Root"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: aarch64-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.333   0.120   0.444 

BufferedMatrix.Rcheck/tests/objectTesting.Rout


R version 4.5.1 Patched (2025-06-14 r88325) -- "Great Square Root"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: aarch64-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 480828 25.7    1056581 56.5         NA   634425 33.9
Vcells 891011  6.8    8388608 64.0      65536  2109041 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] "Tue Oct 14 14:50:18 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] "Tue Oct 14 14:50:18 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: 0x600001ed40c0>
> 
> 
> 
> 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] "Tue Oct 14 14:50:20 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] "Tue Oct 14 14:50:22 2025"
> 
> ColMode(tmp2)
<pointer: 0x600001ed40c0>
> 
> 
> 
> ### Now testing assignments
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+ 
+   new.data <- rnorm(20)
+   tmp2[which.row,] <- new.data
+   test.matrix[which.row,] <- new.data
+   if (rep > 1){
+     if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+   
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   new.data <- rnorm(10)
+   tmp2[,which.col] <- new.data
+   test.matrix[,which.col]<- new.data
+ 
+   if (rep > 1){
+     if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.col <- which.col
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,5,replace=TRUE)
+   new.data <- matrix(rnorm(50),5,10)
+   tmp2[,which.col] <- new.data
+   test.matrix[,which.col]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.col <- which.col
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   new.data <- matrix(rnorm(50),5,10)
+   tmp2[which.row,] <- new.data
+   test.matrix[which.row,]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col  <- sample(1:20,5,replace=TRUE)
+   new.data <- matrix(rnorm(25),5,5)
+   tmp2[which.row,which.col] <- new.data
+   test.matrix[which.row,which.col]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[prev.row,prev.col] == test.matrix[prev.row,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+   prev.col <- which.col
+ }
> 
> 
> 
> 
> ###
> ###
> ### testing some more functions
> ###
> 
> 
> 
> ## duplication function
> tmp5 <- duplicate(tmp2)
> 
> # making sure really did copy everything.
> tmp5[1,1] <- tmp5[1,1] +100.00
> 
> if (tmp5[1,1] == tmp2[1,1]){
+   stop("Problem with duplication")
+ }
> 
> 
> 
> 
> ### testing elementwise applying of functions
> 
> tmp5[1:4,1:4]
            [,1]       [,2]       [,3]       [,4]
[1,] 101.5535683 -0.4324129  1.0710464  0.3290371
[2,]   0.3819205  0.1132789  0.1048957  0.5106765
[3,]  -1.8526619 -0.7171068 -1.0721561  0.7058684
[4,]   0.1696426  0.0982392 -1.0842639 -0.9735733
> ewApply(tmp5,abs)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
            [,1]      [,2]      [,3]      [,4]
[1,] 101.5535683 0.4324129 1.0710464 0.3290371
[2,]   0.3819205 0.1132789 0.1048957 0.5106765
[3,]   1.8526619 0.7171068 1.0721561 0.7058684
[4,]   0.1696426 0.0982392 1.0842639 0.9735733
> ewApply(tmp5,sqrt)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
           [,1]      [,2]     [,3]      [,4]
[1,] 10.0773790 0.6575811 1.034914 0.5736175
[2,]  0.6179971 0.3365694 0.323876 0.7146163
[3,]  1.3611252 0.8468216 1.035450 0.8401598
[4,]  0.4118770 0.3134313 1.041280 0.9866982
> 
> my.function <- function(x,power){
+   (x+5)^power
+ }
> 
> ewApply(tmp5,my.function,power=2)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
          [,1]     [,2]     [,3]     [,4]
[1,] 227.32736 32.00822 36.42018 31.06521
[2,]  31.56189 28.47897 28.34366 32.65684
[3,]  40.46391 34.18532 36.42665 34.10747
[4,]  29.28841 28.23255 36.49706 35.84056
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x600001ed4120>
> exp(tmp5)
<pointer: 0x600001ed4120>
> log(tmp5,2)
<pointer: 0x600001ed4120>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 473.1521
> Min(tmp5)
[1] 53.70329
> mean(tmp5)
[1] 72.88979
> Sum(tmp5)
[1] 14577.96
> Var(tmp5)
[1] 881.4214
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 91.79999 66.99191 70.03777 71.07878 73.27992 69.76225 72.67027 70.36367
 [9] 70.00931 72.90406
> rowSums(tmp5)
 [1] 1836.000 1339.838 1400.755 1421.576 1465.598 1395.245 1453.405 1407.273
 [9] 1400.186 1458.081
> rowVars(tmp5)
 [1] 8112.57294   52.73185   69.32331   76.11831   66.69660   79.82208
 [7]   71.64658   88.98269   76.54141   86.28874
> rowSd(tmp5)
 [1] 90.069823  7.261670  8.326062  8.724581  8.166799  8.934320  8.464430
 [8]  9.433063  8.748795  9.289173
> rowMax(tmp5)
 [1] 473.15211  82.01308  84.22034  89.62243  88.49012  85.15400  86.55751
 [8]  87.79513  86.38525  86.23733
> rowMin(tmp5)
 [1] 60.27907 57.37854 56.12044 56.55023 57.47202 53.70329 58.75234 54.56356
 [9] 58.62232 54.54624
> 
> colMeans(tmp5)
 [1] 113.54601  68.96794  75.81742  71.27456  72.12334  69.26533  72.21713
 [8]  71.50865  75.07004  65.10194  75.51035  67.84206  75.56837  69.99112
[15]  64.73192  66.44715  67.34253  70.52583  67.02821  77.91596
> colSums(tmp5)
 [1] 1135.4601  689.6794  758.1742  712.7456  721.2334  692.6533  722.1713
 [8]  715.0865  750.7004  651.0194  755.1035  678.4206  755.6837  699.9112
[15]  647.3192  664.4715  673.4253  705.2583  670.2821  779.1596
> colVars(tmp5)
 [1] 16052.88114    95.05548    66.48557   100.58381    38.80751    37.46109
 [7]    46.18376    49.51487    52.95439    27.30405   102.04078    59.73204
[13]    53.70915    75.48845    93.96381    43.47184   114.88739    41.59556
[19]    72.86358    27.62175
> colSd(tmp5)
 [1] 126.699965   9.749640   8.153869  10.029148   6.229567   6.120547
 [7]   6.795864   7.036680   7.276976   5.225327  10.101524   7.728651
[13]   7.328653   8.688409   9.693493   6.593318  10.718553   6.449462
[19]   8.536016   5.255639
> colMax(tmp5)
 [1] 473.15211  84.57255  88.49012  86.09218  80.77133  77.55035  80.22206
 [8]  83.52144  86.55751  72.41289  88.79683  78.72047  89.62243  83.62227
[15]  83.43797  75.75292  86.38525  82.07028  85.10526  87.15014
> colMin(tmp5)
 [1] 60.95999 58.76236 58.99361 54.54624 58.80133 58.75234 59.57761 57.60038
 [9] 63.93837 57.47202 60.07157 59.31577 65.44153 54.56356 54.71661 54.78341
[17] 53.70329 60.14787 58.98912 67.40724
> 
> 
> ### 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] 91.79999       NA 70.03777 71.07878 73.27992 69.76225 72.67027 70.36367
 [9] 70.00931 72.90406
> rowSums(tmp5)
 [1] 1836.000       NA 1400.755 1421.576 1465.598 1395.245 1453.405 1407.273
 [9] 1400.186 1458.081
> rowVars(tmp5)
 [1] 8112.57294   52.17913   69.32331   76.11831   66.69660   79.82208
 [7]   71.64658   88.98269   76.54141   86.28874
> rowSd(tmp5)
 [1] 90.069823  7.223512  8.326062  8.724581  8.166799  8.934320  8.464430
 [8]  9.433063  8.748795  9.289173
> rowMax(tmp5)
 [1] 473.15211        NA  84.22034  89.62243  88.49012  85.15400  86.55751
 [8]  87.79513  86.38525  86.23733
> rowMin(tmp5)
 [1] 60.27907       NA 56.12044 56.55023 57.47202 53.70329 58.75234 54.56356
 [9] 58.62232 54.54624
> 
> colMeans(tmp5)
 [1] 113.54601        NA  75.81742  71.27456  72.12334  69.26533  72.21713
 [8]  71.50865  75.07004  65.10194  75.51035  67.84206  75.56837  69.99112
[15]  64.73192  66.44715  67.34253  70.52583  67.02821  77.91596
> colSums(tmp5)
 [1] 1135.4601        NA  758.1742  712.7456  721.2334  692.6533  722.1713
 [8]  715.0865  750.7004  651.0194  755.1035  678.4206  755.6837  699.9112
[15]  647.3192  664.4715  673.4253  705.2583  670.2821  779.1596
> colVars(tmp5)
 [1] 16052.88114          NA    66.48557   100.58381    38.80751    37.46109
 [7]    46.18376    49.51487    52.95439    27.30405   102.04078    59.73204
[13]    53.70915    75.48845    93.96381    43.47184   114.88739    41.59556
[19]    72.86358    27.62175
> colSd(tmp5)
 [1] 126.699965         NA   8.153869  10.029148   6.229567   6.120547
 [7]   6.795864   7.036680   7.276976   5.225327  10.101524   7.728651
[13]   7.328653   8.688409   9.693493   6.593318  10.718553   6.449462
[19]   8.536016   5.255639
> colMax(tmp5)
 [1] 473.15211        NA  88.49012  86.09218  80.77133  77.55035  80.22206
 [8]  83.52144  86.55751  72.41289  88.79683  78.72047  89.62243  83.62227
[15]  83.43797  75.75292  86.38525  82.07028  85.10526  87.15014
> colMin(tmp5)
 [1] 60.95999       NA 58.99361 54.54624 58.80133 58.75234 59.57761 57.60038
 [9] 63.93837 57.47202 60.07157 59.31577 65.44153 54.56356 54.71661 54.78341
[17] 53.70329 60.14787 58.98912 67.40724
> 
> Max(tmp5,na.rm=TRUE)
[1] 473.1521
> Min(tmp5,na.rm=TRUE)
[1] 53.70329
> mean(tmp5,na.rm=TRUE)
[1] 72.95821
> Sum(tmp5,na.rm=TRUE)
[1] 14518.68
> Var(tmp5,na.rm=TRUE)
[1] 884.9322
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 91.79999 67.39805 70.03777 71.07878 73.27992 69.76225 72.67027 70.36367
 [9] 70.00931 72.90406
> rowSums(tmp5,na.rm=TRUE)
 [1] 1836.000 1280.563 1400.755 1421.576 1465.598 1395.245 1453.405 1407.273
 [9] 1400.186 1458.081
> rowVars(tmp5,na.rm=TRUE)
 [1] 8112.57294   52.17913   69.32331   76.11831   66.69660   79.82208
 [7]   71.64658   88.98269   76.54141   86.28874
> rowSd(tmp5,na.rm=TRUE)
 [1] 90.069823  7.223512  8.326062  8.724581  8.166799  8.934320  8.464430
 [8]  9.433063  8.748795  9.289173
> rowMax(tmp5,na.rm=TRUE)
 [1] 473.15211  82.01308  84.22034  89.62243  88.49012  85.15400  86.55751
 [8]  87.79513  86.38525  86.23733
> rowMin(tmp5,na.rm=TRUE)
 [1] 60.27907 57.37854 56.12044 56.55023 57.47202 53.70329 58.75234 54.56356
 [9] 58.62232 54.54624
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 113.54601  70.04490  75.81742  71.27456  72.12334  69.26533  72.21713
 [8]  71.50865  75.07004  65.10194  75.51035  67.84206  75.56837  69.99112
[15]  64.73192  66.44715  67.34253  70.52583  67.02821  77.91596
> colSums(tmp5,na.rm=TRUE)
 [1] 1135.4601  630.4041  758.1742  712.7456  721.2334  692.6533  722.1713
 [8]  715.0865  750.7004  651.0194  755.1035  678.4206  755.6837  699.9112
[15]  647.3192  664.4715  673.4253  705.2583  670.2821  779.1596
> colVars(tmp5,na.rm=TRUE)
 [1] 16052.88114    93.88906    66.48557   100.58381    38.80751    37.46109
 [7]    46.18376    49.51487    52.95439    27.30405   102.04078    59.73204
[13]    53.70915    75.48845    93.96381    43.47184   114.88739    41.59556
[19]    72.86358    27.62175
> colSd(tmp5,na.rm=TRUE)
 [1] 126.699965   9.689637   8.153869  10.029148   6.229567   6.120547
 [7]   6.795864   7.036680   7.276976   5.225327  10.101524   7.728651
[13]   7.328653   8.688409   9.693493   6.593318  10.718553   6.449462
[19]   8.536016   5.255639
> colMax(tmp5,na.rm=TRUE)
 [1] 473.15211  84.57255  88.49012  86.09218  80.77133  77.55035  80.22206
 [8]  83.52144  86.55751  72.41289  88.79683  78.72047  89.62243  83.62227
[15]  83.43797  75.75292  86.38525  82.07028  85.10526  87.15014
> colMin(tmp5,na.rm=TRUE)
 [1] 60.95999 58.76236 58.99361 54.54624 58.80133 58.75234 59.57761 57.60038
 [9] 63.93837 57.47202 60.07157 59.31577 65.44153 54.56356 54.71661 54.78341
[17] 53.70329 60.14787 58.98912 67.40724
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1] 91.79999      NaN 70.03777 71.07878 73.27992 69.76225 72.67027 70.36367
 [9] 70.00931 72.90406
> rowSums(tmp5,na.rm=TRUE)
 [1] 1836.000    0.000 1400.755 1421.576 1465.598 1395.245 1453.405 1407.273
 [9] 1400.186 1458.081
> rowVars(tmp5,na.rm=TRUE)
 [1] 8112.57294         NA   69.32331   76.11831   66.69660   79.82208
 [7]   71.64658   88.98269   76.54141   86.28874
> rowSd(tmp5,na.rm=TRUE)
 [1] 90.069823        NA  8.326062  8.724581  8.166799  8.934320  8.464430
 [8]  9.433063  8.748795  9.289173
> rowMax(tmp5,na.rm=TRUE)
 [1] 473.15211        NA  84.22034  89.62243  88.49012  85.15400  86.55751
 [8]  87.79513  86.38525  86.23733
> rowMin(tmp5,na.rm=TRUE)
 [1] 60.27907       NA 56.12044 56.55023 57.47202 53.70329 58.75234 54.56356
 [9] 58.62232 54.54624
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1] 118.86313       NaN  77.68674  71.64163  72.48366  68.34477  72.12516
 [8]  71.69228  74.29859  65.38697  77.22577  68.78942  76.18606  71.39252
[15]  65.53938  65.83427  67.39404  70.19076  67.61935  78.16288
> colSums(tmp5,na.rm=TRUE)
 [1] 1069.7682    0.0000  699.1806  644.7747  652.3530  615.1030  649.1264
 [8]  645.2305  668.6873  588.4827  695.0319  619.1048  685.6745  642.5327
[15]  589.8544  592.5085  606.5463  631.7168  608.5741  703.4659
> colVars(tmp5,na.rm=TRUE)
 [1] 17741.43405          NA    35.48505   111.64096    42.19781    32.61018
 [7]    51.86156    55.32489    52.87843    29.80312    81.69089    57.10166
[13]    56.13056    62.83046    98.37434    44.68007   129.21847    45.53197
[19]    78.04032    30.38855
> colSd(tmp5,na.rm=TRUE)
 [1] 133.196975         NA   5.956933  10.566028   6.495984   5.710532
 [7]   7.201497   7.438070   7.271756   5.459223   9.038301   7.556564
[13]   7.492033   7.926567   9.918384   6.684315  11.367430   6.747738
[19]   8.834043   5.512581
> colMax(tmp5,na.rm=TRUE)
 [1] 473.15211      -Inf  88.49012  86.09218  80.77133  77.36717  80.22206
 [8]  83.52144  86.55751  72.41289  88.79683  78.72047  89.62243  83.62227
[15]  83.43797  75.75292  86.38525  82.07028  85.10526  87.15014
> colMin(tmp5,na.rm=TRUE)
 [1] 60.95999      Inf 70.11277 54.54624 58.80133 58.75234 59.57761 57.60038
 [9] 63.93837 57.47202 62.33294 59.91073 65.44153 54.56356 54.71661 54.78341
[17] 53.70329 60.14787 58.98912 67.40724
> 
> 
> 
> 
> 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] 169.0629 368.7909 168.2467 297.7577 191.6308 252.1409 177.8394 208.4706
 [9] 546.4352 130.1898
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 169.0629 368.7909 168.2467 297.7577 191.6308 252.1409 177.8394 208.4706
 [9] 546.4352 130.1898
> 
> 
> 
> 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  2.842171e-14 -1.705303e-13  5.684342e-14 -5.684342e-14
 [6]  0.000000e+00 -5.684342e-14 -5.684342e-14  5.684342e-14  5.684342e-14
[11] -1.136868e-13  2.273737e-13 -1.421085e-13  0.000000e+00 -8.526513e-14
[16] -5.684342e-14  5.684342e-14  1.136868e-13 -5.684342e-14  5.684342e-14
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> ## making sure these things agree
> ##
> ## first when there is no NA
> 
> 
> 
> agree.checks <- function(buff.matrix,r.matrix,err.tol=1e-10){
+ 
+   if (Max(buff.matrix,na.rm=TRUE) != max(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Max")
+   }
+   
+ 
+   if (Min(buff.matrix,na.rm=TRUE) != min(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Min")
+   }
+ 
+ 
+   if (abs(Sum(buff.matrix,na.rm=TRUE)- sum(r.matrix,na.rm=TRUE)) > err.tol){
+ 
+     cat(Sum(buff.matrix,na.rm=TRUE),"\n")
+     cat(sum(r.matrix,na.rm=TRUE),"\n")
+     cat(Sum(buff.matrix,na.rm=TRUE) - sum(r.matrix,na.rm=TRUE),"\n")
+     
+     stop("No agreement in Sum")
+   }
+   
+   if (abs(mean(buff.matrix,na.rm=TRUE) - mean(r.matrix,na.rm=TRUE)) > err.tol){
+     stop("No agreement in mean")
+   }
+   
+   
+   if(abs(Var(buff.matrix,na.rm=TRUE) - var(as.vector(r.matrix),na.rm=TRUE)) > err.tol){
+     stop("No agreement in Var")
+   }
+   
+   
+ 
+   if(any(abs(rowMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,mean,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowMeans")
+   }
+   
+   
+   if(any(abs(colMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,mean,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colMeans")
+   }
+   
+   
+   if(any(abs(rowSums(buff.matrix,na.rm=TRUE)  -  apply(r.matrix,1,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in rowSums")
+   }
+   
+   
+   if(any(abs(colSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colSums")
+   }
+   
+   ### this is to get around the fact that R doesn't like to compute NA on an entire vector of NA when 
+   ### computing variance
+   my.Var <- function(x,na.rm=FALSE){
+    if (all(is.na(x))){
+      return(NA)
+    } else {
+      var(x,na.rm=na.rm)
+    }
+ 
+   }
+   
+   if(any(abs(rowVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+   
+   
+   if(any(abs(colVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+ 
+ 
+   if(any(abs(rowMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+ 
+   if(any(abs(colMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+   
+   
+   if(any(abs(rowMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+   
+ 
+   if(any(abs(colMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+ 
+   if(any(abs(colMedians(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,median,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMedian")
+   }
+ 
+   if(any(abs(colRanges(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,range,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colRanges")
+   }
+ 
+ 
+   
+ }
> 
> 
> 
> 
> 
> 
> 
> 
> 
> for (rep in 1:20){
+   copymatrix <- matrix(rnorm(200,150,15),10,20)
+   
+   tmp5[1:10,1:20] <- copymatrix
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ## now lets assign some NA values and check agreement
+ 
+   which.row <- sample(1:10,1,replace=TRUE)
+   which.col  <- sample(1:20,1,replace=TRUE)
+   
+   cat(which.row," ",which.col,"\n")
+   
+   tmp5[which.row,which.col] <- NA
+   copymatrix[which.row,which.col] <- NA
+   
+   agree.checks(tmp5,copymatrix)
+ 
+   ## make an entire row NA
+   tmp5[which.row,] <- NA
+   copymatrix[which.row,] <- NA
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ### also make an entire col NA
+   tmp5[,which.col] <- NA
+   copymatrix[,which.col] <- NA
+ 
+   agree.checks(tmp5,copymatrix)
+ 
+   ### now make 1 element non NA with NA in the rest of row and column
+ 
+   tmp5[which.row,which.col] <- rnorm(1,150,15)
+   copymatrix[which.row,which.col] <- tmp5[which.row,which.col]
+ 
+   agree.checks(tmp5,copymatrix)
+ }
9   7 
8   2 
10   1 
3   18 
7   3 
9   7 
5   4 
10   17 
5   3 
5   2 
6   10 
4   17 
9   1 
4   6 
2   2 
9   11 
4   7 
1   19 
5   18 
6   15 
There were 50 or more warnings (use warnings() to see the first 50)
> 
> 
> ### now test 1 by n and n by 1 matrix
> 
> 
> err.tol <- 1e-12
> 
> rm(tmp5)
> 
> dataset1 <- rnorm(100)
> dataset2 <- rnorm(100)
> 
> tmp <- createBufferedMatrix(1,100)
> tmp[1,] <- dataset1
> 
> tmp2 <- createBufferedMatrix(100,1)
> tmp2[,1] <- dataset2
> 
> 
> 
> 
> 
> Max(tmp)
[1] 2.885789
> Min(tmp)
[1] -2.328091
> mean(tmp)
[1] 0.0005641685
> Sum(tmp)
[1] 0.05641685
> Var(tmp)
[1] 1.162447
> 
> rowMeans(tmp)
[1] 0.0005641685
> rowSums(tmp)
[1] 0.05641685
> rowVars(tmp)
[1] 1.162447
> rowSd(tmp)
[1] 1.078168
> rowMax(tmp)
[1] 2.885789
> rowMin(tmp)
[1] -2.328091
> 
> colMeans(tmp)
  [1] -0.926636307  2.885788603 -0.971502850  2.004953482  1.002976079
  [6]  1.138138283  1.610571868 -0.590928040  1.913694898  0.298646626
 [11]  0.633872506 -0.500760880 -0.860835949  0.408982587 -0.212505177
 [16] -0.153579552 -0.527386586  0.394370226 -1.121999916 -0.922978194
 [21] -0.198670459 -0.461142512  1.938177888  0.217323362 -0.648408954
 [26]  0.964815462  0.011193548  0.848478963 -0.887233473  0.199534441
 [31] -2.328091206 -0.055853654 -1.269957236  2.317897548 -0.383396398
 [36] -1.155428694  0.311662765  0.524684921 -1.828342829  0.425147685
 [41]  1.696034376 -0.497231473 -0.625893168  0.678418833  0.009172152
 [46] -2.043068081 -1.255155583  0.346912815 -0.966818065 -0.552038941
 [51]  2.420919557 -0.140905001  0.324781025  0.653920564 -0.557612362
 [56]  0.884555064  1.419568126  0.704496377 -0.208197863 -0.005626649
 [61] -1.477083332 -0.985627428 -1.514968363  0.012651931  0.688875507
 [66] -1.327128609 -1.308743610 -1.170533016 -1.196261778 -0.253492265
 [71]  1.529281793 -1.121047709 -0.515689155  0.351236477 -0.183698105
 [76] -0.734117078 -0.467169598  0.837824130 -0.119263799  0.101917867
 [81]  2.109200701  2.119459143  0.159797450  1.614555672 -0.300423946
 [86]  0.201259289 -1.968984871 -1.304244709 -0.108428316  2.084656259
 [91] -0.590167867 -0.166576834  0.432812835 -0.433706892  0.196590509
 [96]  0.236482179  0.196378330 -0.615525825 -0.206342556 -1.078842140
> colSums(tmp)
  [1] -0.926636307  2.885788603 -0.971502850  2.004953482  1.002976079
  [6]  1.138138283  1.610571868 -0.590928040  1.913694898  0.298646626
 [11]  0.633872506 -0.500760880 -0.860835949  0.408982587 -0.212505177
 [16] -0.153579552 -0.527386586  0.394370226 -1.121999916 -0.922978194
 [21] -0.198670459 -0.461142512  1.938177888  0.217323362 -0.648408954
 [26]  0.964815462  0.011193548  0.848478963 -0.887233473  0.199534441
 [31] -2.328091206 -0.055853654 -1.269957236  2.317897548 -0.383396398
 [36] -1.155428694  0.311662765  0.524684921 -1.828342829  0.425147685
 [41]  1.696034376 -0.497231473 -0.625893168  0.678418833  0.009172152
 [46] -2.043068081 -1.255155583  0.346912815 -0.966818065 -0.552038941
 [51]  2.420919557 -0.140905001  0.324781025  0.653920564 -0.557612362
 [56]  0.884555064  1.419568126  0.704496377 -0.208197863 -0.005626649
 [61] -1.477083332 -0.985627428 -1.514968363  0.012651931  0.688875507
 [66] -1.327128609 -1.308743610 -1.170533016 -1.196261778 -0.253492265
 [71]  1.529281793 -1.121047709 -0.515689155  0.351236477 -0.183698105
 [76] -0.734117078 -0.467169598  0.837824130 -0.119263799  0.101917867
 [81]  2.109200701  2.119459143  0.159797450  1.614555672 -0.300423946
 [86]  0.201259289 -1.968984871 -1.304244709 -0.108428316  2.084656259
 [91] -0.590167867 -0.166576834  0.432812835 -0.433706892  0.196590509
 [96]  0.236482179  0.196378330 -0.615525825 -0.206342556 -1.078842140
> colVars(tmp)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> colSd(tmp)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> colMax(tmp)
  [1] -0.926636307  2.885788603 -0.971502850  2.004953482  1.002976079
  [6]  1.138138283  1.610571868 -0.590928040  1.913694898  0.298646626
 [11]  0.633872506 -0.500760880 -0.860835949  0.408982587 -0.212505177
 [16] -0.153579552 -0.527386586  0.394370226 -1.121999916 -0.922978194
 [21] -0.198670459 -0.461142512  1.938177888  0.217323362 -0.648408954
 [26]  0.964815462  0.011193548  0.848478963 -0.887233473  0.199534441
 [31] -2.328091206 -0.055853654 -1.269957236  2.317897548 -0.383396398
 [36] -1.155428694  0.311662765  0.524684921 -1.828342829  0.425147685
 [41]  1.696034376 -0.497231473 -0.625893168  0.678418833  0.009172152
 [46] -2.043068081 -1.255155583  0.346912815 -0.966818065 -0.552038941
 [51]  2.420919557 -0.140905001  0.324781025  0.653920564 -0.557612362
 [56]  0.884555064  1.419568126  0.704496377 -0.208197863 -0.005626649
 [61] -1.477083332 -0.985627428 -1.514968363  0.012651931  0.688875507
 [66] -1.327128609 -1.308743610 -1.170533016 -1.196261778 -0.253492265
 [71]  1.529281793 -1.121047709 -0.515689155  0.351236477 -0.183698105
 [76] -0.734117078 -0.467169598  0.837824130 -0.119263799  0.101917867
 [81]  2.109200701  2.119459143  0.159797450  1.614555672 -0.300423946
 [86]  0.201259289 -1.968984871 -1.304244709 -0.108428316  2.084656259
 [91] -0.590167867 -0.166576834  0.432812835 -0.433706892  0.196590509
 [96]  0.236482179  0.196378330 -0.615525825 -0.206342556 -1.078842140
> colMin(tmp)
  [1] -0.926636307  2.885788603 -0.971502850  2.004953482  1.002976079
  [6]  1.138138283  1.610571868 -0.590928040  1.913694898  0.298646626
 [11]  0.633872506 -0.500760880 -0.860835949  0.408982587 -0.212505177
 [16] -0.153579552 -0.527386586  0.394370226 -1.121999916 -0.922978194
 [21] -0.198670459 -0.461142512  1.938177888  0.217323362 -0.648408954
 [26]  0.964815462  0.011193548  0.848478963 -0.887233473  0.199534441
 [31] -2.328091206 -0.055853654 -1.269957236  2.317897548 -0.383396398
 [36] -1.155428694  0.311662765  0.524684921 -1.828342829  0.425147685
 [41]  1.696034376 -0.497231473 -0.625893168  0.678418833  0.009172152
 [46] -2.043068081 -1.255155583  0.346912815 -0.966818065 -0.552038941
 [51]  2.420919557 -0.140905001  0.324781025  0.653920564 -0.557612362
 [56]  0.884555064  1.419568126  0.704496377 -0.208197863 -0.005626649
 [61] -1.477083332 -0.985627428 -1.514968363  0.012651931  0.688875507
 [66] -1.327128609 -1.308743610 -1.170533016 -1.196261778 -0.253492265
 [71]  1.529281793 -1.121047709 -0.515689155  0.351236477 -0.183698105
 [76] -0.734117078 -0.467169598  0.837824130 -0.119263799  0.101917867
 [81]  2.109200701  2.119459143  0.159797450  1.614555672 -0.300423946
 [86]  0.201259289 -1.968984871 -1.304244709 -0.108428316  2.084656259
 [91] -0.590167867 -0.166576834  0.432812835 -0.433706892  0.196590509
 [96]  0.236482179  0.196378330 -0.615525825 -0.206342556 -1.078842140
> colMedians(tmp)
  [1] -0.926636307  2.885788603 -0.971502850  2.004953482  1.002976079
  [6]  1.138138283  1.610571868 -0.590928040  1.913694898  0.298646626
 [11]  0.633872506 -0.500760880 -0.860835949  0.408982587 -0.212505177
 [16] -0.153579552 -0.527386586  0.394370226 -1.121999916 -0.922978194
 [21] -0.198670459 -0.461142512  1.938177888  0.217323362 -0.648408954
 [26]  0.964815462  0.011193548  0.848478963 -0.887233473  0.199534441
 [31] -2.328091206 -0.055853654 -1.269957236  2.317897548 -0.383396398
 [36] -1.155428694  0.311662765  0.524684921 -1.828342829  0.425147685
 [41]  1.696034376 -0.497231473 -0.625893168  0.678418833  0.009172152
 [46] -2.043068081 -1.255155583  0.346912815 -0.966818065 -0.552038941
 [51]  2.420919557 -0.140905001  0.324781025  0.653920564 -0.557612362
 [56]  0.884555064  1.419568126  0.704496377 -0.208197863 -0.005626649
 [61] -1.477083332 -0.985627428 -1.514968363  0.012651931  0.688875507
 [66] -1.327128609 -1.308743610 -1.170533016 -1.196261778 -0.253492265
 [71]  1.529281793 -1.121047709 -0.515689155  0.351236477 -0.183698105
 [76] -0.734117078 -0.467169598  0.837824130 -0.119263799  0.101917867
 [81]  2.109200701  2.119459143  0.159797450  1.614555672 -0.300423946
 [86]  0.201259289 -1.968984871 -1.304244709 -0.108428316  2.084656259
 [91] -0.590167867 -0.166576834  0.432812835 -0.433706892  0.196590509
 [96]  0.236482179  0.196378330 -0.615525825 -0.206342556 -1.078842140
> colRanges(tmp)
           [,1]     [,2]       [,3]     [,4]     [,5]     [,6]     [,7]
[1,] -0.9266363 2.885789 -0.9715029 2.004953 1.002976 1.138138 1.610572
[2,] -0.9266363 2.885789 -0.9715029 2.004953 1.002976 1.138138 1.610572
          [,8]     [,9]     [,10]     [,11]      [,12]      [,13]     [,14]
[1,] -0.590928 1.913695 0.2986466 0.6338725 -0.5007609 -0.8608359 0.4089826
[2,] -0.590928 1.913695 0.2986466 0.6338725 -0.5007609 -0.8608359 0.4089826
          [,15]      [,16]      [,17]     [,18]  [,19]      [,20]      [,21]
[1,] -0.2125052 -0.1535796 -0.5273866 0.3943702 -1.122 -0.9229782 -0.1986705
[2,] -0.2125052 -0.1535796 -0.5273866 0.3943702 -1.122 -0.9229782 -0.1986705
          [,22]    [,23]     [,24]     [,25]     [,26]      [,27]    [,28]
[1,] -0.4611425 1.938178 0.2173234 -0.648409 0.9648155 0.01119355 0.848479
[2,] -0.4611425 1.938178 0.2173234 -0.648409 0.9648155 0.01119355 0.848479
          [,29]     [,30]     [,31]       [,32]     [,33]    [,34]      [,35]
[1,] -0.8872335 0.1995344 -2.328091 -0.05585365 -1.269957 2.317898 -0.3833964
[2,] -0.8872335 0.1995344 -2.328091 -0.05585365 -1.269957 2.317898 -0.3833964
         [,36]     [,37]     [,38]     [,39]     [,40]    [,41]      [,42]
[1,] -1.155429 0.3116628 0.5246849 -1.828343 0.4251477 1.696034 -0.4972315
[2,] -1.155429 0.3116628 0.5246849 -1.828343 0.4251477 1.696034 -0.4972315
          [,43]     [,44]       [,45]     [,46]     [,47]     [,48]      [,49]
[1,] -0.6258932 0.6784188 0.009172152 -2.043068 -1.255156 0.3469128 -0.9668181
[2,] -0.6258932 0.6784188 0.009172152 -2.043068 -1.255156 0.3469128 -0.9668181
          [,50]   [,51]     [,52]    [,53]     [,54]      [,55]     [,56]
[1,] -0.5520389 2.42092 -0.140905 0.324781 0.6539206 -0.5576124 0.8845551
[2,] -0.5520389 2.42092 -0.140905 0.324781 0.6539206 -0.5576124 0.8845551
        [,57]     [,58]      [,59]        [,60]     [,61]      [,62]     [,63]
[1,] 1.419568 0.7044964 -0.2081979 -0.005626649 -1.477083 -0.9856274 -1.514968
[2,] 1.419568 0.7044964 -0.2081979 -0.005626649 -1.477083 -0.9856274 -1.514968
          [,64]     [,65]     [,66]     [,67]     [,68]     [,69]      [,70]
[1,] 0.01265193 0.6888755 -1.327129 -1.308744 -1.170533 -1.196262 -0.2534923
[2,] 0.01265193 0.6888755 -1.327129 -1.308744 -1.170533 -1.196262 -0.2534923
        [,71]     [,72]      [,73]     [,74]      [,75]      [,76]      [,77]
[1,] 1.529282 -1.121048 -0.5156892 0.3512365 -0.1836981 -0.7341171 -0.4671696
[2,] 1.529282 -1.121048 -0.5156892 0.3512365 -0.1836981 -0.7341171 -0.4671696
         [,78]      [,79]     [,80]    [,81]    [,82]     [,83]    [,84]
[1,] 0.8378241 -0.1192638 0.1019179 2.109201 2.119459 0.1597974 1.614556
[2,] 0.8378241 -0.1192638 0.1019179 2.109201 2.119459 0.1597974 1.614556
          [,85]     [,86]     [,87]     [,88]      [,89]    [,90]      [,91]
[1,] -0.3004239 0.2012593 -1.968985 -1.304245 -0.1084283 2.084656 -0.5901679
[2,] -0.3004239 0.2012593 -1.968985 -1.304245 -0.1084283 2.084656 -0.5901679
          [,92]     [,93]      [,94]     [,95]     [,96]     [,97]      [,98]
[1,] -0.1665768 0.4328128 -0.4337069 0.1965905 0.2364822 0.1963783 -0.6155258
[2,] -0.1665768 0.4328128 -0.4337069 0.1965905 0.2364822 0.1963783 -0.6155258
          [,99]    [,100]
[1,] -0.2063426 -1.078842
[2,] -0.2063426 -1.078842
> 
> 
> Max(tmp2)
[1] 2.251569
> Min(tmp2)
[1] -3.073048
> mean(tmp2)
[1] -0.1664997
> Sum(tmp2)
[1] -16.64997
> Var(tmp2)
[1] 1.096045
> 
> rowMeans(tmp2)
  [1] -2.122085043  0.749210207  0.757519589  0.503826765 -1.159997496
  [6]  0.263114342  0.373759831 -1.236230171 -1.344820863  0.781585463
 [11]  0.086463853  1.374526026  0.616377503 -0.048695104  0.928607373
 [16]  0.500254547 -0.413361015 -1.271486790  0.091230973 -3.073048059
 [21] -1.027793513 -0.603329944  0.787854776 -0.094085505 -0.044829001
 [26] -0.627573876 -0.442966266  1.070212557  0.770115749  1.861232104
 [31] -0.124327787  1.018934937  1.243932238  0.333223645 -0.257762421
 [36]  0.169129511 -0.047527227  2.128736764 -0.624853448  0.641711203
 [41]  0.656278035 -0.025821970 -0.477511077 -1.514787422  2.251569397
 [46] -1.935101289 -1.483503887 -0.766655189 -0.298860496 -0.597048012
 [51]  0.087060550  0.177045916  0.333952539 -0.291967914  0.037767299
 [56] -0.796479458 -1.462693610  0.887658742 -0.287496028  1.394293423
 [61] -0.560911872 -3.019591962 -0.867866776  1.778127397 -2.250869646
 [66] -1.715277906  0.134405533  0.589526542 -0.660105505  1.920153644
 [71] -0.745943357 -0.767668930  0.004539125 -0.628433961  0.924265376
 [76]  0.120650470 -1.501849196  0.579801557  0.993208616 -1.528992819
 [81] -0.768851683 -0.763361504  1.377977885  0.251281946  0.039425214
 [86] -0.077370014 -1.272814290  0.225030056 -1.710263645  0.279367216
 [91] -0.618729009  0.337208084 -0.504139174 -0.323650604 -0.974889042
 [96] -0.583260100 -1.979188278 -0.201074479  0.034981479 -0.589305190
> rowSums(tmp2)
  [1] -2.122085043  0.749210207  0.757519589  0.503826765 -1.159997496
  [6]  0.263114342  0.373759831 -1.236230171 -1.344820863  0.781585463
 [11]  0.086463853  1.374526026  0.616377503 -0.048695104  0.928607373
 [16]  0.500254547 -0.413361015 -1.271486790  0.091230973 -3.073048059
 [21] -1.027793513 -0.603329944  0.787854776 -0.094085505 -0.044829001
 [26] -0.627573876 -0.442966266  1.070212557  0.770115749  1.861232104
 [31] -0.124327787  1.018934937  1.243932238  0.333223645 -0.257762421
 [36]  0.169129511 -0.047527227  2.128736764 -0.624853448  0.641711203
 [41]  0.656278035 -0.025821970 -0.477511077 -1.514787422  2.251569397
 [46] -1.935101289 -1.483503887 -0.766655189 -0.298860496 -0.597048012
 [51]  0.087060550  0.177045916  0.333952539 -0.291967914  0.037767299
 [56] -0.796479458 -1.462693610  0.887658742 -0.287496028  1.394293423
 [61] -0.560911872 -3.019591962 -0.867866776  1.778127397 -2.250869646
 [66] -1.715277906  0.134405533  0.589526542 -0.660105505  1.920153644
 [71] -0.745943357 -0.767668930  0.004539125 -0.628433961  0.924265376
 [76]  0.120650470 -1.501849196  0.579801557  0.993208616 -1.528992819
 [81] -0.768851683 -0.763361504  1.377977885  0.251281946  0.039425214
 [86] -0.077370014 -1.272814290  0.225030056 -1.710263645  0.279367216
 [91] -0.618729009  0.337208084 -0.504139174 -0.323650604 -0.974889042
 [96] -0.583260100 -1.979188278 -0.201074479  0.034981479 -0.589305190
> 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] -2.122085043  0.749210207  0.757519589  0.503826765 -1.159997496
  [6]  0.263114342  0.373759831 -1.236230171 -1.344820863  0.781585463
 [11]  0.086463853  1.374526026  0.616377503 -0.048695104  0.928607373
 [16]  0.500254547 -0.413361015 -1.271486790  0.091230973 -3.073048059
 [21] -1.027793513 -0.603329944  0.787854776 -0.094085505 -0.044829001
 [26] -0.627573876 -0.442966266  1.070212557  0.770115749  1.861232104
 [31] -0.124327787  1.018934937  1.243932238  0.333223645 -0.257762421
 [36]  0.169129511 -0.047527227  2.128736764 -0.624853448  0.641711203
 [41]  0.656278035 -0.025821970 -0.477511077 -1.514787422  2.251569397
 [46] -1.935101289 -1.483503887 -0.766655189 -0.298860496 -0.597048012
 [51]  0.087060550  0.177045916  0.333952539 -0.291967914  0.037767299
 [56] -0.796479458 -1.462693610  0.887658742 -0.287496028  1.394293423
 [61] -0.560911872 -3.019591962 -0.867866776  1.778127397 -2.250869646
 [66] -1.715277906  0.134405533  0.589526542 -0.660105505  1.920153644
 [71] -0.745943357 -0.767668930  0.004539125 -0.628433961  0.924265376
 [76]  0.120650470 -1.501849196  0.579801557  0.993208616 -1.528992819
 [81] -0.768851683 -0.763361504  1.377977885  0.251281946  0.039425214
 [86] -0.077370014 -1.272814290  0.225030056 -1.710263645  0.279367216
 [91] -0.618729009  0.337208084 -0.504139174 -0.323650604 -0.974889042
 [96] -0.583260100 -1.979188278 -0.201074479  0.034981479 -0.589305190
> rowMin(tmp2)
  [1] -2.122085043  0.749210207  0.757519589  0.503826765 -1.159997496
  [6]  0.263114342  0.373759831 -1.236230171 -1.344820863  0.781585463
 [11]  0.086463853  1.374526026  0.616377503 -0.048695104  0.928607373
 [16]  0.500254547 -0.413361015 -1.271486790  0.091230973 -3.073048059
 [21] -1.027793513 -0.603329944  0.787854776 -0.094085505 -0.044829001
 [26] -0.627573876 -0.442966266  1.070212557  0.770115749  1.861232104
 [31] -0.124327787  1.018934937  1.243932238  0.333223645 -0.257762421
 [36]  0.169129511 -0.047527227  2.128736764 -0.624853448  0.641711203
 [41]  0.656278035 -0.025821970 -0.477511077 -1.514787422  2.251569397
 [46] -1.935101289 -1.483503887 -0.766655189 -0.298860496 -0.597048012
 [51]  0.087060550  0.177045916  0.333952539 -0.291967914  0.037767299
 [56] -0.796479458 -1.462693610  0.887658742 -0.287496028  1.394293423
 [61] -0.560911872 -3.019591962 -0.867866776  1.778127397 -2.250869646
 [66] -1.715277906  0.134405533  0.589526542 -0.660105505  1.920153644
 [71] -0.745943357 -0.767668930  0.004539125 -0.628433961  0.924265376
 [76]  0.120650470 -1.501849196  0.579801557  0.993208616 -1.528992819
 [81] -0.768851683 -0.763361504  1.377977885  0.251281946  0.039425214
 [86] -0.077370014 -1.272814290  0.225030056 -1.710263645  0.279367216
 [91] -0.618729009  0.337208084 -0.504139174 -0.323650604 -0.974889042
 [96] -0.583260100 -1.979188278 -0.201074479  0.034981479 -0.589305190
> 
> colMeans(tmp2)
[1] -0.1664997
> colSums(tmp2)
[1] -16.64997
> colVars(tmp2)
[1] 1.096045
> colSd(tmp2)
[1] 1.046922
> colMax(tmp2)
[1] 2.251569
> colMin(tmp2)
[1] -3.073048
> colMedians(tmp2)
[1] -0.06303256
> colRanges(tmp2)
          [,1]
[1,] -3.073048
[2,]  2.251569
> 
> 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]  3.2078893 -3.6881276 -2.1952955 -1.1459359  3.1936829 -2.3147670
 [7] -2.1192376 -0.6650122  0.3400188 -2.0498316
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -1.3091777
[2,] -0.5229375
[3,]  0.3864087
[4,]  0.9716037
[5,]  2.3842715
> 
> rowApply(tmp,sum)
 [1] -2.4829274 -0.5883071 -4.9208613 -0.6493345 -2.3933455  2.7065026
 [7]  1.2757773  1.1088912 -0.9429693 -0.5500424
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    3    4    6    8    2    8    7    8    9    10
 [2,]    4    2    7    3    6    5    4    5    2     7
 [3,]    5    8    3    7    1    7    5   10    3     4
 [4,]    9    5    5    5    8    2    1    6    7     6
 [5,]    1   10    9    4    7   10   10    1    4     8
 [6,]    2    9    4    6    5    3    3    3    5     9
 [7,]   10    1   10    2    3    6    9    7    1     2
 [8,]    8    7    1   10   10    1    8    4    6     3
 [9,]    7    6    8    9    9    4    6    2   10     1
[10,]    6    3    2    1    4    9    2    9    8     5
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1] -1.691898325  0.973208342  3.078885342 -1.129149519 -0.768323765
 [6]  0.798072999  1.854800591 -3.949856573  2.353967193 -0.804809519
[11] -0.460681591  3.205700165  2.169387703 -0.533440562  2.412509582
[16] -5.375892459 -1.731085574 -1.363113147  0.009232465 -0.677147266
> colApply(tmp,quantile)[,1]
          [,1]
[1,] -1.964827
[2,] -1.158433
[3,] -1.083670
[4,]  0.858444
[5,]  1.656587
> 
> rowApply(tmp,sum)
[1] -3.0502376 -6.6994213  0.6222328  1.6942502  5.8035420
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]    5    1    2   16   17
[2,]    4   18   16   18    4
[3,]   18    6   20   20    6
[4,]   14    3    6    9   12
[5,]    2    7   15   19    9
> 
> 
> as.matrix(tmp)
          [,1]       [,2]       [,3]       [,4]         [,5]       [,6]
[1,] -1.158433 -1.2481152  1.0106554  0.4245942 -1.735965155  0.9218287
[2,] -1.964827  0.6825237 -0.6798405 -1.4825122 -0.562566137 -1.3638858
[3,] -1.083670  0.8861518  1.7924215 -0.4258351  0.270640191 -0.1823965
[4,]  0.858444  1.2394415  1.4077085 -0.2000074  1.252588352  0.9689978
[5,]  1.656587 -0.5867934 -0.4520596  0.5546110  0.006978985  0.4535289
           [,7]        [,8]       [,9]      [,10]      [,11]      [,12]
[1,]  0.8451484 -0.50728417  1.5310187 -0.8195147 -1.0441239  2.7159716
[2,]  0.3124520 -0.72625849 -0.2557221 -0.5441144  0.2227999 -0.1366883
[3,]  1.1222505 -0.01335416 -0.2260651  0.1714420  1.7680307 -0.9720085
[4,] -0.7880624 -0.31088894  0.5593524 -1.0397160  0.4544217 -0.1719042
[5,]  0.3630121 -2.39207081  0.7453833  1.4270936 -1.8618100  1.7703295
          [,13]       [,14]      [,15]      [,16]        [,17]      [,18]
[1,]  0.3015186  0.37128757 -0.3495089 -1.5509198 -2.416011379 -1.1480413
[2,]  0.8860144  0.03495696 -0.2620333 -1.8283096  0.005361193  1.3296947
[3,] -0.4046282 -0.08662729  1.3221486 -0.5550526 -0.344817444 -0.6607112
[4,]  0.5710836 -0.58015905 -0.5734737 -0.9686637 -0.819736435 -0.2333684
[5,]  0.8153993 -0.27289876  2.2753767 -0.4729468  1.844118491 -0.6506870
            [,19]       [,20]
[1,] -0.165666893  0.97132308
[2,] -0.220690881 -0.14577588
[3,] -0.411106041 -1.34458079
[4,] -0.007513209  0.07570569
[5,]  0.814209489 -0.23381936
> 
> 
> 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 :  650  bytes.
Disk usage :  200  bytes.
> subBufferedMatrix(tmp,,5:8)
BufferedMatrix object
Matrix size:  5 4 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  563  bytes.
Disk usage :  160  bytes.
> subBufferedMatrix(tmp,1:3,)
BufferedMatrix object
Matrix size:  3 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.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.06605059 -0.7676257 1.181434 -0.5708188 -1.000295 -0.6665039 -0.8426932
         col8     col9     col10     col11     col12    col13    col14
row1 1.069789 1.977714 0.1754859 0.2197319 0.1575196 0.241553 1.310781
         col15      col16     col17    col18     col19      col20
row1 -1.319402 -0.5252875 -1.260141 1.812406 -1.497687 -0.7425686
> tmp[,"col10"]
           col10
row1  0.17548592
row2  1.54931661
row3  1.16317977
row4 -0.12785071
row5 -0.08682874
> tmp[c("row1","row5"),]
            col1       col2       col3       col4       col5       col6
row1 -0.06605059 -0.7676257  1.1814340 -0.5708188 -1.0002946 -0.6665039
row5  0.44223060  0.6943327 -0.1453222 -0.8549851 -0.4223877 -0.8502684
           col7      col8      col9       col10      col11      col12
row1 -0.8426932 1.0697894 1.9777135  0.17548592  0.2197319  0.1575196
row5 -1.3731391 0.8475898 0.1687815 -0.08682874 -0.2770601 -0.7551080
          col13      col14      col15      col16      col17     col18
row1 0.24155295  1.3107810 -1.3194020 -0.5252875 -1.2601414 1.8124058
row5 0.04107438 -0.5823472 -0.3012288  1.0626122  0.6124437 0.1488566
          col19      col20
row1 -1.4976871 -0.7425686
row5  0.9213859 -0.5461645
> tmp[,c("col6","col20")]
           col6      col20
row1 -0.6665039 -0.7425686
row2 -1.3121104 -0.2701992
row3 -0.1078786 -2.4710833
row4  0.3119568  0.2513838
row5 -0.8502684 -0.5461645
> tmp[c("row1","row5"),c("col6","col20")]
           col6      col20
row1 -0.6665039 -0.7425686
row5 -0.8502684 -0.5461645
> 
> 
> 
> 
> 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 49.60912 50.13405 49.30238 49.62502 49.98904 105.0308 50.97933 50.31908
         col9    col10   col11   col12    col13    col14    col15    col16
row1 49.01528 50.65866 48.0816 50.4108 48.81126 48.36523 51.26113 51.70145
        col17    col18    col19    col20
row1 49.24174 51.18345 48.31057 104.4093
> tmp[,"col10"]
        col10
row1 50.65866
row2 30.04993
row3 30.84394
row4 30.21413
row5 51.08075
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 49.60912 50.13405 49.30238 49.62502 49.98904 105.0308 50.97933 50.31908
row5 49.79688 50.88328 51.44176 51.31413 50.54936 106.9321 50.54496 48.38701
         col9    col10    col11    col12    col13    col14    col15    col16
row1 49.01528 50.65866 48.08160 50.41080 48.81126 48.36523 51.26113 51.70145
row5 51.21221 51.08075 50.28891 50.53887 49.69854 49.76853 52.01648 48.46869
        col17    col18    col19    col20
row1 49.24174 51.18345 48.31057 104.4093
row5 50.01620 49.04669 50.02916 106.5046
> tmp[,c("col6","col20")]
          col6     col20
row1 105.03081 104.40927
row2  74.05160  74.65338
row3  75.16035  76.07903
row4  74.37506  74.90146
row5 106.93205 106.50459
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 105.0308 104.4093
row5 106.9321 106.5046
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 105.0308 104.4093
row5 106.9321 106.5046
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
          col13
[1,] -1.7580935
[2,] -1.2049327
[3,]  1.1311452
[4,] -0.3283741
[5,] -0.2495104
> tmp[,c("col17","col7")]
          col17       col7
[1,]  1.3434903 -1.4822513
[2,]  1.0722634  1.3907582
[3,]  0.6279880  0.2161382
[4,] -0.3541591  1.1601924
[5,] -0.3929391  0.5324108
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
           col6       col20
[1,]  1.1963120 -0.41194626
[2,] -0.3809131 -1.41101152
[3,]  0.2719239 -0.08969407
[4,] -0.9123117  0.11489857
[5,]  0.4392498  1.44413254
> subBufferedMatrix(tmp,1,c("col6"))[,1]
         col1
[1,] 1.196312
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
           col6
[1,]  1.1963120
[2,] -0.3809131
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> 
> 
> 
> subBufferedMatrix(tmp,c("row3","row1"),)[,1:20]
           [,1]       [,2]      [,3]       [,4]      [,5]       [,6]
row3 -0.3208333 -0.8369239 1.1667539  0.1029894 0.7040276  1.2385799
row1 -0.8320952  0.3394966 0.1411675 -0.4915897 1.4515787 -0.5085321
            [,7]        [,8]       [,9]      [,10]      [,11]      [,12]
row3  1.23725879  0.40165001  0.6364437 -0.5412862 -1.7010067  0.6995368
row1 -0.08785711 -0.07575514 -2.0488648  1.7164541  0.5898485 -0.5620255
         [,13]      [,14]      [,15]      [,16]       [,17]      [,18]
row3 -1.632001 -0.8649483  0.6815468  0.1747886  0.01641027  0.3959197
row1  0.877416  0.4137007 -1.3287030 -1.7253173 -0.11396321 -0.5652859
          [,19]     [,20]
row3 -0.5226253 1.6237395
row1 -0.6483615 0.6039459
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
           [,1]       [,2]      [,3]      [,4]       [,5]       [,6]      [,7]
row2 -0.3258517 -0.3515893 -1.212909 -1.202784 -0.6330399 -0.4654763 0.5325728
           [,8]      [,9]      [,10]
row2 -0.3180905 0.2020615 -0.5661335
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
         [,1]        [,2]      [,3]        [,4]     [,5]       [,6]      [,7]
row5 1.009681 -0.06486576 0.7251325 -0.08789713 1.315895 -0.2973351 0.3571363
          [,8]      [,9]      [,10]    [,11]     [,12]      [,13]      [,14]
row5 -0.752227 0.1793448 -0.3503693 1.741905 -1.128666 -0.2046575 -0.1120686
         [,15]     [,16]    [,17]     [,18]      [,19]     [,20]
row5 0.5532862 -1.559536 1.227967 -1.525106 -0.8581671 0.5770137
> 
> 
> 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: 0x600001ed4240>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM6f8d4417ac62"
 [2] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM6f8d6e3678da"
 [3] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM6f8d3a3868bd"
 [4] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM6f8d4d646e27"
 [5] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM6f8d7c7bea22"
 [6] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM6f8d2b489e07"
 [7] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM6f8d2c7ef3c4"
 [8] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM6f8d42b5dfae"
 [9] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM6f8d32703ab9"
[10] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM6f8d661f618d"
[11] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM6f8d163da45c"
[12] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM6f8d28f19f6c"
[13] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM6f8df198074" 
[14] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM6f8d5340476a"
[15] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM6f8d2110aad9"
> 
> 
> ### 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: 0x600001ec43c0>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x600001ec43c0>
Warning message:
In dir.create(new.directory) :
  '/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x600001ec43c0>
> rowMedians(tmp)
  [1] -0.366671709  0.037980863 -0.218969193  0.223274913  0.145374678
  [6] -0.236192228  0.206311061  0.112925701 -0.288868785 -0.025140380
 [11]  0.008875674 -0.371607540 -0.031345116 -0.643503133  0.327590752
 [16]  0.227202780  0.136817220  0.281439495 -0.252534096  0.058112320
 [21]  0.367515273 -0.182409528  0.614503292 -0.315125473  0.317750467
 [26]  0.029097475  0.497990894 -0.303027257 -0.227429325  0.113880285
 [31]  0.109492279 -0.301157611 -0.118985851  0.173147300  0.724878481
 [36]  0.013231936 -0.583130393  0.076681860  0.165410136 -0.376160404
 [41]  0.268430583  0.186776613 -0.080522830  0.023878305 -0.039380085
 [46] -0.074869862 -0.433679437  0.111291315  0.385626553  0.229294881
 [51]  0.231472905 -0.105176995 -0.103932974 -0.303303751 -0.109896677
 [56]  0.081778290 -0.201957433  0.279038685  0.002602175  0.003671711
 [61] -0.855116420 -0.104767047 -0.349825307  0.258508456 -0.414495170
 [66] -0.104978476  0.078965486 -0.307085242  0.448753039  0.152710434
 [71] -0.125222827 -0.466096721 -0.328296246  0.163451183 -0.904967380
 [76] -0.473215628 -0.057735646  0.040823821  0.002827908 -0.379077045
 [81]  0.913614169 -0.345035629 -0.200186362  0.285774787  0.424500268
 [86]  0.310775001 -0.135104674 -0.035840567  0.289722653  0.627711176
 [91]  0.397830945  0.051716610 -0.342382630  0.287347629 -0.298977037
 [96]  0.213997995 -0.373828168 -0.438238858 -0.494972313  0.156234066
[101]  0.003230054  0.165671568  0.308377658 -0.799775148 -0.018909767
[106] -0.491906418  0.210100242  0.025447567 -0.122482159  0.552824777
[111] -0.308651366  0.460335986 -0.288229972  0.021527538 -0.223259453
[116] -0.249958713  0.399292627  0.635192889  0.158967433 -0.547092838
[121] -0.069186581  0.069324970  0.178923554 -0.326844853  0.418066431
[126]  0.773000201  0.353128943  0.001027653  0.304786032  0.023053733
[131] -0.040727921  0.058663392  0.332397764 -0.014571249 -0.112629136
[136]  0.085775495 -0.112655082  0.155505610  0.049020810  0.238133481
[141]  0.183845195  0.106481281 -0.014668873  0.173535076  0.206906134
[146] -0.214548880  0.032026821  0.067648390  0.139854658 -0.226074457
[151] -0.755146124  0.144274102 -0.143575915  0.323868934  0.407116692
[156]  0.170209960  0.254128946 -0.460004944  0.431635551  0.157917010
[161]  0.568951848 -0.457850561 -0.437362296 -0.258713750 -0.160831776
[166] -0.402325583 -0.338139377 -0.001625346  0.183239094 -0.539273407
[171] -0.452438998  0.050758008  0.069775560 -0.378897205 -0.209949553
[176] -0.279591162 -0.180884152 -0.053034331 -0.164367393  0.294225724
[181] -0.045696438  0.177488064 -0.558073905 -0.357419071  0.160091138
[186]  0.512421477 -0.604269116 -0.222896185 -0.402876153 -0.122228503
[191] -0.308763277 -0.152380551  0.408557445 -0.136858588 -0.089417289
[196]  0.074885902 -0.583730651 -0.313699179  0.215055258  0.093615337
[201]  0.563534228  0.135829323 -0.369522625 -0.237630546 -0.457041025
[206] -0.103471088  0.220909561 -0.111540184  0.208942634 -0.068114983
[211]  0.116580348 -0.300193982 -0.479884380  0.169334994 -0.083008953
[216] -0.095394246  0.544293934  0.087479310 -0.155072891  0.042153105
[221]  0.296253354  0.306042103  0.319320931 -0.260066540  0.070197297
[226]  0.358112421  0.601620734  0.002858571  0.008147996  0.462566112
> 
> proc.time()
   user  system elapsed 
  2.090   8.601  11.309 

BufferedMatrix.Rcheck/tests/rawCalltesting.Rout


R version 4.5.1 Patched (2025-06-14 r88325) -- "Great Square Root"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: aarch64-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: 0x6000006f8240>
> .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: 0x6000006f8240>
> .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: 0x6000006f8240>
> .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: 0x6000006f8240>
> 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: 0x6000006e8600>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000006e8600>
> .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: 0x6000006e8600>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000006e8600>
> .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: 0x6000006e8600>
> 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: 0x6000006e87e0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000006e87e0>
> .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: 0x6000006e87e0>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x6000006e87e0>
> .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: 0x6000006e87e0>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x6000006e87e0>
> .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: 0x6000006e87e0>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x6000006e87e0>
> .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: 0x6000006e87e0>
> 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: 0x6000006e89c0>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x6000006e89c0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000006e89c0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000006e89c0>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile6fb716715775" "BufferedMatrixFile6fb76b24cdd5"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile6fb716715775" "BufferedMatrixFile6fb76b24cdd5"
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000006e8c60>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000006e8c60>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x6000006e8c60>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x6000006e8c60>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x6000006e8c60>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x6000006e8c60>
> .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: 0x6000006e8e40>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000006e8e40>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x6000006e8e40>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x6000006e8e40>
> 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: 0x6000006e9020>
> .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: 0x6000006e9020>
> rm(P)
> 
> proc.time()
   user  system elapsed 
  0.338   0.132   0.468 

BufferedMatrix.Rcheck/tests/Rcodetesting.Rout


R version 4.5.1 Patched (2025-06-14 r88325) -- "Great Square Root"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: aarch64-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.335   0.096   0.415 

Example timings