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

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

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

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


CHECK results for BufferedMatrix on nebbiolo1

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: /home/biocbuild/bbs-3.23-bioc/R/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/home/biocbuild/bbs-3.23-bioc/R/site-library --timings BufferedMatrix_1.75.0.tar.gz
StartedAt: 2026-03-20 21:43:42 -0400 (Fri, 20 Mar 2026)
EndedAt: 2026-03-20 21:44:07 -0400 (Fri, 20 Mar 2026)
EllapsedTime: 25.0 seconds
RetCode: 0
Status:   OK  
CheckDir: BufferedMatrix.Rcheck
Warnings: 0

Command output

##############################################################################
##############################################################################
###
### Running command:
###
###   /home/biocbuild/bbs-3.23-bioc/R/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/home/biocbuild/bbs-3.23-bioc/R/site-library --timings BufferedMatrix_1.75.0.tar.gz
###
##############################################################################
##############################################################################


* using log directory ‘/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck’
* using R Under development (unstable) (2026-03-05 r89546)
* using platform: x86_64-pc-linux-gnu
* R was compiled by
    gcc (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0
    GNU Fortran (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0
* running under: Ubuntu 24.04.4 LTS
* using session charset: UTF-8
* current time: 2026-03-21 01:43:42 UTC
* 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 ... OK
* used C compiler: ‘gcc (Ubuntu 13.3.0-6ubuntu2~24.04.1) 13.3.0’
* 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 loading without being on the library search path ... 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’ ...* 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 re-building of vignette outputs ... OK
* checking PDF version of manual ... OK
* DONE

Status: 1 NOTE
See
  ‘/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/00check.log’
for details.


Installation output

BufferedMatrix.Rcheck/00install.out

##############################################################################
##############################################################################
###
### Running command:
###
###   /home/biocbuild/bbs-3.23-bioc/R/bin/R CMD INSTALL BufferedMatrix
###
##############################################################################
##############################################################################


* installing to library ‘/home/biocbuild/bbs-3.23-bioc/R/site-library’
* installing *source* package ‘BufferedMatrix’ ...
** this is package ‘BufferedMatrix’ version ‘1.75.0’
** using staged installation
** libs
using C compiler: ‘gcc (Ubuntu 13.3.0-6ubuntu2~24.04.1) 13.3.0’
gcc -std=gnu2x -I"/home/biocbuild/bbs-3.23-bioc/R/include" -DNDEBUG   -I/usr/local/include    -fpic  -g -O2  -Wall -Werror=format-security -c RBufferedMatrix.c -o RBufferedMatrix.o
gcc -std=gnu2x -I"/home/biocbuild/bbs-3.23-bioc/R/include" -DNDEBUG   -I/usr/local/include    -fpic  -g -O2  -Wall -Werror=format-security -c doubleBufferedMatrix.c -o doubleBufferedMatrix.o
doubleBufferedMatrix.c: In function ‘dbm_ReadOnlyMode’:
doubleBufferedMatrix.c:1580:7: warning: suggest parentheses around operand of ‘!’ or change ‘&’ to ‘&&’ or ‘!’ to ‘~’ [-Wparentheses]
 1580 |   if (!(Matrix->readonly) & setting){
      |       ^~~~~~~~~~~~~~~~~~~
doubleBufferedMatrix.c: At top level:
doubleBufferedMatrix.c:3327:12: warning: ‘sort_double’ defined but not used [-Wunused-function]
 3327 | static int sort_double(const double *a1,const double *a2){
      |            ^~~~~~~~~~~
gcc -std=gnu2x -I"/home/biocbuild/bbs-3.23-bioc/R/include" -DNDEBUG   -I/usr/local/include    -fpic  -g -O2  -Wall -Werror=format-security -c doubleBufferedMatrix_C_tests.c -o doubleBufferedMatrix_C_tests.o
gcc -std=gnu2x -I"/home/biocbuild/bbs-3.23-bioc/R/include" -DNDEBUG   -I/usr/local/include    -fpic  -g -O2  -Wall -Werror=format-security -c init_package.c -o init_package.o
gcc -std=gnu2x -shared -L/home/biocbuild/bbs-3.23-bioc/R/lib -L/usr/local/lib -o BufferedMatrix.so RBufferedMatrix.o doubleBufferedMatrix.o doubleBufferedMatrix_C_tests.o init_package.o -L/home/biocbuild/bbs-3.23-bioc/R/lib -lR
installing to /home/biocbuild/bbs-3.23-bioc/R/site-library/00LOCK-BufferedMatrix/00new/BufferedMatrix/libs
** R
** inst
** byte-compile and prepare package for lazy loading
Creating a new generic function for ‘rowMeans’ in package ‘BufferedMatrix’
Creating a new generic function for ‘rowSums’ in package ‘BufferedMatrix’
Creating a new generic function for ‘colMeans’ in package ‘BufferedMatrix’
Creating a new generic function for ‘colSums’ in package ‘BufferedMatrix’
Creating a generic function for ‘ncol’ from package ‘base’ in package ‘BufferedMatrix’
Creating a generic function for ‘nrow’ from package ‘base’ in package ‘BufferedMatrix’
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
** checking absolute paths in shared objects and dynamic libraries
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (BufferedMatrix)

Tests output

BufferedMatrix.Rcheck/tests/c_code_level_tests.Rout


R Under development (unstable) (2026-03-05 r89546) -- "Unsuffered Consequences"
Copyright (C) 2026 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu

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.250   0.039   0.276 

BufferedMatrix.Rcheck/tests/objectTesting.Rout


R Under development (unstable) (2026-03-05 r89546) -- "Unsuffered Consequences"
Copyright (C) 2026 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu

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] "/home/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) max used (Mb)
Ncells 479482 25.7    1050322 56.1   639251 34.2
Vcells 886403  6.8    8388608 64.0  2083267 15.9
> 
> 
> 
> 
> ##
> ## checking reads
> ##
> 
> tmp2 <- createBufferedMatrix(10,20)
> 
> test.sample <- rnorm(10*20)
> 
> tmp2[1:10,1:20] <- test.sample
> 
> test.matrix <- matrix(test.sample,10,20)
> 
> ## testing reads
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   which.col <- sample(1:20,1)
+   if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> date()
[1] "Fri Mar 20 21:43:57 2026"
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> date()
[1] "Fri Mar 20 21:43:57 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: 0x61c201d6b4f0>
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   which.col <- sample(1:20,1)
+   if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,5,replace=TRUE)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> date()
[1] "Fri Mar 20 21:43:58 2026"
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col <- sample(1:20,5,replace=TRUE)
+   if (!all(tmp2[which.row,which.col] == test.matrix[which.row,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> date()
[1] "Fri Mar 20 21:43:58 2026"
> 
> ColMode(tmp2)
<pointer: 0x61c201d6b4f0>
> 
> 
> 
> ### Now testing assignments
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+ 
+   new.data <- rnorm(20)
+   tmp2[which.row,] <- new.data
+   test.matrix[which.row,] <- new.data
+   if (rep > 1){
+     if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+   
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   new.data <- rnorm(10)
+   tmp2[,which.col] <- new.data
+   test.matrix[,which.col]<- new.data
+ 
+   if (rep > 1){
+     if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.col <- which.col
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,5,replace=TRUE)
+   new.data <- matrix(rnorm(50),5,10)
+   tmp2[,which.col] <- new.data
+   test.matrix[,which.col]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.col <- which.col
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   new.data <- matrix(rnorm(50),5,10)
+   tmp2[which.row,] <- new.data
+   test.matrix[which.row,]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col  <- sample(1:20,5,replace=TRUE)
+   new.data <- matrix(rnorm(25),5,5)
+   tmp2[which.row,which.col] <- new.data
+   test.matrix[which.row,which.col]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[prev.row,prev.col] == test.matrix[prev.row,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+   prev.col <- which.col
+ }
> 
> 
> 
> 
> ###
> ###
> ### testing some more functions
> ###
> 
> 
> 
> ## duplication function
> tmp5 <- duplicate(tmp2)
> 
> # making sure really did copy everything.
> tmp5[1,1] <- tmp5[1,1] +100.00
> 
> if (tmp5[1,1] == tmp2[1,1]){
+   stop("Problem with duplication")
+ }
> 
> 
> 
> 
> ### testing elementwise applying of functions
> 
> tmp5[1:4,1:4]
           [,1]        [,2]         [,3]       [,4]
[1,] 99.9539981  0.13989898 -0.005437868  2.6466910
[2,] -1.3788199 -1.68561578  1.700909370 -0.8830574
[3,] -1.2838938  0.87377069 -1.918140669  1.1827488
[4,]  0.1595672  0.07774388  0.886352477 -0.4460885
> ewApply(tmp5,abs)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
           [,1]       [,2]        [,3]      [,4]
[1,] 99.9539981 0.13989898 0.005437868 2.6466910
[2,]  1.3788199 1.68561578 1.700909370 0.8830574
[3,]  1.2838938 0.87377069 1.918140669 1.1827488
[4,]  0.1595672 0.07774388 0.886352477 0.4460885
> ewApply(tmp5,sqrt)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
          [,1]      [,2]      [,3]      [,4]
[1,] 9.9976996 0.3740307 0.0737419 1.6268654
[2,] 1.1742316 1.2983127 1.3041892 0.9397113
[3,] 1.1330904 0.9347570 1.3849696 1.0875425
[4,] 0.3994587 0.2788259 0.9414629 0.6678986
> 
> 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:    /home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
          [,1]     [,2]     [,3]     [,4]
[1,] 224.93099 28.88021 25.74286 43.91534
[2,]  38.12114 39.66874 39.74280 35.28017
[3,]  37.61480 35.22134 40.76784 37.05817
[4,]  29.15415 27.86600 35.30098 32.12507
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x61c2033c95a0>
> exp(tmp5)
<pointer: 0x61c2033c95a0>
> log(tmp5,2)
<pointer: 0x61c2033c95a0>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 468.1644
> Min(tmp5)
[1] 53.50802
> mean(tmp5)
[1] 73.61262
> Sum(tmp5)
[1] 14722.52
> Var(tmp5)
[1] 860.1068
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 90.42605 70.72811 75.64393 72.14397 72.79537 71.44838 71.72045 70.50925
 [9] 70.23761 70.47306
> rowSums(tmp5)
 [1] 1808.521 1414.562 1512.879 1442.879 1455.907 1428.968 1434.409 1410.185
 [9] 1404.752 1409.461
> rowVars(tmp5)
 [1] 7998.30103   66.72496   66.73467   84.43297  101.02864   89.33855
 [7]   47.23462   74.98678   57.65705   67.19976
> rowSd(tmp5)
 [1] 89.433221  8.168535  8.169129  9.188742 10.051300  9.451907  6.872745
 [8]  8.659491  7.593224  8.197546
> rowMax(tmp5)
 [1] 468.16439  82.71943  97.93345  96.83644  94.56559  93.52824  88.77515
 [8]  91.16910  86.52228  86.77020
> rowMin(tmp5)
 [1] 53.58038 56.65447 61.54621 57.96465 53.50802 57.24452 60.24188 58.70952
 [9] 59.07563 54.02380
> 
> colMeans(tmp5)
 [1] 106.98577  69.59144  71.71490  72.95534  72.42414  70.09328  73.75089
 [8]  73.04364  75.57152  76.34176  67.89736  70.05995  67.76334  70.59076
[15]  74.37990  68.96458  71.74515  73.11953  70.83312  74.42603
> colSums(tmp5)
 [1] 1069.8577  695.9144  717.1490  729.5534  724.2414  700.9328  737.5089
 [8]  730.4364  755.7152  763.4176  678.9736  700.5995  677.6334  705.9076
[15]  743.7990  689.6458  717.4515  731.1953  708.3312  744.2603
> colVars(tmp5)
 [1] 16168.80695    80.38184    95.35717    86.73385    34.92095    36.84599
 [7]   129.25370    40.87397    43.09551    60.12769   102.40473    47.68575
[13]   123.82287    76.43726   131.97056    40.56526    23.93205    81.62456
[19]    66.35285   121.90234
> colSd(tmp5)
 [1] 127.156624   8.965592   9.765100   9.313101   5.909395   6.070090
 [7]  11.368980   6.393276   6.564717   7.754205  10.119522   6.905487
[13]  11.127572   8.742840  11.487844   6.369086   4.892039   9.034631
[19]   8.145726  11.040939
> colMax(tmp5)
 [1] 468.16439  82.56529  84.85291  91.40404  80.26923  82.50485  96.83644
 [8]  82.12199  86.25303  86.74339  82.28724  82.90519  93.52824  88.77515
[15]  94.56559  81.48424  77.61292  88.61258  78.45708  97.93345
> colMin(tmp5)
 [1] 55.03385 57.99943 53.58038 61.93961 59.35391 58.70952 56.65447 63.85898
 [9] 66.55164 64.91228 53.50802 59.07563 59.51264 57.96465 60.63030 58.93191
[17] 65.30085 54.28587 57.95342 57.24452
> 
> 
> ### 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]       NA 70.72811 75.64393 72.14397 72.79537 71.44838 71.72045 70.50925
 [9] 70.23761 70.47306
> rowSums(tmp5)
 [1]       NA 1414.562 1512.879 1442.879 1455.907 1428.968 1434.409 1410.185
 [9] 1404.752 1409.461
> rowVars(tmp5)
 [1] 8442.59515   66.72496   66.73467   84.43297  101.02864   89.33855
 [7]   47.23462   74.98678   57.65705   67.19976
> rowSd(tmp5)
 [1] 91.883596  8.168535  8.169129  9.188742 10.051300  9.451907  6.872745
 [8]  8.659491  7.593224  8.197546
> rowMax(tmp5)
 [1]       NA 82.71943 97.93345 96.83644 94.56559 93.52824 88.77515 91.16910
 [9] 86.52228 86.77020
> rowMin(tmp5)
 [1]       NA 56.65447 61.54621 57.96465 53.50802 57.24452 60.24188 58.70952
 [9] 59.07563 54.02380
> 
> colMeans(tmp5)
 [1] 106.98577  69.59144  71.71490        NA  72.42414  70.09328  73.75089
 [8]  73.04364  75.57152  76.34176  67.89736  70.05995  67.76334  70.59076
[15]  74.37990  68.96458  71.74515  73.11953  70.83312  74.42603
> colSums(tmp5)
 [1] 1069.8577  695.9144  717.1490        NA  724.2414  700.9328  737.5089
 [8]  730.4364  755.7152  763.4176  678.9736  700.5995  677.6334  705.9076
[15]  743.7990  689.6458  717.4515  731.1953  708.3312  744.2603
> colVars(tmp5)
 [1] 16168.80695    80.38184    95.35717          NA    34.92095    36.84599
 [7]   129.25370    40.87397    43.09551    60.12769   102.40473    47.68575
[13]   123.82287    76.43726   131.97056    40.56526    23.93205    81.62456
[19]    66.35285   121.90234
> colSd(tmp5)
 [1] 127.156624   8.965592   9.765100         NA   5.909395   6.070090
 [7]  11.368980   6.393276   6.564717   7.754205  10.119522   6.905487
[13]  11.127572   8.742840  11.487844   6.369086   4.892039   9.034631
[19]   8.145726  11.040939
> colMax(tmp5)
 [1] 468.16439  82.56529  84.85291        NA  80.26923  82.50485  96.83644
 [8]  82.12199  86.25303  86.74339  82.28724  82.90519  93.52824  88.77515
[15]  94.56559  81.48424  77.61292  88.61258  78.45708  97.93345
> colMin(tmp5)
 [1] 55.03385 57.99943 53.58038       NA 59.35391 58.70952 56.65447 63.85898
 [9] 66.55164 64.91228 53.50802 59.07563 59.51264 57.96465 60.63030 58.93191
[17] 65.30085 54.28587 57.95342 57.24452
> 
> Max(tmp5,na.rm=TRUE)
[1] 468.1644
> Min(tmp5,na.rm=TRUE)
[1] 53.50802
> mean(tmp5,na.rm=TRUE)
[1] 73.52322
> Sum(tmp5,na.rm=TRUE)
[1] 14631.12
> Var(tmp5,na.rm=TRUE)
[1] 862.8441
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 90.37458 70.72811 75.64393 72.14397 72.79537 71.44838 71.72045 70.50925
 [9] 70.23761 70.47306
> rowSums(tmp5,na.rm=TRUE)
 [1] 1717.117 1414.562 1512.879 1442.879 1455.907 1428.968 1434.409 1410.185
 [9] 1404.752 1409.461
> rowVars(tmp5,na.rm=TRUE)
 [1] 8442.59515   66.72496   66.73467   84.43297  101.02864   89.33855
 [7]   47.23462   74.98678   57.65705   67.19976
> rowSd(tmp5,na.rm=TRUE)
 [1] 91.883596  8.168535  8.169129  9.188742 10.051300  9.451907  6.872745
 [8]  8.659491  7.593224  8.197546
> rowMax(tmp5,na.rm=TRUE)
 [1] 468.16439  82.71943  97.93345  96.83644  94.56559  93.52824  88.77515
 [8]  91.16910  86.52228  86.77020
> rowMin(tmp5,na.rm=TRUE)
 [1] 53.58038 56.65447 61.54621 57.96465 53.50802 57.24452 60.24188 58.70952
 [9] 59.07563 54.02380
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 106.98577  69.59144  71.71490  70.90548  72.42414  70.09328  73.75089
 [8]  73.04364  75.57152  76.34176  67.89736  70.05995  67.76334  70.59076
[15]  74.37990  68.96458  71.74515  73.11953  70.83312  74.42603
> colSums(tmp5,na.rm=TRUE)
 [1] 1069.8577  695.9144  717.1490  638.1493  724.2414  700.9328  737.5089
 [8]  730.4364  755.7152  763.4176  678.9736  700.5995  677.6334  705.9076
[15]  743.7990  689.6458  717.4515  731.1953  708.3312  744.2603
> colVars(tmp5,na.rm=TRUE)
 [1] 16168.80695    80.38184    95.35717    50.30412    34.92095    36.84599
 [7]   129.25370    40.87397    43.09551    60.12769   102.40473    47.68575
[13]   123.82287    76.43726   131.97056    40.56526    23.93205    81.62456
[19]    66.35285   121.90234
> colSd(tmp5,na.rm=TRUE)
 [1] 127.156624   8.965592   9.765100   7.092540   5.909395   6.070090
 [7]  11.368980   6.393276   6.564717   7.754205  10.119522   6.905487
[13]  11.127572   8.742840  11.487844   6.369086   4.892039   9.034631
[19]   8.145726  11.040939
> colMax(tmp5,na.rm=TRUE)
 [1] 468.16439  82.56529  84.85291  82.45845  80.26923  82.50485  96.83644
 [8]  82.12199  86.25303  86.74339  82.28724  82.90519  93.52824  88.77515
[15]  94.56559  81.48424  77.61292  88.61258  78.45708  97.93345
> colMin(tmp5,na.rm=TRUE)
 [1] 55.03385 57.99943 53.58038 61.93961 59.35391 58.70952 56.65447 63.85898
 [9] 66.55164 64.91228 53.50802 59.07563 59.51264 57.96465 60.63030 58.93191
[17] 65.30085 54.28587 57.95342 57.24452
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1]      NaN 70.72811 75.64393 72.14397 72.79537 71.44838 71.72045 70.50925
 [9] 70.23761 70.47306
> rowSums(tmp5,na.rm=TRUE)
 [1]    0.000 1414.562 1512.879 1442.879 1455.907 1428.968 1434.409 1410.185
 [9] 1404.752 1409.461
> rowVars(tmp5,na.rm=TRUE)
 [1]        NA  66.72496  66.73467  84.43297 101.02864  89.33855  47.23462
 [8]  74.98678  57.65705  67.19976
> rowSd(tmp5,na.rm=TRUE)
 [1]        NA  8.168535  8.169129  9.188742 10.051300  9.451907  6.872745
 [8]  8.659491  7.593224  8.197546
> rowMax(tmp5,na.rm=TRUE)
 [1]       NA 82.71943 97.93345 96.83644 94.56559 93.52824 88.77515 91.16910
 [9] 86.52228 86.77020
> rowMin(tmp5,na.rm=TRUE)
 [1]       NA 56.65447 61.54621 57.96465 53.50802 57.24452 60.24188 58.70952
 [9] 59.07563 54.02380
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1] 66.85481 70.64490 73.72985      NaN 72.45247 70.01752 73.58927 73.73648
 [9] 76.21045 75.31006 66.29848 70.00457 68.44944 71.03290 74.39786 69.39075
[17] 71.18636 75.21216 69.98601 75.47938
> colSums(tmp5,na.rm=TRUE)
 [1] 601.6933 635.8041 663.5686   0.0000 652.0723 630.1577 662.3034 663.6283
 [9] 685.8941 677.7905 596.6864 630.0412 616.0450 639.2961 669.5808 624.5168
[17] 640.6773 676.9095 629.8741 679.3144
> colVars(tmp5,na.rm=TRUE)
 [1]  71.85222  77.94473  61.60173        NA  39.27704  41.38717 145.11653
 [8]  40.58286  43.88978  55.66888  86.44579  53.61198 134.00490  83.79271
[15] 148.46325  43.59267  23.41086  42.56278  66.57407 124.65785
> colSd(tmp5,na.rm=TRUE)
 [1]  8.476569  8.828631  7.848677        NA  6.267139  6.433286 12.046432
 [8]  6.370467  6.624936  7.461158  9.297623  7.322020 11.576049  9.153836
[15] 12.184550  6.602475  4.838477  6.524015  8.159293 11.165028
> colMax(tmp5,na.rm=TRUE)
 [1] 79.34415 82.56529 84.85291     -Inf 80.26923 82.50485 96.83644 82.12199
 [9] 86.25303 86.74339 78.32731 82.90519 93.52824 88.77515 94.56559 81.48424
[17] 77.61292 88.61258 77.55519 97.93345
> colMin(tmp5,na.rm=TRUE)
 [1] 55.03385 57.99943 60.02830      Inf 59.35391 58.70952 56.65447 63.85898
 [9] 66.55164 64.91228 53.50802 59.07563 59.51264 57.96465 60.63030 58.93191
[17] 65.30085 68.14065 57.95342 57.24452
> 
> 
> 
> 
> 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] 275.2910 182.8057 297.4586 167.8582 229.6081 225.6190 254.3292 202.4990
 [9] 254.8864 360.1428
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 275.2910 182.8057 297.4586 167.8582 229.6081 225.6190 254.3292 202.4990
 [9] 254.8864 360.1428
> 
> 
> 
> 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 -5.684342e-14  2.842171e-14  5.684342e-14  0.000000e+00
 [6] -2.842171e-14 -8.526513e-14  0.000000e+00 -1.421085e-14 -2.415845e-13
[11] -2.842171e-14 -5.684342e-14 -5.684342e-14 -1.421085e-13 -5.684342e-14
[16] -1.989520e-13 -5.684342e-14 -7.105427e-14  0.000000e+00  2.842171e-14
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> ## making sure these things agree
> ##
> ## first when there is no NA
> 
> 
> 
> agree.checks <- function(buff.matrix,r.matrix,err.tol=1e-10){
+ 
+   if (Max(buff.matrix,na.rm=TRUE) != max(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Max")
+   }
+   
+ 
+   if (Min(buff.matrix,na.rm=TRUE) != min(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Min")
+   }
+ 
+ 
+   if (abs(Sum(buff.matrix,na.rm=TRUE)- sum(r.matrix,na.rm=TRUE)) > err.tol){
+ 
+     cat(Sum(buff.matrix,na.rm=TRUE),"\n")
+     cat(sum(r.matrix,na.rm=TRUE),"\n")
+     cat(Sum(buff.matrix,na.rm=TRUE) - sum(r.matrix,na.rm=TRUE),"\n")
+     
+     stop("No agreement in Sum")
+   }
+   
+   if (abs(mean(buff.matrix,na.rm=TRUE) - mean(r.matrix,na.rm=TRUE)) > err.tol){
+     stop("No agreement in mean")
+   }
+   
+   
+   if(abs(Var(buff.matrix,na.rm=TRUE) - var(as.vector(r.matrix),na.rm=TRUE)) > err.tol){
+     stop("No agreement in Var")
+   }
+   
+   
+ 
+   if(any(abs(rowMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,mean,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowMeans")
+   }
+   
+   
+   if(any(abs(colMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,mean,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colMeans")
+   }
+   
+   
+   if(any(abs(rowSums(buff.matrix,na.rm=TRUE)  -  apply(r.matrix,1,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in rowSums")
+   }
+   
+   
+   if(any(abs(colSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colSums")
+   }
+   
+   ### this is to get around the fact that R doesn't like to compute NA on an entire vector of NA when 
+   ### computing variance
+   my.Var <- function(x,na.rm=FALSE){
+    if (all(is.na(x))){
+      return(NA)
+    } else {
+      var(x,na.rm=na.rm)
+    }
+ 
+   }
+   
+   if(any(abs(rowVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+   
+   
+   if(any(abs(colVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+ 
+ 
+   if(any(abs(rowMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+ 
+   if(any(abs(colMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+   
+   
+   if(any(abs(rowMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+   
+ 
+   if(any(abs(colMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+ 
+   if(any(abs(colMedians(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,median,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMedian")
+   }
+ 
+   if(any(abs(colRanges(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,range,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colRanges")
+   }
+ 
+ 
+   
+ }
> 
> 
> 
> 
> 
> 
> 
> 
> 
> for (rep in 1:20){
+   copymatrix <- matrix(rnorm(200,150,15),10,20)
+   
+   tmp5[1:10,1:20] <- copymatrix
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ## now lets assign some NA values and check agreement
+ 
+   which.row <- sample(1:10,1,replace=TRUE)
+   which.col  <- sample(1:20,1,replace=TRUE)
+   
+   cat(which.row," ",which.col,"\n")
+   
+   tmp5[which.row,which.col] <- NA
+   copymatrix[which.row,which.col] <- NA
+   
+   agree.checks(tmp5,copymatrix)
+ 
+   ## make an entire row NA
+   tmp5[which.row,] <- NA
+   copymatrix[which.row,] <- NA
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ### also make an entire col NA
+   tmp5[,which.col] <- NA
+   copymatrix[,which.col] <- NA
+ 
+   agree.checks(tmp5,copymatrix)
+ 
+   ### now make 1 element non NA with NA in the rest of row and column
+ 
+   tmp5[which.row,which.col] <- rnorm(1,150,15)
+   copymatrix[which.row,which.col] <- tmp5[which.row,which.col]
+ 
+   agree.checks(tmp5,copymatrix)
+ }
4   3 
5   5 
10   19 
8   7 
4   5 
5   16 
8   2 
5   8 
2   14 
2   15 
1   19 
6   4 
6   15 
7   18 
9   12 
2   1 
2   6 
2   16 
10   7 
10   8 
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.764868
> Min(tmp)
[1] -2.646189
> mean(tmp)
[1] -0.03096842
> Sum(tmp)
[1] -3.096842
> Var(tmp)
[1] 1.118895
> 
> rowMeans(tmp)
[1] -0.03096842
> rowSums(tmp)
[1] -3.096842
> rowVars(tmp)
[1] 1.118895
> rowSd(tmp)
[1] 1.057778
> rowMax(tmp)
[1] 2.764868
> rowMin(tmp)
[1] -2.646189
> 
> colMeans(tmp)
  [1] -1.59933934 -0.31746388  0.89063068 -0.33628160 -0.99481362 -0.38552717
  [7]  0.98130959 -0.82951673 -0.27868577 -0.37500880 -0.77293022  1.10009722
 [13]  2.07081917  2.76486847 -0.82234606 -0.67290556 -0.04928828  0.45752490
 [19]  0.17694230 -0.39583671  0.81339660  1.12329909 -1.74359353  1.26004321
 [25]  0.99872554 -1.20437459 -1.90430228  0.44021661  0.08091989 -0.38516566
 [31]  0.67028577 -0.78321460 -0.59175275 -1.25177035  0.58658492  1.86964011
 [37]  0.25200025  0.10061788  0.64375205 -1.54622178  0.31954770  0.06324175
 [43]  0.24991611 -1.24552237  1.22656534  1.38794116  1.29626826  0.68392628
 [49]  0.76894687  0.14818606 -0.31150126  1.97260871  2.09194399 -1.29130812
 [55] -1.01276516 -0.08849203 -1.25162870  0.82227262  0.18832221 -2.64618919
 [61] -1.03433043  1.28809677  0.81197761 -0.33317552  0.61702926 -0.79350987
 [67]  1.12501535 -0.57817677 -1.00033555  0.29532284 -0.96946811 -2.07397652
 [73] -1.04760269  0.34315226 -0.50693790 -0.88257547  0.58580020 -0.05421366
 [79] -0.63536825  1.33622405 -1.08771403 -1.22812118 -0.22311144  0.85207353
 [85]  0.55390521 -0.64687508  0.10592198  0.43948487 -1.76948289 -1.20791929
 [91] -1.37666797  0.23736708  0.89071922  1.47012831 -0.41327030 -1.86330322
 [97] -0.17048076  1.69452695  0.08767168  0.65174277
> colSums(tmp)
  [1] -1.59933934 -0.31746388  0.89063068 -0.33628160 -0.99481362 -0.38552717
  [7]  0.98130959 -0.82951673 -0.27868577 -0.37500880 -0.77293022  1.10009722
 [13]  2.07081917  2.76486847 -0.82234606 -0.67290556 -0.04928828  0.45752490
 [19]  0.17694230 -0.39583671  0.81339660  1.12329909 -1.74359353  1.26004321
 [25]  0.99872554 -1.20437459 -1.90430228  0.44021661  0.08091989 -0.38516566
 [31]  0.67028577 -0.78321460 -0.59175275 -1.25177035  0.58658492  1.86964011
 [37]  0.25200025  0.10061788  0.64375205 -1.54622178  0.31954770  0.06324175
 [43]  0.24991611 -1.24552237  1.22656534  1.38794116  1.29626826  0.68392628
 [49]  0.76894687  0.14818606 -0.31150126  1.97260871  2.09194399 -1.29130812
 [55] -1.01276516 -0.08849203 -1.25162870  0.82227262  0.18832221 -2.64618919
 [61] -1.03433043  1.28809677  0.81197761 -0.33317552  0.61702926 -0.79350987
 [67]  1.12501535 -0.57817677 -1.00033555  0.29532284 -0.96946811 -2.07397652
 [73] -1.04760269  0.34315226 -0.50693790 -0.88257547  0.58580020 -0.05421366
 [79] -0.63536825  1.33622405 -1.08771403 -1.22812118 -0.22311144  0.85207353
 [85]  0.55390521 -0.64687508  0.10592198  0.43948487 -1.76948289 -1.20791929
 [91] -1.37666797  0.23736708  0.89071922  1.47012831 -0.41327030 -1.86330322
 [97] -0.17048076  1.69452695  0.08767168  0.65174277
> colVars(tmp)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> colSd(tmp)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> colMax(tmp)
  [1] -1.59933934 -0.31746388  0.89063068 -0.33628160 -0.99481362 -0.38552717
  [7]  0.98130959 -0.82951673 -0.27868577 -0.37500880 -0.77293022  1.10009722
 [13]  2.07081917  2.76486847 -0.82234606 -0.67290556 -0.04928828  0.45752490
 [19]  0.17694230 -0.39583671  0.81339660  1.12329909 -1.74359353  1.26004321
 [25]  0.99872554 -1.20437459 -1.90430228  0.44021661  0.08091989 -0.38516566
 [31]  0.67028577 -0.78321460 -0.59175275 -1.25177035  0.58658492  1.86964011
 [37]  0.25200025  0.10061788  0.64375205 -1.54622178  0.31954770  0.06324175
 [43]  0.24991611 -1.24552237  1.22656534  1.38794116  1.29626826  0.68392628
 [49]  0.76894687  0.14818606 -0.31150126  1.97260871  2.09194399 -1.29130812
 [55] -1.01276516 -0.08849203 -1.25162870  0.82227262  0.18832221 -2.64618919
 [61] -1.03433043  1.28809677  0.81197761 -0.33317552  0.61702926 -0.79350987
 [67]  1.12501535 -0.57817677 -1.00033555  0.29532284 -0.96946811 -2.07397652
 [73] -1.04760269  0.34315226 -0.50693790 -0.88257547  0.58580020 -0.05421366
 [79] -0.63536825  1.33622405 -1.08771403 -1.22812118 -0.22311144  0.85207353
 [85]  0.55390521 -0.64687508  0.10592198  0.43948487 -1.76948289 -1.20791929
 [91] -1.37666797  0.23736708  0.89071922  1.47012831 -0.41327030 -1.86330322
 [97] -0.17048076  1.69452695  0.08767168  0.65174277
> colMin(tmp)
  [1] -1.59933934 -0.31746388  0.89063068 -0.33628160 -0.99481362 -0.38552717
  [7]  0.98130959 -0.82951673 -0.27868577 -0.37500880 -0.77293022  1.10009722
 [13]  2.07081917  2.76486847 -0.82234606 -0.67290556 -0.04928828  0.45752490
 [19]  0.17694230 -0.39583671  0.81339660  1.12329909 -1.74359353  1.26004321
 [25]  0.99872554 -1.20437459 -1.90430228  0.44021661  0.08091989 -0.38516566
 [31]  0.67028577 -0.78321460 -0.59175275 -1.25177035  0.58658492  1.86964011
 [37]  0.25200025  0.10061788  0.64375205 -1.54622178  0.31954770  0.06324175
 [43]  0.24991611 -1.24552237  1.22656534  1.38794116  1.29626826  0.68392628
 [49]  0.76894687  0.14818606 -0.31150126  1.97260871  2.09194399 -1.29130812
 [55] -1.01276516 -0.08849203 -1.25162870  0.82227262  0.18832221 -2.64618919
 [61] -1.03433043  1.28809677  0.81197761 -0.33317552  0.61702926 -0.79350987
 [67]  1.12501535 -0.57817677 -1.00033555  0.29532284 -0.96946811 -2.07397652
 [73] -1.04760269  0.34315226 -0.50693790 -0.88257547  0.58580020 -0.05421366
 [79] -0.63536825  1.33622405 -1.08771403 -1.22812118 -0.22311144  0.85207353
 [85]  0.55390521 -0.64687508  0.10592198  0.43948487 -1.76948289 -1.20791929
 [91] -1.37666797  0.23736708  0.89071922  1.47012831 -0.41327030 -1.86330322
 [97] -0.17048076  1.69452695  0.08767168  0.65174277
> colMedians(tmp)
  [1] -1.59933934 -0.31746388  0.89063068 -0.33628160 -0.99481362 -0.38552717
  [7]  0.98130959 -0.82951673 -0.27868577 -0.37500880 -0.77293022  1.10009722
 [13]  2.07081917  2.76486847 -0.82234606 -0.67290556 -0.04928828  0.45752490
 [19]  0.17694230 -0.39583671  0.81339660  1.12329909 -1.74359353  1.26004321
 [25]  0.99872554 -1.20437459 -1.90430228  0.44021661  0.08091989 -0.38516566
 [31]  0.67028577 -0.78321460 -0.59175275 -1.25177035  0.58658492  1.86964011
 [37]  0.25200025  0.10061788  0.64375205 -1.54622178  0.31954770  0.06324175
 [43]  0.24991611 -1.24552237  1.22656534  1.38794116  1.29626826  0.68392628
 [49]  0.76894687  0.14818606 -0.31150126  1.97260871  2.09194399 -1.29130812
 [55] -1.01276516 -0.08849203 -1.25162870  0.82227262  0.18832221 -2.64618919
 [61] -1.03433043  1.28809677  0.81197761 -0.33317552  0.61702926 -0.79350987
 [67]  1.12501535 -0.57817677 -1.00033555  0.29532284 -0.96946811 -2.07397652
 [73] -1.04760269  0.34315226 -0.50693790 -0.88257547  0.58580020 -0.05421366
 [79] -0.63536825  1.33622405 -1.08771403 -1.22812118 -0.22311144  0.85207353
 [85]  0.55390521 -0.64687508  0.10592198  0.43948487 -1.76948289 -1.20791929
 [91] -1.37666797  0.23736708  0.89071922  1.47012831 -0.41327030 -1.86330322
 [97] -0.17048076  1.69452695  0.08767168  0.65174277
> colRanges(tmp)
          [,1]       [,2]      [,3]       [,4]       [,5]       [,6]      [,7]
[1,] -1.599339 -0.3174639 0.8906307 -0.3362816 -0.9948136 -0.3855272 0.9813096
[2,] -1.599339 -0.3174639 0.8906307 -0.3362816 -0.9948136 -0.3855272 0.9813096
           [,8]       [,9]      [,10]      [,11]    [,12]    [,13]    [,14]
[1,] -0.8295167 -0.2786858 -0.3750088 -0.7729302 1.100097 2.070819 2.764868
[2,] -0.8295167 -0.2786858 -0.3750088 -0.7729302 1.100097 2.070819 2.764868
          [,15]      [,16]       [,17]     [,18]     [,19]      [,20]     [,21]
[1,] -0.8223461 -0.6729056 -0.04928828 0.4575249 0.1769423 -0.3958367 0.8133966
[2,] -0.8223461 -0.6729056 -0.04928828 0.4575249 0.1769423 -0.3958367 0.8133966
        [,22]     [,23]    [,24]     [,25]     [,26]     [,27]     [,28]
[1,] 1.123299 -1.743594 1.260043 0.9987255 -1.204375 -1.904302 0.4402166
[2,] 1.123299 -1.743594 1.260043 0.9987255 -1.204375 -1.904302 0.4402166
          [,29]      [,30]     [,31]      [,32]      [,33]    [,34]     [,35]
[1,] 0.08091989 -0.3851657 0.6702858 -0.7832146 -0.5917527 -1.25177 0.5865849
[2,] 0.08091989 -0.3851657 0.6702858 -0.7832146 -0.5917527 -1.25177 0.5865849
       [,36]     [,37]     [,38]     [,39]     [,40]     [,41]      [,42]
[1,] 1.86964 0.2520002 0.1006179 0.6437521 -1.546222 0.3195477 0.06324175
[2,] 1.86964 0.2520002 0.1006179 0.6437521 -1.546222 0.3195477 0.06324175
         [,43]     [,44]    [,45]    [,46]    [,47]     [,48]     [,49]
[1,] 0.2499161 -1.245522 1.226565 1.387941 1.296268 0.6839263 0.7689469
[2,] 0.2499161 -1.245522 1.226565 1.387941 1.296268 0.6839263 0.7689469
         [,50]      [,51]    [,52]    [,53]     [,54]     [,55]       [,56]
[1,] 0.1481861 -0.3115013 1.972609 2.091944 -1.291308 -1.012765 -0.08849203
[2,] 0.1481861 -0.3115013 1.972609 2.091944 -1.291308 -1.012765 -0.08849203
         [,57]     [,58]     [,59]     [,60]    [,61]    [,62]     [,63]
[1,] -1.251629 0.8222726 0.1883222 -2.646189 -1.03433 1.288097 0.8119776
[2,] -1.251629 0.8222726 0.1883222 -2.646189 -1.03433 1.288097 0.8119776
          [,64]     [,65]      [,66]    [,67]      [,68]     [,69]     [,70]
[1,] -0.3331755 0.6170293 -0.7935099 1.125015 -0.5781768 -1.000336 0.2953228
[2,] -0.3331755 0.6170293 -0.7935099 1.125015 -0.5781768 -1.000336 0.2953228
          [,71]     [,72]     [,73]     [,74]      [,75]      [,76]     [,77]
[1,] -0.9694681 -2.073977 -1.047603 0.3431523 -0.5069379 -0.8825755 0.5858002
[2,] -0.9694681 -2.073977 -1.047603 0.3431523 -0.5069379 -0.8825755 0.5858002
           [,78]      [,79]    [,80]     [,81]     [,82]      [,83]     [,84]
[1,] -0.05421366 -0.6353682 1.336224 -1.087714 -1.228121 -0.2231114 0.8520735
[2,] -0.05421366 -0.6353682 1.336224 -1.087714 -1.228121 -0.2231114 0.8520735
         [,85]      [,86]    [,87]     [,88]     [,89]     [,90]     [,91]
[1,] 0.5539052 -0.6468751 0.105922 0.4394849 -1.769483 -1.207919 -1.376668
[2,] 0.5539052 -0.6468751 0.105922 0.4394849 -1.769483 -1.207919 -1.376668
         [,92]     [,93]    [,94]      [,95]     [,96]      [,97]    [,98]
[1,] 0.2373671 0.8907192 1.470128 -0.4132703 -1.863303 -0.1704808 1.694527
[2,] 0.2373671 0.8907192 1.470128 -0.4132703 -1.863303 -0.1704808 1.694527
          [,99]    [,100]
[1,] 0.08767168 0.6517428
[2,] 0.08767168 0.6517428
> 
> 
> Max(tmp2)
[1] 1.601196
> Min(tmp2)
[1] -1.851209
> mean(tmp2)
[1] -0.05548475
> Sum(tmp2)
[1] -5.548475
> Var(tmp2)
[1] 0.6468287
> 
> rowMeans(tmp2)
  [1] -1.037086278  0.240266998 -0.633438521 -0.335904664  0.149134139
  [6] -0.344278416  0.713909014 -0.179908062  0.055374942  0.768996924
 [11] -1.043246396  0.217299184  0.591778690 -0.722654025  1.601196183
 [16]  0.966743981 -0.750014597 -0.156512779  0.569448175  0.427597190
 [21] -1.329894093  0.364102065  0.352477248  0.737490777 -0.009615697
 [26] -1.851208911 -0.825680055  1.048708441  0.155677563 -0.565999254
 [31] -0.091929157  0.026913356 -0.240422895  1.482002482 -0.018175911
 [36] -1.778006280  1.116354823 -0.626351927 -0.256966997 -1.694698667
 [41]  0.950883822  0.774975721 -0.251560897  0.382650588 -1.726137271
 [46] -0.469286968  0.194880839  0.791421035  0.741838606 -0.678580974
 [51] -0.141412843  0.866904911 -0.125081592 -0.868148198 -1.707024084
 [56]  0.909691153 -0.688517464 -1.788802921 -1.051553503 -0.779776348
 [61]  0.624308538  0.215915685 -0.600948889  0.443678849 -0.625722480
 [66] -0.923200566  0.116202489 -1.100111903 -0.755670620  0.040047909
 [71]  0.596960620  0.675987178  1.548066208 -0.888451846  0.547446527
 [76]  0.253546034 -1.084438850  0.412469426  0.064120517  0.203351756
 [81] -1.088450430 -0.396853093 -0.029803709  1.054287130  0.355641550
 [86] -0.863504134  0.104909519 -0.618125290  0.858109636 -0.549245340
 [91]  0.735603644  0.843187083 -0.199743528  1.112463367  0.521074360
 [96] -0.963314324  0.964383109  0.394580716 -0.180215151  0.202140696
> rowSums(tmp2)
  [1] -1.037086278  0.240266998 -0.633438521 -0.335904664  0.149134139
  [6] -0.344278416  0.713909014 -0.179908062  0.055374942  0.768996924
 [11] -1.043246396  0.217299184  0.591778690 -0.722654025  1.601196183
 [16]  0.966743981 -0.750014597 -0.156512779  0.569448175  0.427597190
 [21] -1.329894093  0.364102065  0.352477248  0.737490777 -0.009615697
 [26] -1.851208911 -0.825680055  1.048708441  0.155677563 -0.565999254
 [31] -0.091929157  0.026913356 -0.240422895  1.482002482 -0.018175911
 [36] -1.778006280  1.116354823 -0.626351927 -0.256966997 -1.694698667
 [41]  0.950883822  0.774975721 -0.251560897  0.382650588 -1.726137271
 [46] -0.469286968  0.194880839  0.791421035  0.741838606 -0.678580974
 [51] -0.141412843  0.866904911 -0.125081592 -0.868148198 -1.707024084
 [56]  0.909691153 -0.688517464 -1.788802921 -1.051553503 -0.779776348
 [61]  0.624308538  0.215915685 -0.600948889  0.443678849 -0.625722480
 [66] -0.923200566  0.116202489 -1.100111903 -0.755670620  0.040047909
 [71]  0.596960620  0.675987178  1.548066208 -0.888451846  0.547446527
 [76]  0.253546034 -1.084438850  0.412469426  0.064120517  0.203351756
 [81] -1.088450430 -0.396853093 -0.029803709  1.054287130  0.355641550
 [86] -0.863504134  0.104909519 -0.618125290  0.858109636 -0.549245340
 [91]  0.735603644  0.843187083 -0.199743528  1.112463367  0.521074360
 [96] -0.963314324  0.964383109  0.394580716 -0.180215151  0.202140696
> rowVars(tmp2)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowSd(tmp2)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowMax(tmp2)
  [1] -1.037086278  0.240266998 -0.633438521 -0.335904664  0.149134139
  [6] -0.344278416  0.713909014 -0.179908062  0.055374942  0.768996924
 [11] -1.043246396  0.217299184  0.591778690 -0.722654025  1.601196183
 [16]  0.966743981 -0.750014597 -0.156512779  0.569448175  0.427597190
 [21] -1.329894093  0.364102065  0.352477248  0.737490777 -0.009615697
 [26] -1.851208911 -0.825680055  1.048708441  0.155677563 -0.565999254
 [31] -0.091929157  0.026913356 -0.240422895  1.482002482 -0.018175911
 [36] -1.778006280  1.116354823 -0.626351927 -0.256966997 -1.694698667
 [41]  0.950883822  0.774975721 -0.251560897  0.382650588 -1.726137271
 [46] -0.469286968  0.194880839  0.791421035  0.741838606 -0.678580974
 [51] -0.141412843  0.866904911 -0.125081592 -0.868148198 -1.707024084
 [56]  0.909691153 -0.688517464 -1.788802921 -1.051553503 -0.779776348
 [61]  0.624308538  0.215915685 -0.600948889  0.443678849 -0.625722480
 [66] -0.923200566  0.116202489 -1.100111903 -0.755670620  0.040047909
 [71]  0.596960620  0.675987178  1.548066208 -0.888451846  0.547446527
 [76]  0.253546034 -1.084438850  0.412469426  0.064120517  0.203351756
 [81] -1.088450430 -0.396853093 -0.029803709  1.054287130  0.355641550
 [86] -0.863504134  0.104909519 -0.618125290  0.858109636 -0.549245340
 [91]  0.735603644  0.843187083 -0.199743528  1.112463367  0.521074360
 [96] -0.963314324  0.964383109  0.394580716 -0.180215151  0.202140696
> rowMin(tmp2)
  [1] -1.037086278  0.240266998 -0.633438521 -0.335904664  0.149134139
  [6] -0.344278416  0.713909014 -0.179908062  0.055374942  0.768996924
 [11] -1.043246396  0.217299184  0.591778690 -0.722654025  1.601196183
 [16]  0.966743981 -0.750014597 -0.156512779  0.569448175  0.427597190
 [21] -1.329894093  0.364102065  0.352477248  0.737490777 -0.009615697
 [26] -1.851208911 -0.825680055  1.048708441  0.155677563 -0.565999254
 [31] -0.091929157  0.026913356 -0.240422895  1.482002482 -0.018175911
 [36] -1.778006280  1.116354823 -0.626351927 -0.256966997 -1.694698667
 [41]  0.950883822  0.774975721 -0.251560897  0.382650588 -1.726137271
 [46] -0.469286968  0.194880839  0.791421035  0.741838606 -0.678580974
 [51] -0.141412843  0.866904911 -0.125081592 -0.868148198 -1.707024084
 [56]  0.909691153 -0.688517464 -1.788802921 -1.051553503 -0.779776348
 [61]  0.624308538  0.215915685 -0.600948889  0.443678849 -0.625722480
 [66] -0.923200566  0.116202489 -1.100111903 -0.755670620  0.040047909
 [71]  0.596960620  0.675987178  1.548066208 -0.888451846  0.547446527
 [76]  0.253546034 -1.084438850  0.412469426  0.064120517  0.203351756
 [81] -1.088450430 -0.396853093 -0.029803709  1.054287130  0.355641550
 [86] -0.863504134  0.104909519 -0.618125290  0.858109636 -0.549245340
 [91]  0.735603644  0.843187083 -0.199743528  1.112463367  0.521074360
 [96] -0.963314324  0.964383109  0.394580716 -0.180215151  0.202140696
> 
> colMeans(tmp2)
[1] -0.05548475
> colSums(tmp2)
[1] -5.548475
> colVars(tmp2)
[1] 0.6468287
> colSd(tmp2)
[1] 0.8042566
> colMax(tmp2)
[1] 1.601196
> colMin(tmp2)
[1] -1.851209
> colMedians(tmp2)
[1] 0.03348063
> colRanges(tmp2)
          [,1]
[1,] -1.851209
[2,]  1.601196
> 
> dataset1 <- matrix(dataset1,1,100)
> 
> agree.checks(tmp,dataset1)
> 
> dataset2 <- matrix(dataset2,100,1)
> agree.checks(tmp2,dataset2)
>   
> 
> tmp <- createBufferedMatrix(10,10)
> 
> tmp[1:10,1:10] <- rnorm(100)
> colApply(tmp,sum)
 [1] -1.7670394 -4.1953282 -2.0857988 -1.6435723  1.0090192  0.6359393
 [7] -3.7964479  3.1907512 -4.0837046  4.4354551
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -1.5602274
[2,] -0.6135518
[3,] -0.3742608
[4,]  0.2106096
[5,]  1.9507003
> 
> rowApply(tmp,sum)
 [1] -1.4396571  3.0928010 -0.8721670 -4.2082354 -7.4737417  0.4375002
 [7] -1.8156663  1.2562877  2.2747659  0.4473864
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]   10    6    3    4    3    7    3    3    3     5
 [2,]    4    4    6    3    8    6    1    6    1     3
 [3,]    3    7    5    1    1    5   10    5    5     8
 [4,]    6    9    9    5    5    9    2    1    4     6
 [5,]    7    5    4    2    2    8    4    4   10    10
 [6,]    8    8    1    6   10    4    5    8    7     2
 [7,]    5    1    7    7    9    2    6    2    8     1
 [8,]    2    3    8   10    4   10    7    7    9     7
 [9,]    1    2    2    8    7    1    9    9    2     9
[10,]    9   10   10    9    6    3    8   10    6     4
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1]  0.8989826  1.4565799  0.6647762 -1.0671232  2.0082873 -1.3803330
 [7]  1.7445585 -1.9692745 -1.2521170 -1.0715824  1.4923179 -0.2088551
[13] -3.3509293  0.6440985 -0.9978883 -2.3878297 -0.1733217  3.5035970
[19] -1.6455032  2.3411744
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -2.1057712
[2,] -0.6478774
[3,]  0.6683324
[4,]  1.4651951
[5,]  1.5191036
> 
> rowApply(tmp,sum)
[1]  0.1490922 -3.2399674 -6.1198950  1.6798207  6.7805643
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]    4    1   19   20   13
[2,]    9   20   13   15    7
[3,]   18   10    6   12   11
[4,]   15    3   10    3   20
[5,]   17   19    3    8   19
> 
> 
> as.matrix(tmp)
           [,1]        [,2]        [,3]       [,4]         [,5]        [,6]
[1,] -0.6478774 -0.30075349  0.86393322  0.5236892  0.768402555  0.16673968
[2,] -2.1057712  1.45684750 -0.04417085 -1.1806509  1.404348313 -0.97496355
[3,]  1.4651951 -0.27304566 -1.13321976 -0.6547146 -1.528503839 -1.80188479
[4,]  1.5191036  0.49076864  0.35502101 -1.3349604 -0.007084613 -0.09606911
[5,]  0.6683324  0.08276293  0.62321254  1.5795135  1.371124922  1.32584477
            [,7]        [,8]       [,9]        [,10]      [,11]      [,12]
[1,] -0.03645211 -0.38235441 -0.1986954 -1.538012378 -0.3714111 -0.3425135
[2,] -0.50792535  0.19995677 -2.0352085 -0.008940197 -0.7023399  1.0520075
[3,]  0.45093636 -1.02080225  0.6313277  0.073090464  2.8912003 -0.6593108
[4,]  1.20252276  0.07841219  0.0319593  1.464208735 -0.7119619  0.1317462
[5,]  0.63547688 -0.84448681  0.3185000 -1.061929008  0.3868304 -0.3907846
          [,13]       [,14]       [,15]      [,16]      [,17]      [,18]
[1,] -1.1230275  0.07064914  0.58301759 -0.4148296 -1.3984932 -0.2839975
[2,] -1.1138961  0.46566436 -0.01432546 -0.6660424  0.6819051  0.6047595
[3,] -0.4639354 -1.21570151 -0.71357427 -0.6191291  0.7530414  1.0026215
[4,] -0.4207559  0.39009895 -1.61667373 -1.0295488  0.4033265  1.3536956
[5,] -0.2293144  0.93338754  0.76366758  0.3417202 -0.6131014  0.8265179
          [,19]      [,20]
[1,]  1.0717149  3.1393636
[2,] -0.9409822  1.1897602
[3,] -1.3770010 -1.9264849
[4,] -1.3384791  0.8144908
[5,]  0.9392443 -0.8759554
> 
> 
> is.BufferedMatrix(tmp)
[1] TRUE
> 
> as.BufferedMatrix(as.matrix(tmp))
BufferedMatrix object
Matrix size:  5 20 
Buffer size:  1 1 
Directory:    /home/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:    /home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  652  bytes.
Disk usage :  200  bytes.
> subBufferedMatrix(tmp,,5:8)
BufferedMatrix object
Matrix size:  5 4 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  566  bytes.
Disk usage :  160  bytes.
> subBufferedMatrix(tmp,1:3,)
BufferedMatrix object
Matrix size:  3 20 
Buffer size:  1 1 
Directory:    /home/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.4748373 0.5234322 1.05875 -0.804001 0.992267 -0.1183741 0.2995929
           col8       col9     col10      col11    col12      col13    col14
row1 -0.2208304 -0.7082607 0.3993855 -0.7629808 1.010256 -0.2834571 1.025899
          col15    col16     col17      col18     col19   col20
row1 -0.7065811 1.540417 0.5028013 -0.9000262 -1.178413 0.59098
> tmp[,"col10"]
          col10
row1  0.3993855
row2  0.6597771
row3 -0.4626832
row4  0.7776508
row5  0.1161789
> tmp[c("row1","row5"),]
           col1      col2     col3       col4      col5       col6       col7
row1 -0.4748373 0.5234322 1.058750 -0.8040010 0.9922670 -0.1183741  0.2995929
row5 -0.8608215 0.1971571 1.379715 -0.6740401 0.1620005 -0.5002252 -0.2606803
           col8       col9     col10       col11    col12      col13     col14
row1 -0.2208304 -0.7082607 0.3993855 -0.76298078 1.010256 -0.2834571 1.0258989
row5  0.1217673  0.7160417 0.1161789  0.04853684 1.185178  0.5792923 0.3533421
           col15    col16     col17      col18     col19    col20
row1 -0.70658112 1.540417 0.5028013 -0.9000262 -1.178413 0.590980
row5  0.02066107 1.280540 0.7560541 -0.7497993  1.132668 1.542649
> tmp[,c("col6","col20")]
           col6      col20
row1 -0.1183741  0.5909800
row2 -0.2166778  0.5166806
row3  1.6352649 -0.5812306
row4  1.5764971 -0.2717820
row5 -0.5002252  1.5426489
> tmp[c("row1","row5"),c("col6","col20")]
           col6    col20
row1 -0.1183741 0.590980
row5 -0.5002252 1.542649
> 
> 
> 
> 
> tmp["row1",] <- rnorm(20,mean=10)
> tmp[,"col10"] <- rnorm(5,mean=30)
> tmp[c("row1","row5"),] <- rnorm(40,mean=50)
> tmp[,c("col6","col20")] <- rnorm(10,mean=75)
> tmp[c("row1","row5"),c("col6","col20")]  <- rnorm(4,mean=105)
> 
> tmp["row1",]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 49.23162 50.03553 50.17413 49.80272 50.29958 105.0825 50.25811 49.13307
         col9    col10    col11    col12   col13    col14    col15    col16
row1 51.34664 50.40622 50.88618 50.40962 49.8818 51.67405 49.33847 49.57418
        col17    col18    col19    col20
row1 50.40212 50.61332 49.20023 106.7015
> tmp[,"col10"]
        col10
row1 50.40622
row2 29.43418
row3 28.66074
row4 29.78078
row5 48.92361
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 49.23162 50.03553 50.17413 49.80272 50.29958 105.0825 50.25811 49.13307
row5 50.15581 48.96706 50.23938 48.96036 49.39468 103.4656 50.07075 49.83842
         col9    col10    col11    col12    col13    col14    col15    col16
row1 51.34664 50.40622 50.88618 50.40962 49.88180 51.67405 49.33847 49.57418
row5 50.30217 48.92361 50.10928 50.60553 50.02404 50.75663 49.70968 50.89944
        col17    col18    col19    col20
row1 50.40212 50.61332 49.20023 106.7015
row5 49.23159 50.45965 50.53481 102.9818
> tmp[,c("col6","col20")]
          col6     col20
row1 105.08248 106.70150
row2  74.49015  73.19948
row3  74.63015  76.01161
row4  75.11459  74.27775
row5 103.46564 102.98181
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 105.0825 106.7015
row5 103.4656 102.9818
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 105.0825 106.7015
row5 103.4656 102.9818
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
           col13
[1,] -0.46681579
[2,]  0.01336921
[3,] -1.04114324
[4,] -2.00711284
[5,]  0.69368598
> tmp[,c("col17","col7")]
           col17       col7
[1,] -0.93155760  1.0730621
[2,]  1.21621210 -0.9741544
[3,] -1.01414110  1.4070284
[4,] -0.04984183 -0.0931999
[5,] -0.73091982 -0.1684545
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
           col6       col20
[1,] -0.5414838 -0.08709579
[2,] -1.5622632  0.57922904
[3,]  1.1338358 -0.89316834
[4,]  0.8681758 -0.01388961
[5,]  0.9157880 -0.54082815
> subBufferedMatrix(tmp,1,c("col6"))[,1]
           col1
[1,] -0.5414838
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
           col6
[1,] -0.5414838
[2,] -1.5622632
> 
> 
> 
> 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.1598505 0.7789490  0.8164875 -1.090600 1.4845401 -1.621301  0.1783246
row1  0.7569913 0.2872144 -0.6226832  1.033765 0.2735822  1.818367 -1.0792553
           [,8]      [,9]    [,10]     [,11]      [,12]     [,13]      [,14]
row3 -1.0786804  1.956105 1.340506 -1.786616 -0.3383109  1.310397 0.99681679
row1 -0.3408295 -0.213272 0.236658 -1.309128 -0.8863597 -2.066580 0.08998083
         [,15]     [,16]     [,17]     [,18]      [,19]    [,20]
row3  1.337391 -2.649677  0.233197 1.1989532 -0.2829885 1.693370
row1 -1.353423 -1.285064 -1.627476 0.9005792 -0.6217863 0.121298
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
          [,1]       [,2]       [,3]       [,4]      [,5]       [,6]      [,7]
row2 0.6203542 -0.3750584 -0.5392414 -0.4498806 -1.991409 -0.6161807 0.2769299
           [,8]       [,9]       [,10]
row2 -0.6569875 -0.6184937 0.005864714
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
          [,1]       [,2]      [,3]       [,4]     [,5]       [,6]      [,7]
row5 0.1156895 -0.5979248 0.7633919 -0.9205637 2.193276 -0.7402234 -1.125422
           [,8]      [,9]     [,10]    [,11]      [,12]      [,13]    [,14]
row5 -0.2060966 -1.105155 0.5659864 1.412838 -0.7799442 -0.1759786 1.771747
         [,15]      [,16]      [,17]      [,18]     [,19]    [,20]
row5 -1.247402 -0.3358135 -0.6371186 -0.6677512 -1.758485 -1.06276
> 
> 
> 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: 0x61c2021c88b0>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1ca14a71828c7f"
 [2] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1ca14a3371f0f4"
 [3] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1ca14a3b47b202"
 [4] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1ca14a6ae79172"
 [5] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1ca14a37c876d1"
 [6] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1ca14a2e278cee"
 [7] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1ca14a623c30f0"
 [8] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1ca14a5e4ea48b"
 [9] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1ca14a4d17a17c"
[10] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1ca14a37370df4"
[11] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1ca14a5a7db547"
[12] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1ca14a767caac8"
[13] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1ca14a1b8cc6a3"
[14] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1ca14a52ce20b5"
[15] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1ca14a169bc7d1"
> 
> 
> ### 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: 0x61c201bf59a0>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x61c201bf59a0>
Warning message:
In dir.create(new.directory) :
  '/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x61c201bf59a0>
> rowMedians(tmp)
  [1]  0.431688092 -0.383415540 -0.192364899  0.053808312  0.258721600
  [6]  0.410529140 -0.112976375 -0.081111280  0.039178703 -0.255137169
 [11]  0.037537923  0.061067843 -0.206256315 -0.315769278 -0.016586437
 [16] -0.482547838 -0.138077679 -0.186047057 -0.171834150 -0.055479460
 [21]  0.300472398 -0.326853460  0.220486864 -0.520418442  0.273380402
 [26] -0.396637283  0.256460825 -0.602166862  0.145062352 -0.062545011
 [31]  0.268144052  0.116485342 -0.172231743 -0.483309539 -0.233798485
 [36] -0.159780572 -0.547532245 -0.162287767 -0.439812756  0.275886451
 [41] -0.425686375 -0.161833306 -0.443049114  0.088097545  0.109856179
 [46]  0.140236141 -0.320410335 -0.148550897  0.017600276  0.383215442
 [51] -0.105941126 -0.332052096  0.087997287 -0.260832912  0.363558549
 [56] -0.345164848  0.182480907 -0.389763289  0.003605743 -0.432845342
 [61] -0.810432777  0.125373818 -0.385967141  0.490175128 -0.141339922
 [66] -0.032844301 -0.147623987  0.257844282  0.248578156 -0.445983405
 [71]  0.205722583 -0.051123729 -0.196760873 -0.830328555 -0.709502263
 [76] -0.167318142  0.463507364 -0.059939680 -0.378518838  0.277024321
 [81]  0.900043610  0.139795895  0.102698086 -0.116355983  0.016514118
 [86] -0.635589528  0.097721120  0.214754513  0.121647049  0.234677362
 [91] -0.100856404 -0.004797388 -0.060805671  0.182667727 -0.481199298
 [96] -0.251526559  0.596959327 -0.408910298 -0.269416199  0.225213617
[101]  0.115015565  0.483501042  0.133150781  0.388822605 -0.181368522
[106]  0.155105754 -0.170613509 -0.584077777 -0.291919703  0.296449132
[111] -0.107444178 -0.168627580 -0.033795557 -0.187520630  0.150749925
[116]  0.149442378  0.653005207 -0.646234888 -0.354084710 -0.521563735
[121] -0.141996479 -0.267536388  0.070553498  0.081181477 -0.130403470
[126] -0.225851069  0.009287671 -0.194510689 -0.135180662 -0.244731607
[131] -0.252072625 -0.133744609 -0.025104696 -0.208917895 -0.564102897
[136]  0.145030159 -0.011588584  0.221458033  0.049892535 -0.270132617
[141]  0.199337146  0.454629827 -0.015852412 -0.185503480 -0.235952335
[146]  0.001763020  0.519970859  0.233445814  0.613717531  0.144617208
[151] -0.203934596 -0.001109759  0.140307833  0.242471299 -0.359215768
[156] -0.327739167 -0.311888542 -0.561575594 -0.469534571 -0.232156402
[161]  0.118066289  0.128154057  0.510668999 -0.301074081  0.164217434
[166]  0.281421260 -0.392886800 -0.568989888  0.271523678 -0.189755246
[171] -0.124052567  0.323571738 -0.067109790 -0.627570833 -0.526408156
[176] -0.347028101 -0.011677714  0.113921933  0.583749992  0.194388119
[181]  0.443549985  0.008981113  0.312789899  0.478941565  0.371565305
[186]  0.176890841 -0.161528658  0.530576688  0.114492150  0.405385400
[191] -0.103559498 -0.125539440  0.293879394 -0.326032836  0.010608309
[196] -0.102357987  0.079788832 -0.082474716  0.300508052 -0.045537068
[201]  0.200736577 -0.273664262  0.422211374  0.344466887 -0.018451914
[206]  0.569222378 -0.475114727 -0.144788088 -0.500066700 -0.138057047
[211] -0.090453831  0.390165405  0.083699747  0.345267858  0.443468074
[216]  0.124935575 -0.261279456 -0.187908066  0.310392641  0.511083719
[221]  0.260485748  0.085765986 -0.447408343 -0.367031259  0.464788398
[226] -0.176498655  0.058595169 -0.239750027  0.001836498 -0.218432322
> 
> proc.time()
   user  system elapsed 
  1.298   1.443   2.730 

BufferedMatrix.Rcheck/tests/rawCalltesting.Rout


R Under development (unstable) (2026-03-05 r89546) -- "Unsuffered Consequences"
Copyright (C) 2026 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu

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: 0x5b1e60e86ff0>
> .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: 0x5b1e60e86ff0>
> .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: 0x5b1e60e86ff0>
> .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: 0x5b1e60e86ff0>
> 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: 0x5b1e60b32710>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5b1e60b32710>
> .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: 0x5b1e60b32710>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5b1e60b32710>
> .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: 0x5b1e60b32710>
> 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: 0x5b1e60e963f0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5b1e60e963f0>
> .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: 0x5b1e60e963f0>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x5b1e60e963f0>
> .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: 0x5b1e60e963f0>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x5b1e60e963f0>
> .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: 0x5b1e60e963f0>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x5b1e60e963f0>
> .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: 0x5b1e60e963f0>
> 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: 0x5b1e605cd8c0>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x5b1e605cd8c0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5b1e605cd8c0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5b1e605cd8c0>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile1ca1f3151b7e61" "BufferedMatrixFile1ca1f34e6d12a" 
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile1ca1f3151b7e61" "BufferedMatrixFile1ca1f34e6d12a" 
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x5b1e602f9e30>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5b1e602f9e30>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x5b1e602f9e30>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x5b1e602f9e30>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x5b1e602f9e30>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x5b1e602f9e30>
> .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: 0x5b1e61455790>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5b1e61455790>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x5b1e61455790>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x5b1e61455790>
> 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: 0x5b1e60840860>
> .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: 0x5b1e60840860>
> rm(P)
> 
> proc.time()
   user  system elapsed 
  0.242   0.049   0.281 

BufferedMatrix.Rcheck/tests/Rcodetesting.Rout


R Under development (unstable) (2026-03-05 r89546) -- "Unsuffered Consequences"
Copyright (C) 2026 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu

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.246   0.038   0.270 

Example timings