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

This page was generated on 2026-01-09 12:02 -0500 (Fri, 09 Jan 2026).

HostnameOSArch (*)R versionInstalled pkgs
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-08 13:40 -0500 (Thu, 08 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)
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-08 18:48:37 -0500 (Thu, 08 Jan 2026)
EndedAt: 2026-01-08 18:48:56 -0500 (Thu, 08 Jan 2026)
EllapsedTime: 19.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.130   0.049   0.177 

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] "Thu Jan  8 18:48:47 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] "Thu Jan  8 18:48:47 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: 0x600001420000>
> 
> 
> 
> 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] "Thu Jan  8 18:48:48 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] "Thu Jan  8 18:48:49 2026"
> 
> ColMode(tmp2)
<pointer: 0x600001420000>
> 
> 
> 
> ### Now testing assignments
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+ 
+   new.data <- rnorm(20)
+   tmp2[which.row,] <- new.data
+   test.matrix[which.row,] <- new.data
+   if (rep > 1){
+     if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+   
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   new.data <- rnorm(10)
+   tmp2[,which.col] <- new.data
+   test.matrix[,which.col]<- new.data
+ 
+   if (rep > 1){
+     if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.col <- which.col
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,5,replace=TRUE)
+   new.data <- matrix(rnorm(50),5,10)
+   tmp2[,which.col] <- new.data
+   test.matrix[,which.col]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.col <- which.col
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   new.data <- matrix(rnorm(50),5,10)
+   tmp2[which.row,] <- new.data
+   test.matrix[which.row,]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col  <- sample(1:20,5,replace=TRUE)
+   new.data <- matrix(rnorm(25),5,5)
+   tmp2[which.row,which.col] <- new.data
+   test.matrix[which.row,which.col]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[prev.row,prev.col] == test.matrix[prev.row,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+   prev.col <- which.col
+ }
> 
> 
> 
> 
> ###
> ###
> ### testing some more functions
> ###
> 
> 
> 
> ## duplication function
> tmp5 <- duplicate(tmp2)
> 
> # making sure really did copy everything.
> tmp5[1,1] <- tmp5[1,1] +100.00
> 
> if (tmp5[1,1] == tmp2[1,1]){
+   stop("Problem with duplication")
+ }
> 
> 
> 
> 
> ### testing elementwise applying of functions
> 
> tmp5[1:4,1:4]
           [,1]       [,2]        [,3]        [,4]
[1,] 99.7865338  0.4636347 -0.26237848  2.09279995
[2,]  0.1322546  2.5493282 -1.62171414  0.34192722
[3,]  0.5672522 -1.1363760 -0.05732304 -0.62114685
[4,]  0.7737923  1.0767872  1.51997427 -0.05681744
> 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 :  1.9  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
           [,1]      [,2]       [,3]       [,4]
[1,] 99.7865338 0.4636347 0.26237848 2.09279995
[2,]  0.1322546 2.5493282 1.62171414 0.34192722
[3,]  0.5672522 1.1363760 0.05732304 0.62114685
[4,]  0.7737923 1.0767872 1.51997427 0.05681744
> 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 :  1.9  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
          [,1]      [,2]      [,3]      [,4]
[1,] 9.9893210 0.6809073 0.5122289 1.4466513
[2,] 0.3636682 1.5966616 1.2734654 0.5847454
[3,] 0.7531615 1.0660094 0.2394223 0.7881287
[4,] 0.8796547 1.0376836 1.2328724 0.2383641
> 
> 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 :  1.9  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
          [,1]     [,2]     [,3]     [,4]
[1,] 224.67974 32.27271 30.38467 41.55931
[2,]  28.76894 43.51594 39.35637 31.18938
[3,]  33.09887 36.79647 27.45155 33.50243
[4,]  34.57034 36.45362 38.84870 27.44046
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x60000142c000>
> exp(tmp5)
<pointer: 0x60000142c000>
> log(tmp5,2)
<pointer: 0x60000142c000>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 467.6414
> Min(tmp5)
[1] 52.72522
> mean(tmp5)
[1] 72.1597
> Sum(tmp5)
[1] 14431.94
> Var(tmp5)
[1] 856.8392
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 93.42911 69.60526 71.71329 70.78299 67.45149 68.10801 69.76931 69.20279
 [9] 70.60957 70.92517
> rowSums(tmp5)
 [1] 1868.582 1392.105 1434.266 1415.660 1349.030 1362.160 1395.386 1384.056
 [9] 1412.191 1418.503
> rowVars(tmp5)
 [1] 7814.19687   83.60543   76.04233   60.53277   74.15797   53.01257
 [7]   56.69376   64.92367   90.74495   55.11560
> rowSd(tmp5)
 [1] 88.397946  9.143601  8.720225  7.780281  8.611502  7.280973  7.529526
 [8]  8.057522  9.526014  7.423988
> rowMax(tmp5)
 [1] 467.64145  90.57274  91.38636  82.54650  87.73226  84.47920  85.07249
 [8]  85.45825  88.12474  80.78173
> rowMin(tmp5)
 [1] 61.67184 57.45664 57.13680 57.11372 52.72522 55.73744 55.29277 55.46226
 [9] 55.29548 57.33567
> 
> colMeans(tmp5)
 [1] 109.30961  73.82200  70.95636  67.86219  71.58325  72.41776  69.01825
 [8]  68.19558  68.75129  70.40221  68.82914  67.89228  69.32281  74.84425
[15]  70.59692  70.38150  69.05907  68.75549  71.33450  69.85956
> colSums(tmp5)
 [1] 1093.0961  738.2200  709.5636  678.6219  715.8325  724.1776  690.1825
 [8]  681.9558  687.5129  704.0221  688.2914  678.9228  693.2281  748.4425
[15]  705.9692  703.8150  690.5907  687.5549  713.3450  698.5956
> colVars(tmp5)
 [1] 15911.22010    67.10685   126.68968   137.26812    86.53906    45.85839
 [7]    95.25941    37.84245    63.85725    52.18062    61.71303    32.02100
[13]    39.96240    70.05180    52.73059    48.99956    49.10463   100.04599
[19]   137.45022    39.96516
> colSd(tmp5)
 [1] 126.139685   8.191877  11.255651  11.716148   9.302637   6.771882
 [7]   9.760093   6.151622   7.991073   7.223616   7.855764   5.658710
[13]   6.321582   8.369695   7.261583   6.999968   7.007470  10.002299
[19]  11.723917   6.321800
> colMax(tmp5)
 [1] 467.64145  90.57274  84.33424  86.50026  90.32856  84.47920  88.12474
 [8]  77.61732  80.09057  79.26888  79.15902  77.82579  77.16504  88.23931
[15]  78.62333  79.19195  79.97012  87.73226  91.38636  83.55152
> colMin(tmp5)
 [1] 59.87877 62.78105 57.13680 52.72522 57.33567 62.38858 55.29277 57.95813
 [9] 58.72289 62.20944 55.73744 61.19584 57.45664 64.62003 59.64909 55.46226
[17] 56.64096 55.29548 56.75564 61.67184
> 
> 
> ### 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] 93.42911 69.60526 71.71329 70.78299       NA 68.10801 69.76931 69.20279
 [9] 70.60957 70.92517
> rowSums(tmp5)
 [1] 1868.582 1392.105 1434.266 1415.660       NA 1362.160 1395.386 1384.056
 [9] 1412.191 1418.503
> rowVars(tmp5)
 [1] 7814.19687   83.60543   76.04233   60.53277   75.91869   53.01257
 [7]   56.69376   64.92367   90.74495   55.11560
> rowSd(tmp5)
 [1] 88.397946  9.143601  8.720225  7.780281  8.713133  7.280973  7.529526
 [8]  8.057522  9.526014  7.423988
> rowMax(tmp5)
 [1] 467.64145  90.57274  91.38636  82.54650        NA  84.47920  85.07249
 [8]  85.45825  88.12474  80.78173
> rowMin(tmp5)
 [1] 61.67184 57.45664 57.13680 57.11372       NA 55.73744 55.29277 55.46226
 [9] 55.29548 57.33567
> 
> colMeans(tmp5)
 [1] 109.30961  73.82200  70.95636  67.86219  71.58325  72.41776  69.01825
 [8]  68.19558  68.75129  70.40221        NA  67.89228  69.32281  74.84425
[15]  70.59692  70.38150  69.05907  68.75549  71.33450  69.85956
> colSums(tmp5)
 [1] 1093.0961  738.2200  709.5636  678.6219  715.8325  724.1776  690.1825
 [8]  681.9558  687.5129  704.0221        NA  678.9228  693.2281  748.4425
[15]  705.9692  703.8150  690.5907  687.5549  713.3450  698.5956
> colVars(tmp5)
 [1] 15911.22010    67.10685   126.68968   137.26812    86.53906    45.85839
 [7]    95.25941    37.84245    63.85725    52.18062          NA    32.02100
[13]    39.96240    70.05180    52.73059    48.99956    49.10463   100.04599
[19]   137.45022    39.96516
> colSd(tmp5)
 [1] 126.139685   8.191877  11.255651  11.716148   9.302637   6.771882
 [7]   9.760093   6.151622   7.991073   7.223616         NA   5.658710
[13]   6.321582   8.369695   7.261583   6.999968   7.007470  10.002299
[19]  11.723917   6.321800
> colMax(tmp5)
 [1] 467.64145  90.57274  84.33424  86.50026  90.32856  84.47920  88.12474
 [8]  77.61732  80.09057  79.26888        NA  77.82579  77.16504  88.23931
[15]  78.62333  79.19195  79.97012  87.73226  91.38636  83.55152
> colMin(tmp5)
 [1] 59.87877 62.78105 57.13680 52.72522 57.33567 62.38858 55.29277 57.95813
 [9] 58.72289 62.20944       NA 61.19584 57.45664 64.62003 59.64909 55.46226
[17] 56.64096 55.29548 56.75564 61.67184
> 
> Max(tmp5,na.rm=TRUE)
[1] 467.6414
> Min(tmp5,na.rm=TRUE)
[1] 52.72522
> mean(tmp5,na.rm=TRUE)
[1] 72.21528
> Sum(tmp5,na.rm=TRUE)
[1] 14370.84
> Var(tmp5,na.rm=TRUE)
[1] 860.5458
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 93.42911 69.60526 71.71329 70.78299 67.78578 68.10801 69.76931 69.20279
 [9] 70.60957 70.92517
> rowSums(tmp5,na.rm=TRUE)
 [1] 1868.582 1392.105 1434.266 1415.660 1287.930 1362.160 1395.386 1384.056
 [9] 1412.191 1418.503
> rowVars(tmp5,na.rm=TRUE)
 [1] 7814.19687   83.60543   76.04233   60.53277   75.91869   53.01257
 [7]   56.69376   64.92367   90.74495   55.11560
> rowSd(tmp5,na.rm=TRUE)
 [1] 88.397946  9.143601  8.720225  7.780281  8.713133  7.280973  7.529526
 [8]  8.057522  9.526014  7.423988
> rowMax(tmp5,na.rm=TRUE)
 [1] 467.64145  90.57274  91.38636  82.54650  87.73226  84.47920  85.07249
 [8]  85.45825  88.12474  80.78173
> rowMin(tmp5,na.rm=TRUE)
 [1] 61.67184 57.45664 57.13680 57.11372 52.72522 55.73744 55.29277 55.46226
 [9] 55.29548 57.33567
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 109.30961  73.82200  70.95636  67.86219  71.58325  72.41776  69.01825
 [8]  68.19558  68.75129  70.40221  69.68793  67.89228  69.32281  74.84425
[15]  70.59692  70.38150  69.05907  68.75549  71.33450  69.85956
> colSums(tmp5,na.rm=TRUE)
 [1] 1093.0961  738.2200  709.5636  678.6219  715.8325  724.1776  690.1825
 [8]  681.9558  687.5129  704.0221  627.1914  678.9228  693.2281  748.4425
[15]  705.9692  703.8150  690.5907  687.5549  713.3450  698.5956
> colVars(tmp5,na.rm=TRUE)
 [1] 15911.22010    67.10685   126.68968   137.26812    86.53906    45.85839
 [7]    95.25941    37.84245    63.85725    52.18062    61.12998    32.02100
[13]    39.96240    70.05180    52.73059    48.99956    49.10463   100.04599
[19]   137.45022    39.96516
> colSd(tmp5,na.rm=TRUE)
 [1] 126.139685   8.191877  11.255651  11.716148   9.302637   6.771882
 [7]   9.760093   6.151622   7.991073   7.223616   7.818566   5.658710
[13]   6.321582   8.369695   7.261583   6.999968   7.007470  10.002299
[19]  11.723917   6.321800
> colMax(tmp5,na.rm=TRUE)
 [1] 467.64145  90.57274  84.33424  86.50026  90.32856  84.47920  88.12474
 [8]  77.61732  80.09057  79.26888  79.15902  77.82579  77.16504  88.23931
[15]  78.62333  79.19195  79.97012  87.73226  91.38636  83.55152
> colMin(tmp5,na.rm=TRUE)
 [1] 59.87877 62.78105 57.13680 52.72522 57.33567 62.38858 55.29277 57.95813
 [9] 58.72289 62.20944 55.73744 61.19584 57.45664 64.62003 59.64909 55.46226
[17] 56.64096 55.29548 56.75564 61.67184
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1] 93.42911 69.60526 71.71329 70.78299      NaN 68.10801 69.76931 69.20279
 [9] 70.60957 70.92517
