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

This page was generated on 2026-01-03 11:34 -0500 (Sat, 03 Jan 2026).

HostnameOSArch (*)R versionInstalled pkgs
nebbiolo1Linux (Ubuntu 24.04.3 LTS)x86_64R Under development (unstable) (2025-12-22 r89219) -- "Unsuffered Consequences" 4809
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-01 13:40 -0500 (Thu, 01 Jan 2026)
git_url: https://git.bioconductor.org/packages/BufferedMatrix
git_branch: devel
git_last_commit: ecdbf23
git_last_commit_date: 2025-10-29 09:58:55 -0500 (Wed, 29 Oct 2025)
nebbiolo1Linux (Ubuntu 24.04.3 LTS) / x86_64  OK    OK    OK  UNNEEDED, same version is already published
kjohnson3macOS 13.7.7 Ventura / arm64  OK    OK    WARNINGS    OK  UNNEEDED, same version is already published


CHECK results for BufferedMatrix on kjohnson3

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

raw results


Summary

Package: BufferedMatrix
Version: 1.75.0
Command: /Library/Frameworks/R.framework/Resources/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/Library/Frameworks/R.framework/Resources/library --no-vignettes --timings BufferedMatrix_1.75.0.tar.gz
StartedAt: 2026-01-01 18:48:02 -0500 (Thu, 01 Jan 2026)
EndedAt: 2026-01-01 18:48:20 -0500 (Thu, 01 Jan 2026)
EllapsedTime: 18.2 seconds
RetCode: 0
Status:   WARNINGS  
CheckDir: BufferedMatrix.Rcheck
Warnings: 1

Command output

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


* using log directory ‘/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck’
* using R Under development (unstable) (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.123   0.051   0.171 

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  1 18:48:12 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  1 18:48:12 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: 0x600001fdc000>
> 
> 
> 
> 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  1 18:48:13 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  1 18:48:14 2026"
> 
> ColMode(tmp2)
<pointer: 0x600001fdc000>
> 
> 
> 
> ### Now testing assignments
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+ 
+   new.data <- rnorm(20)
+   tmp2[which.row,] <- new.data
+   test.matrix[which.row,] <- new.data
+   if (rep > 1){
+     if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+   
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   new.data <- rnorm(10)
+   tmp2[,which.col] <- new.data
+   test.matrix[,which.col]<- new.data
+ 
+   if (rep > 1){
+     if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.col <- which.col
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,5,replace=TRUE)
+   new.data <- matrix(rnorm(50),5,10)
+   tmp2[,which.col] <- new.data
+   test.matrix[,which.col]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.col <- which.col
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   new.data <- matrix(rnorm(50),5,10)
+   tmp2[which.row,] <- new.data
+   test.matrix[which.row,]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col  <- sample(1:20,5,replace=TRUE)
+   new.data <- matrix(rnorm(25),5,5)
+   tmp2[which.row,which.col] <- new.data
+   test.matrix[which.row,which.col]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[prev.row,prev.col] == test.matrix[prev.row,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+   prev.col <- which.col
+ }
> 
> 
> 
> 
> ###
> ###
> ### testing some more functions
> ###
> 
> 
> 
> ## duplication function
> tmp5 <- duplicate(tmp2)
> 
> # making sure really did copy everything.
> tmp5[1,1] <- tmp5[1,1] +100.00
> 
> if (tmp5[1,1] == tmp2[1,1]){
+   stop("Problem with duplication")
+ }
> 
> 
> 
> 
> ### testing elementwise applying of functions
> 
> tmp5[1:4,1:4]
           [,1]       [,2]      [,3]       [,4]
[1,] 101.835577 -0.8826831 0.3864951  0.1558966
[2,]   1.569680 -1.0866472 0.7623891 -0.3749379
[3,]  -2.673990 -1.3973090 0.4401611  1.2719375
[4,]  -1.805132  0.8694079 1.3958872  1.5522770
> 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,] 101.835577 0.8826831 0.3864951 0.1558966
[2,]   1.569680 1.0866472 0.7623891 0.3749379
[3,]   2.673990 1.3973090 0.4401611 1.2719375
[4,]   1.805132 0.8694079 1.3958872 1.5522770
> 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,] 10.091361 0.9395122 0.6216873 0.3948374
[2,]  1.252869 1.0424237 0.8731489 0.6123218
[3,]  1.635234 1.1820783 0.6634464 1.1278021
[4,]  1.343552 0.9324204 1.1814767 1.2459041
> 
> 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,] 227.74919 35.27780 31.60337 29.10427
[2,]  39.09837 36.51088 34.49388 31.49816
[3,]  44.02633 38.21809 32.07463 37.54996
[4,]  40.24065 35.19361 38.21065 39.01132
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x600001fd0000>
> exp(tmp5)
<pointer: 0x600001fd0000>
> log(tmp5,2)
<pointer: 0x600001fd0000>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 474.0301
> Min(tmp5)
[1] 54.04742
> mean(tmp5)
[1] 73.42479
> Sum(tmp5)
[1] 14684.96
> Var(tmp5)
[1] 876.9467
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 89.08223 71.30145 75.26987 73.11846 71.25319 72.24536 69.20678 70.35663
 [9] 71.58132 70.83264
> rowSums(tmp5)
 [1] 1781.645 1426.029 1505.397 1462.369 1425.064 1444.907 1384.136 1407.133
 [9] 1431.626 1416.653
> rowVars(tmp5)
 [1] 8250.55734   55.57080   86.67310   40.95841  107.12194   54.89981
 [7]   85.92603   30.15107  102.46490   58.33770
> rowSd(tmp5)
 [1] 90.832579  7.454583  9.309839  6.399876 10.349973  7.409441  9.269630
 [8]  5.490999 10.122495  7.637912
> rowMax(tmp5)
 [1] 474.03010  84.34902  91.63503  83.75565  91.33054  83.50956  88.57809
 [8]  81.04857  98.65106  85.04577
> rowMin(tmp5)
 [1] 55.98168 57.38890 57.95005 61.64717 54.04742 55.59316 56.16773 61.92887
 [9] 55.17250 56.17149
> 
> colMeans(tmp5)
 [1] 113.12066  74.09479  67.09090  70.94776  68.77168  74.21566  71.16047
 [8]  72.22035  71.08807  73.50449  69.93593  72.26189  76.68747  69.62512
[15]  68.00839  69.05175  66.67569  71.93188  71.97379  76.12915
> colSums(tmp5)
 [1] 1131.2066  740.9479  670.9090  709.4776  687.7168  742.1566  711.6047
 [8]  722.2035  710.8807  735.0449  699.3593  722.6189  766.8747  696.2512
[15]  680.0839  690.5175  666.7569  719.3188  719.7379  761.2915
> colVars(tmp5)
 [1] 16192.82616    38.74357    41.83067    71.92232    78.21654    84.43683
 [7]   101.27466    48.33099    69.72983   120.96996    88.36827    61.31850
[13]    52.77967    41.74564    51.05245    40.75049    50.15336    52.44378
[19]    42.06755    60.13647
> colSd(tmp5)
 [1] 127.251036   6.224433   6.467663   8.480703   8.844011   9.188952
 [7]  10.063531   6.952049   8.350439  10.998635   9.400440   7.830613
[13]   7.264962   6.461087   7.145099   6.383611   7.081904   7.241808
[19]   6.485951   7.754771
> colMax(tmp5)
 [1] 474.03010  83.12096  79.53047  83.50956  81.16733  91.33054  85.85435
 [8]  85.04577  87.15204  98.65106  88.57809  80.80785  87.32157  78.13162
[15]  81.53822  78.01536  79.62973  85.68407  83.50858  89.51974
> colMin(tmp5)
 [1] 54.04742 63.50208 55.59316 59.45391 55.98168 60.32973 55.17250 61.06308
 [9] 60.55897 58.40067 56.41309 56.64997 66.87863 59.73604 56.17149 57.38890
