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

This page was generated on 2026-03-21 11:34 -0400 (Sat, 21 Mar 2026).

HostnameOSArch (*)R versionInstalled pkgs
nebbiolo1Linux (Ubuntu 24.04.3 LTS)x86_64R Under development (unstable) (2026-03-05 r89546) -- "Unsuffered Consequences" 4866
kjohnson3macOS 13.7.7 Venturaarm64R Under development (unstable) (2026-03-20 r89666) -- "Unsuffered Consequences" 4545
Click on any hostname to see more info about the system (e.g. compilers)      (*) as reported by 'uname -p', except on Windows and Mac OS X

Package 257/2368HostnameOS / ArchINSTALLBUILDCHECKBUILD BIN
BufferedMatrix 1.75.0  (landing page)
Ben Bolstad
Snapshot Date: 2026-03-20 13:40 -0400 (Fri, 20 Mar 2026)
git_url: https://git.bioconductor.org/packages/BufferedMatrix
git_branch: devel
git_last_commit: ecdbf23
git_last_commit_date: 2025-10-29 09:58:55 -0400 (Wed, 29 Oct 2025)
nebbiolo1Linux (Ubuntu 24.04.3 LTS) / x86_64  OK    OK    OK  UNNEEDED, same version is already published
kjohnson3macOS 13.7.7 Ventura / arm64  OK    OK    WARNINGS    ERROR  
See other builds for BufferedMatrix in R Universe.


CHECK results for BufferedMatrix on kjohnson3

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.75.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.75.0.tar.gz
StartedAt: 2026-03-20 21:43:47 -0400 (Fri, 20 Mar 2026)
EndedAt: 2026-03-20 21:44:12 -0400 (Fri, 20 Mar 2026)
EllapsedTime: 25.2 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.75.0.tar.gz
###
##############################################################################
##############################################################################


* using log directory ‘/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck’
* using R Under development (unstable) (2026-03-20 r89666)
* using platform: aarch64-apple-darwin23
* R was compiled by
    Apple clang version 17.0.0 (clang-1700.3.19.1)
    GNU Fortran (GCC) 14.2.0
* running under: macOS Tahoe 26.3.1
* using session charset: UTF-8
* current time: 2026-03-21 01:43:47 UTC
* using option ‘--no-vignettes’
* checking for file ‘BufferedMatrix/DESCRIPTION’ ... OK
* this is package ‘BufferedMatrix’ version ‘1.75.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.23-bioc/meat/BufferedMatrix.Rcheck/00install.out’ for details.
* used C compiler: ‘Apple clang version 17.0.0 (clang-1700.6.4.2)’
* used SDK: ‘MacOSX26.2.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 ... INFO
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, 1 NOTE
See
  ‘/Users/biocbuild/bbs-3.23-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.6/Resources/library’