> rowSums(tmp5,na.rm=TRUE)
 [1] 1868.582 1392.105 1434.266 1415.660    0.000 1362.160 1395.386 1384.056
 [9] 1412.191 1418.503
> rowVars(tmp5,na.rm=TRUE)
 [1] 7814.19687   83.60543   76.04233   60.53277         NA   53.01257
 [7]   56.69376   64.92367   90.74495   55.11560
> rowSd(tmp5,na.rm=TRUE)
 [1] 88.397946  9.143601  8.720225  7.780281        NA  7.280973  7.529526
 [8]  8.057522  9.526014  7.423988
> rowMax(tmp5,na.rm=TRUE)
 [1] 467.64145  90.57274  91.38636  82.54650        NA  84.47920  85.07249
 [8]  85.45825  88.12474  80.78173
> rowMin(tmp5,na.rm=TRUE)
 [1] 61.67184 57.45664 57.13680 57.11372       NA 55.73744 55.29277 55.46226
 [9] 55.29548 57.33567
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1] 114.56974  74.71802  72.29954  69.54407  70.83360  72.22807  69.81989
 [8]  68.47250  69.86555  71.07491       NaN  68.63633  69.72570  75.06466
[15]  69.78015  70.58486  67.84673  66.64696  72.12854  70.12892
> colSums(tmp5,na.rm=TRUE)
 [1] 1031.1276  672.4622  650.6959  625.8966  637.5024  650.0526  628.3790
 [8]  616.2525  628.7900  639.6742    0.0000  617.7270  627.5313  675.5819