[17] 56.16773 63.44559 63.23907 64.00464
> 
> 
> ### 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] 89.08223 71.30145 75.26987 73.11846 71.25319 72.24536 69.20678 70.35663
 [9] 71.58132       NA
> rowSums(tmp5)
 [1] 1781.645 1426.029 1505.397 1462.369 1425.064 1444.907 1384.136 1407.133
 [9] 1431.626       NA
> rowVars(tmp5)
 [1] 8250.55734   55.57080   86.67310   40.95841  107.12194   54.89981
 [7]   85.92603   30.15107  102.46490   55.33272
> rowSd(tmp5)
 [1] 90.832579  7.454583  9.309839  6.399876 10.349973  7.409441  9.269630
 [8]  5.490999 10.122495  7.438597
> rowMax(tmp5)
 [1] 474.03010  84.34902  91.63503  83.75565  91.33054  83.50956  88.57809
 [8]  81.04857  98.65106        NA
> rowMin(tmp5)
 [1] 55.98168 57.38890 57.95005 61.64717 54.04742 55.59316 56.16773 61.92887
 [9] 55.17250       NA
> 
> colMeans(tmp5)
 [1] 113.12066  74.09479  67.09090  70.94776        NA  74.21566  71.16047
 [8]  72.22035  71.08807  73.50449  69.93593  72.26189  76.68747  69.62512
[15]  68.00839  69.05175  66.67569  71.93188  71.97379  76.12915
> colSums(tmp5)
 [1] 1131.2066  740.9479  670.9090  709.4776        NA  742.1566  711.6047
 [8]  722.2035  710.8807  735.0449  699.3593  722.6189  766.8747  696.2512
[15]  680.0839  690.5175  666.7569  719.3188  719.7379  761.2915
> colVars(tmp5)
 [1] 16192.82616    38.74357    41.83067    71.92232          NA    84.43683
 [7]   101.27466    48.33099    69.72983   120.96996    88.36827    61.31850
[13]    52.77967    41.74564    51.05245    40.75049    50.15336    52.44378
[19]    42.06755    60.13647
> colSd(tmp5)
 [1] 127.251036   6.224433   6.467663   8.480703         NA   9.188952
 [7]  10.063531   6.952049   8.350439  10.998635   9.400440   7.830613
[13]   7.264962   6.461087   7.145099   6.383611   7.081904   7.241808
[19]   6.485951   7.754771
> colMax(tmp5)
 [1] 474.03010  83.12096  79.53047  83.50956        NA  91.33054  85.85435
 [8]  85.04577  87.15204  98.65106  88.57809  80.80785  87.32157  78.13162
[15]  81.53822  78.01536  79.62973  85.68407  83.50858  89.51974
> colMin(tmp5)
 [1] 54.04742 63.50208 55.59316 59.45391       NA 60.32973 55.17250 61.06308
 [9] 60.55897 58.40067 56.41309 56.64997 66.87863 59.73604 56.17149 57.38890
[17] 56.16773 63.44559 63.23907 64.00464
> 
> Max(tmp5,na.rm=TRUE)
[1] 474.0301
> Min(tmp5,na.rm=TRUE)
[1] 54.04742
> mean(tmp5,na.rm=TRUE)
[1] 73.38589
> Sum(tmp5,na.rm=TRUE)
[1] 14603.79
> Var(tmp5,na.rm=TRUE)
[1] 881.0715
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 89.08223 71.30145 75.26987 73.11846 71.25319 72.24536 69.20678 70.35663
 [9] 71.58132 70.28870
> rowSums(tmp5,na.rm=TRUE)
 [1] 1781.645 1426.029 1505.397 1462.369 1425.064 1444.907 1384.136 1407.133
 [9] 1431.626 1335.485
> rowVars(tmp5,na.rm=TRUE)
 [1] 8250.55734   55.57080   86.67310   40.95841  107.12194   54.89981
 [7]   85.92603   30.15107  102.46490   55.33272
> rowSd(tmp5,na.rm=TRUE)
 [1] 90.832579  7.454583  9.309839  6.399876 10.349973  7.409441  9.269630
 [8]  5.490999 10.122495  7.438597
> rowMax(tmp5,na.rm=TRUE)
 [1] 474.03010  84.34902  91.63503  83.75565  91.33054  83.50956  88.57809
 [8]  81.04857  98.65106  85.04577
> rowMin(tmp5,na.rm=TRUE)
 [1] 55.98168 57.38890 57.95005 61.64717 54.04742 55.59316 56.16773 61.92887
 [9] 55.17250 56.17149
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 113.12066  74.09479  67.09090  70.94776  67.39439  74.21566  71.16047
 [8]  72.22035  71.08807  73.50449  69.93593  72.26189  76.68747  69.62512
[15]  68.00839  69.05175  66.67569  71.93188  71.97379  76.12915
> colSums(tmp5,na.rm=TRUE)
 [1] 1131.2066  740.9479  670.9090  709.4776  606.5495  742.1566  711.6047
 [8]  722.2035  710.8807  735.0449  699.3593  722.6189  766.8747  696.2512
[15]  680.0839  690.5175  666.7569  719.3188  719.7379  761.2915
> colVars(tmp5,na.rm=TRUE)
 [1] 16192.82616    38.74357    41.83067    71.92232    66.65303    84.43683
 [7]   101.27466    48.33099    69.72983   120.96996    88.36827    61.31850
[13]    52.77967    41.74564    51.05245    40.75049    50.15336    52.44378
[19]    42.06755    60.13647
> colSd(tmp5,na.rm=TRUE)
 [1] 127.251036   6.224433   6.467663   8.480703   8.164131   9.188952
 [7]  10.063531   6.952049   8.350439  10.998635   9.400440   7.830613
[13]   7.264962   6.461087   7.145099   6.383611   7.081904   7.241808
[19]   6.485951   7.754771
> colMax(tmp5,na.rm=TRUE)
 [1] 474.03010  83.12096  79.53047  83.50956  80.87915  91.33054  85.85435
 [8]  85.04577  87.15204  98.65106  88.57809  80.80785  87.32157  78.13162
[15]  81.53822  78.01536  79.62973  85.68407  83.50858  89.51974
> colMin(tmp5,na.rm=TRUE)
 [1] 54.04742 63.50208 55.59316 59.45391 55.98168 60.32973 55.17250 61.06308
 [9] 60.55897 58.40067 56.41309 56.64997 66.87863 59.73604 56.17149 57.38890
[17] 56.16773 63.44559 63.23907 64.00464
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1] 89.08223 71.30145 75.26987 73.11846 71.25319 72.24536 69.20678 70.35663
 [9] 71.58132      NaN
> rowSums(tmp5,na.rm=TRUE)
 [1] 1781.645 1426.029 1505.397 1462.369 1425.064 1444.907 1384.136 1407.133
 [9] 1431.626    0.000
> rowVars(tmp5,na.rm=TRUE)
 [1] 8250.55734   55.57080   86.67310   40.95841  107.12194   54.89981
 [7]   85.92603   30.15107  102.46490         NA
> rowSd(tmp5,na.rm=TRUE)
 [1] 90.832579  7.454583  9.309839  6.399876 10.349973  7.409441  9.269630
 [8]  5.490999 10.122495        NA
> rowMax(tmp5,na.rm=TRUE)
 [1] 474.03010  84.34902  91.63503  83.75565  91.33054  83.50956  88.57809
 [8]  81.04857  98.65106        NA