* installing *source* package ‘BufferedMatrix’ ...
** this is package ‘BufferedMatrix’ version ‘1.75.0’
** using staged installation
** libs
using C compiler: ‘Apple clang version 17.0.0 (clang-1700.6.4.2)’
using SDK: ‘MacOSX26.2.sdk’
clang -arch arm64 -std=gnu23 -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=gnu23 -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]
 1580 |   if (!(Matrix->readonly) & setting){
      |       ^                   ~
doubleBufferedMatrix.c:1580:7: note: add parentheses after the '!' to evaluate the bitwise operator first
 1580 |   if (!(Matrix->readonly) & setting){
      |       ^                            
      |        (                           )
doubleBufferedMatrix.c:1580:7: note: add parentheses around left hand side expression to silence this warning
 1580 |   if (!(Matrix->readonly) & setting){
      |       ^
      |       (                  )
doubleBufferedMatrix.c:3327:12: warning: unused function 'sort_double' [-Wunused-function]
 3327 | static int sort_double(const double *a1,const double *a2){
      |            ^~~~~~~~~~~
2 warnings generated.
clang -arch arm64 -std=gnu23 -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=gnu23 -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=gnu23 -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.6/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 Under development (unstable) (2026-03-20 r89666) -- "Unsuffered Consequences"
Copyright (C) 2026 The R Foundation for Statistical Computing
Platform: aarch64-apple-darwin23

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.156   0.065   0.220 

BufferedMatrix.Rcheck/tests/objectTesting.Rout


R Under development (unstable) (2026-03-20 r89666) -- "Unsuffered Consequences"
Copyright (C) 2026 The R Foundation for Statistical Computing
Platform: aarch64-apple-darwin23

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.23-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 484118 25.9    1067182   57         NA   632022 33.8
Vcells 896941  6.9    8388608   64     196608  2112082 16.2
> 
> 
> 
> 
> ##
> ## checking reads
> ##
> 
> tmp2 <- createBufferedMatrix(10,20)
> 
> test.sample <- rnorm(10*20)
> 
> tmp2[1:10,1:20] <- test.sample
> 
> test.matrix <- matrix(test.sample,10,20)
> 
> ## testing reads
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   which.col <- sample(1:20,1)
+   if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> date()
[1] "Fri Mar 20 21:44:00 2026"
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> date()
[1] "Fri Mar 20 21:44:00 2026"
> 
> 
> 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: 0x10169cd20>
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   which.col <- sample(1:20,1)
+   if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,5,replace=TRUE)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> date()
[1] "Fri Mar 20 21:44:02 2026"
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col <- sample(1:20,5,replace=TRUE)
+   if (!all(tmp2[which.row,which.col] == test.matrix[which.row,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> date()
[1] "Fri Mar 20 21:44:03 2026"
> 
> ColMode(tmp2)
<pointer: 0x10169cd20>
> 
> 
> 
> ### Now testing assignments
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+ 
+   new.data <- rnorm(20)
+   tmp2[which.row,] <- new.data
+   test.matrix[which.row,] <- new.data
+   if (rep > 1){
+     if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+   
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   new.data <- rnorm(10)
+   tmp2[,which.col] <- new.data
+   test.matrix[,which.col]<- new.data
+ 
+   if (rep > 1){
+     if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.col <- which.col
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,5,replace=TRUE)
+   new.data <- matrix(rnorm(50),5,10)
+   tmp2[,which.col] <- new.data
+   test.matrix[,which.col]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.col <- which.col
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   new.data <- matrix(rnorm(50),5,10)
+   tmp2[which.row,] <- new.data
+   test.matrix[which.row,]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col  <- sample(1:20,5,replace=TRUE)
+   new.data <- matrix(rnorm(25),5,5)
+   tmp2[which.row,which.col] <- new.data
+   test.matrix[which.row,which.col]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[prev.row,prev.col] == test.matrix[prev.row,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+   prev.col <- which.col
+ }
> 
> 
> 
> 
> ###
> ###
> ### testing some more functions
> ###
> 
> 
> 
> ## duplication function
> tmp5 <- duplicate(tmp2)
> 
> # making sure really did copy everything.
> tmp5[1,1] <- tmp5[1,1] +100.00
> 
> if (tmp5[1,1] == tmp2[1,1]){
+   stop("Problem with duplication")
+ }
> 
> 
> 
> 
> ### testing elementwise applying of functions
> 
> tmp5[1:4,1:4]
           [,1]       [,2]       [,3]        [,4]
[1,] 98.7815787 -1.9689716 -0.2224074 -0.28661724
[2,] -0.1468801  0.6198358  0.0458471 -0.07027764
[3,] -1.1256542  0.8197941  0.2970724 -0.04316265
[4,]  0.5587228 -0.4275271 -1.8308993  0.03460941
> ewApply(tmp5,abs)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
           [,1]      [,2]      [,3]       [,4]
[1,] 98.7815787 1.9689716 0.2224074 0.28661724
[2,]  0.1468801 0.6198358 0.0458471 0.07027764
[3,]  1.1256542 0.8197941 0.2970724 0.04316265
[4,]  0.5587228 0.4275271 1.8308993 0.03460941
> ewApply(tmp5,sqrt)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
          [,1]      [,2]      [,3]      [,4]
[1,] 9.9388922 1.4032005 0.4716009 0.5353665
[2,] 0.3832494 0.7872965 0.2141194 0.2650993
[3,] 1.0609685 0.9054248 0.5450435 0.2077562
[4,] 0.7474777 0.6538556 1.3531073 0.1860360
> 
> 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.23-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
          [,1]     [,2]     [,3]     [,4]
[1,] 223.17050 41.00098 29.93842 30.64028
[2,]  28.97937 33.49280 27.18704 27.72127
[3,]  36.73534 34.87404 30.74751 27.12072
[4,]  33.03350 31.96608 40.36197 26.89497
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x101670480>
> exp(tmp5)
<pointer: 0x101670480>
> log(tmp5,2)
<pointer: 0x101670480>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 464.5002
> Min(tmp5)
[1] 52.77438
> mean(tmp5)
[1] 72.80632
> Sum(tmp5)
[1] 14561.26
> Var(tmp5)
[1] 854.1978
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 92.01263 68.53555 71.51627 72.04155 73.20723 69.93867 70.38687 70.30705
 [9] 70.56477 69.55262
> rowSums(tmp5)
 [1] 1840.253 1370.711 1430.325 1440.831 1464.145 1398.773 1407.737 1406.141
 [9] 1411.295 1391.052
> rowVars(tmp5)
 [1] 7761.14571   63.35559   96.45714  100.97595   86.72382   47.94935
 [7]  105.17702   66.60219   68.12288  102.22934
> rowSd(tmp5)
 [1] 88.097365  7.959622  9.821259 10.048679  9.312562  6.924547 10.255585
 [8]  8.161016  8.253659 10.110853
> rowMax(tmp5)
 [1] 464.50016  83.27935  91.35839  93.56907  88.20222  83.52751  88.00280
 [8]  85.19139  83.17596  86.76394
> rowMin(tmp5)
 [1] 60.14256 56.58626 55.32589 55.97836 53.72779 58.88396 56.57397 54.74486
 [9] 54.63508 52.77438
> 
> colMeans(tmp5)
 [1] 105.70759  73.37972  71.69138  66.14396  72.51615  70.53467  76.47844
 [8]  73.39738  69.51107  70.26130  68.51159  72.44128  71.16179  72.13282
[15]  71.05447  69.28663  74.93984  61.54975  71.54234  73.88429
> colSums(tmp5)
 [1] 1057.0759  733.7972  716.9138  661.4396  725.1615  705.3467  764.7844
 [8]  733.9738  695.1107  702.6130  685.1159  724.4128  711.6179  721.3282
[15]  710.5447  692.8663  749.3984  615.4975  715.4234  738.8429
> colVars(tmp5)
 [1] 15968.71955    35.71606   123.22122    85.43062    78.58752    55.44552
 [7]    57.61457    46.26870    44.48774    64.58175    75.50370    47.39789
[13]    72.75188    91.86720   130.22514    67.40342   136.53707    40.91287
[19]   108.24023    71.81452
> colSd(tmp5)
 [1] 126.367399   5.976291  11.100505   9.242869   8.864960   7.446175
 [7]   7.590426   6.802110   6.669913   8.036277   8.689287   6.884612
[13]   8.529471   9.584738  11.411623   8.209959  11.684908   6.396317
[19]  10.403856   8.474345
> colMax(tmp5)
 [1] 464.50016  85.33816  86.76394  83.62106  83.27935  79.72985  88.20222
 [8]  84.82031  80.39466  83.02714  82.83826  82.23198  86.56947  85.58974
[15]  91.35839  79.20642  93.56907  72.95485  88.80291  84.20749
> colMin(tmp5)
 [1] 55.62863 66.53321 56.58626 55.97836 53.72779 57.38995 60.84233 63.90733
 [9] 56.99566 55.32589 57.04807 64.97888 60.14256 58.55731 52.77438 54.74486
[17] 59.24411 54.63508 56.32115 62.11799
> 
> 
> ### 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] 92.01263 68.53555 71.51627       NA 73.20723 69.93867 70.38687 70.30705
 [9] 70.56477 69.55262
> rowSums(tmp5)
 [1] 1840.253 1370.711 1430.325       NA 1464.145 1398.773 1407.737 1406.141
 [9] 1411.295 1391.052
> rowVars(tmp5)
 [1] 7761.14571   63.35559   96.45714   98.06934   86.72382   47.94935
 [7]  105.17702   66.60219   68.12288  102.22934
> rowSd(tmp5)
 [1] 88.097365  7.959622  9.821259  9.902997  9.312562  6.924547 10.255585
 [8]  8.161016  8.253659 10.110853
> rowMax(tmp5)
 [1] 464.50016  83.27935  91.35839        NA  88.20222  83.52751  88.00280
 [8]  85.19139  83.17596  86.76394
> rowMin(tmp5)
 [1] 60.14256 56.58626 55.32589       NA 53.72779 58.88396 56.57397 54.74486
 [9] 54.63508 52.77438
> 
> colMeans(tmp5)
 [1] 105.70759  73.37972  71.69138  66.14396  72.51615  70.53467  76.47844
 [8]  73.39738  69.51107  70.26130  68.51159  72.44128  71.16179  72.13282
[15]  71.05447        NA  74.93984  61.54975  71.54234  73.88429
> colSums(tmp5)
 [1] 1057.0759  733.7972  716.9138  661.4396  725.1615  705.3467  764.7844
 [8]  733.9738  695.1107  702.6130  685.1159  724.4128  711.6179  721.3282
[15]  710.5447        NA  749.3984  615.4975  715.4234  738.8429
> colVars(tmp5)
 [1] 15968.71955    35.71606   123.22122    85.43062    78.58752    55.44552
 [7]    57.61457    46.26870    44.48774    64.58175    75.50370    47.39789
[13]    72.75188    91.86720   130.22514          NA   136.53707    40.91287
[19]   108.24023    71.81452
> colSd(tmp5)
 [1] 126.367399   5.976291  11.100505   9.242869   8.864960   7.446175
 [7]   7.590426   6.802110   6.669913   8.036277   8.689287   6.884612
[13]   8.529471   9.584738  11.411623         NA  11.684908   6.396317
[19]  10.403856   8.474345
> colMax(tmp5)
 [1] 464.50016  85.33816  86.76394  83.62106  83.27935  79.72985  88.20222
 [8]  84.82031  80.39466  83.02714  82.83826  82.23198  86.56947  85.58974
[15]  91.35839        NA  93.56907  72.95485  88.80291  84.20749
> colMin(tmp5)
 [1] 55.62863 66.53321 56.58626 55.97836 53.72779 57.38995 60.84233 63.90733
 [9] 56.99566 55.32589 57.04807 64.97888 60.14256 58.55731 52.77438       NA
[17] 59.24411 54.63508 56.32115 62.11799
> 
> Max(tmp5,na.rm=TRUE)
[1] 464.5002
> Min(tmp5,na.rm=TRUE)
[1] 52.77438
> mean(tmp5,na.rm=TRUE)
[1] 72.87081
> Sum(tmp5,na.rm=TRUE)
[1] 14501.29
> Var(tmp5,na.rm=TRUE)
[1] 857.6761
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 92.01263 68.53555 71.51627 72.67670 73.20723 69.93867 70.38687 70.30705
 [9] 70.56477 69.55262
> rowSums(tmp5,na.rm=TRUE)
 [1] 1840.253 1370.711 1430.325 1380.857 1464.145 1398.773 1407.737 1406.141
 [9] 1411.295 1391.052
> rowVars(tmp5,na.rm=TRUE)
 [1] 7761.14571   63.35559   96.45714   98.06934   86.72382   47.94935
 [7]  105.17702   66.60219   68.12288  102.22934
> rowSd(tmp5,na.rm=TRUE)
 [1] 88.097365  7.959622  9.821259  9.902997  9.312562  6.924547 10.255585
 [8]  8.161016  8.253659 10.110853
> rowMax(tmp5,na.rm=TRUE)
 [1] 464.50016  83.27935  91.35839  93.56907  88.20222  83.52751  88.00280
 [8]  85.19139  83.17596  86.76394
> rowMin(tmp5,na.rm=TRUE)
 [1] 60.14256 56.58626 55.32589 55.97836 53.72779 58.88396 56.57397 54.74486
 [9] 54.63508 52.77438
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 105.70759  73.37972  71.69138  66.14396  72.51615  70.53467  76.47844
 [8]  73.39738  69.51107  70.26130  68.51159  72.44128  71.16179  72.13282
[15]  71.05447  70.32138  74.93984  61.54975  71.54234  73.88429
> colSums(tmp5,na.rm=TRUE)
 [1] 1057.0759  733.7972  716.9138  661.4396  725.1615  705.3467  764.7844
 [8]  733.9738  695.1107  702.6130  685.1159  724.4128  711.6179  721.3282
[15]  710.5447  632.8924  749.3984  615.4975  715.4234  738.8429
> colVars(tmp5,na.rm=TRUE)
 [1] 15968.71955    35.71606   123.22122    85.43062    78.58752    55.44552
 [7]    57.61457    46.26870    44.48774    64.58175    75.50370    47.39789
[13]    72.75188    91.86720   130.22514    63.78325   136.53707    40.91287
[19]   108.24023    71.81452
> colSd(tmp5,na.rm=TRUE)
 [1] 126.367399   5.976291  11.100505   9.242869   8.864960   7.446175
 [7]   7.590426   6.802110   6.669913   8.036277   8.689287   6.884612
[13]   8.529471   9.584738  11.411623   7.986442  11.684908   6.396317
[19]  10.403856   8.474345
> colMax(tmp5,na.rm=TRUE)
 [1] 464.50016  85.33816  86.76394  83.62106  83.27935  79.72985  88.20222
 [8]  84.82031  80.39466  83.02714  82.83826  82.23198  86.56947  85.58974
[15]  91.35839  79.20642  93.56907  72.95485  88.80291  84.20749
> colMin(tmp5,na.rm=TRUE)
 [1] 55.62863 66.53321 56.58626 55.97836 53.72779 57.38995 60.84233 63.90733
 [9] 56.99566 55.32589 57.04807 64.97888 60.14256 58.55731 52.77438 54.74486
[17] 59.24411 54.63508 56.32115 62.11799
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1] 92.01263 68.53555 71.51627      NaN 73.20723 69.93867 70.38687 70.30705
 [9] 70.56477 69.55262
> rowSums(tmp5,na.rm=TRUE)
 [1] 1840.253 1370.711 1430.325    0.000 1464.145 1398.773 1407.737 1406.141
 [9] 1411.295 1391.052
> rowVars(tmp5,na.rm=TRUE)
 [1] 7761.14571   63.35559   96.45714         NA   86.72382   47.94935
 [7]  105.17702   66.60219   68.12288  102.22934
> rowSd(tmp5,na.rm=TRUE)
 [1] 88.097365  7.959622  9.821259        NA  9.312562  6.924547 10.255585
 [8]  8.161016  8.253659 10.110853
> rowMax(tmp5,na.rm=TRUE)
 [1] 464.50016  83.27935  91.35839        NA  88.20222  83.52751  88.00280
 [8]  85.19139  83.17596  86.76394
> rowMin(tmp5,na.rm=TRUE)
 [1] 60.14256 56.58626 55.32589       NA 53.72779 58.88396 56.57397 54.74486
 [9] 54.63508 52.77438
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1] 109.81344  74.14044  70.32285  67.27347  72.46096  69.51298  76.06134
 [8]  74.45183  69.03982  70.75128  69.63852  71.47834  70.14127  71.63584
[15]  70.58174       NaN  72.86993  61.71388  72.36654  73.25007
> colSums(tmp5,na.rm=TRUE)
 [1] 988.3210 667.2639 632.9057 605.4612 652.1487 625.6168 684.5521 670.0665
 [9] 621.3584 636.7615 626.7467 643.3050 631.2714 644.7226 635.2356   0.0000
[17] 655.8294 555.4249 651.2988 659.2506
> colVars(tmp5,na.rm=TRUE)
 [1] 17775.15659    33.67020   117.55403    81.75676    88.37669    50.63295
 [7]    62.85918    39.54381    47.55039    69.95351    70.65450    42.89103
[13]    70.12935   100.57201   143.98921          NA   105.40307    45.72391
[19]   114.12810    76.26617
> colSd(tmp5,na.rm=TRUE)
 [1] 133.323504   5.802603  10.842234   9.041944   9.400888   7.115683
 [7]   7.928378   6.288387   6.895679   8.363822   8.405623   6.549124
[13]   8.374327  10.028560  11.999550         NA  10.266600   6.761945
[19]  10.683075   8.733051
> colMax(tmp5,na.rm=TRUE)
 [1] 464.50016  85.33816  86.76394  83.62106  83.27935  78.92590  88.20222
 [8]  84.82031  80.39466  83.02714  82.83826  82.23198  86.56947  85.58974
[15]  91.35839      -Inf  88.00280  72.95485  88.80291  84.20749
> colMin(tmp5,na.rm=TRUE)
 [1] 55.62863 68.01019 56.58626 56.44824 53.72779 57.38995 60.84233 68.12372
 [9] 56.99566 55.32589 57.04807 64.97888 60.14256 58.55731 52.77438      Inf
[17] 59.24411 54.63508 56.32115 62.11799
> 
> 
> 
> 
> 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] 204.0530 146.8967 262.1582 225.0056 209.9955 156.0659 358.0598 297.8629
 [9] 152.7614 395.3049
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 204.0530 146.8967 262.1582 225.0056 209.9955 156.0659 358.0598 297.8629
 [9] 152.7614 395.3049
> 
> 
> 
> 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]  4.263256e-14 -2.273737e-13 -1.136868e-13 -1.421085e-14  1.705303e-13
 [6]  1.136868e-13  0.000000e+00  2.842171e-14  8.526513e-14 -8.526513e-14
[11]  2.842171e-14 -1.136868e-13 -5.684342e-14  5.684342e-14 -8.526513e-14
[16]  1.421085e-13 -2.557954e-13 -2.842171e-14 -1.136868e-13 -5.684342e-14
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> ## making sure these things agree
> ##
> ## first when there is no NA
> 
> 
> 
> agree.checks <- function(buff.matrix,r.matrix,err.tol=1e-10){
+ 
+   if (Max(buff.matrix,na.rm=TRUE) != max(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Max")
+   }
+   
+ 
+   if (Min(buff.matrix,na.rm=TRUE) != min(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Min")
+   }
+ 
+ 
+   if (abs(Sum(buff.matrix,na.rm=TRUE)- sum(r.matrix,na.rm=TRUE)) > err.tol){
+ 
+     cat(Sum(buff.matrix,na.rm=TRUE),"\n")
+     cat(sum(r.matrix,na.rm=TRUE),"\n")
+     cat(Sum(buff.matrix,na.rm=TRUE) - sum(r.matrix,na.rm=TRUE),"\n")
+     
+     stop("No agreement in Sum")
+   }
+   
+   if (abs(mean(buff.matrix,na.rm=TRUE) - mean(r.matrix,na.rm=TRUE)) > err.tol){
+     stop("No agreement in mean")
+   }
+   
+   
+   if(abs(Var(buff.matrix,na.rm=TRUE) - var(as.vector(r.matrix),na.rm=TRUE)) > err.tol){
+     stop("No agreement in Var")
+   }
+   
+   
+ 
+   if(any(abs(rowMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,mean,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowMeans")
+   }
+   
+   
+   if(any(abs(colMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,mean,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colMeans")
+   }
+   
+   
+   if(any(abs(rowSums(buff.matrix,na.rm=TRUE)  -  apply(r.matrix,1,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in rowSums")
+   }
+   
+   
+   if(any(abs(colSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colSums")
+   }
+   
+   ### this is to get around the fact that R doesn't like to compute NA on an entire vector of NA when 
+   ### computing variance
+   my.Var <- function(x,na.rm=FALSE){
+    if (all(is.na(x))){
+      return(NA)
+    } else {
+      var(x,na.rm=na.rm)
+    }
+ 
+   }
+   
+   if(any(abs(rowVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+   
+   
+   if(any(abs(colVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+ 
+ 
+   if(any(abs(rowMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+ 
+   if(any(abs(colMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+   
+   
+   if(any(abs(rowMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+   
+ 
+   if(any(abs(colMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+ 
+   if(any(abs(colMedians(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,median,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMedian")
+   }
+ 
+   if(any(abs(colRanges(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,range,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colRanges")
+   }
+ 
+ 
+   
+ }
> 
> 
> 
> 
> 
> 
> 
> 
> 
> for (rep in 1:20){
+   copymatrix <- matrix(rnorm(200,150,15),10,20)
+   
+   tmp5[1:10,1:20] <- copymatrix
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ## now lets assign some NA values and check agreement
+ 
+   which.row <- sample(1:10,1,replace=TRUE)
+   which.col  <- sample(1:20,1,replace=TRUE)
+   
+   cat(which.row," ",which.col,"\n")
+   
+   tmp5[which.row,which.col] <- NA
+   copymatrix[which.row,which.col] <- NA
+   
+   agree.checks(tmp5,copymatrix)
+ 
+   ## make an entire row NA
+   tmp5[which.row,] <- NA
+   copymatrix[which.row,] <- NA
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ### also make an entire col NA
+   tmp5[,which.col] <- NA
+   copymatrix[,which.col] <- NA
+ 
+   agree.checks(tmp5,copymatrix)
+ 
+   ### now make 1 element non NA with NA in the rest of row and column
+ 
+   tmp5[which.row,which.col] <- rnorm(1,150,15)
+   copymatrix[which.row,which.col] <- tmp5[which.row,which.col]
+ 
+   agree.checks(tmp5,copymatrix)
+ }
8   7 
4   11 
3   1 
1   1 
6   19 
6   4 
5   15 
7   7 
8   11 
5   2 
8   4 
9   3 
2   9 
3   5 
2   19 
5   5 
2   17 
6   17 
9   4 
8   20 
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.496014
> Min(tmp)
[1] -1.969359
> mean(tmp)
[1] 0.1582646
> Sum(tmp)
[1] 15.82646
> Var(tmp)
[1] 0.9813024
> 
> rowMeans(tmp)
[1] 0.1582646
> rowSums(tmp)
[1] 15.82646
> rowVars(tmp)
[1] 0.9813024
> rowSd(tmp)
[1] 0.9906071
> rowMax(tmp)
[1] 2.496014
> rowMin(tmp)
[1] -1.969359
> 
> colMeans(tmp)
  [1] -1.2235271559  0.1840347562 -0.0408265067  0.5679005687  0.9736187958
  [6]  0.6329429288  0.4365606314  0.6282009555 -1.8031539825  0.4041248093
 [11] -1.0421193102  0.0685973418  0.8719423444 -0.6816238320 -0.0847694656
 [16]  0.3894868420 -0.3069452597 -0.8338290559  0.6290635326 -1.2269657063
 [21]  1.1720867990  0.2731675588  2.0688236833  1.0168596245 -0.7655847589
 [26]  2.4320582770  0.7573005259  0.1874353054  0.9045455510 -0.6832983541
 [31]  0.4573600060  0.8526532731  0.5326182287  0.4613495185  0.8799698127
 [36] -0.3833642323 -0.2249755717 -1.5390843886 -1.6182105407  0.3223490040
 [41] -0.7081215078  1.0962257510  0.9640931184  0.4800014497  0.0157834154
 [46] -1.8474109788  0.0277767246  0.0991761202 -0.4462613807 -1.4849122019
 [51] -1.4598444562  0.6023277579  1.5277574991  0.2183998915  1.9112678435
 [56] -1.9693585557  0.4610206445  0.0647129049 -0.3462695873 -1.1790835305
 [61]  0.1474502160  0.1696095604 -0.5379535138  0.7060594080  0.7010688752
 [66] -0.9496551065  2.0858108564  1.7445996657  0.5362348122 -0.8797623387
 [71]  0.5320797427 -0.9706321485  0.4125716387  0.1030339243  0.7470625977
 [76]  1.8334399468 -0.1464194560  0.7108236627 -1.8406961166  0.2190527106
 [81] -0.5915301624 -0.6067164941 -0.1539994085 -0.6933000927  0.9489700600
 [86] -1.4187406890 -0.3925680879  0.8872850260 -0.3736734748  1.5678823031
 [91]  1.8891521753 -0.0002708684  0.5520312570  1.2016576525  1.3990046088
 [96]  0.1661129689  2.4960138842 -0.5620323215  0.5531946038 -0.0398410082
> colSums(tmp)
  [1] -1.2235271559  0.1840347562 -0.0408265067  0.5679005687  0.9736187958
  [6]  0.6329429288  0.4365606314  0.6282009555 -1.8031539825  0.4041248093
 [11] -1.0421193102  0.0685973418  0.8719423444 -0.6816238320 -0.0847694656
 [16]  0.3894868420 -0.3069452597 -0.8338290559  0.6290635326 -1.2269657063
 [21]  1.1720867990  0.2731675588  2.0688236833  1.0168596245 -0.7655847589
 [26]  2.4320582770  0.7573005259  0.1874353054  0.9045455510 -0.6832983541
 [31]  0.4573600060  0.8526532731  0.5326182287  0.4613495185  0.8799698127
 [36] -0.3833642323 -0.2249755717 -1.5390843886 -1.6182105407  0.3223490040
 [41] -0.7081215078  1.0962257510  0.9640931184  0.4800014497  0.0157834154
 [46] -1.8474109788  0.0277767246  0.0991761202 -0.4462613807 -1.4849122019
 [51] -1.4598444562  0.6023277579  1.5277574991  0.2183998915  1.9112678435
 [56] -1.9693585557  0.4610206445  0.0647129049 -0.3462695873 -1.1790835305
 [61]  0.1474502160  0.1696095604 -0.5379535138  0.7060594080  0.7010688752
 [66] -0.9496551065  2.0858108564  1.7445996657  0.5362348122 -0.8797623387
 [71]  0.5320797427 -0.9706321485  0.4125716387  0.1030339243  0.7470625977
 [76]  1.8334399468 -0.1464194560  0.7108236627 -1.8406961166  0.2190527106
 [81] -0.5915301624 -0.6067164941 -0.1539994085 -0.6933000927  0.9489700600
 [86] -1.4187406890 -0.3925680879  0.8872850260 -0.3736734748  1.5678823031
 [91]  1.8891521753 -0.0002708684  0.5520312570  1.2016576525  1.3990046088
 [96]  0.1661129689  2.4960138842 -0.5620323215  0.5531946038 -0.0398410082
> colVars(tmp)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> colSd(tmp)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> colMax(tmp)
  [1] -1.2235271559  0.1840347562 -0.0408265067  0.5679005687  0.9736187958
  [6]  0.6329429288  0.4365606314  0.6282009555 -1.8031539825  0.4041248093
 [11] -1.0421193102  0.0685973418  0.8719423444 -0.6816238320 -0.0847694656
 [16]  0.3894868420 -0.3069452597 -0.8338290559  0.6290635326 -1.2269657063
 [21]  1.1720867990  0.2731675588  2.0688236833  1.0168596245 -0.7655847589
 [26]  2.4320582770  0.7573005259  0.1874353054  0.9045455510 -0.6832983541
 [31]  0.4573600060  0.8526532731  0.5326182287  0.4613495185  0.8799698127
 [36] -0.3833642323 -0.2249755717 -1.5390843886 -1.6182105407  0.3223490040
 [41] -0.7081215078  1.0962257510  0.9640931184  0.4800014497  0.0157834154
 [46] -1.8474109788  0.0277767246  0.0991761202 -0.4462613807 -1.4849122019
 [51] -1.4598444562  0.6023277579  1.5277574991  0.2183998915  1.9112678435
 [56] -1.9693585557  0.4610206445  0.0647129049 -0.3462695873 -1.1790835305
 [61]  0.1474502160  0.1696095604 -0.5379535138  0.7060594080  0.7010688752
 [66] -0.9496551065  2.0858108564  1.7445996657  0.5362348122 -0.8797623387
 [71]  0.5320797427 -0.9706321485  0.4125716387  0.1030339243  0.7470625977
 [76]  1.8334399468 -0.1464194560  0.7108236627 -1.8406961166  0.2190527106
 [81] -0.5915301624 -0.6067164941 -0.1539994085 -0.6933000927  0.9489700600
 [86] -1.4187406890 -0.3925680879  0.8872850260 -0.3736734748  1.5678823031
 [91]  1.8891521753 -0.0002708684  0.5520312570  1.2016576525  1.3990046088
 [96]  0.1661129689  2.4960138842 -0.5620323215  0.5531946038 -0.0398410082
> colMin(tmp)
  [1] -1.2235271559  0.1840347562 -0.0408265067  0.5679005687  0.9736187958
  [6]  0.6329429288  0.4365606314  0.6282009555 -1.8031539825  0.4041248093
 [11] -1.0421193102  0.0685973418  0.8719423444 -0.6816238320 -0.0847694656
 [16]  0.3894868420 -0.3069452597 -0.8338290559  0.6290635326 -1.2269657063
 [21]  1.1720867990  0.2731675588  2.0688236833  1.0168596245 -0.7655847589
 [26]  2.4320582770  0.7573005259  0.1874353054  0.9045455510 -0.6832983541
 [31]  0.4573600060  0.8526532731  0.5326182287  0.4613495185  0.8799698127
 [36] -0.3833642323 -0.2249755717 -1.5390843886 -1.6182105407  0.3223490040
 [41] -0.7081215078  1.0962257510  0.9640931184  0.4800014497  0.0157834154
 [46] -1.8474109788  0.0277767246  0.0991761202 -0.4462613807 -1.4849122019
 [51] -1.4598444562  0.6023277579  1.5277574991  0.2183998915  1.9112678435
 [56] -1.9693585557  0.4610206445  0.0647129049 -0.3462695873 -1.1790835305
 [61]  0.1474502160  0.1696095604 -0.5379535138  0.7060594080  0.7010688752
 [66] -0.9496551065  2.0858108564  1.7445996657  0.5362348122 -0.8797623387
 [71]  0.5320797427 -0.9706321485  0.4125716387  0.1030339243  0.7470625977
 [76]  1.8334399468 -0.1464194560  0.7108236627 -1.8406961166  0.2190527106
 [81] -0.5915301624 -0.6067164941 -0.1539994085 -0.6933000927  0.9489700600
 [86] -1.4187406890 -0.3925680879  0.8872850260 -0.3736734748  1.5678823031
 [91]  1.8891521753 -0.0002708684  0.5520312570  1.2016576525  1.3990046088
 [96]  0.1661129689  2.4960138842 -0.5620323215  0.5531946038 -0.0398410082
> colMedians(tmp)
  [1] -1.2235271559  0.1840347562 -0.0408265067  0.5679005687  0.9736187958
  [6]  0.6329429288  0.4365606314  0.6282009555 -1.8031539825  0.4041248093
 [11] -1.0421193102  0.0685973418  0.8719423444 -0.6816238320 -0.0847694656
 [16]  0.3894868420 -0.3069452597 -0.8338290559  0.6290635326 -1.2269657063
 [21]  1.1720867990  0.2731675588  2.0688236833  1.0168596245 -0.7655847589
 [26]  2.4320582770  0.7573005259  0.1874353054  0.9045455510 -0.6832983541
 [31]  0.4573600060  0.8526532731  0.5326182287  0.4613495185  0.8799698127
 [36] -0.3833642323 -0.2249755717 -1.5390843886 -1.6182105407  0.3223490040
 [41] -0.7081215078  1.0962257510  0.9640931184  0.4800014497  0.0157834154
 [46] -1.8474109788  0.0277767246  0.0991761202 -0.4462613807 -1.4849122019
 [51] -1.4598444562  0.6023277579  1.5277574991  0.2183998915  1.9112678435
 [56] -1.9693585557  0.4610206445  0.0647129049 -0.3462695873 -1.1790835305
 [61]  0.1474502160  0.1696095604 -0.5379535138  0.7060594080  0.7010688752
 [66] -0.9496551065  2.0858108564  1.7445996657  0.5362348122 -0.8797623387
 [71]  0.5320797427 -0.9706321485  0.4125716387  0.1030339243  0.7470625977
 [76]  1.8334399468 -0.1464194560  0.7108236627 -1.8406961166  0.2190527106
 [81] -0.5915301624 -0.6067164941 -0.1539994085 -0.6933000927  0.9489700600
 [86] -1.4187406890 -0.3925680879  0.8872850260 -0.3736734748  1.5678823031
 [91]  1.8891521753 -0.0002708684  0.5520312570  1.2016576525  1.3990046088
 [96]  0.1661129689  2.4960138842 -0.5620323215  0.5531946038 -0.0398410082
> colRanges(tmp)
          [,1]      [,2]        [,3]      [,4]      [,5]      [,6]      [,7]
[1,] -1.223527 0.1840348 -0.04082651 0.5679006 0.9736188 0.6329429 0.4365606
[2,] -1.223527 0.1840348 -0.04082651 0.5679006 0.9736188 0.6329429 0.4365606
         [,8]      [,9]     [,10]     [,11]      [,12]     [,13]      [,14]
[1,] 0.628201 -1.803154 0.4041248 -1.042119 0.06859734 0.8719423 -0.6816238
[2,] 0.628201 -1.803154 0.4041248 -1.042119 0.06859734 0.8719423 -0.6816238
           [,15]     [,16]      [,17]      [,18]     [,19]     [,20]    [,21]
[1,] -0.08476947 0.3894868 -0.3069453 -0.8338291 0.6290635 -1.226966 1.172087
[2,] -0.08476947 0.3894868 -0.3069453 -0.8338291 0.6290635 -1.226966 1.172087
         [,22]    [,23]   [,24]      [,25]    [,26]     [,27]     [,28]
[1,] 0.2731676 2.068824 1.01686 -0.7655848 2.432058 0.7573005 0.1874353
[2,] 0.2731676 2.068824 1.01686 -0.7655848 2.432058 0.7573005 0.1874353
         [,29]      [,30]   [,31]     [,32]     [,33]     [,34]     [,35]
[1,] 0.9045456 -0.6832984 0.45736 0.8526533 0.5326182 0.4613495 0.8799698
[2,] 0.9045456 -0.6832984 0.45736 0.8526533 0.5326182 0.4613495 0.8799698
          [,36]      [,37]     [,38]     [,39]    [,40]      [,41]    [,42]
[1,] -0.3833642 -0.2249756 -1.539084 -1.618211 0.322349 -0.7081215 1.096226
[2,] -0.3833642 -0.2249756 -1.539084 -1.618211 0.322349 -0.7081215 1.096226
         [,43]     [,44]      [,45]     [,46]      [,47]      [,48]      [,49]
[1,] 0.9640931 0.4800014 0.01578342 -1.847411 0.02777672 0.09917612 -0.4462614
[2,] 0.9640931 0.4800014 0.01578342 -1.847411 0.02777672 0.09917612 -0.4462614
         [,50]     [,51]     [,52]    [,53]     [,54]    [,55]     [,56]
[1,] -1.484912 -1.459844 0.6023278 1.527757 0.2183999 1.911268 -1.969359
[2,] -1.484912 -1.459844 0.6023278 1.527757 0.2183999 1.911268 -1.969359
         [,57]     [,58]      [,59]     [,60]     [,61]     [,62]      [,63]
[1,] 0.4610206 0.0647129 -0.3462696 -1.179084 0.1474502 0.1696096 -0.5379535
[2,] 0.4610206 0.0647129 -0.3462696 -1.179084 0.1474502 0.1696096 -0.5379535
         [,64]     [,65]      [,66]    [,67]  [,68]     [,69]      [,70]
[1,] 0.7060594 0.7010689 -0.9496551 2.085811 1.7446 0.5362348 -0.8797623
[2,] 0.7060594 0.7010689 -0.9496551 2.085811 1.7446 0.5362348 -0.8797623
         [,71]      [,72]     [,73]     [,74]     [,75]   [,76]      [,77]
[1,] 0.5320797 -0.9706321 0.4125716 0.1030339 0.7470626 1.83344 -0.1464195
[2,] 0.5320797 -0.9706321 0.4125716 0.1030339 0.7470626 1.83344 -0.1464195
         [,78]     [,79]     [,80]      [,81]      [,82]      [,83]      [,84]
[1,] 0.7108237 -1.840696 0.2190527 -0.5915302 -0.6067165 -0.1539994 -0.6933001
[2,] 0.7108237 -1.840696 0.2190527 -0.5915302 -0.6067165 -0.1539994 -0.6933001
         [,85]     [,86]      [,87]    [,88]      [,89]    [,90]    [,91]
[1,] 0.9489701 -1.418741 -0.3925681 0.887285 -0.3736735 1.567882 1.889152
[2,] 0.9489701 -1.418741 -0.3925681 0.887285 -0.3736735 1.567882 1.889152
             [,92]     [,93]    [,94]    [,95]    [,96]    [,97]      [,98]
[1,] -0.0002708684 0.5520313 1.201658 1.399005 0.166113 2.496014 -0.5620323
[2,] -0.0002708684 0.5520313 1.201658 1.399005 0.166113 2.496014 -0.5620323
         [,99]      [,100]
[1,] 0.5531946 -0.03984101
[2,] 0.5531946 -0.03984101
> 
> 
> Max(tmp2)
[1] 2.723883
> Min(tmp2)
[1] -2.032887
> mean(tmp2)
[1] 0.125745
> Sum(tmp2)
[1] 12.5745
> Var(tmp2)
[1] 0.868007
> 
> rowMeans(tmp2)
  [1]  1.028818039  1.098821906  0.133050714  0.684136792  1.662776342
  [6]  0.845085931  1.499782013  0.220619723 -0.520218777  1.219553264
 [11] -0.643236981  0.024300329 -1.617164477  0.918279659 -1.435792144
 [16] -1.254223252 -2.032887121 -0.633670474 -0.519860199 -0.626699861
 [21]  0.263814940 -0.898169855 -0.942820436 -0.286791156  1.037217546
 [26]  1.347370404  1.043055465  0.278607791  0.347208035 -0.911433365
 [31] -0.638293152  0.253368138  1.033344724  0.115196858 -0.132351824
 [36] -1.340707345  1.607256628  0.210669572  0.567776883 -0.771581857
 [41]  1.538683636 -0.047829508  0.793644088  0.959199345  0.699982821
 [46]  0.335228547  1.027877395  0.749953569  1.286849490 -1.272111112
 [51]  1.602183258 -0.290053860  0.004236275 -0.022025253  0.547852868
 [56] -1.994861060  0.002931559  1.018550996  0.916982701  0.240002364
 [61]  0.213572592 -1.278141261  2.723882947 -0.622023277  0.356901493
 [66]  1.698157035 -0.495980530 -0.811714993 -0.412169636 -0.130845731
 [71] -0.662488993  0.174321169  0.112721347  0.319937914 -0.646577855
 [76]  0.102605398  0.680561100  0.966418327  0.451676154  0.896663015
 [81]  0.030513026 -1.885715412 -0.760334143  0.308609361  0.057336898
 [86]  0.329420964 -0.028485239 -0.174121013 -0.375872957 -0.130422646
 [91]  0.211419695  0.702861494  0.690101754  0.459527837  0.257569475
 [96] -0.456564168 -0.621631936 -0.250236800  2.236710076 -1.995147347
> rowSums(tmp2)
  [1]  1.028818039  1.098821906  0.133050714  0.684136792  1.662776342
  [6]  0.845085931  1.499782013  0.220619723 -0.520218777  1.219553264
 [11] -0.643236981  0.024300329 -1.617164477  0.918279659 -1.435792144
 [16] -1.254223252 -2.032887121 -0.633670474 -0.519860199 -0.626699861
 [21]  0.263814940 -0.898169855 -0.942820436 -0.286791156  1.037217546
 [26]  1.347370404  1.043055465  0.278607791  0.347208035 -0.911433365
 [31] -0.638293152  0.253368138  1.033344724  0.115196858 -0.132351824
 [36] -1.340707345  1.607256628  0.210669572  0.567776883 -0.771581857
 [41]  1.538683636 -0.047829508  0.793644088  0.959199345  0.699982821
 [46]  0.335228547  1.027877395  0.749953569  1.286849490 -1.272111112
 [51]  1.602183258 -0.290053860  0.004236275 -0.022025253  0.547852868
 [56] -1.994861060  0.002931559  1.018550996  0.916982701  0.240002364
 [61]  0.213572592 -1.278141261  2.723882947 -0.622023277  0.356901493
 [66]  1.698157035 -0.495980530 -0.811714993 -0.412169636 -0.130845731
 [71] -0.662488993  0.174321169  0.112721347  0.319937914 -0.646577855
 [76]  0.102605398  0.680561100  0.966418327  0.451676154  0.896663015
 [81]  0.030513026 -1.885715412 -0.760334143  0.308609361  0.057336898
 [86]  0.329420964 -0.028485239 -0.174121013 -0.375872957 -0.130422646
 [91]  0.211419695  0.702861494  0.690101754  0.459527837  0.257569475
 [96] -0.456564168 -0.621631936 -0.250236800  2.236710076 -1.995147347
> 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]  1.028818039  1.098821906  0.133050714  0.684136792  1.662776342
  [6]  0.845085931  1.499782013  0.220619723 -0.520218777  1.219553264
 [11] -0.643236981  0.024300329 -1.617164477  0.918279659 -1.435792144
 [16] -1.254223252 -2.032887121 -0.633670474 -0.519860199 -0.626699861
 [21]  0.263814940 -0.898169855 -0.942820436 -0.286791156  1.037217546
 [26]  1.347370404  1.043055465  0.278607791  0.347208035 -0.911433365
 [31] -0.638293152  0.253368138  1.033344724  0.115196858 -0.132351824
 [36] -1.340707345  1.607256628  0.210669572  0.567776883 -0.771581857
 [41]  1.538683636 -0.047829508  0.793644088  0.959199345  0.699982821
 [46]  0.335228547  1.027877395  0.749953569  1.286849490 -1.272111112
 [51]  1.602183258 -0.290053860  0.004236275 -0.022025253  0.547852868
 [56] -1.994861060  0.002931559  1.018550996  0.916982701  0.240002364
 [61]  0.213572592 -1.278141261  2.723882947 -0.622023277  0.356901493
 [66]  1.698157035 -0.495980530 -0.811714993 -0.412169636 -0.130845731
 [71] -0.662488993  0.174321169  0.112721347  0.319937914 -0.646577855
 [76]  0.102605398  0.680561100  0.966418327  0.451676154  0.896663015
 [81]  0.030513026 -1.885715412 -0.760334143  0.308609361  0.057336898
 [86]  0.329420964 -0.028485239 -0.174121013 -0.375872957 -0.130422646
 [91]  0.211419695  0.702861494  0.690101754  0.459527837  0.257569475
 [96] -0.456564168 -0.621631936 -0.250236800  2.236710076 -1.995147347
> rowMin(tmp2)
  [1]  1.028818039  1.098821906  0.133050714  0.684136792  1.662776342
  [6]  0.845085931  1.499782013  0.220619723 -0.520218777  1.219553264
 [11] -0.643236981  0.024300329 -1.617164477  0.918279659 -1.435792144
 [16] -1.254223252 -2.032887121 -0.633670474 -0.519860199 -0.626699861
 [21]  0.263814940 -0.898169855 -0.942820436 -0.286791156  1.037217546
 [26]  1.347370404  1.043055465  0.278607791  0.347208035 -0.911433365
 [31] -0.638293152  0.253368138  1.033344724  0.115196858 -0.132351824
 [36] -1.340707345  1.607256628  0.210669572  0.567776883 -0.771581857
 [41]  1.538683636 -0.047829508  0.793644088  0.959199345  0.699982821
 [46]  0.335228547  1.027877395  0.749953569  1.286849490 -1.272111112
 [51]  1.602183258 -0.290053860  0.004236275 -0.022025253  0.547852868
 [56] -1.994861060  0.002931559  1.018550996  0.916982701  0.240002364
 [61]  0.213572592 -1.278141261  2.723882947 -0.622023277  0.356901493
 [66]  1.698157035 -0.495980530 -0.811714993 -0.412169636 -0.130845731
 [71] -0.662488993  0.174321169  0.112721347  0.319937914 -0.646577855
 [76]  0.102605398  0.680561100  0.966418327  0.451676154  0.896663015
 [81]  0.030513026 -1.885715412 -0.760334143  0.308609361  0.057336898
 [86]  0.329420964 -0.028485239 -0.174121013 -0.375872957 -0.130422646
 [91]  0.211419695  0.702861494  0.690101754  0.459527837  0.257569475
 [96] -0.456564168 -0.621631936 -0.250236800  2.236710076 -1.995147347
> 
> colMeans(tmp2)
[1] 0.125745
> colSums(tmp2)
[1] 12.5745
> colVars(tmp2)
[1] 0.868007
> colSd(tmp2)
[1] 0.931669
> colMax(tmp2)
[1] 2.723883
> colMin(tmp2)
[1] -2.032887
> colMedians(tmp2)
[1] 0.1924954
> colRanges(tmp2)
          [,1]
[1,] -2.032887
[2,]  2.723883
> 
> 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]  1.9976583 -2.0649201  3.6226772 -0.7835942  0.4988169 -3.0457062
 [7]  3.3277761 -6.1986035  6.6887293  0.1102616
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -0.9840111
[2,] -0.4248604
[3,]  0.2062301
[4,]  0.4996839
[5,]  2.5967095
> 
> rowApply(tmp,sum)
 [1]  0.2050835  4.3125039  5.2036500 -2.8832399 -2.4019519 -2.5163972
 [7]  1.4055449 -0.9797853  0.2348399  1.5728474
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    9    5    5    9    4    9    2    2    4    10
 [2,]    5    9    7    3    7    4    1    5    3     3
 [3,]   10    7    6    2    6    6    7    4    5     9
 [4,]    2    2    9    4    3    1    5    6    9     5
 [5,]    3    3    3   10    9    7    6   10    8     1
 [6,]    7    4    1    1    2   10    8    7    7     2
 [7,]    8   10    4    6    8    3   10    9    6     6
 [8,]    6    1    2    7    1    5    4    1    2     4
 [9,]    4    6   10    8    5    8    9    8   10     7
[10,]    1    8    8    5   10    2    3    3    1     8
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1] -0.50232764 -3.98072306  0.03070952 -1.93870011 -1.97727004 -2.84950320
 [7] -4.59337775 -3.80554573 -2.44188680  0.55860818  2.92877090 -0.44973257
[13]  0.80157140  0.19647551  1.39083608  4.98771522 -3.98902087 -1.05381915
[19]  3.69299838  0.50590040
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -2.0085114
[2,] -0.4685797
[3,]  0.2093563
[4,]  0.8200730
[5,]  0.9453342
> 
> rowApply(tmp,sum)
[1] -3.7013769 -2.5762970  0.7886886 -3.3887824 -3.6105536
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]    7    2   10   18   17
[2,]    3    9    4   15    2
[3,]   16    6   16    8   13
[4,]    4    5    7    5   18
[5,]    5   16    9   16    1
> 
> 
> as.matrix(tmp)
           [,1]        [,2]       [,3]       [,4]       [,5]         [,6]
[1,] -0.4685797 -0.93496583  0.2286246 -0.8924160 -0.5882227  0.007647161
[2,] -2.0085114 -0.48721873 -0.9831951 -1.2008690  0.7349110 -1.893764644
[3,]  0.2093563 -0.64822929  0.8174706 -0.1661062  0.1389109  0.687492807
[4,]  0.9453342  0.08981894 -0.3959103 -0.9874025  0.1804839 -1.263551043
[5,]  0.8200730 -2.00012816  0.3637198  1.3080935 -2.4433532 -0.387327483
           [,7]       [,8]         [,9]      [,10]      [,11]      [,12]
[1,] -0.3660621 -0.2062664  0.075183339  0.5586003 -0.5051731  0.9240883
[2,] -1.5299850 -0.1257936 -2.260064148 -0.5745565  0.5245574  0.7306563
[3,] -0.5548725 -0.7756513  0.695822268  0.4143279  1.4021649 -3.3054450
[4,] -1.1976112 -1.4229052  0.002668431 -0.2976316  0.9754477  0.7050332
[5,] -0.9448469 -1.2749293 -0.955496686  0.4578681  0.5317741  0.4959346
           [,13]       [,14]      [,15]       [,16]        [,17]      [,18]
[1,] -0.31035231  0.09122236 -0.2891246  1.51195194 -1.318555603 -1.7819083
[2,]  1.26119919 -0.01150828  0.4185955 -0.66145462  0.399435771  2.3123388
[3,]  0.36090038  0.99723749  0.3775120  2.52809533 -2.688020940 -0.5990914
[4,] -0.06628953 -0.51486881 -1.0979515 -0.03149813 -0.005905413 -0.5529955
[5,] -0.44388633 -0.36560725  1.9818047  1.64062070 -0.375974683 -0.4321627
          [,19]       [,20]
[1,] -0.2751892  0.83812081
[2,]  1.8670723  0.91185784
[3,]  0.9617584 -0.06494401
[4,]  1.8980017 -0.35104963
[5,] -0.7586448 -0.82808462
> 
> 
> 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.23-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.23-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  654  bytes.
Disk usage :  200  bytes.
> subBufferedMatrix(tmp,,5:8)
BufferedMatrix object
Matrix size:  5 4 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  567  bytes.
Disk usage :  160  bytes.
> subBufferedMatrix(tmp,1:3,)
BufferedMatrix object
Matrix size:  3 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.23-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.3066639 -1.472365 -0.328831 -0.4165188 -0.1876343 -1.013224 -0.3799731
          col8      col9     col10      col11     col12     col13    col14
row1 0.2609373 0.5144986 -1.198868 -0.3122723 0.5189627 -2.158149 1.243316
        col15      col16     col17      col18      col19    col20
row1 0.315191 -0.9329024 0.2235619 0.03329353 -0.3984635 1.321218
> tmp[,"col10"]
          col10
row1 -1.1988681
row2 -0.7025109
row3 -0.3460729
row4  0.9614668
row5  0.8054791
> tmp[c("row1","row5"),]
           col1       col2      col3       col4       col5       col6
row1 -0.3066639 -1.4723653 -0.328831 -0.4165188 -0.1876343 -1.0132239
row5  0.8250649 -0.6319806 -1.716008 -0.8576641  0.2523525  0.3619683
           col7       col8      col9      col10      col11     col12      col13
row1 -0.3799731  0.2609373 0.5144986 -1.1988681 -0.3122723 0.5189627 -2.1581492
row5  0.8209246 -2.7074329 2.0589661  0.8054791 -2.2348074 0.1107619 -0.3795032
         col14    col15      col16       col17      col18      col19    col20
row1 1.2433159 0.315191 -0.9329024  0.22356185 0.03329353 -0.3984635 1.321218
row5 0.7094737 1.307258 -0.4725389 -0.04918551 0.05507027 -1.7616458 1.092809
> tmp[,c("col6","col20")]
           col6      col20
row1 -1.0132239  1.3212183
row2 -0.1645369  1.7282369
row3  0.4009895  0.1968302
row4  0.2320979 -0.9260703
row5  0.3619683  1.0928094
> tmp[c("row1","row5"),c("col6","col20")]
           col6    col20
row1 -1.0132239 1.321218
row5  0.3619683 1.092809
> 
> 
> 
> 
> tmp["row1",] <- rnorm(20,mean=10)
> tmp[,"col10"] <- rnorm(5,mean=30)
> tmp[c("row1","row5"),] <- rnorm(40,mean=50)
> tmp[,c("col6","col20")] <- rnorm(10,mean=75)
> tmp[c("row1","row5"),c("col6","col20")]  <- rnorm(4,mean=105)
> 
> tmp["row1",]
         col1     col2     col3    col4     col5     col6     col7     col8
row1 50.63471 50.95146 51.25497 49.9518 50.08571 105.4309 50.69448 50.39955
         col9    col10    col11    col12    col13    col14    col15    col16
row1 50.02087 50.49244 50.94804 49.86684 49.59668 49.40519 51.81559 48.39241
        col17    col18    col19    col20
row1 49.92588 50.73196 49.95823 105.5369
> tmp[,"col10"]
        col10
row1 50.49244
row2 30.28615
row3 30.86465
row4 30.39842
row5 50.29824
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 50.63471 50.95146 51.25497 49.95180 50.08571 105.4309 50.69448 50.39955
row5 51.54344 49.29206 50.39810 48.51629 50.33270 103.5300 48.98334 50.75813
         col9    col10    col11    col12    col13    col14    col15    col16
row1 50.02087 50.49244 50.94804 49.86684 49.59668 49.40519 51.81559 48.39241
row5 49.66606 50.29824 49.66376 50.85280 51.52084 49.97341 49.90383 48.95130
        col17    col18    col19    col20
row1 49.92588 50.73196 49.95823 105.5369
row5 49.59968 47.86073 49.35197 104.9297
> tmp[,c("col6","col20")]
          col6     col20
row1 105.43092 105.53693
row2  74.39281  74.99298
row3  74.14378  74.74087
row4  77.26323  74.87690
row5 103.52998 104.92975
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 105.4309 105.5369
row5 103.5300 104.9297
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 105.4309 105.5369
row5 103.5300 104.9297
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
          col13
[1,]  0.2134026
[2,] -0.2767316
[3,]  0.4621740
[4,] -0.7876843
[5,]  1.9685092
> tmp[,c("col17","col7")]
          col17       col7
[1,]  1.7121069  0.3407665
[2,]  0.7201116 -0.2366736
[3,] -1.1565746 -0.8756531
[4,]  0.6014651  0.5056430
[5,]  0.2965709 -1.8627254
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
            col6      col20
[1,]  0.08042241 -0.6892878
[2,] -0.70540226 -0.6465584
[3,]  0.70669993  0.7000978
[4,]  0.37638691  1.5635554
[5,]  1.08031906  1.3160375
> subBufferedMatrix(tmp,1,c("col6"))[,1]
           col1
[1,] 0.08042241
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
            col6
[1,]  0.08042241
[2,] -0.70540226
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> 
> 
> 
> subBufferedMatrix(tmp,c("row3","row1"),)[,1:20]
          [,1]         [,2]      [,3]      [,4]      [,5]       [,6]       [,7]
row3 1.0786718  0.004527884 -2.431295 -1.296193 0.7790243  1.0464723 -1.2205106
row1 0.8332432 -0.252535558 -1.583227  1.818510 0.1471019 -0.2824649  0.4997939
          [,8]       [,9]    [,10]     [,11]     [,12]       [,13]      [,14]
row3 0.1777297 -0.1674276 1.196971 0.1504796 -1.870275 -0.77863954 -1.5177411
row1 0.6975419  0.5794835 1.999174 0.2517455  1.694209 -0.07616376 -0.6041596
          [,15]     [,16]     [,17]     [,18]      [,19]      [,20]
row3 -0.2042592 1.5892539 0.6524285 0.3194238 -1.2151171 -0.7004575
row1  0.2091561 0.2836949 2.0862655 0.2735559 -0.1646005  0.1998413
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
         [,1]       [,2]     [,3]      [,4]      [,5]      [,6]       [,7]
row2 1.084209 -0.6033612 1.433009 0.3478572 0.5645529 -0.890859 -0.6647396
         [,8]       [,9]     [,10]
row2 2.174955 -0.3325328 0.2899142
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
          [,1]      [,2]      [,3]       [,4]     [,5]       [,6]     [,7]
row5 0.7880587 -2.833414 -1.012225 -0.4023703 1.678317 -0.3445986 1.740654
           [,8]      [,9]     [,10]     [,11]     [,12]      [,13]      [,14]
row5 -0.8221965 -1.070976 -1.783063 0.8981607 0.1515422 -0.6013736 -0.8881334
        [,15]      [,16]    [,17]     [,18]    [,19]    [,20]
row5 1.729409 -0.2557797 1.150498 -1.106636 0.333456 -1.87613
> 
> 
> 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: 0x79b174540>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1293446cf1754"
 [2] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM129344604b01d"
 [3] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM129345dc663d4"
 [4] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM12934bc42365" 
 [5] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1293479efc1eb"
 [6] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM129346ba469d7"
 [7] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM129347720d976"
 [8] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM12934da50f14" 
 [9] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM129344f80f10b"
[10] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM129341a5131f4"
[11] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1293448a697ab"
[12] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM12934312f80d0"
[13] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1293425b1f0ea"
[14] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM12934453fa5fb"
[15] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1293455aa2541"
> 
> 
> ### 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: 0x79b175020>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x79b175020>
Warning message:
In dir.create(new.directory) :
  '/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x79b175020>
> rowMedians(tmp)
  [1] -0.017457836  0.465869477  0.042770677  0.104312972  0.552448875
  [6]  0.234830049 -0.294062153 -0.572698306 -0.184973621  0.290639032
 [11] -0.522964916 -0.498166067  0.333371273  0.684094503  0.326802814
 [16] -0.335969128  0.185626803  0.300522360  0.298267909 -0.081472894
 [21]  0.664301509 -0.047652812  0.421875396  0.230083696  0.314448415
 [26] -0.097792252 -0.383432020  0.020167833  0.037892072 -0.217646592
 [31] -0.498011363  0.410478231  0.267934632  0.020746045 -0.206467731
 [36]  0.303228859  0.136688244 -0.223953742  0.387798599 -0.323225547
 [41]  0.236429337  0.198455910 -0.072905645  0.168081065  0.376697642
 [46]  0.441064473  0.493117421 -0.235090508  0.052718469  0.168698019
 [51] -0.119367698 -0.092274791  0.088286713 -0.543777302  0.109772863
 [56]  0.641980280  0.259734273 -0.086084361 -0.833935300  0.019311660
 [61] -0.241840395 -0.295656021  0.472304404 -0.078816525 -0.144705857
 [66]  0.247350469  0.216282702  0.191688251  0.010345372 -0.221173485
 [71]  0.144306152  0.075478900 -0.169954225  0.640271670 -0.250015435
 [76]  0.067707950 -0.034083993 -0.330393646  0.070239819 -0.192454854
 [81] -0.133338367  0.173633888 -0.089660291 -0.269547031  0.247776770
 [86]  0.532093396 -0.222814642  0.556598285 -0.678790775  0.135048302
 [91]  0.308292067 -0.248919301 -0.251662766 -0.419240709 -0.013540721
 [96]  0.562957056 -0.152660257 -0.128172616  0.035011444 -0.146976807
[101] -0.312099305  0.374646322 -0.299967508 -0.113295709 -0.033509983
[106]  0.192180562 -0.128611341  0.413816312 -0.292205059  0.229830297
[111] -0.424455391  0.147839460 -0.077158500 -0.294311120  0.555722504
[116]  0.279486466  0.061125696  0.366416759 -0.127296151 -0.175833722
[121] -0.389225136 -0.017620688 -0.366815431 -0.001882831  0.453327537
[126] -0.435614060 -0.203151738 -0.310769248 -0.248718310  0.075389527
[131] -0.062721092  0.444582617  0.680124193  0.398935261 -0.116455070
[136]  0.136681155 -0.190193340 -0.469856795 -0.273645979 -0.205497253
[141]  0.281335523 -0.413981178  0.424146955 -0.501200708 -0.377227992
[146]  0.116670583  0.886401573 -0.286606296  0.013468242 -0.566863738
[151] -0.082999715  0.422405373  0.092848789  0.316441764 -0.146673365
[156]  0.111943703  0.209780032 -0.565241676  0.137265233  0.232118234
[161] -0.186750142 -0.294346918  0.121895733 -0.564452361  0.110062821
[166] -0.464894009  0.341110353 -0.346590641  0.399048936 -0.522185224
[171] -0.278999637  0.240495956  0.286917855  0.435640587  0.243403581
[176] -0.199945951  0.236982854 -0.223275161 -0.008744716  0.075892374
[181]  0.203628857 -0.541838142  0.541428837 -0.088806445 -0.016134839
[186] -0.079414839  0.085322926 -0.032150518  0.458053743  0.168421986
[191] -0.025243055 -0.274375092 -0.172859479  0.361367988 -0.248494955
[196] -0.302074707 -0.068144751  0.171946334  0.069963154  0.097893493
[201] -0.438460712 -0.444859712 -0.202208162  0.522243068 -0.308387472
[206] -0.117158100 -0.009248964 -0.563634982 -0.240787486 -0.107541742
[211] -0.093095043  0.025282224 -0.323684350  0.120516919  0.008490229
[216] -0.135533840 -0.114840981 -0.004374175  0.484277332 -0.121100215
[221]  0.234489925 -0.068588915 -0.203747321 -0.201881682  0.094007999
[226]  0.183172099 -0.329548146 -0.268545000 -0.378334950 -0.568737230
> 
> proc.time()
   user  system elapsed 
  0.973   6.467   7.697 

BufferedMatrix.Rcheck/tests/rawCalltesting.Rout


R Under development (unstable) (2026-03-20 r89666) -- "Unsuffered Consequences"
Copyright (C) 2026 The R Foundation for Statistical Computing
Platform: aarch64-apple-darwin23

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: 0x747800240>
> .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: 0x747800240>
> .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: 0x747800240>
> .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: 0x747800240>
> 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: 0x7478002a0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x7478002a0>
> .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: 0x7478002a0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x7478002a0>
> .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: 0x7478002a0>
> 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: 0x7478006c0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x7478006c0>
> .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: 0x7478006c0>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x7478006c0>
> .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: 0x7478006c0>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x7478006c0>
> .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: 0x7478006c0>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x7478006c0>
> .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: 0x7478006c0>
> 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: 0x7478007e0>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x7478007e0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x7478007e0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x7478007e0>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile12b032c01ecf3" "BufferedMatrixFile12b03326b5c17"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile12b032c01ecf3" "BufferedMatrixFile12b03326b5c17"
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x747800900>
> .Call("R_bm_AddColumn",P)
<pointer: 0x747800900>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x747800900>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x747800900>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x747800900>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x747800900>
> .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: 0x747800a80>
> .Call("R_bm_AddColumn",P)
<pointer: 0x747800a80>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x747800a80>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x747800a80>
> 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: 0x747800ba0>
> .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: 0x747800ba0>
> rm(P)
> 
> proc.time()
   user  system elapsed 
  0.148   0.067   0.215 

BufferedMatrix.Rcheck/tests/Rcodetesting.Rout


R Under development (unstable) (2026-03-20 r89666) -- "Unsuffered Consequences"
Copyright (C) 2026 The R Foundation for Statistical Computing
Platform: aarch64-apple-darwin23

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.161   0.044   0.207 

Example timings