[15]  628.0214  635.2637  610.6206  599.8227  649.1569  631.1603
> colVars(tmp5,na.rm=TRUE)
 [1] 17588.84699    66.46296   122.22926   122.60335    91.03426    51.18588
 [7]    99.93732    41.71004    57.87151    53.61234          NA    29.79552
[13]    43.13164    78.26173    51.81696    54.65924    38.70785    62.53540
[19]   147.53828    44.14458
> colSd(tmp5,na.rm=TRUE)
 [1] 132.622950   8.152482  11.055734  11.072640   9.541188   7.154431
 [7]   9.996865   6.458331   7.607333   7.322045         NA   5.458527
[13]   6.567469   8.846566   7.198400   7.393189   6.221563   7.907933
[19]  12.146534   6.644139
> colMax(tmp5,na.rm=TRUE)
 [1] 467.64145  90.57274  84.33424  86.50026  90.32856  84.47920  88.12474
 [8]  77.61732  80.09057  79.26888      -Inf  77.82579  77.16504  88.23931
[15]  78.62333  79.19195  74.42544  78.99298  91.38636  83.55152
> colMin(tmp5,na.rm=TRUE)
 [1] 59.87877 62.78105 57.13680 55.98027 57.33567 62.38858 55.29277 57.95813
 [9] 60.12560 62.20944      Inf 62.62680 57.45664 64.62003 59.64909 55.46226
[17] 56.64096 55.29548 56.75564 61.67184
> 
> 
> 
> 
> 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] 201.6440 310.5522 140.9476 219.1618 285.8434 273.5082 337.5901 147.2076
 [9] 177.2262 331.4028
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 201.6440 310.5522 140.9476 219.1618 285.8434 273.5082 337.5901 147.2076
 [9] 177.2262 331.4028
> 
> 
> 
> copymatrix <- matrix(rnorm(200,150,15),10,20)
> 
> tmp5[1:10,1:20] <- copymatrix
> which.row <- 1
> which.col  <- 3
> cat(which.row," ",which.col,"\n")
1   3 
> tmp5[which.row,which.col] <- NA
> copymatrix[which.row,which.col] <- NA
> 
> colVars(tmp5,na.rm=TRUE)-apply(copymatrix,2,var,na.rm=TRUE)
 [1] -1.421085e-13 -5.684342e-14 -2.842171e-14  5.684342e-14  2.842171e-14
 [6] -4.263256e-14  5.684342e-14 -1.421085e-14  5.684342e-14  0.000000e+00
[11] -1.136868e-13 -1.136868e-13  2.842171e-14  0.000000e+00  1.136868e-13
[16] -2.842171e-14 -2.842171e-14 -5.684342e-14 -3.126388e-13 -8.526513e-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)
+ }
1   9 
8   10 
1   12 
6   10 
4   3 
5   10 
3   2 
6   11 
4   15 
5   14 
4   10 
4   16 
7   10 
9   11 
2   11 
1   3 
6   11 
6   20 
5   8 
2   7 
There were 50 or more warnings (use warnings() to see the first 50)
> 
> 
> ### now test 1 by n and n by 1 matrix
> 
> 
> err.tol <- 1e-12
> 
> rm(tmp5)
> 
> dataset1 <- rnorm(100)
> dataset2 <- rnorm(100)
> 
> tmp <- createBufferedMatrix(1,100)
> tmp[1,] <- dataset1
> 
> tmp2 <- createBufferedMatrix(100,1)
> tmp2[,1] <- dataset2
> 
> 
> 
> 
> 
> Max(tmp)
[1] 2.334767
> Min(tmp)
[1] -2.241751
> mean(tmp)
[1] -0.02453594
> Sum(tmp)
[1] -2.453594
> Var(tmp)
[1] 0.7657904
> 
> rowMeans(tmp)
[1] -0.02453594
> rowSums(tmp)
[1] -2.453594
> rowVars(tmp)
[1] 0.7657904
> rowSd(tmp)
[1] 0.8750945
> rowMax(tmp)
[1] 2.334767
> rowMin(tmp)
[1] -2.241751
> 
> colMeans(tmp)
  [1]  1.355584322 -0.687157002 -0.439291925  0.733711515 -0.362729621
  [6]  0.003476405  0.984249803 -0.775368182  1.225154654  0.158794441
 [11]  0.372577344 -0.721746123 -0.593343106  1.045962160  1.111896793
 [16] -0.673302273  0.024528144  0.566142636  0.273315946  0.180803864
 [21]  1.528649134  2.189619570 -1.211085679  0.374718950 -0.431297788
 [26] -1.084301565 -0.226034792  0.563695421 -0.890778914  0.028884976
 [31]  0.977223400 -0.956517254  1.386443703  0.393836661  0.493034575
 [36]  1.175107973  1.014151441 -0.378362085 -0.980420708  0.598467654
 [41]  0.753669973  1.049721125  1.182355027  0.595929918 -0.419333527
 [46] -1.819612465 -0.205961453 -1.053828766  1.031925212 -0.202071598
 [51]  0.943289683 -0.368085480 -0.576801493 -0.158972489 -0.804631134
 [56] -0.902137212 -0.976506482 -0.181792351  0.756200397 -0.199798306
 [61]  2.334766917 -0.345411193  0.856056571 -0.691653293 -0.813035749
 [66] -0.146657869 -1.097578796 -1.579186675  0.200426089  1.476629284
 [71] -0.691417587  0.054230289  0.175331206 -0.456417864 -0.378618640
 [76]  1.033835000 -2.241750711  0.356722502  0.861557983 -0.170878787
 [81] -0.621401333 -0.638807061 -1.189381770 -0.225821124  0.607196296
 [86]  0.176788944 -1.056552682 -0.757999454 -0.234526835  0.931796761
 [91] -0.227975119 -1.687506725 -0.794058901 -0.383682163 -0.170736049
 [96] -0.900915874 -0.045463126 -1.035548798  0.523666736 -0.251467735
> colSums(tmp)
  [1]  1.355584322 -0.687157002 -0.439291925  0.733711515 -0.362729621
  [6]  0.003476405  0.984249803 -0.775368182  1.225154654  0.158794441
 [11]  0.372577344 -0.721746123 -0.593343106  1.045962160  1.111896793
 [16] -0.673302273  0.024528144  0.566142636  0.273315946  0.180803864
 [21]  1.528649134  2.189619570 -1.211085679  0.374718950 -0.431297788
 [26] -1.084301565 -0.226034792  0.563695421 -0.890778914  0.028884976
 [31]  0.977223400 -0.956517254  1.386443703  0.393836661  0.493034575
 [36]  1.175107973  1.014151441 -0.378362085 -0.980420708  0.598467654
 [41]  0.753669973  1.049721125  1.182355027  0.595929918 -0.419333527
 [46] -1.819612465 -0.205961453 -1.053828766  1.031925212 -0.202071598
 [51]  0.943289683 -0.368085480 -0.576801493 -0.158972489 -0.804631134
 [56] -0.902137212 -0.976506482 -0.181792351  0.756200397 -0.199798306
 [61]  2.334766917 -0.345411193  0.856056571 -0.691653293 -0.813035749
 [66] -0.146657869 -1.097578796 -1.579186675  0.200426089  1.476629284
 [71] -0.691417587  0.054230289  0.175331206 -0.456417864 -0.378618640
 [76]  1.033835000 -2.241750711  0.356722502  0.861557983 -0.170878787
 [81] -0.621401333 -0.638807061 -1.189381770 -0.225821124  0.607196296
 [86]  0.176788944 -1.056552682 -0.757999454 -0.234526835  0.931796761
 [91] -0.227975119 -1.687506725 -0.794058901 -0.383682163 -0.170736049
 [96] -0.900915874 -0.045463126 -1.035548798  0.523666736 -0.251467735