> rowMin(tmp5,na.rm=TRUE)
 [1] 55.98168 57.38890 57.95005 61.64717 54.04742 55.59316 56.16773 61.92887
 [9] 55.17250       NA
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1] 117.47834  73.48158  67.19120  71.74918       NaN  73.78344  72.17663
 [8]  70.79531  71.20779  73.20914  70.85530  72.97146  76.81546  69.36193
[15]  69.32360  68.05579  66.09666  72.59513  72.94432  76.76958
> colSums(tmp5,na.rm=TRUE)
 [1] 1057.3050  661.3342  604.7208  645.7426    0.0000  664.0509  649.5897
 [8]  637.1578  640.8701  658.8823  637.6977  656.7431  691.3391  624.2574
[15]  623.9124  612.5021  594.8700  653.3562  656.4989  690.9262
> colVars(tmp5,na.rm=TRUE)
 [1] 18003.29902    39.35625    46.94633    73.68690          NA    92.88977
 [7]   102.31743    31.52634    78.28480   135.10988    89.90543    63.31901
[13]    59.19282    46.18460    37.97398    34.68509    52.65074    54.05041
[19]    36.72941    63.03940
> colSd(tmp5,na.rm=TRUE)
 [1] 134.176373   6.273456   6.851739   8.584107         NA   9.637934
 [7]  10.115208   5.614832   8.847870  11.623677   9.481848   7.957325
[13]   7.693687   6.795925   6.162303   5.889405   7.256083   7.351898
[19]   6.060479   7.939736
> colMax(tmp5,na.rm=TRUE)
 [1] 474.03010  83.12096  79.53047  83.50956      -Inf  91.33054  85.85435
 [8]  78.90863  87.15204  98.65106  88.57809  80.80785  87.32157  78.13162
[15]  81.53822  74.50753  79.62973  85.68407  83.50858  89.51974
> colMin(tmp5,na.rm=TRUE)
 [1] 54.04742 63.50208 55.59316 59.45391      Inf 60.32973 55.17250 61.06308
 [9] 60.55897 58.40067 56.41309 56.64997 66.87863 59.73604 58.36152 57.38890
[17] 56.16773 63.44559 63.70344 64.00464
> 
> 
> 
> 
> 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] 261.7238 296.6279 202.9181 277.7825 231.6192 176.5728 255.3227 162.5107
 [9] 360.9472 195.3565
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 261.7238 296.6279 202.9181 277.7825 231.6192 176.5728 255.3227 162.5107
 [9] 360.9472 195.3565
> 
> 
> 
> 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.136868e-13  0.000000e+00 -8.526513e-14 -5.684342e-14  0.000000e+00
 [6] -5.684342e-14  5.684342e-14  1.136868e-13  0.000000e+00  2.842171e-14
