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

This page was generated on 2026-01-07 11:35 -0500 (Wed, 07 Jan 2026).

HostnameOSArch (*)R versionInstalled pkgs
nebbiolo1Linux (Ubuntu 24.04.3 LTS)x86_64R Under development (unstable) (2025-12-22 r89219) -- "Unsuffered Consequences" 4815
kjohnson3macOS 13.7.7 Venturaarm64R Under development (unstable) (2025-11-04 r88984) -- "Unsuffered Consequences" 4593
Click on any hostname to see more info about the system (e.g. compilers)      (*) as reported by 'uname -p', except on Windows and Mac OS X

Package 253/2332HostnameOS / ArchINSTALLBUILDCHECKBUILD BIN
BufferedMatrix 1.75.0  (landing page)
Ben Bolstad
Snapshot Date: 2026-01-06 13:40 -0500 (Tue, 06 Jan 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 -0500 (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    OK  UNNEEDED, same version is already published


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-01-06 18:47:18 -0500 (Tue, 06 Jan 2026)
EndedAt: 2026-01-06 18:47:38 -0500 (Tue, 06 Jan 2026)
EllapsedTime: 20.3 seconds
RetCode: 0
Status:   WARNINGS  
CheckDir: BufferedMatrix.Rcheck
Warnings: 1

Command output

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


* using log directory ‘/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck’
* using R Under development (unstable) (2025-11-04 r88984)
* using platform: aarch64-apple-darwin20
* R was compiled by
    Apple clang version 16.0.0 (clang-1600.0.26.6)
    GNU Fortran (GCC) 14.2.0
* running under: macOS Ventura 13.7.8
* using session charset: UTF-8
* 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 15.0.0 (clang-1500.1.0.2.5)’
* used SDK: ‘MacOSX11.3.1.sdk’
* checking installed package size ... OK
* checking package directory ... OK
* checking ‘build’ directory ... OK
* checking DESCRIPTION meta-information ... OK
* checking top-level files ... OK
* checking for left-over files ... OK
* checking index information ... OK
* checking package subdirectories ... OK
* checking code files for non-ASCII characters ... OK
* checking R files for syntax errors ... OK
* checking whether the package can be loaded ... OK
* checking whether the package can be loaded with stated dependencies ... OK
* checking whether the package can be unloaded cleanly ... OK
* checking whether the namespace can be loaded with stated dependencies ... OK
* checking whether the namespace can be unloaded cleanly ... OK
* checking dependencies in R code ... OK
* checking S3 generic/method consistency ... OK
* checking replacement functions ... OK
* checking foreign function calls ... OK
* checking R code for possible problems ... OK
* checking Rd files ... NOTE
checkRd: (-1) BufferedMatrix-class.Rd:209: Lost braces; missing escapes or markup?
   209 |     $x^{power}$ elementwise of the matrix
       |        ^
prepare_Rd: createBufferedMatrix.Rd:26: Dropping empty section \keyword
prepare_Rd: createBufferedMatrix.Rd:17-18: Dropping empty section \details
prepare_Rd: createBufferedMatrix.Rd:15-16: Dropping empty section \value
prepare_Rd: createBufferedMatrix.Rd:19-20: Dropping empty section \references
prepare_Rd: createBufferedMatrix.Rd:21-22: Dropping empty section \seealso
prepare_Rd: createBufferedMatrix.Rd:23-24: Dropping empty section \examples
* checking Rd metadata ... OK
* checking Rd cross-references ... OK
* checking for missing documentation entries ... OK
* checking for code/documentation mismatches ... OK
* checking Rd \usage sections ... OK
* checking Rd contents ... OK
* checking for unstated dependencies in examples ... OK
* checking line endings in C/C++/Fortran sources/headers ... OK
* checking compiled code ... 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-arm64/Resources/library’
* installing *source* package ‘BufferedMatrix’ ...
** this is package ‘BufferedMatrix’ version ‘1.75.0’
** using staged installation
** libs
using C compiler: ‘Apple clang version 15.0.0 (clang-1500.1.0.2.5)’
using SDK: ‘MacOSX11.3.1.sdk’
clang -arch arm64 -std=gnu2x -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/opt/R/arm64/include    -fPIC  -falign-functions=64 -Wall -g -O2  -c RBufferedMatrix.c -o RBufferedMatrix.o
clang -arch arm64 -std=gnu2x -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/opt/R/arm64/include    -fPIC  -falign-functions=64 -Wall -g -O2  -c doubleBufferedMatrix.c -o doubleBufferedMatrix.o
doubleBufferedMatrix.c:1580:7: warning: logical not is only applied to the left hand side of this bitwise operator [-Wlogical-not-parentheses]
  if (!(Matrix->readonly) & setting){
      ^                   ~
doubleBufferedMatrix.c:1580:7: note: add parentheses after the '!' to evaluate the bitwise operator first
  if (!(Matrix->readonly) & setting){
      ^
       (                           )
doubleBufferedMatrix.c:1580:7: note: add parentheses around left hand side expression to silence this warning
  if (!(Matrix->readonly) & setting){
      ^
      (                  )
doubleBufferedMatrix.c:3327:12: warning: unused function 'sort_double' [-Wunused-function]
static int sort_double(const double *a1,const double *a2){
           ^
2 warnings generated.
clang -arch arm64 -std=gnu2x -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/opt/R/arm64/include    -fPIC  -falign-functions=64 -Wall -g -O2  -c doubleBufferedMatrix_C_tests.c -o doubleBufferedMatrix_C_tests.o
clang -arch arm64 -std=gnu2x -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/opt/R/arm64/include    -fPIC  -falign-functions=64 -Wall -g -O2  -c init_package.c -o init_package.o
clang -arch arm64 -std=gnu2x -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -L/Library/Frameworks/R.framework/Resources/lib -L/opt/R/arm64/lib -o BufferedMatrix.so RBufferedMatrix.o doubleBufferedMatrix.o doubleBufferedMatrix_C_tests.o init_package.o -F/Library/Frameworks/R.framework/.. -framework R
installing to /Library/Frameworks/R.framework/Versions/4.6-arm64/Resources/library/00LOCK-BufferedMatrix/00new/BufferedMatrix/libs
** R
** inst
** byte-compile and prepare package for lazy loading
Creating a new generic function for ‘rowMeans’ in package ‘BufferedMatrix’
Creating a new generic function for ‘rowSums’ in package ‘BufferedMatrix’
Creating a new generic function for ‘colMeans’ in package ‘BufferedMatrix’
Creating a new generic function for ‘colSums’ in package ‘BufferedMatrix’
Creating a generic function for ‘ncol’ from package ‘base’ in package ‘BufferedMatrix’
Creating a generic function for ‘nrow’ from package ‘base’ in package ‘BufferedMatrix’
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
** checking absolute paths in shared objects and dynamic libraries
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (BufferedMatrix)

Tests output

BufferedMatrix.Rcheck/tests/c_code_level_tests.Rout


R Under development (unstable) (2025-11-04 r88984) -- "Unsuffered Consequences"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: aarch64-apple-darwin20

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

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

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

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

Attaching package: 'BufferedMatrix'

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

    colMeans, colSums, rowMeans, rowSums

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

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

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

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

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

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

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

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

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

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

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

[[1]]
[1] 0

> 
> proc.time()
   user  system elapsed 
  0.126   0.048   0.180 

BufferedMatrix.Rcheck/tests/objectTesting.Rout


R Under development (unstable) (2025-11-04 r88984) -- "Unsuffered Consequences"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: aarch64-apple-darwin20

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

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

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

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

Attaching package: 'BufferedMatrix'

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

    colMeans, colSums, rowMeans, rowSums

> 
> 
> ### this is used to control how many repetitions in something below
> ### higher values result in more checks.
> nreps <-100 ##20000
> 
> 
> ## test creation and some simple assignments and subsetting operations
> 
> ## first on single elements
> tmp <- createBufferedMatrix(1000,10)
> 
> tmp[10,5]
[1] 0
> tmp[10,5] <- 10
> tmp[10,5]
[1] 10
> tmp[10,5] <- 12.445
> tmp[10,5]
[1] 12.445
> 
> 
> 
> ## now testing accessing multiple elements
> tmp2 <- createBufferedMatrix(10,20)
> 
> 
> tmp2[3,1] <- 51.34
> tmp2[9,2] <- 9.87654
> tmp2[,1:2]
       [,1]    [,2]
 [1,]  0.00 0.00000
 [2,]  0.00 0.00000
 [3,] 51.34 0.00000
 [4,]  0.00 0.00000
 [5,]  0.00 0.00000
 [6,]  0.00 0.00000
 [7,]  0.00 0.00000
 [8,]  0.00 0.00000
 [9,]  0.00 9.87654
[10,]  0.00 0.00000
> tmp2[,-(3:20)]
       [,1]    [,2]
 [1,]  0.00 0.00000
 [2,]  0.00 0.00000
 [3,] 51.34 0.00000
 [4,]  0.00 0.00000
 [5,]  0.00 0.00000
 [6,]  0.00 0.00000
 [7,]  0.00 0.00000
 [8,]  0.00 0.00000
 [9,]  0.00 9.87654
[10,]  0.00 0.00000
> tmp2[3,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
[1,] 51.34    0    0    0    0    0    0    0    0     0     0     0     0
     [,14] [,15] [,16] [,17] [,18] [,19] [,20]
[1,]     0     0     0     0     0     0     0
> tmp2[-3,]
      [,1]    [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [2,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [3,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [4,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [5,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [6,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [7,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [8,]    0 9.87654    0    0    0    0    0    0    0     0     0     0     0
 [9,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
      [,14] [,15] [,16] [,17] [,18] [,19] [,20]
 [1,]     0     0     0     0     0     0     0
 [2,]     0     0     0     0     0     0     0
 [3,]     0     0     0     0     0     0     0
 [4,]     0     0     0     0     0     0     0
 [5,]     0     0     0     0     0     0     0
 [6,]     0     0     0     0     0     0     0
 [7,]     0     0     0     0     0     0     0
 [8,]     0     0     0     0     0     0     0
 [9,]     0     0     0     0     0     0     0
> tmp2[2,1:3]
     [,1] [,2] [,3]
[1,]    0    0    0
> tmp2[3:9,1:3]
      [,1]    [,2] [,3]
[1,] 51.34 0.00000    0
[2,]  0.00 0.00000    0
[3,]  0.00 0.00000    0
[4,]  0.00 0.00000    0
[5,]  0.00 0.00000    0
[6,]  0.00 0.00000    0
[7,]  0.00 9.87654    0
> tmp2[-4,-4]
       [,1]    [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [2,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [3,] 51.34 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [4,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [5,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [6,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [7,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [8,]  0.00 9.87654    0    0    0    0    0    0    0     0     0     0     0
 [9,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
      [,14] [,15] [,16] [,17] [,18] [,19]
 [1,]     0     0     0     0     0     0
 [2,]     0     0     0     0     0     0
 [3,]     0     0     0     0     0     0
 [4,]     0     0     0     0     0     0
 [5,]     0     0     0     0     0     0
 [6,]     0     0     0     0     0     0
 [7,]     0     0     0     0     0     0
 [8,]     0     0     0     0     0     0
 [9,]     0     0     0     0     0     0
> 
> ## now testing accessing/assigning multiple elements
> tmp3 <- createBufferedMatrix(10,10)
> 
> for (i in 1:10){
+   for (j in 1:10){
+     tmp3[i,j] <- (j-1)*10 + i
+   }
+ }
> 
> tmp3[2:4,2:4]
     [,1] [,2] [,3]
[1,]   12   22   32
[2,]   13   23   33
[3,]   14   24   34
> tmp3[c(-10),c(2:4,2:4,10,1,2,1:10,10:1)]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]   11   21   31   11   21   31   91    1   11     1    11    21    31
 [2,]   12   22   32   12   22   32   92    2   12     2    12    22    32
 [3,]   13   23   33   13   23   33   93    3   13     3    13    23    33
 [4,]   14   24   34   14   24   34   94    4   14     4    14    24    34
 [5,]   15   25   35   15   25   35   95    5   15     5    15    25    35
 [6,]   16   26   36   16   26   36   96    6   16     6    16    26    36
 [7,]   17   27   37   17   27   37   97    7   17     7    17    27    37
 [8,]   18   28   38   18   28   38   98    8   18     8    18    28    38
 [9,]   19   29   39   19   29   39   99    9   19     9    19    29    39
      [,14] [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24] [,25]
 [1,]    41    51    61    71    81    91    91    81    71    61    51    41
 [2,]    42    52    62    72    82    92    92    82    72    62    52    42
 [3,]    43    53    63    73    83    93    93    83    73    63    53    43
 [4,]    44    54    64    74    84    94    94    84    74    64    54    44
 [5,]    45    55    65    75    85    95    95    85    75    65    55    45
 [6,]    46    56    66    76    86    96    96    86    76    66    56    46
 [7,]    47    57    67    77    87    97    97    87    77    67    57    47
 [8,]    48    58    68    78    88    98    98    88    78    68    58    48
 [9,]    49    59    69    79    89    99    99    89    79    69    59    49
      [,26] [,27] [,28] [,29]
 [1,]    31    21    11     1
 [2,]    32    22    12     2
 [3,]    33    23    13     3
 [4,]    34    24    14     4
 [5,]    35    25    15     5
 [6,]    36    26    16     6
 [7,]    37    27    17     7
 [8,]    38    28    18     8
 [9,]    39    29    19     9
> tmp3[-c(1:5),-c(6:10)]
     [,1] [,2] [,3] [,4] [,5]
[1,]    6   16   26   36   46
[2,]    7   17   27   37   47
[3,]    8   18   28   38   48
[4,]    9   19   29   39   49
[5,]   10   20   30   40   50
> 
> ## assignment of whole columns
> tmp3[,1] <- c(1:10*100.0)
> tmp3[,1:2] <- tmp3[,1:2]*100
> tmp3[,1:2] <- tmp3[,2:1]
> tmp3[,1:2]
      [,1]  [,2]
 [1,] 1100 1e+04
 [2,] 1200 2e+04
 [3,] 1300 3e+04
 [4,] 1400 4e+04
 [5,] 1500 5e+04
 [6,] 1600 6e+04
 [7,] 1700 7e+04
 [8,] 1800 8e+04
 [9,] 1900 9e+04
[10,] 2000 1e+05
> 
> 
> tmp3[,-1] <- tmp3[,1:9]
> tmp3[,1:10]
      [,1] [,2]  [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,] 1100 1100 1e+04   21   31   41   51   61   71    81
 [2,] 1200 1200 2e+04   22   32   42   52   62   72    82
 [3,] 1300 1300 3e+04   23   33   43   53   63   73    83
 [4,] 1400 1400 4e+04   24   34   44   54   64   74    84
 [5,] 1500 1500 5e+04   25   35   45   55   65   75    85
 [6,] 1600 1600 6e+04   26   36   46   56   66   76    86
 [7,] 1700 1700 7e+04   27   37   47   57   67   77    87
 [8,] 1800 1800 8e+04   28   38   48   58   68   78    88
 [9,] 1900 1900 9e+04   29   39   49   59   69   79    89
[10,] 2000 2000 1e+05   30   40   50   60   70   80    90
> 
> tmp3[,1:2] <- rep(1,10)
> tmp3[,1:2] <- rep(1,20)
> tmp3[,1:2] <- matrix(c(1:5),1,5)
> 
> tmp3[,-c(1:8)] <- matrix(c(1:5),1,5)
> 
> tmp3[1,] <- 1:10
> tmp3[1,]
     [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,]    1    2    3    4    5    6    7    8    9    10
> tmp3[-1,] <- c(1,2)
> tmp3[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    1    2    3    4    5    6    7    8    9    10
 [2,]    1    2    1    2    1    2    1    2    1     2
 [3,]    2    1    2    1    2    1    2    1    2     1
 [4,]    1    2    1    2    1    2    1    2    1     2
 [5,]    2    1    2    1    2    1    2    1    2     1
 [6,]    1    2    1    2    1    2    1    2    1     2
 [7,]    2    1    2    1    2    1    2    1    2     1
 [8,]    1    2    1    2    1    2    1    2    1     2
 [9,]    2    1    2    1    2    1    2    1    2     1
[10,]    1    2    1    2    1    2    1    2    1     2
> tmp3[-c(1:8),] <- matrix(c(1:5),1,5)
> tmp3[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    1    2    3    4    5    6    7    8    9    10
 [2,]    1    2    1    2    1    2    1    2    1     2
 [3,]    2    1    2    1    2    1    2    1    2     1
 [4,]    1    2    1    2    1    2    1    2    1     2
 [5,]    2    1    2    1    2    1    2    1    2     1
 [6,]    1    2    1    2    1    2    1    2    1     2
 [7,]    2    1    2    1    2    1    2    1    2     1
 [8,]    1    2    1    2    1    2    1    2    1     2
 [9,]    1    3    5    2    4    1    3    5    2     4
[10,]    2    4    1    3    5    2    4    1    3     5
> 
> 
> tmp3[1:2,1:2] <- 5555.04
> tmp3[-(1:2),1:2] <- 1234.56789
> 
> 
> 
> ## testing accessors for the directory and prefix
> directory(tmp3)
[1] "/Users/biocbuild/bbs-3.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 481248 25.8    1058085 56.6         NA   633817 33.9
Vcells 891449  6.9    8388608 64.0     196608  2110969 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] "Tue Jan  6 18:47:28 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] "Tue Jan  6 18:47:29 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: 0x6000037283c0>
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   which.col <- sample(1:20,1)
+   if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,5,replace=TRUE)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> date()
[1] "Tue Jan  6 18:47:30 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] "Tue Jan  6 18:47:30 2026"
> 
> ColMode(tmp2)
<pointer: 0x6000037283c0>
> 
> 
> 
> ### Now testing assignments
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+ 
+   new.data <- rnorm(20)
+   tmp2[which.row,] <- new.data
+   test.matrix[which.row,] <- new.data
+   if (rep > 1){
+     if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+   
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   new.data <- rnorm(10)
+   tmp2[,which.col] <- new.data
+   test.matrix[,which.col]<- new.data
+ 
+   if (rep > 1){
+     if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.col <- which.col
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,5,replace=TRUE)
+   new.data <- matrix(rnorm(50),5,10)
+   tmp2[,which.col] <- new.data
+   test.matrix[,which.col]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.col <- which.col
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   new.data <- matrix(rnorm(50),5,10)
+   tmp2[which.row,] <- new.data
+   test.matrix[which.row,]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col  <- sample(1:20,5,replace=TRUE)
+   new.data <- matrix(rnorm(25),5,5)
+   tmp2[which.row,which.col] <- new.data
+   test.matrix[which.row,which.col]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[prev.row,prev.col] == test.matrix[prev.row,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+   prev.col <- which.col
+ }
> 
> 
> 
> 
> ###
> ###
> ### testing some more functions
> ###
> 
> 
> 
> ## duplication function
> tmp5 <- duplicate(tmp2)
> 
> # making sure really did copy everything.
> tmp5[1,1] <- tmp5[1,1] +100.00
> 
> if (tmp5[1,1] == tmp2[1,1]){
+   stop("Problem with duplication")
+ }
> 
> 
> 
> 
> ### testing elementwise applying of functions
> 
> tmp5[1:4,1:4]
            [,1]        [,2]       [,3]       [,4]
[1,] 101.6401248  1.11051031  0.8862097  0.8362423
[2,]   0.2610693 -0.08020837  0.3552813 -0.6914642
[3,]   0.4787738 -0.41857280 -0.1504182  0.5615156
[4,]   0.9062313 -1.67983486 -0.6396683 -0.1630469
> 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,] 101.6401248 1.11051031 0.8862097 0.8362423
[2,]   0.2610693 0.08020837 0.3552813 0.6914642
[3,]   0.4787738 0.41857280 0.1504182 0.5615156
[4,]   0.9062313 1.67983486 0.6396683 0.1630469
> 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,] 10.0816727 1.0538075 0.9413871 0.9144629
[2,]  0.5109494 0.2832108 0.5960548 0.8315432
[3,]  0.6919348 0.6469720 0.3878379 0.7493434
[4,]  0.9519618 1.2960844 0.7997927 0.4037907
> 
> 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,] 227.45685 36.64859 35.30008 34.98087
[2,]  30.37056 27.91232 31.31583 34.00690
[3,]  32.39812 31.88829 29.02880 33.05495
[4,]  35.42585 39.64068 33.63759 29.20095
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x60000371c000>
> exp(tmp5)
<pointer: 0x60000371c000>
> log(tmp5,2)
<pointer: 0x60000371c000>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 473.4216
> Min(tmp5)
[1] 52.99437
> mean(tmp5)
[1] 73.07572
> Sum(tmp5)
[1] 14615.14
> Var(tmp5)
[1] 880.0031
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 91.29660 69.73929 71.45797 67.71158 71.42096 70.21117 69.42764 74.04298
 [9] 71.97911 73.46989
> rowSums(tmp5)
 [1] 1825.932 1394.786 1429.159 1354.232 1428.419 1404.223 1388.553 1480.860
 [9] 1439.582 1469.398
> rowVars(tmp5)
 [1] 8133.70531   59.45396   75.70030   71.94133  109.96830   89.67052
 [7]   61.69582   73.55341   56.45086   62.55675
> rowSd(tmp5)
 [1] 90.187057  7.710640  8.700592  8.481823 10.486577  9.469452  7.854669
 [8]  8.576328  7.513379  7.909282
> rowMax(tmp5)
 [1] 473.42164  83.03404  89.11241  82.50688  90.49238  85.66656  86.38078
 [8]  96.41937  89.24703  83.73752
> rowMin(tmp5)
 [1] 63.25616 55.37787 59.89964 52.99437 54.68931 54.14349 59.75087 64.14877
 [9] 60.27036 56.27784
> 
> colMeans(tmp5)
 [1] 111.17507  72.47999  70.53205  67.48489  70.90403  69.93643  66.49925
 [8]  69.76699  71.32047  67.88679  68.61057  76.02432  75.82455  71.86013
[15]  73.07950  73.39278  71.57919  72.14544  69.71364  71.29828
> colSums(tmp5)
 [1] 1111.7507  724.7999  705.3205  674.8489  709.0403  699.3643  664.9925
 [8]  697.6699  713.2047  678.8679  686.1057  760.2432  758.2455  718.6013
[15]  730.7950  733.9278  715.7919  721.4544  697.1364  712.9828
> colVars(tmp5)
 [1] 16289.18328   104.73372    50.08656    16.26817    63.03888   178.07445
 [7]    44.48952    57.79358    33.90082    75.86309    40.24565    64.82723
[13]    70.37190    65.19471    76.30007    36.23797    34.66107    84.19993
[19]   123.69113   122.29411
> colSd(tmp5)
 [1] 127.629085  10.233950   7.077186   4.033382   7.939703  13.344454
 [7]   6.670046   7.602209   5.822441   8.709942   6.343946   8.051536
[13]   8.388796   8.074324   8.734991   6.019798   5.887365   9.176052
[19]  11.121652  11.058667
> colMax(tmp5)
 [1] 473.42164  87.26083  82.16693  72.80810  80.75930  96.41937  83.98050
 [8]  80.22939  77.49205  79.09980  77.75652  88.00719  87.82634  84.83395
[15]  86.38078  83.03404  80.13045  87.57427  89.11241  85.36334
> colMin(tmp5)
 [1] 56.27784 57.83805 60.41964 60.77796 54.86998 54.45567 60.27036 57.22622
 [9] 61.21411 52.99437 60.76999 65.82800 63.51729 60.82819 64.62807 64.90887
[17] 63.51874 58.70598 54.68931 54.14349
> 
> 
> ### setting a random element to NA and then testing with na.rm=TRUE or na.rm=FALSE (The default)
> 
> 
> which.row <- sample(1:10,1,replace=TRUE)
> which.col  <- sample(1:20,1,replace=TRUE)
> 
> tmp5[which.row,which.col] <- NA
> 
> Max(tmp5)
[1] NA
> Min(tmp5)
[1] NA
> mean(tmp5)
[1] NA
> Sum(tmp5)
[1] NA
> Var(tmp5)
[1] NA
> 
> rowMeans(tmp5)
 [1] 91.29660 69.73929       NA 67.71158 71.42096 70.21117 69.42764 74.04298
 [9] 71.97911 73.46989
> rowSums(tmp5)
 [1] 1825.932 1394.786       NA 1354.232 1428.419 1404.223 1388.553 1480.860
 [9] 1439.582 1469.398
> rowVars(tmp5)
 [1] 8133.70531   59.45396   79.23691   71.94133  109.96830   89.67052
 [7]   61.69582   73.55341   56.45086   62.55675
> rowSd(tmp5)
 [1] 90.187057  7.710640  8.901512  8.481823 10.486577  9.469452  7.854669
 [8]  8.576328  7.513379  7.909282
> rowMax(tmp5)
 [1] 473.42164  83.03404        NA  82.50688  90.49238  85.66656  86.38078
 [8]  96.41937  89.24703  83.73752
> rowMin(tmp5)
 [1] 63.25616 55.37787       NA 52.99437 54.68931 54.14349 59.75087 64.14877
 [9] 60.27036 56.27784
> 
> colMeans(tmp5)
 [1] 111.17507  72.47999  70.53205  67.48489  70.90403  69.93643  66.49925
 [8]  69.76699  71.32047        NA  68.61057  76.02432  75.82455  71.86013
[15]  73.07950  73.39278  71.57919  72.14544  69.71364  71.29828
> colSums(tmp5)
 [1] 1111.7507  724.7999  705.3205  674.8489  709.0403  699.3643  664.9925
 [8]  697.6699  713.2047        NA  686.1057  760.2432  758.2455  718.6013
[15]  730.7950  733.9278  715.7919  721.4544  697.1364  712.9828
> colVars(tmp5)
 [1] 16289.18328   104.73372    50.08656    16.26817    63.03888   178.07445
 [7]    44.48952    57.79358    33.90082          NA    40.24565    64.82723
[13]    70.37190    65.19471    76.30007    36.23797    34.66107    84.19993
[19]   123.69113   122.29411
> colSd(tmp5)
 [1] 127.629085  10.233950   7.077186   4.033382   7.939703  13.344454
 [7]   6.670046   7.602209   5.822441         NA   6.343946   8.051536
[13]   8.388796   8.074324   8.734991   6.019798   5.887365   9.176052
[19]  11.121652  11.058667
> colMax(tmp5)
 [1] 473.42164  87.26083  82.16693  72.80810  80.75930  96.41937  83.98050
 [8]  80.22939  77.49205        NA  77.75652  88.00719  87.82634  84.83395
[15]  86.38078  83.03404  80.13045  87.57427  89.11241  85.36334
> colMin(tmp5)
 [1] 56.27784 57.83805 60.41964 60.77796 54.86998 54.45567 60.27036 57.22622
 [9] 61.21411       NA 60.76999 65.82800 63.51729 60.82819 64.62807 64.90887
[17] 63.51874 58.70598 54.68931 54.14349
> 
> Max(tmp5,na.rm=TRUE)
[1] 473.4216
> Min(tmp5,na.rm=TRUE)
[1] 52.99437
> mean(tmp5,na.rm=TRUE)
[1] 73.06685
> Sum(tmp5,na.rm=TRUE)
[1] 14540.3
> Var(tmp5,na.rm=TRUE)
[1] 884.4318
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 91.29660 69.73929 71.27996 67.71158 71.42096 70.21117 69.42764 74.04298
 [9] 71.97911 73.46989
> rowSums(tmp5,na.rm=TRUE)
 [1] 1825.932 1394.786 1354.319 1354.232 1428.419 1404.223 1388.553 1480.860
 [9] 1439.582 1469.398
> rowVars(tmp5,na.rm=TRUE)
 [1] 8133.70531   59.45396   79.23691   71.94133  109.96830   89.67052
 [7]   61.69582   73.55341   56.45086   62.55675
> rowSd(tmp5,na.rm=TRUE)
 [1] 90.187057  7.710640  8.901512  8.481823 10.486577  9.469452  7.854669
 [8]  8.576328  7.513379  7.909282
> rowMax(tmp5,na.rm=TRUE)
 [1] 473.42164  83.03404  89.11241  82.50688  90.49238  85.66656  86.38078
 [8]  96.41937  89.24703  83.73752
> rowMin(tmp5,na.rm=TRUE)
 [1] 63.25616 55.37787 59.89964 52.99437 54.68931 54.14349 59.75087 64.14877
 [9] 60.27036 56.27784
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 111.17507  72.47999  70.53205  67.48489  70.90403  69.93643  66.49925
 [8]  69.76699  71.32047  67.11419  68.61057  76.02432  75.82455  71.86013
[15]  73.07950  73.39278  71.57919  72.14544  69.71364  71.29828
> colSums(tmp5,na.rm=TRUE)
 [1] 1111.7507  724.7999  705.3205  674.8489  709.0403  699.3643  664.9925
 [8]  697.6699  713.2047  604.0277  686.1057  760.2432  758.2455  718.6013
[15]  730.7950  733.9278  715.7919  721.4544  697.1364  712.9828
> colVars(tmp5,na.rm=TRUE)
 [1] 16289.18328   104.73372    50.08656    16.26817    63.03888   178.07445
 [7]    44.48952    57.79358    33.90082    78.63076    40.24565    64.82723
[13]    70.37190    65.19471    76.30007    36.23797    34.66107    84.19993
[19]   123.69113   122.29411
> colSd(tmp5,na.rm=TRUE)
 [1] 127.629085  10.233950   7.077186   4.033382   7.939703  13.344454
 [7]   6.670046   7.602209   5.822441   8.867399   6.343946   8.051536
[13]   8.388796   8.074324   8.734991   6.019798   5.887365   9.176052
[19]  11.121652  11.058667
> colMax(tmp5,na.rm=TRUE)
 [1] 473.42164  87.26083  82.16693  72.80810  80.75930  96.41937  83.98050
 [8]  80.22939  77.49205  79.09980  77.75652  88.00719  87.82634  84.83395
[15]  86.38078  83.03404  80.13045  87.57427  89.11241  85.36334
> colMin(tmp5,na.rm=TRUE)
 [1] 56.27784 57.83805 60.41964 60.77796 54.86998 54.45567 60.27036 57.22622
 [9] 61.21411 52.99437 60.76999 65.82800 63.51729 60.82819 64.62807 64.90887
[17] 63.51874 58.70598 54.68931 54.14349
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1] 91.29660 69.73929      NaN 67.71158 71.42096 70.21117 69.42764 74.04298
 [9] 71.97911 73.46989
> rowSums(tmp5,na.rm=TRUE)
 [1] 1825.932 1394.786    0.000 1354.232 1428.419 1404.223 1388.553 1480.860
 [9] 1439.582 1469.398
> rowVars(tmp5,na.rm=TRUE)
 [1] 8133.70531   59.45396         NA   71.94133  109.96830   89.67052
 [7]   61.69582   73.55341   56.45086   62.55675
> rowSd(tmp5,na.rm=TRUE)
 [1] 90.187057  7.710640        NA  8.481823 10.486577  9.469452  7.854669
 [8]  8.576328  7.513379  7.909282
> rowMax(tmp5,na.rm=TRUE)
 [1] 473.42164  83.03404        NA  82.50688  90.49238  85.66656  86.38078
 [8]  96.41937  89.24703  83.73752
> rowMin(tmp5,na.rm=TRUE)
 [1] 63.25616 55.37787       NA 52.99437 54.68931 54.14349 59.75087 64.14877
 [9] 60.27036 56.27784
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1] 116.03536  73.15873  71.65565  67.33882  69.80900  71.05163  66.56634
 [8]  70.33856  71.17874       NaN  69.26695  75.70770  75.76819  73.08590
[15]  73.43816  74.09844  71.25600  70.43113  67.55822  70.25166
> colSums(tmp5,na.rm=TRUE)
 [1] 1044.3182  658.4286  644.9008  606.0494  628.2810  639.4647  599.0970
 [8]  633.0470  640.6086    0.0000  623.4025  681.3693  681.9137  657.7731
[15]  660.9435  666.8859  641.3040  633.8801  608.0240  632.2650
> colVars(tmp5,na.rm=TRUE)
 [1] 18059.57882   112.64265    42.14448    18.06165    57.42895   186.34247
 [7]    50.00008    61.34259    37.91243          NA    40.42952    71.80280
[13]    79.13265    56.44078    84.39036    35.16578    37.81866    61.66258
[19]    86.88695   125.25761
> colSd(tmp5,na.rm=TRUE)
 [1] 134.385932  10.613324   6.491878   4.249900   7.578189  13.650731
 [7]   7.071073   7.832151   6.157307         NA   6.358421   8.473653
[13]   8.895653   7.512708   9.186423   5.930074   6.149688   7.852552
[19]   9.321317  11.191855
> colMax(tmp5,na.rm=TRUE)
 [1] 473.42164  87.26083  82.16693  72.80810  78.37478  96.41937  83.98050
 [8]  80.22939  77.49205      -Inf  77.75652  88.00719  87.82634  84.83395
[15]  86.38078  83.03404  80.13045  79.87305  81.90459  85.36334
> colMin(tmp5,na.rm=TRUE)
 [1] 56.27784 57.83805 62.98027 60.77796 54.86998 54.45567 60.27036 57.22622
 [9] 61.21411      Inf 60.76999 65.82800 63.51729 61.70242 64.62807 64.90887
[17] 63.51874 58.70598 54.68931 54.14349
> 
> 
> 
> 
> 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] 137.9843 124.1777 273.0245 256.9099 190.1657 155.8861 290.0415 270.3526
 [9] 255.2822 265.2940
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 137.9843 124.1777 273.0245 256.9099 190.1657 155.8861 290.0415 270.3526
 [9] 255.2822 265.2940
> 
> 
> 
> 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]  5.684342e-14  5.684342e-14  0.000000e+00 -2.842171e-14  1.705303e-13
 [6]  3.410605e-13  1.136868e-13  0.000000e+00  0.000000e+00 -2.842171e-14
[11] -8.526513e-14  8.526513e-14 -1.421085e-14  1.136868e-13 -1.136868e-13
[16]  0.000000e+00  0.000000e+00 -2.842171e-14 -2.842171e-14  2.842171e-14
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> ## making sure these things agree
> ##
> ## first when there is no NA
> 
> 
> 
> agree.checks <- function(buff.matrix,r.matrix,err.tol=1e-10){
+ 
+   if (Max(buff.matrix,na.rm=TRUE) != max(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Max")
+   }
+   
+ 
+   if (Min(buff.matrix,na.rm=TRUE) != min(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Min")
+   }
+ 
+ 
+   if (abs(Sum(buff.matrix,na.rm=TRUE)- sum(r.matrix,na.rm=TRUE)) > err.tol){
+ 
+     cat(Sum(buff.matrix,na.rm=TRUE),"\n")
+     cat(sum(r.matrix,na.rm=TRUE),"\n")
+     cat(Sum(buff.matrix,na.rm=TRUE) - sum(r.matrix,na.rm=TRUE),"\n")
+     
+     stop("No agreement in Sum")
+   }
+   
+   if (abs(mean(buff.matrix,na.rm=TRUE) - mean(r.matrix,na.rm=TRUE)) > err.tol){
+     stop("No agreement in mean")
+   }
+   
+   
+   if(abs(Var(buff.matrix,na.rm=TRUE) - var(as.vector(r.matrix),na.rm=TRUE)) > err.tol){
+     stop("No agreement in Var")
+   }
+   
+   
+ 
+   if(any(abs(rowMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,mean,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowMeans")
+   }
+   
+   
+   if(any(abs(colMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,mean,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colMeans")
+   }
+   
+   
+   if(any(abs(rowSums(buff.matrix,na.rm=TRUE)  -  apply(r.matrix,1,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in rowSums")
+   }
+   
+   
+   if(any(abs(colSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colSums")
+   }
+   
+   ### this is to get around the fact that R doesn't like to compute NA on an entire vector of NA when 
+   ### computing variance
+   my.Var <- function(x,na.rm=FALSE){
+    if (all(is.na(x))){
+      return(NA)
+    } else {
+      var(x,na.rm=na.rm)
+    }
+ 
+   }
+   
+   if(any(abs(rowVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+   
+   
+   if(any(abs(colVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+ 
+ 
+   if(any(abs(rowMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+ 
+   if(any(abs(colMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+   
+   
+   if(any(abs(rowMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+   
+ 
+   if(any(abs(colMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+ 
+   if(any(abs(colMedians(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,median,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMedian")
+   }
+ 
+   if(any(abs(colRanges(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,range,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colRanges")
+   }
+ 
+ 
+   
+ }
> 
> 
> 
> 
> 
> 
> 
> 
> 
> for (rep in 1:20){
+   copymatrix <- matrix(rnorm(200,150,15),10,20)
+   
+   tmp5[1:10,1:20] <- copymatrix
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ## now lets assign some NA values and check agreement
+ 
+   which.row <- sample(1:10,1,replace=TRUE)
+   which.col  <- sample(1:20,1,replace=TRUE)
+   
+   cat(which.row," ",which.col,"\n")
+   
+   tmp5[which.row,which.col] <- NA
+   copymatrix[which.row,which.col] <- NA
+   
+   agree.checks(tmp5,copymatrix)
+ 
+   ## make an entire row NA
+   tmp5[which.row,] <- NA
+   copymatrix[which.row,] <- NA
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ### also make an entire col NA
+   tmp5[,which.col] <- NA
+   copymatrix[,which.col] <- NA
+ 
+   agree.checks(tmp5,copymatrix)
+ 
+   ### now make 1 element non NA with NA in the rest of row and column
+ 
+   tmp5[which.row,which.col] <- rnorm(1,150,15)
+   copymatrix[which.row,which.col] <- tmp5[which.row,which.col]
+ 
+   agree.checks(tmp5,copymatrix)
+ }
7   20 
9   17 
8   15 
6   7 
3   8 
2   19 
4   5 
10   5 
9   9 
4   10 
6   10 
5   9 
4   14 
9   7 
9   17 
5   12 
5   12 
9   16 
7   16 
4   11 
There were 50 or more warnings (use warnings() to see the first 50)
> 
> 
> ### now test 1 by n and n by 1 matrix
> 
> 
> err.tol <- 1e-12
> 
> rm(tmp5)
> 
> dataset1 <- rnorm(100)
> dataset2 <- rnorm(100)
> 
> tmp <- createBufferedMatrix(1,100)
> tmp[1,] <- dataset1
> 
> tmp2 <- createBufferedMatrix(100,1)
> tmp2[,1] <- dataset2
> 
> 
> 
> 
> 
> Max(tmp)
[1] 1.653027
> Min(tmp)
[1] -2.544749
> mean(tmp)
[1] -0.1243604
> Sum(tmp)
[1] -12.43604
> Var(tmp)
[1] 0.6715065
> 
> rowMeans(tmp)
[1] -0.1243604
> rowSums(tmp)
[1] -12.43604
> rowVars(tmp)
[1] 0.6715065
> rowSd(tmp)
[1] 0.819455
> rowMax(tmp)
[1] 1.653027
> rowMin(tmp)
[1] -2.544749
> 
> colMeans(tmp)
  [1] -0.06242986 -0.46785191 -0.71360384  0.83007225 -0.32119713 -0.17508756
  [7] -1.33861348 -0.04528879 -0.65546204 -0.06705714  0.79548662 -0.48993213
 [13] -0.35154523 -0.23915353  0.36569402  0.09345848 -0.06355175  0.13046402
 [19] -1.48300537 -0.07925016 -0.02713740  1.29418685  0.68288627 -0.48633087
 [25] -0.31788729  0.22551261  1.19335627 -0.50308165 -0.02357080 -0.56733744
 [31]  1.53855292  0.03963452  0.12616335  1.49735200  0.51370319  0.36295193
 [37] -0.21221272 -1.86955969  0.51486300 -0.42469607 -1.60572189 -0.05731052
 [43]  0.61234759 -0.67940728  1.65302692 -1.70402273  0.22843427 -0.03149856
 [49] -0.02280199 -1.05834155  1.21517978  0.92107909 -0.39883904  0.43505796
 [55]  1.10328527 -0.99378923  1.15502229 -0.06115204 -0.35545111 -1.18177484
 [61] -0.01287985 -0.80846518  0.20293448 -0.11824539 -1.01323333 -0.76676443
 [67]  1.25858066 -0.72217848  0.82142771 -0.42196599  1.15164431 -0.61875154
 [73] -1.53720329 -0.26358740 -0.65409076 -1.36821976 -0.23759201 -2.54474906
 [79] -0.05609031 -0.17484422 -0.62540222 -0.38979336  0.47483938 -0.72486434
 [85]  0.95823394 -1.25554849  0.26205787 -0.49108255  0.10927208 -0.90642765
 [91] -0.12861178  1.08468525 -0.62503676 -1.39722826  0.94907280  0.38621355
 [97] -0.38092710  0.75007245 -0.88808404 -0.10602484
> colSums(tmp)
  [1] -0.06242986 -0.46785191 -0.71360384  0.83007225 -0.32119713 -0.17508756
  [7] -1.33861348 -0.04528879 -0.65546204 -0.06705714  0.79548662 -0.48993213
 [13] -0.35154523 -0.23915353  0.36569402  0.09345848 -0.06355175  0.13046402
 [19] -1.48300537 -0.07925016 -0.02713740  1.29418685  0.68288627 -0.48633087
 [25] -0.31788729  0.22551261  1.19335627 -0.50308165 -0.02357080 -0.56733744
 [31]  1.53855292  0.03963452  0.12616335  1.49735200  0.51370319  0.36295193
 [37] -0.21221272 -1.86955969  0.51486300 -0.42469607 -1.60572189 -0.05731052
 [43]  0.61234759 -0.67940728  1.65302692 -1.70402273  0.22843427 -0.03149856
 [49] -0.02280199 -1.05834155  1.21517978  0.92107909 -0.39883904  0.43505796
 [55]  1.10328527 -0.99378923  1.15502229 -0.06115204 -0.35545111 -1.18177484
 [61] -0.01287985 -0.80846518  0.20293448 -0.11824539 -1.01323333 -0.76676443
 [67]  1.25858066 -0.72217848  0.82142771 -0.42196599  1.15164431 -0.61875154
 [73] -1.53720329 -0.26358740 -0.65409076 -1.36821976 -0.23759201 -2.54474906
 [79] -0.05609031 -0.17484422 -0.62540222 -0.38979336  0.47483938 -0.72486434
 [85]  0.95823394 -1.25554849  0.26205787 -0.49108255  0.10927208 -0.90642765
 [91] -0.12861178  1.08468525 -0.62503676 -1.39722826  0.94907280  0.38621355
 [97] -0.38092710  0.75007245 -0.88808404 -0.10602484
> colVars(tmp)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> colSd(tmp)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> colMax(tmp)
  [1] -0.06242986 -0.46785191 -0.71360384  0.83007225 -0.32119713 -0.17508756
  [7] -1.33861348 -0.04528879 -0.65546204 -0.06705714  0.79548662 -0.48993213
 [13] -0.35154523 -0.23915353  0.36569402  0.09345848 -0.06355175  0.13046402
 [19] -1.48300537 -0.07925016 -0.02713740  1.29418685  0.68288627 -0.48633087
 [25] -0.31788729  0.22551261  1.19335627 -0.50308165 -0.02357080 -0.56733744
 [31]  1.53855292  0.03963452  0.12616335  1.49735200  0.51370319  0.36295193
 [37] -0.21221272 -1.86955969  0.51486300 -0.42469607 -1.60572189 -0.05731052
 [43]  0.61234759 -0.67940728  1.65302692 -1.70402273  0.22843427 -0.03149856
 [49] -0.02280199 -1.05834155  1.21517978  0.92107909 -0.39883904  0.43505796
 [55]  1.10328527 -0.99378923  1.15502229 -0.06115204 -0.35545111 -1.18177484
 [61] -0.01287985 -0.80846518  0.20293448 -0.11824539 -1.01323333 -0.76676443
 [67]  1.25858066 -0.72217848  0.82142771 -0.42196599  1.15164431 -0.61875154
 [73] -1.53720329 -0.26358740 -0.65409076 -1.36821976 -0.23759201 -2.54474906
 [79] -0.05609031 -0.17484422 -0.62540222 -0.38979336  0.47483938 -0.72486434
 [85]  0.95823394 -1.25554849  0.26205787 -0.49108255  0.10927208 -0.90642765
 [91] -0.12861178  1.08468525 -0.62503676 -1.39722826  0.94907280  0.38621355
 [97] -0.38092710  0.75007245 -0.88808404 -0.10602484
> colMin(tmp)
  [1] -0.06242986 -0.46785191 -0.71360384  0.83007225 -0.32119713 -0.17508756
  [7] -1.33861348 -0.04528879 -0.65546204 -0.06705714  0.79548662 -0.48993213
 [13] -0.35154523 -0.23915353  0.36569402  0.09345848 -0.06355175  0.13046402
 [19] -1.48300537 -0.07925016 -0.02713740  1.29418685  0.68288627 -0.48633087
 [25] -0.31788729  0.22551261  1.19335627 -0.50308165 -0.02357080 -0.56733744
 [31]  1.53855292  0.03963452  0.12616335  1.49735200  0.51370319  0.36295193
 [37] -0.21221272 -1.86955969  0.51486300 -0.42469607 -1.60572189 -0.05731052
 [43]  0.61234759 -0.67940728  1.65302692 -1.70402273  0.22843427 -0.03149856
 [49] -0.02280199 -1.05834155  1.21517978  0.92107909 -0.39883904  0.43505796
 [55]  1.10328527 -0.99378923  1.15502229 -0.06115204 -0.35545111 -1.18177484
 [61] -0.01287985 -0.80846518  0.20293448 -0.11824539 -1.01323333 -0.76676443
 [67]  1.25858066 -0.72217848  0.82142771 -0.42196599  1.15164431 -0.61875154
 [73] -1.53720329 -0.26358740 -0.65409076 -1.36821976 -0.23759201 -2.54474906
 [79] -0.05609031 -0.17484422 -0.62540222 -0.38979336  0.47483938 -0.72486434
 [85]  0.95823394 -1.25554849  0.26205787 -0.49108255  0.10927208 -0.90642765
 [91] -0.12861178  1.08468525 -0.62503676 -1.39722826  0.94907280  0.38621355
 [97] -0.38092710  0.75007245 -0.88808404 -0.10602484
> colMedians(tmp)
  [1] -0.06242986 -0.46785191 -0.71360384  0.83007225 -0.32119713 -0.17508756
  [7] -1.33861348 -0.04528879 -0.65546204 -0.06705714  0.79548662 -0.48993213
 [13] -0.35154523 -0.23915353  0.36569402  0.09345848 -0.06355175  0.13046402
 [19] -1.48300537 -0.07925016 -0.02713740  1.29418685  0.68288627 -0.48633087
 [25] -0.31788729  0.22551261  1.19335627 -0.50308165 -0.02357080 -0.56733744
 [31]  1.53855292  0.03963452  0.12616335  1.49735200  0.51370319  0.36295193
 [37] -0.21221272 -1.86955969  0.51486300 -0.42469607 -1.60572189 -0.05731052
 [43]  0.61234759 -0.67940728  1.65302692 -1.70402273  0.22843427 -0.03149856
 [49] -0.02280199 -1.05834155  1.21517978  0.92107909 -0.39883904  0.43505796
 [55]  1.10328527 -0.99378923  1.15502229 -0.06115204 -0.35545111 -1.18177484
 [61] -0.01287985 -0.80846518  0.20293448 -0.11824539 -1.01323333 -0.76676443
 [67]  1.25858066 -0.72217848  0.82142771 -0.42196599  1.15164431 -0.61875154
 [73] -1.53720329 -0.26358740 -0.65409076 -1.36821976 -0.23759201 -2.54474906
 [79] -0.05609031 -0.17484422 -0.62540222 -0.38979336  0.47483938 -0.72486434
 [85]  0.95823394 -1.25554849  0.26205787 -0.49108255  0.10927208 -0.90642765
 [91] -0.12861178  1.08468525 -0.62503676 -1.39722826  0.94907280  0.38621355
 [97] -0.38092710  0.75007245 -0.88808404 -0.10602484
> colRanges(tmp)
            [,1]       [,2]       [,3]      [,4]       [,5]       [,6]
[1,] -0.06242986 -0.4678519 -0.7136038 0.8300723 -0.3211971 -0.1750876
[2,] -0.06242986 -0.4678519 -0.7136038 0.8300723 -0.3211971 -0.1750876
          [,7]        [,8]      [,9]       [,10]     [,11]      [,12]
[1,] -1.338613 -0.04528879 -0.655462 -0.06705714 0.7954866 -0.4899321
[2,] -1.338613 -0.04528879 -0.655462 -0.06705714 0.7954866 -0.4899321
          [,13]      [,14]    [,15]      [,16]       [,17]    [,18]     [,19]
[1,] -0.3515452 -0.2391535 0.365694 0.09345848 -0.06355175 0.130464 -1.483005
[2,] -0.3515452 -0.2391535 0.365694 0.09345848 -0.06355175 0.130464 -1.483005
           [,20]      [,21]    [,22]     [,23]      [,24]      [,25]     [,26]
[1,] -0.07925016 -0.0271374 1.294187 0.6828863 -0.4863309 -0.3178873 0.2255126
[2,] -0.07925016 -0.0271374 1.294187 0.6828863 -0.4863309 -0.3178873 0.2255126
        [,27]      [,28]      [,29]      [,30]    [,31]      [,32]     [,33]
[1,] 1.193356 -0.5030816 -0.0235708 -0.5673374 1.538553 0.03963452 0.1261634
[2,] 1.193356 -0.5030816 -0.0235708 -0.5673374 1.538553 0.03963452 0.1261634
        [,34]     [,35]     [,36]      [,37]    [,38]    [,39]      [,40]
[1,] 1.497352 0.5137032 0.3629519 -0.2122127 -1.86956 0.514863 -0.4246961
[2,] 1.497352 0.5137032 0.3629519 -0.2122127 -1.86956 0.514863 -0.4246961
         [,41]       [,42]     [,43]      [,44]    [,45]     [,46]     [,47]
[1,] -1.605722 -0.05731052 0.6123476 -0.6794073 1.653027 -1.704023 0.2284343
[2,] -1.605722 -0.05731052 0.6123476 -0.6794073 1.653027 -1.704023 0.2284343
           [,48]       [,49]     [,50]   [,51]     [,52]     [,53]    [,54]
[1,] -0.03149856 -0.02280199 -1.058342 1.21518 0.9210791 -0.398839 0.435058
[2,] -0.03149856 -0.02280199 -1.058342 1.21518 0.9210791 -0.398839 0.435058
        [,55]      [,56]    [,57]       [,58]      [,59]     [,60]       [,61]
[1,] 1.103285 -0.9937892 1.155022 -0.06115204 -0.3554511 -1.181775 -0.01287985
[2,] 1.103285 -0.9937892 1.155022 -0.06115204 -0.3554511 -1.181775 -0.01287985
          [,62]     [,63]      [,64]     [,65]      [,66]    [,67]      [,68]
[1,] -0.8084652 0.2029345 -0.1182454 -1.013233 -0.7667644 1.258581 -0.7221785
[2,] -0.8084652 0.2029345 -0.1182454 -1.013233 -0.7667644 1.258581 -0.7221785
         [,69]     [,70]    [,71]      [,72]     [,73]      [,74]      [,75]
[1,] 0.8214277 -0.421966 1.151644 -0.6187515 -1.537203 -0.2635874 -0.6540908
[2,] 0.8214277 -0.421966 1.151644 -0.6187515 -1.537203 -0.2635874 -0.6540908
        [,76]     [,77]     [,78]       [,79]      [,80]      [,81]      [,82]
[1,] -1.36822 -0.237592 -2.544749 -0.05609031 -0.1748442 -0.6254022 -0.3897934
[2,] -1.36822 -0.237592 -2.544749 -0.05609031 -0.1748442 -0.6254022 -0.3897934
         [,83]      [,84]     [,85]     [,86]     [,87]      [,88]     [,89]
[1,] 0.4748394 -0.7248643 0.9582339 -1.255548 0.2620579 -0.4910825 0.1092721
[2,] 0.4748394 -0.7248643 0.9582339 -1.255548 0.2620579 -0.4910825 0.1092721
          [,90]      [,91]    [,92]      [,93]     [,94]     [,95]     [,96]
[1,] -0.9064276 -0.1286118 1.084685 -0.6250368 -1.397228 0.9490728 0.3862135
[2,] -0.9064276 -0.1286118 1.084685 -0.6250368 -1.397228 0.9490728 0.3862135
          [,97]     [,98]     [,99]     [,100]
[1,] -0.3809271 0.7500724 -0.888084 -0.1060248
[2,] -0.3809271 0.7500724 -0.888084 -0.1060248
> 
> 
> Max(tmp2)
[1] 2.110378
> Min(tmp2)
[1] -2.182348
> mean(tmp2)
[1] -0.04659317
> Sum(tmp2)
[1] -4.659317
> Var(tmp2)
[1] 0.9925512
> 
> rowMeans(tmp2)
  [1]  0.1884819857 -2.0238324811  0.2059937019 -1.2509458117 -1.2632085030
  [6] -1.7877718875 -1.0806332896  0.8217931700  1.5965387991  1.1724398905
 [11] -0.1263971314  0.6321419346 -0.4717186400 -0.1590052525  1.0858979422
 [16] -0.8915978764  0.2090836448  0.4345853572  0.7294609840 -0.2523531636
 [21] -0.0216608460 -1.8347442308  1.2016221549  0.7359828762  1.5837507782
 [26]  1.0803008957 -0.8875845129 -2.1823476100 -1.5008174430 -0.6044143045
 [31] -0.1265805589  1.4757728140  0.1321994309  0.3886021143  0.1503259865
 [36]  0.1232451057 -0.4409758771 -0.6341906651  2.1103775231  1.1465132884
 [41]  0.6430418858 -0.2857641316 -0.9391320375  1.3028305042 -0.6388895360
 [46] -1.3053044077 -1.7164919271  0.0366097737  0.0436718044 -0.9491200412
 [51]  0.0005231818  0.2763005306  1.3701791518 -2.0623420301 -1.6054839657
 [56]  1.4349919470 -0.9569220241  0.7894081627  0.7754109545  0.2237994981
 [61]  0.2848456257 -0.3794089988  0.8445195075 -0.3570036058 -0.6016057802
 [66] -0.1933139018  0.2624405753  0.9063776227 -0.4049932586 -0.0064611036
 [71] -0.6846770684 -0.5079665567 -0.7458854414  0.8007270236  0.0545955613
 [76] -1.8248877515  1.1632143773  1.0548606544 -2.0223630839 -0.1273134630
 [81]  0.4995346261 -0.5093539304  0.4731411170 -0.5423098602 -1.0928850388
 [86] -0.1477981250  1.5638856597  0.0623925398  0.1032706059  1.3486780858
 [91] -0.1081709378  1.7888077935 -0.8371460057  0.2870339261 -1.0829425162
 [96] -0.0243655306  1.0291549098  0.8827279575 -1.6431224105 -0.3271979104
> rowSums(tmp2)
  [1]  0.1884819857 -2.0238324811  0.2059937019 -1.2509458117 -1.2632085030
  [6] -1.7877718875 -1.0806332896  0.8217931700  1.5965387991  1.1724398905
 [11] -0.1263971314  0.6321419346 -0.4717186400 -0.1590052525  1.0858979422
 [16] -0.8915978764  0.2090836448  0.4345853572  0.7294609840 -0.2523531636
 [21] -0.0216608460 -1.8347442308  1.2016221549  0.7359828762  1.5837507782
 [26]  1.0803008957 -0.8875845129 -2.1823476100 -1.5008174430 -0.6044143045
 [31] -0.1265805589  1.4757728140  0.1321994309  0.3886021143  0.1503259865
 [36]  0.1232451057 -0.4409758771 -0.6341906651  2.1103775231  1.1465132884
 [41]  0.6430418858 -0.2857641316 -0.9391320375  1.3028305042 -0.6388895360
 [46] -1.3053044077 -1.7164919271  0.0366097737  0.0436718044 -0.9491200412
 [51]  0.0005231818  0.2763005306  1.3701791518 -2.0623420301 -1.6054839657
 [56]  1.4349919470 -0.9569220241  0.7894081627  0.7754109545  0.2237994981
 [61]  0.2848456257 -0.3794089988  0.8445195075 -0.3570036058 -0.6016057802
 [66] -0.1933139018  0.2624405753  0.9063776227 -0.4049932586 -0.0064611036
 [71] -0.6846770684 -0.5079665567 -0.7458854414  0.8007270236  0.0545955613
 [76] -1.8248877515  1.1632143773  1.0548606544 -2.0223630839 -0.1273134630
 [81]  0.4995346261 -0.5093539304  0.4731411170 -0.5423098602 -1.0928850388
 [86] -0.1477981250  1.5638856597  0.0623925398  0.1032706059  1.3486780858
 [91] -0.1081709378  1.7888077935 -0.8371460057  0.2870339261 -1.0829425162
 [96] -0.0243655306  1.0291549098  0.8827279575 -1.6431224105 -0.3271979104
> rowVars(tmp2)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowSd(tmp2)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowMax(tmp2)
  [1]  0.1884819857 -2.0238324811  0.2059937019 -1.2509458117 -1.2632085030
  [6] -1.7877718875 -1.0806332896  0.8217931700  1.5965387991  1.1724398905
 [11] -0.1263971314  0.6321419346 -0.4717186400 -0.1590052525  1.0858979422
 [16] -0.8915978764  0.2090836448  0.4345853572  0.7294609840 -0.2523531636
 [21] -0.0216608460 -1.8347442308  1.2016221549  0.7359828762  1.5837507782
 [26]  1.0803008957 -0.8875845129 -2.1823476100 -1.5008174430 -0.6044143045
 [31] -0.1265805589  1.4757728140  0.1321994309  0.3886021143  0.1503259865
 [36]  0.1232451057 -0.4409758771 -0.6341906651  2.1103775231  1.1465132884
 [41]  0.6430418858 -0.2857641316 -0.9391320375  1.3028305042 -0.6388895360
 [46] -1.3053044077 -1.7164919271  0.0366097737  0.0436718044 -0.9491200412
 [51]  0.0005231818  0.2763005306  1.3701791518 -2.0623420301 -1.6054839657
 [56]  1.4349919470 -0.9569220241  0.7894081627  0.7754109545  0.2237994981
 [61]  0.2848456257 -0.3794089988  0.8445195075 -0.3570036058 -0.6016057802
 [66] -0.1933139018  0.2624405753  0.9063776227 -0.4049932586 -0.0064611036
 [71] -0.6846770684 -0.5079665567 -0.7458854414  0.8007270236  0.0545955613
 [76] -1.8248877515  1.1632143773  1.0548606544 -2.0223630839 -0.1273134630
 [81]  0.4995346261 -0.5093539304  0.4731411170 -0.5423098602 -1.0928850388
 [86] -0.1477981250  1.5638856597  0.0623925398  0.1032706059  1.3486780858
 [91] -0.1081709378  1.7888077935 -0.8371460057  0.2870339261 -1.0829425162
 [96] -0.0243655306  1.0291549098  0.8827279575 -1.6431224105 -0.3271979104
> rowMin(tmp2)
  [1]  0.1884819857 -2.0238324811  0.2059937019 -1.2509458117 -1.2632085030
  [6] -1.7877718875 -1.0806332896  0.8217931700  1.5965387991  1.1724398905
 [11] -0.1263971314  0.6321419346 -0.4717186400 -0.1590052525  1.0858979422
 [16] -0.8915978764  0.2090836448  0.4345853572  0.7294609840 -0.2523531636
 [21] -0.0216608460 -1.8347442308  1.2016221549  0.7359828762  1.5837507782
 [26]  1.0803008957 -0.8875845129 -2.1823476100 -1.5008174430 -0.6044143045
 [31] -0.1265805589  1.4757728140  0.1321994309  0.3886021143  0.1503259865
 [36]  0.1232451057 -0.4409758771 -0.6341906651  2.1103775231  1.1465132884
 [41]  0.6430418858 -0.2857641316 -0.9391320375  1.3028305042 -0.6388895360
 [46] -1.3053044077 -1.7164919271  0.0366097737  0.0436718044 -0.9491200412
 [51]  0.0005231818  0.2763005306  1.3701791518 -2.0623420301 -1.6054839657
 [56]  1.4349919470 -0.9569220241  0.7894081627  0.7754109545  0.2237994981
 [61]  0.2848456257 -0.3794089988  0.8445195075 -0.3570036058 -0.6016057802
 [66] -0.1933139018  0.2624405753  0.9063776227 -0.4049932586 -0.0064611036
 [71] -0.6846770684 -0.5079665567 -0.7458854414  0.8007270236  0.0545955613
 [76] -1.8248877515  1.1632143773  1.0548606544 -2.0223630839 -0.1273134630
 [81]  0.4995346261 -0.5093539304  0.4731411170 -0.5423098602 -1.0928850388
 [86] -0.1477981250  1.5638856597  0.0623925398  0.1032706059  1.3486780858
 [91] -0.1081709378  1.7888077935 -0.8371460057  0.2870339261 -1.0829425162
 [96] -0.0243655306  1.0291549098  0.8827279575 -1.6431224105 -0.3271979104
> 
> colMeans(tmp2)
[1] -0.04659317
> colSums(tmp2)
[1] -4.659317
> colVars(tmp2)
[1] 0.9925512
> colSd(tmp2)
[1] 0.9962686
> colMax(tmp2)
[1] 2.110378
> colMin(tmp2)
[1] -2.182348
> colMedians(tmp2)
[1] -0.002968961
> colRanges(tmp2)
          [,1]
[1,] -2.182348
[2,]  2.110378
> 
> 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.9608133  0.3556962 -3.0815883 -0.1104896  4.4161871 -1.0761093
 [7]  1.5271690  2.7071727 -1.7555600 -4.4188696
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -0.8559152
[2,] -0.3723538
[3,]  0.1318498
[4,]  0.6909107
[5,]  1.8428191
> 
> rowApply(tmp,sum)
 [1]  3.6628523  4.7280271 -1.5779774  1.8750563 -2.1729998 -1.9591357
 [7] -6.4480952 -0.9057743  4.8881224 -1.5656541
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    3    1    9    8    8    2    8    8   10     1
 [2,]    6    5   10    9    9    1    2    4    5     4
 [3,]    8    6    3    1    6    7    1    2    9     6
 [4,]    5    2    7    7    2    9    3    5    6     7
 [5,]   10   10    1    6   10    4    5    9    8     2
 [6,]    7    3    4    5    3    5    4   10    2     5
 [7,]    4    9    8    3    4    3   10    7    7    10
 [8,]    9    4    6   10    5    8    7    3    4     8
 [9,]    2    7    5    2    7   10    9    1    1     9
[10,]    1    8    2    4    1    6    6    6    3     3
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1] -0.76193918  1.26408801 -0.28731263  1.48175216 -2.23498345  1.02212076
 [7]  2.69673992  2.39414243 -0.18084734 -3.87071144  0.24483728 -1.48887728
[13]  1.10480107 -1.21137249  0.59905853  0.70929528  0.07680996 -0.51596222
[19] -0.69625948 -2.93916149
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -1.2056599
[2,] -0.5253358
[3,] -0.5085974
[4,] -0.1151895
[5,]  1.5928435
> 
> rowApply(tmp,sum)
[1]  0.9805033  0.5192458 -6.6032061  2.8211994 -0.3115240
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]    9    8    9    1   19
[2,]   19   10    1   18   13
[3,]   10   20   13    4    5
[4,]   12   17    5   19    9
[5,]   20    1    3   15    3
> 
> 
> as.matrix(tmp)
           [,1]       [,2]       [,3]       [,4]      [,5]       [,6]
[1,] -0.5085974  1.7222159 -0.2546710  0.1536751  1.779930  0.6664393
[2,] -0.1151895  0.0519424  1.6445601  0.9100297 -1.887369  1.1141120
[3,] -0.5253358 -2.3629706  0.2062114 -1.0839435 -1.936894 -0.7621825
[4,] -1.2056599  1.5360148 -1.0193859  1.6198042  1.202858 -0.4657180
[5,]  1.5928435  0.3168856 -0.8640273 -0.1178133 -1.393508  0.4694699
           [,7]       [,8]       [,9]      [,10]      [,11]      [,12]
[1,] -0.8167158  0.7087603  0.9046224 -1.5428208  1.1196579 -1.0241508
[2,]  0.7379002  0.7998678  0.4743644 -0.6175858  0.1573786 -1.6639464
[3,]  0.7881806  0.8552026  0.2288645  0.2655288 -0.7457944 -1.6849859
[4,]  1.3844386 -0.7414830 -1.1011265 -1.0880567  0.3394526  0.1932554
[5,]  0.6029363  0.7717947 -0.6875722 -0.8877770 -0.6258574  2.6909504
           [,13]       [,14]      [,15]      [,16]       [,17]       [,18]
[1,]  0.54433113  1.58576155 -0.8796010 -0.7430841  0.02600244 -0.77599610
[2,]  1.14935194 -0.66065480 -0.4589414  0.4695080 -0.03989897 -0.18891624
[3,]  0.03345958 -2.01864345  1.3559547  1.2302582  0.06558412  0.33938917
[4,] -0.14493958 -0.09792226 -0.1075731  1.6822112  0.03821079 -0.08375525
[5,] -0.47740199 -0.01991353  0.6892193 -1.9295979 -0.01308842  0.19331619
            [,19]      [,20]
[1,] -0.839131210 -0.8461244
[2,] -1.874922191  0.5176550
[3,] -0.001473976 -0.8496152
[4,]  1.218499915 -0.3379256
[5,]  0.800767978 -1.4231512
> 
> 
> 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.2625331 1.989236 0.01459735 -0.1696654 0.6068986 0.716908 0.03192492
          col8       col9     col10     col11      col12     col13     col14
row1 0.9491953 -0.8035173 -1.217618 0.9243995 -0.6683356 0.3722245 -1.608555
        col15      col16        col17     col18      col19     col20
row1 -2.31231 -0.6733268 -0.001302747 0.4133285 -0.4530977 0.2300348
> tmp[,"col10"]
            col10
row1 -1.217617714
row2 -0.637269138
row3 -0.077622398
row4  0.006542681
row5 -0.970674148
> tmp[c("row1","row5"),]
           col1       col2       col3       col4       col5      col6
row1 -0.2625331  1.9892362 0.01459735 -0.1696654  0.6068986  0.716908
row5 -1.2651523 -0.4798563 0.78353505  0.3105083 -0.5945232 -1.578233
            col7       col8       col9      col10     col11      col12
row1  0.03192492  0.9491953 -0.8035173 -1.2176177 0.9243995 -0.6683356
row5 -0.44556268 -1.0966370 -1.0738005 -0.9706741 0.3991599 -0.4665659
         col13     col14      col15      col16        col17     col18
row1 0.3722245 -1.608555 -2.3123105 -0.6733268 -0.001302747 0.4133285
row5 0.1098282 -1.351052 -0.6198727  1.0588102 -1.779432116 0.3644066
          col19     col20
row1 -0.4530977 0.2300348
row5 -0.8657148 1.8501688
> tmp[,c("col6","col20")]
           col6      col20
row1  0.7169080  0.2300348
row2  1.7789559 -0.7889470
row3  0.7264527  1.7169211
row4 -0.8643649 -0.2305928
row5 -1.5782331  1.8501688
> tmp[c("row1","row5"),c("col6","col20")]
          col6     col20
row1  0.716908 0.2300348
row5 -1.578233 1.8501688
> 
> 
> 
> 
> tmp["row1",] <- rnorm(20,mean=10)
> tmp[,"col10"] <- rnorm(5,mean=30)
> tmp[c("row1","row5"),] <- rnorm(40,mean=50)
> tmp[,c("col6","col20")] <- rnorm(10,mean=75)
> tmp[c("row1","row5"),c("col6","col20")]  <- rnorm(4,mean=105)
> 
> tmp["row1",]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 49.47314 49.58314 49.08541 50.90371 50.60568 105.4279 50.21408 48.51694
         col9    col10    col11    col12    col13    col14    col15    col16
row1 49.03953 49.70704 49.99203 49.98069 50.07316 49.22723 49.56678 50.03449
        col17    col18    col19    col20
row1 52.16392 49.68395 49.75134 105.2086
> tmp[,"col10"]
        col10
row1 49.70704
row2 29.61177
row3 30.46811
row4 28.55963
row5 49.76955
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 49.47314 49.58314 49.08541 50.90371 50.60568 105.4279 50.21408 48.51694
row5 49.27077 50.08817 49.12152 48.67600 50.16528 105.3680 50.57839 48.58296
         col9    col10    col11    col12    col13    col14    col15    col16
row1 49.03953 49.70704 49.99203 49.98069 50.07316 49.22723 49.56678 50.03449
row5 48.46794 49.76955 50.37052 50.52775 50.09869 49.06422 49.81522 50.94169
        col17    col18    col19    col20
row1 52.16392 49.68395 49.75134 105.2086
row5 50.43754 51.94619 52.31377 108.1595
> tmp[,c("col6","col20")]
          col6     col20
row1 105.42795 105.20857
row2  75.85983  74.32833
row3  74.68431  75.51782
row4  76.17226  73.88610
row5 105.36804 108.15953
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 105.4279 105.2086
row5 105.3680 108.1595
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 105.4279 105.2086
row5 105.3680 108.1595
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
         col13
[1,] 0.5488095
[2,] 1.1296674
[3,] 0.3561535
[4,] 0.5710878
[5,] 0.2178033
> tmp[,c("col17","col7")]
           col17       col7
[1,]  1.28781045  0.1060485
[2,] -2.11214445 -1.4939853
[3,] -1.82495263 -1.1309675
[4,] -0.73165646  0.2152684
[5,] -0.03034649 -0.3968134
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
           col6       col20
[1,] -0.3097948 -0.35521859
[2,] -1.5133933 -0.53796162
[3,] -0.3724413  1.08268775
[4,]  0.5957743  0.04689399
[5,] -0.7230811 -0.61479898
> subBufferedMatrix(tmp,1,c("col6"))[,1]
           col1
[1,] -0.3097948
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
           col6
[1,] -0.3097948
[2,] -1.5133933
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> 
> 
> 
> subBufferedMatrix(tmp,c("row3","row1"),)[,1:20]
           [,1]     [,2]       [,3]       [,4]       [,5]       [,6]       [,7]
row3 -0.3161594 1.226107 -0.6230269  1.4540240  1.1372459 1.12878367 -0.9586018
row1  0.2616145 1.207619  0.8349193 -0.6256123 -0.3339788 0.03875953  0.2117384
           [,8]       [,9]       [,10]      [,11]     [,12]       [,13]
row3 -1.8760357 -0.6605616 -0.08562607 0.24165278 -0.853065  0.14400488
row1 -0.1398511  0.9539498 -1.11838094 0.07056922 -1.253088 -0.08218513
          [,14]      [,15]     [,16]     [,17]      [,18]      [,19]      [,20]
row3 -0.4832978 -0.1683984 0.3787778 0.3757082 -0.8956919 -0.6799405  0.2319965
row1 -0.6075305  0.8275501 0.8860962 0.1969926  1.2124719  0.7800022 -1.2659199
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
          [,1]         [,2]       [,3]     [,4]     [,5]       [,6]       [,7]
row2 -1.271744 -0.005470524 -0.9584194 1.835068 1.216838 -0.2036383 -0.6038341
          [,8]     [,9]     [,10]
row2 -1.437569 1.168921 0.8574734
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
          [,1]     [,2]       [,3]      [,4]     [,5]      [,6]      [,7]
row5 0.3106494 1.502376 -0.2267114 0.8844743 -1.06703 0.3685386 -1.229597
           [,8]     [,9]     [,10]      [,11]      [,12]      [,13]      [,14]
row5 -0.6150378 1.888135 0.4505707 -0.6535922 -0.9934476 0.01980878 -0.3839686
         [,15]    [,16]     [,17]     [,18]     [,19]    [,20]
row5 0.4352086 1.287046 0.9892296 0.2712931 -1.425109 1.048488
> 
> 
> 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: 0x6000037285a0>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM10f7553863617"
 [2] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM10f7510494ad8"
 [3] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM10f753bd0b342"
 [4] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM10f752a8d0bc" 
 [5] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM10f75191fe801"
 [6] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM10f757db8a689"
 [7] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM10f7565bdacda"
 [8] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM10f7579f5065" 
 [9] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM10f756c571acb"
[10] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM10f754aa03cfe"
[11] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM10f755e046df8"
[12] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM10f7574cfe500"
[13] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM10f757cc39ee9"
[14] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM10f75ef612fd" 
[15] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM10f753d58a7b7"
> 
> 
> ### 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: 0x60000372c240>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x60000372c240>
Warning message:
In dir.create(new.directory) :
  '/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x60000372c240>
> rowMedians(tmp)
  [1] -0.478848692 -0.234772328  0.170051888  0.120910072  0.116565762
  [6]  0.277415578 -0.171810855  0.243189883  0.477655581 -0.324914216
 [11] -0.137860460  0.370938254  0.767793547 -0.294490732  0.696480269
 [16]  0.137119952 -0.092337376  0.123032487 -0.305144386  0.385624191
 [21] -0.171762336 -0.397153770  0.347505004  0.634587448  0.189190472
 [26]  0.211325688 -0.137256364  0.024880030  0.272072491  0.062074212
 [31]  0.431631206 -0.593462635 -0.030429629  0.443703509 -0.158038605
 [36]  0.189186871 -0.270835427  0.341973362  0.001268235 -0.357322509
 [41] -0.519333763  0.151026858 -0.169820496 -0.313717487  0.432954755
 [46] -0.562991789  0.008680617 -0.015220355 -0.596519785  0.199522945
 [51] -0.045993169  0.137985927  0.125967230  0.095354319  0.413606717
 [56]  0.374633114 -0.852001332 -0.559453963 -0.017912628 -0.154507538
 [61] -0.094865734  0.143452109 -0.059297101  0.276743136  0.638302771
 [66]  0.201802234 -0.180669716 -0.512180309 -0.249151817  0.342142232
 [71]  0.079187889 -0.172528977  0.078498877  0.068792106  0.123823967
 [76]  0.177775193 -0.233322910 -0.421607553 -0.208932973 -0.443590917
 [81]  0.225803707  0.015496522  0.303476079 -0.064731779  0.071538770
 [86] -0.096115433  0.005846497 -0.055714489  0.119687377 -0.137754950
 [91] -0.034837190  0.225229577  0.018993828 -0.034083724 -0.154719294
 [96]  0.207422758  0.183426113  0.034849034  0.179085215  0.184445859
[101] -0.112249769  0.651190427  0.183728940 -0.068866386  0.641053620
[106]  0.418798981  0.285837025 -0.322849479  0.465462177 -0.056482142
[111] -0.171583384  0.692394659 -0.051534732 -0.263147157  0.393203600
[116]  0.056366447 -0.490130843  0.167683732  0.214639328 -0.383993892
[121]  0.367620246  0.430400395 -0.745579977 -0.621014481  0.327065259
[126] -0.059664746  0.470845122 -0.260866328  0.047571192  0.071659867
[131] -0.035817427  0.109731453 -0.530592621  0.231692760 -0.419429565
[136]  0.563333850  0.307380877 -0.177203679  0.120845422 -0.465634927
[141] -0.067967136  0.425565881  0.182739537  0.384645101  0.001430534
[146] -0.057919788 -0.246958247  0.334938947 -0.274769532  0.188006169
[151] -0.304842687  0.559031247 -0.212207337 -0.046328554 -0.209864942
[156] -0.005196363 -0.078176661  0.240463817 -0.177308227 -0.039535441
[161]  0.476292059 -0.012803482  0.185423896  0.227908428 -0.008271598
[166]  0.120049597 -0.309530397  0.284666075  0.026276424  0.267915790
[171] -0.468285434  0.509119927  0.287842860  0.325402672  0.861665579
[176] -0.115916629  0.004439505 -0.319271329  0.052336129 -0.166580467
[181] -0.689310803 -0.190675566  0.705935590 -0.098984616  0.072917485
[186] -0.016308160  0.260504322  0.061189070 -0.202098497  0.158201509
[191]  0.034918519 -0.206994834  0.112368154  0.675493891 -0.003273225
[196] -0.097952066  0.198424710  0.064574876  0.310107952 -0.071286087
[201]  0.142995116  0.248392548  0.116348204  0.236422289 -0.550979229
[206]  0.247533414 -0.176888066 -0.382534166 -0.121886582  0.037069855
[211]  0.483054316  0.017564089 -0.231837363  0.218012436 -0.105038011
[216] -0.285351321 -0.320010991  0.083010782 -0.403134634 -0.695027146
[221] -0.177897433  0.145345437  0.106171798  0.244274452 -0.200114124
[226] -0.094848406 -0.473933308 -0.204141321 -0.019279800 -0.210977468
> 
> proc.time()
   user  system elapsed 
  0.709   3.665   4.767 

BufferedMatrix.Rcheck/tests/rawCalltesting.Rout


R Under development (unstable) (2025-11-04 r88984) -- "Unsuffered Consequences"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: aarch64-apple-darwin20

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

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

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

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

Attaching package: 'BufferedMatrix'

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

    colMeans, colSums, rowMeans, rowSums

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

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

<pointer: 0x600002eec000>
> .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: 0x600002eec000>
> .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: 0x600002eec000>
> .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: 0x600002eec000>
> 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: 0x600002ed80c0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600002ed80c0>
> .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: 0x600002ed80c0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600002ed80c0>
> .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: 0x600002ed80c0>
> 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: 0x600002ee8120>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600002ee8120>
> .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: 0x600002ee8120>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x600002ee8120>
> .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: 0x600002ee8120>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x600002ee8120>
> .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: 0x600002ee8120>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x600002ee8120>
> .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: 0x600002ee8120>
> 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: 0x600002ec8000>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x600002ec8000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600002ec8000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600002ec8000>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile113b4128fb67c" "BufferedMatrixFile113b421bd4b22"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile113b4128fb67c" "BufferedMatrixFile113b421bd4b22"
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x600002ef0120>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600002ef0120>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x600002ef0120>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x600002ef0120>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x600002ef0120>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x600002ef0120>
> .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: 0x600002ef8000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600002ef8000>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x600002ef8000>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x600002ef8000>
> 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: 0x600002ef8180>
> .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: 0x600002ef8180>
> rm(P)
> 
> proc.time()
   user  system elapsed 
  0.158   0.069   0.222 

BufferedMatrix.Rcheck/tests/Rcodetesting.Rout


R Under development (unstable) (2025-11-04 r88984) -- "Unsuffered Consequences"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: aarch64-apple-darwin20

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

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

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

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

Attaching package: 'BufferedMatrix'

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

    colMeans, colSums, rowMeans, rowSums

> 
> Temp <- createBufferedMatrix(100)
> dim(Temp)
[1] 100   0
> buffer.dim(Temp)
[1] 1 1
> 
> 
> proc.time()
   user  system elapsed 
  0.130   0.033   0.159 

Example timings