> colVars(tmp)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> colSd(tmp)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> colMax(tmp)
  [1]  1.355584322 -0.687157002 -0.439291925  0.733711515 -0.362729621
  [6]  0.003476405  0.984249803 -0.775368182  1.225154654  0.158794441
 [11]  0.372577344 -0.721746123 -0.593343106  1.045962160  1.111896793
 [16] -0.673302273  0.024528144  0.566142636  0.273315946  0.180803864
 [21]  1.528649134  2.189619570 -1.211085679  0.374718950 -0.431297788
 [26] -1.084301565 -0.226034792  0.563695421 -0.890778914  0.028884976
 [31]  0.977223400 -0.956517254  1.386443703  0.393836661  0.493034575
 [36]  1.175107973  1.014151441 -0.378362085 -0.980420708  0.598467654
 [41]  0.753669973  1.049721125  1.182355027  0.595929918 -0.419333527
 [46] -1.819612465 -0.205961453 -1.053828766  1.031925212 -0.202071598
 [51]  0.943289683 -0.368085480 -0.576801493 -0.158972489 -0.804631134
 [56] -0.902137212 -0.976506482 -0.181792351  0.756200397 -0.199798306
 [61]  2.334766917 -0.345411193  0.856056571 -0.691653293 -0.813035749
 [66] -0.146657869 -1.097578796 -1.579186675  0.200426089  1.476629284
 [71] -0.691417587  0.054230289  0.175331206 -0.456417864 -0.378618640
 [76]  1.033835000 -2.241750711  0.356722502  0.861557983 -0.170878787
 [81] -0.621401333 -0.638807061 -1.189381770 -0.225821124  0.607196296
 [86]  0.176788944 -1.056552682 -0.757999454 -0.234526835  0.931796761
 [91] -0.227975119 -1.687506725 -0.794058901 -0.383682163 -0.170736049
 [96] -0.900915874 -0.045463126 -1.035548798  0.523666736 -0.251467735
> colMin(tmp)
  [1]  1.355584322 -0.687157002 -0.439291925  0.733711515 -0.362729621
  [6]  0.003476405  0.984249803 -0.775368182  1.225154654  0.158794441
 [11]  0.372577344 -0.721746123 -0.593343106  1.045962160  1.111896793
 [16] -0.673302273  0.024528144  0.566142636  0.273315946  0.180803864
 [21]  1.528649134  2.189619570 -1.211085679  0.374718950 -0.431297788
 [26] -1.084301565 -0.226034792  0.563695421 -0.890778914  0.028884976
 [31]  0.977223400 -0.956517254  1.386443703  0.393836661  0.493034575
 [36]  1.175107973  1.014151441 -0.378362085 -0.980420708  0.598467654
 [41]  0.753669973  1.049721125  1.182355027  0.595929918 -0.419333527
 [46] -1.819612465 -0.205961453 -1.053828766  1.031925212 -0.202071598
 [51]  0.943289683 -0.368085480 -0.576801493 -0.158972489 -0.804631134
 [56] -0.902137212 -0.976506482 -0.181792351  0.756200397 -0.199798306
 [61]  2.334766917 -0.345411193  0.856056571 -0.691653293 -0.813035749
 [66] -0.146657869 -1.097578796 -1.579186675  0.200426089  1.476629284
 [71] -0.691417587  0.054230289  0.175331206 -0.456417864 -0.378618640
 [76]  1.033835000 -2.241750711  0.356722502  0.861557983 -0.170878787
 [81] -0.621401333 -0.638807061 -1.189381770 -0.225821124  0.607196296
 [86]  0.176788944 -1.056552682 -0.757999454 -0.234526835  0.931796761
 [91] -0.227975119 -1.687506725 -0.794058901 -0.383682163 -0.170736049
 [96] -0.900915874 -0.045463126 -1.035548798  0.523666736 -0.251467735
> colMedians(tmp)
  [1]  1.355584322 -0.687157002 -0.439291925  0.733711515 -0.362729621
  [6]  0.003476405  0.984249803 -0.775368182  1.225154654  0.158794441
 [11]  0.372577344 -0.721746123 -0.593343106  1.045962160  1.111896793
 [16] -0.673302273  0.024528144  0.566142636  0.273315946  0.180803864
 [21]  1.528649134  2.189619570 -1.211085679  0.374718950 -0.431297788
 [26] -1.084301565 -0.226034792  0.563695421 -0.890778914  0.028884976
 [31]  0.977223400 -0.956517254  1.386443703  0.393836661  0.493034575
 [36]  1.175107973  1.014151441 -0.378362085 -0.980420708  0.598467654
 [41]  0.753669973  1.049721125  1.182355027  0.595929918 -0.419333527
 [46] -1.819612465 -0.205961453 -1.053828766  1.031925212 -0.202071598
 [51]  0.943289683 -0.368085480 -0.576801493 -0.158972489 -0.804631134
 [56] -0.902137212 -0.976506482 -0.181792351  0.756200397 -0.199798306
 [61]  2.334766917 -0.345411193  0.856056571 -0.691653293 -0.813035749
 [66] -0.146657869 -1.097578796 -1.579186675  0.200426089  1.476629284
 [71] -0.691417587  0.054230289  0.175331206 -0.456417864 -0.378618640
 [76]  1.033835000 -2.241750711  0.356722502  0.861557983 -0.170878787
 [81] -0.621401333 -0.638807061 -1.189381770 -0.225821124  0.607196296
 [86]  0.176788944 -1.056552682 -0.757999454 -0.234526835  0.931796761
 [91] -0.227975119 -1.687506725 -0.794058901 -0.383682163 -0.170736049
 [96] -0.900915874 -0.045463126 -1.035548798  0.523666736 -0.251467735
> colRanges(tmp)
         [,1]      [,2]       [,3]      [,4]       [,5]        [,6]      [,7]
[1,] 1.355584 -0.687157 -0.4392919 0.7337115 -0.3627296 0.003476405 0.9842498
[2,] 1.355584 -0.687157 -0.4392919 0.7337115 -0.3627296 0.003476405 0.9842498
           [,8]     [,9]     [,10]     [,11]      [,12]      [,13]    [,14]
[1,] -0.7753682 1.225155 0.1587944 0.3725773 -0.7217461 -0.5933431 1.045962
[2,] -0.7753682 1.225155 0.1587944 0.3725773 -0.7217461 -0.5933431 1.045962
        [,15]      [,16]      [,17]     [,18]     [,19]     [,20]    [,21]
[1,] 1.111897 -0.6733023 0.02452814 0.5661426 0.2733159 0.1808039 1.528649
[2,] 1.111897 -0.6733023 0.02452814 0.5661426 0.2733159 0.1808039 1.528649
       [,22]     [,23]    [,24]      [,25]     [,26]      [,27]     [,28]
[1,] 2.18962 -1.211086 0.374719 -0.4312978 -1.084302 -0.2260348 0.5636954
[2,] 2.18962 -1.211086 0.374719 -0.4312978 -1.084302 -0.2260348 0.5636954
          [,29]      [,30]     [,31]      [,32]    [,33]     [,34]     [,35]