[11]  4.263256e-14  1.136868e-13 -2.842171e-14 -1.421085e-13  2.842171e-14
[16] -1.705303e-13  0.000000e+00  0.000000e+00 -2.842171e-14  1.705303e-13
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> ## making sure these things agree
> ##
> ## first when there is no NA
> 
> 
> 
> agree.checks <- function(buff.matrix,r.matrix,err.tol=1e-10){
+ 
+   if (Max(buff.matrix,na.rm=TRUE) != max(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Max")
+   }
+   
+ 
+   if (Min(buff.matrix,na.rm=TRUE) != min(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Min")
+   }
+ 
+ 
+   if (abs(Sum(buff.matrix,na.rm=TRUE)- sum(r.matrix,na.rm=TRUE)) > err.tol){
+ 
+     cat(Sum(buff.matrix,na.rm=TRUE),"\n")
+     cat(sum(r.matrix,na.rm=TRUE),"\n")
+     cat(Sum(buff.matrix,na.rm=TRUE) - sum(r.matrix,na.rm=TRUE),"\n")
+     
+     stop("No agreement in Sum")
+   }
+   
+   if (abs(mean(buff.matrix,na.rm=TRUE) - mean(r.matrix,na.rm=TRUE)) > err.tol){
+     stop("No agreement in mean")
+   }
+   
+   
+   if(abs(Var(buff.matrix,na.rm=TRUE) - var(as.vector(r.matrix),na.rm=TRUE)) > err.tol){
+     stop("No agreement in Var")
+   }
+   
+   
+ 
+   if(any(abs(rowMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,mean,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowMeans")
+   }
+   
+   
+   if(any(abs(colMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,mean,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colMeans")
+   }
+   
+   
+   if(any(abs(rowSums(buff.matrix,na.rm=TRUE)  -  apply(r.matrix,1,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in rowSums")
+   }
+   
+   
+   if(any(abs(colSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colSums")
+   }
+   
+   ### this is to get around the fact that R doesn't like to compute NA on an entire vector of NA when 
+   ### computing variance
+   my.Var <- function(x,na.rm=FALSE){
+    if (all(is.na(x))){
+      return(NA)
+    } else {
+      var(x,na.rm=na.rm)
+    }
+ 
+   }
+   
+   if(any(abs(rowVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+   
+   
+   if(any(abs(colVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+ 
+ 
+   if(any(abs(rowMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+ 
+   if(any(abs(colMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+   
+   
+   if(any(abs(rowMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+   
+ 
+   if(any(abs(colMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+ 
+   if(any(abs(colMedians(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,median,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMedian")
+   }
+ 
+   if(any(abs(colRanges(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,range,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colRanges")
+   }
+ 
+ 
+   
+ }
> 
> 
> 
> 
> 
> 
> 
> 
> 
> for (rep in 1:20){
+   copymatrix <- matrix(rnorm(200,150,15),10,20)
+   
+   tmp5[1:10,1:20] <- copymatrix
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ## now lets assign some NA values and check agreement
+ 
+   which.row <- sample(1:10,1,replace=TRUE)
+   which.col  <- sample(1:20,1,replace=TRUE)
+   
+   cat(which.row," ",which.col,"\n")
+   
+   tmp5[which.row,which.col] <- NA
+   copymatrix[which.row,which.col] <- NA
+   
+   agree.checks(tmp5,copymatrix)
+ 
+   ## make an entire row NA
+   tmp5[which.row,] <- NA
+   copymatrix[which.row,] <- NA
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ### also make an entire col NA
+   tmp5[,which.col] <- NA
+   copymatrix[,which.col] <- NA
+ 
+   agree.checks(tmp5,copymatrix)
+ 
+   ### now make 1 element non NA with NA in the rest of row and column
+ 
+   tmp5[which.row,which.col] <- rnorm(1,150,15)
+   copymatrix[which.row,which.col] <- tmp5[which.row,which.col]
+ 
+   agree.checks(tmp5,copymatrix)
+ }
5   9 
10   3 
8   10 
9   10 
6   10 
6   7 
9   3 
10   16 
10   16 
7   16 
3   15 
1   3 
9   20 
3   7 
6   12 
5   10 
8   11 
5   2 
2   10 
4   3 
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.205301
> Min(tmp)
[1] -2.387896
> mean(tmp)
[1] -0.01184262
> Sum(tmp)
[1] -1.184262
> Var(tmp)
[1] 1.065793
> 
> rowMeans(tmp)
[1] -0.01184262
> rowSums(tmp)
[1] -1.184262
> rowVars(tmp)
[1] 1.065793
> rowSd(tmp)
[1] 1.032373
> rowMax(tmp)
[1] 2.205301
> rowMin(tmp)
[1] -2.387896
> 
> colMeans(tmp)
  [1] -0.44736061 -0.36202963 -1.93754526  0.51102083 -1.82730626  0.40423697
  [7]  1.29978733  0.82874838  2.19988186  0.11439028  0.96244366 -0.26399943
 [13]  2.05478207 -0.78707787  0.92260069 -0.60877437  0.92274853  0.16237436
 [19] -0.90717172  0.34381501 -0.20237133 -1.46399220  0.66707086  0.30402147
 [25]  0.42491190 -0.25384505  0.23894932  1.39182515 -0.51681974 -2.29135291
 [31] -0.57259471  0.66147999 -0.67076856 -0.42597606  0.48612168 -1.31350719
 [37] -1.16242414  2.20530138 -0.75786150 -0.41172061  0.30033577 -0.51158000
 [43] -0.02407973  0.15386350 -0.65608290  1.71987621  1.57174219 -0.61831565
 [49] -1.14101633 -0.69522641 -2.16394490  1.27032669  0.06949015  1.89268579
 [55] -1.32420887  1.13929751 -2.38789606  0.16187243  0.38726280 -1.12398988
 [61] -0.18470306 -0.99302959  0.35193908 -0.22303288  0.54106404 -0.19682053
 [67] -1.26523178  0.97730428  1.99480691 -1.62561140  1.44152642 -0.05457235
 [73]  0.22974014  0.49833248  1.26443879  0.74898803 -1.44248638 -0.82533933
 [79] -0.30258738 -0.30438967 -0.24078749 -1.91900966 -1.69557705  0.01730988
 [85] -0.57074040 -0.25188539  0.18537880  0.55137505 -0.04958416 -0.76308464
 [91]  0.60704880  0.20772160 -0.34633991  0.09961279  1.54814205  1.54036165
 [97]  0.38304988 -0.18747343  0.72082785  0.40663092
> colSums(tmp)
  [1] -0.44736061 -0.36202963 -1.93754526  0.51102083 -1.82730626  0.40423697
  [7]  1.29978733  0.82874838  2.19988186  0.11439028  0.96244366 -0.26399943
 [13]  2.05478207 -0.78707787  0.92260069 -0.60877437  0.92274853  0.16237436
 [19] -0.90717172  0.34381501 -0.20237133 -1.46399220  0.66707086  0.30402147
 [25]  0.42491190 -0.25384505  0.23894932  1.39182515 -0.51681974 -2.29135291
 [31] -0.57259471  0.66147999 -0.67076856 -0.42597606  0.48612168 -1.31350719
 [37] -1.16242414  2.20530138 -0.75786150 -0.41172061  0.30033577 -0.51158000
 [43] -0.02407973  0.15386350 -0.65608290  1.71987621  1.57174219 -0.61831565
 [49] -1.14101633 -0.69522641 -2.16394490  1.27032669  0.06949015  1.89268579
 [55] -1.32420887  1.13929751 -2.38789606  0.16187243  0.38726280 -1.12398988
 [61] -0.18470306 -0.99302959  0.35193908 -0.22303288  0.54106404 -0.19682053
 [67] -1.26523178  0.97730428  1.99480691 -1.62561140  1.44152642 -0.05457235
 [73]  0.22974014  0.49833248  1.26443879  0.74898803 -1.44248638 -0.82533933
 [79] -0.30258738 -0.30438967 -0.24078749 -1.91900966 -1.69557705  0.01730988
 [85] -0.57074040 -0.25188539  0.18537880  0.55137505 -0.04958416 -0.76308464
 [91]  0.60704880  0.20772160 -0.34633991  0.09961279  1.54814205  1.54036165
 [97]  0.38304988 -0.18747343  0.72082785  0.40663092
> colVars(tmp)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> colSd(tmp)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> colMax(tmp)
  [1] -0.44736061 -0.36202963 -1.93754526  0.51102083 -1.82730626  0.40423697
  [7]  1.29978733  0.82874838  2.19988186  0.11439028  0.96244366 -0.26399943
 [13]  2.05478207 -0.78707787  0.92260069 -0.60877437  0.92274853  0.16237436
 [19] -0.90717172  0.34381501 -0.20237133 -1.46399220  0.66707086  0.30402147
 [25]  0.42491190 -0.25384505  0.23894932  1.39182515 -0.51681974 -2.29135291
 [31] -0.57259471  0.66147999 -0.67076856 -0.42597606  0.48612168 -1.31350719
 [37] -1.16242414  2.20530138 -0.75786150 -0.41172061  0.30033577 -0.51158000
 [43] -0.02407973  0.15386350 -0.65608290  1.71987621  1.57174219 -0.61831565
 [49] -1.14101633 -0.69522641 -2.16394490  1.27032669  0.06949015  1.89268579
 [55] -1.32420887  1.13929751 -2.38789606  0.16187243  0.38726280 -1.12398988
 [61] -0.18470306 -0.99302959  0.35193908 -0.22303288  0.54106404 -0.19682053
 [67] -1.26523178  0.97730428  1.99480691 -1.62561140  1.44152642 -0.05457235
 [73]  0.22974014  0.49833248  1.26443879  0.74898803 -1.44248638 -0.82533933
 [79] -0.30258738 -0.30438967 -0.24078749 -1.91900966 -1.69557705  0.01730988
 [85] -0.57074040 -0.25188539  0.18537880  0.55137505 -0.04958416 -0.76308464
 [91]  0.60704880  0.20772160 -0.34633991  0.09961279  1.54814205  1.54036165
 [97]  0.38304988 -0.18747343  0.72082785  0.40663092
> colMin(tmp)
  [1] -0.44736061 -0.36202963 -1.93754526  0.51102083 -1.82730626  0.40423697
  [7]  1.29978733  0.82874838  2.19988186  0.11439028  0.96244366 -0.26399943
 [13]  2.05478207 -0.78707787  0.92260069 -0.60877437  0.92274853  0.16237436
 [19] -0.90717172  0.34381501 -0.20237133 -1.46399220  0.66707086  0.30402147
 [25]  0.42491190 -0.25384505  0.23894932  1.39182515 -0.51681974 -2.29135291
 [31] -0.57259471  0.66147999 -0.67076856 -0.42597606  0.48612168 -1.31350719
 [37] -1.16242414  2.20530138 -0.75786150 -0.41172061  0.30033577 -0.51158000
 [43] -0.02407973  0.15386350 -0.65608290  1.71987621  1.57174219 -0.61831565
 [49] -1.14101633 -0.69522641 -2.16394490  1.27032669  0.06949015  1.89268579
 [55] -1.32420887  1.13929751 -2.38789606  0.16187243  0.38726280 -1.12398988
 [61] -0.18470306 -0.99302959  0.35193908 -0.22303288  0.54106404 -0.19682053
 [67] -1.26523178  0.97730428  1.99480691 -1.62561140  1.44152642 -0.05457235
 [73]  0.22974014  0.49833248  1.26443879  0.74898803 -1.44248638 -0.82533933
 [79] -0.30258738 -0.30438967 -0.24078749 -1.91900966 -1.69557705  0.01730988
 [85] -0.57074040 -0.25188539  0.18537880  0.55137505 -0.04958416 -0.76308464
 [91]  0.60704880  0.20772160 -0.34633991  0.09961279  1.54814205  1.54036165
 [97]  0.38304988 -0.18747343  0.72082785  0.40663092
> colMedians(tmp)
  [1] -0.44736061 -0.36202963 -1.93754526  0.51102083 -1.82730626  0.40423697
  [7]  1.29978733  0.82874838  2.19988186  0.11439028  0.96244366 -0.26399943
 [13]  2.05478207 -0.78707787  0.92260069 -0.60877437  0.92274853  0.16237436
 [19] -0.90717172  0.34381501 -0.20237133 -1.46399220  0.66707086  0.30402147
 [25]  0.42491190 -0.25384505  0.23894932  1.39182515 -0.51681974 -2.29135291
 [31] -0.57259471  0.66147999 -0.67076856 -0.42597606  0.48612168 -1.31350719
 [37] -1.16242414  2.20530138 -0.75786150 -0.41172061  0.30033577 -0.51158000
 [43] -0.02407973  0.15386350 -0.65608290  1.71987621  1.57174219 -0.61831565
 [49] -1.14101633 -0.69522641 -2.16394490  1.27032669  0.06949015  1.89268579
 [55] -1.32420887  1.13929751 -2.38789606  0.16187243  0.38726280 -1.12398988
 [61] -0.18470306 -0.99302959  0.35193908 -0.22303288  0.54106404 -0.19682053
 [67] -1.26523178  0.97730428  1.99480691 -1.62561140  1.44152642 -0.05457235
 [73]  0.22974014  0.49833248  1.26443879  0.74898803 -1.44248638 -0.82533933
 [79] -0.30258738 -0.30438967 -0.24078749 -1.91900966 -1.69557705  0.01730988
 [85] -0.57074040 -0.25188539  0.18537880  0.55137505 -0.04958416 -0.76308464
 [91]  0.60704880  0.20772160 -0.34633991  0.09961279  1.54814205  1.54036165
 [97]  0.38304988 -0.18747343  0.72082785  0.40663092
> colRanges(tmp)
           [,1]       [,2]      [,3]      [,4]      [,5]     [,6]     [,7]
[1,] -0.4473606 -0.3620296 -1.937545 0.5110208 -1.827306 0.404237 1.299787
[2,] -0.4473606 -0.3620296 -1.937545 0.5110208 -1.827306 0.404237 1.299787
          [,8]     [,9]     [,10]     [,11]      [,12]    [,13]      [,14]
[1,] 0.8287484 2.199882 0.1143903 0.9624437 -0.2639994 2.054782 -0.7870779
[2,] 0.8287484 2.199882 0.1143903 0.9624437 -0.2639994 2.054782 -0.7870779
         [,15]      [,16]     [,17]     [,18]      [,19]    [,20]      [,21]
[1,] 0.9226007 -0.6087744 0.9227485 0.1623744 -0.9071717 0.343815 -0.2023713
[2,] 0.9226007 -0.6087744 0.9227485 0.1623744 -0.9071717 0.343815 -0.2023713
         [,22]     [,23]     [,24]     [,25]      [,26]     [,27]    [,28]
[1,] -1.463992 0.6670709 0.3040215 0.4249119 -0.2538451 0.2389493 1.391825
[2,] -1.463992 0.6670709 0.3040215 0.4249119 -0.2538451 0.2389493 1.391825
          [,29]     [,30]      [,31]   [,32]      [,33]      [,34]     [,35]
[1,] -0.5168197 -2.291353 -0.5725947 0.66148 -0.6707686 -0.4259761 0.4861217
[2,] -0.5168197 -2.291353 -0.5725947 0.66148 -0.6707686 -0.4259761 0.4861217
         [,36]     [,37]    [,38]      [,39]      [,40]     [,41]    [,42]
[1,] -1.313507 -1.162424 2.205301 -0.7578615 -0.4117206 0.3003358 -0.51158
[2,] -1.313507 -1.162424 2.205301 -0.7578615 -0.4117206 0.3003358 -0.51158
           [,43]     [,44]      [,45]    [,46]    [,47]      [,48]     [,49]
[1,] -0.02407973 0.1538635 -0.6560829 1.719876 1.571742 -0.6183156 -1.141016
[2,] -0.02407973 0.1538635 -0.6560829 1.719876 1.571742 -0.6183156 -1.141016
          [,50]     [,51]    [,52]      [,53]    [,54]     [,55]    [,56]
[1,] -0.6952264 -2.163945 1.270327 0.06949015 1.892686 -1.324209 1.139298
[2,] -0.6952264 -2.163945 1.270327 0.06949015 1.892686 -1.324209 1.139298
         [,57]     [,58]     [,59]    [,60]      [,61]      [,62]     [,63]
[1,] -2.387896 0.1618724 0.3872628 -1.12399 -0.1847031 -0.9930296 0.3519391
[2,] -2.387896 0.1618724 0.3872628 -1.12399 -0.1847031 -0.9930296 0.3519391
          [,64]    [,65]      [,66]     [,67]     [,68]    [,69]     [,70]
[1,] -0.2230329 0.541064 -0.1968205 -1.265232 0.9773043 1.994807 -1.625611
[2,] -0.2230329 0.541064 -0.1968205 -1.265232 0.9773043 1.994807 -1.625611
        [,71]       [,72]     [,73]     [,74]    [,75]    [,76]     [,77]
[1,] 1.441526 -0.05457235 0.2297401 0.4983325 1.264439 0.748988 -1.442486
[2,] 1.441526 -0.05457235 0.2297401 0.4983325 1.264439 0.748988 -1.442486
          [,78]      [,79]      [,80]      [,81]    [,82]     [,83]      [,84]
[1,] -0.8253393 -0.3025874 -0.3043897 -0.2407875 -1.91901 -1.695577 0.01730988
[2,] -0.8253393 -0.3025874 -0.3043897 -0.2407875 -1.91901 -1.695577 0.01730988
          [,85]      [,86]     [,87]    [,88]       [,89]      [,90]     [,91]
[1,] -0.5707404 -0.2518854 0.1853788 0.551375 -0.04958416 -0.7630846 0.6070488
[2,] -0.5707404 -0.2518854 0.1853788 0.551375 -0.04958416 -0.7630846 0.6070488
         [,92]      [,93]      [,94]    [,95]    [,96]     [,97]      [,98]
[1,] 0.2077216 -0.3463399 0.09961279 1.548142 1.540362 0.3830499 -0.1874734
[2,] 0.2077216 -0.3463399 0.09961279 1.548142 1.540362 0.3830499 -0.1874734
         [,99]    [,100]
[1,] 0.7208278 0.4066309
[2,] 0.7208278 0.4066309
> 
> 
> Max(tmp2)
[1] 2.726676
> Min(tmp2)
[1] -2.29695
> mean(tmp2)
[1] 0.1335485
> Sum(tmp2)
[1] 13.35485
> Var(tmp2)
[1] 0.9610121
> 
> rowMeans(tmp2)
  [1]  0.868604369 -0.753526444  2.482805305 -0.570475854  1.681527627
  [6]  1.101459011 -0.737222396 -0.850835531 -0.662755139  0.309096041
 [11]  2.202230015 -0.305938991 -0.136551818  0.352054801  0.038045354
 [16] -0.169576861  0.022442315 -0.225584472  0.639459975 -0.790396751
 [21]  0.003271146  1.226091112 -1.802785801 -1.392667912  0.887460937
 [26] -0.012114106  0.775850006  1.453780582  0.254402283 -0.117150686
 [31] -0.619672187  0.303184927  0.058639017 -2.296950033  0.858627779
 [36]  0.479363886  0.871235044 -1.808695869  0.116251749 -0.348769705
 [41]  0.372578048 -1.007738091  0.852298114 -1.019501599 -0.520993777
 [46] -0.726062449  0.175148818  0.566912338 -0.338438625  1.374459309
 [51]  1.740107364  1.896227995  0.700792713  0.529894901  0.641970725
 [56] -0.704998829 -0.436177274 -0.061901979  0.094135652 -0.270733405
 [61]  0.242020338 -0.817836029  1.669283697  0.612127677  0.357241320
 [66]  0.709050817  0.201159850  0.216553462 -1.034445461 -0.016233238
 [71] -0.153544480 -0.202382250  0.199780769 -1.304734840  0.680680742
 [76]  1.382425991  0.554746062 -0.882408863  1.581964836 -0.100028481
 [81] -0.867477198 -1.371738158 -1.908312173 -0.441963901 -0.195989300
 [86]  2.377533293  0.868226001  1.137377985  0.373628697  0.558360221
 [91]  0.515941005 -0.060740789 -1.359712085  0.338273779  2.726676067
 [96] -1.454172497  0.170758407 -0.094512916 -0.218828031  1.123906290
> rowSums(tmp2)
  [1]  0.868604369 -0.753526444  2.482805305 -0.570475854  1.681527627
  [6]  1.101459011 -0.737222396 -0.850835531 -0.662755139  0.309096041
 [11]  2.202230015 -0.305938991 -0.136551818  0.352054801  0.038045354
 [16] -0.169576861  0.022442315 -0.225584472  0.639459975 -0.790396751
 [21]  0.003271146  1.226091112 -1.802785801 -1.392667912  0.887460937
 [26] -0.012114106  0.775850006  1.453780582  0.254402283 -0.117150686
 [31] -0.619672187  0.303184927  0.058639017 -2.296950033  0.858627779
 [36]  0.479363886  0.871235044 -1.808695869  0.116251749 -0.348769705
 [41]  0.372578048 -1.007738091  0.852298114 -1.019501599 -0.520993777
 [46] -0.726062449  0.175148818  0.566912338 -0.338438625  1.374459309
 [51]  1.740107364  1.896227995  0.700792713  0.529894901  0.641970725
 [56] -0.704998829 -0.436177274 -0.061901979  0.094135652 -0.270733405
 [61]  0.242020338 -0.817836029  1.669283697  0.612127677  0.357241320
 [66]  0.709050817  0.201159850  0.216553462 -1.034445461 -0.016233238
 [71] -0.153544480 -0.202382250  0.199780769 -1.304734840  0.680680742
 [76]  1.382425991  0.554746062 -0.882408863  1.581964836 -0.100028481
 [81] -0.867477198 -1.371738158 -1.908312173 -0.441963901 -0.195989300
 [86]  2.377533293  0.868226001  1.137377985  0.373628697  0.558360221
 [91]  0.515941005 -0.060740789 -1.359712085  0.338273779  2.726676067
 [96] -1.454172497  0.170758407 -0.094512916 -0.218828031  1.123906290
> rowVars(tmp2)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowSd(tmp2)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowMax(tmp2)
  [1]  0.868604369 -0.753526444  2.482805305 -0.570475854  1.681527627
  [6]  1.101459011 -0.737222396 -0.850835531 -0.662755139  0.309096041
 [11]  2.202230015 -0.305938991 -0.136551818  0.352054801  0.038045354
 [16] -0.169576861  0.022442315 -0.225584472  0.639459975 -0.790396751
 [21]  0.003271146  1.226091112 -1.802785801 -1.392667912  0.887460937
 [26] -0.012114106  0.775850006  1.453780582  0.254402283 -0.117150686
 [31] -0.619672187  0.303184927  0.058639017 -2.296950033  0.858627779
 [36]  0.479363886  0.871235044 -1.808695869  0.116251749 -0.348769705
 [41]  0.372578048 -1.007738091  0.852298114 -1.019501599 -0.520993777
 [46] -0.726062449  0.175148818  0.566912338 -0.338438625  1.374459309
 [51]  1.740107364  1.896227995  0.700792713  0.529894901  0.641970725
 [56] -0.704998829 -0.436177274 -0.061901979  0.094135652 -0.270733405
 [61]  0.242020338 -0.817836029  1.669283697  0.612127677  0.357241320
 [66]  0.709050817  0.201159850  0.216553462 -1.034445461 -0.016233238
 [71] -0.153544480 -0.202382250  0.199780769 -1.304734840  0.680680742
 [76]  1.382425991  0.554746062 -0.882408863  1.581964836 -0.100028481
 [81] -0.867477198 -1.371738158 -1.908312173 -0.441963901 -0.195989300
 [86]  2.377533293  0.868226001  1.137377985  0.373628697  0.558360221
 [91]  0.515941005 -0.060740789 -1.359712085  0.338273779  2.726676067
 [96] -1.454172497  0.170758407 -0.094512916 -0.218828031  1.123906290
> rowMin(tmp2)
  [1]  0.868604369 -0.753526444  2.482805305 -0.570475854  1.681527627
  [6]  1.101459011 -0.737222396 -0.850835531 -0.662755139  0.309096041
 [11]  2.202230015 -0.305938991 -0.136551818  0.352054801  0.038045354
 [16] -0.169576861  0.022442315 -0.225584472  0.639459975 -0.790396751
 [21]  0.003271146  1.226091112 -1.802785801 -1.392667912  0.887460937
 [26] -0.012114106  0.775850006  1.453780582  0.254402283 -0.117150686
 [31] -0.619672187  0.303184927  0.058639017 -2.296950033  0.858627779
 [36]  0.479363886  0.871235044 -1.808695869  0.116251749 -0.348769705
 [41]  0.372578048 -1.007738091  0.852298114 -1.019501599 -0.520993777
 [46] -0.726062449  0.175148818  0.566912338 -0.338438625  1.374459309
 [51]  1.740107364  1.896227995  0.700792713  0.529894901  0.641970725
 [56] -0.704998829 -0.436177274 -0.061901979  0.094135652 -0.270733405
 [61]  0.242020338 -0.817836029  1.669283697  0.612127677  0.357241320
 [66]  0.709050817  0.201159850  0.216553462 -1.034445461 -0.016233238
 [71] -0.153544480 -0.202382250  0.199780769 -1.304734840  0.680680742
 [76]  1.382425991  0.554746062 -0.882408863  1.581964836 -0.100028481
 [81] -0.867477198 -1.371738158 -1.908312173 -0.441963901 -0.195989300
 [86]  2.377533293  0.868226001  1.137377985  0.373628697  0.558360221
 [91]  0.515941005 -0.060740789 -1.359712085  0.338273779  2.726676067
 [96] -1.454172497  0.170758407 -0.094512916 -0.218828031  1.123906290
> 
> colMeans(tmp2)
[1] 0.1335485
> colSums(tmp2)
[1] 13.35485
> colVars(tmp2)
[1] 0.9610121
> colSd(tmp2)
[1] 0.9803123
> colMax(tmp2)
[1] 2.726676
> colMin(tmp2)
[1] -2.29695
> colMedians(tmp2)
[1] 0.1051937
> colRanges(tmp2)
          [,1]
[1,] -2.296950
[2,]  2.726676
> 
> dataset1 <- matrix(dataset1,1,100)
> 
> agree.checks(tmp,dataset1)
> 
> dataset2 <- matrix(dataset2,100,1)
> agree.checks(tmp2,dataset2)
>   
> 
> tmp <- createBufferedMatrix(10,10)
> 
> tmp[1:10,1:10] <- rnorm(100)
> colApply(tmp,sum)
 [1] -3.130615 -1.847405 -6.710656  1.459619 -3.409355  2.879315  1.622081
 [8]  2.891193 -1.607729  1.758229
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -1.3683224
[2,] -1.1231687
[3,] -0.8558608
[4,]  0.7566624
[5,]  0.9850261
> 
> rowApply(tmp,sum)
 [1] -0.49344762 -0.52112991 -2.97223465  0.95937046 -3.25552823  0.15975751
 [7]  3.41256060 -1.63904860 -1.67578802 -0.06983517
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    1    8    3    1    2    8    8    3    9     2
 [2,]    6    7    6    2    9    7    2    1   10     4
 [3,]    8    4    1    7    6    2    6    5    5     1
 [4,]    7    1    9    6   10    4    9    2    3     8
 [5,]    4    2    8    3    5    1    5    7    7     6
 [6,]    3    3    2    9    3   10   10   10    4     9
 [7,]   10    6   10    5    8    6    4    4    1     5
 [8,]    5   10    5   10    1    5    7    8    2    10
 [9,]    2    5    4    8    4    9    3    6    6     3
[10,]    9    9    7    4    7    3    1    9    8     7
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1] -1.1518536 -4.2309076  0.6360507  1.9117646  1.7697713 -0.7060464
 [7] -2.1692721  1.9524471 -2.8762303  2.2099675 -6.7561248 -1.7901737
[13] -0.4207637 -2.1577624 -1.6179735  0.2363188 -0.2457271 -0.5324217
[19] -2.1511153  2.5463592
> colApply(tmp,quantile)[,1]
            [,1]
[1,] -1.60286330
[2,] -0.36339938
[3,] -0.22222728
[4,]  0.04267923
[5,]  0.99395709
> 
> rowApply(tmp,sum)
[1] -4.680376 -1.232550  3.711272 -6.644726 -6.697313
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]    4   10   16   12   10
[2,]    9    3   12    3    3
[3,]    7   20    9   19    5
[4,]    8   17    3   18   19
[5,]   18   16   14    1   20
> 
> 
> as.matrix(tmp)
            [,1]       [,2]       [,3]       [,4]       [,5]       [,6]
[1,] -1.60286330 -0.2986688 -0.9031075 -0.5478387  1.1738014  0.7926279
[2,] -0.36339938 -0.9632387  1.9478948  0.8014165  0.7383185 -0.7146107
[3,]  0.99395709  0.3443546 -0.2987687 -0.7365998  0.6322105  0.5788073
[4,]  0.04267923 -1.6212478  0.9704413  0.8748247 -2.3670741 -1.1707690
[5,] -0.22222728 -1.6921069 -1.0804092  1.5199619  1.5925149 -0.1921019
           [,7]       [,8]       [,9]      [,10]      [,11]       [,12]
[1,] -1.7548654  1.5472360  0.2059083 1.02071540 -2.4194695 -1.42442572
[2,] -0.8517484 -0.2720182 -1.9278782 0.27996259 -0.6053869 -0.41849859
[3,]  1.3302694  1.1253323  1.1675652 0.69553664 -0.7166227 -0.73464799
[4,] -0.1599902 -1.5310632  0.3550050 0.04303697 -1.0789967  0.75743767
[5,] -0.7329375  1.0829603 -2.6768307 0.17071586 -1.9356489  0.02996089
           [,13]      [,14]       [,15]      [,16]      [,17]       [,18]
[1,]  1.29652171 -0.1692721  0.62752680 -1.7405442 -0.1032296 -0.21554035
[2,]  0.14294503  0.2798048 -1.25224858  0.1938744 -0.7464631 -0.44273824
[3,] -0.01391168 -0.6110754 -0.83630316  2.1579013 -0.8324689 -0.38059007
[4,] -0.94441790 -2.0179811 -0.19380601 -0.1048678  1.0138324  0.47823200
[5,] -0.90190087  0.3607614  0.03685744 -0.2700448  0.4226020  0.02821497
          [,19]      [,20]
[1,] -1.0422282  0.8773396
[2,]  1.0453402  1.8961220
[3,] -0.3564250  0.2027513
[4,] -0.4578656  0.4678642
[5,] -1.3399367 -0.8977178
> 
> 
> 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 :  649  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.5006415 -1.275314 -1.178707 -0.898434 -0.7668486 0.4213044 0.1759897
          col8      col9     col10    col11      col12      col13     col14
row1 0.1959649 0.7236232 -1.869558 0.920384 -0.3534674 0.07011874 0.2588955
          col15       col16     col17    col18      col19      col20
row1 -0.3839377 -0.07855878 0.0485534 2.452264 -0.5588484 -0.3492191
> tmp[,"col10"]
          col10
row1 -1.8695584
row2 -0.4396453
row3  0.3264511
row4 -1.2353666
row5 -1.0219870
> tmp[c("row1","row5"),]
           col1       col2       col3       col4        col5      col6
row1 -0.5006415 -1.2753139 -1.1787068 -0.8984340 -0.76684855 0.4213044
row5 -1.8372409  0.1944009 -0.4079322  0.9397762  0.09203771 0.1172950
           col7      col8       col9     col10     col11      col12      col13
row1  0.1759897 0.1959649  0.7236232 -1.869558  0.920384 -0.3534674 0.07011874
row5 -0.4737267 0.6776865 -0.4374124 -1.021987 -1.436359 -0.2217890 0.02761409
         col14      col15       col16     col17     col18       col19
row1 0.2588955 -0.3839377 -0.07855878 0.0485534 2.4522637 -0.55884836
row5 0.7373769 -0.6037326  0.57134655 0.5618586 0.4093374 -0.02968521
          col20
row1 -0.3492191
row5  0.9681849
> tmp[,c("col6","col20")]
            col6      col20
row1 0.421304356 -0.3492191
row2 0.678535705 -1.3456891
row3 0.008846388 -1.0147014
row4 1.398468624  0.7648067
row5 0.117294960  0.9681849
> tmp[c("row1","row5"),c("col6","col20")]
          col6      col20
row1 0.4213044 -0.3492191
row5 0.1172950  0.9681849
> 
> 
> 
> 
> tmp["row1",] <- rnorm(20,mean=10)
> tmp[,"col10"] <- rnorm(5,mean=30)
> tmp[c("row1","row5"),] <- rnorm(40,mean=50)
> tmp[,c("col6","col20")] <- rnorm(10,mean=75)
> tmp[c("row1","row5"),c("col6","col20")]  <- rnorm(4,mean=105)
> 
> tmp["row1",]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 50.02199 48.66039 49.73687 49.46489 50.08045 104.5451 51.60957 50.89988
         col9    col10    col11    col12    col13    col14    col15    col16
row1 50.41184 47.68691 50.82498 49.11788 47.74285 49.10281 49.29091 50.01814
        col17    col18    col19   col20
row1 49.13877 50.08346 50.43115 104.168
> tmp[,"col10"]
        col10
row1 47.68691
row2 30.35016
row3 28.57417
row4 31.41664
row5 49.43567
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 50.02199 48.66039 49.73687 49.46489 50.08045 104.5451 51.60957 50.89988
row5 49.52015 49.97049 49.30930 51.08936 49.09871 105.5811 48.05501 50.68337
         col9    col10    col11    col12    col13    col14    col15    col16
row1 50.41184 47.68691 50.82498 49.11788 47.74285 49.10281 49.29091 50.01814
row5 49.55311 49.43567 50.94180 50.32211 51.30427 50.83116 47.98230 51.26302
        col17    col18    col19    col20
row1 49.13877 50.08346 50.43115 104.1680
row5 49.99855 49.89466 48.55313 105.1342
> tmp[,c("col6","col20")]
          col6     col20
row1 104.54512 104.16796
row2  74.20432  74.22783
row3  75.59919  75.28516
row4  75.02725  76.47661
row5 105.58109 105.13418
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 104.5451 104.1680
row5 105.5811 105.1342
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 104.5451 104.1680
row5 105.5811 105.1342
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
           col13
[1,]  1.56831247
[2,]  0.09073074
[3,] -1.25709927
[4,] -2.06611892
[5,] -0.45739953
> tmp[,c("col17","col7")]
          col17        col7
[1,] -0.7717898 -0.55168759
[2,]  0.8817111  0.58572029
[3,]  0.4613036  0.04918616
[4,] -0.1408815 -0.32550829
[5,] -1.7306157 -0.26275512
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
           col6       col20
[1,] -0.2464130 -0.53711526
[2,] -1.0717511  1.37524005
[3,]  0.6102406 -1.62753577
[4,]  0.2261491 -0.55057131
[5,]  1.8525613 -0.06431903
> subBufferedMatrix(tmp,1,c("col6"))[,1]
          col1
[1,] -0.246413
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
          col6
[1,] -0.246413
[2,] -1.071751
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> 
> 
> 
> subBufferedMatrix(tmp,c("row3","row1"),)[,1:20]
         [,1]      [,2]       [,3]      [,4]      [,5]      [,6]       [,7]
row3 1.243594 -1.798022  0.6061621 1.2237087 0.2329499 0.3453166  0.3286417
row1 1.256976 -1.754331 -0.7542523 0.3786418 0.3611317 0.1696037 -0.1985172
           [,8]       [,9]      [,10]     [,11]      [,12]      [,13]     [,14]
row3  0.8554968 -0.6433227 -0.4310445 -1.122713 -0.6775739 -0.0275747 0.1083794
row1 -0.5047265 -1.5521875  1.2649564 -0.897316  0.5545534 -0.9662883 2.1986920
          [,15]      [,16]      [,17]     [,18]     [,19]    [,20]
row3  0.6042183 -0.3051486  0.1156994 0.6796290 0.5822818 -1.05535
row1 -0.4414307  0.4439090 -1.1226183 0.5665985 1.3771416  1.06158
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
         [,1]     [,2]       [,3]       [,4]       [,5]      [,6]      [,7]
row2 2.750136 0.797649 -0.6274046 -0.1540158 -0.7590882 -1.564243 -2.044089
         [,8]      [,9]       [,10]
row2 0.639817 -1.188298 -0.08776396
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
         [,1]        [,2]     [,3]      [,4]       [,5]      [,6]      [,7]
row5 1.387697 -0.07537439 1.247905 0.6153041 0.01870162 0.3175158 0.4378458
          [,8]       [,9]     [,10]      [,11]      [,12]      [,13]      [,14]
row5 0.6420423 -0.3495439 0.2004805 -0.7337613 0.02977619 -0.3907524 -0.8752077
          [,15]      [,16]    [,17]     [,18]     [,19]      [,20]
row5 -0.3358156 -0.6831476 2.258439 -0.879683 0.2820366 -0.5608678
> 
> 
> 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: 0x600001fdc0c0>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BMa58363452e9c"
 [2] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BMa58352f736ae"
 [3] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BMa5836427040f"
 [4] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BMa5833d7ba827"
 [5] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BMa58315cb7fa" 
 [6] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BMa5836e327ec8"
 [7] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BMa5833521b4fd"
 [8] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BMa58337f1694b"
 [9] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BMa5834a37d79e"
[10] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BMa583182cec23"
[11] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BMa5832d42fa3b"
[12] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BMa58383a4eb4" 
[13] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BMa5832c050fa4"
[14] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BMa58345ee90"  
[15] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BMa5836f313013"
> 
> 
> ### 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: 0x600001fd8360>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x600001fd8360>
Warning message:
In dir.create(new.directory) :
  '/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x600001fd8360>
> rowMedians(tmp)
  [1] -0.480188497  0.111956397  0.127732996  0.374909385 -0.104387786
  [6] -0.079387061 -0.261263847  0.558946179 -0.017055713 -0.279368642
 [11] -0.153452682 -0.227280111  0.139569713 -0.128138802 -0.463337525
 [16]  0.101849421 -0.135326794  0.030507461 -0.254861564  0.056841730
 [21] -0.080290256  0.289200662 -0.163980693  0.284804646 -0.297811422
 [26]  0.198817046  0.320621957  0.106999476  0.102692891 -0.369664187
 [31] -0.377945331 -0.005380030  0.072664511  0.063880356  0.463947364
 [36] -0.405388551  0.072639633  0.027733837  0.071024411 -0.103032016
 [41]  0.154466952  0.037167120  0.436436751 -0.584161426  0.073490663
 [46]  0.097418507  0.498026064 -0.169274119  0.157681571  0.343666622
 [51]  0.333869926 -0.320398864 -0.056223237  0.095130040  0.349071450
 [56] -0.021674241  0.099826417  0.070806202  0.066814889  0.041680279
 [61] -0.186901294 -0.021837563  0.551020907  0.495956684  0.092287753
 [66]  0.031180467 -0.122866671  0.588131998 -0.627995845  0.327207805
 [71]  0.134774250 -0.601302579  0.097172783 -0.411696642 -0.245553859
 [76] -0.225612180 -0.395417851 -0.090277078  0.472756957  0.089968290
 [81]  0.035172610 -0.006452774 -0.145591899 -0.249115866  0.051119756
 [86] -0.414648911 -0.324757018 -0.032408294  0.349002993  0.181964660
 [91] -0.139100479 -0.106102662  0.593122121 -0.030506960 -0.142817830
 [96] -0.202878661 -0.242014619 -0.449917924 -1.011481328 -0.286970632
[101] -0.247484645 -0.157031960 -0.089931314 -0.038887130 -0.169074667
[106]  0.708304883 -0.523130866 -0.079209799 -0.069375186 -0.009771806
[111]  0.073307043  0.169209983  0.138871765  0.215464422 -0.076560059
[116] -0.498367134  0.345364279 -0.242817249  0.090653327 -0.302769614
[121]  0.159406713 -0.264677305 -0.101871896 -0.118703638  0.105899205
[126] -0.059423849 -0.873243166  0.279301235  0.392173884  0.693593027
[131] -0.442643114  0.175682504  0.328279497  0.551410657  0.774245800
[136]  0.326024283  0.180333266  0.194225078  0.074997579 -0.327665787
[141]  0.338078319 -0.107550486  0.461095469 -0.497822478 -0.291336033
[146]  0.353759212 -0.423151485 -0.187830814  0.070136105  0.732914301
[151]  0.001671790 -0.141408059  0.064398566  0.199851635  0.405761566
[156]  0.377901044 -0.308381781  0.105674500  0.114253208 -0.031521267
[161] -0.312945808 -0.316768674  0.824955457 -0.209202616  0.296772405
[166]  0.284730809 -0.057156760 -0.173867253  0.260928837  0.281718345
[171]  0.286171097 -0.042366267  0.184636968  0.165795210  0.212121428
[176]  0.106329280  0.355768274 -0.632806837  0.273831321  0.474843186
[181]  0.204860354 -0.071879233 -0.592962738  0.129821800 -0.088071018
[186] -0.195892133 -0.087080780  0.006088232 -0.015334389  0.018964156
[191]  0.251938043 -0.217583598  0.745432877 -0.109472472 -0.467178182
[196]  0.080312529 -0.535084743  0.105426400  0.222837216  0.222551013
[201] -0.136177008 -0.521773979 -0.354043042 -0.324150726 -0.320818602
[206]  0.078640675 -0.132120389 -0.365932709 -0.611762861 -0.497434448
[211] -0.016371251 -0.538453861 -0.059111844  0.202742513  0.436056866
[216] -0.363299759  0.008653082 -0.389560977  0.040513940  0.337573840
[221] -0.166997305 -0.359026221 -0.382050273  0.228066578  0.347658654
[226]  0.217271189  0.458930319 -0.433910596 -0.261890455  0.343940925
> 
> proc.time()
   user  system elapsed 
  0.687   3.514   4.509 

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: 0x600003854060>
> .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: 0x600003854060>
> .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: 0x600003854060>
> .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: 0x600003854060>
> 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: 0x600003878000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600003878000>
> .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: 0x600003878000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600003878000>
> .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: 0x600003878000>
> 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: 0x600003854420>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600003854420>
> .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: 0x600003854420>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x600003854420>
> .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: 0x600003854420>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x600003854420>
> .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: 0x600003854420>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x600003854420>
> .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: 0x600003854420>
> 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: 0x600003874000>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x600003874000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600003874000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600003874000>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFileab403c81f057" "BufferedMatrixFileab4076c9fec9"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFileab403c81f057" "BufferedMatrixFileab4076c9fec9"
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x600003874240>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600003874240>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x600003874240>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x600003874240>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x600003874240>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x600003874240>
> .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: 0x600003870000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600003870000>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x600003870000>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x600003870000>
> 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: 0x600003870180>
> .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: 0x600003870180>
> rm(P)
> 
> proc.time()
   user  system elapsed 
  0.131   0.068   0.200 

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.125   0.033   0.160 

Example timings