[1,] -0.8907789 0.02888498 0.9772234 -0.9565173 1.386444 0.3938367 0.4930346
[2,] -0.8907789 0.02888498 0.9772234 -0.9565173 1.386444 0.3938367 0.4930346
        [,36]    [,37]      [,38]      [,39]     [,40]   [,41]    [,42]
[1,] 1.175108 1.014151 -0.3783621 -0.9804207 0.5984677 0.75367 1.049721
[2,] 1.175108 1.014151 -0.3783621 -0.9804207 0.5984677 0.75367 1.049721
        [,43]     [,44]      [,45]     [,46]      [,47]     [,48]    [,49]
[1,] 1.182355 0.5959299 -0.4193335 -1.819612 -0.2059615 -1.053829 1.031925
[2,] 1.182355 0.5959299 -0.4193335 -1.819612 -0.2059615 -1.053829 1.031925
          [,50]     [,51]      [,52]      [,53]      [,54]      [,55]
[1,] -0.2020716 0.9432897 -0.3680855 -0.5768015 -0.1589725 -0.8046311
[2,] -0.2020716 0.9432897 -0.3680855 -0.5768015 -0.1589725 -0.8046311
          [,56]      [,57]      [,58]     [,59]      [,60]    [,61]      [,62]
[1,] -0.9021372 -0.9765065 -0.1817924 0.7562004 -0.1997983 2.334767 -0.3454112
[2,] -0.9021372 -0.9765065 -0.1817924 0.7562004 -0.1997983 2.334767 -0.3454112
         [,63]      [,64]      [,65]      [,66]     [,67]     [,68]     [,69]
[1,] 0.8560566 -0.6916533 -0.8130357 -0.1466579 -1.097579 -1.579187 0.2004261
[2,] 0.8560566 -0.6916533 -0.8130357 -0.1466579 -1.097579 -1.579187 0.2004261
        [,70]      [,71]      [,72]     [,73]      [,74]      [,75]    [,76]
[1,] 1.476629 -0.6914176 0.05423029 0.1753312 -0.4564179 -0.3786186 1.033835
[2,] 1.476629 -0.6914176 0.05423029 0.1753312 -0.4564179 -0.3786186 1.033835
         [,77]     [,78]    [,79]      [,80]      [,81]      [,82]     [,83]
[1,] -2.241751 0.3567225 0.861558 -0.1708788 -0.6214013 -0.6388071 -1.189382
[2,] -2.241751 0.3567225 0.861558 -0.1708788 -0.6214013 -0.6388071 -1.189382
          [,84]     [,85]     [,86]     [,87]      [,88]      [,89]     [,90]
[1,] -0.2258211 0.6071963 0.1767889 -1.056553 -0.7579995 -0.2345268 0.9317968
[2,] -0.2258211 0.6071963 0.1767889 -1.056553 -0.7579995 -0.2345268 0.9317968
          [,91]     [,92]      [,93]      [,94]     [,95]      [,96]
[1,] -0.2279751 -1.687507 -0.7940589 -0.3836822 -0.170736 -0.9009159
[2,] -0.2279751 -1.687507 -0.7940589 -0.3836822 -0.170736 -0.9009159
           [,97]     [,98]     [,99]     [,100]
[1,] -0.04546313 -1.035549 0.5236667 -0.2514677
[2,] -0.04546313 -1.035549 0.5236667 -0.2514677
> 
> 
> Max(tmp2)
[1] 1.99001
> Min(tmp2)
[1] -2.370812
> mean(tmp2)
[1] -0.1360568
> Sum(tmp2)
[1] -13.60568
> Var(tmp2)
[1] 0.813039
> 
> rowMeans(tmp2)
  [1] -1.323370050  1.321358513 -0.256741741 -0.487569265 -0.515470360
  [6] -0.174660501 -1.834973351 -0.132276110 -1.368018961 -0.253200743
 [11] -0.422150272 -0.685563874  1.061546893 -0.857315844 -0.146936992
 [16]  0.122878218  1.123013794  1.211500566 -0.782977211 -0.377287063
 [21]  0.422093296 -0.426380599 -1.029033157 -0.689449545  0.496626069
 [26] -0.599643658 -1.108060192  1.480830424  1.023250032 -2.370812200
 [31]  0.716250555 -0.350456116 -1.298459290 -0.250672256  0.543372618
 [36]  1.177304845 -0.171980418  0.417142025 -2.103008307  0.124288799
 [41]  0.599411164  0.791480901  1.255277861 -1.464418507 -0.477662613
 [46] -0.838964859 -0.013108667 -0.580155383 -0.492246614  0.039517716
 [51] -0.048232557  0.321426515  0.317517941 -0.875107977  1.531174770
 [56] -1.786918215 -0.649511147  0.823538589  0.416013645 -0.560548484
 [61] -0.527363410  0.033659117  0.634097574  0.017885676  1.990010461
 [66] -0.092782576 -0.892830012  0.267263503 -0.191833476 -1.042607263
 [71]  1.361137974 -2.031120059  1.518775934 -0.162385360 -0.457318239
 [76]  0.979559676 -0.363406371 -0.291510919 -0.131205530 -0.078509634
 [81]  1.173200628  0.226910036 -1.836295195 -0.806145902 -0.022904294
 [86] -0.005267981 -0.170522518  0.460952276  0.555532353 -0.658879990
 [91] -2.103485777 -0.517702224 -1.129207833  0.749663525  0.173390646
 [96]  0.823575483  0.468340229 -0.896009638 -0.405823785  0.242014247
> rowSums(tmp2)
  [1] -1.323370050  1.321358513 -0.256741741 -0.487569265 -0.515470360
  [6] -0.174660501 -1.834973351 -0.132276110 -1.368018961 -0.253200743
 [11] -0.422150272 -0.685563874  1.061546893 -0.857315844 -0.146936992
 [16]  0.122878218  1.123013794  1.211500566 -0.782977211 -0.377287063
 [21]  0.422093296 -0.426380599 -1.029033157 -0.689449545  0.496626069
 [26] -0.599643658 -1.108060192  1.480830424  1.023250032 -2.370812200
 [31]  0.716250555 -0.350456116 -1.298459290 -0.250672256  0.543372618
 [36]  1.177304845 -0.171980418  0.417142025 -2.103008307  0.124288799
 [41]  0.599411164  0.791480901  1.255277861 -1.464418507 -0.477662613
 [46] -0.838964859 -0.013108667 -0.580155383 -0.492246614  0.039517716
 [51] -0.048232557  0.321426515  0.317517941 -0.875107977  1.531174770
 [56] -1.786918215 -0.649511147  0.823538589  0.416013645 -0.560548484
 [61] -0.527363410  0.033659117  0.634097574  0.017885676  1.990010461
 [66] -0.092782576 -0.892830012  0.267263503 -0.191833476 -1.042607263
 [71]  1.361137974 -2.031120059  1.518775934 -0.162385360 -0.457318239
 [76]  0.979559676 -0.363406371 -0.291510919 -0.131205530 -0.078509634
 [81]  1.173200628  0.226910036 -1.836295195 -0.806145902 -0.022904294
 [86] -0.005267981 -0.170522518  0.460952276  0.555532353 -0.658879990
 [91] -2.103485777 -0.517702224 -1.129207833  0.749663525  0.173390646
 [96]  0.823575483  0.468340229 -0.896009638 -0.405823785  0.242014247
> rowVars(tmp2)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowSd(tmp2)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowMax(tmp2)
  [1] -1.323370050  1.321358513 -0.256741741 -0.487569265 -0.515470360
  [6] -0.174660501 -1.834973351 -0.132276110 -1.368018961 -0.253200743
 [11] -0.422150272 -0.685563874  1.061546893 -0.857315844 -0.146936992
 [16]  0.122878218  1.123013794  1.211500566 -0.782977211 -0.377287063
 [21]  0.422093296 -0.426380599 -1.029033157 -0.689449545  0.496626069
 [26] -0.599643658 -1.108060192  1.480830424  1.023250032 -2.370812200
 [31]  0.716250555 -0.350456116 -1.298459290 -0.250672256  0.543372618
 [36]  1.177304845 -0.171980418  0.417142025 -2.103008307  0.124288799
 [41]  0.599411164  0.791480901  1.255277861 -1.464418507 -0.477662613
 [46] -0.838964859 -0.013108667 -0.580155383 -0.492246614  0.039517716
 [51] -0.048232557  0.321426515  0.317517941 -0.875107977  1.531174770
 [56] -1.786918215 -0.649511147  0.823538589  0.416013645 -0.560548484
 [61] -0.527363410  0.033659117  0.634097574  0.017885676  1.990010461
 [66] -0.092782576 -0.892830012  0.267263503 -0.191833476 -1.042607263
 [71]  1.361137974 -2.031120059  1.518775934 -0.162385360 -0.457318239
 [76]  0.979559676 -0.363406371 -0.291510919 -0.131205530 -0.078509634
 [81]  1.173200628  0.226910036 -1.836295195 -0.806145902 -0.022904294
 [86] -0.005267981 -0.170522518  0.460952276  0.555532353 -0.658879990
 [91] -2.103485777 -0.517702224 -1.129207833  0.749663525  0.173390646
 [96]  0.823575483  0.468340229 -0.896009638 -0.405823785  0.242014247
> rowMin(tmp2)
  [1] -1.323370050  1.321358513 -0.256741741 -0.487569265 -0.515470360
  [6] -0.174660501 -1.834973351 -0.132276110 -1.368018961 -0.253200743
 [11] -0.422150272 -0.685563874  1.061546893 -0.857315844 -0.146936992
 [16]  0.122878218  1.123013794  1.211500566 -0.782977211 -0.377287063
 [21]  0.422093296 -0.426380599 -1.029033157 -0.689449545  0.496626069
 [26] -0.599643658 -1.108060192  1.480830424  1.023250032 -2.370812200
 [31]  0.716250555 -0.350456116 -1.298459290 -0.250672256  0.543372618
 [36]  1.177304845 -0.171980418  0.417142025 -2.103008307  0.124288799
 [41]  0.599411164  0.791480901  1.255277861 -1.464418507 -0.477662613
 [46] -0.838964859 -0.013108667 -0.580155383 -0.492246614  0.039517716
 [51] -0.048232557  0.321426515  0.317517941 -0.875107977  1.531174770
 [56] -1.786918215 -0.649511147  0.823538589  0.416013645 -0.560548484
 [61] -0.527363410  0.033659117  0.634097574  0.017885676  1.990010461
 [66] -0.092782576 -0.892830012  0.267263503 -0.191833476 -1.042607263
 [71]  1.361137974 -2.031120059  1.518775934 -0.162385360 -0.457318239
 [76]  0.979559676 -0.363406371 -0.291510919 -0.131205530 -0.078509634
 [81]  1.173200628  0.226910036 -1.836295195 -0.806145902 -0.022904294
 [86] -0.005267981 -0.170522518  0.460952276  0.555532353 -0.658879990
 [91] -2.103485777 -0.517702224 -1.129207833  0.749663525  0.173390646
 [96]  0.823575483  0.468340229 -0.896009638 -0.405823785  0.242014247
> 
> colMeans(tmp2)
[1] -0.1360568
> colSums(tmp2)
[1] -13.60568
> colVars(tmp2)
[1] 0.813039
> colSd(tmp2)
[1] 0.9016868
> colMax(tmp2)
[1] 1.99001
> colMin(tmp2)
[1] -2.370812
> colMedians(tmp2)
[1] -0.1664539
> colRanges(tmp2)
          [,1]
[1,] -2.370812
[2,]  1.990010
> 
> dataset1 <- matrix(dataset1,1,100)
> 
> agree.checks(tmp,dataset1)
> 
> dataset2 <- matrix(dataset2,100,1)
> agree.checks(tmp2,dataset2)
>   
> 
> tmp <- createBufferedMatrix(10,10)
> 
> tmp[1:10,1:10] <- rnorm(100)
> colApply(tmp,sum)
 [1]  2.4824907  0.9564132 -2.3398187 -3.9497853  4.4501987  7.5872425
 [7] -4.4627843 -0.5844514  2.1459182 -4.0201930
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -1.5081416
[2,] -0.2569502
[3,]  0.3547767
[4,]  1.0068761
[5,]  1.6146158
> 
> rowApply(tmp,sum)
 [1]  0.94294934  4.77873123  6.26779431 -4.63302623  0.02549026 -3.37423671
 [7] -4.49400529 -0.63370037  1.20053238  2.18470170
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]   10    8    1    9   10    6   10    3    6     3
 [2,]    5   10    3    8    8    1    3    7    2     9
 [3,]    7    4    2    2    4    2    5    6    1    10
 [4,]    9    3    8    3    1    4    2    4    5     4
 [5,]    4    5    9    6    5    7    4    9    8     8
 [6,]    6    7    5   10    2    9    9   10   10     5
 [7,]    8    2    4    7    6    5    1    1    7     1
 [8,]    2    9    7    4    7   10    8    2    3     2
 [9,]    1    6   10    5    3    8    7    5    9     6
[10,]    3    1    6    1    9    3    6    8    4     7
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1] -0.9498288  3.2653678 -0.3272908  0.8061995 -0.4296121 -1.3278218
 [7]  1.6144639 -1.7125389  0.7361433  1.5575935 -0.4297111 -2.9141237
[13] -1.5662703 -1.6002953  3.2406383  2.5724151 -0.3522928  1.9048037
[19] -1.3246691  0.8619650
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -1.6632912
[2,] -1.2373013
[3,]  0.0967000
[4,]  0.6416265
[5,]  1.2124372
> 
> rowApply(tmp,sum)
[1] -0.6202974 -3.4433802  2.2475427  4.5039168  0.9373535
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]    2    2   17    8   18
[2,]   12   17   19   20    3
[3,]   19    4    7   10    1
[4,]   14   15    3   18   11
[5,]    5    6    2    6   20
> 
> 
> as.matrix(tmp)
           [,1]       [,2]       [,3]        [,4]       [,5]        [,6]
[1,] -1.6632912 -0.1787507  1.3576957  0.08814136 -0.5147992 -0.25883951
[2,] -1.2373013  0.6452158 -0.8417083  0.26033760 -0.4704354  0.06072604
[3,]  0.6416265  1.5646149 -0.1722607 -1.02128105 -1.2354348 -0.16450387
[4,]  0.0967000  2.0181721  0.3458409  1.49671079 -0.1717608 -1.55312272
[5,]  1.2124372 -0.7838844 -1.0168584 -0.01770923  1.9628180  0.58791831
           [,7]       [,8]       [,9]      [,10]      [,11]      [,12]
[1,]  0.8141512 -0.7499019  2.6388874 -0.3184624  0.7169244 -0.5473461
[2,]  0.4031453 -0.9332348 -2.0290133  0.9306631 -0.3514036 -0.2891275
[3,]  0.1803742 -0.1261986  0.2295348 -0.2291163  0.4717651 -0.0532254
[4,] -1.4665320 -0.7463328  0.5785415  0.4190588 -0.6080847 -1.5257922
[5,]  1.6833251  0.8431292 -0.6818072  0.7554503 -0.6589122 -0.4986325
          [,13]      [,14]      [,15]      [,16]        [,17]       [,18]
[1,] -0.3157553 -1.7207392  0.8348293 0.39884007 -0.008991318 -0.41174518
[2,]  0.1509755  1.0397358 -0.4401422 0.93628255 -0.508277272 -0.30275120
[3,] -1.6894165 -0.4476811  2.3396960 0.53886642  0.443978485  1.01658606
[4,]  0.5446181  0.4036806  0.8519946 0.61516431  0.308299702  1.58793907
[5,] -0.2566921 -0.8752913 -0.3457394 0.08326179 -0.587302439  0.01477495
            [,19]       [,20]
[1,] -0.396313542 -0.38483138
[2,] -0.375876510 -0.09119054
[3,]  0.176819628 -0.21720098
[4,] -0.003555998  1.31237740
[5,] -0.725742728  0.24281054
> 
> 
> 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 :  650  bytes.
Disk usage :  200  bytes.
> subBufferedMatrix(tmp,,5:8)
BufferedMatrix object
Matrix size:  5 4 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  563  bytes.
Disk usage :  160  bytes.
> subBufferedMatrix(tmp,1:3,)
BufferedMatrix object
Matrix size:  3 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.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.8229786 -0.8866901 -0.04987604 -1.048025 -0.6938521 0.8543555 1.141337
           col8       col9      col10      col11      col12     col13     col14
row1 -0.2609733 -0.1870449 0.08910216 -0.6122559 -0.8074954 0.4388133 0.8763381
          col15      col16     col17      col18      col19     col20
row1 -0.7640392 -0.4533146 -1.527159 -0.2533631 -0.0673086 -1.058936
> tmp[,"col10"]
           col10
row1  0.08910216
row2 -2.62957321
row3  0.47525506
row4 -0.52483979
row5  0.04774129
> tmp[c("row1","row5"),]
          col1       col2        col3       col4       col5      col6
row1 0.8229786 -0.8866901 -0.04987604 -1.0480250 -0.6938521 0.8543555
row5 0.8856914  0.5958636 -0.36325991 -0.4471436  0.3553685 0.5190596
            col7       col8       col9      col10      col11      col12
row1  1.14133707 -0.2609733 -0.1870449 0.08910216 -0.6122559 -0.8074954
row5 -0.02641452 -1.2222916  0.9670378 0.04774129  0.9235597 -1.1987215
          col13      col14       col15      col16      col17       col18
row1  0.4388133  0.8763381 -0.76403923 -0.4533146 -1.5271585 -0.25336307
row5 -1.2644492 -0.2177114  0.07093184 -0.8642855 -0.7648874 -0.02112335
          col19      col20
row1 -0.0673086 -1.0589359
row5  0.6841544 -0.3949849
> tmp[,c("col6","col20")]
            col6      col20
row1  0.85435552 -1.0589359
row2 -0.04208889  0.6230288
row3  0.57834075 -0.5924426
row4  3.21537111  0.3707809
row5  0.51905961 -0.3949849
> tmp[c("row1","row5"),c("col6","col20")]
          col6      col20
row1 0.8543555 -1.0589359
row5 0.5190596 -0.3949849
> 
> 
> 
> 
> 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 51.38534 49.14269 50.85595 49.34338 51.30834 104.9942 50.82585 50.01968
         col9    col10  col11    col12    col13    col14    col15    col16
row1 49.93172 48.54384 49.922 50.84156 48.24319 49.65106 47.57998 50.84393
        col17    col18    col19    col20
row1 49.26622 51.48802 49.92749 104.0463
> tmp[,"col10"]
        col10
row1 48.54384
row2 30.50610
row3 28.86308
row4 32.50258
row5 50.57616
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 51.38534 49.14269 50.85595 49.34338 51.30834 104.9942 50.82585 50.01968
row5 48.64267 50.22978 49.88195 50.49354 50.00609 104.8258 50.65969 49.62850
         col9    col10    col11    col12    col13    col14    col15    col16
row1 49.93172 48.54384 49.92200 50.84156 48.24319 49.65106 47.57998 50.84393
row5 49.18654 50.57616 50.59949 48.92824 51.20428 48.83891 49.58199 49.10645
        col17    col18    col19    col20
row1 49.26622 51.48802 49.92749 104.0463
row5 50.01811 51.22296 49.72932 105.0106
> tmp[,c("col6","col20")]
          col6     col20
row1 104.99421 104.04629
row2  74.11762  75.74948
row3  74.72406  74.78713
row4  76.07575  76.49499
row5 104.82580 105.01064
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 104.9942 104.0463
row5 104.8258 105.0106
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 104.9942 104.0463
row5 104.8258 105.0106
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
          col13
[1,]  0.8597041
[2,]  0.7915926
[3,] -1.0986565
[4,] -0.7253784
[5,] -0.3603486
> tmp[,c("col17","col7")]
           col17        col7
[1,] -0.68033992 -0.01635449
[2,] -0.16312465 -0.64088142
[3,]  0.53906723  0.92942057
[4,] -0.07782248 -0.84520339
[5,] -0.18375374 -0.81734495
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
           col6      col20
[1,]  2.2025419  1.0392848
[2,] -1.2699121  0.1009948
[3,]  0.5814413 -2.5828272
[4,] -0.5159423 -0.1742154
[5,] -0.9921232  1.1396406
> subBufferedMatrix(tmp,1,c("col6"))[,1]
         col1
[1,] 2.202542
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
          col6
[1,]  2.202542
[2,] -1.269912
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> 
> 
> 
> subBufferedMatrix(tmp,c("row3","row1"),)[,1:20]
           [,1]      [,2]       [,3]        [,4]        [,5]       [,6]
row3  0.7767862  1.335366  0.4509999 0.407399831 -0.07538404 -0.7554368
row1 -0.9804347 -1.088959 -1.3415672 0.003738836 -0.15997826 -0.9366665
           [,7]      [,8]        [,9]      [,10]      [,11]      [,12]
row3  1.1919538 0.1567355  0.68525077  1.5963505  0.6796882 -0.1657728
row1 -0.4073118 0.5579092 -0.04513128 -0.4869133 -0.9849840 -0.6586839
          [,13]      [,14]      [,15]     [,16]      [,17]    [,18]     [,19]
row3 -0.3660121  0.2219888  1.6188392 0.6204355 -0.2769323 -1.42983 -1.111905
row1  0.3975595 -0.3108849 -0.8594769 0.3453945 -0.7831019  1.25018  1.096715
         [,20]
row3 1.3248760
row1 0.1433351
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
          [,1]      [,2]      [,3]      [,4]       [,5]      [,6]     [,7]
row2 0.8079009 0.6703028 0.6149054 -1.246044 0.06034215 -1.158875 1.191001
          [,8]      [,9]    [,10]
row2 0.2309748 0.8886136 1.388592
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
          [,1]       [,2]      [,3]      [,4]       [,5]       [,6]     [,7]
row5 0.5114283 -0.7360155 0.6524234 0.3344001 -0.9757098 -0.2190772 1.226969
           [,8]     [,9]      [,10]     [,11]   [,12]      [,13]     [,14]
row5 -0.6699799 0.749316 0.02944932 0.1777917 -0.4375 -0.2718026 0.6757674
           [,15]     [,16]     [,17]   [,18]    [,19]  [,20]
row5 0.007112609 0.3304929 -2.163362 -1.1827 1.391986 1.3628
> 
> 
> 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: 0x60000140c660>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM80132d2bccb2"
 [2] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM8013168bd149"
 [3] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM801335591b2f"
 [4] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM80136d07c605"
 [5] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM80131959aa2f"
 [6] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM80134db400a9"
 [7] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM801364977f19"
 [8] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM8013161975e7"
 [9] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM8013618b9c06"
[10] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM801314b07ff2"
[11] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM80134f9ff37a"
[12] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM8013e29f76d" 
[13] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM801365331c5e"
[14] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM80137e8b9339"
[15] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM80137d6ec416"
> 
> 
> ### 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: 0x60000140c960>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x60000140c960>
Warning message:
In dir.create(new.directory) :
  '/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x60000140c960>
> rowMedians(tmp)
  [1] -2.018462e-01  1.153339e-01 -2.693358e-01 -4.941953e-01 -3.975085e-01
  [6] -8.109103e-03 -2.752711e-01 -2.592829e-01  6.918379e-02  3.160913e-01
 [11] -9.649463e-02  7.286765e-02  1.363905e-01  6.505602e-02 -3.725754e-01
 [16] -1.938094e-01  3.113677e-01 -6.079768e-01 -3.193614e-03 -5.510757e-01
 [21]  5.742280e-01  5.747343e-01 -1.006989e-02 -2.222286e-01 -3.440971e-02
 [26]  6.479844e-01 -3.217029e-01 -4.804824e-02  2.485914e-01  7.847697e-02
 [31] -3.452659e-01 -2.679197e-01  3.737382e-01  4.616285e-01  4.798990e-03
 [36]  1.802947e-01  2.473394e-01 -2.324985e-01  6.234420e-02  1.044626e+00
 [41]  6.361273e-01 -2.896541e-01 -1.819348e-01  3.564079e-01 -3.451564e-01
 [46]  2.863807e-01 -2.402918e-01  4.659111e-01  1.159004e-01 -3.453526e-01
 [51] -2.372923e-01  5.181750e-01  1.212958e-01  1.406948e-01 -1.989632e-01
 [56]  3.842651e-02  3.987800e-01  9.100393e-02  1.973023e-01 -1.826186e-01
 [61]  8.612637e-02  2.003403e-01  5.681557e-01  6.764668e-02  7.039183e-01
 [66] -4.112277e-02 -2.512260e-01 -6.043665e-02 -3.781124e-01  3.832823e-02
 [71] -2.577540e-01 -3.933477e-01  2.996209e-01 -1.446766e-01 -4.148516e-01
 [76] -1.431351e-01  1.821387e-01  2.262335e-01  1.924835e-01  1.207794e-01
 [81] -2.079169e-01  2.755083e-01 -2.908944e-02  2.111650e-01  3.453770e-01
 [86] -9.557067e-02  6.358757e-02  4.569530e-01 -5.460087e-01 -5.086650e-01
 [91] -2.722651e-01 -5.216636e-01  1.016369e-01 -1.124385e-01  5.863497e-02
 [96]  2.412146e-01 -3.700488e-01 -6.975139e-01  3.688826e-01 -4.830497e-02
[101]  2.079522e-01 -1.786045e-01 -3.779011e-01  5.309570e-01 -4.793872e-01
[106]  1.978003e-01  1.757004e-02  1.822947e-01  2.742092e-01 -5.122400e-01
[111] -1.548413e-01 -8.693874e-02  8.904034e-03 -1.916609e-01  8.566481e-01
[116]  1.054120e-01 -4.724903e-01 -3.199360e-01  4.248885e-01  4.240182e-01
[121]  4.595794e-01  1.212746e-01 -5.960202e-01  2.160907e-01 -2.965880e-01
[126]  3.614766e-01 -5.222715e-01 -2.314885e-01 -9.539561e-02  3.421251e-01
[131] -2.190387e-01 -1.389741e-01  6.153036e-02 -1.379141e-01 -2.212421e-01
[136]  3.603823e-01  2.174493e-01 -3.501723e-01  1.092888e-01 -4.193615e-01
[141] -7.456687e-02 -5.343890e-01 -2.870735e-01  2.551771e-01  1.402326e-01
[146]  4.637365e-01  5.158824e-01 -2.179792e-01 -4.728759e-01  4.503693e-01
[151] -1.782427e-02  1.164520e-01 -4.020458e-01  2.434408e-01 -9.213236e-02
[156]  2.160335e-01  2.731813e-02  3.965133e-01  5.963053e-02 -2.357750e-02
[161]  1.049615e-01 -5.356114e-01  6.302669e-02  3.336586e-03  1.913572e-01
[166]  3.910654e-02 -4.331567e-01  4.466500e-01  1.499167e-01 -4.951389e-02
[171] -2.910365e-02  6.021461e-02  2.484180e-01  1.314520e-06  4.373288e-01
[176]  5.864788e-01 -2.014012e-02 -4.177752e-01  2.043729e-01 -2.741584e-02
[181] -4.886284e-02  2.929728e-02 -1.955283e-01 -5.588678e-01  8.688758e-02
[186]  2.768313e-01  9.561019e-01  1.162185e-01 -3.770608e-01 -8.953778e-02
[191]  4.058194e-02 -3.032566e-01  2.288409e-01 -1.186218e-01  2.068740e-02
[196] -3.909113e-01  2.850051e-01  1.884397e-01 -2.258096e-01  9.153115e-02
[201]  2.758271e-01 -3.966702e-01 -2.744646e-02 -3.183134e-01 -3.908257e-02
[206]  6.079316e-02 -1.456129e-01 -5.817476e-02 -4.076823e-01 -1.408561e-01
[211]  1.683495e-01 -2.593528e-02  2.702917e-01 -1.144591e-01  1.831099e-01
[216] -2.636088e-01 -5.257268e-03  9.044117e-02  1.287629e-01  7.649954e-02
[221] -4.314959e-01 -7.770875e-02  1.000796e-02  8.280113e-02 -2.358723e-01
[226] -4.481553e-01 -3.277097e-01 -1.602415e-01 -3.525591e-01  6.188587e-01
> 
> proc.time()
   user  system elapsed 
  0.715   3.657   4.832 

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: 0x600001404000>
> .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: 0x600001404000>
> .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: 0x600001404000>
> .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: 0x600001404000>
> 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: 0x60000143c000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x60000143c000>
> .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: 0x60000143c000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x60000143c000>
> .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: 0x60000143c000>
> 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: 0x600001430000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600001430000>
> .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: 0x600001430000>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x600001430000>
> .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: 0x600001430000>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x600001430000>
> .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: 0x600001430000>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x600001430000>
> .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: 0x600001430000>
> 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: 0x600001428000>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x600001428000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600001428000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600001428000>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile85c0120082b3" "BufferedMatrixFile85c05f84bf00"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile85c0120082b3" "BufferedMatrixFile85c05f84bf00"
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x600001428240>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600001428240>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x600001428240>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x600001428240>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x600001428240>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x600001428240>
> .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: 0x600001428420>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600001428420>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x600001428420>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x600001428420>
> 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: 0x600001428600>
> .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: 0x600001428600>
> rm(P)
> 
> proc.time()
   user  system elapsed 
  0.124   0.047   0.172 

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.131   0.033   0.162 

Example timings